text:
package org.apache.sis.internal.jaxb.gml;

import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.datatype.XMLGregorianCalendar;
import org.opengis.temporal.Instant;

/**
 * The {@linkplain TimePeriod#begin begin} or {@linkplain TimePeriod#end end} position in
 * a {@link TimePeriod}. This information is encoded in different way depending if we are
 * reading or formatting a GML2 or GML3 file.
 *
 * @author  Guilhem Legal (Geomatys)
 * @author  Martin Desruisseaux (Geomatys)
 * @version 0.3
 * @since   0.3
 * @module
 */
@XmlTransient
public abstract class TimePeriodBound {
    /**
     * Empty constructor for subclasses only.
     */
    TimePeriodBound() {
    }

    /**
     * Returns the XML calendar, or {@code null} if none. This information is encoded
     * in different fields depending if we are reading/writing a GML2 or a GML3 file.
     */
    abstract XMLGregorianCalendar calendar();

    /**
     * Returns a string representation of this bound for debugging purpose.
     *
     * @return a string representation of the time currently set.
     */
    @Override
    public String toString() {
        return String.valueOf(calendar());
    }

    /**
     * The begin or end position in a {@link TimePeriod}, expressed in the GML 3 way.
     * Example:
     *
     * {@preformat xml
     *   <gml:TimePeriod>
     *     <gml:beginPosition>1992-01-01T01:00:00.000+01:00</gml:beginPosition>
     *     <gml:endPosition>2007-12-31T01:00:00.000+01:00</gml:endPosition>
     *   </gml:TimePeriod>
     * }
     */
    public static final class GML3 extends TimePeriodBound {
        /**
         * A textual indication of the time, usually {@code "before"}, {@code "after"} or {@code "now"}.
         * This attribute and the {@linkplain #value} are mutually exclusive.
         */
        @XmlAttribute
        public String indeterminatePosition;

        /**
         * The actual time position, or {@code null} for {@linkplain #indeterminatePosition indeterminate position}.
         *
         *
WARNING: The timezone information may be lost! This is because this field
         * is derived from a {@link java.util.Date}, in which case we don't know if the time is really 0
         * or just unspecified. This class assumes that a time of zero means "unspecified". This will be
         * revised after we implemented ISO 19108.

         */
        @XmlValue
        public XMLGregorianCalendar value;

        /**
         * Empty constructor used by JAXB.
         */
        public GML3() {
        }

        /**
         * Creates a bound initialized to the given instant.
         *
         * @param instant        the instant of the new bound, or {@code null}.
         * @param indeterminate  the value to give to {@link #indeterminatePosition} if the date is null.
         */
        GML3(final Instant instant, final String indeterminate) {
            value = TimeInstant.toXML(instant);
            if (value == null) {
                indeterminatePosition = indeterminate;
            }
        }

        /**
         * Returns the XML calendar, or {@code null} if none or undetermined.
         */
        @Override
        XMLGregorianCalendar calendar() {
            return value;
        }
    }

    /**
     * The begin or end position in a {@link TimePeriod}, expressed in the GML 2 way.
     * This object encapsulates a {@link TimeInstant} inside a {@code begin} or {@code end}
     * element inside a GML 2 {@link TimePeriod} in GML 2. This is not used for GML 3.
     * Example:
     *
     * {@preformat xml
     *   <gml:TimePeriod>
     *     <gml:begin>
     *       <gml:TimeInstant gml:id="begin">
     *         <gml:timePosition>1992-01-01T01:00:00.000+01:00</gml:timePosition>
     *       </gml:TimeInstant>
     *     </gml:begin>
     *     <gml:end>
     *       <gml:TimeInstant gml:id="end">
     *         <gml:timePosition>2007-12-31T01:00:00.000+01:00</gml:timePosition>
     *       </gml:TimeInstant>
     *     </gml:end>
     *   </gml:TimePeriod>
     * }
     */
    //@XmlType(name = "TimeInstantPropertyType") // TODO: Omitted for now for allowing external modules to define their own type.
    public static final class GML2 extends TimePeriodBound {
        /**
         * The time.
         */
        @XmlElement(name = "TimeInstant")
        public TimeInstant timeInstant;

        /**
         * Empty constructor used by JAXB.
         */
        public GML2() {
        }

        /**
         * Creates a bound initialized to the given instant.
         *
         * @param instant The instant of the new bound, or {@code null}.
         */
        GML2(final Instant instant) {
            timeInstant = new TimeInstant(instant);
        }

        /**
         * Returns the XML calendar, or {@code null} if none.
         */
        @Override
        XMLGregorianCalendar calendar() {
            final TimeInstant timeInstant = this.timeInstant;
            return (timeInstant != null) ? timeInstant.timePosition : null;
        }
    }
}


text:
import { ServiceClientOptions, RequestOptions, ServiceCallback, ServiceClientCredentials } from 'ms-rest';
import * as operations from "./operations";

declare class MicrosoftAzureTestUrl {
    /**
     * @class
     * Initializes a new instance of the MicrosoftAzureTestUrl class.
     * @constructor
     *
     * @param {Credentials} credentials The management credentials for Azure.
     *
     * @param {String} subscriptionId Subscription Id.
     *
     * @param {string} [baseUri] - The base URI of the service.
     *
     * @param {object} [options] - The parameter options
     *
     * @param {Array} [options.filters] - Filters to be added to the request pipeline
     *
     * @param {object} [options.requestOptions] - Options for the underlying request object
     * {@link https://github.com/request/request#requestoptions-callback Options doc}
     *
     * @param {bool} [options.noRetryPolicy] - If set to true, turn off default retry policy
     */
    constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri: string, options: ServiceClientOptions);

    credentials: ServiceClientCredentials;

    subscriptionId: string;

    apiVersion: string;

    acceptLanguage: string;

    longRunningOperationRetryTimeout: number;

    // Operation groups
    group: operations.Group;
    }

export = MicrosoftAzureTestUrl;

redpajama_set_name: RedPajamaGithub


text:
module ShopqiAPI
  class ProductSearchEngine < Base
  end
end


text:
package statsbot.messages.regex;

import java.util.regex.*;

import MessagesModel.JoinTeamMessage;
import MessagesModel.Message;
import MessagesModel.ModelFactory;

public class JoinTeamRegex implements IRegex
{
	private static final String regex = "\"(?<userName>.+)[<](?<userId>\\d+)[>][<](?<userSteamId>.*)[>][<](?<userTeam>CT|TERRORIST|Unassigned|Spectator)[>]\" joined team \"(?<joinedTeam>CT|TERRORIST|Unassigned|Spectator)\"";

	public JoinTeamRegex()
	{
		RegexParser.getInstance().registerRegex(this);
	}

	@Override
	public Message tryCreatingMessage(String input)
	{
		Pattern p = Pattern.compile(regex);
		Matcher m = p.matcher(input);
		JoinTeamMessage message = null;

		if(m.find())
		{
			message = ModelFactory.eINSTANCE.createJoinTeamMessage();

			message.setUserName(m.group("userName"));
			message.setUserID(m.group("userId"));
			message.setUserSteamID(m.group("userSteamId"));
			message.setUserTeam(m.group("userTeam"));
			message.setJoinedTeam(m.group("joinedTeam"));
		}

		return message;
	}
}


text:
module Pod
  class Installer
    class Analyzer
      class TargetInspectionResult
        # @return [TargetDefinition] the target definition, whose project was
        #         inspected
        #
        attr_accessor :target_definition

        # @return [Pathname] the path of the user project that the
        #         #target_definition should integrate
        #
        attr_accessor :project_path

        # @return [Array<String>] the uuid of the user's targets
        #
        attr_accessor :project_target_uuids

        # @return [Hash{String=>Symbol}] A hash representing the user build
        #         configurations where each key corresponds to the name of a
        #         configuration and its value to its type (`:debug` or
        #         `:release`).
        #
        attr_accessor :build_configurations

        # @return [Platform] the platform of the user targets
        #
        attr_accessor :platform

        # @return [Array<String>] the architectures used by user's targets
        #
        attr_accessor :archs

        # @return [Bool] whether frameworks are recommended for the integration
        #         due to the presence of Swift source in the user's targets
        #
        attr_accessor :recommends_frameworks

        # @return [Xcodeproj::Project] the user's Xcode project
        #
        attr_accessor :project
      end
    end
  end
end


text:
package org.apache.sysds.runtime.io.hdf5;

import org.apache.sysds.runtime.io.hdf5.message.H5DataLayoutMessage;
import org.apache.sysds.runtime.io.hdf5.message.H5DataSpaceMessage;
import org.apache.sysds.runtime.io.hdf5.message.H5DataTypeMessage;

import java.nio.ByteBuffer;

import static java.nio.ByteOrder.LITTLE_ENDIAN;

public class H5ContiguousDataset {

	private final H5RootObject rootObject;
	private final H5DataLayoutMessage dataLayoutMessage;
	private final H5DataTypeMessage dataTypeMessage;
	@SuppressWarnings("unused")
	private final H5DataSpaceMessage dataSpaceMessage;

	public H5ContiguousDataset(H5RootObject rootObject, H5ObjectHeader objectHeader) {

		this.rootObject = rootObject;
		this.dataLayoutMessage = objectHeader.getMessageOfType(H5DataLayoutMessage.class);
		this.dataTypeMessage = objectHeader.getMessageOfType(H5DataTypeMessage.class);
		this.dataSpaceMessage = objectHeader.getMessageOfType(H5DataSpaceMessage.class);
	}

	public ByteBuffer getDataBuffer(int row) {
		try {
			long rowPos = row * rootObject.getCol()*this.dataTypeMessage.getDoubleDataType().getSize();
			ByteBuffer data = rootObject.readBufferFromAddressNoOrder(dataLayoutMessage.getAddress() + rowPos,
				(int) (rootObject.getCol() * this.dataTypeMessage.getDoubleDataType().getSize()));
			data.order(LITTLE_ENDIAN);

			return data;
		}
		catch(Exception e) {
			throw new H5RuntimeException("Failed to map data buffer for dataset", e);
		}
	}
	public H5DataTypeMessage getDataType() {
		return dataTypeMessage;
	}
}


text:
<?php

declare(strict_types=1);

namespace WoohooLabs\Zen\Tests\Config\Hint;

use PHPUnit\Framework\TestCase;
use WoohooLabs\Zen\Config\Hint\DefinitionHint;
use WoohooLabs\Zen\Config\Hint\Psr4WildcardHint;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\AClass;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\AInterface;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\BClass;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\BInterface;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\ClassC;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\ClassD;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\ClassEImplementation;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\ClassFImplementation;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\G;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\InterfaceC;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\InterfaceD;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\InterfaceE;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\InterfaceF;
use WoohooLabs\Zen\Tests\Fixture\DependencyGraph\Wildcard\InterfaceG;

class Psr4WildcardHintTest extends TestCase
{
    /**
     * @test
     */
    public function getDefinitionHintsWithPrefixPattern(): void
    {
        $wildcardHint = new Psr4WildcardHint(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Interface",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Class"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                AInterface::class => new DefinitionHint(AClass::class),
                BInterface::class => new DefinitionHint(BClass::class),
            ],
            $definitionHints
        );
    }

    /**
     * @test
     */
    public function getPrototypeDefinitionHintsWithPrefixPattern(): void
    {
        $wildcardHint = Psr4WildcardHint::prototype(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Interface",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Class"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                AInterface::class => DefinitionHint::prototype(AClass::class),
                BInterface::class => DefinitionHint::prototype(BClass::class),
            ],
            $definitionHints
        );
    }

    /**
     * @test
     */
    public function getSingletonDefinitionHintsWithPrefixPattern(): void
    {
        $wildcardHint = Psr4WildcardHint::singleton(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Interface",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Class"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                AInterface::class => DefinitionHint::singleton(AClass::class),
                BInterface::class => DefinitionHint::singleton(BClass::class),
            ],
            $definitionHints
        );
    }

    /**
     * @test
     */
    public function geNonExistentDefinitionHintsWithPrefixPattern(): void
    {
        $wildcardHint = new Psr4WildcardHint(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*Interface",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*NonexistentClass"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEmpty($definitionHints);
    }

    /**
     * @test
     */
    public function getDefinitionHintsWithPostfixPattern(): void
    {
        $wildcardHint = new Psr4WildcardHint(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\Interface*",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\Class*"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                InterfaceC::class => new DefinitionHint(ClassC::class),
                InterfaceD::class => new DefinitionHint(ClassD::class),
            ],
            $definitionHints
        );
    }

    /**
     * @test
     */
    public function getDefinitionHintsWithInfixPattern(): void
    {
        $wildcardHint = new Psr4WildcardHint(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\Interface*",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\Class*Implementation"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                InterfaceE::class => new DefinitionHint(ClassEImplementation::class),
                InterfaceF::class => new DefinitionHint(ClassFImplementation::class),
            ],
            $definitionHints
        );
    }

    /**
     * @test
     */
    public function geNonExistentDefinitionHintsWithOnlyPattern(): void
    {
        $wildcardHint = new Psr4WildcardHint(
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\Interface*",
            "WoohooLabs\\Zen\Tests\\Fixture\\DependencyGraph\\Wildcard\\*"
        );

        $definitionHints = $wildcardHint->getDefinitionHints();

        $this->assertEquals(
            [
                InterfaceG::class => new DefinitionHint(G::class),
            ],
            $definitionHints
        );
    }
}


text:
using UnityEngine;

namespace SkylineToolkit.UI
{
    public class CursorInfo : ScriptableObject
    {
        public Texture2D Texture { get; set; }

        public Vector2 HotSpot { get; set; }

        public ColossalFramework.CursorInfo ToColossalCursorInfo()
        {
            ColossalFramework.CursorInfo info = ScriptableObject.CreateInstance<ColossalFramework.CursorInfo>();

            info.m_texture = this.Texture;
            info.m_hotspot = this.HotSpot;

            return info;
        }

        public static CursorInfo FromColossalCursorInfo(ColossalFramework.CursorInfo info)
        {
            CursorInfo cInfo = ScriptableObject.CreateInstance<CursorInfo>();

            cInfo.Texture = info.m_texture;
            cInfo.HotSpot = info.m_hotspot;

            return cInfo;
        }
    }
}


text:
require "spec_helper"

describe "Heaven::Notifier::Slack" do
  it "handles pending notifications" do
    Heaven.redis.set("atmos/my-robot-production-revision", "sha")

    n = Heaven::Notifier::Slack.new(fixture_data("deployment-pending"))
    n.comparison = {
      "html_url" => "https://github.com/org/repo/compare/sha...sha"
    }

    result = [
      "[#123456](https://gist.github.com/fa77d9fb1fe41c3bb3a3ffb2c) ",
      ": [atmos](https://github.com/atmos) is deploying ",
      "[my-robot](https://github.com/atmos/my-robot/tree/break-up-notifiers) ",
      "to production ([compare](https://github.com/org/repo/compare/sha...sha))"
    ]

    expect(n.default_message).to eql result.join("")
  end

  it "handles successful deployment statuses" do
    n = Heaven::Notifier::Slack.new(fixture_data("deployment-success"))

    result = [
      "[#11627](https://gist.github.com/fa77d9fb1fe41c3bb3a3ffb2c) ",
      ": [atmos](https://github.com/atmos)'s production deployment of ",
      "[my-robot](https://github.com/atmos/my-robot) ",
      "is done! "
    ]
    expect(n.default_message).to eql result.join("")
  end

  it "handles failure deployment statuses" do
    n = Heaven::Notifier::Slack.new(fixture_data("deployment-failure"))

    result = [
      "[#123456](https://gist.github.com/fa77d9fb1fe41c3bb3a3ffb2c) ",
      ": [atmos](https://github.com/atmos)'s production deployment of ",
      "[my-robot](https://github.com/atmos/my-robot) ",
      "failed. "
    ]
    expect(n.default_message).to eql result.join("")
  end
end


text:
package mobi.cangol.web.modules.user.service;

import java.util.List;

import mobi.cangol.web.common.search.Page;
import mobi.cangol.web.common.search.PageSearchEntity;
import mobi.cangol.web.common.service.BaseService;
import mobi.cangol.web.modules.user.dao.UserAppDao;
import mobi.cangol.web.modules.user.entity.UserApp;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserAppService implements BaseService<UserApp> {
	@Autowired
	private UserAppDao userAppDao=null;
	@Override
	public void delete(String id) throws Exception {
		userAppDao.deleteByKey(id);

	}

	@Override
	public void deleteAll(List<UserApp> list) throws Exception {
		userAppDao.deleteAll(list);
	}

	@Override
	public Page findPage(PageSearchEntity pEntity, int pageNo, int pageSize)
			throws Exception {
		Page page=userAppDao.findByEntity(pEntity, pageNo, pageSize);
		List<UserApp> list=(List<UserApp>) page.getData();
		return page;
	}

	@Override
	public UserApp get(String id) {
		return userAppDao.get(id);
	}

	@Override
	public List<UserApp> getList(PageSearchEntity pEntity) throws Exception {
		return userAppDao.findListByEntity(pEntity);
	}

	@Override
	public void save(UserApp t) throws Exception {
		if (StringUtils.isBlank(t.getId())) {
			userAppDao.save(t);
		} else {
			userAppDao.update(t);
		}

	}
	public List<UserApp> syncAll(String syncTime) {
		PageSearchEntity pEntity=new PageSearchEntity();
		pEntity.addSearch("updateTime", syncTime, ">");
		List<UserApp> list= userAppDao.findListByEntity(pEntity);
		return list;
	}

	public UserApp getUserApp(String appId, String userId) {
		PageSearchEntity entity = new PageSearchEntity();
		entity.addSearch("appId", appId, "=");
		entity.addSearch("userId", userId, "=");
		return userAppDao.findUniqueByEntity(entity);
	}
}


text:
var express = require('express')
var request = require('request')
var url = require('url')
var parseString = require('xml2js').parseString
var products = require('../lib/products')
var auth = require('../lib/auth')
var router = express.Router()

var LOGIN_URL = 'https://rentoys.xyz/index.php/rest/V1/integration/customer/token'
var USER_PROFILE_URL = 'https://rentoys.xyz/index.php/rest/V1/customers/me'

router.post('/login/email', function (req, res, next) {

  var creds
  for (var i in req.body){
    creds = JSON.parse(i)
  }

  var username = creds.email
  var password = creds.password
  auth.gettoken_login_with_email(username, password, function (access_token) {
    auth.user_profile(access_token, function (data) {
      res.json(data)
    })
  })
})

router.get('/users/:user_id', function (req, res) {
  var auth_header = req.header('Authorization')
  var token = auth_header.split(' ')[1]
  auth.user_profile(token, function (data) {
    if (data.id === parseInt(req.params.user_id)){
      res.json(data)
    }
    else{
      res.send({'status': 503})
    }
  })
})
module.exports = router


text:
<?xml version="1.0" encoding="UTF-8"?>
<artifact name="org_wso2_analytics_apim_tierCrossing" version="1.0.0" type="dashboards/gadget" serverRole="DataAnalyticsServer">
    <file>tier-crossing</file>
</artifact>


text:
#ifndef HKP_COLLISION_DISPATCHER_H
#define HKP_COLLISION_DISPATCHER_H

#include <Physics2012/Collide/Agent/Collidable/hkpCdBody.h>
#include <Physics2012/Collide/Shape/hkpShape.h>
#include <Physics2012/Collide/Agent3/hkpAgent3.h>
#include <Physics2012/Collide/Agent/Collidable/hkpCollidableQualityType.h>
#include <Physics2012/Collide/Agent/hkpCollisionQualityInfo.h>
#include <Physics2012/Collide/Agent/hkpCollisionInput.h>

class hkpCollidable;
class hkpCollisionAgent;
class hkpContactMgr;
struct hkpCollisionInput;
class hkpContactMgrFactory;
class hkpCdPointCollector;
class hkpCdPointCollector;
class hkpCdBodyPairCollector;
struct hkpLinearCastCollisionInput;

enum hkpCollisionDispatcherAgentType
{
	HK_AGENT_TYPE_NULL = 0,
	HK_AGENT_TYPE_BRIDGE = 1
};

	/// This class is used to find the correct function which performs collision detection between pairs of shapes.
	/// It's based on the following rules:
	///  - Each shapes has a type
	///  - For each pair of types, there must be a function registered to handle this pair of types
	///
	/// However implementing all combinations would be quite complex. Therefore we allow for:
	///  - shapes to actually subclass other more basic shapes (e.g., a box is a convex shape)
	///    and then reuse a common base function
	///  - functions, which work on a pair of shapes, where only one shape type is used (e.g., hkpTransformShape, hkpBvTreeShape)
	///    and the other ignored (hkcdShapeType::ALL_SHAPE_TYPES).
	///    in this case we have to register a function with a pair of types ( HK_SHAPE_MY_TYPE, hkcdShapeType::ALL_SHAPE_TYPES )
	///
	/// To implement this behavior, the user has to
	///  - first declare the shape inheritance hierarchy by calling registerAlternateShapeType for each inheritance link
	///  - register all functions which handle collisions between two shape types.
	///
	/// Note: You still cannot call registerAlternateShapeType after you registered your first agent
	///
	/// Also this class can dispatch hkpContactMgrFactory s. This dispatch is quite simple as there is no inheritance.
	/// Also this class combines two hkCollidableQualityTypes into a hkCdInteractionQualtityType
	///
	/// In addition to that, this class also dispatches a pair of hkpCollidableQualityType into a hkpCollisionQualityInfo structure
class hkpCollisionDispatcher : public hkReferencedObject
{
	public:

		enum {
			HK_MAX_RESPONSE_TYPE = 8,
			HK_MAX_SHAPE_TYPE    = hkcdShapeType::MAX_PPU_SHAPE_TYPE,
			HK_MAX_AGENT2_TYPES  = 64,
			HK_MAX_AGENT3_TYPES = 18,
			HK_MAX_COLLISION_QUALITIES = 8
		};

	public:

		HK_DECLARE_CLASS_ALLOCATOR( HK_MEMORY_CLASS_CDINFO );

			/// A function to create a collision agent
		typedef hkpCollisionAgent* (HK_CALL *CreateFunc)( const hkpCdBody& collA, const hkpCdBody& collB, const hkpCollisionInput& env, hkpContactMgr* mgr );

			/// A function to check whether two objects are penetrating
		typedef void (HK_CALL *GetPenetrationsFunc)( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, hkpCdBodyPairCollector& collector );

			/// A function to find the closest points
		typedef void (HK_CALL *GetClosestPointsFunc)( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, hkpCdPointCollector& output );

			/// A function to do linear casts
		typedef void (HK_CALL *LinearCastFunc)( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpLinearCastCollisionInput& input, hkpCdPointCollector& castCollector, hkpCdPointCollector* startCollector );

			/// For backward compatibility
		typedef CreateFunc CollisionAgentCreationFunction;

		typedef hkChar CollisionQualityIndex;

			/// A helper struct, which is used as an input to registerCollisionAgent
		struct AgentFuncs
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, AgentFuncs );

				/// The agent creation functions
			CreateFunc  m_createFunc;

				/// A static penetration function
			GetPenetrationsFunc m_getPenetrationsFunc;

				/// A static get closest distance functions
			GetClosestPointsFunc m_getClosestPointFunc;

				/// A static linear cast function
			LinearCastFunc m_linearCastFunc;

				/// A flag telling the system, whether a symmetric agent is involved.
				/// If the collision detector sees the flag to be set to true, it tries
				/// to swap objectA with objectB
			hkBool m_isFlipped;

				/// A flag indicating whether the object can handle continuous collision
			hkBool m_isPredictive;

			AgentFuncs() : m_isFlipped(false), m_isPredictive(false) {}
		};

			/// A helper struct, which is used as an input to registerCollisionAgent
			/// for streamed agents. Read hkAgent3 for details
		struct Agent3Funcs
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, Agent3Funcs );
			Agent3Funcs() : m_isPredictive(false), m_ignoreSymmetricVersion(false), m_reusePreviousEntry(false)
			{
				m_updateFilterFunc	= HK_NULL;
				m_invalidateTimFunc = HK_NULL;
				m_warpTimeFunc		= HK_NULL;
				m_sepNormalFunc		= HK_NULL;
			}

				// Called when the agent is created
			HK_ALIGN16( hkAgent3::CreateFunc m_createFunc );

				// Called when the agent is destroyed
			hkAgent3::DestroyFunc m_destroyFunc;

				// Called when the agent has all points removed.
				// Info: This is only used when you have Tim's -- and there fore m_sepNormalFunc assigned.
			hkAgent3::CleanupFunc m_cleanupFunc;

				// Point remove/commit/zombie functions used for welding
			hkAgent3::RemovePointFunc m_removePointFunc;
			hkAgent3::CommitPotentialFunc m_commitPotentialFunc;
			hkAgent3::CreateZombieFunc m_createZombieFunc;

				// Should be implemented for all agents
			hkAgent3::UpdateFilterFunc m_updateFilterFunc;
			hkAgent3::InvalidateTimFunc m_invalidateTimFunc;
			hkAgent3::WarpTimeFunc m_warpTimeFunc;

				// Only needed if the agent uses Tim's
			hkAgent3::SepNormalFunc m_sepNormalFunc;
			hkAgent3::ProcessFunc m_processFunc;
			hkBool m_isPredictive;
			hkBool m_ignoreSymmetricVersion;
			hkBool m_reusePreviousEntry;
		};

		struct InitCollisionQualityInfo
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, InitCollisionQualityInfo );

			hkReal m_gravityLength;
			hkReal m_collisionTolerance;
			hkReal m_minDeltaTime;
			hkReal m_maxLinearVelocity;
			hkReal m_numToisTillAllowedPenetrationSimplifiedToi;
			hkReal m_numToisTillAllowedPenetrationToi;
			hkReal m_numToisTillAllowedPenetrationToiHigher;
			hkReal m_numToisTillAllowedPenetrationToiForced;
			hkUint16 m_defaultConstraintPriority;
			hkUint16 m_toiConstraintPriority;
			hkUint16 m_toiHigherConstraintPriority;
			hkUint16 m_toiForcedConstraintPriority;
			hkBool m_wantContinuousCollisionDetection;
			hkBool m_enableNegativeManifoldTims;
			hkBool m_enableNegativeToleranceToCreateNon4dContacts;
			hkBool m_enableToiWeldRejection;
		};

		enum IsAgentPredictive
		{
			IS_NOT_PREDICTIVE,
			IS_PREDICTIVE
		};

	public:

			/// create the collision dispatcher
		hkpCollisionDispatcher( CreateFunc defaultCreationFunction, hkpContactMgrFactory* defaultContactMgrFactory );

			/// delete it
		~hkpCollisionDispatcher();

			//
			//	Shape Types
			//

			/// register a shape type and a possible alternative shape type, which
			/// is used if the first type does not give a valid answer.
			/// Note: you should register all alternate shapes BEFORE you can register the collision
			/// agent creation functions (otherwise it gets very CPU intensive).
			///
			/// Background:
			///
			/// Since havok2.2, the inheritance of shapes is defined in the collision dispatcher,
			/// not in the shapes. That means before registering agents, all shape types and their
			/// alternate (=superClass) type needs to be registered.
			/// - Example: A triangle is a convex shape, so in order for the convex agent to
			///   pick up a triangle the following lines must precede the registration of the convex
			///   agent: dispatcher->registerAlternateShapeTypes( hkcdShapeType::TRIANGLE, hkcdShapeType::CONVEX );
		void registerAlternateShapeType( hkpShapeType primaryType, hkpShapeType alternateType );

			/// returns true, if type has a path to alternateType or type == alternateType.
			/// Note: This function is really fast
		inline hkBool32 hasAlternateType( hkpShapeType type, hkpShapeType alternateType );

			//
			//	Agents
			//

			/// Register an agent for a given pair of shape types, use hkcdShapeType::ALL_SHAPE_TYPES for one type if you want to register
			/// the other type with all agents.
			/// Later calls to this functions override existing values, that means later calls automatically have a higher priority.
			///  - Note: You should register all shape alternate Types before you call registerCollisionAgent()
			///  - Note: A call to this function is slow
			///  - Note: Agent using the streaming technology must be registered just after the non
			///    streaming version is registered
			///
			/// Build in checks
			///
			/// Example: Say you register a fast sphere-sphere agent first and than you register a slow convex-convex agent.
			/// As later registrations overrides earlier, the convex-convex agent will actually override the
			/// sphere-sphere one (given that there is a rule that a sphere is a convex object). Bad :-(
			///
			/// Unfortunately this wrong registration is usually difficult to find.
			///
			/// Solution:
			///  - Currently the program checks, if a more general agent overrides an more specialized agent and asserts.
			///    However in some cases the check does not work, so you can disable it by calling setEnableChecks(false).
			///  - Call debugPrintTable() to get a text file which shows you check the contents of the table by hand
		void registerCollisionAgent( AgentFuncs& f, hkpShapeType typeA, hkpShapeType typeB );

			/// Register an agent with the collision dispatcher. Does not register bridge agent.
			/// This means this agent will only be used
			///  - if static collision queries are used or
			///  - if agent is used by a phantom or
			///  - if the agent is owned by a transform agent
		void registerCollisionAgent2( AgentFuncs& f, hkpShapeType typeA, hkpShapeType typeB );

			/// disable checks if you want to force override existing entries when calling registerCollisionAgent.
			/// Don't forget to re-enabling the checks, once you have done your unchecked operations.
		void setEnableChecks( hkBool checkEnabled);

			/// Debug print of the current table entries
		void debugPrintTable();

			/// Disables debugging. This should be done at the end of registering all agents to save some memory.
			/// Note: Checking is only enabled in debug
		void disableDebugging();

			/// returns a new collision agent for a collidable pair
		HK_FORCE_INLINE hkpCollisionAgent* getNewCollisionAgent(	const hkpCdBody& a, const hkpCdBody& b, const hkpCollisionInput& env, hkpContactMgr* mgr) const;

			/// get the agent creation function registered for a given pair.
		HK_FORCE_INLINE CreateFunc getCollisionAgentCreationFunction( hkpShapeType typeA, hkpShapeType typeB, IsAgentPredictive predictive ) const;

			/// get the functions, which allows you to query two collision collidables for penetration cases
		HK_FORCE_INLINE GetPenetrationsFunc getGetPenetrationsFunc( hkpShapeType typeA, hkpShapeType typeB ) const;

			/// get the functions, which allows you to query two collision collidables for penetration cases
		HK_FORCE_INLINE GetClosestPointsFunc getGetClosestPointsFunc( hkpShapeType typeA, hkpShapeType typeB ) const;

			/// get the functions, which allows you to query two collision collidables for penetration cases
		HK_FORCE_INLINE LinearCastFunc getLinearCastFunc( hkpShapeType typeA, hkpShapeType typeB ) const;

		HK_FORCE_INLINE hkBool getIsFlipped( hkpShapeType typeA, hkpShapeType typeB ) const;

			/// Same as registerCollisionAgent, but for the hkAgent3 technology
			/// if reusePreviousEntry is set to true, than f is ignored and the f of previous call to registerAgent3 is used
		int registerAgent3( Agent3Funcs& f, hkpShapeType typeA, hkpShapeType typeB );

		HK_FORCE_INLINE hkAgent3::AgentType getAgent3Type( hkpShapeType typeA, hkpShapeType typeB, hkBool32 predicitve ) const;

		HK_FORCE_INLINE hkAgent3::CreateFunc			getAgent3CreateFunc  ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::DestroyFunc			getAgent3DestroyFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::CleanupFunc			getAgent3CleanupFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::RemovePointFunc		getAgent3RemovePointFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::CommitPotentialFunc	getAgent3CommitPotentialFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::CreateZombieFunc		getAgent3CreateZombieFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::UpdateFilterFunc		getAgent3UpdateFilterFunc ( hkAgent3::AgentType type ) const;
		HK_FORCE_INLINE hkAgent3::InvalidateTimFunc		getAgent3InvalidateTimFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::WarpTimeFunc			getAgent3WarpTimeFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::ProcessFunc			getAgent3ProcessFunc ( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::SepNormalFunc			getAgent3SepNormalFunc( hkAgent3::AgentType type );
		HK_FORCE_INLINE hkAgent3::Symmetric				getAgent3Symmetric( hkAgent3::AgentType type );

			//
			//	Contact Mgrs
			//

			/// register a contact factory
		void registerContactMgrFactory( hkpContactMgrFactory*, int responseA, int responseB );

			/// Get a contact manager factory - used to create a contact manager.
		HK_FORCE_INLINE hkpContactMgrFactory* getContactMgrFactory( int responseA, int responseB ) const;

			/// register a contact factory with all other types: Note overrides existing entries
		void registerContactMgrFactoryWithAll( hkpContactMgrFactory*, int responseA );

			//
			//	hkpCollisionQualityInfo
			//

		HK_FORCE_INLINE CollisionQualityIndex getCollisionQualityIndex( hkpCollidableQualityType a, hkpCollidableQualityType b );

		HK_FORCE_INLINE hkpCollisionQualityInfo* getCollisionQualityInfo( CollisionQualityIndex index );

		void initCollisionQualityInfo( InitCollisionQualityInfo& input );

			//
			//	Some simple convenience functions
			//

			/// Get the closest point between 2 shapes. Warning the hit.m_rootCollidable is not used (points to unused memory)
		void getClosestPoints( const hkpShape* shapeA, const hkTransform& transformA, const hkpShape* shapeB, const hkTransform& transformB, hkReal collisionTolerance, hkpCdPointCollector& collector );

			/// Get the penetration status of 2 shapes.
		void getPenetrations( const hkpShape* shapeA, const hkTransform& transformA, const hkpShape* shapeB, const hkTransform& transformB, hkReal collisionTolerance, hkpCdBodyPairCollector& collector );

	public:

		struct ShapeInheritance
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, ShapeInheritance );

			hkpShapeType m_primaryType;
			hkpShapeType m_alternateType;
		};

		struct AgentEntry
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, AgentEntry );

			hkpShapeType m_typeA;
			hkpShapeType m_typeB;
			hkBool m_checkEnabled;
			AgentFuncs m_createFunc;
		};

		struct Agent3Entry
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, Agent3Entry );

			hkpShapeType m_typeA;
			hkpShapeType m_typeB;
			hkBool m_checkEnabled;
			Agent3Funcs m_funcs;
		};

			// A helper struct, which is used as an input to registerFullAgent
		struct Agent3FuncsIntern : public Agent3Funcs
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, Agent3FuncsIntern );

			hkAgent3::Symmetric m_symmetric;
		};

		struct DebugEntry
		{
			HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, DebugEntry );

				/// Shape Type A
			char m_typeA;
				/// Shape Type B
			char m_typeB;

				/// The sum of all shape rules which have to be applied to get to this entry.
				/// E.g. we have two spheres (m_typeAB = hkcdShapeType::SPHERE)
				///  - if we register a hkSphereSphere Agent, no indirections are needed and the priority is 0
				///  - if we register a hkSphereConvex Agent, 1 indirections is needed and the priority is 1
				///  - if we register a hkConvexConvex Agent, 2 indirections are needed and the priority is 2
				///  - if we register a hkSphere-All Agent, 1 indirections is needed and the priority is 1
			char m_priority;
		};

		typedef DebugEntry DebugTable[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE];

	protected:

		void internalRegisterCollisionAgent( hkUchar agentTypesTable[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE], int agentType, hkpShapeType typeA, hkpShapeType typeB, hkpShapeType origA, hkpShapeType origB, DebugTable *debugTable, int recursionDepth );

		void updateHasAlternateType( hkpShapeType primaryType, hkpShapeType alternateType, int depth );

		void resetCreationFunctions();

	public:

			/// Collision quality setting for a collision between a pair of objects.
			/// Values must correspond to hkpConstraintInstance::ConstraintPriority
		enum CollisionQualityLevel
		{
				/// Invalid.
			COLLISION_QUALITY_INVALID,

				/// Use this to get discrete stepping behavior or for fixed objects.
			COLLISION_QUALITY_PSI,

				/// Use this to avoid fast-moving debris object penetrating through the ground and other static objects.
				/// This only back steps the debris objects.
			COLLISION_QUALITY_SIMPLIFIED_TOI,

				/// Application: Ensure non-penetration between pairs of non-fixed objects.
				/// Use this if you want to prevent bullet through paper
			COLLISION_QUALITY_TOI,

				/// Same as above.
				/// Application: Ensure non-penetration between moving objects & fixed objects.
				/// Tech. Info: This ensures constraints to be treated as 'higher-priority' in PSI solver
			COLLISION_QUALITY_TOI_HIGHER,

				/// Application: Ensure and monitor non-penetration between moving objects & fixed objects.
				///              You receive callbacks when penetration occurs.
				///
				/// Tech. Info: This ensures constraints to be treated as 'higher-priority' in PSI & TOI solvers
				///             plus 'forced' during TOI handling
			COLLISION_QUALITY_TOI_FORCED,

				/// This quality is the same as COLLISION_QUALITY_TOI_FORCED with some additional tolerances
				/// set to enable more accurate generation of contact points.
			COLLISION_QUALITY_CHARACTER,

				/// Only used internally for expanding contact manifold in hkpContinuousSimulation::updateManifold().
				/// Will try to collect as many contact points as possible.
			COLLISION_QUALITY_TMP_EXPAND_MANIFOLD
		};

		CreateFunc m_defaultCollisionAgent;

		hkpContactMgrFactory* m_contactMgrFactory	[HK_MAX_RESPONSE_TYPE][HK_MAX_RESPONSE_TYPE];

			/// for each shapeType T, m_hasAlternateType[T] has a bit set for each superclass
		HK_ALIGN16(hkUint32 m_hasAlternateType	[HK_MAX_SHAPE_TYPE]);

			/// CollidableType x collidableType x {0, Pred} -> agentType dispatching for agent2 & agent3 technology.
			///  - m_agent2Types hold the proper agent's index for a given collision pair for non predictive collision detection
			///  - m_agent2TypesPred for predictive collision detection
		int					m_numAgent2Types;
		HK_ALIGN16( hkUchar	m_agent2Types		[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE] );
		hkUchar				m_agent2TypesPred	[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE];
		AgentFuncs			m_agent2Func		[HK_MAX_AGENT2_TYPES];

		int					m_numAgent3Types;
		HK_ALIGN16( hkUchar	m_agent3Types		[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE] );
		HK_ALIGN16( hkUchar	m_agent3TypesPred	[HK_MAX_SHAPE_TYPE][HK_MAX_SHAPE_TYPE] );
		Agent3FuncsIntern	m_agent3Func		[HK_MAX_AGENT3_TYPES];

			/// CollidableQuality x collidableQuality -> collisionQuality dispatching
		HK_ALIGN16( hkChar					m_collisionQualityTable	[HK_COLLIDABLE_QUALITY_MAX][HK_COLLIDABLE_QUALITY_MAX] );
		HK_ALIGN16( hkpCollisionQualityInfo	m_collisionQualityInfo	[HK_MAX_COLLISION_QUALITIES] );

			/// This is set to true if there is at least one call to registerCollisionAgent() made
		hkBool m_collisionAgentRegistered;
		hkBool m_agent3Registered;

		hkBool m_midphaseAgent3Registered;

			/// If set, produces an Assert whenever a more-general agent overrides a more-specific agent in dispatch tables.
		hkBool m_checkEnabled;

			/// All alternate shape rules (a simple collection of all registerAlternateShapeType() calls)
		hkArray<ShapeInheritance> m_shapeInheritance;

			/// Additional information to the main tables. This allows for debugging
			/// a wrong order of registering agents, see DebugEntry
		DebugTable* m_debugAgent2Table;
		DebugTable* m_debugAgent2TablePred;
		DebugTable* m_debugAgent3Table;
		DebugTable* m_debugAgent3TablePred;

	public:

		// The following two members are only used when you call hkpWorld::getCinfo(...)
		// They're set upon dispatcher initialization.
		hkReal m_expectedMaxLinearVelocity;
		hkReal m_expectedMinPsiDeltaTime;
};

#include <Physics2012/Collide/Dispatch/hkpCollisionDispatcher.inl>

#endif // HKP_COLLISION_DISPATCHER_H

/*
 * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
 *
 * Confidential Information of Havok.  (C) Copyright 1999-2014
 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
 * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
 * rights, and intellectual property rights in the Havok software remain in
 * Havok and/or its suppliers.
 *
 * Use of this software for evaluation purposes is subject to and indicates
 * acceptance of the End User licence Agreement for this product. A copy of
 * the license is included with this software and is also available at www.havok.com/tryhavok.
 *
 */


text:
{% extends "base_site.html" %}

{% block title %}Drafts - View{% endblock %}

{% block extrahead %}{{ block.super }}

{% endblock %}

{% block breadcrumbs %}{{ block.super }}
  » Drafts
  » {{ draft.name }}
{% endblock %}

{% block content %}

{% comment %}{{ request.user }}{% endcomment %}

Draft - View

Document Name:	{{ draft.title }}

Area:	{% if draft.group.parent %}{{ draft.group.parent }}{% endif %}

Group:	{% if draft.group %}{{ draft.group.acronym }}{% endif %}

Area Director:	{{ draft.ad }}

Shepherd:	{{ draft.shepherd }}

Notify:	{{ draft.notify }}

Document State:	{{ draft.get_state }}

IESG State:	{{ draft.iesg_state }}

Stream:	{{ draft.stream }}

Under Review by RFC Editor:	{% if draft.review_by_rfc_editor %}YES{% else %}NO{% endif %}

File Name:
          {% if draft.expired_tombstone %}
                {{ draft.filename }}

This is a last active version - the tombstone was expired.

              {% else %}{{ draft.name }}
              {% endif %}

Document Aliases:
            {% for alias in draft.docalias_set.all %}
                  {% if not forloop.first %}, {% endif %}
                  {{ alias.name }}
                {% endfor %}

Revision:	{{ draft.rev }}

Revision Date:	{{ draft.revision_date }}

Start Date:	{{ draft.start_date }}

Number of Pages:	{{ draft.pages }}

        {% comment %}
Local Path:	/ftp/internet-drafts/{{ draft.local_path|default_if_none:"" }}
{% endcomment %}

Abstract:	Click here to view the abstract

Expiration Date:	{{ draft.expires|date:"M. d, Y" }}

Intended Status:	{{ draft.intended_std_level|default_if_none:"" }}

RFC Number:	{{ draft.rfc_number|default_if_none:"" }}

Comments:	{{ draft.internal_comments|default_if_none:"" }}

Last Modified Date:	{{ draft.time }}

Replaced by:	{% if draft.replaced_by %}{{ draft.replaced_by.name }}{% endif %}

Related Documents:	{% for item in draft.relateddocument_set.all %}{% if not forloop.first %}, {% endif %}{{ item.relationship }} {{ item.target.name }}{% endfor %}

Tags:
            {% for tag in draft.tags.all %}
                  {% if not forloop.first %}, {% endif %}
                  {{ tag }}
                {% endfor %}

Author(s)

        {% for author in draft.documentauthor_set.all %}

{{ author.author.person.name }}

        {% endfor %}

Actions

<button {% if is_active %}{% else %}disabled="disabled"{% endif %}onclick="window.location='revision/'">New Revision</button>

<button {% if is_expired %}{% else %}disabled="disabled"{% endif %}onclick="window.location='update/'">Update Expired</button>

<button {% if is_expired or is_withdrawn %}{% else %}disabled="disabled"{% endif %}onclick="window.location='resurrect/'">Resurrect</button>

<button {% if is_active or is_expired %}{% else %}disabled="disabled"{% endif %}onclick="window.location='replace/'">Replace</button>

<button {% if is_active %}{% else %}disabled="disabled"{% endif %}onclick="window.location='extend/'">Extend Expiry</button>

<button {% if is_active %}{% else %}disabled="disabled"{% endif %}onclick="window.location='withdraw/'">Withdraw</button>

<button {% if is_active %}{% else %}disabled="disabled"{% endif %}onclick="window.location='announce/'">Announcement</button>

<button {% if is_active %}{% else %}disabled="disabled"{% endif %}onclick="window.location='makerfc/'">Make RFC</button>

<button onclick="window.location='edit/'">Edit</button>

<button onclick="window.location='authors/'">Authors</button>

          {% comment %}

<button onclick="window.location='{% url sec.ids.views.search id=group.group_acronym.acronym_id %}'">Drafts</button>

<button onclick="window.location='{% url sec.rfcs.views.search id=group.group_acronym.acronym_id %}'">RFCs</button>

          {% endcomment %}

{% endblock %}


text:
/**
 * @flow
 */

import { Registry } from '../registry';

import type { CommandSpec, OptionSpec, OptionType,
    NamedOptionSpec, ProgramSpec } from './types';

export class StandardCommandSpec implements CommandSpec {
    _args: Array<NamedOptionSpec<*>>;
    _flags: { [name: string]: OptionSpec<*> };

    constructor (args: Array<NamedOptionSpec<*>>,
            flags: { [name: string]: OptionSpec<*> }) {
        this._args = args;
        this._flags = flags;
    }

    args (): Array<NamedOptionSpec<*>> {
        return this._args;
    }

    flags (): { [name: string]: OptionSpec<*> } {
        return this._flags;
    }
}

export class StandardOptionSpec<T: OptionType> implements OptionSpec<T> {
    _defaultValue: T | (Process) => T;
    _multiple: boolean;
    _optional: boolean;
    _sample: T;

    constructor (defaultValue: T | Process => T,
            multiple: boolean, optional: boolean, sample: T) {
        this._defaultValue = defaultValue;
        this._multiple = multiple;
        this._optional = optional;
        this._sample = sample;
    }

    defaultValue (process: Process): T {
        if (typeof this._defaultValue == 'function') {
            return this._defaultValue(process);
        } else {
            return this._defaultValue;
        }
    }

    multiple (): boolean {
        return this._multiple;
    }

    optional (): boolean {
        return this._optional;
    }

    sample (): T {
        return this._sample;
    }
}

export class StandardNamedOptionSpec<T: OptionType> extends StandardOptionSpec<T> implements NamedOptionSpec<T> {
    _name: string;

    constructor (name: string, optionSpec: OptionSpec<T>) {
        super(optionSpec.defaultValue, optionSpec.multiple(),
            optionSpec.optional(), optionSpec.sample());

        this._name = name;
    }

    name () {
        return this._name;
    }
}


text:
class Solution {
public:
    vector<string> generateParenthesis(int n) {
        vector <string> ret;
        helper(0, 0, n, string(""), ret);
        return ret;
    }
    void helper(int left ,int right, int total, string now, vector <string> &ret) {
        if (left == total) {
            for (int i = 0; i < total - right; i++) {
                now += ')';
            }
            ret.push_back(now);
            return;
        }
        helper(left + 1, right, total, now + "(", ret);
        if (left > right)   helper(left, right + 1, total, now + ")", ret);
    }
};


text:
using System;
using Entitas;
using UnityEditor;

namespace Entitas.Unity.VisualDebugging {
    public class FloatTypeDrawer : ITypeDrawer {
        public bool HandlesType(Type type) {
            return type == typeof(float);
        }

        public object DrawAndGetNewValue(Type type, string fieldName, object value, Entity entity, int index, IComponent component) {
            return EditorGUILayout.FloatField(fieldName, (float)value);
        }
    }
}


text:
package com.leroymerlin.pandroid.demo.globals.model;

import android.os.Parcel;
import android.os.Parcelable;

public class Review implements Parcelable {

    private long userId;
    private long id;
    private String title;
    private String body;

    protected Review(Parcel in) {
        userId = in.readLong();
        id = in.readLong();
        title = in.readString();
        body = in.readString();
    }

    public static final Creator<Review> CREATOR = new Creator<Review>() {
        @Override
        public Review createFromParcel(Parcel in) {
            return new Review(in);
        }

        @Override
        public Review[] newArray(int size) {
            return new Review[size];
        }
    };

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getId() {
        return id;
    }

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

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(userId);
        dest.writeLong(id);
        dest.writeString(title);
        dest.writeString(body);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
using SelfLoad.DataAccess;
using SelfLoad.DataAccess.ERCLevel;

namespace SelfLoad.DataAccess.Sql.ERCLevel
{
    /// <summary>
    /// DAL SQL Server implementation of <see cref="ID09_Region_ChildDal"/>
    /// </summary>
    public partial class D09_Region_ChildDal : ID09_Region_ChildDal
    {
        /// <summary>
        /// Loads a D09_Region_Child object from the database.
        /// </summary>
        /// <param name="region_ID1">The fetch criteria.</param>
        /// <returns>A D09_Region_ChildDto object.</returns>
        public D09_Region_ChildDto Fetch(int region_ID1)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("GetD09_Region_Child", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Region_ID1", region_ID1).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

        private D09_Region_ChildDto Fetch(IDataReader data)
        {
            var d09_Region_Child = new D09_Region_ChildDto();
            using (var dr = new SafeDataReader(data))
            {
                if (dr.Read())
                {
                    d09_Region_Child.Region_Child_Name = dr.GetString("Region_Child_Name");
                }
            }
            return d09_Region_Child;
        }

        /// <summary>
        /// Inserts a new D09_Region_Child object in the database.
        /// </summary>
        /// <param name="d09_Region_Child">The D09 Region Child DTO.</param>
        /// <returns>The new <see cref="D09_Region_ChildDto"/>.</returns>
        public D09_Region_ChildDto Insert(D09_Region_ChildDto d09_Region_Child)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("AddD09_Region_Child", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Region_ID1", d09_Region_Child.Parent_Region_ID).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Region_Child_Name", d09_Region_Child.Region_Child_Name).DbType = DbType.String;
                    cmd.ExecuteNonQuery();
                }
            }
            return d09_Region_Child;
        }

        /// <summary>
        /// Updates in the database all changes made to the D09_Region_Child object.
        /// </summary>
        /// <param name="d09_Region_Child">The D09 Region Child DTO.</param>
        /// <returns>The updated <see cref="D09_Region_ChildDto"/>.</returns>
        public D09_Region_ChildDto Update(D09_Region_ChildDto d09_Region_Child)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("UpdateD09_Region_Child", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Region_ID1", d09_Region_Child.Parent_Region_ID).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Region_Child_Name", d09_Region_Child.Region_Child_Name).DbType = DbType.String;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("D09_Region_Child");
                }
            }
            return d09_Region_Child;
        }

        /// <summary>
        /// Deletes the D09_Region_Child object from database.
        /// </summary>
        /// <param name="region_ID1">The parent Region ID1.</param>
        public void Delete(int region_ID1)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("DeleteD09_Region_Child", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Region_ID1", region_ID1).DbType = DbType.Int32;
                    cmd.ExecuteNonQuery();
                }
            }
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace StandartTestApp
{
    public class Person
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string PhoneNumber { get; set; }
    }
}


text:
@implementation CMPopTipViewQuality

@synthesize qualityView;

- (id)initWithBackgroundColor:(UIColor *)color
{
    SelectQualityView *sqView = [SelectQualityView viewFromXib];

    self = [self initWithCustomView:sqView];
    if (self) {
        self.qualityView = sqView;

        self.hasGradientBackground = NO;
        self.backgroundColor = color;
        self.animation = CMPopTipAnimationPop;
        self.textColor = [UIColor whiteColor];
        self.has3DStyle = NO;
        self.borderWidth = 0;
        self.dismissTapAnywhere = YES;

        self.cornerPadding = 0;
        self.cornerRadius = 1.0;
        self.pointerSize = 6.0f;
        //self.topMargin = -1.0f;
    }
    return self;
}

@end


text:
using GraphQL.Validation.Rules;
using Xunit;

namespace GraphQL.Tests.Validation
{
  public class UniqueFragmentNamesTests : ValidationTestBase<UniqueFragmentNames, ValidationSchema>
  {
    [Fact]
    public void no_fragments()
    {
      ShouldPassRule(@"
        {
          field
        }
      ");
    }

    [Fact]
    public void one_fragment()
    {
      ShouldPassRule(@"
        {
          ...fragA
        }
        fragment fragA on Type {
          field
        }
      ");
    }

    [Fact]
    public void many_fragments()
    {
      ShouldPassRule(@"
        {
          ...fragA
          ...fragB
          ...fragC
        }
        fragment fragA on Type {
          fieldA
        }
        fragment fragB on Type {
          fieldB
        }
        fragment fragC on Type {
          fieldC
        }
      ");
    }

    [Fact]
    public void inline_fragments_are_always_unique()
    {
      ShouldPassRule(@"
        {
          ...on Type {
            fieldA
          }
          ...on Type {
            fieldB
          }
        }
      ");
    }

    [Fact]
    public void fragment_and_operation_named_the_same()
    {
      ShouldPassRule(@"
        query Foo {
          ...Foo
        }
        fragment Foo on Type {
          field
        }
      ");
    }

    [Fact]
    public void fragments_named_the_same()
    {
      ShouldFailRule(_ =>
      {
        _.Query = @"
          {
            ...fragA
          }
          fragment fragA on Type {
            fieldA
          }
          fragment fragA on Type {
            fieldB
          }
        ";
        // Note: this is failing on "fragment"; graphql-js fails on the fragment name.
        duplicateFrag(_, "fragA", 5, 11, 8, 11);
      });
    }

    [Fact]
    public void fragments_named_the_same_without_being_referenced()
    {
      ShouldFailRule(_ =>
      {
        _.Query = @"
          fragment fragA on Type {
            fieldA
          }
          fragment fragA on Type {
            fieldB
          }
        ";
        // Note: this is failing on "fragment"; graphql-js fails on the fragment name.
        duplicateFrag(_, "fragA", 2, 11, 5, 11);
      });
    }

    private void duplicateFrag(
      ValidationTestConfig _,
      string fragName,
      int line1,
      int column1,
      int line2,
      int column2)
    {
      _.Error(err =>
      {
        err.Message = Rule.DuplicateFragmentNameMessage(fragName);
        err.Loc(line1, column1);
        err.Loc(line2, column2);
      });
    }
  }
}


text:
[![Greenkeeper badge](https://badges.greenkeeper.io/MiguelCastillo/belty.svg)](https://greenkeeper.io/)

General purpose utility belt

> as of v5.0.0, belty only generates a minified bundle `dist/index.js`.

**Table of Contents**

- [API](#api)
  - [identity(arg?)](#identityarg)
  - [noop](#noop)
  - [pick(input, keys)](#pickinput-keys)
  - [omit(input, keys)](#omitinput-keys)
  - [assign(target, ...sources, transform)](#assigntarget-sources-transform)
  - [merge(target, ...sources, transform)](#mergetarget-sources-transform)
  - [isMatch(input, criteria)](#ismatchinput-criteria)
  - [find(input, predicate)](#findinput-predicate)
  - [findAll(input, predicate)](#findallinput-predicate)
  - [value(input, keypath, transform)](#valueinput-keypath-transform)
  - [values(input)](#valuesinput)
  - [toArray(...)](#toarray)
  - [arrayToObject(input, val)](#arraytoobjectinput-val)
- [License](#license)

# API

## identity(arg?)

Helper method that returns the first argument passed in.

- **@param** {*?} input - Argument to be returned. This is completely optional
- **@returns** {*} This returns whatever is passed in.

``` javascript
var input = 3.14;
assert(identity(input) === input);
```

## noop

noop method! It takes no arguments and does not return anything. Useful when you need to setup an initial placeholder function.

``` javascript
var input = 3.14;
assert(noop(input) === undefined);
```

## pick(input, keys)

> Alias `pluck`

Method that extracts key value pairs from the input object.

- **@param** {object} *input* - Object to generate data from.
- **@param** {string|string[]|object} *keys* - Key/value pairs to extract from `input`. Keys that do not exist in the input are ignored.
- **@returns** {object} Object with key value pairs of only the matching *keys*.

``` javascript
var input = {
  first: "Mgnum",
  last: "Rusty",
  id: "some-random-id"
};

var result = pick(input, ["first", "id", "something that does not exist"]);

// result is:
// {
//   first: "Mgnum",
//   id: "some-random-id"
// }
```

## omit(input, keys)

Pulls out all the items in the input that are **not** in `keys` and returns a new object with just that.

Opposite of *pick*

- **@param** {object} *input* - Object to generate data from.
- **@param** {string|string[]|object} *keys* - Key/value pairs to exclude from `input`.
- **@returns** {object} Object with key value pairs without the matching *keys*.

``` javascript
var input = {
  first: "Mgnum",
  last: "Rusty",
  id: "some-random-id"
};

var result = omit(input, ["first"]);

// result is:
// {
//   last: "Rusty",
//   id: "some-random-id"
// }
```

## assign(target, ...sources, transform)

> Alias `extend`

Shallow copies all properties from the input objects (sources) into the target object. Source objects are processed left to right overriding whatever values already exist in the result.

- **@param** {object} *target* - Object to copy properties to.
- **@param** {...} *source* - The source objects to be merged into the target object.
- **@param** {function} *transform* - Transform function called with current and next value in order to generate the final value for the particular object entry.

- **@returns** {object} Object with all source objects merged in.

``` javascript
var input1 = {
  first: "Mgnum",
  last: "Rusty",
  id: "some-random-id"
};

var input2 = {
  address: {
    street: "somewhere st",
    zip: "12345"
  }
};

var result = assign({}, input1, input2);

// result is a shallow copy of the input. So changing anything in address
// in the result will also change input.
//{
//  first: "Mgnum",
//  last: "Rusty",
//  id: "some-random-id",
//  address: {
//    street: "somewhere st",
//    zip: "12345"
//  }
//}
```

## merge(target, ...sources, transform)

Deep copy all properties from the input objects (sources) into the target object. It merges objects and arrays into new structures from left to right overriding all other non array/object properties.

- **@param** {object} *target* - Object to copy properties to
- **@param** {...object} *sources* - The list of source objects to be merged into the target object
- **@param** {function} *transform* - Transform function called with current and next value in order to generate the final value for the particular object entry. The transform is only called with top level objects currently being processed.
- **@returns** {object} Object with all source objects merged in.

``` javascript
var source1 = {
  data: [1, 2, 3],
  misc: "random"
};

var source2 = {
  data: [4, 5]
};

var result = merge({}, source1, source2);

// {
//   data: [4, 5, 3],
//   misc: "modded"
// }
```

``` javascript
var source1 = {
  data: [1, 2, 3],
  misc: "random"
};

var source2 = {
  data: [4, 5, 6]
};

var result = merge({}, source1, source2, transform);

function transform(current, next) {
  if (Array.isArray(next.data)) {
    return {
      data: current.data ? current.data.concat(next.data) : next.data
    };
  }

  return next;
}

// The result of this is an object with the array entries concatinated
// and the exapnded out object property as generated by the transform
// method.
// {
//   data: [1, 2, 3, 4, 5, 6],
//   misc: "random"
// }
```

## isMatch(input, criteria)

Deep comparisson of object structures recursively matching all properties in criteria with the input. If everything in the criteria matches the input, then isMatch returns true. Otherwise it returns false.

When matching items in an array, the index position is taken into account.

- **@param** {object | array | string | number} input - Object to check the criteria against
- **@param** {object | array | string | number} criteria - Object with all the data to match against
- **@returns** { boolean }

``` javascript
var input = {
  prop1: 3.14,
  prop2: [4, 8],
  prop3: {
    "prop3--1": [23]
  }
};

// Result is true
isMatch(input, {
  prop1: 3.14
});

// Result is true
isMatch(input, {
  prop2: [4]
});

// Result is false
isMatch(input, {
  prop2: [8]
});

// Result is false
isMatch(input, {
  prop2: [1]
});

// Result is true
isMatch(input, {
  prop3: {
    "prop3--1": [23]
  }
});
```

## find(input, predicate)

Find the first item in the input for which the predicate function returns true for. When the predicate is not a function, isMatch is called with the predicate as the matching criteria.

Predicate functions are called with item, index, and original collection.

- **@param** { object | array } input - Collection of items to search in.
- **@param** { object | array | string | number | function } predicate - When the predicate is a function then that is called. Otherwise, isMatch is used to deeply match object structures. The result is the first item the predicate returns true for.
- **@returns** { Object } First item to match the predicate

Example with an input array

``` javascript
var input = [{
  city: "DET",
  number: 313
}, {
  city: "RO",
  number: 2311
}, {
  city: "DET",
  number: 734
}];

// Result is
// { city: "DET", number: 313 }
findAll(input, {
  city: "DET"
});
```

Example with an input object

``` javascript
var input = {
  item1: {
    city: "DET",
    number: 313
  },
  item2: {
    city: "RO",
    number: 2311
  },
  item3: {
    city: "DET",
    number: 734
  }
};

// Result is
// { city: "DET", number: 313 }
findAll(input, {
  city: "DET"
});
```

## findAll(input, predicate)

Returns an array with all the items for which the predicate function returns true for. Or in the case when the predicate is not a function, isMatch is called with predicate as the matching criteria.

Predicate functions are called with item, index, and original collection.

- **@param** { object | array } input - Collection of items to search in.
- **@param** { object | array | string | number | function } predicate - When the predicate is a function then that is called. Otherwise, isMatch is used to deeply match object structures. The result is a collection of all the items the predicate returns true for.
- **@returns** { array } Collection of items that match the predicate.

Example with an input array

``` javascript
var input = [{
  city: "DET",
  number: 313
}, {
  city: "RO",
  number: 2311
}, {
  city: "DET",
  number: 734
}];

// Result is
// [{ city: "DET", number: 313 }, { city: "DET", number: 734 }]
findAll(input, {
  city: "DET"
});
```

Example with an input object

``` javascript
var input = {
  item1: {
    city: "DET",
    number: 313
  },
  item2: {
    city: "RO",
    number: 2311
  },
  item3: {
    city: "DET",
    number: 734
  }
};

// Result is
// [{ city: "DET", number: 313 }, { city: "DET", number: 734 }]
findAll(input, {
  city: "DET"
});
```

## value(input, keypath, transform)

> Alias objectValue

Extract the value from an input object for the given keypath.

- **@param** {object} input - Object to read `property` from.
- **@param** {string|number|array} keypath - keypath for the value in the object.
- **@param** {function?} transform - Function that is called to transform the result. The function is called with the result, keypath and the input. The result from calling the transform is returned.
- **@returns** {*} The value for the corresponding keypath.

``` javascript
var input = {
  car: {
    interior: {
      seats: {
        count: 2,
        color: "blue"
      }
    }
  }
};

var result = value(input, ["car", "interior", "seats"]);

// result is the seats
// {
//   count: 2,
//   color: "blue"
// }
```

## values(input)

> Alias objectValues

Gets the values from a object map and returns them in an array. If an array is passed in, then the array is returned as is.

- **@param** {object | Array} input - Input to get values from
- **@returns** { Array } - Array of all the values extracted from the input object, or the array itself if the input is an array.

``` javascript
var input = {
  "foo": "bar",
  "hello": "world"
};

var result = values(input);

// result is an array with just the object values
// ["bar", "world"]
```

## toArray(...)

Converts input items to an array.

> When the input is an array, the items in it are added to the final resulting array.

- **@param** { * } input - Data to be converted to array
- **@returns** { array }

When the input is an object

``` javascript
var input = {
  a: "First value",
  b: "Second value"
};

var result = toArray(input);

// result is an array with the object as its values
[{
  a: "First value",
  b: "Second value"
}]
```

When the input is an array

``` javascript
var input = [{
  a: "First value",
  b: "Second value"
}];

var result = toArray(input);

// result is an array with the object as its values
[{
  a: "First value",
  b: "Second value"
}]
```

When the input is one object and an array

``` javascript
var input1 = {
  a: "First value",
  b: "Second value"
};

var input2 = [{
  c: "Third value",
  d: "Fourth value"
}, {
  e: "Fifth value",
  f: "Sixth value"
}];

var result = toArray(input1, input2);

// result is an array with the object as its values
[{
  a: "First value",
  b: "Second value"
}, {
  c: "Third value",
  d: "Fourth value"
}, {
  e: "Fifth value",
  f: "Sixth value"
}]
```

## arrayToObject(input, val)

Converts arrays to a literal objects with the array values as keys. You can optionally pass in a callback function that is called in order to generate the values that go in the final result. `val` can also just be anything to be used as the value for each entry in the final result, otherwise `true` is used.

This method is useful in situation where you need to create a lookup table such as an object map (enums).

- **@param** { array } input - Items to convert to a map
- **@param** { *? } val - Can be a function, in which case it is called with the currect item in the array being processed in order to derive the value for the map entry. If a value of any other type is provided, that is used for populating each entry in the resulting map. Or if a value is not provided, all entries will be initialized to `true`
- **@returns** { object } Object will all the array values as keys and the derived values.

``` javascript
var input = ["first", "last", "GPS", "location"];
var result = arrayToObject(input);

// result is an object with the array items as the the keys for the object
// {
//   "first": true,
//   "last": true,
//   "GPS": true,
//   "location": true
// }
```

``` javascript
var input = ["first", "last", "GPS", "location"];
var result = arrayToObject(input, 3.14);

// result is an object with the array items as the the keys for the object
// {
//   "first": 3.14,
//   "last": 3.14,
//   "GPS": 3.14,
//   "location": 3.14
// }
```

``` javascript
var input = ["first", "last", "GPS", "location"];
var result = arrayToObject(input, transform);

function transform(value, key, array) {
  return value + "-" + key;
}

// result is an object with the array items as the the keys for the object
// {
//   "first": "first-0",
//   "last": "last-1",
//   "GPS": "GPS-2",
//   "location": "location-3"
// }
```

# License

Licensed under MIT


text:
All notable changes to `vuebbble` will be documented in this file.

## [2.7.2] - 2019-02-01

### Fixed
- Upgrade `webpack-dev-server` to `^3.1.14` due to security vulnerability in `<3.1.11` (https://nvd.nist.gov/vuln/detail/CVE-2018-14732). As a result the following packages had to be updated: `vue-loader@^14.2.2`, `webpack@^4.29.0`. Also added `webpack-cli` as a dev dependency.

## [2.7.1] - 2019-01-31

### Added
- Added custom error message example to readme.

### Changed
- Moved repo to [robbinworks/vuebbble](https://github.com/robbinworks/vuebbble).
- Moved demo to [robbinworks.github.io/vuebbble/](https://robbinworks.github.io/vuebbble/).

## [2.7.0] - 2018-05-25

### Changed
- Take advantage of javascript object destructuring feature on slot scopes. (Props to [Adam Wathan](https://youtu.be/GWdOucfAzTo?t=8m) :heart:)
- Changed shot slot name from `shots` to `shot`

## [2.6.0] - 2018-04-04

### Changed
- Updated to dribbble `v2` API (v1 deprecated).

### Removed
- Removed prop: `user`, no longer used in `v2` API.

## [2.5.0] - 2018-03-20

### Changed
- Refactor code/plugin using [spatie/skeleton-vue](https://github.com/spatie/skeleton-vue).


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>

    <groupId>org.jgroups.example</groupId>
    <artifactId>jgroups-concurrent-stack</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <name>JGroups Example</name>
    <description>jGroups Test Project </description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>

        <compiler.plugin.version>2.3.1</compiler.plugin.version>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
    </properties>

    <dependencies>

	<dependency>
           <groupId>org.jgroups</groupId>
           <artifactId>jgroups</artifactId>
           <version>3.6.6.Final</version>
       </dependency>

    </dependencies>

    <build>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
import * as vscode from 'vscode';
import { GitHubAuthenticationProvider, AuthProviderType } from './github';
import TelemetryReporter from 'vscode-extension-telemetry';
import { createExperimentationService, ExperimentationTelemetry } from './experimentationService';

export async function activate(context: vscode.ExtensionContext) {
	const { name, version, aiKey } = require('../package.json') as { name: string, version: string, aiKey: string };
	const telemetryReporter = new ExperimentationTelemetry(new TelemetryReporter(name, version, aiKey));

	const experimentationService = await createExperimentationService(context, telemetryReporter);
	await experimentationService.initialFetch;

	[
		AuthProviderType.github,
		AuthProviderType['github-enterprise']
	].forEach(async type => {
		const loginService = new GitHubAuthenticationProvider(context, type, telemetryReporter);
		await loginService.initialize();
	});
}

// this method is called when your extension is deactivated
export function deactivate() { }


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace com.mxgraph
{
    /// <summary>
    /// Basic implementation of a canvas that draws a graph.
    /// </summary>
    public abstract class mxBasicCanvas : mxICanvas
    {
        /// <summary>
        /// Defines the default value for the imageBasePath in all GDI canvases.
        /// Default is an empty string.
        /// </summary>
        public static string DEFAULT_IMAGEBASEPATH = "";

        /// <summary>
        /// Defines the base path for images with relative paths. Trailing slash
        /// is required. Default value is DEFAULT_IMAGEBASEPATH.
        /// </summary>
        protected string imageBasePath = DEFAULT_IMAGEBASEPATH;

        /// <summary>
        /// Specifies the current translation. Default is (0,0).
        /// </summary>
        protected Point translate = new Point(0, 0);

        /// <summary>
        /// Specifies the current scale. Default is 1.
        /// </summary>
        protected double scale;

        /// <summary>
        /// Specifies whether labels should be painted. Default is true.
        /// </summary>
        protected bool drawLabels = true;

        /// <summary>
        /// see com.mxgraph.mxICanvas.Translate
        /// </summary>
        public Point Translate
        {
            get { return translate; }
            set { translate = value; }
        }

        /// <summary>
        /// see com.mxgraph.mxICanvas.Scale
        /// </summary>
        public double Scale
        {
            get { return scale; }
            set { scale = value; }
        }

        /// <summary>
        /// see com.mxgraph.mxICanvas.DrawCell()
        /// </summary>
        public abstract Object DrawCell(mxCellState state);

        /// <summary>
        /// see com.mxgraph.mxICanvas.DrawLabel()
        /// </summary>
        public abstract Object DrawLabel(string text, mxCellState state, bool html);

        /// <summary>
        /// Sets if labels should be visible.
        /// </summary>
        public bool DrawLabels
        {
            get { return drawLabels; }
            set { drawLabels = value; }
        }

        /// <summary>
        /// Sets or gets the image base path.
        /// </summary>
        public string ImageBasePath
        {
            get { return imageBasePath; }
            set { imageBasePath = value; }
        }

        /// <summary>
        /// Gets the image path from the given style.  If the path is relative (does
        /// not start with a slash) then it is appended to the imageBasePath.
        /// </summary>
        /// <param name="style"></param>
        /// <returns></returns>
        protected string GetImageForStyle(Dictionary<string, Object> style)
        {
            string filename = mxUtils.GetString(style, mxConstants.STYLE_IMAGE);

            if (filename != null && !filename.StartsWith("/"))
            {
                filename = imageBasePath + filename;
            }

            return filename;
        }

    }
}


text:
        // Copyright: 2013 PMSI-AlignAlytics
        // License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
        // Source: /src/objects/storyboard/methods/getFrameValue.js
        this.getFrameValue = function () {
            var returnValue = null;
            if (this._frame >= 0 && this._getCategories().length > this._frame) {
                returnValue = this._getCategories()[this._frame];
            }
            return returnValue;
        };


text:
//
//  GZFaker.h
//
//
//  Created by John Tumminaro on 4/18/14.
//
//

#import <Foundation/Foundation.h>

/**
 *  GZDataManager represents control over the entire Gizou library.  If you want to switch languages from the default english you can do it here.
 */

@interface GZDataManager : NSObject

///------------------------
/// @name Language settings
///------------------------

/**
 *  List of the avaiable languages.
 *
 *  @return Set containing the available language codes.
 */

+ (NSSet *)availableLanguages;

/**
 *  Current language being used, default is "en".
 *
 *  @return Language code currently being used.
 */

+ (NSString *)currentLanguage;

/**
 *  Sets Gizou to use a different language code.  It must be a code that is in the `availableLanguages` set.
 *
 *  @param language String with the language code you want to switch to.
 */

+ (void)setLanguage:(NSString *)language;

@end


text:
<?php

namespace Soda\Cms\Foundation\Uploads;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Soda\Cms\Database\Models\Media;
use Illuminate\Support\Facades\Storage;
use Soda\Cms\Foundation\Uploads\Files\Base64File;
use Soda\Cms\Foundation\Uploads\Files\SymfonyFile;
use Soda\Cms\Foundation\Uploads\Files\UploadableFile;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\File\Exception\UploadException;

class Uploader
{
    public static function guessFileExtensionByMimeType($mimeType)
    {
        static $mimeTypes = null;

        if ($mimeTypes === null) {
            foreach (static::getExtensionToMimeTypeMap() as $extension => $extensionMimeType) {
                $mimeTypes[$extensionMimeType][] = $extension;
            }
        }

        if (isset($mimeTypes[$mimeType])) {
            return $mimeTypes[$mimeType][0];
        }
    }

    /**
     * Creates and uploads a single file from base64 data, returning
     * the filepath if successful. Returns false on failure.
     *
     * @param              $fileContents
     * @param null         $fileName
     * @param array        $transformConfig
     * @param              $appendedPath
     *
     * @return bool|string
     */
    public function uploadBase64($fileContents, $fileName = null, $transformConfig = [], $appendedPath = null)
    {
        return $this->upload(new Base64File($fileContents, $fileName), $transformConfig, $appendedPath);
    }

    /**
     * Uploads an UploadableFile instance and returns the path to the image.
     * Returns false on failure.
     *
     * @param UploadableFile $uploadableFile
     * @param array          $transformConfig
     * @param                $appendedPath
     *
     * @return bool|string
     */
    protected function upload(UploadableFile $uploadableFile, $transformConfig = [], $appendedPath = null)
    {
        if ($appendedPath) {
            $uploadableFile->appendToUploadPath($appendedPath);
        }

        if ($transformConfig) {
            $uploadableFile->setTransformConfig($transformConfig)->transform();
        }

        //$uploadableFile->setUploadTo(config('soda.upload.folder'));

        $uploadFilePath = $uploadableFile->uploadPath();
        $uploadConfig = [
            'visibility'   => 'public',
            'CacheControl' => 'public, max-age=2592000', // 30 days
        ];

        // Generate return information
        if ($this->driver()->put($uploadFilePath, $uploadableFile->fileContents(), $uploadConfig)) {
            if (config('filesystems.disks.'.config('soda.upload.default').'.driver') == 'local') {
                return substr($this->driver()->getAdapter()->applyPathPrefix($uploadFilePath), strlen(public_path()));
            }

            return $this->driver()->url(trim($uploadFilePath, '/'));
        }

        return false;
    }

    /**
     * Specifies the driver used by the uploader.
     *
     * @return mixed
     */
    protected function driver()
    {
        $driver = config('soda.upload.default');

        return Storage::disk($driver);
    }

    /**
     * Uploads a file and returns a response to be consumed by
     * bootstrap-fileinput jQuery plugin.
     *
     * @param Request $request
     * @param array   $transformConfig
     * @param         $appendedPath
     *
     * @return array|\Illuminate\Http\JsonResponse
     */
    public function fancyUpload(Request $request, $transformConfig = [], $appendedPath = null)
    {
        if ($request->hasFile('file')) {
            foreach ($request->file('file') as $file) {
                if ($file->isValid()) {
                    $uploadedFile = $this->uploadFile($file, $transformConfig, $appendedPath);

                    // Generate return information
                    if ($uploadedFile) {
                        return $this->generateFancyUploadResponse($request, $uploadedFile);
                    }
                } else {
                    throw new UploadException('File not valid.');
                }
            }
        }

        throw new UploadException('No valid files to upload');
    }

    /**
     * Uploads a single file and returns the filepath if successful.
     * Returns false on failure.
     *
     * @param UploadedFile $file
     * @param array        $transformConfig
     * @param              $appendedPath
     *
     * @return bool|string
     */
    public function uploadFile(UploadedFile $file, $transformConfig = [], $appendedPath = null)
    {
        if ($file->isValid()) {
            return $this->upload(new SymfonyFile($file), $transformConfig, $appendedPath);
        }

        return false;
    }

    /**
     * Generates a JSON response for bootstrap-fileinput jQuery plugin.
     *
     * @param Request $request
     * @param         $uploadedFilePath
     *
     * @return array
     */
    protected function generateFancyUploadResponse(Request $request, $uploadedFilePath)
    {
        $mimeType = static::detectByFilename($uploadedFilePath);
        $isMulti = $request->input('multi') && $request->input('multi') == 'true';
        $return = [
            'append'               => $isMulti ? true : false,
            'initialPreview'       => [$uploadedFilePath], // todo: not always an image
            'initialPreviewAsData' => true,
            'initialPreviewCount'  => 1,
            'initialPreviewConfig' => [
                [
                    'filetype' => $mimeType,
                    'type'     => static::guessFileTypeByMimeType($mimeType),
                    'width'    => '120px',
                ],
            ],
        ];

        $table = $request->input('related_table');
        $field = $request->input('related_field');
        $id = $request->input('related_id');

        if ($isMulti) {
            $media = Media::create([
                'related_id'    => $id,
                'related_table' => $table,
                'related_field' => $field,
                'position'      => $request->input('file_id'),
                'media'         => $uploadedFilePath,
                'media_type'    => 'image',
            ]);

            $return['initialPreviewConfig'][0]['key'] = $media->id;
            $return['initialPreviewConfig'][0]['extra'] = [
                'key'           => $media->id,
                'related_table' => $table,
                'related_field' => $field,
                'related_id'    => $id,
            ];
        } else {
            DB::table($table)->where('id', $id)->update([
                $field => $uploadedFilePath,
            ]);

            $return['initialPreviewConfig'][0]['key'] = null;
            $return['initialPreviewConfig'][0]['extra'] = [
                'related_table' => $table,
                'related_field' => $field,
                'related_id'    => $id,
            ];
        }

        return $return;
    }

    /**
     * @param string $filename
     *
     * @return string
     */
    public static function detectByFilename($filename)
    {
        $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));

        return empty($extension) ? 'text/plain' : static::detectByFileExtension($extension);
    }

    /**
     * Detects MIME Type based on file extension.
     *
     * @param string $extension
     *
     * @return string|null MIME Type or NULL if no extension detected
     */
    public static function detectByFileExtension($extension)
    {
        static $extensionToMimeTypeMap;

        if (! $extensionToMimeTypeMap) {
            $extensionToMimeTypeMap = static::getExtensionToMimeTypeMap();
        }

        if (isset($extensionToMimeTypeMap[$extension])) {
            return $extensionToMimeTypeMap[$extension];
        }

        return 'text/plain';
    }

    /**
     * @return array Map of file extension to MIME Type
     */
    public static function getExtensionToMimeTypeMap()
    {
        return [
            'hqx'   => 'application/mac-binhex40',
            'cpt'   => 'application/mac-compactpro',
            'csv'   => 'text/x-comma-separated-values',
            'bin'   => 'application/octet-stream',
            'dms'   => 'application/octet-stream',
            'lha'   => 'application/octet-stream',
            'lzh'   => 'application/octet-stream',
            'exe'   => 'application/octet-stream',
            'class' => 'application/octet-stream',
            'psd'   => 'application/x-photoshop',
            'so'    => 'application/octet-stream',
            'sea'   => 'application/octet-stream',
            'dll'   => 'application/octet-stream',
            'oda'   => 'application/oda',
            'pdf'   => 'application/pdf',
            'ai'    => 'application/pdf',
            'eps'   => 'application/postscript',
            'ps'    => 'application/postscript',
            'smi'   => 'application/smil',
            'smil'  => 'application/smil',
            'mif'   => 'application/vnd.mif',
            'xls'   => 'application/vnd.ms-excel',
            'ppt'   => 'application/powerpoint',
            'pptx'  => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
            'wbxml' => 'application/wbxml',
            'wmlc'  => 'application/wmlc',
            'dcr'   => 'application/x-director',
            'dir'   => 'application/x-director',
            'dxr'   => 'application/x-director',
            'dvi'   => 'application/x-dvi',
            'gtar'  => 'application/x-gtar',
            'gz'    => 'application/x-gzip',
            'gzip'  => 'application/x-gzip',
            'php'   => 'application/x-httpd-php',
            'php4'  => 'application/x-httpd-php',
            'php3'  => 'application/x-httpd-php',
            'phtml' => 'application/x-httpd-php',
            'phps'  => 'application/x-httpd-php-source',
            'js'    => 'application/javascript',
            'swf'   => 'application/x-shockwave-flash',
            'sit'   => 'application/x-stuffit',
            'tar'   => 'application/x-tar',
            'tgz'   => 'application/x-tar',
            'z'     => 'application/x-compress',
            'xhtml' => 'application/xhtml+xml',
            'xht'   => 'application/xhtml+xml',
            'zip'   => 'application/x-zip',
            'rar'   => 'application/x-rar',
            'mid'   => 'audio/midi',
            'midi'  => 'audio/midi',
            'mpga'  => 'audio/mpeg',
            'mp2'   => 'audio/mpeg',
            'mp3'   => 'audio/mpeg',
            'aif'   => 'audio/x-aiff',
            'aiff'  => 'audio/x-aiff',
            'aifc'  => 'audio/x-aiff',
            'ram'   => 'audio/x-pn-realaudio',
            'rm'    => 'audio/x-pn-realaudio',
            'rpm'   => 'audio/x-pn-realaudio-plugin',
            'ra'    => 'audio/x-realaudio',
            'rv'    => 'video/vnd.rn-realvideo',
            'wav'   => 'audio/x-wav',
            'jpg'   => 'image/jpeg',
            'jpeg'  => 'image/jpeg',
            'jpe'   => 'image/jpeg',
            'png'   => 'image/png',
            'gif'   => 'image/gif',
            'bmp'   => 'image/bmp',
            'tiff'  => 'image/tiff',
            'tif'   => 'image/tiff',
            'svg'   => 'image/svg+xml',
            'css'   => 'text/css',
            'html'  => 'text/html',
            'htm'   => 'text/html',
            'shtml' => 'text/html',
            'txt'   => 'text/plain',
            'text'  => 'text/plain',
            'log'   => 'text/plain',
            'rtx'   => 'text/richtext',
            'rtf'   => 'text/rtf',
            'xml'   => 'application/xml',
            'xsl'   => 'application/xml',
            'mpeg'  => 'video/mpeg',
            'mpg'   => 'video/mpeg',
            'mpe'   => 'video/mpeg',
            'qt'    => 'video/quicktime',
            'mov'   => 'video/quicktime',
            'avi'   => 'video/x-msvideo',
            'movie' => 'video/x-sgi-movie',
            'doc'   => 'application/msword',
            'docx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'dot'   => 'application/msword',
            'dotx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'xlsx'  => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            'word'  => 'application/msword',
            'xl'    => 'application/excel',
            'eml'   => 'message/rfc822',
            'json'  => 'application/json',
            'pem'   => 'application/x-x509-user-cert',
            'p10'   => 'application/x-pkcs10',
            'p12'   => 'application/x-pkcs12',
            'p7a'   => 'application/x-pkcs7-signature',
            'p7c'   => 'application/pkcs7-mime',
            'p7m'   => 'application/pkcs7-mime',
            'p7r'   => 'application/x-pkcs7-certreqresp',
            'p7s'   => 'application/pkcs7-signature',
            'crt'   => 'application/x-x509-ca-cert',
            'crl'   => 'application/pkix-crl',
            'der'   => 'application/x-x509-ca-cert',
            'kdb'   => 'application/octet-stream',
            'pgp'   => 'application/pgp',
            'gpg'   => 'application/gpg-keys',
            'sst'   => 'application/octet-stream',
            'csr'   => 'application/octet-stream',
            'rsa'   => 'application/x-pkcs7',
            'cer'   => 'application/pkix-cert',
            '3g2'   => 'video/3gpp2',
            '3gp'   => 'video/3gp',
            'mp4'   => 'video/mp4',
            'm4a'   => 'audio/x-m4a',
            'f4v'   => 'video/mp4',
            'webm'  => 'video/webm',
            'aac'   => 'audio/x-acc',
            'm4u'   => 'application/vnd.mpegurl',
            'm3u'   => 'text/plain',
            'xspf'  => 'application/xspf+xml',
            'vlc'   => 'application/videolan',
            'wmv'   => 'video/x-ms-wmv',
            'au'    => 'audio/x-au',
            'ac3'   => 'audio/ac3',
            'flac'  => 'audio/x-flac',
            'ogg'   => 'audio/ogg',
            'kmz'   => 'application/vnd.google-earth.kmz',
            'kml'   => 'application/vnd.google-earth.kml+xml',
            'ics'   => 'text/calendar',
            'zsh'   => 'text/x-scriptzsh',
            '7zip'  => 'application/x-7z-compressed',
            'cdr'   => 'application/cdr',
            'wma'   => 'audio/x-ms-wma',
            'jar'   => 'application/java-archive',
        ];
    }

    /**
     * @param string $mimeType
     *
     * @return string
     */
    public static function guessFileTypeByMimeType($mimeType)
    {
        switch ($mimeType) {
            case 'text/html':
                return 'html';
            case 'text/css':
            case 'text/plain':
            case 'text/richtext':
            case 'text/rtf':
            case 'text/x-comma-separated-values':
            case 'application/xml':
            case 'application/json':
                return 'text';
            case 'application/pdf':
                return 'pdf';
            case 'audio/midi':
            case 'audio/mpeg':
            case 'audio/x-aiff':
            case 'audio/x-pn-realaudio':
            case 'audio/x-pn-realaudio-plugin':
            case 'audio/x-realaudio':
            case 'audio/x-wav':
            case 'audio/x-m4a':
            case 'audio/x-acc':
                return 'audio';
            case 'image/jpeg':
            case 'image/png':
            case 'image/gif':
            case 'image/bmp':
            case 'image/tiff':
            case 'image/svg+xml':
            case 'audio/x-au':
            case 'audio/ac3':
            case 'audio/x-flac':
            case 'audio/ogg':
            case 'audio/x-ms-wma':
                return 'image';
            case 'video/mpeg':
            case 'video/quicktime':
            case 'video/x-msvideo':
            case 'video/x-sgi-movie':
            case 'video/vnd.rn-realvideo':
            case 'video/3gpp2':
            case 'video/3gp':
            case 'video/mp4':
            case 'video/webm':
            case 'application/vnd.mpegurl':
            case 'video/x-ms-wmv':
                return 'video';
        }

        return 'other';
    }
}


text:
<?php

namespace xsist10\HaveIBeenPwned\Response;

class BreachResponse
{
    private $breach;

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

    public function getName() {
        return $this->breach['Name'];
    }

    public function getTitle() {
        return $this->breach['Title'];
    }

    public function getDomain() {
        return $this->breach['Domain'];
    }

    public function getBreachDate() {
        return $this->breach['BreachDate'];
    }

    public function getAddedDate() {
        return $this->breach['AddedDate'];
    }

    public function getModifiedDate() {
        return $this->breach['ModifiedDate'];
    }

    public function getPwnCount() {
        return $this->breach['PwnCount'];
    }

    public function getDescription() {
        return $this->breach['Description'];
    }

    public function getIsVerified() {
        return $this->breach['IsVerified'];
    }

    public function getIsFabricated() {
        return $this->breach['IsFabricated'];
    }

    public function getIsSensitive() {
        return $this->breach['IsSensitive'];
    }

    public function getIsActive() {
        return $this->breach['IsActive'];
    }

    public function getIsRetired() {
        return $this->breach['IsRetired'];
    }

    public function getIsSpamList() {
        return $this->breach['IsSpamList'];
    }

    public function getLogoType() {
        return $this->breach['LogoType'];
    }

    public function getDataClasses() {
        return new DataClassResponse($this->breach['DataClasses']);
    }
}


text:
var AppSettings = {};

/**
 * Helper method for detecting production enviroment
 *
 * @return {boolean} - 'true' for production enviroment, 'false' for development
 */
AppSettings.isProduction = function () {
    var host = window.location.hostname;

    if (host === 'localhost') {
        return false;
    }

    return true;
};

/**
 * Helper method for detecting development enviroment
 *
 * @return {boolean} - 'false' for production enviroment, 'true' for development
 */
AppSettings.isNotProduction = function () {
    return !AppSettings.isProduction();
};

/**
 * Print version info on the page
 *
 * @type {boolean}
 */
AppSettings.renderVersionInfo = true;

export default AppSettings;