text:
<!--
  ~ Copyright 2013 - 2014 The Original Authors
  ~
  ~ Licensed 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.
  -->

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.elasticsoftwarefoundation.elasticactors-systems</groupId>
    <artifactId>elasticactors-systems</artifactId>
    <version>6.1.1-SNAPSHOT</version>

    <packaging>pom</packaging>

    <name>Elastic Software Foundation :: ElasticActors :: Systems</name>
    <description>Current useful implementations (plugins / extensions) of Elastic Actors</description>
    <url>https://github.com/elasticsoftwarefoundation/elasticactors-systems</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Joost van de Wijgerd</name>
            <email>jwijgerd@gmail.com</email>
            <organization>Elastic Software Foundation</organization>
            <organizationUrl>https://elasticsoftwarefoundation.org</organizationUrl>
        </developer>
        <developer>
            <name>Andre Brait</name>
            <email>andrebrait@gmail.com</email>
            <organization>Elastic Software Foundation</organization>
            <organizationUrl>https://elasticsoftwarefoundation.org</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <elasticactors.version>6.1.1</elasticactors.version>
        <slf4j.version>1.7.32</slf4j.version>
        <spring.version>5.3.12</spring.version>
        <grizzly.version>2.4.4</grizzly.version>
        <aspectj.version>1.9.7</aspectj.version>

        <async-http-client.version>2.1.2</async-http-client.version>
        <netty.version>3.10.6.Final</netty.version>
        <netty4.version>4.1.70.Final</netty4.version>
        <reactive-streams.version>1.0.3</reactive-streams.version>
        <guava.version>30.1.1-jre</guava.version>

        <!-- testing -->
        <testng-version>7.1.0</testng-version>
        <mockito.version>3.3.3</mockito.version>
    </properties>

    <scm>
        <connection>scm:git:git@github.com:elasticsoftwarefoundation/elasticactors-systems.git</connection>
        <developerConnection>
            scm:git:git@github.com:elasticsoftwarefoundation/elasticactors-systems.git
        </developerConnection>
        <url>https://github.com/elasticsoftwarefoundation/elasticactors-systems</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.elasticsoftwarefoundation.elasticactors</groupId>
                <artifactId>elasticactors-bom</artifactId>
                <version>${elasticactors.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava-bom</artifactId>
                <version>${guava.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-bom</artifactId>
                <version>${netty4.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.grizzly</groupId>
                <artifactId>grizzly-framework</artifactId>
                <version>${grizzly.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.asynchttpclient</groupId>
                <artifactId>async-http-client</artifactId>
                <version>${async-http-client.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.reactivestreams</groupId>
                <artifactId>reactive-streams</artifactId>
                <version>${reactive-streams.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>${spring.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.elasticsoftwarefoundation.elasticactors-systems</groupId>
                <artifactId>elasticactors-broadcast-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng-version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.yaml</groupId>
                        <artifactId>snakeyaml</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Common Elastic Actors -->
        <dependency>
            <groupId>org.elasticsoftwarefoundation.elasticactors</groupId>
            <artifactId>elasticactors-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.elasticsoftwarefoundation.elasticactors</groupId>
            <artifactId>elasticactors-base</artifactId>
        </dependency>
        <dependency>
            <groupId>org.elasticsoftwarefoundation.elasticactors</groupId>
            <artifactId>elasticactors-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.elasticsoftwarefoundation.elasticactors</groupId>
            <artifactId>elasticactors-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>http</module>
        <module>geoevents</module>
        <module>broadcast</module>
        <module>master-service</module>
        <module>broadcast-api</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <source>8</source>
                        <excludePackageNames>org.elasticsoftware.elasticactors.serialization.protobuf:org.elasticsoftware.elasticactors.cluster.protobuf</excludePackageNames>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>*.xml</include>
                    <include>*.yaml</include>
                    <include>*.properties</include>
                    <include>META-INF/*</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>true</filtering>
                <directory>${basedir}/src/test/resources</directory>
                <includes>
                    <include>*.xml</include>
                    <include>*.properties</include>
                    <include>*.yaml</include>
                    <include>META-INF/*</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <fork>true</fork>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <!--
                        <meminitial>128m</meminitial> <maxmem>512m</maxmem>
                        <verbose>false</verbose>
                    -->
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <version>3.0.5</version>
                        </requireMavenVersion>
                        <requireJavaVersion>
                            <version>1.8</version>
                        </requireJavaVersion>
                        <banDuplicatePomDependencyVersions />
                        <dependencyConvergence />
                    </rules>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <systemProperties>
                    </systemProperties>
                    <parallel>both</parallel>
                    <threadCount>10</threadCount>
                    <reportFormat>plain</reportFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <shortRevisionLength>10</shortRevisionLength>
                    <buildNumberPropertyName>buildNr</buildNumberPropertyName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <archive>

                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <!--
                        <manifestEntries>
                            <Implementation-Version>
                                ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.r${buildNr}
                            </Implementation-Version>
                            <Implementation-Build>${buildNr}</Implementation-Build>
                        </manifestEntries>
                        -->
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.11.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-api</artifactId>
                        <version>1.11.2</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <goals>install</goals>
                    <!-- Prevents running the deploy goal during release:perform -->
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>maven-release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <!-- When running a release build from bamboo, maven forks the actual release build.
                     To ensure the build number property is available, we need to pass it via the arguments.
                     -->
                    <arguments>-DskipTests</arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>maven-release</id>
        </profile>
        <profile>
            <id>ci</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.simplify4u.plugins</groupId>
                        <artifactId>sign-maven-plugin</artifactId>
                        <version>0.3.1</version>
                        <configuration>
                            <skipNoKey>false</skipNoKey>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- attach sources -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>attach-source</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <configuration>
                                    <attach>true</attach>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
package io.quarkus.hibernate.orm.deployment;

import java.util.HashMap;
import java.util.Map;
import java.util.OptionalInt;

import io.quarkus.hibernate.orm.deployment.HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCache;

public class HibernateConfigUtil {

    /**
     * TODO: reuse the ones from QuarkusInfinispanRegionFactory as soon as they are made public.
     */
    private final static String EXPIRATION_MAX_IDLE = ".expiration.max-idle";
    private final static String MEMORY_OBJECT_COUNT = ".memory.object-count";
    private static final String HIBERNATE_CACHE_PREFIX = "hibernate.cache.";

    public static Map<String, String> getCacheConfigEntries(HibernateOrmConfigPersistenceUnit config) {
        Map<String, String> cacheRegionsConfigEntries = new HashMap<>();
        for (Map.Entry<String, HibernateOrmConfigPersistenceUnitCache> regionEntry : config.cache.entrySet()) {
            String regionName = regionEntry.getKey();
            HibernateOrmConfigPersistenceUnitCache cacheConfig = regionEntry.getValue();

            if (cacheConfig.expiration.maxIdle.isPresent()) {
                cacheRegionsConfigEntries.put(getCacheConfigKey(regionName, EXPIRATION_MAX_IDLE),
                        String.valueOf(cacheConfig.expiration.maxIdle.get().getSeconds()));
            }
            if (cacheConfig.memory.objectCount.isPresent()) {
                cacheRegionsConfigEntries.put(getCacheConfigKey(regionName, MEMORY_OBJECT_COUNT),
                        String.valueOf(cacheConfig.memory.objectCount.getAsLong()));
            }
        }

        return cacheRegionsConfigEntries;
    }

    private static String getCacheConfigKey(String regionName, String configKey) {
        return HIBERNATE_CACHE_PREFIX + regionName + configKey;
    }

    public static <T> OptionalInt firstPresent(OptionalInt first, OptionalInt second) {
        return first.isPresent() ? first : second;
    }
}

redpajama_set_name: RedPajamaGithub


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Humaria leucoloma var. ricciicola Corda

### Remarks
null


text:
import { Box, color, MagnifyingGlassIcon } from "@artsy/palette"
import Input from "Components/Input"
import { isEmpty } from "lodash"
import React from "react"
import styled from "styled-components"

const SearchButton = styled.button`
  position: absolute;
  right: 0;
  top: calc(50% + 3px);
  border: none;
  margin-top: -14px;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  background: none;
  padding: 0;

  :focus {
    background: ${color("purple100")};
    border-radius: 50%;

    svg > path {
      fill: ${color("white100")};
    }
  }
`

export const SearchInputContainer: React.ForwardRefExoticComponent<
  any
> = React.forwardRef((props, ref) => {
  return (
    <Box style={{ position: "relative" }}>
      <Input ref={ref} style={{ width: "100%" }} {...props} />
      <SearchButton
        onClick={event => {
          ;(event.target as HTMLElement).parentElement.blur()
          if (isEmpty(props.value)) {
            event.preventDefault()
          }
        }}
      >
        <MagnifyingGlassIcon />
      </SearchButton>
    </Box>
  )
})


text:
using System.Web.Mvc;
using log4net;

namespace Xyperico.Web.Mvc
{
  public class Controller : System.Web.Mvc.Controller
  {
    static protected ILog Logger { get; set; }

    public Controller()
    {
      Logger = LogManager.GetLogger(this.GetType());
    }

    protected virtual ActionResult RedirectToHome()
    {
      return Redirect("~/");
    }

    protected string ErrorMessage
    {
      get { return (string)TempData["ErrorMessage"]; }
      set { TempData["ErrorMessage"] = value; }
    }

    protected virtual ActionResult Error(string errorMessage, ActionResult action)
    {
      ErrorMessage = errorMessage;
      return action;
    }
  }
}


text:
#include "config.h"

#if ENABLE(INDEXED_DATABASE)
#include "JSIDBKey.h"

#include "IDBBindingUtilities.h"
#include "IDBKey.h"

using namespace JSC;

namespace WebCore {

JSValue toJS(ExecState* exec, JSDOMGlobalObject*, IDBKey* key)
{
    if (!key)
        return jsNull();

    switch (key->type()) {
    case IDBKey::NullType:
        return jsNull();
    case IDBKey::NumberType:
        return jsNumber(key->number());
    case IDBKey::StringType:
        return jsString(exec, key->string());
    // FIXME: Implement dates.
    }

    ASSERT_NOT_REACHED();
    return jsUndefined();
}

} // namespace WebCore

#endif // ENABLE(INDEXED_DATABASE)


text:
using System;
using UnityEngine;

namespace WellFired
{
	[USequencerEvent("Physics/Sleep Rigid Body"), USequencerEventHideDuration, USequencerFriendlyName("Sleep Rigid Body")]
	public class USSleepRigidBody : USEventBase
	{
		public override void FireEvent()
		{
			Rigidbody component = base.AffectedObject.GetComponent<Rigidbody>();
			if (!component)
			{
				Debug.Log("Attempting to Nullify a force on an object, but it has no rigid body from USSleepRigidBody::FireEvent");
				return;
			}
			component.Sleep();
		}

		public override void ProcessEvent(float deltaTime)
		{
		}

		public override void StopEvent()
		{
			this.UndoEvent();
		}

		public override void UndoEvent()
		{
			if (!base.AffectedObject)
			{
				return;
			}
			Rigidbody component = base.AffectedObject.GetComponent<Rigidbody>();
			if (!component)
			{
				return;
			}
			component.WakeUp();
		}
	}
}


text:
/* @flow */

"use strict";

var _classCallCheck = require("babel-runtime/helpers/class-call-check")["default"];

var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"];

exports.__esModule = true;

var _helpersNormalizeAst = require("../helpers/normalize-ast");

var _helpersNormalizeAst2 = _interopRequireDefault(_helpersNormalizeAst);

var _file = require("./file");

var _file2 = _interopRequireDefault(_file);

var Pipeline = (function () {
  function Pipeline() {
    _classCallCheck(this, Pipeline);
  }

  Pipeline.prototype.lint = function lint(code /*: string*/) {
    var opts /*:: ?: Object*/ = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    opts.code = false;
    opts.mode = "lint";
    return this.transform(code, opts);
  };

  Pipeline.prototype.pretransform = function pretransform(code /*: string*/, opts /*:: ?: Object*/) {
    var file = new _file2["default"](opts, this);
    return file.wrap(code, function () {
      file.addCode(code);
      file.parseCode(code);
      return file;
    });
  };

  Pipeline.prototype.transform = function transform(code /*: string*/, opts /*:: ?: Object*/) {
    var file = new _file2["default"](opts, this);
    return file.wrap(code, function () {
      file.addCode(code);
      file.parseCode(code);
      return file.transform();
    });
  };

  Pipeline.prototype.transformFromAst = function transformFromAst(ast, code /*: string*/, opts /*: Object*/) {
    ast = _helpersNormalizeAst2["default"](ast);

    var file = new _file2["default"](opts, this);
    return file.wrap(code, function () {
      file.addCode(code);
      file.addAst(ast);
      return file.transform();
    });
  };

  return Pipeline;
})();

exports["default"] = Pipeline;
module.exports = exports["default"];


text:
FileSystem
==========

This object represents a file system.

Properties
----------

- __name:__ The name of the file system. _(DOMString)_
- __root:__ The root directory of the file system. _(DirectoryEntry)_

Details
-------

The `FileSystem` object represents information about the file system. The name of the file system will be unique across the list of exposed file systems.  The root property contains a `DirectoryEntry` object which represents the root directory of the file system.

Supported Platforms
-------------------

- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- iOS

File System Quick Example
-------------------------

	function onSuccess(fileSystem) {
		console.log(fileSystem.name);
		console.log(fileSystem.root.name);
	}

	// request the persistent file system
	window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null);

Full Example
------------

    <!DOCTYPE html>

        <title>File System Example</title>

Example

File System


text:
package org.archboy.clobaframe.query.simplequery;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.archboy.clobaframe.common.collection.DefaultObjectMap;
import org.archboy.clobaframe.query.Query;
import org.archboy.clobaframe.common.collection.ObjectMap;
import org.springframework.util.Assert;

/**
 *
 * @author yang
 * @param <T>
 */
public class SimpleQuery<T> implements Query<T>{

	private Collection<T> collection;

	private List<Predicate> predicates = null;
	private List<Comparator<T>> comparators = null;

	private int limit;

	public SimpleQuery(Collection<T> collection) {
		this.collection = collection;
	}

	public static <T> Query<T> from(Collection<T> collection){
		Assert.notNull(collection);

		return new SimpleQuery<T>(collection);
	}

	@Override
	public Query<T> where(Predicate predicate) {
		Assert.notNull(predicate);

		if (predicates == null){
			predicates = new ArrayList<Predicate>();
		}
		predicates.add(predicate);
		return this;
	}

	@Override
	public Query<T> whereEquals(String key, Object value) {
		Assert.hasText(key);

		Predicate predicate = PredicateFactory.equals(key, value);
		return where(predicate);
	}

	@Override
	public Query<T> whereNotEquals(String key, Object value) {
		Assert.hasText(key);

		Predicate predicateEquals = PredicateFactory.equals(key, value);
		Predicate predicate = PredicateFactory.not(predicateEquals);
		return where(predicate);
	}

	@Override
	public Query<T> whereGreaterThan(String key, Object value) {
		Assert.hasText(key);

		Predicate predicate = PredicateFactory.greaterThan(key, value);
		return where(predicate);
	}

	@Override
	public Query<T> whereGreaterThanOrEqual(String key, Object value) {
		Assert.hasText(key);

		Predicate predicateLessThan = PredicateFactory.lessThan(key, value);
		Predicate predicate = PredicateFactory.not(predicateLessThan);
		return where(predicate);
	}

	@Override
	public Query<T> whereLessThan(String key, Object value) {
		Assert.hasText(key);

		Predicate predicate = PredicateFactory.lessThan(key, value);
		return where(predicate);
	}

	@Override
	public Query<T> whereLessThanOrEqual(String key, Object value) {
		Assert.hasText(key);

		Predicate predicateGreaterThan = PredicateFactory.greaterThan(key, value);
		Predicate predicate = PredicateFactory.not(predicateGreaterThan);
		return where(predicate);
	}

	@Override
	public Query<T> orderBy(String key) {
		Assert.hasText(key);

		Comparator<T> comparator = ComparatorFactory.build(key, true);
		return orderBy(comparator);
	}

	@Override
	public Query<T> orderByDesc(String key) {
		Assert.hasText(key);

		Comparator<T> comparator = ComparatorFactory.build(key, false);
		return orderBy(comparator);
	}

	@Override
	public Query<T> orderBy(Comparator<T> comparator) {
		Assert.notNull(comparator);

		if (comparators == null){
			comparators = new ArrayList<Comparator<T>>();
		}
		comparators.add(comparator);

		return this;
	}

	@Override
	public Query<T> limit(int size) {
		Assert.isTrue(size >0);
		this.limit = size;
		return this;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<T> list() {
		Collection<T> items = collection;

		if (predicates != null) {
			Predicate[] predicateArray = predicates.toArray(new Predicate[0]);
			Predicate predicate = PredicateFactory.and(predicateArray);
			items = (Collection<T>) CollectionUtils.select(items, predicate);
		}

		if (items.isEmpty() || comparators == null) {
			if (limit == 0) { // un-specify the limit size
				return new ArrayList<T>(items);
			} else {
				return copy(items, limit);
			}
		}

		Comparator<T>[] comparatorArray = (Comparator<T>[]) comparators.toArray(new Comparator[0]);
		Comparator<T> comparator = ComparatorFactory.combine(comparatorArray);

		List<T> result = new ArrayList<T>(items);
		Collections.sort(result, comparator);

		if (limit == 0) { // un-specify the limit size
			return result;
		} else {
			return copy(result, limit);
		}
	}

	private List<T> copy(Collection<T> items, int maxItems){
		int count = (maxItems > items.size() ? items.size() : maxItems);

		List<T> result = new ArrayList<T>(count);
		int done = 0;
		for(T t : items) {
			done++;
			if (done > count) {
				break;
			}
			result.add(t);
		}
		return result;
	}

	@Override
	public T first() {
		Collection<T> items = list();
		if (items.isEmpty()){
			return null;
		}else{
			return items.iterator().next();
		}
	}

	@Override
	public List<ObjectMap> select(String... keys) {
		Assert.notNull(keys);

		List<ObjectMap> result = new ArrayList<ObjectMap>();
		Collection<T> items = list();

		Set<String> names = new TreeSet<String>();
		Collections.addAll(names, keys);

		for (T item : items) {
			ObjectMap viewModel = Utils.Wrap(item, names);
			result.add(viewModel);
		}

		return result;
	}
}


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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.github.sinetastic</groupId>
	<artifactId>sinetastic-game</artifactId>
	<version>0.1</version>
	<build>
		<sourceDirectory>src</sourceDirectory>
		<resources>
			<resource>
				<directory>src</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>com.github.sinetastic.Engine</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id> <!-- this is used for inheritance merges -->
						<phase>package</phase> <!-- bind to the packaging phase -->
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
Example: Piecewise continuous function
======================================

Piecewise continuus functions can be tricky to fit. However, using the
:mod:`symfit` interface this process is made a lot easier. Suppose we want to
fit to the following model:

.. math:: f(x) = \begin{cases} x^2 - a x & \text{if}\quad x \leq x_0 \\
                               a x + b   & \text{otherwise}
                 \end{cases}

The script below gives an example of how to fit such a model:

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

This code prints::

    Parameter Value        Standard Deviation
    a         -4.780338e-02 None
    b         1.205443e+00 None
    x0        1.051163e+00 None
    Fitting status message: Optimization terminated successfully.
    Number of iterations:   18
    Regression Coefficient: 0.9849188499599985

.. figure:: ../_static/piecewise_continuous.png
   :width: 500px
   :alt: Continuous piecewise fit

Judging from this graph, another possible solution would have been to also
demand a continuous derivative at the point `x0`. This can be achieved by
setting the following constraints instead::

    constraints = [
        Eq(y1.diff(x).subs({x: x0}), y2.diff(x).subs({x: x0})),
        Eq(y1.subs({x: x0}), y2.subs({x: x0}))
    ]

This gives the following plot:

.. figure:: ../_static/piecewise_differentiable.png
   :width: 500px
   :alt: Differentiable fit to a piecewise function

and the following fit report::

    Parameter Value        Standard Deviation
    a         8.000000e-01 None
    b         -6.400000e-01 None
    x0        8.000000e-01 None
    Fitting status message: Optimization terminated successfully.
    Number of iterations:   3
    Regression Coefficient: 0.8558226069368662

The first fit is therefore the prevered one, but it does show you how easy it is
to set these constraints using :mod:`symfit`.


text:
package org.intellij.ibatis.provider;

import com.intellij.codeInsight.lookup.LookupValueFactory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider;
import com.intellij.psi.xml.XmlAttributeValue;
import com.intellij.util.ProcessingContext;
import com.intellij.openapi.project.Project;
import org.intellij.ibatis.IbatisManager;
import org.intellij.ibatis.dom.configuration.TypeHandler;
import org.intellij.ibatis.util.IbatisConstants;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * typeHandler reference provider
 *
 * @author linux_china@hotmail.com
 */
public class TypeHandlerReferenceProvider extends WrappedReferenceProvider {

    public TypeHandlerReferenceProvider(Project project) {
        super(new JavaClassReferenceProvider(project));
    }

    public static Map<String, TypeHandler> getAllTypeHandler(PsiElement psiElement) {
        IbatisManager manager = IbatisManager.getInstance();
        return manager.getAllTypeHandlers(psiElement);
    }

    @Override
    @NotNull
    public PsiReference[] getReferencesByElement(@NotNull final PsiElement psiElement, @NotNull ProcessingContext processingContext) {
        PsiReference[] references = myProvider.getReferencesByElement(psiElement,processingContext);
        if (references.length < 1) return references;
        return new PsiReference[]{new WrappedPsiReference(references[references.length - 1]) {
            public PsiElement resolve() {
                String className = getCanonicalText();
                if (!className.contains(".")) {  // type handler javaType
                    Map<String, TypeHandler> allTypeHandler = getAllTypeHandler(psiElement);
                    if (allTypeHandler.containsKey(className)) {
                        return allTypeHandler.get(className).getXmlTag();
                    }
                }
                return super.resolve();
            }

            public Object[] getVariants() {
                List<Object> variants = new ArrayList<Object>();
                List<Object> classNames = Arrays.asList(super.getVariants());
                variants.addAll(classNames);
                if (!getCanonicalText().contains(".")) {  //not  interal type handler
                    Map<String, TypeHandler> allTypeHandler = getAllTypeHandler(psiElement);
                    for (String javaType : allTypeHandler.keySet()) {
                        variants.add(LookupValueFactory.createLookupValue(javaType, IbatisConstants.TYPE_ALIAS));
                    }
                }
                return variants.toArray();
            }

            public String getCanonicalText() {
                XmlAttributeValue xmlAttributeValue = (XmlAttributeValue) getElement();
                return xmlAttributeValue.getValue();
            }

            public boolean isSoft() {
                return false;
            }
        }};
    }
}


text:
export MONGO_URL=mongodb://$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test
bash $METEORD_DIR/run_app.sh


text:
[![Build Status](https://travis-ci.org/mpclarkson/freshdesk-php-sdk.svg?branch=master)](https://travis-ci.org/mpclarkson/freshdesk-php-sdk)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mpclarkson/freshdesk-php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mpclarkson/freshdesk-php-sdk/?branch=master)
[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/5cb7004a-ac48-4fe2-88a4-79341e3c03d6.svg)](https://insight.sensiolabs.com/projects/5cb7004a-ac48-4fe2-88a4-79341e3c03d6)
[![Packagist](https://img.shields.io/packagist/v/mpclarkson/freshdesk-php-sdk.svg)](https://packagist.org/packages/mpclarkson/freshdesk-php-sdk)

This is a PHP 5.5+ SDK for the [Freshdesk](https://www.freshdesk.com) API v2.

If you have questions, please contact me or open an issue on GitHub.

## Quick Start
```phpg
require __DIR__ . '/vendor/autoload.php';
use \Freshdesk\Api;

$api = new Api("your_freshdesk_api_key", "your_freshdesk_domain");

$all = $api->tickets->all();
$some = $api->tickets->all(['page' => 2]);
$new = $api->tickets->create($data);
$updated = $api->tickets->update($data);
$api->tickets->delete($id);
$existing = $api->tickets->view($id);

//Responses are simple arrays, e.g.:
$id = $existing['id'];
$first = $all[0];

```

## Framework Integration

- Symfony - [FreshdeskBundle](https://github.com/mpclarkson/freshdesk-bundle)
- Laravel/Lumen - [Freshdesk Larvel Service Provider](https://github.com/mpclarkson/freshdesk-laravel) .

## Installation

To integrate this library into your application, use [Composer](https://getcomposer.org).

Add `mpclarkson/freshdesk-php-sdk` to your **composer.json** file:

```json
{
    "require": {
        "mpclarkson/freshdesk-php-sdk": "dev-master"
    }
}
```

Then run:

```bash
php composer.phar install
```

## API Overview

Full documentation is available [here](docs/ApiIndex.md)

### Getting started

Creating a new API instance is very easy. All you need is your Freshdesk
API key and your Freshdesk domain.

```php
require __DIR__ . '/vendor/autoload.php';
use \Freshdesk\Api;

$api = new Api("your_freshdesk_api_key", "your_freshdesk_domain");
```

### Resources

The available methods for each resource are available via a public
property on the api, for example:

```php
//Contacts
$contacts = $api->contacts->update($contactId, $data);

//Agents
$me = $api->agents->current();

//Companies
$company = $api->companies->create($data);

//Groups
$deleted = $api->groups->delete($groupId);

//Tickets
$ticket = $api->tickets->view($filters);

//Time Entries
$time = $api->timeEntries->all($ticket['id']);

//Conversations
$ticket = $api->conversations->note($ticketId, $data);

//Categories
$newCategory = $api->categories->create($data);

//Forums
$forum = $api->forums->create($categoryId, $data);

//Topics
$topics = $api->topics->monitor($topicId, $userId);

//Comments
$comment = $api->comments->create($forumId);

//Email Configs
$configs = $api->emailConfigs->all();

//Products
$product = $api->products->view($productId);

//Business Hours
$hours = $api->businessHours->all();

//SLA Policy
$policies = $api->slaPolicies->all();

```

### Responses

All responses are arrays of data. Please refer to Freshdesk's documentation
for further information.

### Filtering

All `GET` requests accept an optional `array $query` parameter to filter
results. For example:

```php
//Page 2 with 50 results per page
$page2 = $this->forums->all(['page' => 2, 'per_page' => 50]);

//Tickets for a specific customer
$tickets = $this->tickets->view(['company_id' => $companyId]);

```

Please read the Freshdesk documentation for further information on
filtering `GET` requests.

## Contributing

This is a work in progress and PRs are welcome. Please read the
[contributing guide](.github/CONTRIBUTING.md).

Nearly all api calls are available except for the `Solutions` and `Surveys`,
which Freshdesk has not yet implemented.

- [ ] Solutions
- [ ] Surveys
- [ ] Uploading files is not yet supported
- [ ] More tests. You can never have enough!
- [ ] Nicer documentation

## Author

The library was written and maintained by [Matthew Clarkson](http://mpclarkson.github.io/)
from [Hilenium](https://hilenium.com).

## Reference

* [Freshdesk API Documentation](https://developer.freshdesk.com/api/)


text:
using CoinAPI.WebSocket.V1.DataModels;

namespace CoinAPI.WebSocket.V1
{
    public delegate void OHLCVEventHandler(object sender, OHLCV item);
    public delegate void OrderBookEventHandler(object sender, OrderBook item);
    public delegate void OrderBook5EventHandler(object sender, OrderBook item);
    public delegate void OrderBook20EventHandler(object sender, OrderBook item);
    public delegate void OrderBook50EventHandler(object sender, OrderBook item);
    public delegate void OrderBookL3EventHandler(object sender, OrderBookL3 item);
    public delegate void QuoteEventHandler(object sender, Quote item);
    public delegate void TradeEventHandler(object sender, Trade item);
    public delegate void VolumeEventHandler(object sender, Volume item);
    public delegate void ExchangeRateHandler(object sneder, ExchangeRate item);
    public delegate void TickerHandler(object sender, Ticker item);

    public interface ICoinApiWsClient
    {
        void SendHelloMessage(Hello helloMessage);
        long UnprocessedMessagesQueueSize { get; }
        event OHLCVEventHandler OHLCVEvent;
        event OrderBookEventHandler OrderBookEvent;
        event OrderBook5EventHandler OrderBook5Event;
        event OrderBook20EventHandler OrderBook20Event;
        event OrderBook50EventHandler OrderBook50Event;
        event OrderBookL3EventHandler OrderBookL3Event;
        event QuoteEventHandler QuoteEvent;
        event TradeEventHandler TradeEvent;
        event VolumeEventHandler VolumeEvent;
        event ExchangeRateHandler ExchangeRateEvent;
        event TickerHandler TickerEvent;
    }
}


text:
#include "util/run_cmd.h"
#include "util/tempfile.h"

#include <errno.h>
#include <limits.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

// Globals
static int g_tempdir_nonce = 0;

static int g_num_tempdirs = 0;

static char **g_tempdirs = NULL;

static pthread_mutex_t tempdir_lock = PTHREAD_MUTEX_INITIALIZER;

// Functions
static void cleanup_registered_tempdirs(void)
{
	int i;
	const char *skip_cleanup;
	skip_cleanup = getenv("SKIP_CLEANUP");
	if (skip_cleanup)
		return;
	pthread_mutex_lock(&tempdir_lock);
	for (i = 0; i < g_num_tempdirs; ++i) {
		remove_tempdir(g_tempdirs[i]);
		free(g_tempdirs[i]);
	}
	free(g_tempdirs);
	g_tempdirs = NULL;
	pthread_mutex_unlock(&tempdir_lock);
}

int get_tempdir(char *tempdir, int name_max, int mode)
{
	char tmp[PATH_MAX];
	int nonce, pid;
	const char *base = getenv("TMPDIR");
	if (!base)
		base = "/tmp";
	if (base[0] != '/') {
		// canonicalize non-abosolute TMPDIR
		if (realpath(base, tmp) == NULL) {
			return -errno;
		}
		base = tmp;
	}
	pthread_mutex_lock(&tempdir_lock);
	nonce = g_tempdir_nonce++;
	pthread_mutex_unlock(&tempdir_lock);
	pid = getpid();
	snprintf(tempdir, name_max, "%s/tempdir.%08d.%08d", base, pid, nonce);
	if (mkdir(tempdir, mode) == -1) {
		int ret = errno;
		return -ret;
	}
	return 0;
}

int register_tempdir_for_cleanup(const char *tempdir)
{
	char **tempdirs;
	pthread_mutex_lock(&tempdir_lock);
	tempdirs = realloc(g_tempdirs, sizeof(char*) * (g_num_tempdirs + 1));
	if (!tempdirs)
		return -ENOMEM;
	g_tempdirs = tempdirs;
	g_tempdirs[g_num_tempdirs] = strdup(tempdir);
	if (g_num_tempdirs == 0)
		atexit(cleanup_registered_tempdirs);
	g_num_tempdirs++;
	pthread_mutex_unlock(&tempdir_lock);
	return 0;
}

void unregister_tempdir_for_cleanup(const char *tempdir)
{
	int i;
	char **tempdirs;
	pthread_mutex_lock(&tempdir_lock);
	if (g_num_tempdirs == 0) {
		pthread_mutex_unlock(&tempdir_lock);
		return;
	}
	for (i = 0; i < g_num_tempdirs; ++i) {
		if (strcmp(g_tempdirs[i], tempdir) == 0)
			break;
	}
	if (i == g_num_tempdirs) {
		pthread_mutex_unlock(&tempdir_lock);
		return;
	}
	free(g_tempdirs[i]);
	g_tempdirs[i] = g_tempdirs[g_num_tempdirs - 1];
	tempdirs = realloc(g_tempdirs, sizeof(char*) * g_num_tempdirs - 1);
	if (tempdirs) {
		g_tempdirs = tempdirs;
	}
	g_num_tempdirs--;
	pthread_mutex_unlock(&tempdir_lock);
}

void remove_tempdir(const char *tempdir)
{
	run_cmd("rm", "-rf", tempdir, (char*)NULL);
}


text:
Good linux knowhow, good shell scripting skills and the more you know or the more information you gathered about the board you are going to use the better. If it has a community forum, consider joining it.
They are usually an excellent source of information, which is especially useful when you get stuck somewhere.

### Build environment ###
It is highly recommended to set up your build environment on a Debian Jessie or Ubunutu 16.04 machine.
A VMware or VirtualBox on Windows is also an option. Then install a virtual machine with one of these two OS.
#### Note ####
In case you use Ubuntu, you may need to remove $forceyes from line 989 of

    /usr/sbin/multistrap

### A corresponding kernel with overlayfs and squashfs filesystems ###
You need the sources of the kernel, preferably the one which is used with a popular image for that particular board.
For Volumio 2 it has to be a kernel version 3.18 or higher because of the overlayfs filesystem.
Earlier versions __can__ be used, provided overlayfs has been backported.
This has been done by the volumio team for a number of board kernels like cubox, odroids and pine64.

If your kernel does not support overlayfs, consider porting it.
Refer to __<https://github.com/adilinden/overlayfs-patches/blob/master/README>__, which has patch sets for various older kernel versions.
Pick the one closest to the target version, you might be lucky and get away without a scratch :)
However, this is not always the case, so if the patch set does not work and throws errors, you may have to adapt the patch manually (or ask for help).

### A config file (xxx_defconfig) ###
This you need for compiling the kernel, preferably one as used with one of the popular images.
It is good practice to copy the defconfig to the boot directory, so you might find one there in one of the board images.
The config file does not have to have all options enabled, the reason to take it from a popular image (of course with a very similar or the same kernel version) is the fact that it has a lot of normal options people need already enabled, it just saves a lot of time.
The configuration is subject to optimization later, one could remove all options and drivers which nobody needs on a Volumio 2 image.
But as long as the drivers are compiled as modules there is no hurry, they won't get loaded anyway when not used.
When you are going to prepare the Volumio 2 image, we suggest you also copy the used defconfig to the boot folder, so people know which options you used.
If your popular image does not have the config in the boot directory, there is a slight chance you might get hold of it in  the running system, example for a pine64:

    modprobe configs
    cat /proc/config.gz | gunzip > pine64_defconfig

### A corresponding u-boot ###
Pre-compiled, including other related files like bootloader blobs, or the sources of the u-boot version to compile, including the config file to use.

### The partition layout for the boot image ###
Mainly to find out which sectors to put the u-boot and SPL files or other blobs.

### A UART-Interface ###
It is not a must, but we __highly__ recommend to use a UART-interface with your device.
It saves a lot of time and frustration being able to see the complete boot process, starting with u-boot displaying its messages.
Some devices have a proprietary interface, like the uart interface Hardkernel uses for all their devices.
A very popular device is the __adafruit USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi__, we also use it.

<img src="./img/uart-intfc.jpg">

You only need three wires: TX(white), RX(green) and GND(black).


text:
(function(){
    'use strict';

    angular.module('smartsys')
        .controller('PublicCtrl', function($rootScope,
                                        $state,
                                        $stateParams,
                                        $scope,
                                        $auth,
                                        $log,
                                        $translate,
                                        GlobalService,
                                        ProfileService,
                                        alertService){

            $rootScope.stylesheets = [

                {href: 'themes/'+$rootScope.config.activeTheme+'/assets/css/styles.css', type: 'text/css'}
            ];

            $rootScope.addStylesheet = function(stylesheet){
                $rootScope.stylesheets.push(stylesheet);
            };

            $scope.setWebIncludes = function(include){
                var url = 'themes/'+ $scope.config.activeTheme+'/includes/'+include+'.html';
                return url;
            };

            $scope.header = $scope.setWebIncludes('header');
            $scope.footer = $scope.setWebIncludes('footer');

            $scope.currentLocale = null;

            $scope.getSopportedLocales = function(){
                var promise = GlobalService.getSopportedLocales();
                promise.then(
                    function(data){
                        $scope.sopportedLocales = data.sopportedLocales;
                        $scope.currentLocale = data.currentLocale;
                        $translate.use($scope.currentLocale);
                    },
                    function(error){
                        alertService.add('error', error);
                    });
            };
            $scope.getSopportedLocales();
        });
})();


text:
package com.biubike.util;

import com.baidu.mapapi.model.LatLng;

/**
 * Created by gaolei on 17/3/
 */

public class LocationManager {

    LatLng currentLL;
    String address;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public LatLng getCurrentLL() {
        return currentLL;
    }

    public void setCurrentLL(LatLng currentLL) {
        this.currentLL = currentLL;
    }

    public static LocationManager getInstance() {
        return SingletonFactory.singletonInstance;
    }

    private static class SingletonFactory {
        private static LocationManager singletonInstance = new LocationManager();
    }
}


text:
def command():
    return "describe-platform"

def init_argument(parser):
    parser.add_argument("--platform-no", required=True)

def execute(requester, args):
    platform_no = args.platform_no

    parameters = {}
    parameters["PlatformNo"] = platform_no

    return requester.execute("/DescribePlatform", parameters)


text:
<?php
/*
	@author dhtmlx.com
	@license GPL, see license.txt
*/
require_once("base_connector.php");
require_once("data_connector.php");

/*! DataItem class for Scheduler component
**/
class SchedulerDataItem extends DataItem{
	/*! return self as XML string
	*/
	function to_xml(){
		if ($this->skip) return "";

		$str="<event id='".$this->get_id()."' >";
		$str.="<start_date><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]></start_date>";
		$str.="<end_date><![CDATA[".$this->data[$this->config->text[1]["name"]]."]]></end_date>";
		$str.="<text><![CDATA[".$this->data[$this->config->text[2]["name"]]."]]></text>";
		for ($i=3; $i<sizeof($this->config->text); $i++){
			$extra = $this->config->text[$i]["name"];
			$str.="<".$extra."><![CDATA[".$this->data[$extra]."]]></".$extra.">";
		}
		if ($this->userdata !== false)
			foreach ($this->userdata as $key => $value)
				$str.="<".$key."><![CDATA[".$value."]]></".$key.">";

		return $str."</event>";
	}
}

/*! Connector class for dhtmlxScheduler
**/
class SchedulerConnector extends Connector{

	protected $extra_output="";//!< extra info which need to be sent to client side
	protected $options=array();//!< hash of OptionsConnector

	/*! assign options collection to the column

		@param name
			name of the column
		@param options
			array or connector object
	*/
	public function set_options($name,$options){
		if (is_array($options)){
			$str="";
			foreach($options as $k => $v)
				$str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
			$options=$str;
		}
		$this->options[$name]=$options;
	}

	/*! constructor

		Here initilization of all Masters occurs, execution timer initialized
		@param res
			db connection resource
		@param type
			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
		@param item_type
			name of class, which will be used for item rendering, optional, DataItem will be used by default
		@param data_type
			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
	 * @param render_type
			name of class which will be used for rendering.
	*/
	public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){
		if (!$item_type) $item_type="SchedulerDataItem";
		if (!$data_type) $data_type="SchedulerDataProcessor";
		if (!$render_type) $render_type="RenderStrategy";
		parent::__construct($res,$type,$item_type,$data_type,$render_type);
	}

	//parse GET scoope, all operations with incoming request must be done here
	function parse_request(){
		parent::parse_request();
		if (count($this->config->text)){
			if (isset($_GET["to"]))
				$this->request->set_filter($this->config->text[0]["name"],$_GET["to"],"<");
			if (isset($_GET["from"]))
				$this->request->set_filter($this->config->text[1]["name"],$_GET["from"],">");
		}
	}
}

/*! DataProcessor class for Scheduler component
**/
class SchedulerDataProcessor extends DataProcessor{
	function name_data($data){
		if ($data=="start_date")
			return $this->config->text[0]["db_name"];
		if ($data=="id")
			return $this->config->id["db_name"];
		if ($data=="end_date")
			return $this->config->text[1]["db_name"];
		if ($data=="text")
			return $this->config->text[2]["db_name"];

		return $data;
	}
}

class JSONSchedulerDataItem extends SchedulerDataItem{
	/*! return self as XML string
	*/
	function to_xml(){
		if ($this->skip) return "";

		$obj = array();
		$obj['id'] = $this->get_id();
		$obj['start_date'] = $this->data[$this->config->text[0]["name"]];
		$obj['end_date'] = $this->data[$this->config->text[1]["name"]];
		$obj['text'] = $this->data[$this->config->text[2]["name"]];
		for ($i=3; $i<sizeof($this->config->text); $i++){
			$extra = $this->config->text[$i]["name"];
			$obj[$extra]=$this->data[$extra];
		}

		if ($this->userdata !== false)
			foreach ($this->userdata as $key => $value)
				$obj[$key]=$value;

		return $obj;
	}
}

class JSONSchedulerConnector extends SchedulerConnector {

	protected $data_separator = ",";

	/*! constructor

		Here initilization of all Masters occurs, execution timer initialized
		@param res
			db connection resource
		@param type
			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
		@param item_type
			name of class, which will be used for item rendering, optional, DataItem will be used by default
		@param data_type
			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default.
	*/
	public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){
		if (!$item_type) $item_type="JSONSchedulerDataItem";
		if (!$data_type) $data_type="SchedulerDataProcessor";
		if (!$render_type) $render_type="JSONRenderStrategy";
		parent::__construct($res,$type,$item_type,$data_type,$render_type);
	}

	protected function xml_start() {
		return '{ "data":';
	}

	protected function xml_end() {
		$this->fill_collections();
		$end = (!empty($this->extra_output)) ? ', "collections": {'.$this->extra_output.'}' : '';
		foreach ($this->attributes as $k => $v)
			$end.=", \"".$k."\":\"".$v."\"";
		$end .= '}';
		return $end;
	}

	/*! assign options collection to the column

		@param name
			name of the column
		@param options
			array or connector object
	*/
	public function set_options($name,$options){
		if (is_array($options)){
			$str=array();
			foreach($options as $k => $v)
				$str[]='{"id":"'.$this->xmlentities($k).'", "value":"'.$this->xmlentities($v).'"}';
			$options=implode(",",$str);
		}
		$this->options[$name]=$options;
	}

	/*! generates xml description for options collections

		@param list
			comma separated list of column names, for which options need to be generated
	*/
	protected function fill_collections($list=""){
		$options = array();
		foreach ($this->options as $k=>$v) {
			$name = $k;
			$option="\"{$name}\":[";
			if (!is_string($this->options[$name])){
				$data = json_encode($this->options[$name]->render());
				$option.=substr($data,1,-1);
			} else
				$option.=$this->options[$name];
			$option.="]";
			$options[] = $option;
		}
		$this->extra_output .= implode($this->data_separator, $options);
	}

	/*! output fetched data as XML
		@param res
			DB resultset
	*/
	protected function output_as_xml($res){
		$result = $this->render_set($res);
		if ($this->simple) return $result;

		$data=$this->xml_start().json_encode($result).$this->xml_end();

		if ($this->as_string) return $data;

		$out = new OutputWriter($data, "");
		$out->set_type("json");
		$this->event->trigger("beforeOutput", $this, $out);
		$out->output("", true, $this->encoding);
	}
}
?>


text:
describe StackerBee::Middleware::CloudStackAPI do
  let(:env) do
    StackerBee::Middleware::Environment.new(
      endpoint_name: 'endpoint-name'
    )
  end
  let(:middleware) do
    described_class.new(api_key: 'API-KEY', api_path: api_path)
  end
  let(:api_path) { '/my/path' }

  before do
    middleware.before(env)
  end

  describe 'request' do
    subject { env.request }

    its(:path) { should == '/my/path' }
  end

  describe 'params' do
    subject { env.request.params }
    its([:api_key])  { should eq 'API-KEY' }
    its([:response]) { should eq 'json' }
    its([:command])  { should eq 'endpoint-name' }
  end
end


text:
use baz::zed::bar;  //~ ERROR unresolved import
//~^ ERROR failed to resolve import

mod baz {}
mod zed {
    pub fn bar() { println!("bar3"); }
}
fn main(args: Vec<String>) { bar(); }


text:
/* eslint-disable */
'use strict';

if (typeof Peeracle === 'undefined') {
  var Peeracle = require('..');
}

describe('MetadataFile', function() {
});


text:
#pragma once
#include <aws/macie2/Macie2_EXPORTS.h>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace Macie2
{
namespace Model
{
  class AWS_MACIE2_API UpdateOrganizationConfigurationResult
  {
  public:
    UpdateOrganizationConfigurationResult();
    UpdateOrganizationConfigurationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    UpdateOrganizationConfigurationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

  };

} // namespace Model
} // namespace Macie2
} // namespace Aws


text: match 42:<EOLError descr="Indent expected"></EOLError>


text:
<?php

namespace Chamilo\Core\Repository\ContentObject\Rubric\Storage\Entity;

use Chamilo\Libraries\Architecture\ContextIdentifier;
use Doctrine\ORM\Mapping as ORM;

/**
 * Class RubricResult
 *
 * @package Chamilo\Core\Repository\ContentObject\Rubric\Storage\Entity
 *
 * @author - Sven Vanpoucke - Hogeschool Gent
 *
 * @ORM\Entity(repositoryClass="Chamilo\Core\Repository\ContentObject\Rubric\Storage\Repository\RubricResultRepository")
 *
 * @ORM\Table(
 *      name="repository_rubric_result",
 *      indexes={
 *          @ORM\Index(name="rrr_context", columns={"context_class", "context_id"}),
 *          @ORM\Index(name="rrr_attempt", columns={"result_id"}),
 *          @ORM\Index(name="rrr_target_user", columns={"target_user_id"}),
 *          @ORM\Index(name="rrr_attempt", columns={"result_id"})
 *      }
 * )
 */
class RubricResult
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer", nullable=false, length=10)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="context_class", type="string")
     */
    protected $contextClass;

    /**
     * @var int
     *
     * @ORM\Column(name="context_id", type="integer")
     */
    protected $contextId;

    /**
     * GUID for unique ID
     *
     * @var string
     *
     * @ORM\Column(name="result_id", type="guid")
     */
    protected $resultId;

    /**
     * @var int
     *
     * @ORM\Column(name="user_id", type="integer")
     */
    protected $evaluatorUserId;

    /**
     * @var int
     *
     * @ORM\Column(name="target_user_id", type="integer", nullable=true)
     */
    protected $targetUserId;

    /**
     * @var string
     *
     * @ORM\Column(name="comment", type="string", nullable=true)
     */
    protected $comment;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="time", type="datetime")
     */
    protected $time;

    /**
     * @var integer
     *
     * @ORM\Column(name="score", type="integer")
     */
    protected $score;

    /**
     * @var RubricData
     *
     * @ORM\ManyToOne(targetEntity="RubricData")
     * @ORM\JoinColumn(name="rubric_data_id", referencedColumnName="id")
     */
    protected $rubricData;

    /**
     * @var TreeNode
     *
     * @ORM\ManyToOne(targetEntity="TreeNode")
     * @ORM\JoinColumn(name="tree_node_id", referencedColumnName="id")
     */
    protected $treeNode;

    /**
     * @var Choice
     *
     * @ORM\ManyToOne(targetEntity="Choice")
     * @ORM\JoinColumn(name="choice_id", referencedColumnName="id")
     */
    protected $selectedChoice;

    /**
     * @var Level
     *
     * @ORM\ManyToOne(targetEntity="Level")
     * @ORM\JoinColumn(name="level_id", referencedColumnName="id")
     */
    protected $selectedLevel;

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @param int $id
     *
     * @return RubricResult
     */
    public function setId(int $id): RubricResult
    {
        $this->id = $id;

        return $this;
    }

    /**
     * @return string
     */
    public function getResultId(): ?string
    {
        return $this->resultId;
    }

    /**
     * @param string $resultId
     *
     * @return RubricResult
     */
    public function setResultId(string $resultId): RubricResult
    {
        $this->resultId = $resultId;

        return $this;
    }

    /**
     * @return RubricData
     */
    public function getRubricData(): ?RubricData
    {
        return $this->rubricData;
    }

    /**
     * @param RubricData $rubricData
     *
     * @return RubricResult
     */
    public function setRubricData(RubricData $rubricData): RubricResult
    {
        $this->rubricData = $rubricData;

        return $this;
    }

    /**
     * @return TreeNode
     */
    public function getTreeNode(): ?TreeNode
    {
        return $this->treeNode;
    }

    /**
     * @param TreeNode $treeNode
     *
     * @return RubricResult
     */
    public function setTreeNode(TreeNode $treeNode): RubricResult
    {
        $this->treeNode = $treeNode;

        return $this;
    }

    /**
     * @return float
     */
    public function getScore(): ?float
    {
        if (is_null($this->score))
        {
            return null;
        }
        return $this->score / 100;
    }

    /**
     * @param float|null $score
     *
     * @return RubricResult
     */
    public function setScore(?float $score): RubricResult
    {
        if (is_null($score))
        {
            $this->score = null;
            return $this;
        }

        $this->score = (int) round($score * 100);
        return $this;
    }

    /**
     * @return Choice
     */
    public function getSelectedChoice(): ?Choice
    {
        return $this->selectedChoice;
    }

    /**
     * @param Choice $selectedChoice
     *
     * @return RubricResult
     */
    public function setSelectedChoice(Choice $selectedChoice = null): RubricResult
    {
        $this->selectedChoice = $selectedChoice;

        return $this;
    }

    /**
     * @return Level
     */
    public function getSelectedLevel(): ?Level
    {
        return $this->selectedLevel;
    }

    /**
     * @param Level $selectedLevel
     *
     * @return RubricResult
     */
    public function setSelectedLevel(Level $selectedLevel = null): RubricResult
    {
        $this->selectedLevel = $selectedLevel;

        return $this;
    }

    /**
     * @return string
     */
    public function getContextClass(): ?string
    {
        return $this->contextClass;
    }

    /**
     * @param string $contextClass
     *
     * @return RubricResult
     */
    public function setContextClass(string $contextClass): RubricResult
    {
        $this->contextClass = $contextClass;

        return $this;
    }

    /**
     * @return int
     */
    public function getContextId(): ?int
    {
        return $this->contextId;
    }

    /**
     * @param int $contextId
     *
     * @return RubricResult
     */
    public function setContextId(int $contextId): RubricResult
    {
        $this->contextId = $contextId;

        return $this;
    }

    /**
     * @param ContextIdentifier $contextIdentifier
     *
     * @return $this
     */
    public function setContextIdentifier(ContextIdentifier $contextIdentifier)
    {
        $this->setContextClass($contextIdentifier->getContextClass());
        $this->setContextId($contextIdentifier->getContextId());

        return $this;
    }

    /**
     * @return ContextIdentifier
     */
    public function getContextIdentifier()
    {
        return new ContextIdentifier($this->getContextClass(), $this->getContextId());
    }

    /**
     * @return int
     */
    public function getEvaluatorUserId(): ?int
    {
        return $this->evaluatorUserId;
    }

    /**
     * @param int $evaluatorUserId
     *
     * @return RubricResult
     */
    public function setEvaluatorUserId(int $evaluatorUserId): RubricResult
    {
        $this->evaluatorUserId = $evaluatorUserId;

        return $this;
    }

    /**
     * @return int
     *
     * @deprecated
     */
    public function getTargetUserId(): ?int
    {
        return $this->targetUserId;
    }

    /**
     * @param int $targetUserId
     *
     * @return RubricResult
     *
     * @deprecated - this is now written directly to a separate table
     */
    public function setTargetUserId(int $targetUserId): RubricResult
    {
        $this->targetUserId = $targetUserId;

        return $this;
    }

    /**
     * @return string
     */
    public function getComment(): ?string
    {
        return $this->comment;
    }

    /**
     * @param string $comment
     *
     * @return RubricResult
     */
    public function setComment(string $comment = null): RubricResult
    {
        $this->comment = $comment;

        return $this;
    }

    /**
     * @return \DateTime
     */
    public function getTime(): ?\DateTime
    {
        return $this->time;
    }

    /**
     * @param \DateTime $time
     *
     * @return RubricResult
     */
    public function setTime(\DateTime $time): RubricResult
    {
        $this->time = $time;

        return $this;
    }
}


text:
module Ci
  class BuildPrepareWorker
    include ApplicationWorker
    include PipelineQueue

    queue_namespace :pipeline_processing

    def perform(build_id)
      Ci::Build.find_by_id(build_id).try do |build|
        Ci::PrepareBuildService.new(build).execute
      end
    end
  end
end


text:
package io.volkan;

public class FinalizeTest {
    private boolean resourcesInUse;

    public synchronized void allocateResources() {
        performAllocate();
        resourcesInUse = true;
    }

    public synchronized void releaseResources() {
        performRelease();
        resourcesInUse = false;
    }

    @Override
    protected synchronized void finalize() throws Throwable {
        if (!resourcesInUse) {return;}

        releaseResources();
    }

    protected void performAllocate() {}
    protected void performRelease() {}
}


text:
package fixtures.lro;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines headers for putAsyncNoRetrySucceeded operation.
 */
public class LROsPutAsyncNoRetrySucceededHeaders {
    /**
     * Location to poll for result status: will be set to
     * /lro/putasync/noretry/succeeded/operationResults/200.
     */
    @JsonProperty(value = "Azure-AsyncOperation")
    private String azureAsyncOperation;

    /**
     * Location to poll for result status: will be set to
     * /lro/putasync/noretry/succeeded/operationResults/200.
     */
    @JsonProperty(value = "Location")
    private String location;

    /**
     * Get the azureAsyncOperation value.
     *
     * @return the azureAsyncOperation value
     */
    public String azureAsyncOperation() {
        return this.azureAsyncOperation;
    }

    /**
     * Set the azureAsyncOperation value.
     *
     * @param azureAsyncOperation the azureAsyncOperation value to set
     * @return the LROsPutAsyncNoRetrySucceededHeaders object itself.
     */
    public LROsPutAsyncNoRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) {
        this.azureAsyncOperation = azureAsyncOperation;
        return this;
    }

    /**
     * Get the location value.
     *
     * @return the location value
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location value.
     *
     * @param location the location value to set
     * @return the LROsPutAsyncNoRetrySucceededHeaders object itself.
     */
    public LROsPutAsyncNoRetrySucceededHeaders withLocation(String location) {
        this.location = location;
        return this;
    }

}


text:
package com.almondtools.stringbench.singlepattern.stringsearchalgorithms;

import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;

import net.amygdalum.stringsearchalgorithms.search.chars.ShiftOr;
import net.amygdalum.stringsearchalgorithms.search.chars.StringSearchAlgorithm;

@State(Scope.Thread)
public class SCShiftOrCharBenchmark extends StringSearchAlgorithmsCharBenchmark {

	private static final String ID = "StringSearchAlgorithms Shift-Or";

	@Override
	public String getId() {
		return ID;
	}

	@Override
	public StringSearchAlgorithm create(String pattern) {
		return new ShiftOr(pattern);
	}

}


text:
.ant-checkbox {
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  display: inline-block;
  line-height: 1;
  position: relative;
  vertical-align: middle;
}
.ant-checkbox-wrapper:hover .ant-checkbox .ant-checkbox-inner,
.ant-checkbox:hover .ant-checkbox-inner,
.ant-checkbox-focused .ant-checkbox-inner {
  border-color: #108ee9;
}
.ant-checkbox-inner {
  position: relative;
  top: 0;
  left: 0;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  background-color: #fff;
  -webkit-transition: all .3s;
  transition: all .3s;
}
.ant-checkbox-inner:after {
  -webkit-transform: rotate(45deg) scale(0);
      -ms-transform: rotate(45deg) scale(0);
          transform: rotate(45deg) scale(0);
  position: absolute;
  left: 4px;
  top: 1px;
  display: table;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  content: ' ';
  -webkit-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6);
  transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6);
}
.ant-checkbox-input {
  position: absolute;
  left: 0;
  z-index: 1;
  cursor: pointer;
  opacity: 0;
  filter: alpha(opacity=0);
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
}
.ant-checkbox-indeterminate .ant-checkbox-inner:after {
  content: ' ';
  -webkit-transform: scale(1);
      -ms-transform: scale(1);
          transform: scale(1);
  position: absolute;
  left: 2px;
  top: 5px;
  width: 8px;
  height: 1px;
}
.ant-checkbox-checked .ant-checkbox-inner:after {
  -webkit-transform: rotate(45deg) scale(1);
      -ms-transform: rotate(45deg) scale(1);
          transform: rotate(45deg) scale(1);
  position: absolute;
  left: 4px;
  top: 1px;
  display: table;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  content: ' ';
  -webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
  transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
}
.ant-checkbox-checked .ant-checkbox-inner,
.ant-checkbox-indeterminate .ant-checkbox-inner {
  background-color: #108ee9;
  border-color: #108ee9;
}
.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after {
  -webkit-animation-name: none;
          animation-name: none;
  border-color: #ccc;
}
.ant-checkbox-disabled .ant-checkbox-inner {
  border-color: #d9d9d9 !important;
  background-color: #f3f3f3;
}
.ant-checkbox-disabled .ant-checkbox-inner:after {
  -webkit-animation-name: none;
          animation-name: none;
  border-color: #f3f3f3;
}
.ant-checkbox-disabled + span {
  color: #ccc;
  cursor: not-allowed;
}
.ant-checkbox-wrapper {
  cursor: pointer;
  font-size: 12px;
  display: inline-block;
}
.ant-checkbox-wrapper:not(:last-child) {
  margin-right: 8px;
}
.ant-checkbox-wrapper + span,
.ant-checkbox + span {
  padding-left: 8px;
  padding-right: 8px;
}
.ant-checkbox-group {
  font-size: 12px;
}
.ant-checkbox-group-item {
  display: inline-block;
}
@media \0screen {
  .ant-checkbox-checked .ant-checkbox-inner:before,
  .ant-checkbox-checked .ant-checkbox-inner:after {
    font-family: 'anticon';
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\e632";
    font-weight: bold;
    font-size: 8px;
    border: 0;
    color: #fff;
    left: 2px;
    top: 3px;
    position: absolute;
  }
}


text:
<?php

/**
 * Accordion item
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Adminhtml_Block_Widget_Accordion_Item extends Mage_Adminhtml_Block_Widget
{
    protected $_accordion;

    public function __construct()
    {
        parent::__construct();
    }

    public function setAccordion($accordion)
    {
        $this->_accordion = $accordion;
        return $this;
    }

    public function getTarget()
    {
        return ($this->getAjax()) ? 'ajax' : '';
    }

    public function getTitle()
    {
        $title  = $this->getData('title');
        $url    = $this->getContentUrl() ? $this->getContentUrl() : '#';
        $title  = 'getTarget().'">'.$title.'';

        return $title;
    }

    public function getContent()
    {
        $content = $this->getData('content');
        if (is_string($content)) {
            return $content;
        }
        if ($content instanceof Mage_Core_Block_Abstract) {
            return $content->toHtml();
        }
        return null;
    }

    public function getClass()
    {
        $class = $this->getData('class');
        if ($this->getOpen()) {
            $class.= ' open';
        }
        return $class;
    }

    protected function _toHtml()
    {
        $content = $this->getContent();
        $html = '
getHtmlId().'" class="'.$this->getClass().'">';
        $html.= $this->getTitle();
        $html.= '
';
        $html.= '
getHtmlId().'" class="'.$this->getClass().'">';
        $html.= $content;
        $html.= '
';
        return $html;
    }
}


text:
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function(config) {
  config.set({
    // base path, that will be used to resolve files and exclude
    basePath: '',

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      'src/bower_components/angular/angular.js',
      'src/bower_components/lodash/lodash.js',
      'src/bower_components/angular-mocks/angular-mocks.js',
      'src/bower_components/restangular/dist/restangular.js',
      'src/*.js',
      'src/directives/*.js',
      'src/services/*.js',
      'test/mock/**/*.js',
      'test/spec/**/*.js'
    ],

    // list of files / patterns to exclude
    exclude: [],

    // web server port
    port: 8080,

    // level of logging
    // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['PhantomJS'],

    reporters: ['dots'],

    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false
  });
};


text:
package com.hypebeast.sdk.api.exception;

/**
 * Created by hesk on 30/6/15.
 */
public class InternalServerError extends Exception {

    public InternalServerError() {
    }

    public InternalServerError(String detailMessage) {
        super(detailMessage);
    }

    public InternalServerError(String detailMessage, Throwable throwable) {
        super(detailMessage, throwable);
    }

    public InternalServerError(Throwable throwable) {
        super(throwable);
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="dark">#000000</color>
    <color name="light_blue">#0080FF</color>
    <color name="orange">#FF8800</color>
    <color name="bone">#FFD685</color>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Agency__c</name>
    <help>Edustaja, joka toimitti tai vahvisti hyväksynnän.</help>
    <relationshipLabel>Attribuutit</relationshipLabel>
    <label>Edustaja</label>
</CustomFieldTranslation>


text:
#include "wxstackedbarchart.h"
#include "wxchartcategoricalaxis.h"
#include "wxchartnumericalaxis.h"
#include <sstream>

wxStackedBarChart::Bar::Bar(wxDouble value,
                            const wxChartTooltipProvider::ptr tooltipProvider,
                            wxDouble x,
                            wxDouble y,
                            const wxColor &fillColor,
                            const wxColor &strokeColor,
                            int directions)
    : wxChartRectangle(x, y, tooltipProvider, wxChartRectangleOptions(fillColor, strokeColor, directions)),
    m_value(value)
{
}

bool wxStackedBarChart::Bar::HitTest(const wxPoint &point) const
{
    return ((point.y >= GetPosition().m_y) &&
        (point.y <= (GetPosition().m_y + GetHeight())));
}

wxDouble wxStackedBarChart::Bar::GetValue() const
{
    return m_value;
}

wxStackedBarChart::Dataset::Dataset()
{
}

const wxVector<wxStackedBarChart::Bar::ptr>& wxStackedBarChart::Dataset::GetBars() const
{
    return m_bars;
}

void wxStackedBarChart::Dataset::AppendBar(Bar::ptr column)
{
    m_bars.push_back(column);
}

wxStackedBarChart::wxStackedBarChart(wxChartsCategoricalData::ptr &data,
                                     const wxSize &size)
    : m_grid(
        wxPoint2DDouble(m_options.GetPadding().GetLeft(), m_options.GetPadding().GetRight()),
        size,
        wxChartCategoricalAxis::make_shared("x", data->GetCategories(), m_options.GetGridOptions().GetXAxisOptions()),
        wxChartNumericalAxis::make_shared("y", GetCumulativeMinValue(data->GetDatasets()), GetCumulativeMaxValue(data->GetDatasets()), m_options.GetGridOptions().GetYAxisOptions()),
        m_options.GetGridOptions()
        )
{
    const wxVector<wxChartsDoubleDataset::ptr>& datasets = data->GetDatasets();
    for (size_t i = 0; i < datasets.size(); ++i)
    {
        const wxChartsDoubleDataset& dataset = *datasets[i];
        Dataset::ptr newDataset(new Dataset());

        int border = wxTOP | wxBOTTOM;
        if (i == (datasets.size() - 1))
        {
            border |= wxRIGHT;
        }

        const wxVector<wxDouble>& datasetData = dataset.GetData();
        for (size_t j = 0; j < datasetData.size(); ++j)
        {
            std::stringstream tooltip;
            tooltip << datasetData[j];
            wxChartTooltipProvider::ptr tooltipProvider(
                new wxChartTooltipProviderStatic(data->GetCategories()[j], tooltip.str(), dataset.GetFillColor())
                );

            newDataset->AppendBar(Bar::ptr(new Bar(
                datasetData[j],
                tooltipProvider,
                25, 50,
                dataset.GetFillColor(), dataset.GetStrokeColor(),
                border
                )));
        }

        m_datasets.push_back(newDataset);
    }
}

wxStackedBarChart::wxStackedBarChart(wxChartsCategoricalData::ptr &data,
                                     const wxStackedBarChartOptions &options,
                                     const wxSize &size)
    : m_options(options),
    m_grid(
        wxPoint2DDouble(m_options.GetPadding().GetLeft(), m_options.GetPadding().GetRight()),
        size,
        wxChartCategoricalAxis::make_shared("x", data->GetCategories(), m_options.GetGridOptions().GetXAxisOptions()),
        wxChartNumericalAxis::make_shared("y", GetCumulativeMinValue(data->GetDatasets()), GetCumulativeMaxValue(data->GetDatasets()), m_options.GetGridOptions().GetYAxisOptions()),
        m_options.GetGridOptions()
        )
{
    const wxVector<wxChartsDoubleDataset::ptr>& datasets = data->GetDatasets();
    for (size_t i = 0; i < datasets.size(); ++i)
    {
        const wxChartsDoubleDataset& dataset = *datasets[i];
        Dataset::ptr newDataset(new Dataset());

        int border = wxTOP | wxBOTTOM;
        if (i == (datasets.size() - 1))
        {
            border |= wxRIGHT;
        }

        const wxVector<wxDouble>& datasetData = dataset.GetData();
        for (size_t j = 0; j < datasetData.size(); ++j)
        {
            std::stringstream tooltip;
            tooltip << datasetData[j];
            wxChartTooltipProvider::ptr tooltipProvider(
                new wxChartTooltipProviderStatic(data->GetCategories()[j], tooltip.str(), dataset.GetFillColor())
                );

            newDataset->AppendBar(Bar::ptr(new Bar(
                datasetData[j],
                tooltipProvider,
                25, 50,
                dataset.GetFillColor(), dataset.GetStrokeColor(),
                border
                )));
        }

        m_datasets.push_back(newDataset);
    }
}

const wxChartCommonOptions& wxStackedBarChart::GetCommonOptions() const
{
    return m_options.GetCommonOptions();
}

wxDouble wxStackedBarChart::GetCumulativeMinValue(const wxVector<wxChartsDoubleDataset::ptr>& datasets)
{
    wxDouble result = 0;

    size_t i = 0;
    while (true)
    {
        wxDouble sum = 0;
        bool stop = true;
        for (size_t j = 0; j < datasets.size(); ++j)
        {
            const wxChartsDoubleDataset& dataset = *datasets[j];
            if (i < dataset.GetData().size())
            {
                sum += dataset.GetData()[i];
                stop = false;
            }
        }
        if (sum < result)
        {
            result = sum;
        }
        if (stop)
        {
            break;
        }
        ++i;
    }

    return result;
}

wxDouble wxStackedBarChart::GetCumulativeMaxValue(const wxVector<wxChartsDoubleDataset::ptr>& datasets)
{
    wxDouble result = 0;

    size_t i = 0;
    while (true)
    {
        wxDouble sum = 0;
        bool stop = true;
        for (size_t j = 0; j < datasets.size(); ++j)
        {
            const wxChartsDoubleDataset& dataset = *datasets[j];
            if (i < dataset.GetData().size())
            {
                sum += dataset.GetData()[i];
                stop = false;
            }
        }
        if (sum > result)
        {
            result = sum;
        }
        if (stop)
        {
            break;
        }
        ++i;
    }

    return result;
}

void wxStackedBarChart::DoSetSize(const wxSize &size)
{
    wxSize newSize(
        size.GetWidth() - m_options.GetPadding().GetTotalHorizontalPadding(),
        size.GetHeight() - m_options.GetPadding().GetTotalVerticalPadding()
        );
    m_grid.Resize(newSize);
}

void wxStackedBarChart::DoFit()
{
    wxVector<wxDouble> widthOfPreviousDatasets;
    for (size_t i = 0; i < m_datasets[0]->GetBars().size(); ++i)
    {
        widthOfPreviousDatasets.push_back(0);
    }

    for (size_t i = 0; i < m_datasets.size(); ++i)
    {
        Dataset& currentDataset = *m_datasets[i];
        for (size_t j = 0; j < currentDataset.GetBars().size(); ++j)
        {
            Bar& bar = *(currentDataset.GetBars()[j]);

            wxPoint2DDouble upperLeftCornerPosition = m_grid.GetMapping().GetXAxis().GetTickMarkPosition(j + 1);
            upperLeftCornerPosition.m_x += widthOfPreviousDatasets[j];
            upperLeftCornerPosition.m_y += m_options.GetBarSpacing();
            wxPoint2DDouble bottomLeftCornerPosition = m_grid.GetMapping().GetXAxis().GetTickMarkPosition(j);
            bottomLeftCornerPosition.m_x += widthOfPreviousDatasets[j];
            bottomLeftCornerPosition.m_y -= m_options.GetBarSpacing();

            wxPoint2DDouble upperRightCornerPosition = m_grid.GetMapping().GetWindowPositionAtTickMark(j + 1, bar.GetValue());
            upperRightCornerPosition.m_x += widthOfPreviousDatasets[j];

            bar.SetPosition(upperLeftCornerPosition);
            bar.SetSize(upperRightCornerPosition.m_x - upperLeftCornerPosition.m_x,
                bottomLeftCornerPosition.m_y - upperLeftCornerPosition.m_y);

            widthOfPreviousDatasets[j] += (upperRightCornerPosition.m_x - upperLeftCornerPosition.m_x);
        }
    }
}

void wxStackedBarChart::DoDraw(wxGraphicsContext &gc,
                               bool suppressTooltips)
{
    m_grid.Fit(gc);
    m_grid.Draw(gc);

    Fit();

    for (size_t i = 0; i < m_datasets.size(); ++i)
    {
        Dataset& currentDataset = *m_datasets[i];
        for (size_t j = 0; j < currentDataset.GetBars().size(); ++j)
        {
            currentDataset.GetBars()[j]->Draw(gc);
        }
    }

    if (!suppressTooltips)
    {
        DrawTooltips(gc);
    }
}

wxSharedPtr<wxVector<const wxChartElement*> > wxStackedBarChart::GetActiveElements(const wxPoint &point)
{
    wxSharedPtr<wxVector<const wxChartElement*> > activeElements(new wxVector<const wxChartElement*>());

    for (size_t i = 0; i < m_datasets.size(); ++i)
    {
        const wxVector<Bar::ptr>& bars = m_datasets[i]->GetBars();
        for (size_t j = 0; j < bars.size(); ++j)
        {
            if (bars[j]->HitTest(point))
            {
                activeElements->push_back(bars[j].get());
            }
        }
    }

    return activeElements;
}


text:
A go application that extracts maven dependency information from pom files and outputs to the console.

##Usage

`
$ mavenDependencyList [searchPath]
`


text:
package aima.test.core.unit.agent.impl.aprog;

import aima.core.agent.Action;
import aima.core.agent.impl.SimpleAgent;
import aima.core.agent.impl.DynamicAction;
import aima.core.agent.impl.DynamicPercept;
import aima.core.agent.impl.aprog.TableDrivenAgentProgram;
import aima.test.core.unit.agent.impl.MockAgent;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.util.*;

/**
 * @author Ciaran O'Reilly
 * @author Ruediger Lunde
 *
 */
public class TableDrivenAgentProgramTest {

	private static final Action ACTION_1 = new DynamicAction("action1");
	private static final Action ACTION_2 = new DynamicAction("action2");
	private static final Action ACTION_3 = new DynamicAction("action3");

	private SimpleAgent<DynamicPercept, Action> agent;

	@Before
	public void setUp() {
		Map<List<DynamicPercept>, Action> perceptSequenceActions = new HashMap<>();
		perceptSequenceActions.put(createPerceptSequence(new DynamicPercept(
				"key1", "value1")), ACTION_1);
		perceptSequenceActions.put(
				createPerceptSequence(new DynamicPercept("key1", "value1"),
						new DynamicPercept("key1", "value2")), ACTION_2);
		perceptSequenceActions.put(
				createPerceptSequence(new DynamicPercept("key1", "value1"),
						new DynamicPercept("key1", "value2"),
						new DynamicPercept("key1", "value3")), ACTION_3);

		agent = new MockAgent<DynamicPercept, Action>(new TableDrivenAgentProgram<>(
				perceptSequenceActions));
	}

	@Test
	public void testExistingSequences() {
		Assert.assertEquals(Optional.of(ACTION_1),
				agent.act(new DynamicPercept("key1", "value1")));
		Assert.assertEquals(Optional.of(ACTION_2),
				agent.act(new DynamicPercept("key1", "value2")));
		Assert.assertEquals(Optional.of(ACTION_3),
				agent.act(new DynamicPercept("key1", "value3")));
	}

	@Test
	public void testNonExistingSequence() {
		Assert.assertEquals(Optional.of(ACTION_1),
				agent.act(new DynamicPercept("key1", "value1")));
		Assert.assertEquals(Optional.empty(),
				agent.act(new DynamicPercept("key1", "value3")));
	}

	private static List<DynamicPercept> createPerceptSequence(DynamicPercept... percepts) {
		return Arrays.asList(percepts);
	}
}


text:
import {Dictionary} from 'lodash';
import Task from './Task';

interface Filter {
    iconDisabledMap: Dictionary<boolean>;
    word?: string;
}

function createApplier(filter?: Filter): (task: Task) => boolean {
    return (task: Task): boolean => {
        if (!filter) {
            return true;
        }

        return (!filter.iconDisabledMap || !filter.iconDisabledMap[task.icon])
            && (!filter.word || !!task.name.match(new RegExp(filter.word, "i")));
    }
}

export default Filter;
export {
    createApplier
}


text:
using System;
using OpenADK.Library;

namespace OpenADK.Library.uk.Learner
{
	///
	/// Defines the set of values that can be specified whenever a Motivation
	/// is used as a parameter to a method or constructor.
	///
	/// <remarks>
	/// Alternatively, the static
	///  <see cref="Wrap"/> method can be called to encapsulate any string value in
	///  a Motivation object.
	/// <para>Author: Generated by adkgen</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.3</para>
	/// </remarks>
	[Serializable]
	public class Motivation : SifEnum
	{
	/// Other ("Other")
	public static readonly Motivation OTHER = new Motivation("Other");

	/// Sexual ("Sexual")
	public static readonly Motivation SEXUAL = new Motivation("Sexual");

	/// Racial ("Racial")
	public static readonly Motivation RACIAL = new Motivation("Racial");

	/// Religious ("Religious")
	public static readonly Motivation RELIGIOUS = new Motivation("Religious");

	/// Financial ("Financial")
	public static readonly Motivation FINANCIAL = new Motivation("Financial");

	///Wrap an arbitrary string value in a Motivation object.
	///<param name="wrappedValue">The element/attribute value.</param>
	///<remarks>This method does not verify
	///that the value is valid according to the SIF Specification</remarks>
	public static Motivation Wrap( String wrappedValue ) {
		return new Motivation( wrappedValue );
	}

	private Motivation( string enumDefValue ) : base( enumDefValue ) {}
	}
}


text:
+++
title = "Compilers"
date =  2017-10-15T01:12:14-04:00
weight = 1
+++

## Dragon Book

### Context Free Grammars

Defines a language and a corresponding set of structures.

Nonterminal - sets of strings of terminals
Terminal Symbols - base building blocks
Productions - a sequence of terminals and/or nonterminals

Examples: "The dog chased the cat"

Distinguished Symbol : S

Nonterminals: (S) Sentence, (NP) Noun Phrase, (VP) Verb Phrase, Det, (N) Noun, (V) Verb

Terminals: "the", "dog", "chased", "cat"

Productions:

* S -> NP VP
* NP -> Det N
* VP -> V NP
* Det -> "the"
* N -> "dog"
* V -> "chased"
* N -> "cat"

### Compilation Process

1. Character Stream
2. Lexical Analyzer
3. Token Stream
4. Syntax Analyzer
5. Syntax Tree
6. Semantic Analyzer
7. Intermediate Code Generator
8. Optimizer

The `Lexical Analyzer` reads a character stream and groups into a meaningful sequence called a `Lexeme`.

A `Lexeme` is a `tokenName, attributeValue` pair.

Example: `position = initial + rate * 60`

Lexemes:

{{% notice note %}}
The first part is practically the lexeme type and the second is a pointer to a lookup table where the `attributeValue` are stored.
{{% /notice %}}

1. "position" -> (id, 1)
2. "=" -> (=)
3. "initial" -> (id, 2)
4. "+" -> (+)
5. "rate" -> (id, 3)
6. "\*" -> (\*)
7. "60" -> (60)

#### Lookup Table

Index    | Value
--------|------
1     | position
2   | initial
3   | rate


text:
{-# LANGUAGE RecordWildCards #-}

module Vision.Freenect
  ( withKinect, withKinect'
  -- * Types
  , Depth
  , RunStatus(..), Config(..)
  ) where

import Control.Concurrent (threadDelay)
import Control.Monad.Fix
import Vision.Freenect.Convert
import Freenect
import Data.IORef

-- | A pseudo-boolean indicating whether the process should continue or halt.
data RunStatus = Stop | Continue deriving (Eq, Ord, Show, Read, Enum, Bounded)

-- | Structure for configuring the depth callback, method to acquire the
-- run status (stopping the callbacks), and amount of delay between frame
-- acquisition (in micro seconds, 100000 ~ 10fps).
data Config = Config { depthCallback :: Depth -> IO ()
                     , killSignal    :: IO RunStatus
                     , delayTime     :: Int
                     }

-- | @withKinect (\kill img -> f kill img)@ will call @f@ continually
-- until @f@ calls @kill@.  It is possible @f@ will be called after calling
-- @kill@, but the callbacks should stop \"soon\".  There should be at most
-- 10 callbacks per second (@delayTime=100000@).
withKinect :: (IO () -> Depth -> IO ()) -> IO ()
withKinect cb =
  do continueRef <- newIORef Continue
     let kill    = writeIORef continueRef Stop
         cb'     = cb kill
         killSig = readIORef continueRef
     withKinect' Config { depthCallback = cb'
                        , killSignal    = killSig
                        , delayTime     = 50000 -- max of 20fps
                        }

withKinect' :: Config -> IO ()
withKinect' (Config {..}) = do
    withContext $ \ctx -> do
       selectSubdevices ctx [Camera]
       withDevice ctx 0 $ \dev -> do
        setDepthMode dev Medium ElevenBit
        let myCallback v _ = depthCallback (depthToFriday v)
        setDepthCallback dev myCallback
        startDepth dev
        fix $ \cont -> do
                 c <- killSignal
                 if c == Continue
                  then threadDelay delayTime >> processEvents ctx >> cont
                  else return ()