text:
package server

import (
	"fmt"
	"sort"
	"time"

	"github.com/docker/distribution"
	"github.com/docker/distribution/context"
	"github.com/docker/distribution/digest"
	"github.com/docker/distribution/manifest/schema2"
	"github.com/docker/distribution/registry/middleware/registry"
	"github.com/docker/distribution/registry/storage"

	kerrors "k8s.io/apimachinery/pkg/api/errors"

	imageapi "github.com/openshift/origin/pkg/image/apis/image"
	imageapiv1 "github.com/openshift/origin/pkg/image/apis/image/v1"
)

const (
	// DigestSha256EmptyTar is the canonical sha256 digest of empty data
	digestSha256EmptyTar = digest.Digest("sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")

	// digestSHA256GzippedEmptyTar is the canonical sha256 digest of gzippedEmptyTar
	digestSHA256GzippedEmptyTar = digest.Digest("sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4")
)

// ByGeneration allows for sorting tag events from latest to oldest.
type ByGeneration []*imageapiv1.TagEvent

func (b ByGeneration) Less(i, j int) bool { return b[i].Generation > b[j].Generation }
func (b ByGeneration) Len() int           { return len(b) }
func (b ByGeneration) Swap(i, j int)      { b[i], b[j] = b[j], b[i] }

func init() {
	middleware.RegisterOptions(storage.BlobDescriptorServiceFactory(&blobDescriptorServiceFactory{}))
}

// blobDescriptorServiceFactory needs to be able to work with blobs
// directly without using links. This allows us to ignore the distribution
// of blobs between repositories.
type blobDescriptorServiceFactory struct{}

func (bf *blobDescriptorServiceFactory) BlobAccessController(svc distribution.BlobDescriptorService) distribution.BlobDescriptorService {
	return &blobDescriptorService{svc}
}

type blobDescriptorService struct {
	distribution.BlobDescriptorService
}

// Stat returns a a blob descriptor if the given blob is either linked in repository or is referenced in
// corresponding image stream. This method is invoked from inside of upstream's linkedBlobStore. It expects
// a proper repository object to be set on given context by upper openshift middleware wrappers.
func (bs *blobDescriptorService) Stat(ctx context.Context, dgst digest.Digest) (distribution.Descriptor, error) {
	context.GetLogger(ctx).Debugf("(*blobDescriptorService).Stat: starting with digest=%s", dgst.String())
	repo, found := repositoryFrom(ctx)
	if !found || repo == nil {
		err := fmt.Errorf("failed to retrieve repository from context")
		context.GetLogger(ctx).Error(err)
		return distribution.Descriptor{}, err
	}

	// if there is a repo layer link, return its descriptor
	desc, err := bs.BlobDescriptorService.Stat(ctx, dgst)
	if err == nil {
		// and remember the association
		repo.cachedLayers.RememberDigest(dgst, repo.blobrepositorycachettl, imageapi.DockerImageReference{
			Namespace: repo.namespace,
			Name:      repo.name,
		}.Exact())
		return desc, nil
	}

	context.GetLogger(ctx).Debugf("(*blobDescriptorService).Stat: could not stat layer link %s in repository %s: %v", dgst.String(), repo.Named().Name(), err)

	// First attempt: looking for the blob locally
	desc, err = dockerRegistry.BlobStatter().Stat(ctx, dgst)
	if err == nil {
		context.GetLogger(ctx).Debugf("(*blobDescriptorService).Stat: blob %s exists in the global blob store", dgst.String())
		// only non-empty layers is wise to check for existence in the image stream.
		// schema v2 has no empty layers.
		if !isEmptyDigest(dgst) {
			// ensure it's referenced inside of corresponding image stream
			if !imageStreamHasBlob(repo, dgst) {
				context.GetLogger(ctx).Debugf("(*blobDescriptorService).Stat: blob %s is neither empty nor referenced in image stream %s", dgst.String(), repo.Named().Name())
				return distribution.Descriptor{}, distribution.ErrBlobUnknown
			}
		}
		return desc, nil
	}

	if err == distribution.ErrBlobUnknown && remoteBlobAccessCheckEnabledFrom(ctx) {
		// Second attempt: looking for the blob on a remote server
		desc, err = repo.remoteBlobGetter.Stat(ctx, dgst)
	}

	return desc, err
}

func (bs *blobDescriptorService) Clear(ctx context.Context, dgst digest.Digest) error {
	repo, found := repositoryFrom(ctx)
	if !found || repo == nil {
		err := fmt.Errorf("failed to retrieve repository from context")
		context.GetLogger(ctx).Error(err)
		return err
	}

	repo.cachedLayers.ForgetDigest(dgst, imageapi.DockerImageReference{
		Namespace: repo.namespace,
		Name:      repo.name,
	}.Exact())
	return bs.BlobDescriptorService.Clear(ctx, dgst)
}

// imageStreamHasBlob returns true if the given blob digest is referenced in image stream corresponding to
// given repository. If not found locally, image stream's images will be iterated and fetched from newest to
// oldest until found. Each processed image will update local cache of blobs.
func imageStreamHasBlob(r *repository, dgst digest.Digest) bool {
	repoCacheName := imageapi.DockerImageReference{Namespace: r.namespace, Name: r.name}.Exact()
	if r.cachedLayers.RepositoryHasBlob(repoCacheName, dgst) {
		context.GetLogger(r.ctx).Debugf("found cached blob %q in repository %s", dgst.String(), r.Named().Name())
		return true
	}

	context.GetLogger(r.ctx).Debugf("verifying presence of blob %q in image stream %s/%s", dgst.String(), r.namespace, r.name)
	started := time.Now()
	logFound := func(found bool) bool {
		elapsed := time.Now().Sub(started)
		if found {
			context.GetLogger(r.ctx).Debugf("verified presence of blob %q in image stream %s/%s after %s", dgst.String(), r.namespace, r.name, elapsed.String())
		} else {
			context.GetLogger(r.ctx).Debugf("detected absence of blob %q in image stream %s/%s after %s", dgst.String(), r.namespace, r.name, elapsed.String())
		}
		return found
	}

	// verify directly with etcd
	is, err := r.imageStreamGetter.get()
	if err != nil {
		context.GetLogger(r.ctx).Errorf("failed to get image stream: %v", err)
		return logFound(false)
	}

	tagEvents := []*imageapiv1.TagEvent{}
	event2Name := make(map[*imageapiv1.TagEvent]string)
	for _, eventList := range is.Status.Tags {
		name := eventList.Tag
		for i := range eventList.Items {
			event := &eventList.Items[i]
			tagEvents = append(tagEvents, event)
			event2Name[event] = name
		}
	}
	// search from youngest to oldest
	sort.Sort(ByGeneration(tagEvents))

	processedImages := map[string]struct{}{}

	for _, tagEvent := range tagEvents {
		if _, processed := processedImages[tagEvent.Image]; processed {
			continue
		}
		if imageHasBlob(r, repoCacheName, tagEvent.Image, dgst.String(), !r.pullthrough) {
			tagName := event2Name[tagEvent]
			context.GetLogger(r.ctx).Debugf("blob found under istag %s/%s:%s in image %s", r.namespace, r.name, tagName, tagEvent.Image)
			return logFound(true)
		}
		processedImages[tagEvent.Image] = struct{}{}
	}

	context.GetLogger(r.ctx).Warnf("blob %q exists locally but is not referenced in repository %s/%s", dgst.String(), r.namespace, r.name)

	return logFound(false)
}

// imageHasBlob returns true if the image identified by imageName refers to the given blob. The image is
// fetched. If requireManaged is true and the image is not managed (it refers to remote registry), the image
// will not be processed. Fetched image will update local cache of blobs -> repositories with (blobDigest,
// cacheName) pairs.
func imageHasBlob(
	r *repository,
	cacheName,
	imageName,
	blobDigest string,
	requireManaged bool,
) bool {
	context.GetLogger(r.ctx).Debugf("getting image %s", imageName)
	image, err := r.getImage(digest.Digest(imageName))
	if err != nil {
		if kerrors.IsNotFound(err) {
			context.GetLogger(r.ctx).Debugf("image %q not found: imageName")
		} else {
			context.GetLogger(r.ctx).Errorf("failed to get image: %v", err)
		}
		return false
	}

	// in case of pullthrough disabled, client won't be able to download a blob belonging to not managed image
	// (image stored in external registry), thus don't consider them as candidates
	if requireManaged && !isImageManaged(image) {
		context.GetLogger(r.ctx).Debugf("skipping not managed image")
		return false
	}

	// someone asks for manifest
	if imageName == blobDigest {
		r.rememberLayersOfImage(image, cacheName)
		return true
	}

	if len(image.DockerImageLayers) == 0 && len(image.DockerImageManifestMediaType) > 0 {
		// If the media type is set, we can safely assume that the best effort to
		// fill the image layers has already been done. There are none.
		return false
	}

	for _, layer := range image.DockerImageLayers {
		if layer.Name == blobDigest {
			// remember all the layers of matching image
			r.rememberLayersOfImage(image, cacheName)
			return true
		}
	}

	meta, ok := image.DockerImageMetadata.Object.(*imageapi.DockerImage)
	if !ok {
		context.GetLogger(r.ctx).Errorf("image does not have metadata %s", imageName)
		return false
	}

	// only manifest V2 schema2 has docker image config filled where dockerImage.Metadata.id is its digest
	if image.DockerImageManifestMediaType == schema2.MediaTypeManifest && meta.ID == blobDigest {
		// remember manifest config reference of schema 2 as well
		r.rememberLayersOfImage(image, cacheName)
		return true
	}

	return false
}

func isEmptyDigest(dgst digest.Digest) bool {
	return dgst == digestSha256EmptyTar || dgst == digestSHA256GzippedEmptyTar
}


text:
package org.labrad.util

import org.labrad.Connection
import org.labrad.Labrad.Manager
import org.labrad.data._
import scala.concurrent.{ExecutionContext, Future}

class LookupProvider(send: Request => Future[Seq[Data]]) {

  private var serverCache = Map.empty[String, Long] // server name -> server id
  private var settingCache = Map.empty[(String, String), Long] // (server name, setting name) -> setting id

  def clearCache: Unit = {
    serverCache = Map.empty
    settingCache = Map.empty
  }

  def clearServer(name: String): Unit = {
    // TODO connect this to server disconnect messages from the manager
    settingCache = settingCache.filterKeys { case (server, _) => server != name }
    serverCache -= name
  }

  def resolve(request: NameRequest)(implicit ex: ExecutionContext): Future[Request] =
    lookupLocal(request) match {
      case Some(request) => Future.successful(request)
      case None => lookupRemote(request)
    }

  private def lookupLocal(request: NameRequest): Option[Request] = {
    val NameRequest(server, context, records) = request

    def lookupRecord(r: NameRecord): Option[Record] =
      settingCache.get((server, r.name)).map(id => Record(id, r.data))

    def allOrNone[T](opts: Seq[Option[T]]): Option[Seq[T]] =
      if (opts.forall(_.isDefined)) Some(opts.map(_.get)) else None

    for {
      id <- serverCache.get(server)
      recs <- allOrNone(records.map(lookupRecord))
    } yield Request(id, context, recs)
  }

  private def lookupRemote(request: NameRequest)(implicit ec: ExecutionContext): Future[Request] = {
    val NameRequest(server, context, records) = request
    for {
      id <- lookupServer(server)
      recs <- Future.sequence {
        records.map(r => lookupSetting(server, r.name).map(id => Record(id, r.data)))
      }
    } yield Request(id, context, recs)
  }

  private def lookupServer(server: String)(implicit ec: ExecutionContext): Future[Long] =
    serverCache.get(server) match {
      case Some(id) => Future.successful(id)
      case None => doLookup(Str(server)) map {
        case UInt(id) =>
          serverCache += server -> id
          id
      }
    }

  private def lookupSetting(server: String, setting: String)(implicit ec: ExecutionContext): Future[Long] =
    settingCache.get((server, setting)) match {
      case Some(id) => Future.successful(id)
      case None => doLookup(Cluster(Str(server), Str(setting))) map {
        case Cluster(_, UInt(id)) =>
          settingCache += (server, setting) -> id
          id
      }
    }

  private def doLookup(data: Data)(implicit ec: ExecutionContext): Future[Data] =
    send(Request(Manager.ID, records = Seq(Record(Manager.LOOKUP, data)))).map(_(0))
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ 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.
  -->

<user oid="b2a3f4ad-ad7b-4691-83d9-34d5ebb50a04"
	  xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	  xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	  xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
	  xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">

	<name>cheese</name>
	<description>The owner of Scumm Bar</description>
	<parentOrgRef oid="00000000-8888-6666-0000-100000000006" type="c:OrgType"/>
	<parentOrgRef oid="00000000-8888-6666-0000-100000000006" type="c:OrgType" relation="org:manager"/>
	<assignment id="1">
		<targetRef oid="00000000-8888-6666-0000-100000000006" type="c:OrgType"/>
	</assignment>
	<assignment id="2">
		<targetRef oid="00000000-8888-6666-0000-100000000006" type="c:OrgType" relation="org:manager"/>
	</assignment>
	<assignment id="3">
		<description>a-test-1</description>
		<targetRef type="RoleType" relation="org:approver">
			<filter>
				<q:equal>
					<q:path>name</q:path>
					<q:value>a-test-1</q:value>
				</q:equal>
			</filter>
		</targetRef>
	</assignment>
	<assignment id="4">
		<description>a-test-2a</description>
		<targetRef type="RoleType" relation="org:approver">
			<filter>
				<q:equal>
					<q:path>name</q:path>
					<q:value>a-test-2a</q:value>
				</q:equal>
			</filter>
		</targetRef>
	</assignment>
	<assignment id="5">
		<description>a-test-2b</description>
		<targetRef type="RoleType" relation="org:approver">
			<filter>
				<q:equal>
					<q:path>name</q:path>
					<q:value>a-test-2b</q:value>
				</q:equal>
			</filter>
		</targetRef>
	</assignment>
	<assignment id="6">
		<description>a-test-4</description>
		<targetRef type="RoleType" relation="org:approver">
			<filter>
				<q:equal>
					<q:path>name</q:path>
					<q:value>a-test-4</q:value>
				</q:equal>
			</filter>
		</targetRef>
	</assignment>

	<assignment id="1000">
		<targetRef oid="00000000-0000-0000-0000-000000000008" type="RoleType"/>    <!-- End user -->
	</assignment>
	<!--<assignment id="1001">-->
		<!--<targetRef oid="00000000-0000-0000-0000-00000000000a" type="RoleType"/>    <!– Approver –>-->
	<!--</assignment>-->
	<fullName>Ignatius Cheese</fullName>
	<givenName>Ignatius</givenName>
	<familyName>Cheese</familyName>
	<emailAddress>cheese@evolveum.com</emailAddress>
	<credentials>
		<password>
			<value>a123456</value>
		</password>
	</credentials>
</user>


text:
<?php

namespace Furry\Database\Blueprint\Column;

use Furry\Database\Blueprint\Column;

/**
 * Class SQLiteColumn
 * @package Furry\Database\Blueprint\Column
 */
class SQLiteColumn extends Column
{
    public const MODIFY_COLUMN_TYPES = [
        'int' => 'integer',
        'tinyint' => 'integer',
        'smallint' => 'integer',
        'bigint' => 'integer',
        'double' => 'float',
        'mediumtext' => 'text',
        'longtext' => 'text',
        'data' => 'blob',
        'bool' => 'tinyint(1)',
        'timestamp' => 'datetime'
    ];

    /** @inheritdoc */
    public function buildQuery() : string
    {
        $name = $this->connection->quoteColumnName($this->name);
        $type = static::MODIFY_COLUMN_TYPES[$this->type] ?? $this->type;

        $nullable = $this->nullable ? 'NULL' : 'NOT NULL';
        $autoincrement = $this->autoincrement ? 'AUTOINCREMENT' : '';

        $defaultValue = $this->connection->escape($this->default);
        $default = ($this->hasDefault) ? "DEFAULT {$defaultValue}" : '';

        $primary = $this->primary ? 'PRIMARY KEY' : '';

        $params = implode(', ', $this->params);
        $params = ($params) ? "({$params})" : '';

        return "{$name} {$type}{$params} {$primary} {$autoincrement} {$nullable} {$default}";
    }
}


text:
from setuptools import setup, find_packages

setup(
    name="cuboid",
    version="0.0.1",
    packages=find_packages()
)


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

    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>

    <artifactId>dbus-java-transport-tcp</artifactId>

    <name>${project.artifactId}</name>

    <description>
        dbus-java transport providing tcp support.
    </description>

    <parent>
        <groupId>com.github.hypfvieh</groupId>
        <artifactId>dbus-java-parent</artifactId>
        <version>4.2.2-SNAPSHOT</version>
    </parent>

    <properties>
        <parentDir>${project.parent.basedir}</parentDir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.github.hypfvieh</groupId>
            <artifactId>dbus-java-core</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

</project>


text:
bundle install --standalone --binstubs
export PATH="$PWD/bin:$PATH"


text:
package transport

// These transports are supported by CoreDNS.
const (
	DNS   = "dns"
	TLS   = "tls"
	GRPC  = "grpc"
	HTTPS = "https"
)

// Port numbers for the various transports.
const (
	// Port is the default port for DNS
	Port = "53"
	// TLSPort is the default port for DNS-over-TLS.
	TLSPort = "853"
	// GRPCPort is the default port for DNS-over-gRPC.
	GRPCPort = "443"
	// HTTPSPort is the default port for DNS-over-HTTPS.
	HTTPSPort = "443"
)


text:
**0.0.77**, _2017.03.28_

 * **remove "type" : "nodespec"** where namekey is defined

**0.0.76**, _2017.03.15_

 * **added pkg namespace**
 * **use explicit namespacing** to resolve "when" and "argprops" values
 * **make mulitiple hydrated** namespaces usable to define new namespace

**0.0.75**, _2017.02.18_

 * **added more tests**
 * **huge speed improvments**
   * replacing `setTimeout` w/ `setImmediate`
   * replacing accumasync w/ for-loop callback idiom

**0.0.74**, _2017.02.13_

 * **added support** for composite nodes
 * **move hyperscript functions** to page node

**0.0.73**, _2017.02.11_

 * **added timerecord** file for recording render times
 * **removed destructured callback assignments**
 * **updated patch process** to loop patched nodes only
 * **updated templating** to always use locale page name and node className
 * **shortened className** boilerplate '.:className.:page' becomes '.:class.:pg'
 * **added example** composite node, 'pglisttext'

**0.0.72**, _2017.02.10_

 * **added page object iframe**
 * **merged list processing pipelines** for nodes (datanode and pagenode)
 * **removed complex list processing** from datanode

**0.0.71**, _2017.02.05_

 * **added page objects img and svg**

**0.0.70**, _2017.02.03_

 * **added todo list example**
 * **added basic** directory with scripts for common page objects

**0.0.69**, _2017.02.02_

 * **added namespacing for all data hydration**
 * **added files** for specifically adapting keys and patterns
 * **removed file** for "opt" style page nodes
 * **updated** hydration for some data to use same args in function call

**0.0.67**, _2017.01.27_

 * **updated accessor** with 'rm' functions
 * **updated node errorlog** to persist graph and node at error
 * **added namespacing** to define namespace used to collect property values
 * **added rehydration** to patch process, completely refresh partial nodes
 * **added rmchild and addchild** methods for list data nodes
 * **removed definition of clutter** properties on data partial spec
 * **added patch record to "patch" function return values**

**0.0.66**, _2017.01.22_

 * **added accessor** functions for accessing fixed number of data types found on nodes

**0.0.65**, _2017.01.19_

 * **improved patching** behaviour, foreign key changes => rebuild dependents

**0.0.62**, _2017.01.13_

 * **simplified publishing interface** with fewer functions, meaningful names
 * **added changelog** content to README
 * **removed subject filtering** now handled at specmob layer, all spec values
 * **moved refkey hydration** to occur before child nodes are defined
 * **added convenience method** getkeynext to pgpartial
 * **removed cast option** from pgpartial behaviour, determines type dynamically
 * **added handling of boolean type values** on partial data


text:
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Raml.Parser.Expressions;

namespace Raml.Parser.Tests
{
    [TestClass]
    public class TypesTests
    {
        private static RamlParser parser;

        [TestMethod]
        public async Task ShouldParseComplexTypes()
        {
            var raml = await Parse("specifications/complextypes.raml");

            Assert.AreEqual(2, raml.Types["Movie"].Object.Properties["director"].Object.Properties.Count);

            Assert.AreEqual("Movie[]", raml.Types["Movies"].Type);
            Assert.IsNotNull(raml.Types["Movies"].Array);

            Assert.AreEqual(2, raml.Types["SomeArray"].Array.Items.Object.Properties.Count);
            Assert.AreEqual("integer", raml.Types["SomeArray"].Array.Items.Object.Properties["prop1"].Scalar.Type);
        }

        [TestMethod]
        public async Task ShouldParseTypes_Movies1()
        {
            var raml = await Parse("specifications/movietype.raml");

            Assert.AreEqual(1, raml.Types.Count);
            Assert.AreEqual("object", raml.Types["Movie"].Type);
        }

        [TestMethod]
        public async Task ShouldParseAsRequiredByDefault()
        {
            var raml = await Parse("specifications/movietype.raml");
            Assert.AreEqual(false, raml.Types["Movie"].Object.Properties.First(p => p.Key == "storyline").Value.Required);
            Assert.AreEqual(false, raml.Types["Movie"].Object.Properties.First(p => p.Key == "rented").Value.Required);
            Assert.AreEqual(true, raml.Types["Movie"].Object.Properties.First(p => p.Key == "genre").Value.Required);
            Assert.AreEqual(true, raml.Types["Movie"].Object.Properties.First(p => p.Key == "cast").Value.Required);
            Assert.AreEqual(true, raml.Types["Movie"].Object.Properties.First(p => p.Key == "name").Value.Required);
        }

        [TestMethod]
        public async Task ShouldHandleTypeProperties_Movies1()
        {
            var raml = await Parse("specifications/movietype.raml");

            Assert.AreEqual(255, raml.Types["Movie"].Object.Properties.First(p => p.Key == "name").Value.Scalar.MaxLength);
            Assert.AreEqual(1, raml.Types["Movie"].Object.Properties.First(p => p.Key == "duration").Value.Scalar.Minimum);
            Assert.AreEqual(false, raml.Types["Movie"].Object.Properties.First(p => p.Key == "duration").Value.Required);
            Assert.AreEqual(9, raml.Types["Movie"].Object.Properties.Count());
        }

        [TestMethod]
        public async Task ShouldHandleTypeExpressions()
        {
            var raml = await Parse("specifications/typeexpressions.raml");

            Assert.AreEqual("Movie[]", raml.Resources.First().Methods.First(m => m.Verb == "get").Responses.First().Body.First().Value.Type);
            Assert.AreEqual("string | Movie", raml.Resources.First().Methods.First(m => m.Verb == "put").Body.First().Value.Type);
            Assert.AreEqual("(string | Movie)[]", raml.Resources.First().Methods.First(m => m.Verb == "post").Body.First().Value.Schema);
        }

        [TestMethod]
        public async Task ShouldHandleCustomScalars()
        {
            var raml = await Parse("specifications/customscalar.raml");

            Assert.AreEqual(2, raml.Types.Count);
        }

        [TestMethod]
        public async Task ShouldParseNumberFormats()
        {
            var raml = await Parse("specifications/numbers.raml");
            Assert.AreEqual("long", raml.Types["sample"].Object.Properties.First(p => p.Key == "longprop").Value.Scalar.Format);
            Assert.AreEqual("int64", raml.Types["sample"].Object.Properties.First(p => p.Key == "int64prop").Value.Scalar.Format);
            Assert.AreEqual("int32", raml.Types["sample"].Object.Properties.First(p => p.Key == "int32prop").Value.Scalar.Format);
            Assert.AreEqual("int16", raml.Types["sample"].Object.Properties.First(p => p.Key == "int16prop").Value.Scalar.Format);
            Assert.AreEqual("int8", raml.Types["sample"].Object.Properties.First(p => p.Key == "int8prop").Value.Scalar.Format);
            Assert.AreEqual("int", raml.Types["sample"].Object.Properties.First(p => p.Key == "intprop").Value.Scalar.Format);
            Assert.AreEqual("float", raml.Types["sample"].Object.Properties.First(p => p.Key == "floatprop").Value.Scalar.Format);
            Assert.AreEqual("double", raml.Types["sample"].Object.Properties.First(p => p.Key == "doubleprop").Value.Scalar.Format);

            Assert.AreEqual("long", raml.Types["myLong"].Scalar.Format);

            Assert.AreEqual("long", raml.Resources.First(r => r.RelativeUri == "/persons").Methods.First().QueryParameters.First().Value.Format);
            //Assert.AreEqual("long", raml.Resources.First(r => r.RelativeUri == "/other").Methods.First().Body.First().Value.InlineType.Scalar.Format);
        }

        private static async Task<RamlDocument> Parse(string filePath)
        {
            parser = new RamlParser();
            var fi = new FileInfo(filePath);
            var raml = await parser.LoadAsync(fi.FullName);
            return raml;
        }

    }
}


text:
using System;
using rho.common;

namespace rho.db
{
    public interface IDBResult : IDisposable
    {
    int getColCount();
	String getColName(int nCol);
	String getOrigColName(int nCol);

	//New
    boolean isEnd();
    void next();
	String getStringByIdx(int nCol);
	int getIntByIdx(int nCol);
	long getLongByIdx(int nCol);
	String getUInt64ByIdx(int nCol);

	Object /*RubyValue*/ getRubyValueByIdx(int nCol);
	boolean isNullByIdx(int nCol);

	Object /*RubyValue*/ getRubyValue(String colname);
	int getInt(String colname);
	String getString(String colname);

	Object[] getCurData();

    boolean isNonUnique();

    void close();
    }
}


text:
<?php

/**
 * @namespace
 */
namespace Admin\Event;

/**
 * @uses Zend\Mvc\MvcEvent
 * @uses User\Controller\Plugin\UserAuthentication
 * @uses User\Acl\Acl
 */
use Zend\Mvc\MvcEvent as MvcEvent,
    Admin\Controller\Plugin\UserAuthentication as AuthPlugin,
    Admin\Acl\Acl as AclClass;
use Zend\Mvc\Controller\AbstractActionController;

/**
 * Authentication Event Handler Class
 *
 * This Event Handles Authentication
 *
 * @category  User
 * @package   User_Event
 * @copyright Copyright (c) 2011, Marco Neumann
 * @license   http://binware.org/license/index/type:new-bsd New BSD License
 */
class Authentication extends AbstractActionController
{
	protected $utilisateurTable;

	public function getUtilisateurTable(){
		if(!$this->utilisateurTable){
			$sm = $this->getServiceLocator();
			$this->utilisateurTable = $sm->get('Admin\Model\UtilisateursTable');
		}
		return $this->utilisateurTable;
	}

	/**
	 * =========================================================================
	 * =========================================================================
	 * =========================================================================
	 */

    /**
     * @var AuthPlugin
     */
    protected $_userAuth = null;

    /**
     * @var AclClass
     */
    protected $_aclClass = null;

    /**
     * preDispatch Event Handler
     *
     * @param \Zend\Mvc\MvcEvent $event
     * @throws \Exception
     */
    public function preDispatch(MvcEvent $event)
    {
        //@todo - C'est ici qu'on utilise le plugin UserAuthentification pour verifier si l utilisateur est connecté par exemple
        $userAuth = $this->getUserAuthenticationPlugin();

        //@todo - On appel la classe ACL pour la gestion des roles et des ressources
        $acl = $this->getAclClass();

        $role  = AclClass::DEFAULT_ROLE;

        if ($userAuth->hasIdentity()) {

            $pseudo = $userAuth->getIdentity();

            $user = $this->getUtilisateurTable()->getUtilisateursWithUsername($pseudo);

            //$role  = 'member'; //@todo - Get role from user!
            $role  = $user['role_personne'] ;
            //si le role n'est pas encore defini dans le jeu d'ACL
            if(!$acl->hasRole($role)){
            	echo '
Le role ... ('.$role.')  n\' est pa défini dans le jeu d\'ACL
';
            	exit();
            }
        }

        $routeMatch = $event->getRouteMatch();
        $controller = $routeMatch->getParam('controller');
        $action     = $routeMatch->getParam('action');

        //Si la ressource n'existe pas on lance une exception
        if (!$acl->hasResource($controller)) {
        	if (!$userAuth->hasIdentity()) {
        		$chemin = $this->getServiceLocator()->get('Request')->getBasePath();
        		header('Location: '.$chemin.'/admin');
        		exit() ;
        	}
        	echo '
La Ressource

'.$controller.'

n\'est pas defini
';
        	exit();
        }

        //Si la ressource existe et que l'utilisateur n'en est pas accès
        if (!$acl->isAllowed($role, $controller, $action)) {

        	if (!$userAuth->hasIdentity()) {
        		$chemin = $this->getServiceLocator()->get('Request')->getBasePath();
        		header('Location: '.$chemin.'/admin');
        		exit() ;
        	}
            echo '
vous n\'avez pas accès a cette page ... ('.$action.')  vous n\' avez pas les privilèges requis
';
            exit();
        }

        //Sinon c 'est bon
    }

    /**
     * Sets Authentication Plugin
     *
     * @param \User\Controller\Plugin\UserAuthentication $userAuthenticationPlugin
     * @return Authentication
     */
    public function setUserAuthenticationPlugin(AuthPlugin $userAuthenticationPlugin)
    {
        $this->_userAuth = $userAuthenticationPlugin;

        return $this;
    }

    /**
     * Gets Authentication Plugin
     *
     * @return \User\Controller\Plugin\UserAuthentication
     */
    public function getUserAuthenticationPlugin()
    {
        if ($this->_userAuth === null) {
            $this->_userAuth = new AuthPlugin();
        }

        return $this->_userAuth;
    }

    /**
     * Sets ACL Class
     *
     * @param \User\Acl\Acl $aclClass
     * @return Authentication
     */
    public function setAclClass(AclClass $aclClass)
    {
        $this->_aclClass = $aclClass;

        return $this;
    }

    /**
     * Gets ACL Class
     *
     * @return \User\Acl\Acl
     */
    public function getAclClass()
    {
        if ($this->_aclClass === null) {
            $this->_aclClass = new AclClass(array());
        }

        return $this->_aclClass;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecanora superposita Zahlbr.

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using ZXing.Common;
using ZXing.Common.ReedSolomon;
using ZXing.QrCode.Internal;

// I feel like I should apologize for the crimes against humanity that the
//  following code commits. If anyone knows any other way to accomplish this,
//  please let me know so I can remove this horrible train-wreck.
namespace AnimalCrossingQR
{
    public class StructuredAppendQR
    {
        private static readonly int[][] MaxQRSize =
        {
           new int[] { 17, 32, 53, 78, 106, 134, 154, 192, 230, 271, 321, 367, 425, 458, 520, 586, 644,
               718, 792, 858, 929, 1003, 1091, 1171, 1273, 1367, 1465, 1528, 1628, 1732, 1840, 1952,
               2068, 2188, 2303, 2431, 2563, 2699, 2809, 2953 },
           new int[] { 14, 26, 42, 62, 84, 106, 122, 152, 180, 213, 251, 287, 331, 362, 412, 450, 504,
               560, 624, 666, 711, 779, 857, 911, 997, 1059, 1125, 1190, 1264, 1370, 1452, 1538, 1628,
               1722, 1809, 1911, 1989, 2099, 2213, 2331 },
           new int[] { 11, 20, 32, 46, 60, 74, 86, 108, 130, 151, 177, 203, 241, 258, 292, 322, 364,
                394, 442, 482, 509, 565, 611, 661, 715, 751, 805, 868, 908, 982, 1030, 1112, 1168, 1228,
                1283, 1351, 1423, 1499, 1579, 1663 },
           new int[] { 7, 14, 24, 34, 44, 58, 64, 84, 98, 119, 137, 155, 177, 194, 220, 250, 280, 310,
                338, 382, 403, 439, 461, 511, 535, 593, 625, 658, 698, 742, 790, 842, 898, 958, 983,
                1051, 1093, 1139, 1219, 1273 },
        };

        private static Action<int, BitArray> terminateBits;
        private static Func<BitArray, int, int, int, BitArray> interleaveWithECBytes;
        private static Func<BitArray, ErrorCorrectionLevel, ZXing.QrCode.Internal.Version, ByteMatrix, int> chooseMaskPattern;

        static StructuredAppendQR()
        {
            // Proving that 'private internal' is just a suggestion. Seriously, I'm sorry.

            terminateBits = (a, b) => typeof(ZXing.QrCode.Internal.Encoder)
                .GetMethod("terminateBits", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)
                .Invoke(null, new object[] { a, b });

            interleaveWithECBytes = (a, b, c, d) => (BitArray)typeof(ZXing.QrCode.Internal.Encoder)
                .GetMethod("interleaveWithECBytes", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)
                .Invoke(null, new object[] { a, b, c, d });

            chooseMaskPattern = (a, b, c, d) => (int)typeof(ZXing.QrCode.Internal.Encoder)
                .GetMethod("chooseMaskPattern", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)
                .Invoke(null, new object[] { a, b, c, d });
        }

        private static int GetSmallestVersion(int size, ErrorCorrectionLevel errorCorrectionLevel)
        {
            return Array.FindIndex(MaxQRSize[errorCorrectionLevel.ordinal()], i => i >= size) + 1;
        }

        public static ByteMatrix CreateRawQR(byte[] rawData, ErrorCorrectionLevel errorCorrectionLevel)
        {
            int versionNumber = GetSmallestVersion(rawData.Length, errorCorrectionLevel);
            ZXing.QrCode.Internal.Version version = ZXing.QrCode.Internal.Version.getVersionForNumber(versionNumber);

            BitArray dataBits = new BitArray();
            foreach (byte b in rawData)
                dataBits.appendBits(b, 8);

            ZXing.QrCode.Internal.Version.ECBlocks ecBlocks = version.getECBlocksForLevel(errorCorrectionLevel);
            int bytesLength = version.TotalCodewords - ecBlocks.TotalECCodewords;
            terminateBits(bytesLength, dataBits);

            BitArray resultBits = interleaveWithECBytes(dataBits, version.TotalCodewords, bytesLength, ecBlocks.NumBlocks);

            ByteMatrix matrix = new ByteMatrix(version.DimensionForVersion, version.DimensionForVersion);
            int maskPattern = chooseMaskPattern(resultBits, errorCorrectionLevel, version, matrix);

            MatrixUtil.buildMatrix(resultBits, errorCorrectionLevel, version, maskPattern, matrix);
            return matrix;
        }
    }
}


text:
/**
 * @module whynot
 */
define(
	function() {
		'use strict';

		/**
		 * The Assembler is used to generate a whynot program by appending instructions.
		 *
		 * @class Assembler
		 * @constructor
		 */
		function Assembler() {
			this.program = [];
		}

		function addInstruction(program, op, func, data) {
			var instruction = {
				op: op,
				func: func,
				data: data
			};
			program.push(instruction);
			return instruction;
		}

		/**
		 * The 'test' instruction validates and consumes an input item.
		 * If the matcher returns true, execution continues in the next Generation, otherwise
		 * execution of the current Thread ends.
		 *
		 * @method test
		 *
		 * @param {Function} matcher Callback to invoke for the input,
		 *                             should return true to accept, false to reject.
		 * @param {Any}      [data]  Data to be passed to the matcher callback. Defaults to null.
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.test = function(matcher, data) {
			return addInstruction(
				this.program,
				'test',
				matcher,
				data === undefined ? null : data
			);
		};

		/**
		 * The 'jump' instruction continues execution in the current Generation at any number
		 * of other locations. A new Thread will be spawned for each target.
		 *
		 * @method jump
		 *
		 * @param {Number[]} targets Program counters at which to continue execution
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.jump = function(targets) {
			return addInstruction(
				this.program,
				'jump',
				null,
				targets
			);
		};

		function defaultRecorder(data, inputIndex) {
			return data;
		}

		/**
		 * The 'record' instruction adds a custom record to the current Thread's trace and
		 * resumes execution at the next instruction in the same Generation.
		 *
		 * @method record
		 *
		 * @param {Any}      data       Data to record
		 * @param {Function} [recorder] Callback to generate the record based on data and the
		 *                                current input position. Defaults to recording data.
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.record = function(data, recorder) {
			return addInstruction(
				this.program,
				'record',
				recorder || defaultRecorder,
				data
			);
		};

		/**
		 * The 'bad' instruction permanently lowers the priority of all threads originating in
		 * the current one.
		 *
		 * @method bad
		 *
		 * @param {Number} cost Amount to increase badness with. Defaults to 1.
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.bad = function(cost) {
			return addInstruction(
				this.program,
				'bad',
				null,
				cost || 1
			);
		};

		/**
		 * The 'accept' instruction causes the VM to yield the current Thread's Trace upon
		 * completion, provided all input has been consumed. Otherwise, the Thread ends.
		 *
		 * @method accept
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.accept = function() {
			return addInstruction(
				this.program,
				'accept',
				null,
				null
			);
		};

		/**
		 * The 'fail' instruction ends the current Thread.
		 *
		 * @method fail
		 *
		 * @param {Function} [predicate] Optional callback to make the fail conditional, if this
		 *                                 returns true the thread will end, otherwise it will
		 *                                 continue.
		 *
		 * @return {Object} The new instruction
		 */
		Assembler.prototype.fail = function(predicate) {
			return addInstruction(
				this.program,
				'fail',
				predicate || null,
				null
			);
		};

		return Assembler;
	}
);


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _alaska = require('alaska');

/**
 * @class PageService
 */
class PageService extends _alaska.Service {
  constructor(options) {
    options = options || { dir: '', id: '' };
    options.dir = options.dir || __dirname;
    options.id = options.id || 'alaska-page';
    super(options);
  }
}

exports.default = new PageService();


text:
"""
Add custom attributes to objects to describe various different types of
constraints. These user properties are stored in a way that they are to be
parsed by Unity's AssetPostprocessor in order to transport a rig into Unity for
evaluation at run-time.

\b Requirements: Unity Pro with ImportMayaRigs.cs editor script and all its
dependencies.

\par Supported constraint types:
	- aimConstraint
	- orientConstraint
	- pointConstraint

\b Creation \b Info:

\b Donations: http://adammechtley.com/donations/

\b License: The MIT License

Copyright (c) 2011 Adam Mechtley (http://adammechtley.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

\namespace amTools.unity.rigs.constraints
"""

import re
import maya.cmds as cmds
import maya.mel as mel
import amTools.utilities.unity as util
reload(util)

def exportConstraints():
	"""Add user properties for all supported node types."""
	doConstraints('aimConstraint')
	doConstraints('orientConstraint')
	doConstraints('pointConstraint')

def doConstraints(constraintType):
	"""Adds user properties to objects controlled by constraints."""
	# determine the outgoing plug name and attribute lists based on the constraint type
	outPlug = ''
	attributeList = []
	if (constraintType == 'aimConstraint'):
		outPlug = 'constraintRotate'
		attributeList = ['offset', 'aimVector', 'upVector', 'worldUpVector', 'worldUpMatrix', 'worldUpType']
	elif (constraintType == 'orientConstraint'):
		outPlug = 'constraintRotate'
		attributeList = ['offset', 'interpType']
	elif (constraintType == 'pointConstraint'):
		outPlug = 'constraintTranslate'
		attributeList = ['offset', 'constraintOffsetPolarity']

	# set up each constraint
	constraints = cmds.ls(type=constraintType)
	for constraint in constraints:
		# first resolve naming conflicts in case any exist
		constraint = cmds.rename(constraint, constraint)
		# NOTE: Unity implementation does not allow per-child-plug behavior, so just check first child plug
		constrainedObjects = cmds.listConnections('%s.%sX'%(constraint, outPlug), source=False)
		if not constrainedObjects: continue
		for obj in constrainedObjects:
			if constraintType == 'pointConstraint': util.addAttributeValues(obj, constraint, attributeList)
			else: util.addAttributeValues(obj, constraint, attributeList, eulerAttributes=['offset'])
			util.addAttributeValues(obj, constraint, mel.eval('%s -q -wal %s'%(constraintType, constraint)))
			try:
				targets = ['target[%s].targetParentMatrix'%re.search('\d+$', t).group(0) for t in mel.eval('%s -q -wal %s'%(constraintType, constraint))]
				util.addAttributeValues(obj, constraint, targets)
			except: pass


text:
// -*- coding: utf-8 -*-
// Copyright (C) 2006-2010 Rosen Diankov (rosen.diankov@gmail.com)
//
// This file is part of OpenRAVE.
// OpenRAVE is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
/** \file physicsengine.h
    \brief Physics engine related definitions.

    Automatically included with \ref openrave.h
 */
#ifndef OPENRAVE_PHYSICSENGINE_H
#define OPENRAVE_PHYSICSENGINE_H

namespace OpenRAVE {

/// basic options for physics engine
enum PhysicsEngineOptions
{
    PEO_SelfCollisions = 1, ///< if set, physics engine will use contact forces from self-collisions
};

/** \brief <b>[interface]</b> The physics engine interfaces supporting simulations and dynamics. See \ref arch_physicsengine.
    \ingroup interfaces
 */
class OPENRAVE_API PhysicsEngineBase : public InterfaceBase
{
public:
    PhysicsEngineBase(EnvironmentBasePtr penv) : InterfaceBase(PT_PhysicsEngine, penv) {
    }
    virtual ~PhysicsEngineBase() {
    }

    /// return the static interface type this class points to (used for safe casting)
    static inline InterfaceType GetInterfaceTypeStatic() {
        return PT_PhysicsEngine;
    }

    /// Set basic physics engine using the PhysicsEngineOptions enum
    virtual bool SetPhysicsOptions(int physicsoptions) = 0;
    virtual int GetPhysicsOptions() const = 0;

    /// \deprecated (10/11/18) use SendCommand instead
    virtual bool SetPhysicsOptions(std::ostream& sout, std::istream& sinput) RAVE_DEPRECATED = 0;

    /// called when environment sets this physics engine, engine assumes responsibility for KinBody::_pPhysicsData
    virtual bool InitEnvironment() = 0;

    /// called when environment switches to a different physics engine
    /// has to clear/deallocate any memory associated with KinBody::_pPhysicsData
    virtual void DestroyEnvironment() = 0;

    /// \brief notified when a new body has been initialized in the environment. Return
    virtual bool InitKinBody(KinBodyPtr body) = 0;

    /// \brief notified when a body has been removed from the environment.
    virtual void RemoveKinBody(KinBodyPtr body) = 0;

    /// \brief Force the body velocity of a link, velocities correspond to the link's coordinate system origin.
    ///
    /// \param[in] link link to set velocities.
    /// \param[in] linearvel linear velocity of base link
    /// \param[in] angularvel angular velocity rotation_axis*theta_dot
    virtual bool SetLinkVelocity(KinBody::LinkPtr link, const Vector& linearvel, const Vector& angularvel) = 0;

    /// \brief Sets the velocities for each link, velocities correspond to the link's coordinate system origin.
    ///
    /// \param[in] body the body to query velocities from.
    /// \param[in] velocities sets the linear and angular (axis * angular_speed) velocities for each link
    virtual bool SetLinkVelocities(KinBodyPtr body, const std::vector<std::pair<Vector,Vector> >& velocities) = 0;

    /// \brief Gets the velocity of a link, velocities correspond to the link's coordinate system origin.
    /// \param[out] linearvel - linear velocity of base link
    /// \param[out] angularvel - angular velocity rotation_axis*theta_dot
    virtual bool GetLinkVelocity(KinBody::LinkConstPtr link, Vector& linearvel, Vector& angularvel) = 0;

    /// \brief Sets the velocities for each link, velocities correspond to the link's coordinate system origin.
    /// \param[out] velocities the linear and angular (axis * angular_speed) velocities for each link.
    virtual bool GetLinkVelocities(KinBodyConstPtr body, std::vector<std::pair<Vector,Vector> >& velocities) = 0;

    /// add a force at a particular position in a link
    /// \param force the direction and magnitude of the force
    /// \param position in the world where the force is getting applied
    /// \param bAdd if true, force is added to previous forces, otherwise it is set
    virtual bool SetBodyForce(KinBody::LinkPtr link, const Vector& force, const Vector& position, bool bAdd) OPENRAVE_DUMMY_IMPLEMENTATION;

    /// adds torque to a body (absolute coords)
    /// \param link the link to add a torque to
    /// \param torque torque vector
    /// \param bAdd if true, torque is added to previous torques, otherwise it is set
    virtual bool SetBodyTorque(KinBody::LinkPtr link, const Vector& torque, bool bAdd) OPENRAVE_DUMMY_IMPLEMENTATION;

    /// adds torque to a joint
    /// \param pjoint - the joint the torque is added to
    /// \param pTorques - the torques added to the joint. Pointer because the joint dof can be greater than 1.
    virtual bool AddJointTorque(KinBody::JointPtr pjoint, const std::vector<dReal>& pTorques) OPENRAVE_DUMMY_IMPLEMENTATION;

    /// \deprecated (13/03/25)
    virtual bool GetLinkForceTorque(KinBody::LinkConstPtr link, Vector& force, Vector& torque);

    /// Return forces and torques exerted by a joint wrt the joint anchor frame.
    /// \param[in] joint a constant pointer to a joint
    /// \param[out] force current overall force exerted by the joint
    /// \param[out] torque current overall torque exerted by the joint
    virtual bool GetJointForceTorque(KinBody::JointConstPtr joint, Vector& force, Vector& torque) OPENRAVE_DUMMY_IMPLEMENTATION;

    /// set the gravity direction
    virtual void SetGravity(const Vector& gravity) OPENRAVE_DUMMY_IMPLEMENTATION;
    virtual Vector GetGravity() OPENRAVE_DUMMY_IMPLEMENTATION;

    /// dynamically simulate system for fTimeElapsed seconds
    /// add torques to the joints of the body. Torques disappear after one timestep of simulation
    virtual void SimulateStep(dReal fTimeElapsed)=0;

    /// \deprecated (10/11/18)
    virtual bool GetBodyVelocity(KinBodyConstPtr body, std::vector<Vector>& vLinearVelocities, std::vector<Vector>& vAngularVelocities) RAVE_DEPRECATED {
        std::vector<std::pair<Vector,Vector> > velocities;
        if( !GetLinkVelocities(body, velocities) ) {
            return false;
        }
        vLinearVelocities.resize(velocities.size());
        vAngularVelocities.resize(velocities.size());
        for(size_t i = 0; i < velocities.size(); ++i) {
            vLinearVelocities[i] = velocities[i].first;
            vAngularVelocities[i] = velocities[i].second;
        }
        return true;
    }

    virtual bool SetBodyVelocity(KinBodyPtr body, const std::vector<Vector>& vLinearVelocities, const std::vector<Vector>& vAngularVelocities) RAVE_DEPRECATED {
        BOOST_ASSERT(vLinearVelocities.size()==vAngularVelocities.size());
        std::vector<std::pair<Vector,Vector> > velocities(vLinearVelocities.size());
        for(size_t i = 0; i < velocities.size(); ++i) {
            velocities[i].first = vLinearVelocities[i];
            velocities[i].second = vAngularVelocities[i];
        }
        return SetLinkVelocities(body,velocities);
    }

protected:
    /// \deprecated (12/12/11)
    virtual void SetPhysicsData(KinBodyPtr body, UserDataPtr data) RAVE_DEPRECATED {
        body->SetUserData(GetXMLId(), data);
    }

private:
    virtual const char* GetHash() const {
        return OPENRAVE_PHYSICSENGINE_HASH;
    }
};

} // end namespace OpenRAVE

#endif


text:
import React from 'react';
import ZeroSum from '.';

export default <ZeroSum onNext={() => console.log('Next')} />;


text:
<?php

namespace Aidantwoods\BetterOptions;

class Response
{
    private $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function getMessage() : string
    {
        return $this->message;
    }
}


text:
//  HTMLNamespace.h
//
//  Public domain. https://github.com/nolanw/HTMLReader

#import "HTMLSupport.h"

NS_ASSUME_NONNULL_BEGIN

/**
    The three namespaces that this HTML parser cares about.

    For more information, see http://www.whatwg.org/specs/web-apps/current-work/multipage/namespaces.html#namespaces
 */
typedef NS_ENUM(NSInteger, HTMLNamespace)
{
    /// The default namespace is HTML.
    HTMLNamespaceHTML,

    /// Most elements within <math> tags are in the MathML namespace.
    HTMLNamespaceMathML,

    /// Most elements within <svg> tags are in the SVG namespace.
    HTMLNamespaceSVG,
};

NS_ASSUME_NONNULL_END


text:
Taquin game solve by an IA (A* algorithm) written in Java for a small project in university

* **Author:** Louis Barranqueiro
* **Java:** v1.7

## Getting started

Get source code: `git clone https://github.com/LouisBarranqueiro/ia-taquin-game.git`

## Documentation

#### Heuristic

There is two heuristic used to evaluate a taquin state is :
**Heuristic 1**: calculate number of box incorrectly placed
**Heuristic 2**: calculate number of moves needed to solve the taquin game

## License

ia-taquin-game-solver is released under the terms of the [MIT License](https://github.com/LouisBarranqueiro/ia-taquin-game-solver/blob/master/LICENSE)


text:
package br.com.joffer.plugin.android.domain;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
import org.springframework.shell.core.annotation.CliCommand;
import org.springframework.stereotype.Component;

import br.com.joffer.scaffold.domain.BasicShell;
import br.com.joffer.scaffold.domain.Configurations;

@Component
public class AndroidShell extends BasicShell {

	@Autowired
	private AndroidProjectGenerator androidProjectGenerator;

	@Autowired
	private ActivityGenerator activityGenerator;

	@Autowired
	private Configurations configurations;

	@CliAvailabilityIndicator("generate android")
	public boolean isGenerateAndroidAvailable() {
		return true;
	}

	@CliCommand(value = "generate android", help = "Generate a Simple Android Project")
	public String gerarProjeto() {

		makeQuestions();

		androidProjectGenerator.generate(configurations);
		activityGenerator.generate(configurations);

		configurations.clear();

		return "";
	}

	private void makeQuestions(){
		makeProjectQuestions();
		makeActivityQuestions();
	}

	private void makeProjectQuestions(){
		String pkgProject = question("What is the package name?");
		String projecctName = question("What is the project name?");
		configurations.putProperty(Configurations.PROJECT_PACKAGE_PROPERTY, pkgProject);
		configurations.putProperty(Configurations.PROJECT_NAME_PROPERTY, projecctName);
	}

	private void makeActivityQuestions(){
		boolean createActivity = questionBoolean("Would you like to create a activity?");

		if(createActivity){
			String activityName = question("What is the activity name?");
			String activityPackage = question("What is the activity subPackage(Leave it blank to put on root package)?");

			String projectPkg = configurations.getProperty(Configurations.PROJECT_PACKAGE_PROPERTY);

			activityPackage = StringUtils.isEmpty(activityPackage) ? "" : "." + activityPackage;
			activityPackage = projectPkg + activityPackage;

			configurations.putProperty(ActivityGenerator.ACTIVITY_NAME, activityName);
			configurations.putProperty(ActivityGenerator.ACTIVITY_LABEL, activityName);
			configurations.putProperty(ActivityGenerator.ACTIVITY_PKD, activityPackage);
		}
	}
}