text:
title: "Getting started with license-activated features"
linkTitle: "License-Activated Features"
description: "Get started with license-activated features in Sensu Go. Read this guide to learn about the latest license-activated features, and contact our sales team for a free trial."
version: "5.7"
weight: 2
product: "Sensu Go"
menu:
  sensu-go-5.7:
    parent: getting-started
---

Sensu Go offers license-activated features designed for monitoring at scale.
[Contact the Sensu sales team][1] for a personalized demo and free trial.
License-activated features are available for all Sensu Go packages and downloads.
See the [products page][3] for a complete feature comparison.

### License-activated features in Sensu Go

- **Manage your monitoring checks from your browser**: Create, edit, and delete checks using the Sensu [web UI](../../dashboard/overview).
- **Authentication providers**: Scale Sensu role-based access control with [LDAP and Active Directory integrations](../../installation/auth).
- **Resource filtering in the Sensu API and sensuctl command-line tool**: Designed for large installations, label and field selectors let you filter Sensu API and sensuctl responses using custom labels and resource attributes such as event status and check subscriptions.
- **Enterprise-tier assets**: Connect your monitoring event pipelines to industry-standard tools like ServiceNow and Jira with [enterprise-tier assets](https://bonsai.sensu.io/assets?tiers%5B%5D=4).
- **Enterprise-class support**: [Sensu support](https://sensu.io/support/) gives you the assurance that help is available if you need it. Our expert in-house team offers best-in-class support to help get you up and running smoothly.

### Contact us for a free trial

For a personalized demo and free trial of license-activated features in Sensu Go, [contact the Sensu sales team][1].
You can manage your Sensu account and contact support through [account.sensu.io][2].

- [Contact the Sensu sales team](https://sensu.io/sales/)
- [Log in to your Sensu account][2]
- [Contact Sensu support](https://account.sensu.io/support)

### Get started with license-activated features in Sensu Go

If you haven't already, [install the Sensu Go backend, agent, and sensuctl tool](../../installation/install-sensu) and [configure sensuctl](../../sensuctl/reference/#first-time-setup).

Log in to your Sensu account at [account.sensu.io](https://account.sensu.io/)
and download your license file using the "Download license" link.

_Sensu account: Download Sensu license._

{{< figure src="/images/go/commercial/license_download.png" alt="Screenshot of Sensu account license download" link="/images/go/commercial/license_download.png" target="_blank" >}}

With the license file downloaded, you can activate your license using sensuctl.

{{< highlight shell >}}
sensuctl create --file sensu_license.json
{{< /highlight >}}

You can use sensuctl to view your license details at any time.

{{< highlight shell >}}
sensuctl license info
{{< /highlight >}}

See these resources to get started using license-activated features in Sensu Go.

- [Set up authentication providers](../../installation/auth)
- [Get started with assets](../../guides/install-check-executables-with-assets)
- [Manage your Sensu license](../../reference/license)
- [Log in to your Sensu account](https://account.sensu.io)
- [Contact Sensu support](https://account.sensu.io/support)

[1]: https://sensu.io/sales/
[2]: https://account.sensu.io/
[3]: https://sensu.io/products


text:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisResult"
           table="GENE_DIFFERENTIAL_EXPRESSION_META_ANALYSIS_RESULT">
        <cache usage="read-write"/>
        <id name="id" type="java.lang.Long" unsaved-value="null">
            <column name="ID" sql-type="BIGINT"/>
            <generator class="native">
            </generator>
        </id>
        <property name="metaPvalue" type="java.lang.Double">
            <column name="META_PVALUE" not-null="false" unique="false" sql-type="DOUBLE"/>
        </property>
        <property name="metaQvalue" type="java.lang.Double">
            <column name="META_QVALUE" not-null="false" unique="false" sql-type="DOUBLE"/>
        </property>
        <property name="meanLogFoldChange" type="java.lang.Double">
            <column name="MEAN_LOG_FOLD_CHANGE" not-null="false" unique="false" sql-type="DOUBLE"/>
        </property>
        <property name="metaPvalueRank" type="java.lang.Double">
            <column name="META_PVALUE_RANK" not-null="false" unique="false" sql-type="DOUBLE"/>
        </property>
        <property name="upperTail" type="java.lang.Boolean">
            <column name="UPPER_TAIL" not-null="true" unique="false" sql-type="TINYINT"/>
        </property>
        <many-to-one name="gene" class="ubic.gemma.model.genome.Gene" lazy="proxy" fetch="select">
            <column name="GENE_FK" not-null="true" sql-type="BIGINT"/>
        </many-to-one>
        <set name="resultsUsed" table="METAANALYSES2RESULTS_USED" lazy="true" fetch="select">
            <key foreign-key="DIFFERENTIAL_EXPRESSION_ANALYSIS_RESULT_METAANALYSES_FKC">
                <column name="METAANALYSES_FK" sql-type="BIGINT"/>
            </key>
            <many-to-many class="ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysisResult">
                <column name="RESULTS_USED_FK" sql-type="BIGINT"/>
            </many-to-many>
        </set>
    </class>
</hibernate-mapping>

redpajama_set_name: RedPajamaGithub


text:
from cloudkitty.common.db.alembic import env  # noqa
from cloudkitty.db.sqlalchemy import models

target_metadata = models.Base.metadata
version_table = 'cloudkitty_alembic'

env.run_migrations_online(target_metadata, version_table)


text:
'use strict';

//Etc products service used to communicate Etc products REST endpoints
angular.module('etc-products').factory('EtcProducts', ['$resource',
	function($resource) {
		return $resource('etc-products/:etcProductId', { etcProductId: '@_id'
		}, {
			update: {
				method: 'PUT'
			}
		});
	}
]);


text:
import {
   append,
   asNumber,
   filterArray,
   filterFunction,
   filterHasLength,
   filterPlainObject,
   filterPrimitives,
   first,
   forEachLineWithContent,
   including,
   last,
   NOOP,
   toLinesWithContent,
} from '../../src/lib/utils';

describe('utils', () => {
   describe('array edges', () => {
      it.each<[string, any, string | number | undefined, string | undefined]>([
         ['string array', ['abc', 'def'], 'abc', 'def'],
         ['variadic array', [123, 'abc', 456, 'def'], 123, 'def'],
         ['non array', { foo: 'bar' }, undefined, undefined],
         ['array-like', { foo: 'bar', 0: 'abc', 2: 'def', length: 3 }, 'abc', 'def'],
      ])('picks first and last from %s', (_type, input, expectedFirst, expectedLast) => {
         expect(first(input)).toBe(expectedFirst);
         expect(last(input)).toBe(expectedLast);
      });

      it('picks first with offset', () => {
         const input = ['abc', 'def'];
         expect(first(input, 1)).toBe('def');
         expect(first(input, 2)).toBe(undefined);
      });

      it('picks last with offset', () => {
         const input = ['abc', 'def'];
         expect(last(input, 1)).toBe('abc');
         expect(last(input, 2)).toBe(undefined);
      });
   });

   describe('asNumber', () => {
      it('from nullables', () => {
         expect((asNumber as any)()).toBe(0);
         expect(asNumber(undefined)).toBe(0);
         expect(asNumber(undefined, 5)).toBe(5);
         expect(asNumber(null)).toBe(0);
         expect(asNumber(null, 5)).toBe(5);
      });

      it('from NaN', () => {
         expect(asNumber('hello')).toBe(0);
         expect(asNumber('hello', 5)).toBe(5);
      });
   });

   describe('content', () => {
      it('caters for empty values', () => {
         expect(toLinesWithContent()).toEqual([]);
         expect(toLinesWithContent(undefined, false)).toEqual([]);
         expect(toLinesWithContent('')).toEqual([]);
         expect(toLinesWithContent('', false)).toEqual([]);
      });

      it('filters lines with content', () => {
         expect(toLinesWithContent(' \n content \n\n')).toEqual(['content']);
         expect(toLinesWithContent(' \n content \n\n', false)).toEqual([' ', ' content ']);
      });

      it('maps lines with content', () => {
         expect(forEachLineWithContent(' \n content \n\n', (line) => line.toUpperCase())).toEqual([
            'CONTENT',
         ]);
      });
   });

   describe('arrays', () => {
      function test<T>(target: T[] | Set<T>, itemA: T, itemB: T) {
         expect(append(target, itemA)).toBe(itemA);
         expect(Array.from(target)).toEqual([itemA]);

         expect(append(target, itemB)).toBe(itemB);
         expect(Array.from(target)).toEqual([itemA, itemB]);

         expect(append(target, itemA)).toBe(itemA);
         expect(Array.from(target)).toEqual([itemA, itemB]);
      }

      it('appends objects into an array', () => {
         test([], { a: 1 }, { b: 1 });
      });

      it('appends primitives into an array', () => {
         test<string>([], 'A', 'B');
      });

      it('appends objects into a set', () => {
         test(new Set(), { a: 1 }, { b: 1 });
      });

      it('appends primitives into a set', () => {
         test(new Set(), 'A', 'B');
      });
   });

   describe('including', () => {
      it('does nothing when the item already exists', () => {
         const input = ['abc', 'foo', 'bar'];
         const output = including(input, 'foo');

         expect(input).toBe(output);
         expect(output).toEqual(['abc', 'foo', 'bar']);
      });

      it('appends when the item does not exist', () => {
         const input = ['abc', 'bar'];
         const output = including(input, 'foo');

         expect(input).toBe(output);
         expect(output).toEqual(['abc', 'bar', 'foo']);
      });
   });

   describe('argument filtering', () => {
      it('recognises arrays', () => {
         expect(filterArray([])).toBe(true);
         expect(filterArray({})).toBe(false);
         expect(filterArray(undefined)).toBe(false);
      });

      it('recognises primitives', () => {
         expect(filterPrimitives([])).toBe(false);
         expect(filterPrimitives({})).toBe(false);
         expect(filterPrimitives(undefined)).toBe(false);

         expect(filterPrimitives(123.456)).toBe(true);
         expect(filterPrimitives('hello world')).toBe(true);
         expect(filterPrimitives(false)).toBe(true);
         expect(filterPrimitives(true)).toBe(true);
      });

      it('recognises plain objects', () => {
         expect(filterPlainObject({})).toBe(true);
         expect(filterPlainObject(Object.create(null))).toBe(true);

         expect(filterPlainObject(NOOP)).toBe(false);
      });

      it('recognises functions', () => {
         expect(filterFunction(NOOP)).toBe(true);
         expect(filterFunction(() => {})).toBe(true);

         expect(filterFunction({})).toBe(false);
      });

      it('recognises entities with a length', () => {
         expect(filterHasLength([])).toBe(true);
         expect(filterHasLength('')).toBe(true);
         expect(filterHasLength({ length: 1 })).toBe(true);
         expect(filterHasLength(Buffer.from('hello', 'utf8'))).toBe(true);

         expect(filterHasLength({})).toBe(false);
         expect(filterHasLength({ length: false })).toBe(false);
         expect(filterHasLength(1)).toBe(false);
         expect(filterHasLength(true)).toBe(false);
         expect(filterHasLength(undefined)).toBe(false);
         expect(filterHasLength(null)).toBe(false);
         expect(filterHasLength(NOOP)).toBe(false);
      });
   });
});


text:
<?php declare(strict_types = 1);

namespace App\Domain\Article;

use MongoDB\Collection as MongoCollection;
use MongoDB\Database;
use Psr\Container\ContainerInterface;

class CollectionFactory
{
    /**
     * @param ContainerInterface $container
     *
     * @return MongoCollection
     */
    public function __invoke(ContainerInterface $container): MongoCollection
    {
        return $container->get(Database::class)->selectCollection('articles');
    }
}


text:
BenchmarkDimention::BenchmarkDimention(Database *database, const QString &dimentionName)
{
    m_benchmarkTable = new BenchmarkTable(database, "Dimention" + dimentionName);
}

void BenchmarkDimention::setDimention(const QString &dimentionName, const QString dimentionInstance)
{
    m_benchmarkTable->setDimention(dimentionName, dimentionInstance);
}

void BenchmarkDimention::commitInstance()
{
    static int instanceId = 0; // ###
    m_benchmarkTable->setValue("InstanceID", ++instanceId);
}


text:
<?php

    use paslandau\Benchmark\Benchmark;
    use paslandau\Benchmark\BenchmarkResultList;
use paslandau\IOUtility\IOUtil;

require_once __DIR__ . '/demo-bootstrap.php';

    //define tests
    $tests = [
        "explode" => function ($params){
            $c = array_pop(explode('\\', get_class($params)));
            return $c;
        },
        "reflection" => function ($params){
            $c = (new \ReflectionClass($params))->getShortName();
            return $c;
        },
        "basename" => function ($params){
            $c = basename(str_replace('\\', '/', get_class($params)));
            return $c;
        },
    ];

    // get 10000 data points
    $runs = 10000;
    // call each test 10 to obtain one data point (default is 1)
    $iterations = 10;

    //run tests
    $benchmark = new Benchmark($tests, $runs, $iterations);
    $res = $benchmark->run($benchmark);

    // order by total time  (default is BenchmarkResultList::Average)
    $res->setOrderBy(BenchmarkResultList::TOTAL);
    // set number of decimal digits to round to (default is 2)
    $res->setPrecision(6);

    // display results
    echo $res;


text:
<?xml version="1.0" encoding="UTF-8"?>
<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">

    <!--

        Licensed to the Apache Software Foundation (ASF) under one or more
        contributor license agreements.  See the NOTICE file distributed with
        this work for additional information regarding copyright ownership.
        The ASF licenses this file to You under the Apache License, Version 2.0
        (the "License"); you may not use this file except in compliance with
        the License.  You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>15</version>
        <relativePath />
    </parent>

    <groupId>org.apache.karaf</groupId>
    <artifactId>cellar</artifactId>
    <version>4.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Apache Karaf :: Cellar</name>

    <properties>
        <easymock.version>3.2</easymock.version>
        <fabric8.version>2.2.23</fabric8.version>
        <fabric8.kubernetes-client.version>1.3.22</fabric8.kubernetes-client.version>
        <felix.bundlerepository.version>2.0.4</felix.bundlerepository.version>
        <felix.utils.version>1.8.0</felix.utils.version>
        <felix.webconsole.version>4.2.8</felix.webconsole.version>
        <hazelcast.version>3.5.5</hazelcast.version>
        <jclouds.version>1.8.1</jclouds.version>
        <joda-time.version>2.5</joda-time.version>
        <junit.version>4.11</junit.version>
        <karaf.version>3.0.6</karaf.version>
        <osgi.version>5.0.0</osgi.version>
        <osgi.compendium.version>5.0.0</osgi.compendium.version>
        <slf4j.version>1.7.7</slf4j.version>
    </properties>

    <modules>
        <module>core</module>
        <module>config</module>
        <module>features</module>
        <module>bundle</module>
        <module>obr</module>
        <module>dosgi</module>
        <module>event</module>
        <module>shell</module>
        <module>hazelcast</module>
        <module>utils</module>
        <module>cloud</module>
        <module>kubernetes</module>
        <module>webconsole</module>
        <module>assembly</module>
        <module>samples</module>
        <module>itests</module>
    </modules>

    <scm>
        <connection>scm:git:https://git-wip-us.apache.org/repos/asf/karaf-cellar.git</connection>
        <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/karaf-cellar.git</developerConnection>
        <url>https://git-wip-us.apache.org/repos/asf?p=karaf-cellar.git;a=summary</url>
      <tag>HEAD</tag>
  </scm>

    <issueManagement>
        <system>jira</system>
        <url>https://issues.apache.org/jira/browse/KARAF</url>
    </issueManagement>

    <mailingLists>
        <mailingList>
            <name>Karaf Dev</name>
            <subscribe>dev-subscribe@karaf.apache.org</subscribe>
            <unsubscribe>dev-unsubscribe@karaf.apache.org</unsubscribe>
            <post>-</post>
            <archive>http://www.mail-archive.com/dev%karaf.apache.org/</archive>
        </mailingList>
        <mailingList>
            <name>Karaf User</name>
            <subscribe>user-subscribe@karaf.apache.org</subscribe>
            <unsubscribe>user-unsubscribe@karaf.apache.org</unsubscribe>
            <post>-</post>
            <archive>http://www.mail-archive.com/user%40karaf.apache.org/</archive>
        </mailingList>
        <mailingList>
            <name>Karaf Commits</name>
            <subscribe>commits-subscribe@karaf.apache.org</subscribe>
            <unsubscribe>commits-unsubscribe@karaf.apache.org</unsubscribe>
            <post>-</post>
            <archive>http://www.mail-archive.com/commits%40karaf.apache.org/</archive>
        </mailingList>
        <mailingList>
            <name>Karaf Issues</name>
            <subscribe>issues-subscribe@karaf.apache.org</subscribe>
            <unsubscribe>issues-unsubscribe@karaf.apache.org</unsubscribe>
            <post>-</post>
            <archive>http://www.mail-archive.com/issues%40karaf.apache.org/</archive>
        </mailingList>
    </mailingLists>

    <dependencyManagement>
        <dependencies>

            <!-- Cellar -->
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.bundle</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.config</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.features</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.hazelcast</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.cloud</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.manual</artifactId>
                <type>html</type>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.manual</artifactId>
                <type>pdf</type>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.shell</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>org.apache.karaf.cellar.utils</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.cellar</groupId>
                <artifactId>apache-karaf-cellar</artifactId>
                <version>${project.version}</version>
                <type>xml</type>
                <classifier>features</classifier>
            </dependency>

            <!-- Felix -->
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.bundlerepository</artifactId>
                <version>${felix.bundlerepository.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.webconsole</artifactId>
                <version>${felix.webconsole.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.utils</artifactId>
                <version>${felix.utils.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.osgi</groupId>
                        <artifactId>org.osgi.core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.osgi</groupId>
                        <artifactId>org.osgi.compendium</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Hazelcast -->
            <dependency>
                <groupId>com.hazelcast</groupId>
                <artifactId>hazelcast</artifactId>
                <version>${hazelcast.version}</version>
            </dependency>

            <!-- Karaf -->
            <dependency>
                <groupId>org.apache.karaf.features</groupId>
                <artifactId>org.apache.karaf.features.command</artifactId>
                <version>${karaf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.features</groupId>
                <artifactId>org.apache.karaf.features.core</artifactId>
                <version>${karaf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.shell</groupId>
                <artifactId>org.apache.karaf.shell.console</artifactId>
                <version>${karaf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.shell</groupId>
                <artifactId>org.apache.karaf.shell.table</artifactId>
                <version>${karaf.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>org.apache.karaf.tooling.testing</artifactId>
                <version>${karaf.version}</version>
            </dependency>

            <!-- OSGi -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>${osgi.compendium.version}</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>${osgi.version}</version>
            </dependency>

            <!-- Servlet API -->
            <dependency>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
                <version>1.0</version>
            </dependency>

            <!-- SLF4J -->
            <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>

            <!-- JClouds -->
            <dependency>
                <groupId>org.apache.jclouds</groupId>
                <artifactId>jclouds-blobstore</artifactId>
                <version>${jclouds.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.jclouds</groupId>
                <artifactId>jclouds-allblobstore</artifactId>
                <version>${jclouds.version}</version>
            </dependency>

            <!-- Joda Time -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda-time.version}</version>
            </dependency>

            <!-- Kubernetes -->
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${fabric8.kubernetes-client.version}</version>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <!-- Easymock -->
            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>${easymock.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <defaultGoal>install</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <outputDirectory>${basedir}/eclipse-classes</outputDirectory>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <useReleaseProfile>false</useReleaseProfile>
                        <preparationGoals>clean install</preparationGoals>
                        <goals>deploy</goals>
                        <arguments>-Prelease,deploy,manual</arguments>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-idea-plugin</artifactId>
                    <version>2.2.1</version>
                    <configuration>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.16</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <version>1.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3,4)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>[1.7,1.9)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <resourceBundles>
                                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
                            </resourceBundles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-notice</id>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <copy file="NOTICE" todir="target/maven-shared-archive-resources/META-INF" failonerror="false" overwrite="true" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>${project.artifactId}*;version=${project.version}</Export-Package>
                    </instructions>
                    <supportedProjectTypes>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>war</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                    </supportedProjectTypes>
                    <unpackBundle>true</unpackBundle>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- generate dependencies versions -->
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>manual</id>
            <modules>
                <module>manual</module>
            </modules>
        </profile>
        <profile>
            <id>release</id>
            <modules>
                <module>manual</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-versions</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireMavenVersion>
                                            <version>[3,4)</version>
                                        </requireMavenVersion>
                                        <requireJavaVersion>
                                            <version>[1.7,1.9)</version>
                                        </requireJavaVersion>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- We want to deploy the artifact to a staging location for perusal -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-assemblies</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deploy</id>
            <properties>
                <createSourcesJar>true</createSourcesJar>
            </properties>
            <build>
                <defaultGoal>deploy</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <source>1.5</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;

[assembly: AssemblyProduct("Cake")]
[assembly: AssemblyVersion("0.32.1.0")]
[assembly: AssemblyFileVersion("0.32.1.0")]
[assembly: AssemblyInformationalVersion("0.32.1-beta.1+0.Branch.release/0.32.1.Sha.24f2a7dcfacb9efe2f7f7c41017679c39a689e9a")]
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]


text:
package com.example.tools.analytics;

import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent;

public class AnalyticsHelper {

    private final Answers answers;

    public AnalyticsHelper(Answers answers) {

        this.answers = answers;
    }

    public void logEvent(CustomEvent customEvent) {

        answers.logCustom(customEvent);
    }

}


text:
using System;
using System.Threading;
using Magellan.Exceptions;
using Magellan.Framework;
using Magellan.Testability;
using Magellan.Tests.Helpers;
using Magellan.Tests.Helpers.TypeGeneration;
using NUnit.Framework;

namespace Magellan.Tests.Framework
{
    [TestFixture]
    public class AsyncActionInvokerTests
    {
        protected TypeBuilder<Controller> Controller { get; set; }

        [SetUp]
        public void SetUp()
        {
            Controller = new TypeBuilder<Controller>("ExampleController");
        }

        [TearDown]
        public void TearDown()
        {
            Controller.VerifyAll();
        }

        [Test]
        public void ShouldExecuteOnBackgroundThread()
        {
            var testThreadId = Thread.CurrentThread.ManagedThreadId;
            var waitHandle = new AutoResetEvent(false);

            Controller.Method("ShowCustomer").Returns((int a) =>
                {
                    Assert.AreNotEqual(testThreadId, Thread.CurrentThread.ManagedThreadId);
                    waitHandle.Set();
                    return new DoNothingResult();
                }).MustBeCalled();

            Controller.Instance.ActionInvoker = new AsyncActionInvoker();
            Controller.Instance.Execute("ShowCustomer", new { a = 3 });

            waitHandle.WaitOne();
        }

        [Test]
        public void ShouldDispatchExceptionsToUIThread()
        {
            var testThreadId = Thread.CurrentThread.ManagedThreadId;
            var waitHandle = new AutoResetEvent(false);

            Controller.Method("ShowCustomer").Returns((int a) =>
            {
                Assert.AreNotEqual(testThreadId, Thread.CurrentThread.ManagedThreadId);
                throw new DivideByZeroException();
                return new DoNothingResult();
            }).MustBeCalled();

            var dispatcher = new ManualPumpDispatcher();

            var request = RequestBuilder.CreateRequest("ExampleController", "ShowCustomer", new {a = 3});
            request.Dispatcher = dispatcher;

            Controller.Instance.ActionInvoker = new AsyncActionInvoker();
            Controller.Instance.Execute(request.BuildControllerContext(Controller.Instance));

            Thread.Sleep(400);

            var ex = Assert.Throws<AsyncControllerExecutionException>(dispatcher.Pump);
            Assert.IsInstanceOf<DivideByZeroException>(ex.InnerException);
        }

        [Test]
        public void ShouldSetNameOfWorkerThread()
        {
            var waitHandle = new AutoResetEvent(false);

            Controller.Method("ShowCustomer").Returns((int a) =>
            {
                Assert.IsTrue(Thread.CurrentThread.Name.StartsWith("Navigation request: "));
                waitHandle.Set();
                return new DoNothingResult();
            }).MustBeCalled();

            Controller.Instance.ActionInvoker = new AsyncActionInvoker();
            Controller.Instance.Execute("ShowCustomer", new { a = 3 });

            waitHandle.WaitOne();
        }
    }
}


text:
package com.sissi.pipeline.in.iq.bytestreams;

import com.sissi.context.JIDContext;
import com.sissi.pipeline.Input;
import com.sissi.protocol.Protocol;
import com.sissi.protocol.iq.bytestreams.Bytestreams;
import com.sissi.server.exchange.TracerContext;

/**
 * Bytestreams追踪
 *
 * @author kim 2014年5月8日
 */
public class Bytestreams2FansTraceProcessor implements Input {

	private final TracerContext tracerContext;

	public Bytestreams2FansTraceProcessor(TracerContext tracerContext) {
		super();
		this.tracerContext = tracerContext;
	}

	@Override
	public boolean input(JIDContext context, Protocol protocol) {
		Bytestreams bytestreams = protocol.cast(Bytestreams.class);
		return bytestreams.sid() ? this.trace(context, bytestreams) : true;
	}

	private boolean trace(JIDContext context, Bytestreams bytestreams) {
		return this.tracerContext.trace(bytestreams);
	}
}


text:
@interface DWViewController : UIViewController

@end


text:
@implementation Player

@synthesize lastPosition;
@synthesize speedUpActive;
@synthesize tripleShotsActive;
@synthesize velocitySpeedUp, velocityOrdinary;

-(id) init {
    if ((self = [super init]))
    {
		self.zOrderOffset = 0;
		self.velocitySpeedUp = 270/1;
		self.velocityOrdinary = 180/1;
		self.velocity = velocityOrdinary;
		self.alive = YES;
		self.isMoving = NO;
		self.speedUpActive = NO;
		self.tripleShotsActive = NO;
		self.spritesheetBaseFilename = @"walking";
		[self cacheFrames];

    }
    return self;
}

+(id) player
{
	return [[[self alloc] init] autorelease];
}

@end


text:
angular.module('Androguide', ['ngAnimate']).config([function() {

}]);


text:
_[www.codever.land/bookmarks/t/snes](https://www.codever.land/bookmarks/t/snes)_
---
#### [ioncodes/snesutilities](https://github.com/ioncodes/snesutilities)
_https://github.com/ioncodes/snesutilities_

ROM analyser/extractor
* **tags**: [rust](../tagged/rust.md), [emulators](../tagged/emulators.md), [dev-tools](../tagged/dev-tools.md), [snes](../tagged/snes.md)
* :octocat: **[source code](https://github.com/ioncodes/snesutilities)**
---


text:
package com.google.gwt.event.dom.client;

import com.google.gwt.dom.client.BrowserEvents;

/**
 * Represents a native touch start event.
 */
public class TouchStartEvent extends TouchEvent<TouchStartHandler> {

  /**
   * Event type for touch start events. Represents the meta-data associated with
   * this event.
   */
  private static final Type<TouchStartHandler> TYPE = new Type<
      TouchStartHandler>(BrowserEvents.TOUCHSTART, new TouchStartEvent());

  /**
   * Gets the event type associated with touch start events.
   *
   * @return the handler type
   */
  public static Type<TouchStartHandler> getType() {
    return TYPE;
  }

  /**
   * Protected constructor, use {@link
   * DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent,
   * com.google.gwt.event.shared.HasHandlers)} to fire touch start events.
   */
  protected TouchStartEvent() {
  }

  @Override
  public final Type<TouchStartHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(TouchStartHandler handler) {
    handler.onTouchStart(this);
  }
}


text:
import cherrypy

import lib.error
import controller.address_validation
import controller.authentication
import controller.member
import controller.organization
import controller.reporting_year
import controller.user

class Medlem(object):
	def __init__(self):
		cherrypy.tools.content_type_json = cherrypy.Tool("before_finalize", self.content_type_json)
		cherrypy.config.update({"tools.content_type_json.on": True})
		cherrypy.config.update({"error_page.404": self.error_404})
		cherrypy.config.update({"request.error_response": self.error_500})

		self.address_validation = controller.address_validation.AddressValidation()
		self.authentication = controller.authentication.Authentication()
		self.member = controller.member.Member()
		self.organization = controller.organization.Organization()
		self.reporting_year = controller.reporting_year.ReportingYear()
		self.user = controller.user.User()

	def content_type_json(self):
		cherrypy.response.headers['Content-Type']= 'application/json'

	def error_404(self, status, message, traceback, version):
		cherrypy.response.status = 404
		return lib.error.APIError("http.404")

	def error_500(self):
		cherrypy.response.status = 500
		cherrypy.response.body = lib.error.APIError("http.500")


text:
cask "font-ubuntu" do
  version :latest
  sha256 :no_check

  url "https://github.com/google/fonts/trunk/ufl/ubuntu",
      verified: "github.com/google/fonts/",
      using:    :svn
  name "Ubuntu"
  desc "Sans-serif typeface manually hinted for clarity"
  homepage "https://fonts.google.com/specimen/Ubuntu"

  font "Ubuntu-Bold.ttf"
  font "Ubuntu-BoldItalic.ttf"
  font "Ubuntu-Italic.ttf"
  font "Ubuntu-Light.ttf"
  font "Ubuntu-LightItalic.ttf"
  font "Ubuntu-Medium.ttf"
  font "Ubuntu-MediumItalic.ttf"
  font "Ubuntu-Regular.ttf"
end


text:
module TinySparse
    # Required modules
    using TinyInt
    using LinearMaps
    # Overloaded functions
    import Base: size, nnz, issymmetric, ishermitian, isposdef, A_mul_B!, *, At_mul_B!, Ac_mul_B!, Ac_mul_B
    import TinyInt: pack
    # Type definition and overloaded functions
    include("tinysparsemat.jl")
    # Function to pack sparse matrices
    include("compress.jl")

    export TinySparseMat, pack
end


text:
var keystone = require('keystone');
var _ = require('lodash');

module.exports = (req, res) => {
	var result = {};
	var sections = keystone.nav.sections ? _.clone(keystone.nav.sections) : [];
	var orphanedLists = keystone.getOrphanedLists().map(function (list) {
		return _.pick(list, ['key', 'label', 'path']);
	});

	if (orphanedLists.length) {
		var orphanedList = {
			lists: orphanedLists,
			key: 'Other',
			label: 'Other'
		};
		sections.push(orphanedList);
	}

	res.setHeader('Content-Type', 'application/json');
	// res.setHeader('Access-Control-Allow-Credentials', 'true');

	if (sections.length) {
		result.resCode = "0000"; //
		result.resMsg = sections; //
		return res.send(result);
	} else {
		result.resCode = "4001"; //
		result.resMsg = []; //
		return res.send(result);
	}
}


text:
// Copyright 2022 Google LLC
//
// 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
//
//     https://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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main(instance, project, zone) {
  // [START compute_v1_generated_Instances_SimulateMaintenanceEvent_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Name of the instance scoping this request.
   */
  // const instance = 'abc123'
  /**
   *  Project ID for this request.
   */
  // const project = 'my-project'
  /**
   *  The name of the zone for this request.
   */
  // const zone = 'abc123'

  // Imports the Compute library
  const {InstancesClient} = require('@google-cloud/compute').v1;

  // Instantiates a client
  const computeClient = new InstancesClient();

  async function callSimulateMaintenanceEvent() {
    // Construct request
    const request = {
      instance,
      project,
      zone,
    };

    // Run request
    const response = await computeClient.simulateMaintenanceEvent(request);
    console.log(response);
  }

  callSimulateMaintenanceEvent();
  // [END compute_v1_generated_Instances_SimulateMaintenanceEvent_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
/*
 * Do not modify this file. This file is generated from the iam-2010-05-08.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;

using Amazon.IdentityManagement.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.IdentityManagement.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// ResyncMFADevice Request Marshaller
    /// </summary>
    public class ResyncMFADeviceRequestMarshaller : IMarshaller<IRequest, ResyncMFADeviceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
    {
        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((ResyncMFADeviceRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>
        /// <param name="publicRequest"></param>
        /// <returns></returns>
        public IRequest Marshall(ResyncMFADeviceRequest publicRequest)
        {
            IRequest request = new DefaultRequest(publicRequest, "Amazon.IdentityManagement");
            request.Parameters.Add("Action", "ResyncMFADevice");
            request.Parameters.Add("Version", "2010-05-08");

            if(publicRequest != null)
            {
                if(publicRequest.IsSetAuthenticationCode1())
                {
                    request.Parameters.Add("AuthenticationCode1", StringUtils.FromString(publicRequest.AuthenticationCode1));
                }
                if(publicRequest.IsSetAuthenticationCode2())
                {
                    request.Parameters.Add("AuthenticationCode2", StringUtils.FromString(publicRequest.AuthenticationCode2));
                }
                if(publicRequest.IsSetSerialNumber())
                {
                    request.Parameters.Add("SerialNumber", StringUtils.FromString(publicRequest.SerialNumber));
                }
                if(publicRequest.IsSetUserName())
                {
                    request.Parameters.Add("UserName", StringUtils.FromString(publicRequest.UserName));
                }
            }
            return request;
        }
    }
}


text:
package com.intellij.codeInsight.preview;

import org.jetbrains.annotations.TestOnly;

import javax.annotation.Nullable;

/**
 * User: zolotov
 * Date: 6/5/13
 */
public interface PreviewHintComponent {
  @TestOnly
  boolean isEqualTo(@Nullable PreviewHintComponent other);
}


text:
package org.machine.engine.graph.commands

import reflect.runtime.universe._
// import scala.collection._
// import scala.collection.generic._

import scala.collection.mutable.{ArrayBuffer, ListBuffer, Map}
import org.machine.engine.exceptions._

import org.machine.engine.graph.nodes.PropertyDefinitions

object GraphCommandOptions{
  def apply():GraphCommandOptions = new GraphCommandOptions()
}

//http://daily-scala.blogspot.com/2010/04/creating-custom-traversable.html
class GraphCommandOptions{
  private var graphValue = Map.empty[String, AnyVal]
  private var graphObjects = Map.empty[String, AnyRef]

  def fieldValues = this.graphValue
  def fieldObjects = this.graphObjects
  def optionValues = this.graphValue
  def optionObjects = this.graphObjects

  def addField(fieldName: String, fieldValue: Any):GraphCommandOptions = {
    fieldValue match {
      case x: Boolean => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Boolean])
      case x: Byte => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Byte])
      case x: Short => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Short])
      case x: Int => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Int])
      case x: Long => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Long])
      case x: Float => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Float])
      case x: Double => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Double])
      case x: Char => graphValue.+=(fieldName -> fieldValue.asInstanceOf[Char])
      case x: String => graphObjects.+=(fieldName -> fieldValue.asInstanceOf[String])
      case x: PropertyDefinitions => graphObjects.+=(fieldName -> fieldValue.asInstanceOf[PropertyDefinitions])
      case _ => throw new InternalErrorException("GraphCommandOptions.addField: Unsupported type.")
    }
    this
  }

  def addOption(optionName:String, optionValue: Any):GraphCommandOptions = {
    addField(optionName, optionValue)
  }

  def field[T: TypeTag](name: String):T = option[T](name)

  def option[T: TypeTag](name: String):T = {
    val map = name match {
      case v if typeOf[T] <:< typeOf[AnyVal] => graphValue
      case r if typeOf[T] <:< typeOf[AnyRef] => graphObjects
      case r if typeOf[T] <:< typeOf[Boolean] => graphValue
      case x if typeOf[T] <:< typeOf[Byte] => graphValue
      case x if typeOf[T] <:< typeOf[Short] => graphValue
      case x if typeOf[T] <:< typeOf[Int] => graphValue
      case x if typeOf[T] <:< typeOf[Long] => graphValue
      case x if typeOf[T] <:< typeOf[Float] => graphValue
      case x if typeOf[T] <:< typeOf[Double] => graphValue
      case x if typeOf[T] <:< typeOf[Char] => graphValue
      case _ => throw new InternalErrorException("GraphCommandOptions.option: Unsupported type.")
    }
    return map.get(name).getOrElse(throw new InternalErrorException("Could not find: %s".format(name))).asInstanceOf[T]
  }

  def contains(name: String):Boolean = {
    return graphValue.contains(name) || graphObjects.contains(name)
  }

  def reset:Unit = {
    graphValue = Map.empty[String, AnyVal]
    graphObjects = Map.empty[String, AnyRef]
  }

  //Create a Java Map
  def toJavaMap:java.util.HashMap[java.lang.String, Object] = {
    val map = new java.util.HashMap[java.lang.String, Object]()
    loadValues(map)
    graphObjects.foreach(t => map.put(t._1, t._2))
    return map
  }

  private def loadValues(javaMap: java.util.HashMap[java.lang.String, Object]):Unit = {
    graphValue.foreach(option => {
      val fieldName = option._1
      val fieldValue = option._2
      fieldValue match {
        case x: Boolean => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Boolean])
        case x: Byte => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Byte])
        case x: Short => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Short])
        case x: Int => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Integer])
        case x: Long => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Long])
        case x: Float => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Float])
        case x: Double => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Double])
        case x: Char => javaMap.put(fieldName, fieldValue.asInstanceOf[java.lang.Character])
        case _ => throw new InternalErrorException("GraphCommandOptions: Unhandled type.")
      }
    })
  }

  def toMap:scala.collection.immutable.Map[String, Any] = {
    val map = Map.empty[String, Any]
    graphValue.foreach(t => map.put(t._1, t._2))
    graphObjects.foreach(t => map.put(t._1, t._2))
    return map.toMap
  }

  def foreach(f: ((String, Any)) => Unit): Unit = {
    graphValue.foreach(f)
    graphObjects.foreach(f)
  }

  def keys: List[String] = {
    val items = ArrayBuffer.empty[String]
    graphValue.keys.foreach(key => items += key)
    graphObjects.keys.foreach(key => items += key)
    return items.toList
  }

  override def toString:String = {
    import scala.collection.mutable.StringBuilder
    val sb = StringBuilder.newBuilder
    this.foreach{ case (k,v) => sb ++=(s"$k -> $v\n")}
    return sb.toString
  }
}


text:
module ThemesOnRails
  class ActionController
    attr_reader :theme_name

    class << self
      def apply_theme(controller_class, theme, options={})
        filter_method = before_filter_method(options)
        options       = options.slice(:only, :except)

        # set layout
        controller_class.class_eval do
          define_method :layout_from_theme do
            theme_instance.theme_name
          end

          define_method :theme_instance do
            @theme_instance ||= ThemesOnRails::ActionController.new(self, theme)
          end

          define_method :current_theme do
            theme_instance.theme_name
          end

          private :layout_from_theme, :theme_instance
          layout  :layout_from_theme, options
          helper_method :current_theme
        end

        controller_class.send(filter_method, options) do |controller|

          # prepend view path
          controller.prepend_view_path theme_instance.theme_view_path

          # liquid file system
          Liquid::Template.file_system = Liquid::Rails::FileSystem.new(theme_instance.theme_view_path) if defined?(Liquid::Rails)
        end
      end

      private

        def before_filter_method(options)
          case Rails::VERSION::MAJOR
          when 3
            options.delete(:prepend) ? :prepend_before_filter : :before_filter
          when 4, 5
            options.delete(:prepend) ? :prepend_before_action : :before_action
          end
        end
    end

    def initialize(controller, theme)
      @controller = controller
      @theme_name = _theme_name(theme)
    end

    def theme_view_path
      "#{prefix_path}/#{@theme_name}/views"
    end

    def prefix_path
      "#{Rails.root}/app/themes"
    end

    private

      def _theme_name(theme)
        case theme
        when String     then theme
        when Proc       then theme.call(@controller).to_s
        when Symbol     then @controller.respond_to?(theme, true) ? @controller.send(theme).to_s : theme.to_s
        else
          raise ArgumentError,
            "String, Proc, or Symbol, expected for `theme'; you passed #{theme.inspect}"
        end
      end
  end
end


text:
package elastic

import (
	"context"
	"encoding/json"
	_ "net/http"
	"testing"
)

func TestCommonTermsQuery(t *testing.T) {
	q := NewCommonTermsQuery("message", "Golang").CutoffFrequency(0.001)
	src, err := q.Source()
	if err != nil {
		t.Fatal(err)
	}
	data, err := json.Marshal(src)
	if err != nil {
		t.Fatalf("marshaling to JSON failed: %v", err)
	}
	got := string(data)
	expected := `{"common":{"message":{"cutoff_frequency":0.001,"query":"Golang"}}}`
	if got != expected {
		t.Errorf("expected\n%s\n,got:\n%s", expected, got)
	}
}

func TestSearchQueriesCommonTermsQuery(t *testing.T) {
	client := setupTestClientAndCreateIndex(t)

	// Deprecated in >= 7.3.0
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html
	esversion, err := client.ElasticsearchVersion(DefaultURL)
	if err != nil {
		t.Fatal(err)
	}
	if esversion < "7.3.0" {
		t.Skipf("Elasticsearch versions >= 7.3.0 deprecated Common Terms Query. "+
			"See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html. "+
			"You are running Elasticsearch %v.", esversion)
	}

	tweet1 := tweet{User: "olivere", Message: "Welcome to Golang and Elasticsearch."}
	tweet2 := tweet{User: "olivere", Message: "Another unrelated topic."}
	tweet3 := tweet{User: "sandrae", Message: "Cycling is fun."}

	// Add all documents
	_, err = client.Index().Index(testIndexName).Id("1").BodyJson(&tweet1).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Index().Index(testIndexName).Id("2").BodyJson(&tweet2).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Index().Index(testIndexName).Id("3").BodyJson(&tweet3).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Refresh().Index(testIndexName).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	// Common terms query
	q := NewCommonTermsQuery("message", "Golang")
	searchResult, err := client.Search().Index(testIndexName).Query(q).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if searchResult.Hits == nil {
		t.Errorf("expected SearchResult.Hits != nil; got nil")
	}
	if searchResult.TotalHits() != 1 {
		t.Errorf("expected SearchResult.TotalHits() = %d; got %d", 1, searchResult.TotalHits())
	}
	if len(searchResult.Hits.Hits) != 1 {
		t.Errorf("expected len(SearchResult.Hits.Hits) = %d; got %d", 1, len(searchResult.Hits.Hits))
	}

	for _, hit := range searchResult.Hits.Hits {
		if hit.Index != testIndexName {
			t.Errorf("expected SearchResult.Hits.Hit.Index = %q; got %q", testIndexName, hit.Index)
		}
		item := make(map[string]interface{})
		err := json.Unmarshal(hit.Source, &item)
		if err != nil {
			t.Fatal(err)
		}
	}
}


text:
#ifndef __X86_64_SIGNAL_H_
#define __X86_64_SIGNAL_H_

#define ARCH_SIGHDLR_PARAM int sig

#define ARCH_GET_SIGCONTEXT(sc, sig_addr) \
	do { \
		struct ucontext *__uc; \
		asm("movq %%rdx, %0" : "=r" (__uc)); \
		sc = (struct sigcontext *) &__uc->uc_mcontext; \
	} while(0)

#endif

/*
 * Overrides for Emacs so that we follow Linus's tabbing style.
 * Emacs will notice this stuff at the end of the file and automatically
 * adjust the settings for this buffer only.  This must remain at the end
 * of the file.
 * ---------------------------------------------------------------------------
 * Local variables:
 * c-file-style: "linux"
 * End:
 */


text:
/**
 * $Id: QuestionEditAction.java 4026 2011-03-22 14:58:42Z orangeforjava $
 */
package org.openuap.cms.survey.action.admin.question;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.openuap.base.util.ControllerHelper;
import org.openuap.base.util.resource.DirectoryListDataLoader;
import org.openuap.cms.core.action.UserAwareFormAction;
import org.openuap.cms.survey.manager.QuestionManager;
import org.openuap.cms.survey.manager.SurveyManager;
import org.openuap.cms.survey.model.Question;
import org.openuap.cms.survey.model.QuestionItem;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;

/**
 *

 * Title:QuestionEditAction
 *

 *
 *

 * Description:问题编辑控制器.
 *

 *
 *

 * Copyright: Copyright (c) 2006
 *

 *
 *

 * Company: http://www.openuap.org
 *

 *
 * @author Weiping Ju
 * @version 1.0
 */
public class QuestionEditAction extends UserAwareFormAction {

	private String defaultScreensPath;

	private String resultViewName;

	//
	private QuestionManager questionManager;

	private SurveyManager surveyManager;

	//
	public QuestionEditAction() {
		initDefaultProperty();
	}

	protected void initDefaultProperty() {
		defaultScreensPath = "/plugin/cms/survey/screens/question/";
		resultViewName = defaultScreensPath + "question_result.html";
		this.setFormView(defaultScreensPath + "question_edit.html");
		this.setSuccessView(this.getFormView());
		this.setSessionForm(true);
		this.setBindOnNewForm(false);
		this.setCommandClass(Question.class);
		this.setCommandName("question");
	}

	/**
	 *
	 * @param request
	 *
	 * @param response
	 *
	 * @param command
	 *
	 * @param errors
	 *
	 * @param helper
	 *
	 * @param model
	 *
	 * @return
	 * @throws
	 */
	protected ModelAndView onSubmit(HttpServletRequest request,
			HttpServletResponse response, Object command, BindException errors,
			ControllerHelper helper, Map model) throws Exception {
		//
		ModelAndView mv = new ModelAndView(resultViewName, model);
		model.put("op", "edit");
		try {
			Question question = (Question) command;
			if (question.getQuestionId() == null) {
				question.setCreationUserId(getUser().getUserId());
				question.setCreationUserName(getUser().getName());
				question.setQuestionCreationDate(new Long(System
						.currentTimeMillis()));
				question.setQuestionStatus(new Integer(0));
				Long id = questionManager.addQuestion(question);
				//
				model.put("id", id);
				//

			} else {
				questionManager.saveQuestion(question);
				model.put("id", question.getQuestionId());
			}
			model.put("rs", "success");
		} catch (Exception ex) {
			ex.printStackTrace();
			model.put("rs", "failed");
			model.put("msgs", ex);
		}
		return mv;
	}

	protected void onBindAndValidate(HttpServletRequest request,
			Object command, BindException errors) {

	}

	protected Object formBackingObject(HttpServletRequest request) {
		String id = request.getParameter("questionId");
		String sid = request.getParameter("sid");
		Question question = null;
		if (id != null) {
			Long iid = new Long(id);
			question = questionManager.getQuestionById(iid);

		} else {
			question = new Question();
			if (sid != null) {
				Long lsid = new Long(sid);
				int count = questionManager.getQuestionCountBySurvey(lsid);
				question.setSurveyId(lsid);
				question.setQuestionPos(new Long(count + 1));
				question.setGroupId(new Long(count + 1));
			}
		}
		return question;
	}

	protected Map referenceData(HttpServletRequest request, Object command,
			Errors errors) throws Exception {
		Map model = new HashMap();
		Question question = (Question) command;
		if (question.getQuestionId() == null) {
			model.put("mode", "add");
		} else {
			model.put("mode", "edit");
			List items = questionManager.getQuestionItems(question
					.getQuestionId());
			model.put("items", items);
		}
		//
		List questionTypes = getQuestionTypeConstants();
		model.put("questionTypes", questionTypes);
		List questionFilters = getQuestionFilterConstants();
		model.put("questionFilters", questionFilters);
		return model;
	}

	public ModelAndView doAddQuestion(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String id = request.getParameter("questionId");
		String sid = request.getParameter("sid");
		if (id != null) {
			Long iid = new Long(id);
			Question question = questionManager.getQuestionById(iid);
			if (sid != null && question != null) {
				Long lsid = new Long(sid);
				int count = questionManager.getQuestionCountBySurvey(lsid);
				Question q = new Question();
				q.setCreationUserId(this.getUser().getUserId());
				q.setCreationUserName(this.getUser().getName());
				q.setGroupId(question.getGroupId());
				q.setGroupTitle(question.getGroupTitle());
				q.setPageId(question.getPageId());
				q.setQuestionCreationDate(new Long(System.currentTimeMillis()));
				q.setQuestionPos(new Long(count + 1));
				q.setQuestionStatus(new Integer(0));
				q.setQuestionTitle("[复制]" + question.getQuestionTitle());
				q.setQuestionType(question.getQuestionType());
				q.setSurveyId(lsid);
				Long qid = questionManager.addQuestion(q);
				q.setQuestionId(qid);
				// 添加选项
				Set items = question.getQuestionItems();
				if (items != null) {
					Iterator it = items.iterator();
					while (it.hasNext()) {
						QuestionItem qi = (QuestionItem) it.next();
						QuestionItem qi2 = new QuestionItem();
						qi2.setQuestion(q);
						qi2.setQuestionItemPolledTimes(new Integer(0));
						qi2.setQuestionItemSort(qi.getQuestionItemSort());
						qi2.setQuestionItemText(qi.getQuestionItemText());
						qi2.setQuestionItemType(qi.getQuestionItemType());
						questionManager.addQuestionItem(qi2);
					}
				}
				//
				helper.sendRedirect(helper.getBaseURL()
						+ "plugin/survey/questionEdit.jhtml?sid=" + sid
						+ "&questionId=" + qid);
			}
		}
		return null;
	}

	/**
	 *
	 * @param request
	 *            HttpServletRequest
	 * @param response
	 *            HttpServletResponse
	 * @param helper
	 *            ControllerHelper
	 * @param model
	 *            Map
	 * @return ModelAndView
	 * @throws Exception
	 */
	public ModelAndView doAddItem(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String questionId = request.getParameter("questionId");
		if (questionId != null) {
			Long qid = new Long(questionId);
			Question q = questionManager.getQuestionById(qid);
			if (q != null) {
				QuestionItem item = new QuestionItem();
				int i = questionManager.getItemsCount(qid);
				item.setQuestion(q);
				item.setQuestionItemPolledTimes(new Integer(0));
				item.setQuestionItemText("请输入选项内容");
				item.setQuestionItemType(new Integer(0));
				item.setQuestionItemSort(new Integer(i + 1));
				questionManager.addQuestionItem(item);
			}
		}
		return this.showNewForm(request, response, helper, model);
	}

	public ModelAndView doSaveItem(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String questionItemId = request.getParameter("questionItemId");
		String questionItemText = request.getParameter("questionItemText");
		String questionItemType = request.getParameter("questionItemType");
		String image=helper.getString("image","");
		String url=helper.getString("url","");
		//
		if (questionItemId != null) {
			Long qid = new Long(questionItemId);
			QuestionItem qi = questionManager.getQuestionItemById(qid);
			if (qi != null) {
				qi.setQuestionItemText(questionItemText);
				qi.setQuestionItemType(new Integer(questionItemType));
				qi.setImage(image);
				qi.setUrl(url);
				//
				questionManager.saveQuestionItem(qi);
			}
		}
		return this.showNewForm(request, response, helper, model);
	}

	public ModelAndView doDelItem(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String questionItemId = request.getParameter("questionItemId");
		String questionId = request.getParameter("questionId");
		if (questionItemId != null) {
			Long qid = new Long(questionItemId);
			Long id = new Long(questionId);
			QuestionItem qi = questionManager.getQuestionItemById(qid);
			if (qi != null) {
				Integer pos = qi.getQuestionItemSort();
				updateItemPos("del", id, qid, pos.intValue());
				questionManager.deleteQuestionItem(qi);
			}
		}
		return this.showNewForm(request, response, helper, model);
	}

	public ModelAndView doUpItem(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String questionItemId = request.getParameter("questionItemId");
		String questionId = request.getParameter("questionId");
		if (questionItemId != null) {
			Long qid = new Long(questionItemId);
			Long id = new Long(questionId);
			QuestionItem qi = questionManager.getQuestionItemById(qid);
			if (qi != null) {
				Integer pos = qi.getQuestionItemSort();
				updateItemPos("up", id, qid, pos.intValue());
			}
		}
		return this.showNewForm(request, response, helper, model);

	}

	public ModelAndView doDownItem(HttpServletRequest request,
			HttpServletResponse response, ControllerHelper helper, Map model)
			throws Exception {
		String questionItemId = request.getParameter("questionItemId");
		String questionId = request.getParameter("questionId");
		if (questionItemId != null) {
			Long qid = new Long(questionItemId);
			Long id = new Long(questionId);
			QuestionItem qi = questionManager.getQuestionItemById(qid);
			if (qi != null) {
				Integer pos = qi.getQuestionItemSort();
				updateItemPos("down", id, qid, pos.intValue());
			}
		}
		return this.showNewForm(request, response, helper, model);

	}

	private void updateItemPos(String action, Long questionId,
			Long questionItemId, int pos) {
		if (action == null) {
			return;
		}
		if (action.equals("del")) {
			int totalCount = questionManager.getItemsCount(questionId);
			if (pos >= 0 && pos < totalCount) {
				questionManager
						.executeHql(
								"update QuestionItem qi set qi.questionItemSort=qi.questionItemSort-1 where qi.question.questionId="
										+ questionId
										+ " and qi.questionItemSort>" + pos,
								null);
			}
		} else if (action.equals("up")) {
			int totalCount = questionManager.getItemsCount(questionId);
			if (pos > 1 && pos <= totalCount) {
				questionManager
						.executeHql(
								"update QuestionItem qi set qi.questionItemSort=qi.questionItemSort+1 where qi.questionItemSort="
										+ (pos - 1)
										+ " and qi.question.questionId="
										+ questionId, null);
				questionManager
						.executeHql(
								"update QuestionItem qi set qi.questionItemSort=qi.questionItemSort-1 where qi.questionItemId="
										+ questionItemId, null);
			}
		} else if (action.equals("down")) {
			int totalCount = questionManager.getItemsCount(questionId);
			if (pos >= 1 && pos < totalCount) {
				questionManager
						.executeHql(
								"update QuestionItem qi set qi.questionItemSort=qi.questionItemSort-1 where qi.questionItemSort="
										+ (pos + 1)
										+ " and qi.question.questionId="
										+ questionId, null);
				questionManager
						.executeHql(
								"update QuestionItem qi set qi.questionItemSort=qi.questionItemSort+1 where qi.questionItemId="
										+ questionItemId, null);
			}

		}

	}

	public List getQuestionTypeConstants() {
		List dd = DirectoryListDataLoader
				.load("/plugin/survey/questiontype_constant.xml");
		return dd;
	}

	public List getQuestionFilterConstants() {
		List dd = DirectoryListDataLoader
				.load("/plugin/survey/questionfilter_constant.xml");
		return dd;
	}

	public void setResultViewName(String resultViewName) {
		this.resultViewName = resultViewName;
	}

	public void setQuestionManager(QuestionManager questionManager) {
		this.questionManager = questionManager;
	}

	public void setDefaultScreensPath(String defaultScreensPath) {
		this.defaultScreensPath = defaultScreensPath;
	}
}


text: """This directory is meant for IPython extensions."""


text:
package org.ojalgo.matrix.decomposition;

import org.ojalgo.function.FunctionSet;
import org.ojalgo.function.PrimitiveFunction;
import org.ojalgo.matrix.store.DiagonalStore;
import org.ojalgo.matrix.store.MatrixStore;
import org.ojalgo.matrix.store.PhysicalStore;
import org.ojalgo.matrix.store.Primitive64Store;
import org.ojalgo.matrix.store.RawStore;
import org.ojalgo.scalar.PrimitiveScalar;
import org.ojalgo.scalar.Scalar;
import org.ojalgo.structure.Access1D;
import org.ojalgo.structure.Access2D;
import org.ojalgo.structure.Access2D.Collectable;
import org.ojalgo.structure.Structure2D;
import org.ojalgo.type.context.NumberContext;

/**
 * In many ways similar to InPlaceDecomposition but this class is hardwired to work with double[][] data. Most
 * of it's originates from JAMA, but have been significantly refactored or even (re)written from scratch.
 *
 * @author apete
 */
abstract class RawDecomposition extends AbstractDecomposition<Double> {

    static RawStore make(final int nbRows, final int nbCols) {
        return RawStore.FACTORY.make(nbRows, nbCols);
    }

    final static <D extends Access1D<?>> DiagonalStore.Builder<Double, D> makeDiagonal(final D mainDiag) {
        return DiagonalStore.builder(RawStore.FACTORY, mainDiag);
    }

    private int myColDim;
    private double[][] myInternalData;
    private RawStore myInternalStore;
    private int myRowDim;

    protected RawDecomposition() {
        super();
    }

    @Override
    public int getColDim() {
        return myColDim;
    }

    @Override
    public int getRowDim() {
        return myRowDim;
    }

    @Override
    protected Primitive64Store allocate(final long numberOfRows, final long numberOfColumns) {
        // TODO Should use RawStore.FACTORY rather than PrimitiveDenseStore.FACTORY
        return Primitive64Store.FACTORY.make(numberOfRows, numberOfColumns);
    }

    protected boolean checkSymmetry() {
        boolean retVal = myRowDim == myColDim;
        for (int i = 0; retVal && i < myRowDim; i++) {
            for (int j = 0; retVal && j < i; j++) {
                retVal &= NumberContext.compare(myInternalData[i][j], myInternalData[j][i]) == 0;
            }
        }
        return retVal;
    }

    @SuppressWarnings("unchecked")
    protected MatrixStore<Double> collect(final Access2D.Collectable<Double, ? super DecompositionStore<Double>> source) {
        // TODO Should use RawStore.FACTORY rather than PrimitiveDenseStore.FACTORY
        if (source instanceof MatrixStore) {
            return (MatrixStore<Double>) source;
        }
        if (source instanceof Access2D) {
            return Primitive64Store.FACTORY.makeWrapper((Access2D<?>) source);
        }
        return source.collect(Primitive64Store.FACTORY);
    }

    @Override
    protected final FunctionSet<Double> function() {
        return PrimitiveFunction.getSet();
    }

    protected double[][] getInternalData() {
        return myInternalData;
    }

    protected RawStore getInternalStore() {
        return myInternalStore;
    }

    @Override
    protected final Scalar.Factory<Double> scalar() {
        return PrimitiveScalar.FACTORY;
    }

    protected Collectable<Double, ? super PhysicalStore<Double>> wrap(final Access2D<?> matrix) {
        return Primitive64Store.FACTORY.makeWrapper(matrix);
    }

    RawStore newRawStore(final int m, final int n) {
        return RawStore.FACTORY.make(m, n);
    }

    double[][] reset(final Structure2D template, final boolean transpose) {

        this.reset();

        final int templateRows = template.getRowDim();
        final int templateCols = template.getColDim();

        final int internalRows = transpose ? templateCols : templateRows;
        final int internalCols = transpose ? templateRows : templateCols;

        if (myInternalData == null || myRowDim != templateRows || myColDim != templateCols) {

            myInternalStore = RawStore.FACTORY.make(internalRows, internalCols);
            myInternalData = myInternalStore.data;

            myRowDim = templateRows;
            myColDim = templateCols;
        }

        return myInternalData;
    }

    RawStore wrap(final double[][] data) {
        return RawStore.wrap(data);
    }

}


text:
{{ $data := index site.Data site.Language.Lang }}

{{ if $data.news.news.enable }}
{{ with $data.news.news }}
{{"" | safeHTML}}

{{ .caption | markdownify }}

{{ .title | markdownify }}

{{ .content | markdownify }}

						{{ range .feature_item }}

								{{with .icon}}

								{{ end }}

{{ .title | markdownify }}

{{ .content | markdownify }}

						{{ end }}

{{"" | safeHTML}}
{{ end }}
{{ end }}


text:
import {Component} from "@angular/core";
import {ShoppingListComponent} from "./shopping-list.component";

@Component({
    selector: 'shoplist-app',
    styleUrls: ['src/css/shoplist.css'],
    directives: [ShoppingListComponent],
    template: `

Shopping list

    <shopping-list></shopping-list>

`
})
export class ShoplistAppComponent {

}


text:
using System.Data.Entity;
using System.Linq;
using System.Management.Instrumentation;

namespace Gallifrey.Persistence.Application.Extension
{
    /// <summary>
    /// Entity extension to get a <see cref="DbSet{TEntity}"/> when you don't know which properties you have.
    /// </summary>
    public static class EntityFrameworkExtension
    {
        public static DbSet<T> GetDbSet<T>(this DbContext context) where T : class
        {
            var type = context.GetType();
            var properties = type.GetProperties();

            if (properties.All(r => r.PropertyType != typeof (DbSet<T>)))
                throw new InstanceNotFoundException(
                    string.Format("Could not find {0} instance using EntityFrameworkHelper.GetDbSet<T>", typeof (T).Name));

            var property = properties.First(r => r.PropertyType == typeof(DbSet<T>));
            return property.GetValue(context) as DbSet<T>;
        }
    }
}