text:
Character::Character(char * fileName, Tile * startTile, BaseWeapon * weapon, Team * team)
	: Sprite2D(Texture::loadTexture(fileName)) {

		//set up the positions
		Sprite2D::Position = startTile->Position;
		AICharacter::Position = startTile->Position;

		Weapon = weapon;
		Weapon->Holder = this;
		AICharacter::registerWeapon(weapon);

		//set up ai vars
		AICharacter::DestinationTile = startTile;
		AICharacter::CurrentTile = startTile;
		startTile->IsOccupied = true;
		AICharacter::movedToTile(startTile);
		AICharacter::registerTeam(team);
		AICharacter::TheDecisionTree = new DecisionTree(this, startTile->ParentLevel);

		//default values
		Sprite2D::Rotation = 0;
		AICharacter::Rotation = 0;
		Health = MaxHealth = 20;
}

//Updates the character
void Character::update(float dt) {

	//match the ai positions and rotations to that of this character
	AICharacter::Position = Sprite2D::Position;
	AICharacter::Rotation = Sprite2D::Rotation;

	//only perform the AI if we are not dead
	if (IsDead == false)
		AICharacter::update(dt);
}

//Updates traits of the ai character based on this classes' variables
void Character::updateChildTraits() {

	//reduce the boldness of a character depending on their health
	float hpRatio = Health / (float)MaxHealth;

	if (hpRatio <= 0.4f) {

		Boldness = max(Boldness - 4, 0);
		Aggression = max(Aggression - 2, 0);
	}

	else if (hpRatio <= 0.6f) {

		Boldness = max(Boldness - 2, 0);
		Aggression = max(Aggression - 1, 0);
	}
}

//Method for when damage is taken from
//the character holding the weapon
void Character::damageTaken(AICharacter * source) {

	if (Health > 0)
		Health--;

	if (Health <= 0 && IsDead == false) {

		//mark character as dead and make them display dead
		IsDead = true;
		Sprite2D::DisplayColour.a = 0.1f;

		//delete the current action if we have one
		if (HasAction == true) {

			CurrentAct->hardCancel();
			delete CurrentAct;
			HasAction = false;
		}

		if (CurrentTile == DestinationTile)
			CurrentTile->IsOccupied = false;

		//remove character from its team
		ParentTeam->removeMember(this);
	}
}

void Character::draw() {

	//draw the character
	Sprite2D::draw();

	//draw the weapon and the decision tree though process
	if (IsDead == false) {

		Weapon->draw();
		TheDecisionTree->draw();
	}
}

string Character::toString() {

	std::stringstream output;
	output << "Team ";
	output << AICharacter::ParentTeam->Identifier;
	output << " ";
	output << Weapon->toString();
	output << "man";

	return output.str();
}

//AI Behaviour overrides and required functions
//=============================================================

//Moves the character by a vector
void Character::moveBy(Vector3 move) {

	if (move == Vector3(0, 0, 0))
		return;

	//face towards the point we are moving too
	faceTowards(Sprite2D::Position + move);

	//move the sprite
	Sprite2D::Position = Sprite2D::Position + move;
}

//Rotates the character by an amount of
void Character::rotateBy(float amount) {

	Sprite2D::Rotation += amount;
}

//rotates the character to face a point
void Character::faceTowards(Vector3 point) {

	//work out the direction we have to face
	Vector3 difference = point - Sprite2D::Position;

	//resolve vector into an angle, where 0 is facing up n degrees
	Sprite2D::Rotation = ((atan2(difference.y, difference.x) * 180) / 3.1415926) + 90;
}

Character::~Character() {
}


text:
Part of the "EasyProject" framework.

Abstractions layer for "EasyProject".

[![Build status](https://ci.appveyor.com/api/projects/status/yjoybk7wtgn6mnme/branch/dev?svg=true)](https://ci.appveyor.com/project/webflo/easyproject-abstractions/branch/dev)

redpajama_set_name: RedPajamaGithub


text:
package com.spare.cointrade;

import com.spare.cointrade.realtime.huobi.HuobiClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Created by dada on 2017/8/20.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestHuobiClient {

    @Autowired
    HuobiClient huobiClient;

    @Test
    public void testStart() throws InterruptedException {
        huobiClient.startFetch();

        Thread.currentThread().join();
    }

}


text:
package com.opengamma.master.position.impl;

import java.util.List;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

import com.opengamma.id.ObjectId;
import com.opengamma.master.AbstractDocumentDataResource;
import com.opengamma.master.position.PositionDocument;
import com.opengamma.master.position.PositionHistoryRequest;
import com.opengamma.master.position.PositionHistoryResult;
import com.opengamma.master.position.PositionMaster;
import com.opengamma.util.ArgumentChecker;
import com.opengamma.util.rest.RestUtils;

/**
 * RESTful resource for a position in the position master.
 */
public class DataPositionResource extends AbstractDocumentDataResource<PositionDocument> {

  /**
   * The parent resource.
   */
  private final DataPositionMasterResource _parentResource;
  /**
   * The identifier specified in the URI.
   */
  private ObjectId _urlResourceId;

  /**
   * Creates dummy resource for the purpose of url resolution.
   *
   */
  DataPositionResource() {
    _parentResource = null;
  }

  /**
   * Creates the resource.
   *
   * @param parentResource  the parent resource, not null
   * @param positionId  the position unique identifier, not null
   */
  public DataPositionResource(final DataPositionMasterResource parentResource, final ObjectId positionId) {
    ArgumentChecker.notNull(parentResource, "parentResource");
    ArgumentChecker.notNull(positionId, "position");
    _parentResource = parentResource;
    _urlResourceId = positionId;
  }

  //-------------------------------------------------------------------------

  /**
   * Gets the parent resource.
   *
   * @return the parent resource, not null
   */
  public DataPositionMasterResource getParentResource() {
    return _parentResource;
  }

  /**
   * Gets the position identifier from the URL.
   *
   * @return the unique identifier, not null
   */
  public ObjectId getUrlId() {
    return _urlResourceId;
  }

  //-------------------------------------------------------------------------

  /**
   * Gets the position master.
   *
   * @return the position master, not null
   */
  public PositionMaster getMaster() {
    return getParentResource().getPositionMaster();
  }

  //-------------------------------------------------------------------------
  @GET
  @Path("versions")
  public Response history(@Context UriInfo uriInfo) {
    PositionHistoryRequest request = RestUtils.decodeQueryParams(uriInfo, PositionHistoryRequest.class);
    if (getUrlId().equals(request.getObjectId()) == false) {
      throw new IllegalArgumentException("Document objectId does not match URI");
    }
    PositionHistoryResult result = getMaster().history(request);
    return responseOkObject(result);
  }

  @GET
  public Response get(@QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo) {
    return super.get(versionAsOf, correctedTo);
  }

  @POST
  public Response update(@Context UriInfo uriInfo, PositionDocument request) {
    return super.update(uriInfo, request);
  }

  @DELETE
  public void remove() {
    super.remove();
  }

  @GET
  @Path("versions/{versionId}")
  public Response getVersioned(@PathParam("versionId") String versionId) {
    return super.getVersioned(versionId);
  }

  @PUT
  @Path("versions/{versionId}")
  public Response replaceVersion(@PathParam("versionId") String versionId, List<PositionDocument> replacementDocuments) {
    return super.replaceVersion(versionId, replacementDocuments);
  }

  @PUT
  public Response replaceVersions(List<PositionDocument> replacementDocuments) {
    return super.replaceVersions(replacementDocuments);
  }

  @PUT
  @Path("all")
  public Response replaceAllVersions(List<PositionDocument> replacementDocuments) {
    return super.replaceAllVersions(replacementDocuments);
  }

  @Override
  protected String getResourceName() {
    return "positions";
  }
}


text:
@interface PodsDummy_Pods_TBCore_Tests : NSObject
@end
@implementation PodsDummy_Pods_TBCore_Tests
@end


text:
cd RepoA
git checkout -f -B master

#Create an annotated tag
git tag -a v1.0.annotated -m 'my version 1.0 annotted'
git push --progress  "origin" master:master

#Add a commit
echo "A" >> File1.txt
echo "B" >> File1.txt
git add File1.txt
git commit -m "This is a commit"

#Create a lightweight tag
git tag v1.0.lightweight
git push --tags --progress  "origin" master:master

read -p "paused"


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/micro/slack-srv/proto/channels/channels.proto

/*
Package go_micro_srv_slack is a generated protocol buffer package.

It is generated from these files:
	github.com/micro/slack-srv/proto/channels/channels.proto

It has these top-level messages:
	Channel
	ListRequest
	ListResponse
	HistoryRequest
	HistoryResponse
	InfoRequest
	InfoResponse
	MarkRequest
	MarkResponse
	SetPurposeRequest
	SetPurposeResponse
	SetTopicRequest
	SetTopicResponse
*/
package go_micro_srv_slack

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import go_micro_srv_slack1 "github.com/micro/slack-srv/proto"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type Channel struct {
	Id                 string                       `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Name               string                       `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Created            int64                        `protobuf:"varint,3,opt,name=created" json:"created,omitempty"`
	Creator            string                       `protobuf:"bytes,4,opt,name=creator" json:"creator,omitempty"`
	IsArchived         bool                         `protobuf:"varint,5,opt,name=is_archived,json=isArchived" json:"is_archived,omitempty"`
	IsMember           bool                         `protobuf:"varint,6,opt,name=is_member,json=isMember" json:"is_member,omitempty"`
	IsGeneral          bool                         `protobuf:"varint,7,opt,name=is_general,json=isGeneral" json:"is_general,omitempty"`
	NumMembers         int64                        `protobuf:"varint,8,opt,name=num_members,json=numMembers" json:"num_members,omitempty"`
	Topic              *go_micro_srv_slack1.Topic   `protobuf:"bytes,9,opt,name=topic" json:"topic,omitempty"`
	Purpose            *go_micro_srv_slack1.Purpose `protobuf:"bytes,10,opt,name=purpose" json:"purpose,omitempty"`
	Members            []string                     `protobuf:"bytes,11,rep,name=members" json:"members,omitempty"`
	LatestRead         string                       `protobuf:"bytes,12,opt,name=latest_read,json=latestRead" json:"latest_read,omitempty"`
	Latest             *go_micro_srv_slack1.Message `protobuf:"bytes,13,opt,name=latest" json:"latest,omitempty"`
	UnreadCount        int64                        `protobuf:"varint,14,opt,name=unread_count,json=unreadCount" json:"unread_count,omitempty"`
	UnreadCountDisplay int64                        `protobuf:"varint,15,opt,name=unread_count_display,json=unreadCountDisplay" json:"unread_count_display,omitempty"`
}

func (m *Channel) Reset()                    { *m = Channel{} }
func (m *Channel) String() string            { return proto.CompactTextString(m) }
func (*Channel) ProtoMessage()               {}
func (*Channel) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

func (m *Channel) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *Channel) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Channel) GetCreated() int64 {
	if m != nil {
		return m.Created
	}
	return 0
}

func (m *Channel) GetCreator() string {
	if m != nil {
		return m.Creator
	}
	return ""
}

func (m *Channel) GetIsArchived() bool {
	if m != nil {
		return m.IsArchived
	}
	return false
}

func (m *Channel) GetIsMember() bool {
	if m != nil {
		return m.IsMember
	}
	return false
}

func (m *Channel) GetIsGeneral() bool {
	if m != nil {
		return m.IsGeneral
	}
	return false
}

func (m *Channel) GetNumMembers() int64 {
	if m != nil {
		return m.NumMembers
	}
	return 0
}

func (m *Channel) GetTopic() *go_micro_srv_slack1.Topic {
	if m != nil {
		return m.Topic
	}
	return nil
}

func (m *Channel) GetPurpose() *go_micro_srv_slack1.Purpose {
	if m != nil {
		return m.Purpose
	}
	return nil
}

func (m *Channel) GetMembers() []string {
	if m != nil {
		return m.Members
	}
	return nil
}

func (m *Channel) GetLatestRead() string {
	if m != nil {
		return m.LatestRead
	}
	return ""
}

func (m *Channel) GetLatest() *go_micro_srv_slack1.Message {
	if m != nil {
		return m.Latest
	}
	return nil
}

func (m *Channel) GetUnreadCount() int64 {
	if m != nil {
		return m.UnreadCount
	}
	return 0
}

func (m *Channel) GetUnreadCountDisplay() int64 {
	if m != nil {
		return m.UnreadCountDisplay
	}
	return 0
}

type ListRequest struct {
	ExcludeArchived int64 `protobuf:"varint,1,opt,name=exclude_archived,json=excludeArchived" json:"exclude_archived,omitempty"`
}

func (m *ListRequest) Reset()                    { *m = ListRequest{} }
func (m *ListRequest) String() string            { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage()               {}
func (*ListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *ListRequest) GetExcludeArchived() int64 {
	if m != nil {
		return m.ExcludeArchived
	}
	return 0
}

type ListResponse struct {
	Ok       bool       `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error    string     `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	Channels []*Channel `protobuf:"bytes,3,rep,name=channels" json:"channels,omitempty"`
}

func (m *ListResponse) Reset()                    { *m = ListResponse{} }
func (m *ListResponse) String() string            { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage()               {}
func (*ListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func (m *ListResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *ListResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

func (m *ListResponse) GetChannels() []*Channel {
	if m != nil {
		return m.Channels
	}
	return nil
}

type HistoryRequest struct {
	Channel   string  `protobuf:"bytes,1,opt,name=channel" json:"channel,omitempty"`
	Latest    float64 `protobuf:"fixed64,2,opt,name=latest" json:"latest,omitempty"`
	Oldest    float64 `protobuf:"fixed64,3,opt,name=oldest" json:"oldest,omitempty"`
	Inclusive int64   `protobuf:"varint,4,opt,name=inclusive" json:"inclusive,omitempty"`
	Count     int64   `protobuf:"varint,5,opt,name=count" json:"count,omitempty"`
	Unreads   int64   `protobuf:"varint,6,opt,name=unreads" json:"unreads,omitempty"`
}

func (m *HistoryRequest) Reset()                    { *m = HistoryRequest{} }
func (m *HistoryRequest) String() string            { return proto.CompactTextString(m) }
func (*HistoryRequest) ProtoMessage()               {}
func (*HistoryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

func (m *HistoryRequest) GetChannel() string {
	if m != nil {
		return m.Channel
	}
	return ""
}

func (m *HistoryRequest) GetLatest() float64 {
	if m != nil {
		return m.Latest
	}
	return 0
}

func (m *HistoryRequest) GetOldest() float64 {
	if m != nil {
		return m.Oldest
	}
	return 0
}

func (m *HistoryRequest) GetInclusive() int64 {
	if m != nil {
		return m.Inclusive
	}
	return 0
}

func (m *HistoryRequest) GetCount() int64 {
	if m != nil {
		return m.Count
	}
	return 0
}

func (m *HistoryRequest) GetUnreads() int64 {
	if m != nil {
		return m.Unreads
	}
	return 0
}

type HistoryResponse struct {
	Ok       bool                           `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error    string                         `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	Latest   string                         `protobuf:"bytes,3,opt,name=latest" json:"latest,omitempty"`
	Messages []*go_micro_srv_slack1.Message `protobuf:"bytes,4,rep,name=messages" json:"messages,omitempty"`
	HasMore  bool                           `protobuf:"varint,5,opt,name=has_more,json=hasMore" json:"has_more,omitempty"`
}

func (m *HistoryResponse) Reset()                    { *m = HistoryResponse{} }
func (m *HistoryResponse) String() string            { return proto.CompactTextString(m) }
func (*HistoryResponse) ProtoMessage()               {}
func (*HistoryResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }

func (m *HistoryResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *HistoryResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

func (m *HistoryResponse) GetLatest() string {
	if m != nil {
		return m.Latest
	}
	return ""
}

func (m *HistoryResponse) GetMessages() []*go_micro_srv_slack1.Message {
	if m != nil {
		return m.Messages
	}
	return nil
}

func (m *HistoryResponse) GetHasMore() bool {
	if m != nil {
		return m.HasMore
	}
	return false
}

type InfoRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel" json:"channel,omitempty"`
}

func (m *InfoRequest) Reset()                    { *m = InfoRequest{} }
func (m *InfoRequest) String() string            { return proto.CompactTextString(m) }
func (*InfoRequest) ProtoMessage()               {}
func (*InfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }

func (m *InfoRequest) GetChannel() string {
	if m != nil {
		return m.Channel
	}
	return ""
}

type InfoResponse struct {
	Ok      bool     `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error   string   `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	Channel *Channel `protobuf:"bytes,3,opt,name=channel" json:"channel,omitempty"`
}

func (m *InfoResponse) Reset()                    { *m = InfoResponse{} }
func (m *InfoResponse) String() string            { return proto.CompactTextString(m) }
func (*InfoResponse) ProtoMessage()               {}
func (*InfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }

func (m *InfoResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *InfoResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

func (m *InfoResponse) GetChannel() *Channel {
	if m != nil {
		return m.Channel
	}
	return nil
}

type MarkRequest struct {
	Channel string  `protobuf:"bytes,1,opt,name=channel" json:"channel,omitempty"`
	Ts      float64 `protobuf:"fixed64,2,opt,name=ts" json:"ts,omitempty"`
}

func (m *MarkRequest) Reset()                    { *m = MarkRequest{} }
func (m *MarkRequest) String() string            { return proto.CompactTextString(m) }
func (*MarkRequest) ProtoMessage()               {}
func (*MarkRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }

func (m *MarkRequest) GetChannel() string {
	if m != nil {
		return m.Channel
	}
	return ""
}

func (m *MarkRequest) GetTs() float64 {
	if m != nil {
		return m.Ts
	}
	return 0
}

type MarkResponse struct {
	Ok    bool   `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
}

func (m *MarkResponse) Reset()                    { *m = MarkResponse{} }
func (m *MarkResponse) String() string            { return proto.CompactTextString(m) }
func (*MarkResponse) ProtoMessage()               {}
func (*MarkResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }

func (m *MarkResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *MarkResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

type SetPurposeRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel" json:"channel,omitempty"`
	Purpose string `protobuf:"bytes,2,opt,name=purpose" json:"purpose,omitempty"`
}

func (m *SetPurposeRequest) Reset()                    { *m = SetPurposeRequest{} }
func (m *SetPurposeRequest) String() string            { return proto.CompactTextString(m) }
func (*SetPurposeRequest) ProtoMessage()               {}
func (*SetPurposeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }

func (m *SetPurposeRequest) GetChannel() string {
	if m != nil {
		return m.Channel
	}
	return ""
}

func (m *SetPurposeRequest) GetPurpose() string {
	if m != nil {
		return m.Purpose
	}
	return ""
}

type SetPurposeResponse struct {
	Ok      bool   `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	Purpose string `protobuf:"bytes,3,opt,name=purpose" json:"purpose,omitempty"`
}

func (m *SetPurposeResponse) Reset()                    { *m = SetPurposeResponse{} }
func (m *SetPurposeResponse) String() string            { return proto.CompactTextString(m) }
func (*SetPurposeResponse) ProtoMessage()               {}
func (*SetPurposeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }

func (m *SetPurposeResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *SetPurposeResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

func (m *SetPurposeResponse) GetPurpose() string {
	if m != nil {
		return m.Purpose
	}
	return ""
}

type SetTopicRequest struct {
	Channel string `protobuf:"bytes,1,opt,name=channel" json:"channel,omitempty"`
	Topic   string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
}

func (m *SetTopicRequest) Reset()                    { *m = SetTopicRequest{} }
func (m *SetTopicRequest) String() string            { return proto.CompactTextString(m) }
func (*SetTopicRequest) ProtoMessage()               {}
func (*SetTopicRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }

func (m *SetTopicRequest) GetChannel() string {
	if m != nil {
		return m.Channel
	}
	return ""
}

func (m *SetTopicRequest) GetTopic() string {
	if m != nil {
		return m.Topic
	}
	return ""
}

type SetTopicResponse struct {
	Ok    bool   `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	Topic string `protobuf:"bytes,3,opt,name=topic" json:"topic,omitempty"`
}

func (m *SetTopicResponse) Reset()                    { *m = SetTopicResponse{} }
func (m *SetTopicResponse) String() string            { return proto.CompactTextString(m) }
func (*SetTopicResponse) ProtoMessage()               {}
func (*SetTopicResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }

func (m *SetTopicResponse) GetOk() bool {
	if m != nil {
		return m.Ok
	}
	return false
}

func (m *SetTopicResponse) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

func (m *SetTopicResponse) GetTopic() string {
	if m != nil {
		return m.Topic
	}
	return ""
}

func init() {
	proto.RegisterType((*Channel)(nil), "go.micro.srv.slack.Channel")
	proto.RegisterType((*ListRequest)(nil), "go.micro.srv.slack.ListRequest")
	proto.RegisterType((*ListResponse)(nil), "go.micro.srv.slack.ListResponse")
	proto.RegisterType((*HistoryRequest)(nil), "go.micro.srv.slack.HistoryRequest")
	proto.RegisterType((*HistoryResponse)(nil), "go.micro.srv.slack.HistoryResponse")
	proto.RegisterType((*InfoRequest)(nil), "go.micro.srv.slack.InfoRequest")
	proto.RegisterType((*InfoResponse)(nil), "go.micro.srv.slack.InfoResponse")
	proto.RegisterType((*MarkRequest)(nil), "go.micro.srv.slack.MarkRequest")
	proto.RegisterType((*MarkResponse)(nil), "go.micro.srv.slack.MarkResponse")
	proto.RegisterType((*SetPurposeRequest)(nil), "go.micro.srv.slack.SetPurposeRequest")
	proto.RegisterType((*SetPurposeResponse)(nil), "go.micro.srv.slack.SetPurposeResponse")
	proto.RegisterType((*SetTopicRequest)(nil), "go.micro.srv.slack.SetTopicRequest")
	proto.RegisterType((*SetTopicResponse)(nil), "go.micro.srv.slack.SetTopicResponse")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for Channels service

type ChannelsClient interface {
	History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error)
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Mark(ctx context.Context, in *MarkRequest, opts ...grpc.CallOption) (*MarkResponse, error)
	SetPurpose(ctx context.Context, in *SetPurposeRequest, opts ...grpc.CallOption) (*SetPurposeResponse, error)
	SetTopic(ctx context.Context, in *SetTopicRequest, opts ...grpc.CallOption) (*SetTopicResponse, error)
}

type channelsClient struct {
	cc *grpc.ClientConn
}

func NewChannelsClient(cc *grpc.ClientConn) ChannelsClient {
	return &channelsClient{cc}
}

func (c *channelsClient) History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error) {
	out := new(HistoryResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/History", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *channelsClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
	out := new(InfoResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/Info", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *channelsClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
	out := new(ListResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/List", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *channelsClient) Mark(ctx context.Context, in *MarkRequest, opts ...grpc.CallOption) (*MarkResponse, error) {
	out := new(MarkResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/Mark", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *channelsClient) SetPurpose(ctx context.Context, in *SetPurposeRequest, opts ...grpc.CallOption) (*SetPurposeResponse, error) {
	out := new(SetPurposeResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/SetPurpose", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *channelsClient) SetTopic(ctx context.Context, in *SetTopicRequest, opts ...grpc.CallOption) (*SetTopicResponse, error) {
	out := new(SetTopicResponse)
	err := grpc.Invoke(ctx, "/go.micro.srv.slack.Channels/SetTopic", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Channels service

type ChannelsServer interface {
	History(context.Context, *HistoryRequest) (*HistoryResponse, error)
	Info(context.Context, *InfoRequest) (*InfoResponse, error)
	List(context.Context, *ListRequest) (*ListResponse, error)
	Mark(context.Context, *MarkRequest) (*MarkResponse, error)
	SetPurpose(context.Context, *SetPurposeRequest) (*SetPurposeResponse, error)
	SetTopic(context.Context, *SetTopicRequest) (*SetTopicResponse, error)
}

func RegisterChannelsServer(s *grpc.Server, srv ChannelsServer) {
	s.RegisterService(&_Channels_serviceDesc, srv)
}

func _Channels_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HistoryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).History(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/History",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).History(ctx, req.(*HistoryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Channels_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(InfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).Info(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/Info",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).Info(ctx, req.(*InfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Channels_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/List",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).List(ctx, req.(*ListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Channels_Mark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MarkRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).Mark(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/Mark",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).Mark(ctx, req.(*MarkRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Channels_SetPurpose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetPurposeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).SetPurpose(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/SetPurpose",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).SetPurpose(ctx, req.(*SetPurposeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Channels_SetTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetTopicRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ChannelsServer).SetTopic(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/go.micro.srv.slack.Channels/SetTopic",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ChannelsServer).SetTopic(ctx, req.(*SetTopicRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Channels_serviceDesc = grpc.ServiceDesc{
	ServiceName: "go.micro.srv.slack.Channels",
	HandlerType: (*ChannelsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "History",
			Handler:    _Channels_History_Handler,
		},
		{
			MethodName: "Info",
			Handler:    _Channels_Info_Handler,
		},
		{
			MethodName: "List",
			Handler:    _Channels_List_Handler,
		},
		{
			MethodName: "Mark",
			Handler:    _Channels_Mark_Handler,
		},
		{
			MethodName: "SetPurpose",
			Handler:    _Channels_SetPurpose_Handler,
		},
		{
			MethodName: "SetTopic",
			Handler:    _Channels_SetTopic_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/micro/slack-srv/proto/channels/channels.proto",
}

func init() {
	proto.RegisterFile("github.com/micro/slack-srv/proto/channels/channels.proto", fileDescriptor0)
}

var fileDescriptor0 = []byte{
	// 796 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x5d, 0x6f, 0xf2, 0x36,
	0x14, 0x6e, 0x08, 0x1f, 0xe1, 0xc0, 0xa0, 0xb3, 0xaa, 0xca, 0xa5, 0x9b, 0xca, 0xd2, 0x7d, 0xb0,
	0x8b, 0xc2, 0xd4, 0xae, 0x6a, 0x6f, 0xab, 0x4e, 0xea, 0xa6, 0x8d, 0x69, 0x4a, 0x2b, 0xed, 0x6a,
	0x42, 0x69, 0xe2, 0x81, 0x45, 0x12, 0x33, 0x3b, 0x41, 0xeb, 0x7f, 0xd8, 0xbf, 0xd8, 0xcd, 0xfb,
	0x2f, 0xdf, 0x57, 0xb6, 0xe3, 0x90, 0xaa, 0xa1, 0x88, 0x3b, 0xce, 0xf1, 0x73, 0x1e, 0x3f, 0x3e,
	0xe7, 0xc9, 0x11, 0x70, 0x3b, 0xa7, 0xe9, 0x22, 0x7b, 0x1e, 0x07, 0x2c, 0x9e, 0xc4, 0x34, 0xe0,
	0x6c, 0x22, 0x22, 0x3f, 0x58, 0x5e, 0x08, 0xbe, 0x9e, 0xac, 0x38, 0x4b, 0xd9, 0x24, 0x58, 0xf8,
	0x49, 0x42, 0x22, 0x51, 0xfc, 0x18, 0xab, 0x3c, 0x42, 0x73, 0x36, 0x56, 0x15, 0x63, 0xc1, 0xd7,
	0x63, 0x55, 0x35, 0xb8, 0xd8, 0xcd, 0xc6, 0xe2, 0x98, 0x25, 0x9a, 0xc2, 0xfd, 0xaf, 0x0e, 0xad,
	0x7b, 0xcd, 0x8a, 0x7a, 0x50, 0xa3, 0x21, 0xb6, 0x86, 0xd6, 0xa8, 0xed, 0xd5, 0x68, 0x88, 0x10,
	0xd4, 0x13, 0x3f, 0x26, 0xb8, 0xa6, 0x32, 0xea, 0x37, 0xc2, 0xd0, 0x0a, 0x38, 0xf1, 0x53, 0x12,
	0x62, 0x7b, 0x68, 0x8d, 0x6c, 0xcf, 0x84, 0xc5, 0x09, 0xe3, 0xb8, 0xae, 0x0a, 0x4c, 0x88, 0xce,
	0xa0, 0x43, 0xc5, 0xcc, 0xe7, 0xc1, 0x82, 0xae, 0x49, 0x88, 0x1b, 0x43, 0x6b, 0xe4, 0x78, 0x40,
	0xc5, 0x5d, 0x9e, 0x41, 0xa7, 0xd0, 0xa6, 0x62, 0x16, 0x93, 0xf8, 0x99, 0x70, 0xdc, 0x54, 0xc7,
	0x0e, 0x15, 0x53, 0x15, 0xa3, 0x2f, 0x01, 0xa8, 0x98, 0xcd, 0x49, 0x42, 0xb8, 0x1f, 0xe1, 0x96,
	0x3a, 0x6d, 0x53, 0xf1, 0xa0, 0x13, 0x92, 0x3c, 0xc9, 0xe2, 0xbc, 0x58, 0x60, 0x47, 0x89, 0x82,
	0x24, 0x8b, 0x75, 0xb9, 0x40, 0x13, 0x68, 0xa4, 0x6c, 0x45, 0x03, 0xdc, 0x1e, 0x5a, 0xa3, 0xce,
	0xe5, 0xc9, 0xf8, 0x6d, 0xd3, 0xc6, 0x4f, 0x12, 0xe0, 0x69, 0x1c, 0xba, 0x86, 0xd6, 0x2a, 0xe3,
	0x2b, 0x26, 0x08, 0x06, 0x55, 0x72, 0x5a, 0x55, 0xf2, 0x87, 0x86, 0x78, 0x06, 0x2b, 0xdf, 0x6f,
	0x44, 0x74, 0x86, 0xb6, 0x7c, 0x7f, 0x1e, 0x4a, 0x89, 0x91, 0x9f, 0x12, 0x91, 0xce, 0x38, 0xf1,
	0x43, 0xdc, 0x55, 0xdd, 0x01, 0x9d, 0xf2, 0x88, 0x1f, 0xa2, 0x2b, 0x68, 0xea, 0x08, 0x7f, 0xb6,
	0xfd, 0xc2, 0x29, 0x11, 0xc2, 0x9f, 0x13, 0x2f, 0x87, 0xa2, 0xaf, 0xa0, 0x9b, 0x25, 0x92, 0x70,
	0x16, 0xb0, 0x2c, 0x49, 0x71, 0x4f, 0xbd, 0xbc, 0xa3, 0x73, 0xf7, 0x32, 0x85, 0x7e, 0x80, 0xa3,
	0x32, 0x64, 0x16, 0x52, 0xb1, 0x8a, 0xfc, 0x17, 0xdc, 0x57, 0x50, 0x54, 0x82, 0xfe, 0xa4, 0x4f,
	0xdc, 0x5b, 0xe8, 0xfc, 0x46, 0xa5, 0xaa, 0x7f, 0x32, 0x79, 0xc7, 0xf7, 0x70, 0x48, 0xfe, 0x0d,
	0xa2, 0x2c, 0x24, 0x9b, 0xf1, 0x59, 0xaa, 0xb8, 0x9f, 0xe7, 0xcd, 0x0c, 0xdd, 0x18, 0xba, 0xba,
	0x52, 0xac, 0x58, 0x22, 0x88, 0x34, 0x13, 0x5b, 0x2a, 0xb0, 0xe3, 0xd5, 0xd8, 0x12, 0x1d, 0x41,
	0x83, 0x70, 0xce, 0x78, 0xee, 0x26, 0x1d, 0xa0, 0x1b, 0x70, 0x8c, 0xa7, 0xb1, 0x3d, 0xb4, 0xb7,
	0xbd, 0x3d, 0x77, 0xa8, 0x57, 0x80, 0xdd, 0x0f, 0x16, 0xf4, 0x7e, 0xa6, 0x22, 0x65, 0xfc, 0xc5,
	0x88, 0x95, 0x06, 0xd4, 0xc7, 0xb9, 0x87, 0x4d, 0x88, 0x8e, 0x8b, 0xfe, 0xca, 0xcb, 0xad, 0xa2,
	0x85, 0xc7, 0xd0, 0x64, 0x51, 0x28, 0xf3, 0xb6, 0xce, 0xeb, 0x08, 0x7d, 0x01, 0x6d, 0x9a, 0x04,
	0x51, 0x26, 0xe8, 0x9a, 0x28, 0x33, 0xdb, 0xde, 0x26, 0x21, 0x5f, 0xa2, 0x3b, 0xde, 0x50, 0x27,
	0x3a, 0x90, 0xb7, 0xeb, 0x7e, 0x0a, 0xe5, 0x60, 0xdb, 0x33, 0xa1, 0xfb, 0xbf, 0x05, 0xfd, 0x42,
	0xea, 0x5e, 0xdd, 0xd9, 0xe8, 0xb6, 0x55, 0xda, 0xe8, 0xbe, 0x01, 0x27, 0xd6, 0x6e, 0x10, 0xb8,
	0xbe, 0xbd, 0x6b, 0xc6, 0x31, 0x05, 0x18, 0x9d, 0x80, 0xb3, 0xf0, 0xc5, 0x2c, 0x66, 0x9c, 0xe4,
	0x9f, 0x61, 0x6b, 0xe1, 0x8b, 0x29, 0xe3, 0xc4, 0xfd, 0x0e, 0x3a, 0xbf, 0x24, 0x7f, 0xb3, 0x9d,
	0xcd, 0x74, 0x97, 0xd0, 0xd5, 0xc0, 0xbd, 0x9e, 0x72, 0xbd, 0xe1, 0xb3, 0xb7, 0x7b, 0xdc, 0xcc,
	0xb9, 0xb8, 0xec, 0x06, 0x3a, 0x53, 0x9f, 0x2f, 0x77, 0x8f, 0xb8, 0x07, 0xb5, 0x54, 0xe4, 0xe3,
	0xad, 0xa5, 0xc2, 0xfd, 0x11, 0xba, 0xba, 0x70, 0x1f, 0x95, 0xee, 0x03, 0x7c, 0xfe, 0x48, 0x52,
	0xf3, 0x69, 0xef, 0xbc, 0x14, 0x6f, 0x36, 0x85, 0xa6, 0x31, 0xa1, 0xfb, 0x04, 0xa8, 0x4c, 0xb4,
	0x57, 0xab, 0x4a, 0xac, 0xf6, 0x6b, 0xd6, 0x3b, 0xe8, 0x3f, 0x92, 0x54, 0x2f, 0xab, 0x9d, 0xe2,
	0x8e, 0xcc, 0xde, 0xcb, 0xc9, 0x55, 0xe0, 0xfe, 0x0e, 0x87, 0x1b, 0x8a, 0xbd, 0x64, 0x15, 0x7c,
	0x76, 0x89, 0xef, 0xf2, 0xa3, 0x0d, 0x4e, 0x3e, 0x35, 0x81, 0x9e, 0xa0, 0x95, 0x1b, 0x1d, 0xb9,
	0x55, 0xe3, 0x7d, 0xfd, 0xc1, 0x0e, 0xce, 0xdf, 0xc5, 0x68, 0x71, 0xee, 0x01, 0xfa, 0x15, 0xea,
	0xd2, 0x70, 0xe8, 0xac, 0x0a, 0x5e, 0xf2, 0xec, 0x60, 0xb8, 0x1d, 0x50, 0x26, 0x93, 0x6b, 0xaa,
	0x9a, 0xac, 0xb4, 0xfa, 0xaa, 0xc9, 0xca, 0x1b, 0x4e, 0x93, 0x49, 0x93, 0x55, 0x93, 0x95, 0x7c,
	0x5b, 0x4d, 0x56, 0xf6, 0xa7, 0x7b, 0x80, 0xfe, 0x02, 0xd8, 0x58, 0x06, 0x7d, 0x53, 0x55, 0xf1,
	0xc6, 0x9b, 0x83, 0x6f, 0x77, 0xc1, 0x0a, 0xfa, 0x3f, 0xc1, 0x31, 0x83, 0x47, 0xe7, 0x5b, 0xaa,
	0xca, 0xce, 0x1a, 0x7c, 0xfd, 0x3e, 0xc8, 0x10, 0x3f, 0x37, 0xd5, 0x1f, 0x89, 0xab, 0x4f, 0x01,
	0x00, 0x00, 0xff, 0xff, 0x5f, 0x11, 0x25, 0x92, 0xc7, 0x08, 0x00, 0x00,
}


text: Displays a list of 'completed' items within a sidebar container.


text:
//
// DO NOT MODIFY! THIS IS AUTOGENERATED FILE!
//
namespace Xilium.CefGlue.Interop
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime.InteropServices;
    using System.Security;

    [StructLayout(LayoutKind.Sequential, Pack = libcef.ALIGN)]
    [SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable")]
    internal unsafe struct cef_server_handler_t
    {
        internal cef_base_ref_counted_t _base;
        internal IntPtr _on_server_created;
        internal IntPtr _on_server_destroyed;
        internal IntPtr _on_client_connected;
        internal IntPtr _on_client_disconnected;
        internal IntPtr _on_http_request;
        internal IntPtr _on_web_socket_request;
        internal IntPtr _on_web_socket_connected;
        internal IntPtr _on_web_socket_message;

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void add_ref_delegate(cef_server_handler_t* self);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate int release_delegate(cef_server_handler_t* self);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate int has_one_ref_delegate(cef_server_handler_t* self);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate int has_at_least_one_ref_delegate(cef_server_handler_t* self);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_server_created_delegate(cef_server_handler_t* self, cef_server_t* server);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_server_destroyed_delegate(cef_server_handler_t* self, cef_server_t* server);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_client_connected_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_client_disconnected_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_http_request_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id, cef_string_t* client_address, cef_request_t* request);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_web_socket_request_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id, cef_string_t* client_address, cef_request_t* request, cef_callback_t* callback);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_web_socket_connected_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id);

        [UnmanagedFunctionPointer(libcef.CEF_CALLBACK)]
        #if !DEBUG
        [SuppressUnmanagedCodeSecurity]
        #endif
        internal delegate void on_web_socket_message_delegate(cef_server_handler_t* self, cef_server_t* server, int connection_id, void* data, UIntPtr data_size);

        private static int _sizeof;

        static cef_server_handler_t()
        {
            _sizeof = Marshal.SizeOf(typeof(cef_server_handler_t));
        }

        internal static cef_server_handler_t* Alloc()
        {
            var ptr = (cef_server_handler_t*)Marshal.AllocHGlobal(_sizeof);
            *ptr = new cef_server_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return ptr;
        }

        internal static void Free(cef_server_handler_t* ptr)
        {
            Marshal.FreeHGlobal((IntPtr)ptr);
        }

    }
}


text:
<?php
namespace Soluble\Normalist\Synthetic\Exception;

class LogicException extends \LogicException implements SyntheticExceptionInterface
{
};


text:
module Appsignal
  class Hooks
    class MongoRubyDriverHook < Appsignal::Hooks::Hook
      register :mongo_ruby_driver

      def dependencies_present?
        defined?(::Mongo::Monitoring::Global)
      end

      def install
        require 'appsignal/integrations/mongo_ruby_driver'

        Mongo::Monitoring::Global.subscribe(
          Mongo::Monitoring::COMMAND,
          Appsignal::Hooks::MongoMonitorSubscriber.new
        )
      end
    end

  end
end


text:
function [Tm,labelsfc_output,valid]=Gettheclustering(allGis,Gif,noGroups,dimtouse,n_size,noreplicates,tryonlinefirst,filenames,...
    saveyre,saveidxcs,maintaintleveloneconnections,tlevelone,picsorvideo,...
    frame,...%necessary for creating pics
    fframe,howmanyframes,... %necessary for videos
    minLength,trackLength,trajectories,allregionpaths,ucm2,allregionsframes,...
    selectedtreetrajectories,manifoldmethod,clusteringmethod,cim,printonscreen,...
    options,filename_sequence_basename_frames_or_video,videocorrectionparameters)
% allGis_or_D, Gif_or_T

%Dumb variables returned in case of non convergence
Tm=[];
labelsfc_output=[];
valid=false;

if ( (~exist('cim','var')) || (isempty(cim)) )
    picsorvideo=0;
end
if ( (~exist('manifoldmethod','var')) || (isempty(manifoldmethod)) )
    manifoldmethod='isoii'; %'iso','isoii','laplacian'
end
if ( (~exist('clusteringmethod','var')) || (isempty(clusteringmethod)) )
    clusteringmethod='km3'; %'km','km2','km3'
end
if ( (~exist('n_size','var')) || (isempty(n_size)) )
    n_size=0; %default is 7, 0 when neighbours have already been selected
end
if ( (~exist('picsorvideo','var')) || (isempty(picsorvideo)) )
    picsorvideo=0;
    %picsorvideo == 0 stands for no pics nor video
    %picsorvideo == 1 stands for pics
    %picsorvideo == 2 stands for interactive
    %picsorvideo == 3 stands for video
    %picsorvideo == 4 stands for pics for output (same as 1 but with active contours and sequence images)
end
if ( (~exist('maintaintleveloneconnections','var')) || (isempty(maintaintleveloneconnections)) )
    maintaintleveloneconnections=false;
end
if (  ((~exist('tlevelone','var')) || (isempty(tlevelone)))  &&  (maintaintleveloneconnections)  )
    fprintf('To maintain connections at level one a tlevelone must be passed\n');
    maintaintleveloneconnections=false;
end
if ( (~exist('frame','var')) || (isempty(frame)) )
    frame=1; %frame is only required for the cases (picsorvideo == [1,4])
end
if ( (~exist('noreplicates','var')) || (isempty(noreplicates)) )
    noreplicates=30;
end
if ( (~exist('tryonlinefirst','var')) || (isempty(tryonlinefirst)) )
    tryonlinefirst=true;
end
if ( (~exist('saveidxcs','var')) || (isempty(saveidxcs)) )
    saveidxcs=false;
end
if ( (~exist('saveyre','var')) || (isempty(saveyre)) )
    saveyre=false;
end
if ( (~exist('printonscreen','var')) || (isempty(printonscreen)) )
    printonscreen=false;
end
if ( (~exist('noGroups','var')) || (isempty(noGroups)) )
    noGroups=70; %70,160
end
if ( (~exist('dimtouse','var')) || (isempty(dimtouse)) )
    dimtouse=6;
end

if ( strcmp(manifoldmethod,'isoii') || strcmp(manifoldmethod,'laplacian') )
    usesparse=true;
else
    usesparse=false;
end

if ( (~exist('allGis','var')) || (isempty(allGis)) )
    fprintf('An argument must be passed for D\n');
    return;
end
if (isstruct(allGis)) %allGis_or_D
    D=1-allGis.P;
else
    D=allGis;
    picsorvideo=0;
end
if ( (~exist('Gif','var')) || (isempty(Gif)) )
    picsorvideo=0;
    if (isstruct(allGis)) %allGis_or_D
        T=allGis.T;
    else
        T=true(size(D));
        T(isinf(D))=false;
    end
else
    if (isstruct(Gif)) %Gif_or_T
        T=allGis.T;
    else
        T=Gif;
        picsorvideo=0;
    end
end
%From allGis: D=1-allGis.P; T=allGis.T;
%From allGis_or_D and Gif_or_T: D=allGis; T=Gif;
D(~T)=Inf; %IMPORTANT: Isomap only takes D and interrupted links are indicated with Inf value

%%%part related to visualization%%%
noFrames=numel(allregionsframes);
endf=(noFrames-trackLength+1);

if ( (~exist('selectedtreetrajectories','var')) || (isempty(selectedtreetrajectories)) )
    selectedtreetrajectories=true(1,numel(trajectories));
end
if ( (~exist('trackLength','var')) || (isempty(trackLength)) )
    trackLength=17;
end
if ( (~exist('minLength','var')) || (isempty(minLength)) )
    minLength=5;
end
if ( (~exist('howmanyframes','var')) || (isempty(howmanyframes)) )
%     howmanyframes=1:54;
    howmanyframes=1:endf;
end
if (numel(howmanyframes)==1) %This means that at least two frames must be requested if fframe is not empty
    if ( (exist('fframe','var')) && (~isempty(fframe)) )
        howmanyframes=fframe:fframe+howmanyframes-1;
    end
end
if (any(howmanyframes>endf))
    howmanyframes=howmanyframes(howmanyframes<=endf);
end

if (~(mod(trackLength,2))) %if trackLength is not a odd number
    trackLength=trackLength-1;
end
if (~(mod(minLength,2))) %if trackLength is not a odd number
    minLength=minLength-1;
end
sizeL=round( (trackLength-1)/2 );
minsizeL=round( (minLength-1)/2 );

saveworkfiles=false;
%%%%%%

if (numel(noGroups)>1)
    if (~saveidxcs)
        fprintf('Multiple group numbers requires to save idxs\n');
        return;
    end
end

zerosparsevalue=0.0000001;
if (usesparse)
    D(D==0)=zerosparsevalue;
    D(isinf(D))=0;
    D=sparse(D);
end

forcezerodiagonal=true;
D=Forcezerodiagonal(D,usesparse,forcezerodiagonal);

readyre=true;
[Y, R, E] = Mapontomanifold(D,manifoldmethod,dimtouse,n_size,saveyre,readyre,filenames);

readidxcs=true;
[IDX,kmeansdone,offext]=Clusterthepoints(Y,clusteringmethod,noGroups,dimtouse,noreplicates,...
    tryonlinefirst,readidxcs,saveidxcs,filenames); %,C

if ( (numel(noGroups)==1) && (~kmeansdone) )
    fprintf('No converged case to process\n');
    return;
end

%%% graphical presentation of Kmeans clustering, case of single noGroups
if ( (exist('IDX','var')) && (~isempty(IDX)) && (numel(noGroups)==1) && (printonscreen) )
    distributecolours=true;
    Visualiseclusteredpoints(Y,IDX,2,20,distributecolours);
    Visualiseclusteredpoints(Y,IDX,3,21,distributecolours);
end

%picsorvideo == 0 stands for no pics nor video
%picsorvideo == 1 stands for pics
%picsorvideo == 2 stands for interactive
%picsorvideo == 3 stands for video
%picsorvideo == 4 stands for pics for output

%%%Preparation for pics%%%
if ( (picsorvideo==1) || (picsorvideo==2) || (picsorvideo==4) ) %pics or interactive
    % computation of track, mapTracToTrajectories, dist_track_mask, all_the_lengths
    fc=frame+sizeL; %position of central frame in the sequence
%     fcin=sizeL+1;
        %position of the central frame in the longest vector (trackLength long)
    %for the computation of the lowest level spanning tree (reference for region selection)
    ntrackLength=minLength;
    nframe=fc-minsizeL; %analysed frames are [nframe:nframe+ntrackLength-1]
    image=cim{nframe}; %should only be necessary if printonscreen == true
    imagefc=cim{fc}; %should only be necessary if printonscreen == true

    %The following is to be used, then allDs are computed on request
    [track,mapTracToTrajectories,dist_track_mask]=... %,all_the_lengths
        Prepareregiontracksonrequest(trajectories,nframe,ntrackLength,allregionpaths,ucm2,allregionsframes,...
        filenames,selectedtreetrajectories,saveworkfiles,printonscreen,image);
    noTracks=size(track,3); %=size(dist_track_mask,2)
end
%%%%%%

if ( (exist('options','var')) && (~isempty(options)) && (isfield(options,'bmetric')) && (options.bmetric) )
    %Prepare a labelledvideo according to the trajectories
    gisselectedtrajectories=false(1,numel(trajectories));
    gisselectedtrajectories(allGis.mapTracToTrajectories)=true;
    [gislabelledvideo,ltrajectories,map]=Getlabelledvideofromtrajectories(ucm2,allregionpaths,allregionsframes,trajectories,gisselectedtrajectories,printonscreen);
    Printthevideoonscreen(gislabelledvideo, printonscreen, 1);

    %Prepare backmaps
    backmapscramble=Mapitback(map);
    backtractrajs=Mapitback(allGis.mapTracToTrajectories);

    %Prepare gtimages
    framestoconsider=1:noFrames;
    printonscreeninsidefunction=false;
    noFrames=numel(cim);
    %Read the ground truth video sequence or the frames
    allgtimages=Readpictureseries(filename_sequence_basename_frames_or_video.gtbasename,...
        filename_sequence_basename_frames_or_video.gtnumber_format,filename_sequence_basename_frames_or_video.gtclosure,...
        filename_sequence_basename_frames_or_video.gtstartNumber,noFrames,printonscreeninsidefunction);
    allgtimages=Adjustimagesize(allgtimages,videocorrectionparameters,printonscreeninsidefunction,true);
    if (printonscreeninsidefunction)
        close all;
    end
    gtimages=allgtimages(framestoconsider);

    %Prepare filenames
    %bdeffileframes is considered because of the clustering algorithm not considering edge frames
    deffilename=filename_sequence_basename_frames_or_video.bdeffileframes;
    bfileexe=['UCM',filesep,'Aggregation',filesep,'Quantitative',filesep,'Broxcode',filesep,'MoSegEval'];
    mergebtext='notmg';

    %Prepare btrajectories and blabelledvideo
    [btrajectories,noblabels]=Readbroxtrajectories(filename_sequence_basename_frames_or_video.btracksfile); %some labels may be empty
    videosize=[size(cim{1},1),size(cim{1},2),noFrames];
    blabelledvideo=Labelbvideo(btrajectories,videosize,printonscreen);

    %Merge labels in the background
    if ( (isfield(options,'bmergeb')) && (options.bmergeb) )
        [blabelledvideo,labelsmerged]=Mergeallbackground(gtimages,filename_sequence_basename_frames_or_video,...
            blabelledvideo,printonscreen,framestoconsider,fframe);
        Printthevideoonscreen(blabelledvideo, printonscreen, 1);
        btrajectories=Mergetrajectorylabels(btrajectories,labelsmerged);
        mergebtext='mg';
    end

    %Compute metrics on btrajectories
    bforegtmp=[filenames.idxpicsandvideobasedir,'btraj',mergebtext,'.dat'];
    Writebtrajectories(btrajectories,videosize,bforegtmp);
    if (isdir('UCM'))
        system( ['chmod u+x ',bfileexe] );
        system( [bfileexe,sprintf(' %s %s', deffilename, bforegtmp)] );
    end
    delete(bforegtmp);
end

for agroupnumber=noGroups

    if (numel(noGroups)~=1)
        readidxcs=true;
        [IDX,kmeansdone,offext]=Clusterthepoints([],[],agroupnumber,[],[],...
            [],readidxcs,[],filenames); %,C
        if (~kmeansdone)
            continue;
        end
    end

    if ( (picsorvideo==1) || (picsorvideo==4) ) %pics
        filenamepicorvideobasename=[filenames.idxpicsandvideobasedir,'Pics',filesep];
    elseif (picsorvideo==3) %video
        filenamepicorvideobasename=[filenames.idxpicsandvideobasedir,'Videos',filesep];
    end

    [labelsfc_output,Tm,valid]=Gettmandlabelsfcfromidx(IDX,Y,T,maintaintleveloneconnections,tlevelone);

    %The function allows to specify a framesforevaluation to only compute
    %results on some of the howmanyframes input (same format)
    if ( (exist('options','var')) && (~isempty(options)) && (isfield(options,'statistics')) && (options.statistics) )
        printonscreeninsidefunction=false; %deeper level of comments printed
        framesforevaluation=howmanyframes;
        Getquantitativestatistics(filename_sequence_basename_frames_or_video, videocorrectionparameters, noFrames, filenames, ...
            trajectories, allregionpaths, allregionsframes, ucm2, selectedtreetrajectories,...
            allGis, Gif, Tm, agroupnumber, cim, howmanyframes, sizeL, minLength, minsizeL, ...
            framesforevaluation, printonscreen, printonscreeninsidefunction);
    end

    if ( (exist('options','var')) && (~isempty(options)) && (isfield(options,'bmetric')) && (options.bmetric) )

        %Re-label video according to ISOMAP+Kmeans clustering
        gisthenewlabelledvideo=gislabelledvideo;
        for thelabel=unique(gislabelledvideo)'
            if (thelabel==0) %0 label is not scrambled, it represents no label
                continue;
            end
            truelabel=backmapscramble(thelabel); %truelabel=find(map==thelabel,1,'first');
            mappedlabel=backtractrajs(truelabel); %mappedlabel=find(allGis.mapTracToTrajectories==truelabel,1,'first');
            if (~isempty(mappedlabel))
                gisthenewlabelledvideo(gislabelledvideo==thelabel)=labelsfc_output(mappedlabel);
            else
                fprintf('Empty label detected\n');
            end
        end
        Printthevideoonscreen(gisthenewlabelledvideo, printonscreen, 1);

        %Further clustering based on Brox trajectories
        if ( (isfield(options,'bvote')) && (options.bvote) )
            numberofsegments=max(gisthenewlabelledvideo(:));
            gisthenewlabelledvideo=Votewithtrajectories(numberofsegments,noblabels,btrajectories,gisthenewlabelledvideo,printonscreen);
        end

        %Merge labels in the background
        if ( (isfield(options,'bmergeb')) && (options.bmergeb) )
            [gisthenewlabelledvideo]=Mergeallbackground(gtimages,filename_sequence_basename_frames_or_video,...
                gisthenewlabelledvideo,printonscreen,framestoconsider,fframe); %,labelsmerged
            Printthevideoonscreen(gisthenewlabelledvideo, printonscreen, 1);
        end

        %Compute metrics on re-labelled clustered video
        btrackstmp=[filenames.idxpicsandvideobasedir,'clustered',mergebtext,sprintf('%d',agroupnumber),'.dat'];
        Writeblabelledvideo(gisthenewlabelledvideo,btrackstmp);
        if (~isdir('UCM'))
            fprintf('Please set your directory to the main folder\n');
        else
            system( [bfileexe,sprintf(' %s %s', deffilename, btrackstmp)] );
        end
        delete(btrackstmp);

    end

    %Prepare the outputs to pics or video
    if ( (picsorvideo==1) || (picsorvideo==4) ) %pics
        %Represent computed clustering at frame
        labelsfc=Turntmtolabels(Tm); %labels according to the spanning tree allGis.T (as if fully connected)
        [labels,labelsv]=Getlabelsatframei(allGis,labelsfc,Gif,frame);
        Representcomputedlabelsatcentre(imagefc,track,labelsv);
%         Representcomputedlabels(image,track,dist_track_mask,labelsv);
        th=1; Representlabeledregionsatcentre(imagefc,dist_track_mask,labelsv,th,labelsfc); %TODO: threshold no regions
%         th=6; Representlabeledregions(image,track,dist_track_mask,labelsv,th,labelsfc);
        indexframe=find(Gif.frame==frame,1); allowchanget=1;
        Tmi=Turnlabelstotm(labels,Gif.Gis{indexframe}.T{1},allowchanget);
        Representspanningtreeatcentre(Tmi,track,dist_track_mask,imagefc);
%         Representspanningtree(Tmi,track,dist_track_mask,image);

        %Active contours
        if (picsorvideo==4)
            Getactivecontours(allGis,track,dist_track_mask,mapTracToTrajectories,labelsfc,labelsv,imagefc);
        end

        figure(13), title(['Frame ',num2str(fc)]); %nframe
        print('-depsc',[filenamepicorvideobasename,'l_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'_f_',num2str(frame),'.eps']);
%         print('-depsc',[filenamepicorvideobasename,'l_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.eps']);
        figure(16), title(['Frame ',num2str(fc)]); %nframe
        print('-depsc',[filenamepicorvideobasename,'t_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'_f_',num2str(frame),'.eps']);
%         print('-depsc',[filenamepicorvideobasename,'t_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.eps']);
        figure(17), title(['Frame ',num2str(fc)]); %nframe
        print('-depsc',[filenamepicorvideobasename,'r_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'_f_',num2str(frame),'.eps']);
%         print('-depsc',[filenamepicorvideobasename,'r_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.eps']);

        if (picsorvideo==4)
            figure(10), Init_figure_no(10);
            imshow(cim{fc});
            print('-depsc',[filenamepicorvideobasename,'orig_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'_f_',num2str(frame),'.eps']);
%             print('-depsc',[filenamepicorvideobasename,'orig_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.eps']);
        end

        fprintf('No groups = %d, computed and saved\n',agroupnumber);
    elseif (picsorvideo==3) %video

        count=0;
        clear lab; clear sp; clear lr;
        for frame=howmanyframes
            count=count+1;

            % computation of track, mapTracToTrajectories, dist_track_mask, all_the_lengths
            fc=frame+sizeL; %position of central frame in the sequence
        %     fcin=sizeL+1;
                %position of the central frame in the longest vector (trackLength long)
            %for the computation of the lowest level spanning tree (reference for region selection)
            ntrackLength=minLength;
            nframe=fc-minsizeL; %analysed frames are [nframe:nframe+ntrackLength-1]
            image=cim{nframe}; %should only be necessary if printonscreen == true
            imagefc=cim{fc}; %should only be necessary if printonscreen == true

            %The following is to be used, then allDs are computed on request
            [track,mapTracToTrajectories,dist_track_mask,all_the_lengths]=...
                Prepareregiontracksonrequest(trajectories,nframe,ntrackLength,allregionpaths,ucm2,allregionsframes,...
                filenames,selectedtreetrajectories,saveworkfiles,printonscreen,image);
            noTracks=size(track,3); %=size(dist_track_mask,2)

            %Represent computed clustering at frame
            labelsfc=Turntmtolabels(Tm); %labels according to the spanning tree allGis.T (as if fully connected)
            [labels,labelsv]=Getlabelsatframei(allGis,labelsfc,Gif,frame);
            Representcomputedlabelsatcentre(imagefc,track,labelsv);
%             Representcomputedlabels(image,track,dist_track_mask,labelsv);
            th=1; Representlabeledregionsatcentre(imagefc,dist_track_mask,labelsv,th,labelsfc); %TODO: threshold no regions
%             th=1; Representlabeledregions(image,track,dist_track_mask,labelsv,th,labelsfc);
            indexframe=find(Gif.frame==frame,1); allowchanget=1;
            Tmi=Turnlabelstotm(labels,Gif.Gis{indexframe}.T{1},allowchanget);
            Representspanningtreeatcentre(Tmi,track,dist_track_mask,imagefc);
%             Representspanningtree(Tmi,track,dist_track_mask,image);
            %This part is correct but the labels are not consistent and the Ts are fully connected
            % labelsfc=Turntmtolabels(Tm); %labels according to the spanning tree allGis.T (as if fully connected)
            % Tmfc=Turnlabelstotm(labelsfc,true(size(allGis.T))); %
            % Tmi=Gettatframei(allGis,Tmfc,Gif,frame);
            % % Tmi=Gettatframei(allGis,Tm,Gif,frame); %this line splits the labels
            % Representspanningtree(Tmi,track,dist_track_mask,image);
            % labels=Turntmtolabels(Tmi);
            % Representcomputedlabels(image,track,dist_track_mask,labels);
            % for i=1:max(labels)
            %     tlabels=labels;
            %     tlabels(labels~=i)=max(labels)+1;
            %     Representcomputedlabels(image,track,dist_track_mask,tlabels);
            %     pause;
            % end

            figure(13), title(['Frame ',num2str(fc)]);
%             figure(13), title(['Frame ',num2str(nframe)]);
            lab(count)=getframe;
            % print('-depsc',['C:\Epsimages\labels',num2str(nframe),'.eps']);
            figure(16), title(['Frame ',num2str(fc)]);
%             figure(16), title(['Frame ',num2str(nframe)]);
            sp(count)=getframe;
            % print('-depsc',['C:\Epsimages\sp',num2str(nframe),'.eps']);
            figure(17), title(['Frame ',num2str(fc)]);
%             figure(17), title(['Frame ',num2str(nframe)]);
            lr(count)=getframe;
            % print('-depsc',['C:\Epsimages\lregions',num2str(nframe),'.eps']);
        end
        movie2avi(sp,[filenamepicorvideobasename,'t_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.avi'],'compression','None','fps',7);
        movie2avi(lab,[filenamepicorvideobasename,'l_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.avi'],'compression','None','fps',7);
        movie2avi(lr,[filenamepicorvideobasename,'r_',num2str(agroupnumber),'_',num2str(dimtouse),offext,'.avi'],'compression','None','fps',7);
    end
end

%part for interactive representation of the image with tracks
if ( (picsorvideo==2) && (numel(noGroups)==1) ) %interactive

    labelsfc=Turntmtolabels(Tm); %labels according to the spanning tree allGis.T (as if fully connected)
    [labels,labelsv]=Getlabelsatframei(allGis,labelsfc,Gif,frame);
%     [labels,labelsv]=Getlabelsatframei(allGis,IDX,Gif,frame);

%Represent regions and the spanning tree
        th=1; Representlabeledregionsatcentre(imagefc,dist_track_mask,labelsv,th,labelsfc); %TODO: threshold no regions
%         th=6; Representlabeledregions(image,track,dist_track_mask,labelsv,th,labelsfc);
        indexframe=find(Gif.frame==frame,1); allowchanget=1;
        Tmi=Turnlabelstotm(labels,Gif.Gis{indexframe}.T{1},allowchanget);
        Representspanningtreeatcentre(Tmi,track,dist_track_mask,imagefc);

    %%% graphical representation on the image with tracks
    figure(13)
    set(gcf, 'color', 'black');
    imshow(image);
    hold on;
    for i=unique(labelsv) %so as to illustrate all labels
            %unique(IDX(Y.index))' this only illustrates the embedded ones
        col=GiveDifferentColours(i);
        whichBelonging=find(labelsv==i);
        %whichBelonging=find(labelsfc==i); %alternative calculation of whichBelonging
        for whichtrack=whichBelonging
%             trackpos=find(mapTracToTrajectories==whichBelonging(j));
%             if (isempty(trackpos))
%                 continue;
%             end
            line(track(:,1,whichtrack),track(:,2,whichtrack),'Color',col);
            plot(track(:,1,whichtrack),track(:,2,whichtrack),'+','Color',col);
        end
    end
    hold off;

    %%% interactive graphical presentation
    % noTracks=size(track,3);

    twod=Getchosend(Y,2);
%     twod = find(options.dims==2,1,'first');
    figure(12), set(gcf, 'color', 'white');
    plot(Y.coords{twod}(1,:), Y.coords{twod}(2,:), 'ro');
    hold on
    gplot(E(Y.index, Y.index), [Y.coords{twod}(1,:); Y.coords{twod}(2,:)]');
    hold off
    figure(17)
    % imshow(uint8(ones(480,640)*255));
    % set(gcf, 'color', 'white');
    set(gcf, 'color', 'black');
    imshow(image);
    hold on
    for i=1:noTracks
        line(track(:,1,i),track(:,2,i),'Color','k');
        plot(track(:,1,i),track(:,2,i),'+k');
    end
    hold off

    j=0;
    while (1)

        j=j+1;
        figure(12);
        fprintf('Please adjust the zoom and press return\n');
        pause;

        fprintf('Please select area %d (empty for return)\n',j)

        figure(12);
        p = ginput();
        if (isempty(p))
            break;
        end

        patch =  inpolygon(Y.coords{twod}(1,:), Y.coords{twod}(2,:), p(:,1), p(:,2));

        col=GiveDifferentColours(j);

        pointsIn = Y.coords{twod}(:,patch);
        figure(12);
        hold on;
    %     plot(pointsIn(1,:),pointsIn(2,:),['.',GiveAColour(j)]);
        plot(pointsIn(1,:),pointsIn(2,:), '.','Color',col,'LineWidth',3);
        hold off;

        figure(17);
        gofframe=find(Gif.frame==frame);
        thelevel=1;
        whichBelonging=Y.index(patch);
        disp(whichBelonging);
        for i=1:numel(whichBelonging)
            whichOne=whichBelonging(i);

            whichonecorr=Translatefromfirsttosecond(allGis.mapTracToTrajectories,whichOne,Gif.Gis{gofframe}.mapTracToTrajectories{thelevel});

            if (whichonecorr>0)
                hold on;
                line(track(:,1,whichonecorr),track(:,2,whichonecorr),'Color',col);
                plot(track(:,1,whichonecorr),track(:,2,whichonecorr),'+','Color',col);
                hold off;
            end
        end
    end
    fprintf('\n');
end

function Produceoriginalvideo(filenames,cim,noFrames,noGroups,dimtouse,trackLength,offext,sizeL,howmanyframes,endf)

if ( (~exist('noFrames','var')) || (isempty(noFrames)) )
    noFrames=100;
end
if ( (~exist('trackLength','var')) || (isempty(trackLength)) )
    trackLength=17;
end
if (~(mod(trackLength,2))) %if trackLength is not a odd number
    trackLength=trackLength-1;
end
if ( (~exist('endf','var')) || (isempty(endf)) )
    endf=(noFrames-trackLength+1);
end
if ( (~exist('offext','var')) || (isempty(offext)) )
    offext='';
end
if ( (~exist('howmanyframes','var')) || (isempty(howmanyframes)) )
    howmanyframes=1:endf;
end
if (any(howmanyframes>endf))
    howmanyframes=howmanyframes(howmanyframes<=endf);
end
if ( (~exist('sizeL','var')) || (isempty(sizeL)) )
    sizeL=round( (trackLength-1)/2 );
end
if ( (~exist('noGroups','var')) || (isempty(noGroups)) )
    noGroups=10;
end
if ( (~exist('dimtouse','var')) || (isempty(dimtouse)) )
    dimtouse=6;
end
if ( (~exist('cim','var')) || (~iscell(cim)) )
    if (exist(filenames.filename_colour_images,'file'))
        load(filenames.filename_colour_images);
        fprintf('Loaded colour images\n');
    else
        fprintf('cim needs to be loaded\n');
    end
end

filenamepicorvideobasename=[filenames.idxpicsandvideobasedir,'Videos',filesep];

count=0;
for frame=howmanyframes
    count=count+1;

    fc=frame+sizeL; %position of central frame in the sequence

    Init_figure_no(10);
    title(['Frame ',num2str(fc)]);
    imshow(cim{fc})
    orig(count)=getframe;
end
movie2avi(orig,[filenamepicorvideobasename,'orig_',num2str(noGroups),'_',num2str(dimtouse),offext,'.avi'],'compression','None','fps',7);

function Printimageandgroundtruth()

fc=69;

filenamepicorvideobasename=[filenames.filename_directory,'Videopicsidx_mns_ten',filesep,'Pics',filesep];

Init_figure_no(10);
imshow(cim{fc});
print('-depsc',[filenamepicorvideobasename,'orig_f_',num2str(fc),'.eps']);

Init_figure_no(13);
imshow(gtimages{fc});
print('-depsc',[filenamepicorvideobasename,'gt_f_',num2str(fc),'.eps']);


text:
package net.sandstorm.castlauncher;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

/**
 * Created by Brian Wing on 3/25/2016.
 * Sandstorm Technologies
 * brian@sandstorm.net
 */
public class MobilePagerAdapter extends PagerAdapter{

    private HomeActivity activity;
    private int pageCount;

    public MobilePagerAdapter(HomeActivity a){
        //super(a.getFragmentManager());
        this.activity = a;
        this.pageCount = 0;
    }

    @Override
    public Object instantiateItem(ViewGroup group, int position) {
        LinearLayout appPage = (LinearLayout) this.activity.getLayoutInflater().inflate(R.layout.mobile_app_page, null);
        group.addView(appPage); //The "group" is the ViewPager.
        this.pageCount++;
        return appPage;
    }

    @Override
    public void destroyItem(ViewGroup group, int position, Object view) {
        group.removeView((LinearLayout) view); //The "group" is the ViewPager.
        this.pageCount--;
    }

    @Override
    public int getCount() {
        return this.pageCount;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }

}


text:
require File.dirname(__FILE__) + '/authorize_net'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class RedfinGateway < AuthorizeNetGateway
      self.live_url = self.test_url = 'https://payment.redfinnet.com/aim/transact.aspx'

      self.homepage_url = 'http://www.redfinnet.com/'
      self.display_name = 'RedfinNetwork'

      # Limit support to purchase() for the time being
      # JRuby chokes here
      # undef_method :authorize, :capture, :void, :credit

      # undef_method :authorize
      # undef_method :capture
      # undef_method :void
      # undef_method :credit

      def test?
        Base.gateway_mode == :test
      end

      private

      def success?(response)
        response[:response_code] == APPROVED
      end

      def fraud_review?(response)
        response[:response_code] == FRAUD_REVIEW
      end

      def split(response)
        # puts("Response Text: #{response}")
        response[1,(response.length-2)].split("$,$")
        # response.split('$,$')
      end

      def parse(body)
        fields = split(body)

        results = {
          :response_code => fields[RESPONSE_CODE].to_i,
          :response_reason_code => fields[RESPONSE_REASON_CODE],
          :response_reason_text => fields[RESPONSE_REASON_TEXT],
          :avs_result_code => fields[AVS_RESULT_CODE],
          :transaction_id => fields[TRANSACTION_ID],
          :card_code => fields[CARD_CODE_RESPONSE_CODE],
          :full_body => body
        }
        results
      end
    end
  end
end


text:
require "helper"

describe Google::Cloud::Bigquery::Table, :copy, :mock_bigquery do
  let(:source_dataset) { "source_dataset" }
  let(:source_table_id) { "source_table_id" }
  let(:source_table_name) { "Source Table" }
  let(:source_description) { "This is the source table" }
  let(:source_table_gapi) { random_table_gapi source_dataset,
                                              source_table_id,
                                              source_table_name,
                                              source_description }
  let(:source_table) { Google::Cloud::Bigquery::Table.from_gapi source_table_gapi,
                                                         bigquery.service }
  let(:target_dataset) { "target_dataset" }
  let(:target_table_id) { "target_table_id" }
  let(:target_table_name) { "Target Table" }
  let(:target_description) { "This is the target table" }
  let(:target_table_gapi) { random_table_gapi target_dataset,
                                              target_table_id,
                                              target_table_name,
                                              target_description }
  let(:target_table) { Google::Cloud::Bigquery::Table.from_gapi target_table_gapi,
                                                         bigquery.service }
  let(:target_table_other_proj_gapi) { random_table_gapi target_dataset,
                                              target_table_id,
                                              target_table_name,
                                              target_description,
                                              "target-project" }
  let(:target_table_other_proj) { Google::Cloud::Bigquery::Table.from_gapi target_table_other_proj_gapi,
                                                         bigquery.service }

  it "can snapshot itself" do
    mock = Minitest::Mock.new
    bigquery.service.mocked_service = mock
    job_gapi = copy_job_gapi(source_table, target_table)
    job_resp_gapi = job_gapi.dup
    job_resp_gapi.status = status "done"
    mock.expect :insert_job, job_resp_gapi, [project, job_gapi]

    result = source_table.snapshot target_table
    mock.verify

    _(result).must_equal true
  end

  it "can snapshot to a table identified by a string" do
    mock = Minitest::Mock.new
    bigquery.service.mocked_service = mock

    job_gapi = copy_job_gapi(source_table, target_table_other_proj)
    job_resp_gapi = job_gapi.dup
    job_resp_gapi.status = status "done"
    mock.expect :insert_job, job_resp_gapi, ["test-project", job_gapi]

    result = source_table.snapshot "target-project:target_dataset.target_table_id"
    mock.verify

    _(result).must_equal true
  end

  it "can snapshot to a table name string only" do
    mock = Minitest::Mock.new
    bigquery.service.mocked_service = mock
    new_target_table = Google::Cloud::Bigquery::Table.from_gapi(
      random_table_gapi(source_dataset,
                        "new_target_table_id",
                        target_table_name,
                        target_description),
      bigquery.service
    )

    job_gapi = copy_job_gapi(source_table, new_target_table)
    job_resp_gapi = job_gapi.dup
    job_resp_gapi.status = status "done"
    mock.expect :insert_job, job_resp_gapi, [project, job_gapi]

    result = source_table.snapshot "new_target_table_id"
    mock.verify

    _(result).must_equal true
  end

  def copy_job_gapi source, target, job_id: "job_9876543210", location: "US"
    Google::Apis::BigqueryV2::Job.from_json copy_job_json(source, target, job_id, location: location)
  end

  def copy_job_json source, target, job_id, location: "US"
    {
      "jobReference" => {
        "projectId" => project,
        "jobId" => job_id,
        "location" => location
      },
      "configuration" => {
        "copy" => {
          "sourceTable" => {
            "projectId" => source.project_id,
            "datasetId" => source.dataset_id,
            "tableId" => source.table_id
          },
          "destinationTable" => {
            "projectId" => target.project_id,
            "datasetId" => target.dataset_id,
            "tableId" => target.table_id
          },
          "createDisposition" => nil,
          "writeDisposition" => nil,
          "operationType" => "SNAPSHOT"
        },
        "dryRun" => nil
      }
    }.to_json
  end
end


text:
require 'flattr/error/client_error'

module Flattr
  # Raised when Flattr returns the HTTP status code 406
  class Error::NotAcceptable <Flattr::Error::ClientError
  end
end


text:
@interface MBEMetalView ()
@property (strong) id<CAMetalDrawable> currentDrawable;
@property (assign) NSTimeInterval frameDuration;
@property (strong) id<MTLTexture> depthTexture;
@property (strong) CADisplayLink *displayLink;
@end

@implementation MBEMetalView

+ (Class)layerClass
{
    return [CAMetalLayer class];
}

- (CAMetalLayer *)metalLayer
{
    return (CAMetalLayer *)self.layer;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if ((self = [super initWithCoder:aDecoder]))
    {
        [self commonInit];
        self.metalLayer.device = MTLCreateSystemDefaultDevice();
    }

    return self;
}

- (instancetype)initWithFrame:(CGRect)frame device:(id<MTLDevice>)device
{
    if ((self = [super initWithFrame:frame]))
    {
        [self commonInit];
        self.metalLayer.device = device;
    }

    return self;
}

- (void)commonInit
{
    _preferredFramesPerSecond = 60;
    _clearColor = MTLClearColorMake(1, 1, 1, 1);

    self.metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm;
}

- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];

    // During the first layout pass, we will not be in a view hierarchy, so we guess our scale
    CGFloat scale = [UIScreen mainScreen].scale;

    // If we've moved to a window by the time our frame is being set, we can take its scale as our own
    if (self.window)
    {
        scale = self.window.screen.scale;
    }

    CGSize drawableSize = self.bounds.size;

    // Since drawable size is in pixels, we need to multiply by the scale to move from points to pixels
    drawableSize.width *= scale;
    drawableSize.height *= scale;

    self.metalLayer.drawableSize = drawableSize;

    [self makeDepthTexture];
}

- (void)setColorPixelFormat:(MTLPixelFormat)colorPixelFormat
{
    self.metalLayer.pixelFormat = colorPixelFormat;
}

- (MTLPixelFormat)colorPixelFormat
{
    return self.metalLayer.pixelFormat;
}

- (void)didMoveToWindow
{
    const NSTimeInterval idealFrameDuration = (1.0 / 60);
    const NSTimeInterval targetFrameDuration = (1.0 / self.preferredFramesPerSecond);
    const NSInteger frameInterval = round(targetFrameDuration / idealFrameDuration);

    if (self.window)
    {
        [self.displayLink invalidate];
        self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkDidFire:)];
        self.displayLink.frameInterval = frameInterval;
        [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
    }
    else
    {
        [self.displayLink invalidate];
        self.displayLink = nil;
    }
}

- (void)displayLinkDidFire:(CADisplayLink *)displayLink
{
    self.currentDrawable = [self.metalLayer nextDrawable];
    self.frameDuration = displayLink.duration;

    if ([self.delegate respondsToSelector:@selector(drawInView:)])
    {
        [self.delegate drawInView:self];
    }
}

- (void)makeDepthTexture
{
    CGSize drawableSize = self.metalLayer.drawableSize;

    if ([self.depthTexture width] != drawableSize.width ||
        [self.depthTexture height] != drawableSize.height)
    {
        MTLTextureDescriptor *desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatDepth32Float
                                                                                width:drawableSize.width
                                                                                height:drawableSize.height
                                                                                mipmapped:NO];
        desc.usage = MTLTextureUsageRenderTarget;

        self.depthTexture = [self.metalLayer.device newTextureWithDescriptor:desc];
    }
}

- (MTLRenderPassDescriptor *)currentRenderPassDescriptor
{
    MTLRenderPassDescriptor *passDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];

    passDescriptor.colorAttachments[0].texture = [self.currentDrawable texture];
    passDescriptor.colorAttachments[0].clearColor = self.clearColor;
    passDescriptor.colorAttachments[0].storeAction = MTLStoreActionStore;
    passDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear;

    passDescriptor.depthAttachment.texture = self.depthTexture;
    passDescriptor.depthAttachment.clearDepth = 1.0;
    passDescriptor.depthAttachment.loadAction = MTLLoadActionClear;
    passDescriptor.depthAttachment.storeAction = MTLStoreActionDontCare;

    return passDescriptor;
}

@end


text:
import math
import base64
import time
import hashlib
import hmac
import struct
import os

def generate_otp(label, user, key):
    """Generates a otpauth:// URI"""
    return "otpauth://totp/%s:%s?secret=%s&issuer=%s" % (label,user,key,label)

class keygen:
    """Generates a secure key that __str__ to b32 and __bytes__ to bytes"""
    myKey = b""
    def __init__(self, l=20):
        myKey = os.urandom(l)

    def __str__(self):
        return base64.b32decode(self.myKey)

    def __bytes__(self):
        return self.myKey

def hmac_sha1(key, message):
    hms1 = hmac.new(key, message, hashlib.sha1)
    return hms1.digest()

#Implimented based on the code at
#https://en.wikipedia.org/wiki/Google_Authenticator#Technical_description
class GAuth:
    secret = ""
    def __init__(self, secret):
        self.secret = base64.b32decode(secret)

    def TOTP(self, myTime=None):
        if myTime == None:
            myTime = int(time.time())

        message = math.floor(myTime / 30)
        hash = hmac_sha1(self.secret, struct.pack(">I", message))
        offset = hash[19] & 0x0F #0x0F = 00001111

        #4 bytes starting at the offset
        truncatedHash = struct.unpack(">I", hash[offset:offset+4])[0]

        #remove the most significant bit
        #0x7FFFFFFF = 01111111111111111111111111111111
        truncatedHash = truncatedHash & 0x7FFFFFFF
        code = truncatedHash % 1000000
        return ("000000"+str(code))[-6:]

    def HOTP(self, ioff=0):
        message = struct.unpack(">Q", ioff)[0]
        hash = hmac_sha1(self.secret, message)
        offset = hash[19] & 0x0F #0x0F = 00001111

        #4 bytes starting at the offset
        truncatedHash = struct.unpack(">I", hash[offset:offset+4])[0]

        #remove the most significant bit
        #0x7FFFFFFF = 01111111111111111111111111111111
        truncatedHash = truncatedHash & 0x7FFFFFFF
        return ("000000"+str(code))[-6:]

if name == '__main__': #Test bed
    gauth = GAuth()
    print(gauth.TOTP("ACDEFGHI"))


text:
var reClassSelector = /\.[a-z0-9_\-]+/ig
  , toArray = require("mout/lang/toArray")
  , unique = require("mout/array/unique")
  , matches = require("dom-utils/src/matches")

/**
 * Get an array of class selectors from a CSSRuleList object
 */
function getClassesFromRuleList(rulelist) {
  return rulelist.reduce(function(classes, rule) {
    var matches
    if (rule.styleSheet) { // from @import rules
      return classes.concat(getClassesFromStyleSheets([rule.styleSheet]))
    }
    else if (rule.cssRules) { // from @media rules (or other conditionals)
      return classes.concat(getClassesFromRuleList(toArray(rule.cssRules)))
    }
    else if (rule.selectorText) {
      matches = rule.selectorText.match(reClassSelector) || []
      return classes.concat(matches.map(function(cls) { return cls.slice(1) } ))
    }
    return classes
  }, [])
}

/**
 * Get an array of class selectors from a CSSSytleSheetList object
 */
function getClassesFromStyleSheets(styleSheets) {
  return styleSheets.reduce(function(classes, sheet) {
    return classes.concat(getClassesFromRuleList(toArray(sheet.cssRules)))
  }, [])
}

function getStyleSheets() {
  return toArray(document.styleSheets).filter(function(sheet) {
    return matches(sheet.ownerNode, css.styleSheets)
  })
}

var css = {
  getClassSelectors: function() {
    return unique(getClassesFromStyleSheets(getStyleSheets()))
  },
  // getSelectors: function() {
  //   return []
  // },
  styleSheets: 'link[rel="stylesheet"], style'
}

module.exports = {
  name: "css",
  module: css
}


text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package test.fixtures.adapter;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import com.facebook.thrift.*;
import com.facebook.thrift.annotations.*;
import com.facebook.thrift.async.*;
import com.facebook.thrift.meta_data.*;
import com.facebook.thrift.server.*;
import com.facebook.thrift.transport.*;
import com.facebook.thrift.protocol.*;

@SuppressWarnings({ "unused", "serial" })
public class TerseAdaptedFields implements TBase, java.io.Serializable, Cloneable {
  private static final TStruct STRUCT_DESC = new TStruct("TerseAdaptedFields");
  private static final TField INT_FIELD_FIELD_DESC = new TField("int_field", TType.I32, (short)1);
  private static final TField STRING_FIELD_FIELD_DESC = new TField("string_field", TType.STRING, (short)2);
  private static final TField SET_FIELD_FIELD_DESC = new TField("set_field", TType.SET, (short)3);

  public final Integer int_field;
  public final String string_field;
  public final Set<Integer> set_field;
  public static final int INT_FIELD = 1;
  public static final int STRING_FIELD = 2;
  public static final int SET_FIELD = 3;

  public TerseAdaptedFields(
      Integer int_field,
      String string_field,
      Set<Integer> set_field) {
    this.int_field = int_field;
    this.string_field = string_field;
    this.set_field = set_field;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TerseAdaptedFields(TerseAdaptedFields other) {
    if (other.isSetInt_field()) {
      this.int_field = TBaseHelper.deepCopy(other.int_field);
    } else {
      this.int_field = null;
    }
    if (other.isSetString_field()) {
      this.string_field = TBaseHelper.deepCopy(other.string_field);
    } else {
      this.string_field = null;
    }
    if (other.isSetSet_field()) {
      this.set_field = TBaseHelper.deepCopy(other.set_field);
    } else {
      this.set_field = null;
    }
  }

  public TerseAdaptedFields deepCopy() {
    return new TerseAdaptedFields(this);
  }

  public Integer getInt_field() {
    return this.int_field;
  }

  // Returns true if field int_field is set (has been assigned a value) and false otherwise
  public boolean isSetInt_field() {
    return this.int_field != null;
  }

  public String getString_field() {
    return this.string_field;
  }

  // Returns true if field string_field is set (has been assigned a value) and false otherwise
  public boolean isSetString_field() {
    return this.string_field != null;
  }

  public Set<Integer> getSet_field() {
    return this.set_field;
  }

  // Returns true if field set_field is set (has been assigned a value) and false otherwise
  public boolean isSetSet_field() {
    return this.set_field != null;
  }

  @Override
  public boolean equals(Object _that) {
    if (_that == null)
      return false;
    if (this == _that)
      return true;
    if (!(_that instanceof TerseAdaptedFields))
      return false;
    TerseAdaptedFields that = (TerseAdaptedFields)_that;

    if (!TBaseHelper.equalsNobinary(this.isSetInt_field(), that.isSetInt_field(), this.int_field, that.int_field)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.isSetString_field(), that.isSetString_field(), this.string_field, that.string_field)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.isSetSet_field(), that.isSetSet_field(), this.set_field, that.set_field)) { return false; }

    return true;
  }

  @Override
  public int hashCode() {
    return Arrays.deepHashCode(new Object[] {int_field, string_field, set_field});
  }

  // This is required to satisfy the TBase interface, but can't be implemented on immutable struture.
  public void read(TProtocol iprot) throws TException {
    throw new TException("unimplemented in android immutable structure");
  }

  public static TerseAdaptedFields deserialize(TProtocol iprot) throws TException {
    Integer tmp_int_field = null;
    String tmp_string_field = null;
    Set<Integer> tmp_set_field = null;
    TField __field;
    iprot.readStructBegin();
    while (true)
    {
      __field = iprot.readFieldBegin();
      if (__field.type == TType.STOP) {
        break;
      }
      switch (__field.id)
      {
        case INT_FIELD:
          if (__field.type == TType.I32) {
            tmp_int_field = iprot.readI32();
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case STRING_FIELD:
          if (__field.type == TType.STRING) {
            tmp_string_field = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case SET_FIELD:
          if (__field.type == TType.SET) {
            {
              TSet _set50 = iprot.readSetBegin();
              tmp_set_field = new HashSet<Integer>(Math.max(0, 2*_set50.size));
              for (int _i51 = 0;
                   (_set50.size < 0) ? iprot.peekSet() : (_i51 < _set50.size);
                   ++_i51)
              {
                Integer _elem52;
                _elem52 = iprot.readI32();
                tmp_set_field.add(_elem52);
              }
              iprot.readSetEnd();
            }
          } else {
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, __field.type);
          break;
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    TerseAdaptedFields _that;
    _that = new TerseAdaptedFields(
      tmp_int_field
      ,tmp_string_field
      ,tmp_set_field
    );
    _that.validate();
    return _that;
  }

  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.int_field != null) {
      oprot.writeFieldBegin(INT_FIELD_FIELD_DESC);
      oprot.writeI32(this.int_field);
      oprot.writeFieldEnd();
    }
    if (this.string_field != null) {
      oprot.writeFieldBegin(STRING_FIELD_FIELD_DESC);
      oprot.writeString(this.string_field);
      oprot.writeFieldEnd();
    }
    if (this.set_field != null) {
      oprot.writeFieldBegin(SET_FIELD_FIELD_DESC);
      {
        oprot.writeSetBegin(new TSet(TType.I32, this.set_field.size()));
        for (Integer _iter53 : this.set_field)        {
          oprot.writeI32(_iter53);
        }
        oprot.writeSetEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    return toString(1, true);
  }

  @Override
  public String toString(int indent, boolean prettyPrint) {
    return TBaseHelper.toStringHelper(this, indent, prettyPrint);
  }

  public void validate() throws TException {
    // check for required fields
  }

}


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

namespace System.DirectoryServices.AccountManagement
{
    internal static class UrnScheme
    {
        public const string GuidScheme = IdentityTypeStringMap.Guid;
        public const string SidScheme = IdentityTypeStringMap.Sid;
        public const string DistinguishedNameScheme = IdentityTypeStringMap.DistinguishedName;
        public const string SamAccountScheme = IdentityTypeStringMap.SamAccount;
        public const string UpnScheme = IdentityTypeStringMap.Upn;
        public const string NameScheme = IdentityTypeStringMap.Name;
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/vmmigration/v1/vmmigration.proto

package com.google.cloud.vmmigration.v1;

public interface MigrationErrorOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.vmmigration.v1.MigrationError)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Output only. The error code.
   *

   *
   *
   * .google.cloud.vmmigration.v1.MigrationError.ErrorCode code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The enum numeric value on the wire for code.
   */
  int getCodeValue();
  /**
   *
   *
   *

   * Output only. The error code.
   *

   *
   *
   * .google.cloud.vmmigration.v1.MigrationError.ErrorCode code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The code.
   */
  com.google.cloud.vmmigration.v1.MigrationError.ErrorCode getCode();

  /**
   *
   *
   *

   * Output only. The localized error message.
   *

   *
   *
   * .google.rpc.LocalizedMessage error_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the errorMessage field is set.
   */
  boolean hasErrorMessage();
  /**
   *
   *
   *

   * Output only. The localized error message.
   *

   *
   *
   * .google.rpc.LocalizedMessage error_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The errorMessage.
   */
  com.google.rpc.LocalizedMessage getErrorMessage();
  /**
   *
   *
   *

   * Output only. The localized error message.
   *

   *
   *
   * .google.rpc.LocalizedMessage error_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.rpc.LocalizedMessageOrBuilder getErrorMessageOrBuilder();

  /**
   *
   *
   *

   * Output only. Suggested action for solving the error.
   *

   *
   *
   * .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the actionItem field is set.
   */
  boolean hasActionItem();
  /**
   *
   *
   *

   * Output only. Suggested action for solving the error.
   *

   *
   *
   * .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The actionItem.
   */
  com.google.rpc.LocalizedMessage getActionItem();
  /**
   *
   *
   *

   * Output only. Suggested action for solving the error.
   *

   *
   *
   * .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.rpc.LocalizedMessageOrBuilder getActionItemOrBuilder();

  /**
   *
   *
   *

   * Output only. URL(s) pointing to additional information on handling the
   * current error.
   *

   *
   *
   * repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  java.util.List<com.google.rpc.Help.Link> getHelpLinksList();
  /**
   *
   *
   *

   * Output only. URL(s) pointing to additional information on handling the
   * current error.
   *

   *
   *
   * repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.rpc.Help.Link getHelpLinks(int index);
  /**
   *
   *
   *

   * Output only. URL(s) pointing to additional information on handling the
   * current error.
   *

   *
   *
   * repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  int getHelpLinksCount();
  /**
   *
   *
   *

   * Output only. URL(s) pointing to additional information on handling the
   * current error.
   *

   *
   *
   * repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  java.util.List<? extends com.google.rpc.Help.LinkOrBuilder> getHelpLinksOrBuilderList();
  /**
   *
   *
   *

   * Output only. URL(s) pointing to additional information on handling the
   * current error.
   *

   *
   *
   * repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.rpc.Help.LinkOrBuilder getHelpLinksOrBuilder(int index);

  /**
   *
   *
   *

   * Output only. The time the error occurred.
   *

   *
   * .google.protobuf.Timestamp error_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the errorTime field is set.
   */
  boolean hasErrorTime();
  /**
   *
   *
   *

   * Output only. The time the error occurred.
   *

   *
   * .google.protobuf.Timestamp error_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The errorTime.
   */
  com.google.protobuf.Timestamp getErrorTime();
  /**
   *
   *
   *

   * Output only. The time the error occurred.
   *

   *
   * .google.protobuf.Timestamp error_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getErrorTimeOrBuilder();
}


text:
package de.afinke.orderingsystem.domain;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import javax.persistence.*;

@Entity
@Table(name = "person")
public class Person {
    private Long id;
    private String name;

    public Person() {
    }

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

    @Id
    @GeneratedValue
    @Column(name = "id")
    public Long getId() {
        return id;
    }

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

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Person)) return false;

        Person person = (Person) o;

        EqualsBuilder equalsBuilder = new EqualsBuilder();
        equalsBuilder.append(id, person.id);
        equalsBuilder.append(name, person.getName());
        return equalsBuilder.isEquals();
    }

    @Override
    public int hashCode() {
        HashCodeBuilder hashCodeBuilder = new HashCodeBuilder();
        hashCodeBuilder.append(id);
        hashCodeBuilder.append(name);
        return hashCodeBuilder.toHashCode();
    }
}


text:
package
  MyApp::Controller::ForBrowsers;
our $VERSION = '0.11';

use base 'CatalystX::Controller::ExtJS::REST';

1;


text:
import PouchDB from './constructor';
import { guardedConsole, hasLocalStorage } from 'pouchdb-utils';

function parseAdapter(name, opts) {
  var match = name.match(/([a-z\-]*):\/\/(.*)/);
  if (match) {
    // the http adapter expects the fully qualified name
    name = /http(s?)/.test(match[1]) ? match[1] + '://' + match[2] : match[2];
    return {name: name, adapter: match[1]};
  }

  // check for browsers that have been upgraded from websql-only to websql+idb
  var skipIdb = 'idb' in PouchDB.adapters && 'websql' in PouchDB.adapters &&
    hasLocalStorage() &&
    localStorage['_pouch__websqldb_' + PouchDB.prefix + name];

  var adapterName;

  if (opts.adapter) {
    adapterName = opts.adapter;
  } else if (typeof opts !== 'undefined' && opts.db) {
    adapterName = 'leveldb';
  } else { // automatically determine adapter
    for (var i = 0; i < PouchDB.preferredAdapters.length; ++i) {
      adapterName = PouchDB.preferredAdapters[i];
      /* istanbul ignore if */
      if (skipIdb && adapterName === 'idb') {
        // log it, because this can be confusing during development
        guardedConsole('log', 'PouchDB is downgrading "' + name + '" to WebSQL to' +
          ' avoid data loss, because it was already opened with WebSQL.');
        continue; // keep using websql to avoid user data loss
      }
      break;
    }
  }

  var adapter = PouchDB.adapters[adapterName];

  // if adapter is invalid, then an error will be thrown later
  var usePrefix = (adapter && 'use_prefix' in adapter) ?
    adapter.use_prefix : true;

  return {
    name: usePrefix ? (PouchDB.prefix + name) : name,
    adapter: adapterName
  };
}

export default parseAdapter;