package gitkit

import (
	"bytes"
	"crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net"
	"os"
	"os/exec"
	"path/filepath"
	"strings"

	"golang.org/x/crypto/ssh"
)

var (
	ErrAlreadyStarted = errors.New("server has already been started")
	ErrNoListener     = errors.New("cannot call Serve() before Listen()")
)

type PublicKey struct {
	Id          string
	Name        string
	Fingerprint string
	Content     string
}

type SSH struct {
	listener net.Listener

	sshconfig           *ssh.ServerConfig
	config              *Config
	PublicKeyLookupFunc func(string) (*PublicKey, error)
}

func NewSSH(config Config) *SSH {
	s := &SSH{config: &config}

	// Use PATH if full path is not specified
	if s.config.GitPath == "" {
		s.config.GitPath = "git"
	}
	return s
}

func fileExists(path string) bool {
	_, err := os.Stat(path)
	return err == nil || os.IsExist(err)
}

func cleanCommand(cmd string) string {
	i := strings.Index(cmd, "git")
	if i == -1 {
		return cmd
	}
	return cmd[i:]
}

func execCommandBytes(cmdname string, args ...string) ([]byte, []byte, error) {
	bufOut := new(bytes.Buffer)
	bufErr := new(bytes.Buffer)

	cmd := exec.Command(cmdname, args...)
	cmd.Stdout = bufOut
	cmd.Stderr = bufErr

	err := cmd.Run()
	return bufOut.Bytes(), bufErr.Bytes(), err
}

func execCommand(cmdname string, args ...string) (string, string, error) {
	bufOut, bufErr, err := execCommandBytes(cmdname, args...)
	return string(bufOut), string(bufErr), err
}

func (s *SSH) handleConnection(keyID string, chans <-chan ssh.NewChannel) {
	for newChan := range chans {
		if newChan.ChannelType() != "session" {
			newChan.Reject(ssh.UnknownChannelType, "unknown channel type")
			continue
		}

		ch, reqs, err := newChan.Accept()
		if err != nil {
			log.Printf("error accepting channel: %v", err)
			continue
		}

		go func(in <-chan *ssh.Request) {
			defer ch.Close()

			for req := range in {
				payload := cleanCommand(string(req.Payload))

				switch req.Type {
				case "env":
					log.Printf("ssh: incoming env request: %s\n", payload)

					args := strings.Split(strings.Replace(payload, "\x00", "", -1), "\v")
					if len(args) != 2 {
						log.Printf("env: invalid env arguments: '%#v'", args)
						continue
					}

					args[0] = strings.TrimLeft(args[0], "\x04")
					if len(args[0]) == 0 {
						log.Printf("env: invalid key from payload: %s", payload)
						continue
					}

					_, _, err := execCommandBytes("env", args[0]+"="+args[1])
					if err != nil {
						log.Printf("env: %v", err)
						return
					}
				case "exec":
					log.Printf("ssh: incoming exec request: %s\n", payload)

					cmdName := strings.TrimLeft(payload, "'()")
					log.Printf("ssh: payload '%v'", cmdName)

					if strings.HasPrefix(cmdName, "\x00") {
						cmdName = strings.Replace(cmdName, "\x00", "", -1)[1:]
					}

					gitcmd, err := ParseGitCommand(cmdName)
					if err != nil {
						log.Println("ssh: error parsing command:", err)
						ch.Write([]byte("Invalid command.\r\n"))
						return
					}

					if !repoExists(filepath.Join(s.config.Dir, gitcmd.Repo)) && s.config.AutoCreate == true {
						err := initRepo(gitcmd.Repo, s.config)
						if err != nil {
							logError("repo-init", err)
							return
						}
					}

					cmd := exec.Command(gitcmd.Command, gitcmd.Repo)
					cmd.Dir = s.config.Dir
					cmd.Env = append(os.Environ(), "GITKIT_KEY="+keyID)
					// cmd.Env = append(os.Environ(), "SSH_ORIGINAL_COMMAND="+cmdName)

					stdout, err := cmd.StdoutPipe()
					if err != nil {
						log.Printf("ssh: cant open stdout pipe: %v", err)
						return
					}

					stderr, err := cmd.StderrPipe()
					if err != nil {
						log.Printf("ssh: cant open stderr pipe: %v", err)
						return
					}

					input, err := cmd.StdinPipe()
					if err != nil {
						log.Printf("ssh: cant open stdin pipe: %v", err)
						return
					}

					if err = cmd.Start(); err != nil {
						log.Printf("ssh: start error: %v", err)
						return
					}

					req.Reply(true, nil)
					go io.Copy(input, ch)
					io.Copy(ch, stdout)
					io.Copy(ch.Stderr(), stderr)

					if err = cmd.Wait(); err != nil {
						log.Printf("ssh: command failed: %v", err)
						return
					}

					ch.SendRequest("exit-status", false, []byte{0, 0, 0, 0})
					return
				default:
					ch.Write([]byte("Unsupported request type.\r\n"))
					log.Println("ssh: unsupported req type:", req.Type)
					return
				}
			}
		}(reqs)
	}
}

func (s *SSH) createServerKey() error {
	if err := os.MkdirAll(s.config.KeyDir, os.ModePerm); err != nil {
		return err
	}

	privateKey, err := rsa.GenerateKey(rand.Reader, 2048)
	if err != nil {
		return err
	}

	privateKeyFile, err := os.Create(s.config.KeyPath())
	if err != nil {
		return err
	}

	if err := os.Chmod(s.config.KeyPath(), 0600); err != nil {
		return err
	}
	defer privateKeyFile.Close()
	if err != nil {
		return err
	}
	privateKeyPEM := &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)}
	if err := pem.Encode(privateKeyFile, privateKeyPEM); err != nil {
		return err
	}

	pubKeyPath := s.config.KeyPath() + ".pub"
	pub, err := ssh.NewPublicKey(&privateKey.PublicKey)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(pubKeyPath, ssh.MarshalAuthorizedKey(pub), 0644)
}

func (s *SSH) setup() error {
	config := &ssh.ServerConfig{
		ServerVersion: fmt.Sprintf("SSH-2.0-gitkit %s", Version),
	}

	if s.config.KeyDir == "" {
		return fmt.Errorf("key directory is not provided")
	}

	if !s.config.Auth {
		config.NoClientAuth = true
	} else {
		if s.PublicKeyLookupFunc == nil {
			return fmt.Errorf("public key lookup func is not provided")
		}

		config.PublicKeyCallback = func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
			pkey, err := s.PublicKeyLookupFunc(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))))
			if err != nil {
				return nil, err
			}

			if pkey == nil {
				return nil, fmt.Errorf("auth handler did not return a key")
			}

			return &ssh.Permissions{Extensions: map[string]string{"key-id": pkey.Id}}, nil
		}
	}

	keypath := s.config.KeyPath()
	if !fileExists(keypath) {
		if err := s.createServerKey(); err != nil {
			return err
		}
	}

	privateBytes, err := ioutil.ReadFile(keypath)
	if err != nil {
		return err
	}

	private, err := ssh.ParsePrivateKey(privateBytes)
	if err != nil {
		return err
	}

	config.AddHostKey(private)
	s.sshconfig = config
	return nil
}

func (s *SSH) Listen(bind string) error {
	if s.listener != nil {
		return ErrAlreadyStarted
	}

	if err := s.setup(); err != nil {
		return err
	}

	if err := s.config.Setup(); err != nil {
		return err
	}

	var err error
	s.listener, err = net.Listen("tcp", bind)
	if err != nil {
		return err
	}

	return nil
}

func (s *SSH) Serve() error {
	if s.listener == nil {
		return ErrNoListener
	}

	for {
		// wait for connection or Stop()
		conn, err := s.listener.Accept()
		if err != nil {
			return err
		}

		go func() {
			log.Printf("ssh: handshaking for %s", conn.RemoteAddr())

			sConn, chans, reqs, err := ssh.NewServerConn(conn, s.sshconfig)
			if err != nil {
				if err == io.EOF {
					log.Printf("ssh: handshaking was terminated: %v", err)
				} else {
					log.Printf("ssh: error on handshaking: %v", err)
				}
				return
			}

			log.Printf("ssh: connection from %s (%s)", sConn.RemoteAddr(), sConn.ClientVersion())

			if s.config.Auth && s.config.GitUser != "" && sConn.User() != s.config.GitUser {
				sConn.Close()
				return
			}

			keyId := ""
			if sConn.Permissions != nil {
				keyId = sConn.Permissions.Extensions["key-id"]
			}

			go ssh.DiscardRequests(reqs)
			go s.handleConnection(keyId, chans)
		}()
	}
}

func (s *SSH) ListenAndServe(bind string) error {
	if err := s.Listen(bind); err != nil {
		return err
	}
	return s.Serve()
}

// Stop stops the server if it has been started, otherwise it is a no-op.
func (s *SSH) Stop() error {
	if s.listener == nil {
		return nil
	}
	defer func() {
		s.listener = nil
	}()

	return s.listener.Close()
}

// Address returns the network address of the listener. This is in
// particular useful when binding to :0 to get a free port assigned by
// the OS.
func (s *SSH) Address() string {
	if s.listener != nil {
		return s.listener.Addr().String()
	}
	return ""
}

{'repo_name': 'sosedoff/gitkit', 'stars': '140', 'repo_language': 'Go', 'file_name': 'codec.go', 'mime_type': 'text/plain', 'hash': 6978420503412440439, 'source_dataset': 'data'}


import { gcd } from './gcd';

export const lcm = (num1: number, num2: number) => {
  if (num1 === 0 || num2 === 0) {
    return 0;
  }
  num1 = Math.abs(num1);
  num2 = Math.abs(num2);
  return (num1 * num2) / gcd(num1, num2);
};

export const lcmArray = (num: number[]) => {
  let result = num[0];

  for (let i = 1; i < num.length; i++) {
    result = num[i] * result / gcd(num[i], result);
  }

  return result;
};

{'repo_name': 'PacktPublishing/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition', 'stars': '276', 'repo_language': 'JavaScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': -2313208965103303815, 'source_dataset': 'data'}


{'repo_name': 'BuildCraft/BuildCraft', 'stars': '1167', 'repo_language': 'Java', 'file_name': 'buildcraft.checkstyle', 'mime_type': 'text/xml', 'hash': 4577835617349668191, 'source_dataset': 'data'}


/*
            Copyright Oliver Kowalke 2009.
   Distributed under the Boost Software License, Version 1.0.
      (See accompanying file LICENSE_1_0.txt or copy at
          http://www.boost.org/LICENSE_1_0.txt)
*/

/****************************************************************************************
 *                                                                                *
 *  ----------------------------------------------------------------------------------  *
 *  |    0    |    1    |    2    |    3    |    4     |    5    |    6    |    7    |  *
 *  ----------------------------------------------------------------------------------  *
 *  |   0x0   |   0x4   |   0x8   |   0xc   |   0x10   |   0x14  |   0x18  |   0x1c  |  *
 *  ----------------------------------------------------------------------------------  *
 *  | fc_mxcsr|fc_x87_cw|   EDI   |   ESI   |   EBX    |   EBP   |   EIP   |  hidden |  *
 *  ----------------------------------------------------------------------------------  *
 *  ----------------------------------------------------------------------------------  *
 *  |    8    |    9    |    10   |    11   |    12    |    13   |    14   |    15   |  *
 *  ----------------------------------------------------------------------------------  *
 *  |   0x20  |   0x24  |                                                            |  *
 *  ----------------------------------------------------------------------------------  *
 *  |    to   |   data  |                                                            |  *
 *  ----------------------------------------------------------------------------------  *
 *                                                                                *
 ****************************************************************************************/

.text
.globl _make_fcontext
.align 2
_make_fcontext:
    /* first arg of make_fcontext() == top of context-stack */
    movl  0x4(%esp), %eax

    /* reserve space for first argument of context-function
       eax might already point to a 16byte border */
    leal  -0x8(%eax), %eax

    /* shift address in EAX to lower 16 byte boundary */
    andl  $-16, %eax

    /* reserve space for context-data on context-stack */
    leal  -0x28(%eax), %eax

    /* third arg of make_fcontext() == address of context-function */
    /* stored in EBX */
    movl  0xc(%esp), %ecx
    movl  %ecx, 0x10(%eax)

    /* save MMX control- and status-word */
    stmxcsr (%eax)
    /* save x87 control-word */
    fnstcw  0x4(%eax)

    /* return transport_t */
    /* FCTX == EDI, DATA == ESI */
    leal  0x8(%eax), %ecx
    movl  %ecx, 0x1c(%eax)

    /* compute abs address of label trampoline */
    call  1f
    /* address of trampoline 1 */
1:  popl  %ecx
    /* compute abs address of label trampoline */
    addl  $trampoline-1b, %ecx
    /* save address of trampoline as return address */
    /* will be entered after calling jump_fcontext() first time */
    movl  %ecx, 0x18(%eax)

    /* compute abs address of label finish */
    call  2f
    /* address of label 2 */
2:  popl  %ecx
    /* compute abs address of label finish */
    addl  $finish-2b, %ecx
    /* save address of finish as return-address for context-function */
    /* will be entered after context-function returns */
    movl  %ecx, 0x14(%eax)

    ret /* return pointer to context-data */

trampoline:
    /* move transport_t for entering context-function */
    movl  %edi, (%esp)
    movl  %esi, 0x4(%esp)
    pushl %ebp
    /* jump to context-function */
    jmp *%ebx

finish:
    /* exit code is zero */
    xorl  %eax, %eax
    movl  %eax, (%esp)
    /* exit application */
    call  __exit
    hlt

{'repo_name': 'RichieSams/FiberTaskingLib', 'stars': '588', 'repo_language': 'C++', 'file_name': 'catch.hpp', 'mime_type': 'text/x-c++', 'hash': 8273875699569428747, 'source_dataset': 'data'}


/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

#include "tensorflow/core/kernels/cwise_ops_common.h"

namespace tensorflow {
REGISTER_KERNEL_BUILDER(Name("LogicalAnd").Device(DEVICE_CPU),
                        BinaryOp<CPUDevice, functor::logical_and>);
#if GOOGLE_CUDA
REGISTER_KERNEL_BUILDER(Name("LogicalAnd").Device(DEVICE_GPU),
                        BinaryOp<GPUDevice, functor::logical_and>);
#endif
}  // namespace tensorflow

{'repo_name': 'miyosuda/TensorFlowAndroidMNIST', 'stars': '264', 'repo_language': 'C++', 'file_name': 'beginner.py', 'mime_type': 'text/x-python', 'hash': -6865199220180304278, 'source_dataset': 'data'}


Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DOMParser", "DOMParser\DOMParser_vs100.vcxproj", "{70F2F655-67D5-32A1-A99B-D4903547DB3E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DOMWriter", "DOMWriter\DOMWriter_vs100.vcxproj", "{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrettyPrint", "PrettyPrint\PrettyPrint_vs100.vcxproj", "{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SAXParser", "SAXParser\SAXParser_vs100.vcxproj", "{2A54653D-9F55-348B-8F79-A3E454563AE3}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		debug_shared|Win32 = debug_shared|Win32
		release_shared|Win32 = release_shared|Win32
		debug_static_mt|Win32 = debug_static_mt|Win32
		release_static_mt|Win32 = release_static_mt|Win32
		debug_static_md|Win32 = debug_static_md|Win32
		release_static_md|Win32 = release_static_md|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_shared|Win32.Build.0 = debug_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_shared|Win32.ActiveCfg = release_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_shared|Win32.Build.0 = release_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_shared|Win32.Deploy.0 = release_shared|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_md|Win32.Build.0 = release_static_md|Win32
		{70F2F655-67D5-32A1-A99B-D4903547DB3E}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_shared|Win32.Build.0 = debug_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_shared|Win32.ActiveCfg = release_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_shared|Win32.Build.0 = release_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_shared|Win32.Deploy.0 = release_shared|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_md|Win32.Build.0 = release_static_md|Win32
		{A3CBDFA6-6261-3C04-B1FD-51AA20763BB8}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_shared|Win32.Build.0 = debug_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_shared|Win32.ActiveCfg = release_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_shared|Win32.Build.0 = release_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_shared|Win32.Deploy.0 = release_shared|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_md|Win32.Build.0 = release_static_md|Win32
		{DFA97011-8DD4-3A84-A0C9-EB2101BD6082}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_shared|Win32.Build.0 = debug_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_shared|Win32.ActiveCfg = release_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_shared|Win32.Build.0 = release_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_shared|Win32.Deploy.0 = release_shared|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_md|Win32.Build.0 = release_static_md|Win32
		{2A54653D-9F55-348B-8F79-A3E454563AE3}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

{'repo_name': 'toggl-open-source/toggldesktop', 'stars': '1359', 'repo_language': 'C++', 'file_name': 'InfoPlist.strings', 'mime_type': 'text/plain', 'hash': -6343215128075987033, 'source_dataset': 'data'}


apiVersion: v1
kind: ServiceAccount
metadata:
  name: metrics-server
  namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: metrics-server
  namespace: kube-system
  labels:
    k8s-app: metrics-server
spec:
  selector:
    matchLabels:
      k8s-app: metrics-server
  template:
    metadata:
      name: metrics-server
      labels:
        k8s-app: metrics-server
    spec:
      serviceAccountName: metrics-server
      containers:
      - name: metrics-server
        image: gcr.io/google_containers/metrics-server-amd64:v0.2.1
        imagePullPolicy: Always
        command:
        - /metrics-server
        - --source=kubernetes.summary_api:''

{'repo_name': 'feiskyer/kubernetes-handbook', 'stars': '3736', 'repo_language': 'Makefile', 'file_name': 'index.md', 'mime_type': 'text/plain', 'hash': -1511791955927866999, 'source_dataset': 'data'}


//
//  AVIMAudioMessage.h
//  AVOSCloudIM
//
//  Created by Qihe Bian on 1/12/15.
//  Copyright (c) 2015 LeanCloud Inc. All rights reserved.
//

#import "AVIMTypedMessage.h"

NS_ASSUME_NONNULL_BEGIN

/**
 *  Audio Message. Can be created by the audio's file path.
 */
@interface AVIMAudioMessage : AVIMTypedMessage <AVIMTypedMessageSubclassing>

/// File size in bytes.
@property(nonatomic, assign, readonly) uint64_t size;

/// Audio's duration in seconds.
@property(nonatomic, assign, readonly) float duration;

/// Audio format, mp3, aac, etc. Simply get it by the file extension.
@property(nonatomic, copy, readonly, nullable) NSString *format;

@end

NS_ASSUME_NONNULL_END

{'repo_name': 'Brances/ZMBCY-iOS', 'stars': '189', 'repo_language': 'Objective-C', 'file_name': 'Info.plist', 'mime_type': 'text/xml', 'hash': -5078548899846981869, 'source_dataset': 'data'}


/************************************************
Copyright (c) 2016, Xilinx, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.// Copyright (c) 2015 Xilinx, Inc.
************************************************/
#include "echo_server_application.hpp"
#include <iostream>

using namespace hls;

int main()
{

	stream<ap_uint<16> > listenPort("listenPort");
	stream<bool> listenPortStatus("listenPortStatus");
	stream<appNotification> notifications;
	stream<appReadRequest> readRequest;
	stream<ap_uint<16> > rxMetaData;
	stream<axiWord> rxData;
	stream<ipTuple> openConnection;
	stream<openStatus> openConStatus;
	stream<ap_uint<16> > closeConnection;
	stream<ap_uint<16> > txMetaData;
	stream<axiWord> txData;
	stream<ap_int<17> >	txStatus;

	int count = 0;
	while (count < 50)
	{
		echo_server_application(	listenPort, listenPortStatus,
									notifications, readRequest,
									rxMetaData, rxData,
									openConnection, openConStatus,
									closeConnection,
									txMetaData, txData,
									txStatus);
		if (!listenPort.empty())
		{
			listenPort.read();
			listenPortStatus.write(true);
		}
		count++;
	}
	return 0;
}

{'repo_name': 'Xilinx/HLx_Examples', 'stars': '226', 'repo_language': 'Matlab', 'file_name': 'image_filter.cpp', 'mime_type': 'text/x-c', 'hash': 5008992410171918434, 'source_dataset': 'data'}


// Code generated by zanzibar
// @generated

// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package module

import (
	zanzibar "github.com/uber/zanzibar/runtime"
)

// Dependencies contains dependencies for the google-now client module
type Dependencies struct {
	Default *zanzibar.DefaultDependencies
}

{'repo_name': 'uber/zanzibar', 'stars': '210', 'repo_language': 'Go', 'file_name': 'template_files.go', 'mime_type': 'text/plain', 'hash': 8103592207938109717, 'source_dataset': 'data'}


<?php

namespace Ardent\Collection;

class HashSetTest extends SetTest {

    /**
     * @var HashSet
     */
    protected $object;

    function instance() {
        return new HashSet();
    }

    function test_has() {
        $set = $this->instance();

        $scalar = 0;
        $this->assertFalse($set->has($scalar));
        $set->add($scalar);
        $this->assertTrue($set->has($scalar));
        $this->assertTrue($set->has('0'));

        $object = new \StdClass();
        $this->assertFalse($set->has($object));
        $set->add($object);
        $this->assertTrue($set->has($object));

        $resource = fopen(__FILE__, 'r');
        $this->assertFalse($set->has($resource));
        $set->add($resource);
        $this->assertTrue($set->has($resource));
        fclose($resource);

        $emptyArray = array();
        $this->assertFalse($set->has($emptyArray));
        $set->add($emptyArray);
        $this->assertTrue($set->has($emptyArray));

        $array = array(0, 1);
        $this->assertFalse($set->has($array));
        $set->add($array);
        $this->assertTrue($set->has($array));

        $null = null;

        $this->assertFalse($set->has($null));
        $set->add($null);
        $this->assertTrue($set->has($null));

    }

}

{'repo_name': 'morrisonlevi/Ardent', 'stars': '627', 'repo_language': 'PHP', 'file_name': 'AvlTreeTest.php', 'mime_type': 'text/x-php', 'hash': -6918952494597019445, 'source_dataset': 'data'}


<properties
   pageTitle="Configure the Visual Studio Tools for Apache Cordova | Cordova"
   description="description"
   services="na"
   documentationCenter=""
   authors="jmatthiesen"
   tags=""/>
<tags ms.technology="cordova" ms.prod="visual-studio-dev14"
   ms.service="na"
   ms.devlang="javascript"
   ms.topic="article"
   ms.tgt_pltfrm="mobile-multiple"
   ms.workload="na"
   ms.date="09/10/2015"
   ms.author="jomatthi"/>

# Configure the Visual Studio Tools for Apache Cordova
You can download Visual Studio from the [Microsoft Download Center](http://go.microsoft.com/fwlink/p/?linkid=517106). Once you have [installed the tools](install-vs-tools-apache-cordova.md), refer to this topic for additional ways to quickly configure, update, or customize the tools for your environment.

* If you choose not to install one or more dependencies with Visual Studio Tools for Apache Cordova, you may need to [install the dependencies manually](#ThirdParty).

* If you need to verify the path for a third-party dependency or if you have multiple versions of a dependency installed, see [Override system environment variables](#env-var).

* If you are running Visual Studio behind a proxy, see [Configure tools to work with a proxy](#Proxy).

* To install, start, and configure the remotebuild agent (previously called vs-mda-remote) for building iOS apps, see the following:

    * [Install the remote agent and get it running](ios-guide.md) (external topic)

    * [Generate a new security PIN](#IosPin)

    * [Configure the remote agent](#IosConfig)

    * [Generate a new server certificate](#IosCert)

    * [Verify the remote agent configuration](#IosVerify)

* If you see unexpected errors when trying to build the Blank App template, see [Re-install the Cordova CLI pre-processor](#vstac).

    >**Caution:**
  If you are migrating a project from an earlier version of Visual Studio, see this [migration information](https://github.com/Microsoft/cordova-docs/blob/master/known-issues/known-issues-vs2015.md#known-issues—visual-studio-2015) (github).

##Install dependencies manually
If you choose not to install one or more dependencies with the extension, you can install them later manually.

You can install the dependencies in any order, except for Java. You must install and configure Java before you install the Android SDK. Read the following information and use these links to install dependencies manually.

* [Joyent Node.js](http://nodejs.org)

    We recommend installing the x86 version of Node.js. Before installing this software, read about [safely installing Node.js](../develop-apps/change-node-version.md).

* [Google Chrome](https://www.google.com/intl/en/chrome/browser/index.html)

* [Git Command Line Tools](http://go.microsoft.com/fwlink/?LinkID=396870)

    When you install Git command line tools, select the option that adds Git to your command prompt path.

    >**Caution:**
Git command line tools 1.9.5 are installed by default. Unexpected failures may occur if you install a version prior to 1.9.0.

* [Apache Ant](http://go.microsoft.com/fwlink/?LinkID=396869)

     * Download and extract Ant to a location like C:/ant-1.x.x

     * Set the ANT_HOME environment variable to point to the preceding location.

     * Add %ANT_HOME%\bin to the system path.

    >**Note:**
If you need to set this environment variable manually, see [Override system environment variables](#env-var).
* [32-bit Oracle Java 7](http://go.microsoft.com/fwlink/?LinkID=396871)

    * Set the JAVA_HOME environment variable to C:/Program Files/Java/jdk1.7.0_55

    * Add this to the system path: %JAVA_HOME%\bin

    * To avoid out of memory issues, set a *JAVA_OPTIONS environment variable with at least -Xmx512M in it.

    >**Note:**
If you need to set this environment variable manually, see [Override system environment variables](#env-var).
* [Android SDK](http://go.microsoft.com/fwlink/?LinkID=396873) with the following SDK packages:

   * Android SDK Tools (latest version) * Android SDK Platform-tools (latest version)

   * Android SDK Build-tools (19.1, 19.0.3, and 21)

   * Android 5.0 (API level 21) with the following packages:

      * SDK Platform

      * If you want to use the Google Android Emulator to emulate a 5.0.x device:

         * ARM EABI v7a System Image

         * Intel x86 Atom System Image

         * Google APIs (x86 System Image)

         * Google APIs (ARM System Image)

         * If you want to use Cordova 5.0.0 or later:

           * Android 5.1.x (API level 22) with the following packages: SDK platform

           The following illustration shows the minimum required packages in the Android SDK Manager.

           ![Cordova_SDK_Android_Packages](media/configure-vs-tools-apache-cordova/IC795810.png)

           Set the ADT_HOME environment variable to the SDK installation location.

           Add this to the system path: %ADT_HOME%\tools;%ADT_HOME%\platform-tools

           If you need to set this environment variable manually, see [Override system environment variables](#env-var).

          >**Tip:** If you install the Android SDK to its default location on Windows, it gets installed to C:\Program Files (x86)\Android\android-sdk.

* If you want to use the Google Android Emulator to emulate a 5.1.x device:

  * ARM EABI v7a System Image

  * Intel x86 Atom System Image

  * Google APIs (x86 System Image)

  * Google APIs (ARM System Image)

  * Apple iTunes ([x86](http://go.microsoft.com/fwlink/?LinkID=397715), [x64](http://go.microsoft.com/fwlink/?LinkID=397313))

  * WebSocket4Net (required if you’re developing your app on Windows 7)

    1. Download WebSocket4Net(0.9).Binaries.zip from [CodePlex](http://go.microsoft.com/fwlink/?LinkID=403031).
    2. Unzip the binaries and then unblock net45\Release\WebSocket4Net.dll. To unblock the DLL, open the file Properties for the DLL and choose Unblock in the General tab (at the bottom of the dialog box).
    3. After you unblock the DLL, copy net45\Release\WebSocket4Net.dll into the %ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\WebClient\Diagnostics\ToolWindows folder on your computer.

##Override system environment variables

Visual Studio detects the configurations for the third-party software you’ve installed, and maintains the installation paths in the following environment variables:

* **ADT_HOME** points to the Android installation path.

* **ANT_HOME** points to the Ant folder on your computer.

* **GIT_HOME** points to the Git installation path.

* **JAVA_HOME** points to the Java installation path.

Visual Studio uses these environment variables when building and running your app. You can view the environment variables and revise their values through the Visual Studio Options dialog box. You might want to override the default settings for one of the following reasons:

* Visual Studio was unable to verify the path. In this case, a warning is displayed next to the environment variable.

* You have multiple versions of the software installed, and you’d like to use a specific version.

* You want your global environment path to be different from the local Visual Studio environment.

### To override the variables
1. On the Visual Studio menu bar, choose **Tools**, **Options**. 4. In the **Options** dialog box, choose **Tools* for Apache Cordova**, and then choose **Environment Variable Overrides**.

2. Make your changes:

    * To override a value, select its check box, and then revise the value.
      If the path information is invalid or missing, Visual Studio displays a warning next to that variable.

    * To reset an environment variable to its default value, clear its check box or choose **Reset to Default**.

3. Choose the **OK** button to save your changes and close the dialog box.
![Environment variables, warning message](media/configure-vs-tools-apache-cordova/options-dialog.png)

##Generate a new security PIN

When you [start the agent](ios-guide.md#remoteAgent) the first time, the generated PIN is valid for a limited amount of time (10 minutes by default). If you don’t connect to the agent before the time expires, or if you want to connect a second client to the agent, you will need to generate a new PIN.
### To generate a new security PIN
1. Stop the agent (or open a second Terminal app window on your Mac and use that to enter the command).

3. From the Terminal app on your Mac, type:

        remotebuild certificates generate

    > **Note** If you are running an older version of the agent, the preceding command is not supported. Make sure that you update the remotebuild agent by [re-installing](ios-guide.md#first-install-a-few-things-onto-your-mac).

4. Follow instructions to [start the agent](ios-guide.md#remoteAgent) on your Mac and configure the agent in Visual Studio.

##Generate a new server certificate
For security purposes, the server certificates that pair Visual Studio with the remote agent are tied to your Mac’s IP or host name. If these values have changed, you will need to generate a new server certificate, and then reconfigure Visual Studio with the new values.

### To generate a new server certificate
1. Stop the agent.

2. From the Terminal app on your Mac, type:

        remotebuild certificates reset --hostname=my.hostname.com

    > **Note** If you are running an older version of the agent, the preceding command is not supported. Make sure that you update the remotebuild agent by [re-installing](ios-guide.md#first-install-a-few-things-onto-your-mac).

3. When prompted, type “Y” and then type Enter.

4. From the Terminal app on your Mac, type:

        remotebuild certificates generate --hostname=my.hostname.com

    –hostname is optional. If omitted, the agent will attempt to determine the hostname automatically.

5. Follow instructions to [start the agent](ios-guide.md#remoteAgent) on your Mac and configure the agent in Visual Studio.

##Configure the iOS remote agent

You can configure the remote agent using various command line options. For example, you can specify the port to listen for build requests and specify the maximum number of builds to maintain on the file system. (By default, the limit is 10\. The agent will remove builds that exceed the maximum on shutdown.)

>**Caution:**
Many options have changed between vs-mda-remote and remotebuild.

### To configure the remote agent

* To see a complete list of agent commands, type:

        remotebuild --help

    To see the full list of supported options, type `remotebuild --help <*command*>`. For example, to see options for the certificates parameter, type:

        remotebuild --help certificates

* To disable secure mode and enable simple HTTP based connections, type:

        remotebuild –-secure=false

    When you use this option, leave the PIN field blank and make sure to set Secure Mode to False when configuring the agent in Visual Studio.

* To specify a location for remote agent files, type:

        remotebuild --serverDir <directory>

    where _<directory\>_ is a location on your Mac where log files, builds, and server certificates will be placed. For example, the location could be /Users/username/builds. (Builds will be organized by build number in this location.)

* To use a background process to capture _stdout_ and _stderr_ to a file (server.log), type:

        remotebuild > server.log 2>&1 &

The server.log file might assist in troubleshooting build issues.

* To run the agent by using a configuration file instead of command-line parameters, type:

        remotebuild --config <path-to-config-file>

The configuration file must be in JSON format. The startup options and their values must not include dashes. To see a documented configuration file, look at the remotebuild/examples/exampleConfig.json folder in the remote agent installation directory, although you must remove the comments in the file that you use for your configuration. An example of a path you might use when running this command is _/Users/<username\>/myConfig.json_. The default path where the agent looks for a configuration file is ~/.taco_home/RemoteBuild.config.\

##Verify the iOS remote agent configuration
Once you have [installed the agent](ios-guide.md), you can verify the remote agent configuration.

### To verify the remote agent configuration

* With the remote agent running, open a second Terminal app window (choose **Shell**, **New Window**).

* From the second Terminal app window on your Mac, type:

       remotebuild test <same-options-as-first-agent>

    >**Important:**
This command will fail if the agent is not running in a second window, or if the two instances are not using the same configuration options.

    This command initiates a test build. The output from the command should show the build number and other information about the build, such as its progress.

* If you started the server on a port other than 3000, use the following command instead to initiate a test build:

        remotebuild test –-server http://localhost:<portNumber>

* To verify that your developer signing identity is set up correctly for device builds (using the Debug and Release configurations in Visual Studio), type:

        remotebuild test --device

* To verify that your distribution signing identity is set up correctly for device builds (using the Debug configuration in Visual Studio), type:

        remotebuild test --device

For more information about app provisioning and certificate signing identities, see [Package Your App Built with Visual Studio Tools for Apache Cordova](./package-and-publish/package-app-built-with-visual-studio.md).

##Reinstall the Cordova CLI pre-processor (vs-tac)

If you see unexpected errors when trying to build the Blank App template after installing Visual Studio Tools for Apache Cordova, you can try clearing your cache and reinstalling the Cordova CLI pre-processor, vs-tac, on your PC. Typically, this is only necessary if you try to build a Cordova app and see the error Cannot find module *[modulename]*.

>**Note**: If you do not see the module error, go through steps in [Resolving build errors](../tips-and-workarounds/general/tips-and-workarounds-general-readme.md) before re-installing vs-tac.

### To try the quick fix

* Delete the platforms/*platform* folder for the platform you are targeting (like the platforms/android folder) and then rebuild your project. If you have no errors this time, you don't need to clear the cache.

### To clear the cache

1. Choose **Tools**, **Options**, **Tools for Apache Cordova**, and then choose **Cordova Tools**.

2. Choose **Clear Cordova Cache**.

3. Close and re-open your project.

4. Choose **Build**, **Clean Solution**.

5. Delete the platforms/*platform* folder, like platforms/android.

    >**Tip:**
If you have no errors, you do not need to re-install vs-tac. If you still have the same error, then re-install vs-tac.

### To re-install vs-tac

1. Close Visual Studio.

2. Open a command line and type the following command:

        npm install -g <path-to-vs-tac>
The default path to vs-tac is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac

3. Re-open Visual Studio.

4. Open your project, choose **Build**, **Clean Solution**.

5. Delete the platforms/*platform* folder, like platforms/android, and then rebuild your project.

    If this does not resolve the issue, see the [Known Issues](./known-issues/known-issues-general.md).

##Configure tools to work with a proxy
If you are using Visual Studio behind a proxy, such as a corporate firewall, you may need to configure proxy settings for the npm package manager and for git before you can use Visual Studio Tools for Apache Cordova.

>**Important:**
Using npm proxy settings with recent versions of Node.js can cause Cordova to fail to acquire plugins at the command line or in the configuration designer or when adding platforms required for build. If you encounter unexpected issues (particularly a “TypeError: Request path contains unescaped characters” error), try downgrading Node.js to 0.10.29.

### To configure proxy settings for npm package manager

1. Close Visual Studio.

2. Open a Visual Studio developer command window (Ctrl + Alt + A) and type the following command.

        npm -g uninstall vs-tac

3. Open %AppData%\npm\node_modules and verify that the vs-tac folder has been removed.

4. In the Visual Studio developer command window, type the following command.

        npm config set proxy <proxy-port>
where *proxy-port* is the proxy address and port number, such as http://proxy.mycompany.com:80/.
5. Then type this command:

        npm config set https-proxy <proxy-port>
where proxy-port might be a value such as http://proxy.mycompany.com:80/

6. Open Visual Studio.

7. Open your Apache Cordova solution and rebuild your project.

### To configure proxy settings for git
1. Close Visual Studio.

2. Open a Visual Studio developer command window (Ctrl + Alt + A) and type the following command.

        git config --global http.proxy http://<username>:<password>@<proxy-port>
where *username* and *password* are your proxy username and password; *proxy-port* might be a value such as proxy.mycompany.com:80.

3. Type this command:

        git config --global https.proxy http://<username>:<password>@<proxy-port>
where *username* and *password* are your proxy username and password; *proxy-port* might be a value such as proxy.mycompany.com:80

4. Open Visual Studio.

5. Open your Apache Cordova solution and rebuild your project.

{'repo_name': 'MicrosoftDocs/cordova-docs', 'stars': '141', 'repo_language': 'JavaScript', 'file_name': 'docfx.json', 'mime_type': 'text/plain', 'hash': 7365292128697254169, 'source_dataset': 'data'}


#include "MatrixOpe.h"

int autoNorm(Matrix x);

Matrix cdistances(Matrix test,Matrix x);

Matrix getK(Matrix oneTest,Matrix x,int K);

int classfiy(Matrix &testData,Matrix &testDatay,Matrix &x,Matrix &y,const int &K);

int KNN();

{'repo_name': 'myazi/myLearn', 'stars': '105', 'repo_language': 'C++', 'file_name': '5.txt', 'mime_type': 'text/plain', 'hash': 8842257837561298377, 'source_dataset': 'data'}


/**
 * Copyright (c) 2014,2019 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package org.eclipse.smarthome.core.thing.dto;

import java.util.List;
import java.util.Map;

import org.eclipse.smarthome.config.core.dto.ConfigDescriptionParameterDTO;
import org.eclipse.smarthome.config.core.dto.ConfigDescriptionParameterGroupDTO;

/**
 * This is a data transfer object that is used with to serialize thing types.
 *
 * @author Dennis Nobel - Initial contribution
 * @author Thomas Höfer - Added thing and thing type properties
 * @author Chris Jackson - Added parameter groups
 * @author Miki Jankov - Introducing StrippedThingTypeDTO
 *
 */
public class ThingTypeDTO extends StrippedThingTypeDTO {

    public List<ChannelDefinitionDTO> channels;
    public List<ChannelGroupDefinitionDTO> channelGroups;
    public List<ConfigDescriptionParameterDTO> configParameters;
    public List<ConfigDescriptionParameterGroupDTO> parameterGroups;
    public Map<String, String> properties;
    public List<String> extensibleChannelTypeIds;

    public ThingTypeDTO() {
    }

    public ThingTypeDTO(String UID, String label, String description, String category, boolean listed,
            List<ConfigDescriptionParameterDTO> configParameters, List<ChannelDefinitionDTO> channels,
            List<ChannelGroupDefinitionDTO> channelGroups, List<String> supportedBridgeTypeUIDs,
            Map<String, String> properties, boolean bridge, List<ConfigDescriptionParameterGroupDTO> parameterGroups,
            List<String> extensibleChannelTypeIds) {
        this.UID = UID;
        this.label = label;
        this.description = description;
        this.category = category;
        this.listed = listed;
        this.configParameters = configParameters;
        this.channels = channels;
        this.channelGroups = channelGroups;
        this.supportedBridgeTypeUIDs = supportedBridgeTypeUIDs;
        this.properties = properties;
        this.bridge = bridge;
        this.parameterGroups = parameterGroups;
        this.extensibleChannelTypeIds = extensibleChannelTypeIds;
    }

}

{'repo_name': 'eclipse-archived/smarthome', 'stars': '865', 'repo_language': 'Java', 'file_name': 'MANIFEST.MF', 'mime_type': 'text/plain', 'hash': -8535657874232201325, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="_qyxQQOTSEeO-H55oRJubsg" exporter="camunda modeler" exporterVersion="2.5.0" targetNamespace="http://camunda.org/schema/1.0/bpmn">
  <bpmn2:process id="process" isExecutable="true">
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:subProcess id="SubProcess_1">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
      <bpmn2:startEvent id="StartEvent_2">
        <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
      </bpmn2:startEvent>
      <bpmn2:serviceTask id="ServiceTask_1" camunda:class="org.camunda.bpm.engine.test.bpmn.subprocess.util.GetActInstanceDelegate" name="Service
Task">
        <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
        <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
      </bpmn2:serviceTask>
      <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="StartEvent_2" targetRef="ServiceTask_1"/>
      <bpmn2:endEvent id="EndEvent_2">
        <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
      </bpmn2:endEvent>
      <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="ServiceTask_1" targetRef="EndEvent_2"/>
    </bpmn2:subProcess>
    <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="SubProcess_1"/>
    <bpmn2:endEvent id="EndEvent_1">
      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="SubProcess_1" targetRef="EndEvent_1"/>
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds height="36.0" width="36.0" x="193.0" y="160.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_SubProcess_2" bpmnElement="SubProcess_1" isExpanded="true">
        <dc:Bounds height="150.0" width="517.0" x="288.0" y="103.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_2" targetElement="_BPMNShape_SubProcess_2">
        <di:waypoint xsi:type="dc:Point" x="229.0" y="178.0"/>
        <di:waypoint xsi:type="dc:Point" x="288.0" y="178.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_EndEvent_2" bpmnElement="EndEvent_1">
        <dc:Bounds height="36.0" width="36.0" x="855.0" y="160.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_SubProcess_2" targetElement="_BPMNShape_EndEvent_2">
        <di:waypoint xsi:type="dc:Point" x="804.0" y="178.0"/>
        <di:waypoint xsi:type="dc:Point" x="855.0" y="178.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_3" bpmnElement="StartEvent_2">
        <dc:Bounds height="36.0" width="36.0" x="347.0" y="160.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_2" bpmnElement="ServiceTask_1">
        <dc:Bounds height="80.0" width="100.0" x="433.0" y="138.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_StartEvent_3" targetElement="_BPMNShape_ServiceTask_2">
        <di:waypoint xsi:type="dc:Point" x="383.0" y="178.0"/>
        <di:waypoint xsi:type="dc:Point" x="433.0" y="178.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_EndEvent_3" bpmnElement="EndEvent_2">
        <dc:Bounds height="36.0" width="36.0" x="583.0" y="160.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ServiceTask_2" targetElement="_BPMNShape_EndEvent_3">
        <di:waypoint xsi:type="dc:Point" x="533.0" y="178.0"/>
        <di:waypoint xsi:type="dc:Point" x="583.0" y="178.0"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>

{'repo_name': 'camunda/camunda-bpm-platform', 'stars': '1508', 'repo_language': 'Java', 'file_name': 'DmnBusinessRuleTaskTest.java', 'mime_type': 'text/x-java', 'hash': -4168188778184698764, 'source_dataset': 'data'}


// Copyright 2014 Cognitect. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

goog.provide("com.cognitect.transit.eq");
goog.require("com.cognitect.transit.util");

goog.scope(function() {

var eq   = com.cognitect.transit.eq,
    util = com.cognitect.transit.util;

/**
 * @const
 * @type {string}
 */
eq.hashCodeProperty = "transit$hashCode$";

/**
 * @type {number}
 */
eq.hashCodeCounter = 1;

eq.equals = function (x, y) {
    if(x == null) {
        return y == null;
    } else if(x === y) {
        return true;
    } else if(typeof x === "object") {
        if(util.isArray(x)) {
            if(util.isArray(y)) {
                if(x.length === y.length) {
                    for(var i = 0; i < x.length; i++) {
                        if(!eq.equals(x[i], y[i])) {
                            return false;
                        }
                    }
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else if(x.com$cognitect$transit$equals) {
            return x.com$cognitect$transit$equals(y);
        } else if((y != null) && (typeof y === "object")) {
            if(y.com$cognitect$transit$equals) {
                return y.com$cognitect$transit$equals(x);
            } else {
                var xklen = 0,
                    yklen = util.objectKeys(y).length;
                for(var p in x) {
                    if(!x.hasOwnProperty(p)) continue;
                    xklen++;
                    if(!y.hasOwnProperty(p)) {
                        return false;
                    } else {
                        if(!eq.equals(x[p], y[p])) {
                            return false;
                        }
                    }
                }
                return xklen === yklen;
            }
        } else {
            return false;
        }
    } else {
        return false
    }
};

eq.hashCombine = function(seed, hash) {
    return seed ^ (hash + 0x9e3779b9 + (seed << 6) + (seed >> 2));
};

eq.stringCodeCache     = {};
eq.stringCodeCacheSize = 0;

/**
 * @const
 * @type {number}
 */
eq.STR_CACHE_MAX       = 256;

eq.hashString = function(str) {
    // a la goog.string.HashCode
    // http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1206
    var cached = eq.stringCodeCache[str];
    if(cached != null) {
        return cached;
    }
    var code = 0;
    for (var i = 0; i < str.length; ++i) {
        code = 31 * code + str.charCodeAt(i);
        code %= 0x100000000;
    }
    eq.stringCodeCacheSize++;
    if(eq.stringCodeCacheSize >= eq.STR_CACHE_MAX) {
        eq.stringCodeCache = {};
        eq.stringCodeCacheSize = 1;
    }
    eq.stringCodeCache[str] = code;
    return code;
};

eq.hashMapLike = function(m) {
    var code = 0;
    // ES6 Map-like case
    if(m.forEach != null) {
        m.forEach(function(val, key, m) {
            code = (code + (eq.hashCode(key) ^ eq.hashCode(val))) % 4503599627370496;
        });
    } else {
        // JS Object case
        var keys = util.objectKeys(m);
        for(var i = 0; i < keys.length; i++) {
            var key = keys[i];
            var val = m[key];
            code = (code + (eq.hashCode(key) ^ eq.hashCode(val))) % 4503599627370496;
        }
    }
    return code;
};

eq.hashArrayLike = function(arr) {
    var code = 0;
    if(util.isArray(arr)) {
        for(var i = 0; i < arr.length; i++) {
            code = eq.hashCombine(code, eq.hashCode(arr[i]));
        }
    } else if(arr.forEach) {
        arr.forEach(function(x, i) {
            code = eq.hashCombine(code, eq.hashCode(x));
        });
    }
    return code;
};

eq.hashCode = function(x) {
    if(x == null) {
        return 0;
    } else {
        switch(typeof x) {
        case 'number':
            return x;
            break;
        case 'boolean':
            return x === true ? 1 : 0;
            break;
        case 'string':
            return eq.hashString(x);
            break;
        case 'function':
            var code = x[eq.hashCodeProperty];
            if(code) {
                return code;
            } else {
                code = eq.hashCodeCounter;
                if(typeof Object.defineProperty != "undefined") {
                    Object.defineProperty(x, eq.hashCodeProperty, {
                        value: code,
                        enumerable: false
                    });
                } else {
                    x[eq.hashCodeProperty] = code;
                }
                eq.hashCodeCounter++;
                return code;
            }
            break;
        default:
            if(x instanceof Date) {
                return x.valueOf();
            } else if(util.isArray(x)) {
                return eq.hashArrayLike(x);
            } if(x.com$cognitect$transit$hashCode) {
                return x.com$cognitect$transit$hashCode();
            } else {
                return eq.hashMapLike(x);
            }
            break;
        }
    }
}

eq.extendToEQ = function(obj, opts) {
    obj.com$cognitect$transit$hashCode = opts["hashCode"];
    obj.com$cognitect$transit$equals = opts["equals"];
    return obj;
}

});

{'repo_name': 'cognitect/transit-js', 'stars': '710', 'repo_language': 'JavaScript', 'file_name': 'bson_compare.js', 'mime_type': 'text/plain', 'hash': 8604327181272633393, 'source_dataset': 'data'}


<?php
use think\facade\Env;

return [
    // 默认使用的数据库连接配置
    'default'         => Env::get('database.driver', 'mysql'),

    // 自定义时间查询规则
    'time_query_rule' => [],

    // 自动写入时间戳字段
    // true为自动识别类型 false关闭
    // 字符串则明确指定时间字段类型 支持 int timestamp datetime date
    'auto_timestamp'  => true,

    // 时间字段取出后的默认时间格式
    'datetime_format' => 'Y-m-d H:i:s',

    // 数据库连接配置信息
    'connections'     => [
        'mysql' => [
            // 数据库类型
            'type'              => Env::get('database.type', 'mysql'),
            // 服务器地址
            'hostname'          => Env::get('database.hostname', 'host.docker.internal'),
            // 数据库名
            'database'          => Env::get('database.database', 'easyadmin'),
            // 用户名
            'username'          => Env::get('database.username', 'root'),
            // 密码
            'password'          => Env::get('database.password', 'root'),
            // 端口
            'hostport'          => Env::get('database.hostport', '3306'),
            // 数据库连接参数
            'params'            => [],
            // 数据库编码默认采用utf8
            'charset'           => Env::get('database.charset', 'utf8'),
            // 数据库表前缀
            'prefix'            => Env::get('database.prefix', 'ea_'),

            // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
            'deploy'            => 0,
            // 数据库读写是否分离 主从式有效
            'rw_separate'       => false,
            // 读写分离后 主服务器数量
            'master_num'        => 1,
            // 指定从服务器序号
            'slave_no'          => '',
            // 是否严格检查字段是否存在
            'fields_strict'     => true,
            // 是否需要断线重连
            'break_reconnect'   => false,
            // 监听SQL
            'trigger_sql'       => true,
            // 开启字段缓存
            'fields_cache'      => false,
            // 字段缓存路径
            'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
        ],

        // 更多的数据库配置信息
    ],
];

{'repo_name': 'zhongshaofa/easyadmin', 'stars': '113', 'repo_language': 'PHP', 'file_name': 'goods.js', 'mime_type': 'text/plain', 'hash': 3187550496789945484, 'source_dataset': 'data'}


# Copyright (C) 2018 Heron Systems, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
from adept.exp.base.exp_module import ExpModule

class ExperienceReplay(ExpModule):
    def write_actor(self, items):
        pass

    def write_env(self, obs, rewards, terminals, infos):
        pass

    def read(self):
        pass

    def is_ready(self):
        pass

class PrioritizedExperienceReplay(ExpModule):
    def write_actor(self, items):
        pass

    def write_env(self, obs, rewards, terminals, infos):
        pass

    def read(self):
        pass

    def is_ready(self):
        pass

{'repo_name': 'heronsystems/adeptRL', 'stars': '113', 'repo_language': 'Python', 'file_name': 'test_rollout.py', 'mime_type': 'text/x-python', 'hash': 3156563140301728070, 'source_dataset': 'data'}


/*
 * Copyright (C) 2001, 2004, 2011 Free Software Foundation, Inc.
 * This file is part of the GNU LIBICONV Library.
 *
 * The GNU LIBICONV Library is free software; you can redistribute it
 * and/or modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * The GNU LIBICONV Library is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
 * If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA.
 */

/* Combining characters used in Vietnamese encodings CP1258, TCVN. */

#ifndef _VIETCOMB_H
#define _VIETCOMB_H

/* Relevant combining characters:
   0x0300, 0x0301, 0x0303, 0x0309, 0x0323. */

/* Composition tables for each of the relevant combining characters. */
static const struct { unsigned short base; unsigned short composed; } viet_comp_table_data[] = {
#define viet_comp_table0300_idx 0
#define viet_comp_table0300_len 31
  { 0x0041, 0x00C0 },
  { 0x0045, 0x00C8 },
  { 0x0049, 0x00CC },
  { 0x004E, 0x01F8 },
  { 0x004F, 0x00D2 },
  { 0x0055, 0x00D9 },
  { 0x0057, 0x1E80 },
  { 0x0059, 0x1EF2 },
  { 0x0061, 0x00E0 },
  { 0x0065, 0x00E8 },
  { 0x0069, 0x00EC },
  { 0x006E, 0x01F9 },
  { 0x006F, 0x00F2 },
  { 0x0075, 0x00F9 },
  { 0x0077, 0x1E81 },
  { 0x0079, 0x1EF3 },
  { 0x00A8, 0x1FED },
  { 0x00C2, 0x1EA6 },
  { 0x00CA, 0x1EC0 },
  { 0x00D4, 0x1ED2 },
  { 0x00DC, 0x01DB },
  { 0x00E2, 0x1EA7 },
  { 0x00EA, 0x1EC1 },
  { 0x00F4, 0x1ED3 },
  { 0x00FC, 0x01DC },
  { 0x0102, 0x1EB0 },
  { 0x0103, 0x1EB1 },
/*{ 0x0112, 0x1E14 },*/
/*{ 0x0113, 0x1E15 },*/
/*{ 0x014C, 0x1E50 },*/
/*{ 0x014D, 0x1E51 },*/
  { 0x01A0, 0x1EDC },
  { 0x01A1, 0x1EDD },
  { 0x01AF, 0x1EEA },
  { 0x01B0, 0x1EEB },
#define viet_comp_table0301_idx (viet_comp_table0300_idx+viet_comp_table0300_len)
#define viet_comp_table0301_len 63
  { 0x0041, 0x00C1 },
  { 0x0043, 0x0106 },
  { 0x0045, 0x00C9 },
  { 0x0047, 0x01F4 },
  { 0x0049, 0x00CD },
  { 0x004B, 0x1E30 },
  { 0x004C, 0x0139 },
  { 0x004D, 0x1E3E },
  { 0x004E, 0x0143 },
  { 0x004F, 0x00D3 },
  { 0x0050, 0x1E54 },
  { 0x0052, 0x0154 },
  { 0x0053, 0x015A },
  { 0x0055, 0x00DA },
  { 0x0057, 0x1E82 },
  { 0x0059, 0x00DD },
  { 0x005A, 0x0179 },
  { 0x0061, 0x00E1 },
  { 0x0063, 0x0107 },
  { 0x0065, 0x00E9 },
  { 0x0067, 0x01F5 },
  { 0x0069, 0x00ED },
  { 0x006B, 0x1E31 },
  { 0x006C, 0x013A },
  { 0x006D, 0x1E3F },
  { 0x006E, 0x0144 },
  { 0x006F, 0x00F3 },
  { 0x0070, 0x1E55 },
  { 0x0072, 0x0155 },
  { 0x0073, 0x015B },
  { 0x0075, 0x00FA },
  { 0x0077, 0x1E83 },
  { 0x0079, 0x00FD },
  { 0x007A, 0x017A },
  { 0x00A8, 0x0385 }, /* prefer U+0385 over U+1FEE */
  { 0x00C2, 0x1EA4 },
  { 0x00C5, 0x01FA },
  { 0x00C6, 0x01FC },
  { 0x00C7, 0x1E08 },
  { 0x00CA, 0x1EBE },
  { 0x00CF, 0x1E2E },
  { 0x00D4, 0x1ED0 },
  { 0x00D5, 0x1E4C },
  { 0x00D8, 0x01FE },
  { 0x00DC, 0x01D7 },
  { 0x00E2, 0x1EA5 },
  { 0x00E5, 0x01FB },
  { 0x00E6, 0x01FD },
  { 0x00E7, 0x1E09 },
  { 0x00EA, 0x1EBF },
  { 0x00EF, 0x1E2F },
  { 0x00F4, 0x1ED1 },
  { 0x00F5, 0x1E4D },
  { 0x00F8, 0x01FF },
  { 0x00FC, 0x01D8 },
  { 0x0102, 0x1EAE },
  { 0x0103, 0x1EAF },
/*{ 0x0112, 0x1E16 },*/
/*{ 0x0113, 0x1E17 },*/
/*{ 0x014C, 0x1E52 },*/
/*{ 0x014D, 0x1E53 },*/
  { 0x0168, 0x1E78 },
  { 0x0169, 0x1E79 },
  { 0x01A0, 0x1EDA },
  { 0x01A1, 0x1EDB },
  { 0x01AF, 0x1EE8 },
  { 0x01B0, 0x1EE9 },
#define viet_comp_table0303_idx (viet_comp_table0301_idx+viet_comp_table0301_len)
#define viet_comp_table0303_len 34
  { 0x0041, 0x00C3 },
  { 0x0045, 0x1EBC },
  { 0x0049, 0x0128 },
  { 0x004E, 0x00D1 },
  { 0x004F, 0x00D5 },
  { 0x0055, 0x0168 },
  { 0x0056, 0x1E7C },
  { 0x0059, 0x1EF8 },
  { 0x0061, 0x00E3 },
  { 0x0065, 0x1EBD },
  { 0x0069, 0x0129 },
  { 0x006E, 0x00F1 },
  { 0x006F, 0x00F5 },
  { 0x0075, 0x0169 },
  { 0x0076, 0x1E7D },
  { 0x0079, 0x1EF9 },
  { 0x00C2, 0x1EAA },
  { 0x00CA, 0x1EC4 },
  { 0x00D3, 0x1E4C },
  { 0x00D4, 0x1ED6 },
  { 0x00D6, 0x1E4E },
  { 0x00DA, 0x1E78 },
  { 0x00E2, 0x1EAB },
  { 0x00EA, 0x1EC5 },
  { 0x00F3, 0x1E4D },
  { 0x00F4, 0x1ED7 },
  { 0x00F6, 0x1E4F },
  { 0x00FA, 0x1E79 },
  { 0x0102, 0x1EB4 },
  { 0x0103, 0x1EB5 },
  { 0x01A0, 0x1EE0 },
  { 0x01A1, 0x1EE1 },
  { 0x01AF, 0x1EEE },
  { 0x01B0, 0x1EEF },
#define viet_comp_table0309_idx (viet_comp_table0303_idx+viet_comp_table0303_len)
#define viet_comp_table0309_len 24
  { 0x0041, 0x1EA2 },
  { 0x0045, 0x1EBA },
  { 0x0049, 0x1EC8 },
  { 0x004F, 0x1ECE },
  { 0x0055, 0x1EE6 },
  { 0x0059, 0x1EF6 },
  { 0x0061, 0x1EA3 },
  { 0x0065, 0x1EBB },
  { 0x0069, 0x1EC9 },
  { 0x006F, 0x1ECF },
  { 0x0075, 0x1EE7 },
  { 0x0079, 0x1EF7 },
  { 0x00C2, 0x1EA8 },
  { 0x00CA, 0x1EC2 },
  { 0x00D4, 0x1ED4 },
  { 0x00E2, 0x1EA9 },
  { 0x00EA, 0x1EC3 },
  { 0x00F4, 0x1ED5 },
  { 0x0102, 0x1EB2 },
  { 0x0103, 0x1EB3 },
  { 0x01A0, 0x1EDE },
  { 0x01A1, 0x1EDF },
  { 0x01AF, 0x1EEC },
  { 0x01B0, 0x1EED },
#define viet_comp_table0323_idx (viet_comp_table0309_idx+viet_comp_table0309_len)
#define viet_comp_table0323_len 50
  { 0x0041, 0x1EA0 },
  { 0x0042, 0x1E04 },
  { 0x0044, 0x1E0C },
  { 0x0045, 0x1EB8 },
  { 0x0048, 0x1E24 },
  { 0x0049, 0x1ECA },
  { 0x004B, 0x1E32 },
  { 0x004C, 0x1E36 },
  { 0x004D, 0x1E42 },
  { 0x004E, 0x1E46 },
  { 0x004F, 0x1ECC },
  { 0x0052, 0x1E5A },
  { 0x0053, 0x1E62 },
  { 0x0054, 0x1E6C },
  { 0x0055, 0x1EE4 },
  { 0x0056, 0x1E7E },
  { 0x0057, 0x1E88 },
  { 0x0059, 0x1EF4 },
  { 0x005A, 0x1E92 },
  { 0x0061, 0x1EA1 },
  { 0x0062, 0x1E05 },
  { 0x0064, 0x1E0D },
  { 0x0065, 0x1EB9 },
  { 0x0068, 0x1E25 },
  { 0x0069, 0x1ECB },
  { 0x006B, 0x1E33 },
  { 0x006C, 0x1E37 },
  { 0x006D, 0x1E43 },
  { 0x006E, 0x1E47 },
  { 0x006F, 0x1ECD },
  { 0x0072, 0x1E5B },
  { 0x0073, 0x1E63 },
  { 0x0074, 0x1E6D },
  { 0x0075, 0x1EE5 },
  { 0x0076, 0x1E7F },
  { 0x0077, 0x1E89 },
  { 0x0079, 0x1EF5 },
  { 0x007A, 0x1E93 },
  { 0x00C2, 0x1EAC },
  { 0x00CA, 0x1EC6 },
  { 0x00D4, 0x1ED8 },
  { 0x00E2, 0x1EAD },
  { 0x00EA, 0x1EC7 },
  { 0x00F4, 0x1ED9 },
  { 0x0102, 0x1EB6 },
  { 0x0103, 0x1EB7 },
  { 0x01A0, 0x1EE2 },
  { 0x01A1, 0x1EE3 },
  { 0x01AF, 0x1EF0 },
  { 0x01B0, 0x1EF1 },
};
static const struct { unsigned int len; unsigned int idx; } viet_comp_table[] = {
  { viet_comp_table0300_len, viet_comp_table0300_idx },
  { viet_comp_table0301_len, viet_comp_table0301_idx },
  { viet_comp_table0303_len, viet_comp_table0303_idx },
  { viet_comp_table0309_len, viet_comp_table0309_idx },
  { viet_comp_table0323_len, viet_comp_table0323_idx },
};

/* Decomposition table for the relevant Unicode characters. */
struct viet_decomp { unsigned short composed; unsigned int base : 12; int comb1 : 4; };
static const struct viet_decomp viet_decomp_table[] = {
  { 0x00B4, 0x0020, 1 }, /* compatibility decomposition - for TCVN only */
  { 0x00C0, 0x0041, 0 },
  { 0x00C1, 0x0041, 1 },
  { 0x00C3, 0x0041, 2 },
  { 0x00C8, 0x0045, 0 },
  { 0x00C9, 0x0045, 1 },
  { 0x00CC, 0x0049, 0 },
  { 0x00CD, 0x0049, 1 },
  { 0x00D1, 0x004E, 2 },
  { 0x00D2, 0x004F, 0 },
  { 0x00D3, 0x004F, 1 },
  { 0x00D5, 0x004F, 2 },
  { 0x00D9, 0x0055, 0 },
  { 0x00DA, 0x0055, 1 },
  { 0x00DD, 0x0059, 1 },
  { 0x00E0, 0x0061, 0 },
  { 0x00E1, 0x0061, 1 },
  { 0x00E3, 0x0061, 2 },
  { 0x00E8, 0x0065, 0 },
  { 0x00E9, 0x0065, 1 },
  { 0x00EC, 0x0069, 0 },
  { 0x00ED, 0x0069, 1 },
  { 0x00F1, 0x006E, 2 },
  { 0x00F2, 0x006F, 0 },
  { 0x00F3, 0x006F, 1 },
  { 0x00F5, 0x006F, 2 },
  { 0x00F9, 0x0075, 0 },
  { 0x00FA, 0x0075, 1 },
  { 0x00FD, 0x0079, 1 },
  { 0x0106, 0x0043, 1 },
  { 0x0107, 0x0063, 1 },
  { 0x0128, 0x0049, 2 },
  { 0x0129, 0x0069, 2 },
  { 0x0139, 0x004C, 1 },
  { 0x013A, 0x006C, 1 },
  { 0x0143, 0x004E, 1 },
  { 0x0144, 0x006E, 1 },
  { 0x0154, 0x0052, 1 },
  { 0x0155, 0x0072, 1 },
  { 0x015A, 0x0053, 1 },
  { 0x015B, 0x0073, 1 },
  { 0x0168, 0x0055, 2 },
  { 0x0169, 0x0075, 2 },
  { 0x0179, 0x005A, 1 },
  { 0x017A, 0x007A, 1 },
  { 0x01D7, 0x00DC, 1 },
  { 0x01D8, 0x00FC, 1 },
  { 0x01DB, 0x00DC, 0 },
  { 0x01DC, 0x00FC, 0 },
  { 0x01F4, 0x0047, 1 },
  { 0x01F5, 0x0067, 1 },
  { 0x01F8, 0x004E, 0 },
  { 0x01F9, 0x006E, 0 },
  { 0x01FA, 0x00C5, 1 },
  { 0x01FB, 0x00E5, 1 },
  { 0x01FC, 0x00C6, 1 },
  { 0x01FD, 0x00E6, 1 },
  { 0x01FE, 0x00D8, 1 },
  { 0x01FF, 0x00F8, 1 },
  { 0x02DC, 0x0020, 2 }, /* compatibility decomposition - for TCVN only */
  { 0x0385, 0x00A8, 1 },
  { 0x1E04, 0x0042, 4 },
  { 0x1E05, 0x0062, 4 },
  { 0x1E08, 0x00C7, 1 },
  { 0x1E09, 0x00E7, 1 },
  { 0x1E0C, 0x0044, 4 },
  { 0x1E0D, 0x0064, 4 },
  { 0x1E24, 0x0048, 4 },
  { 0x1E25, 0x0068, 4 },
  { 0x1E2E, 0x00CF, 1 },
  { 0x1E2F, 0x00EF, 1 },
  { 0x1E30, 0x004B, 1 },
  { 0x1E31, 0x006B, 1 },
  { 0x1E32, 0x004B, 4 },
  { 0x1E33, 0x006B, 4 },
  { 0x1E36, 0x004C, 4 },
  { 0x1E37, 0x006C, 4 },
  { 0x1E3E, 0x004D, 1 },
  { 0x1E3F, 0x006D, 1 },
  { 0x1E42, 0x004D, 4 },
  { 0x1E43, 0x006D, 4 },
  { 0x1E46, 0x004E, 4 },
  { 0x1E47, 0x006E, 4 },
  { 0x1E4C, 0x00D3, 2 }, /*{ 0x1E4C, 0x00D5, 1 },*/ /*{ 0x1E4C, 0x004F, 1, 2 },*/
  { 0x1E4D, 0x00F3, 2 }, /*{ 0x1E4D, 0x00F5, 1 },*/ /*{ 0x1E4D, 0x006F, 1, 2 },*/
  { 0x1E4E, 0x00D6, 2 },
  { 0x1E4F, 0x00F6, 2 },
  { 0x1E54, 0x0050, 1 },
  { 0x1E55, 0x0070, 1 },
  { 0x1E5A, 0x0052, 4 },
  { 0x1E5B, 0x0072, 4 },
  { 0x1E62, 0x0053, 4 },
  { 0x1E63, 0x0073, 4 },
  { 0x1E6C, 0x0054, 4 },
  { 0x1E6D, 0x0074, 4 },
  { 0x1E78, 0x00DA, 2 }, /*{ 0x1E78, 0x0168, 1 },*/ /*{ 0x1E78, 0x0055, 1, 2 },*/
  { 0x1E79, 0x00FA, 2 }, /*{ 0x1E79, 0x0169, 1 },*/ /*{ 0x1E79, 0x0075, 1, 2 },*/
  { 0x1E7C, 0x0056, 2 },
  { 0x1E7D, 0x0076, 2 },
  { 0x1E7E, 0x0056, 4 },
  { 0x1E7F, 0x0076, 4 },
  { 0x1E80, 0x0057, 0 },
  { 0x1E81, 0x0077, 0 },
  { 0x1E82, 0x0057, 1 },
  { 0x1E83, 0x0077, 1 },
  { 0x1E88, 0x0057, 4 },
  { 0x1E89, 0x0077, 4 },
  { 0x1E92, 0x005A, 4 },
  { 0x1E93, 0x007A, 4 },
  { 0x1EA0, 0x0041, 4 },
  { 0x1EA1, 0x0061, 4 },
  { 0x1EA2, 0x0041, 3 },
  { 0x1EA3, 0x0061, 3 },
  { 0x1EA4, 0x00C2, 1 },
  { 0x1EA5, 0x00E2, 1 },
  { 0x1EA6, 0x00C2, 0 },
  { 0x1EA7, 0x00E2, 0 },
  { 0x1EA8, 0x00C2, 3 },
  { 0x1EA9, 0x00E2, 3 },
  { 0x1EAA, 0x00C2, 2 },
  { 0x1EAB, 0x00E2, 2 },
  { 0x1EAC, 0x00C2, 4 },
  { 0x1EAD, 0x00E2, 4 },
  { 0x1EAE, 0x0102, 1 },
  { 0x1EAF, 0x0103, 1 },
  { 0x1EB0, 0x0102, 0 },
  { 0x1EB1, 0x0103, 0 },
  { 0x1EB2, 0x0102, 3 },
  { 0x1EB3, 0x0103, 3 },
  { 0x1EB4, 0x0102, 2 },
  { 0x1EB5, 0x0103, 2 },
  { 0x1EB6, 0x0102, 4 },
  { 0x1EB7, 0x0103, 4 },
  { 0x1EB8, 0x0045, 4 },
  { 0x1EB9, 0x0065, 4 },
  { 0x1EBA, 0x0045, 3 },
  { 0x1EBB, 0x0065, 3 },
  { 0x1EBC, 0x0045, 2 },
  { 0x1EBD, 0x0065, 2 },
  { 0x1EBE, 0x00CA, 1 },
  { 0x1EBF, 0x00EA, 1 },
  { 0x1EC0, 0x00CA, 0 },
  { 0x1EC1, 0x00EA, 0 },
  { 0x1EC2, 0x00CA, 3 },
  { 0x1EC3, 0x00EA, 3 },
  { 0x1EC4, 0x00CA, 2 },
  { 0x1EC5, 0x00EA, 2 },
  { 0x1EC6, 0x00CA, 4 },
  { 0x1EC7, 0x00EA, 4 },
  { 0x1EC8, 0x0049, 3 },
  { 0x1EC9, 0x0069, 3 },
  { 0x1ECA, 0x0049, 4 },
  { 0x1ECB, 0x0069, 4 },
  { 0x1ECC, 0x004F, 4 },
  { 0x1ECD, 0x006F, 4 },
  { 0x1ECE, 0x004F, 3 },
  { 0x1ECF, 0x006F, 3 },
  { 0x1ED0, 0x00D4, 1 },
  { 0x1ED1, 0x00F4, 1 },
  { 0x1ED2, 0x00D4, 0 },
  { 0x1ED3, 0x00F4, 0 },
  { 0x1ED4, 0x00D4, 3 },
  { 0x1ED5, 0x00F4, 3 },
  { 0x1ED6, 0x00D4, 2 },
  { 0x1ED7, 0x00F4, 2 },
  { 0x1ED8, 0x00D4, 4 },
  { 0x1ED9, 0x00F4, 4 },
  { 0x1EDA, 0x01A0, 1 },
  { 0x1EDB, 0x01A1, 1 },
  { 0x1EDC, 0x01A0, 0 },
  { 0x1EDD, 0x01A1, 0 },
  { 0x1EDE, 0x01A0, 3 },
  { 0x1EDF, 0x01A1, 3 },
  { 0x1EE0, 0x01A0, 2 },
  { 0x1EE1, 0x01A1, 2 },
  { 0x1EE2, 0x01A0, 4 },
  { 0x1EE3, 0x01A1, 4 },
  { 0x1EE4, 0x0055, 4 },
  { 0x1EE5, 0x0075, 4 },
  { 0x1EE6, 0x0055, 3 },
  { 0x1EE7, 0x0075, 3 },
  { 0x1EE8, 0x01AF, 1 },
  { 0x1EE9, 0x01B0, 1 },
  { 0x1EEA, 0x01AF, 0 },
  { 0x1EEB, 0x01B0, 0 },
  { 0x1EEC, 0x01AF, 3 },
  { 0x1EED, 0x01B0, 3 },
  { 0x1EEE, 0x01AF, 2 },
  { 0x1EEF, 0x01B0, 2 },
  { 0x1EF0, 0x01AF, 4 },
  { 0x1EF1, 0x01B0, 4 },
  { 0x1EF2, 0x0059, 0 },
  { 0x1EF3, 0x0079, 0 },
  { 0x1EF4, 0x0059, 4 },
  { 0x1EF5, 0x0079, 4 },
  { 0x1EF6, 0x0059, 3 },
  { 0x1EF7, 0x0079, 3 },
  { 0x1EF8, 0x0059, 2 },
  { 0x1EF9, 0x0079, 2 },
  { 0x1FED, 0x00A8, 0 },
  { 0x1FEE, 0x00A8, 1 }, /* U+1FEE => U+0385 => U+00A8 U+0301 */
};

#endif /* _VIETCOMB_H */

{'repo_name': 'rizzoma/rizzoma', 'stars': '114', 'repo_language': 'CoffeeScript', 'file_name': 'sphinxsearch', 'mime_type': 'text/plain', 'hash': 1244045455749493406, 'source_dataset': 'data'}