text:
HANDLE write_mutex;

int prepare_concurrent_bufs(void);

#include "vmprof_common.h"
#include <tlhelp32.h>

// This file has been inspired (but not copied from since the LICENSE
// would not allow it) from verysleepy profiler

volatile int thread_started = 0;
volatile int enabled = 0;

int vmp_write_all(const char *buf, size_t bufsize);

#ifdef RPYTHON_VMPROF
typedef struct pypy_threadlocal_s PY_WIN_THREAD_STATE;
#else
typedef PyThreadState PY_WIN_THREAD_STATE;
#endif

RPY_EXTERN
int vmprof_register_virtual_function(char *code_name, intptr_t code_uid,
                                     int auto_retry)
{
    char buf[2048];
    long namelen;

    namelen = (long)strnlen(code_name, 1023);
    buf[0] = MARKER_VIRTUAL_IP;
    *(intptr_t*)(buf + 1) = code_uid;
    *(long*)(buf + 1 + sizeof(intptr_t)) = namelen;
    memcpy(buf + 1 + sizeof(intptr_t) + sizeof(long), code_name, namelen);
    vmp_write_all(buf, 1 + sizeof(intptr_t) + sizeof(long) + namelen);
    return 0;
}

int vmprof_snapshot_thread(DWORD thread_id, PY_WIN_THREAD_STATE *tstate, prof_stacktrace_s *stack)
{
    HRESULT result;
    HANDLE hThread;
    int depth;
    CONTEXT ctx;
#ifdef RPYTHON_LL2CTYPES
    return 0; // not much we can do
#else
#if !defined(RPY_TLOFS_thread_ident) && defined(RPYTHON_VMPROF)
    return 0; // we can't freeze threads, unsafe
#else
    hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id);
    if (!hThread) {
        return -1;
    }
    result = SuspendThread(hThread);
    if(result == 0xffffffff)
        return -1; // possible, e.g. attached debugger or thread alread suspended
    // find the correct thread
#ifdef RPYTHON_VMPROF
    ctx.ContextFlags = CONTEXT_FULL;
    if (!GetThreadContext(hThread, &ctx))
        return -1;
    depth = get_stack_trace(tstate->vmprof_tl_stack,
                     stack->stack, MAX_STACK_DEPTH-2, ctx.Eip);
    stack->depth = depth;
    stack->stack[depth++] = thread_id;
    stack->count = 1;
    stack->marker = MARKER_STACKTRACE;
    ResumeThread(hThread);
    return depth;
#else
    depth = vmp_walk_and_record_stack(tstate->frame, stack->stack,
                                      MAX_STACK_DEPTH, 0, 0);
    stack->depth = depth;
    stack->stack[depth++] = (void*)((ULONG_PTR)thread_id);
    stack->count = 1;
    stack->marker = MARKER_STACKTRACE;
    ResumeThread(hThread);
    return depth;
#endif

#endif
#endif
}

#ifndef RPYTHON_VMPROF
static
PY_WIN_THREAD_STATE * get_current_thread_state(void)
{
#if PY_MAJOR_VERSION < 3
    return _PyThreadState_Current;
#elif PY_VERSION_HEX < 0x03050200
    return (PyThreadState*) _Py_atomic_load_relaxed(&_PyThreadState_Current);
#else
    return _PyThreadState_UncheckedGet();
#endif
}
#endif

long __stdcall vmprof_mainloop(void *arg)
{
#ifdef RPYTHON_LL2CTYPES
    // for tests only
    return 0;
#else
    // it is not a test case!
    PY_WIN_THREAD_STATE *tstate;
    HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
    prof_stacktrace_s *stack = (prof_stacktrace_s*)malloc(SINGLE_BUF_SIZE);
    int depth;
#ifndef RPYTHON_VMPROF
    // cpython version
    while (1) {
        Sleep(profile_interval_usec * 1000);
        if (!enabled) {
            continue;
        }
        tstate = get_current_thread_state();
        if (!tstate)
            continue;
        depth = vmprof_snapshot_thread(tstate->thread_id, tstate, stack);
        if (depth > 0) {
            vmp_write_all((char*)stack + offsetof(prof_stacktrace_s, marker),
                          SIZEOF_PROF_STACKTRACE + depth * sizeof(void*));
        }
    }
#else
    // pypy version
    while (1) {
        //Sleep(profile_interval_usec * 1000);
        Sleep(10);
        if (!enabled) {
            continue;
        }
        _RPython_ThreadLocals_Acquire();
        tstate = _RPython_ThreadLocals_Head(); // the first one is one behind head
        tstate = _RPython_ThreadLocals_Enum(tstate);
        while (tstate) {
            if (tstate->ready == 42) {
                depth = vmprof_snapshot_thread(tstate->thread_ident, tstate, stack);
                if (depth > 0) {
                    vmp_write_all((char*)stack + offsetof(prof_stacktrace_s, marker),
                         depth * sizeof(void *) +
                         sizeof(struct prof_stacktrace_s) -
                         offsetof(struct prof_stacktrace_s, marker));
                }
            }
            tstate = _RPython_ThreadLocals_Enum(tstate);
        }
        _RPython_ThreadLocals_Release();
    }
#endif
#endif
}

RPY_EXTERN
int vmprof_enable(int memory, int native)
{
    if (!thread_started) {
        if (!CreateThread(NULL, 0, vmprof_mainloop, NULL, 0, NULL)) {
            return -1;
        }
        thread_started = 1;
    }
    enabled = 1;
    return 0;
}

RPY_EXTERN
int vmprof_disable(void)
{
    char marker = MARKER_TRAILER;
    (void)vmp_write_time_now(MARKER_TRAILER);

    enabled = 0;
    vmp_set_profile_fileno(-1);
    return 0;
}

RPY_EXTERN
void vmprof_ignore_signals(int ignored)
{
    enabled = !ignored;
}

int vmp_native_enable(void) {
    return 0;
}

void vmp_native_disable(void) {
}

int get_stack_trace(PY_WIN_THREAD_STATE * current, void** result,
		    int max_depth, intptr_t pc)
{
    return 0;
}


text:
//===--- PrintSwiftToClangCoreScaffold.cpp - Print core decls ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#include "PrintSwiftToClangCoreScaffold.h"
#include "ClangSyntaxPrinter.h"
#include "PrimitiveTypeMapping.h"
#include "SwiftToClangInteropContext.h"
#include "swift/ABI/MetadataValues.h"
#include "swift/AST/Decl.h"
#include "swift/AST/Type.h"
#include "swift/IRGen/IRABIDetailsProvider.h"
#include "swift/IRGen/Linking.h"
#include "llvm/ADT/STLExtras.h"

using namespace swift;

static void printKnownCType(Type t, PrimitiveTypeMapping &typeMapping,
                            raw_ostream &os) {
  auto info =
      typeMapping.getKnownCTypeInfo(t->getNominalOrBoundGenericNominal());
  assert(info.hasValue() && "not a known type");
  os << info->name;
  if (info->canBeNullable)
    os << " _Null_unspecified";
}

static void printKnownStruct(
    PrimitiveTypeMapping &typeMapping, raw_ostream &os, StringRef name,
    const IRABIDetailsProvider::TypeRecordABIRepresentation &typeRecord) {
  assert(typeRecord.getMembers().size() > 1);
  os << "struct " << name << " {\n";
  for (const auto &ty : llvm::enumerate(typeRecord.getMembers())) {
    os << "  ";
    printKnownCType(ty.value(), typeMapping, os);
    os << " _" << ty.index() << ";\n";
  }
  os << "};\n";
}

static void printKnownTypedef(
    PrimitiveTypeMapping &typeMapping, raw_ostream &os, StringRef name,
    const IRABIDetailsProvider::TypeRecordABIRepresentation &typeRecord) {
  assert(typeRecord.getMembers().size() == 1);
  os << "typedef ";
  printKnownCType(typeRecord.getMembers()[0], typeMapping, os);
  os << " " << name << ";\n";
}

static void printKnownType(
    PrimitiveTypeMapping &typeMapping, raw_ostream &os, StringRef name,
    const IRABIDetailsProvider::TypeRecordABIRepresentation &typeRecord) {
  if (typeRecord.getMembers().size() == 1)
    return printKnownTypedef(typeMapping, os, name, typeRecord);
  printKnownStruct(typeMapping, os, name, typeRecord);
}

static void
printValueWitnessTableFunctionType(raw_ostream &os, StringRef prefix,
                                   StringRef name, StringRef returnType,
                                   std::string paramTypes,
                                   uint16_t ptrauthDisc) {
  os << "using " << prefix << name << "Ty = " << returnType
     << "(* __ptrauth_swift_value_witness_function_pointer(" << ptrauthDisc
     << "))(" << paramTypes << ") SWIFT_NOEXCEPT_FUNCTION_PTR;\n";
}

static std::string makeParams(const char *arg) { return arg; }

template <class... T>
static std::string makeParams(const char *arg, const T... args) {
  return std::string(arg) + ", " + makeParams(args...);
}

static void printValueWitnessTable(raw_ostream &os) {
  std::string members;
  llvm::raw_string_ostream membersOS(members);

  // C++ only supports noexcept on `using` function types in C++17.
  os << "#if __cplusplus > 201402L\n";
  os << "#  define SWIFT_NOEXCEPT_FUNCTION_PTR noexcept\n";
  os << "#else\n";
  os << "#  define SWIFT_NOEXCEPT_FUNCTION_PTR\n";
  os << "#endif\n\n";

#define WANT_ONLY_REQUIRED_VALUE_WITNESSES
#define DATA_VALUE_WITNESS(lowerId, upperId, type)                             \
  membersOS << "  " << type << " " << #lowerId << ";\n";
#define FUNCTION_VALUE_WITNESS(lowerId, upperId, returnType, paramTypes)       \
  printValueWitnessTableFunctionType(                                          \
      os, "ValueWitness", #upperId, returnType, makeParams paramTypes,         \
      SpecialPointerAuthDiscriminators::upperId);                              \
  membersOS << "  ValueWitness" << #upperId << "Ty _Nonnull " << #lowerId      \
            << ";\n";
#define MUTABLE_VALUE_TYPE "void * _Nonnull"
#define IMMUTABLE_VALUE_TYPE "const void * _Nonnull"
#define MUTABLE_BUFFER_TYPE "void * _Nonnull"
#define IMMUTABLE_BUFFER_TYPE "const void * _Nonnull"
#define TYPE_TYPE "void * _Nonnull"
#define SIZE_TYPE "size_t"
#define INT_TYPE "int"
#define UINT_TYPE "unsigned"
#define VOID_TYPE "void"
#include "swift/ABI/ValueWitness.def"

  membersOS << "\n  constexpr size_t getAlignment() const { return (flags & "
            << TargetValueWitnessFlags<uint64_t>::AlignmentMask << ") + 1; }\n";
  os << "\nstruct ValueWitnessTable {\n" << membersOS.str() << "};\n\n";
  membersOS.str().clear();

#define WANT_ONLY_ENUM_VALUE_WITNESSES
#define DATA_VALUE_WITNESS(lowerId, upperId, type)                             \
  membersOS << "  " << type << " " << #lowerId << ";\n";
#define FUNCTION_VALUE_WITNESS(lowerId, upperId, returnType, paramTypes)       \
  printValueWitnessTableFunctionType(                                          \
      os, "EnumValueWitness", #upperId, returnType, makeParams paramTypes,     \
      SpecialPointerAuthDiscriminators::upperId);                              \
  membersOS << "  EnumValueWitness" << #upperId << "Ty _Nonnull " << #lowerId  \
            << ";\n";
#define MUTABLE_VALUE_TYPE "void * _Nonnull"
#define IMMUTABLE_VALUE_TYPE "const void * _Nonnull"
#define MUTABLE_BUFFER_TYPE "void * _Nonnull"
#define IMMUTABLE_BUFFER_TYPE "const void * _Nonnull"
#define TYPE_TYPE "void * _Nonnull"
#define SIZE_TYPE "size_t"
#define INT_TYPE "int"
#define UINT_TYPE "unsigned"
#define VOID_TYPE "void"
#include "swift/ABI/ValueWitness.def"

  os << "\nstruct EnumValueWitnessTable {\n"
     << "  ValueWitnessTable vwTable;\n"
     << membersOS.str() << "};\n\n";

  os << "#undef SWIFT_NOEXCEPT_FUNCTION_PTR\n\n";
}

static void printTypeMetadataResponseType(SwiftToClangInteropContext &ctx,
                                          PrimitiveTypeMapping &typeMapping,
                                          raw_ostream &os) {
  os << "// Swift type metadata response type.\n";
  // Print out the type metadata structure.
  auto funcSig = ctx.getIrABIDetails().getTypeMetadataAccessFunctionSignature();
  printKnownType(typeMapping, os, "MetadataResponseTy", funcSig.returnType);
  assert(funcSig.parameterTypes.size() == 1);
  os << "// Swift type metadata request type.\n";
  printKnownType(typeMapping, os, "MetadataRequestTy",
                 funcSig.parameterTypes[0]);
}

void printCxxNaiveException(raw_ostream &os) {
  os << "/// Naive exception class that should be thrown\n";
  os << "class NaiveException {\n";
  os << "public:\n";
  os << "  inline NaiveException(const char * _Nonnull msg) noexcept : "
     << "msg_(msg) { }\n";
  os << "  inline NaiveException(NaiveException&& other) noexcept : "
        "msg_(other.msg_) { other.msg_ = nullptr; }\n";
  os << "  inline ~NaiveException() noexcept { }\n";
  os << "  void operator =(NaiveException&& other) noexcept { auto temp = msg_;"
     << " msg_ = other.msg_; other.msg_ = temp; }\n";
  os << "  void operator =(const NaiveException&) noexcept = delete;";
  os << "\n";
  os << "  inline const char * _Nonnull getMessage() const noexcept { "
     << "return(msg_); }\n";
  os << "private:\n";
  os << "  const char * _Nonnull msg_;\n";
  os << "};\n";
}

void printPrimitiveGenericTypeTraits(raw_ostream &os, ASTContext &astContext,
                                     PrimitiveTypeMapping &typeMapping,
                                     bool isCForwardDefinition) {
  Type supportedPrimitiveTypes[] = {
      astContext.getBoolType(),

      // Primitive integer, C integer and Int/UInt mappings.
      astContext.getInt8Type(), astContext.getUInt8Type(),
      astContext.getInt16Type(), astContext.getUInt16Type(),
      astContext.getInt32Type(), astContext.getUInt32Type(),
      astContext.getInt64Type(), astContext.getUInt64Type(),

      // Primitive floating point type mappings.
      astContext.getFloatType(), astContext.getDoubleType(),

      // Pointer types.
      // FIXME: support raw pointers?
      astContext.getOpaquePointerType()};

  for (Type type : llvm::makeArrayRef(supportedPrimitiveTypes)) {
    auto typeInfo = *typeMapping.getKnownCxxTypeInfo(
        type->getNominalOrBoundGenericNominal());

    auto typeMetadataFunc = irgen::LinkEntity::forTypeMetadata(
        type->getCanonicalType(), irgen::TypeMetadataAddress::AddressPoint);
    std::string typeMetadataVarName = typeMetadataFunc.mangleAsString();

    if (isCForwardDefinition) {
      os << "// type metadata address for " << type.getString() << ".\n";
      os << "SWIFT_IMPORT_STDLIB_SYMBOL extern size_t " << typeMetadataVarName
         << ";\n";
      continue;
    }

    os << "template<>\n";
    os << "static inline const constexpr bool isUsableInGenericContext<"
       << typeInfo.name << "> = true;\n\n";

    os << "template<>\ninline void * _Nonnull getTypeMetadata<";
    os << typeInfo.name << ">() {\n";
    os << "  return &" << cxx_synthesis::getCxxImplNamespaceName()
       << "::" << typeMetadataVarName << ";\n";
    os << "}\n\n";
  }
}

void swift::printSwiftToClangCoreScaffold(SwiftToClangInteropContext &ctx,
                                          ASTContext &astContext,
                                          PrimitiveTypeMapping &typeMapping,
                                          raw_ostream &os) {
  ClangSyntaxPrinter printer(os);
  printer.printNamespace("swift", [&](raw_ostream &) {
    printer.printNamespace(
        cxx_synthesis::getCxxImplNamespaceName(), [&](raw_ostream &) {
          printer.printExternC([&](raw_ostream &os) {
            printTypeMetadataResponseType(ctx, typeMapping, os);
            os << "\n";
            printValueWitnessTable(os);
            os << "\n";
            printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
                                            /*isCForwardDefinition=*/true);
          });
          os << "\n";
          printCxxNaiveException(os);
        });
    os << "\n";
    // C++ only supports inline variables from C++17.
    // FIXME: silence the warning instead?
    os << "#if __cplusplus > 201402L\n";
    printPrimitiveGenericTypeTraits(os, astContext, typeMapping,
                                    /*isCForwardDefinition=*/false);
    os << "#endif\n";
  });
}

redpajama_set_name: RedPajamaGithub


text:
import React, { Component } from 'react'
import Map from '../Map/Map.js'
import Header from '../Header'
import { connect } from 'react-redux';
//Container for mentor result
const mapStateToProps = ({ mentors }) => ({mentors});

@connect(mapStateToProps)

class MapContainer extends Component {
  render() {
    return (
      <div>
        <Header
        style={{backgroundImage: 'url('+'../images/navbar-background.jpg'+')'}} />
        <Map
        mentors={this.props.mentors}/>
      </div>
    )
  }
}
export default MapContainer


text:
package negocio;

import impbd.FilmeDaoDB;
import impbd.IngressoDaoDB;
import java.util.ArrayList;
import java.util.List;
import model.Filme;
import model.Ingresso;
import util.ExceptionUtil;
import dao.IFilme;
import dao.IIngresso;

/**
 *
 * @author gabrielgrs
 */
public class IngressosNegocio {
    private IIngresso ingressoDao;

    public IngressosNegocio(){
        ingressoDao = new IngressoDaoDB();
    }

    public void salvar(Ingresso ingresso) throws ExceptionUtil {
        validar(ingresso);
        ingressoDao.salvar(ingresso);
    }

    public List<Ingresso> listar() {
        return (ingressoDao.listar());
    }

    public void deletar(Ingresso ingresso) throws ExceptionUtil {
        if (ingresso == null) {
            throw new ExceptionUtil("Ingresso inválido!");
        }
        ingressoDao.deletar(ingresso);
    }

    public void atualizar(Ingresso ingresso) throws ExceptionUtil {
        if (ingresso == null) {
            throw new ExceptionUtil("Ingresso inválido!");
        }
        validar(ingresso);
        ingressoDao.atualizar(ingresso);
    }

    public Ingresso procurarPorCodigo(int codigo) throws ExceptionUtil {
        return null;
    }

    private void validar(Ingresso ingresso) throws ExceptionUtil {
        if (ingresso.getSessao() == null) {
            throw new ExceptionUtil("Sessao é um campo obrigatório");
        }
    }
}


text:
module WellsFargo
  class Element
    class Payroll < WellsFargo::Element
      attribute :prd_end_date
      attribute :prd_begin_date

      child :exemptions
      child :message
      child :additional_details
      child :earnings
      child :earnings_total
      child :deductions
      child :deductions_total
      child :account_reporting
      child :ref_info
    end
  end
end


text:
This Alfred workflow is a shortcut that focuses on either nvAlt or a search or a new note prefixed with a date.

When I take notes, my notes end up in one of three formats:

- *Title*
- [Date]
- [Date] *Title*

I realized I wanted a workflow that would shortcut this process. If you're using nvALT you'll notice there's no easy keyboard shortcut to sort by date versus by title.

I started adding dates to note titles to keep a consistent sort to content. This was essentially an easy way to chronologically log notes. E.g. "Where are my notes from that meeting on Monday?"

# Alfred Commands

1.  \> ```nv```
    **Result** Brings up nvAlt

2. \> ```nv Hello World```
  **Result** Brings up nvAlt with a search "Hello World"
    ![Hello World](nv.png "Searching for Hello World")
  **Brings up**
    ![Hello World](nv-hello-w.png "Result for Hello World")

-----

1. \> ```nd```
    **Result** Brings up nvAlt with today's agenda on it. If you're like me, you like to make a lightweight agenda for your day in nvALT. It's fast and easy to read, unlike my outlook calendar!

4. \> ```nd Hello World```
  **Result** Brings up nvAlt with a search on today's date and "Hello World"
    ![Hello World](nd-hello.png "Searching for Hello World prefixed by today's date")
    **Turns into**
    ![Hello World](nd-hello-q.png "Result for Hello World prefixed by today's date")

Note: Dates are in format "%m.%d" because I typically don't write dates like this in my notes.

# Credits / Inspiration

- Zoom Icon <http://thenounproject.com/term/zoom/15441/>
- nvALT <http://brettterpstra.com/projects/nvalt/>
- nvAlt Search Workflow by fruityh1g <http://bit.ly/1bBQttg>

I can be found at <http://frankc.net> and on [twitter](https://twitter.com/frankc)


text:
layout: title
title: {{ site.name }}
---

Purpose

    This site was created to allow BYU CS students to gather and disseminate information for other students. It was pointed out that unless resources were available on the official BYU CS website, students were left to find questions to answers on the 100 Hour Board, ask other students via social media, or searching the Internet. A Slack team was recently started, but for static content, a website seemed appropriate.

How you can help

    Any one can fork this website, modify it, and submit pull requests to share information. At the moment, we've started with listing course descriptions that give a better idea of what technologies a course uses, what the projects are like, etc. If you have an idea of something that should be easy to find or that BYU CS students should know, pass it along and help the future generations of the program.

Wiki

    For now, we've decided to use the the byu-cs wiki to share information because it's easier to edit markup than HTML.  Feel free to contribute what you know.  Your insights can help many future generations of nerds and hackers...


text:
package main

import (
	"bufio"
	"flag"
	"fmt"
	"os"
	"path/filepath"
	"strings"
)

var out = flag.String("out", ".", "Path to a directory where the outputs will be written")

// Read newline-separated symbols from a file, ignoring any comments started
// with '#'.
func readSymbols(path string) ([]string, error) {
	f, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer f.Close()
	scanner := bufio.NewScanner(f)
	var ret []string
	for scanner.Scan() {
		line := scanner.Text()
		if idx := strings.IndexByte(line, '#'); idx >= 0 {
			line = line[:idx]
		}
		line = strings.TrimSpace(line)
		if len(line) == 0 {
			continue
		}
		ret = append(ret, line)
	}
	if err := scanner.Err(); err != nil {
		return nil, err
	}
	return ret, nil
}

func writeCHeader(symbols []string, path string) error {
	f, err := os.Create(path)
	if err != nil {
		return err
	}
	defer f.Close()

	if _, err := f.WriteString(`// Copyright (c) 2018, Google Inc.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

// BORINGSSL_ADD_PREFIX pastes two identifiers into one. It performs one
// iteration of macro expansion on its arguments before pasting.
#define BORINGSSL_ADD_PREFIX(a, b) BORINGSSL_ADD_PREFIX_INNER(a, b)
#define BORINGSSL_ADD_PREFIX_INNER(a, b) a ## _ ## b

`); err != nil {
		return err
	}

	for _, symbol := range symbols {
		if _, err := fmt.Fprintf(f, "#define %s BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, %s)\n", symbol, symbol); err != nil {
			return err
		}
	}

	return nil
}

func writeASMHeader(symbols []string, path string) error {
	f, err := os.Create(path)
	if err != nil {
		return err
	}
	defer f.Close()

	if _, err := f.WriteString(`// Copyright (c) 2018, Google Inc.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

#if !defined(__APPLE__)
#include <boringssl_prefix_symbols.h>
#else
// On iOS and macOS, we need to treat assembly symbols differently from other
// symbols. The linker expects symbols to be prefixed with an underscore.
// Perlasm thus generates symbol with this underscore applied. Our macros must,
// in turn, incorporate it.
#define BORINGSSL_ADD_PREFIX_MAC_ASM(a, b) BORINGSSL_ADD_PREFIX_INNER_MAC_ASM(a, b)
#define BORINGSSL_ADD_PREFIX_INNER_MAC_ASM(a, b) _ ## a ## _ ## b

`); err != nil {
		return err
	}

	for _, symbol := range symbols {
		if _, err := fmt.Fprintf(f, "#define _%s BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, %s)\n", symbol, symbol); err != nil {
			return err
		}
	}

	_, err = fmt.Fprintf(f, "#endif\n")
	return nil
}

func writeNASMHeader(symbols []string, path string) error {
	f, err := os.Create(path)
	if err != nil {
		return err
	}
	defer f.Close()

	// NASM uses a different syntax from the C preprocessor.
	if _, err := f.WriteString(`; Copyright (c) 2018, Google Inc.
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
; SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
; OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

; 32-bit Windows adds underscores to C functions, while 64-bit Windows does not.
%ifidn __OUTPUT_FORMAT__, win32
`); err != nil {
		return err
	}

	for _, symbol := range symbols {
		if _, err := fmt.Fprintf(f, "%%xdefine _%s _ %%+ BORINGSSL_PREFIX %%+ _%s\n", symbol, symbol); err != nil {
			return err
		}
	}

	if _, err := fmt.Fprintf(f, "%%else\n"); err != nil {
		return err
	}

	for _, symbol := range symbols {
		if _, err := fmt.Fprintf(f, "%%xdefine %s BORINGSSL_PREFIX %%+ _%s\n", symbol, symbol); err != nil {
			return err
		}
	}

	if _, err := fmt.Fprintf(f, "%%endif\n"); err != nil {
		return err
	}

	return nil
}

func main() {
	flag.Parse()
	if flag.NArg() != 1 {
		fmt.Fprintf(os.Stderr, "Usage: %s [-out OUT] SYMBOLS\n", os.Args[0])
		os.Exit(1)
	}

	symbols, err := readSymbols(flag.Arg(0))
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error reading symbols: %s\n", err)
		os.Exit(1)
	}

	if err := writeCHeader(symbols, filepath.Join(*out, "boringssl_prefix_symbols.h")); err != nil {
		fmt.Fprintf(os.Stderr, "Error writing boringssl_prefix_symbols.h: %s\n", err)
		os.Exit(1)
	}

	if err := writeASMHeader(symbols, filepath.Join(*out, "boringssl_prefix_symbols_asm.h")); err != nil {
		fmt.Fprintf(os.Stderr, "Error writing boringssl_prefix_symbols_asm.h: %s\n", err)
		os.Exit(1)
	}

	if err := writeNASMHeader(symbols, filepath.Join(*out, "boringssl_prefix_symbols_nasm.inc")); err != nil {
		fmt.Fprintf(os.Stderr, "Error writing boringssl_prefix_symbols_nasm.inc: %s\n", err)
		os.Exit(1)
	}

}


text:
'use strict';

/**
 * The application publish settings.
 *
 */
class PublishSettings {
  /**
   * Create a PublishSettings.
   * @property {uuid} id The application ID.
   * @property {boolean} isSentimentAnalysisEnabled Setting sentiment analysis
   * as true returns the Sentiment of the input utterance along with the
   * response
   * @property {boolean} isSpeechEnabled Setting speech as public enables
   * speech priming in your app
   * @property {boolean} isSpellCheckerEnabled Setting spell checker as public
   * enables spell checking the input utterance.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PublishSettings
   *
   * @returns {object} metadata of PublishSettings
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PublishSettings',
      type: {
        name: 'Composite',
        className: 'PublishSettings',
        modelProperties: {
          id: {
            required: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          isSentimentAnalysisEnabled: {
            required: true,
            nullable: false,
            serializedName: 'sentimentAnalysis',
            type: {
              name: 'Boolean'
            }
          },
          isSpeechEnabled: {
            required: true,
            nullable: false,
            serializedName: 'speech',
            type: {
              name: 'Boolean'
            }
          },
          isSpellCheckerEnabled: {
            required: true,
            nullable: false,
            serializedName: 'spellChecker',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = PublishSettings;


text:
using System.Threading.Tasks;
using Canvas.v1.Request;
using Canvas.v1.Wrappers.Contracts;
using Nito.AsyncEx;

namespace Canvas.v1.Services
{
    public class RequestService : IRequestService
    {
        private const int NumberOfThreads = 2;
        private IRequestHandler _handler;

        // Used to limit the number of requests that go out
        AsyncSemaphore _throttler = new AsyncSemaphore(NumberOfThreads);

        /// <summary>
        /// Instantiates a new RequestService with the provided handler
        /// </summary>
        /// <param name="handler"></param>
        public RequestService(IRequestHandler handler)
        {
            _handler = handler;
        }

        /// <summary>
        /// Executes the request according to the default TaskScheduler
        /// This will allow for concurrent requests and is managed by the thread pool
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<IApiResponse<T>> ToResponseAsync<T>(IApiRequest request)
            where T : class
        {
            return await _handler.ExecuteAsync<T>(request).ConfigureAwait(false);
        }

        /// <summary>
        /// Executes the request but limits the number of threads that can be used
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task<IApiResponse<T>> EnqueueAsync<T>(IApiRequest request)
            where T : class
        {
            await _throttler.WaitAsync().ConfigureAwait(false);

            try
            {
                return await _handler.ExecuteAsync<T>(request).ConfigureAwait(false);
            }
            finally
            {
                _throttler.Release();
            }
        }
    }
}


text:
[![Build Status](https://travis-ci.org/wiseman/turboshrimp.png?branch=master)](https://travis-ci.org/wiseman/turboshrimp) [![Coverage Status](https://coveralls.io/repos/wiseman/turboshrimp/badge.png?branch=master)](https://coveralls.io/r/wiseman/turboshrimp?branch=master)
[![](https://www.codeship.io/projects/bf2c2bd0-d1cb-0131-603c-5af570721319/status?branch=master)](https://www.codeship.io/projects/bf2c2bd0-d1cb-0131-603c-5af570721319/status?branch=master)

Turboshrimp is a clojure library for communicating with and
controlling the Parrot AR.Drone.

It supports the following:

* Flight control.
* Telemetry (including video and GPS).
* Runs on Android, using [clojure-android](http://clojure-android.info/).

## Example code

This simple example connects to a drone, tells it to take off, and
prints the battery level:

```
(require '[com.lemondronor.turboshrimp :as ardrone])

(def drone (ardrone/make-drone))

;; Connect to the drone.
(ardrone/connect! drone)

;; Tell the drone to being sending us detailed telemetry.
(ardrone/navdata-demo drone true)

;; Tell the drone to take off.
(ardrone/takeoff drone)

;; Check the battery level.
(println (get-in @(:navdata drone) '[:demo :battery-percentage]))
```

This example shows how to process telemetry updates from the drone as
they arrive:

```
(require '[com.lemondronor.turboshrimp :as ardrone])

(defn process-event [event-type data]
  (when (= event-type :navdata)
    (println "Position:" (get-in data [:demo :drone :camera :translation]))))

(def drone (ardrone/make-drone :event-handler process-event))
(ardrone/connect! drone)
(ardrone/navdata-demo drone true)
```

## Example app

There is an example of using the library to create a simple ground
control station with keyboard control and live video with an overlaid
HUD:
[examples/controller.clj](https://github.com/wiseman/turboshrimp/blob/master/examples/controller.clj)

You can run the example like this:
```
# lein with-profile example run -m controller > debug.log
```

![Turboshrimp HUD](/media/screenshots/turboshrimp-hud.jpg?raw=true "Turboshrimp HUD")

(Hey look, it's Ralph & Dottie!)

Here's a video of the HUD in action: https://www.youtube.com/watch?v=2mOtoYUoiWI

Once the controller has started, you can use the following controls:

Key       | Command
----------|--------
t         | Take off
l         | Land
w/a/s/d   | Forward / turn left / backward/ turn right
shift-a/d |"Strafe" left / right
q / z     | Climb / descend
c         | Switch to forward-facing camera
v         | Switch to downward-facing camera

## Other apps

[Shrimpdroid](https://github.com/wiseman/shrimpdroid) is an Android
app that uses turboshrimp to let you fly a drone with your phone.

![Shrimpdroid screenshot](/media/screenshots/shrimpdroid.png?raw=true)

## API

See
[Turboshrimp API documentation](http://wiseman.github.io/turboshrimp/).

## Testing

```
$ lein test
```

## Current status

  * Flight control works.

  * Telemetry works--even GPS!

  * Video works.  I've tried two different H.264 decoders:

      * [turboshrimp-h264j](https://github.com/wiseman/turboshrimp-h264j)
        uses the pure Java [h264j](https://code.google.com/p/h264j/)
        decoder.  h264j is a little slow and has some color glitches
        and occasional errors.

      * [turboshrimp-xuggler](https://github.com/wiseman/turboshrimp-xuggler)
        uses the [xuggler](http://www.xuggle.com/xuggler) decoder,
        which uses native code.  It's almost twice as fast as h264j
        and its output appears to be perfect.

  * It runs on Android.  I don't check every commit, but I do
    periodically test on Android.  This code has flown a drone on an
    Android phone.

## Origin and motivation

This code was originally forked from the awesome work gigasquid/Carin
Meier did with [clj-drone](https://github.com/gigasquid/clj-drone).

My changes are mostly about turning the code into a full-featured
library for writing drone applications (similar to
[node-ar-drone](https://github.com/felixge/node-ar-drone)), with the
following specific goals:

  * Keeping the focus on straightforward drone control: I removed the
    OpenCV dependency and the goal/belief-driven programming API.
    Those are good things, but I think they should be in separate
    libraries.

  * Enhancing the ability to control multiple drones and receive
    telemetry from multiple drones: Replacing single, global vars with
    per-drone data structures.

  * Adding a clean way for applications to process drone telemetry,
    and parsing the full set of navdata options from the drone: GPS,
    magneto, vision, etc.

  * Android compatibility.  I want to be able to use this code on
    Android using [Clojure on Android](http://clojure-android.info/).

## To do

* Handle blocking config commands and multiconfig (see
  https://github.com/felixge/node-ar-drone/pull/76).

* Make sure errors and other events are handled correctly and
  consistently.

* Make it easier to tell if the drone is connected or disconnected.

## License

Copyright 2014, 2015, 2016 John Wiseman jjwiseman@gmail.com

Distributed under the [MIT License](http://opensource.org/licenses/MIT).


text:
using System.Linq;
using SimpleInjector.Diagnostics;
using Xunit;

namespace ScaffoldR.EntityFramework.Tests.CompositionRoot
{
    [Collection("Simple Injector Tests")]
    public class CompositionRootTests
    {
        private readonly CompositionRootFixture _fixture;

        public CompositionRootTests(CompositionRootFixture fixture)
        {
            _fixture = fixture;
        }

        [Fact]
        public void CompositionRoot_ComposesVerifiedRoot_WithoutDiagnosticsWarnings()
        {
            _fixture.Container.Verify();
            var results = Analyzer.Analyze(_fixture.Container);

            Assert.False(results.Any());
        }

        [Fact]
        public void CompositionRoot_AllowsOverridingRegistrations()
        {
            Assert.False(_fixture.Container.Options.AllowOverridingRegistrations);
        }

    }
}


text:
namespace clang {

class APValue;
class ASTContext;
class Sema;

  /// OverloadingResult - Capture the result of performing overload
  /// resolution.
  enum OverloadingResult {
    /// Overload resolution succeeded.
    OR_Success,

    /// No viable function found.
    OR_No_Viable_Function,

    /// Ambiguous candidates found.
    OR_Ambiguous,

    /// Succeeded, but refers to a deleted function.
    OR_Deleted
  };

  enum OverloadCandidateDisplayKind {
    /// Requests that all candidates be shown.  Viable candidates will
    /// be printed first.
    OCD_AllCandidates,

    /// Requests that only viable candidates be shown.
    OCD_ViableCandidates,

    /// Requests that only tied-for-best candidates be shown.
    OCD_AmbiguousCandidates
  };

  /// The parameter ordering that will be used for the candidate. This is
  /// used to represent C++20 binary operator rewrites that reverse the order
  /// of the arguments. If the parameter ordering is Reversed, the Args list is
  /// reversed (but obviously the ParamDecls for the function are not).
  ///
  /// After forming an OverloadCandidate with reversed parameters, the list
  /// of conversions will (as always) be indexed by argument, so will be
  /// in reverse parameter order.
  enum class OverloadCandidateParamOrder : char { Normal, Reversed };

  /// The kinds of rewrite we perform on overload candidates. Note that the
  /// values here are chosen to serve as both bitflags and as a rank (lower
  /// values are preferred by overload resolution).
  enum OverloadCandidateRewriteKind : unsigned {
    /// Candidate is not a rewritten candidate.
    CRK_None = 0x0,

    /// Candidate is a rewritten candidate with a different operator name.
    CRK_DifferentOperator = 0x1,

    /// Candidate is a rewritten candidate with a reversed order of parameters.
    CRK_Reversed = 0x2,
  };

  /// ImplicitConversionKind - The kind of implicit conversion used to
  /// convert an argument to a parameter's type. The enumerator values
  /// match with the table titled 'Conversions' in [over.ics.scs] and are listed
  /// such that better conversion kinds have smaller values.
  enum ImplicitConversionKind {
    /// Identity conversion (no conversion)
    ICK_Identity = 0,

    /// Lvalue-to-rvalue conversion (C++ [conv.lval])
    ICK_Lvalue_To_Rvalue,

    /// Array-to-pointer conversion (C++ [conv.array])
    ICK_Array_To_Pointer,

    /// Function-to-pointer (C++ [conv.array])
    ICK_Function_To_Pointer,

    /// Function pointer conversion (C++17 [conv.fctptr])
    ICK_Function_Conversion,

    /// Qualification conversions (C++ [conv.qual])
    ICK_Qualification,

    /// Integral promotions (C++ [conv.prom])
    ICK_Integral_Promotion,

    /// Floating point promotions (C++ [conv.fpprom])
    ICK_Floating_Promotion,

    /// Complex promotions (Clang extension)
    ICK_Complex_Promotion,

    /// Integral conversions (C++ [conv.integral])
    ICK_Integral_Conversion,

    /// Floating point conversions (C++ [conv.double]
    ICK_Floating_Conversion,

    /// Complex conversions (C99 6.3.1.6)
    ICK_Complex_Conversion,

    /// Floating-integral conversions (C++ [conv.fpint])
    ICK_Floating_Integral,

    /// Pointer conversions (C++ [conv.ptr])
    ICK_Pointer_Conversion,

    /// Pointer-to-member conversions (C++ [conv.mem])
    ICK_Pointer_Member,

    /// Boolean conversions (C++ [conv.bool])
    ICK_Boolean_Conversion,

    /// Conversions between compatible types in C99
    ICK_Compatible_Conversion,

    /// Derived-to-base (C++ [over.best.ics])
    ICK_Derived_To_Base,

    /// Vector conversions
    ICK_Vector_Conversion,

    /// A vector splat from an arithmetic type
    ICK_Vector_Splat,

    /// Complex-real conversions (C99 6.3.1.7)
    ICK_Complex_Real,

    /// Block Pointer conversions
    ICK_Block_Pointer_Conversion,

    /// Transparent Union Conversions
    ICK_TransparentUnionConversion,

    /// Objective-C ARC writeback conversion
    ICK_Writeback_Conversion,

    /// Zero constant to event (OpenCL1.2 6.12.10)
    ICK_Zero_Event_Conversion,

    /// Zero constant to queue
    ICK_Zero_Queue_Conversion,

    /// Conversions allowed in C, but not C++
    ICK_C_Only_Conversion,

    /// C-only conversion between pointers with incompatible types
    ICK_Incompatible_Pointer_Conversion,

    /// The number of conversion kinds
    ICK_Num_Conversion_Kinds,
  };

  /// ImplicitConversionRank - The rank of an implicit conversion
  /// kind. The enumerator values match with Table 9 of (C++
  /// 13.3.3.1.1) and are listed such that better conversion ranks
  /// have smaller values.
  enum ImplicitConversionRank {
    /// Exact Match
    ICR_Exact_Match = 0,

    /// Promotion
    ICR_Promotion,

    /// Conversion
    ICR_Conversion,

    /// OpenCL Scalar Widening
    ICR_OCL_Scalar_Widening,

    /// Complex <-> Real conversion
    ICR_Complex_Real_Conversion,

    /// ObjC ARC writeback conversion
    ICR_Writeback_Conversion,

    /// Conversion only allowed in the C standard (e.g. void* to char*).
    ICR_C_Conversion,

    /// Conversion not allowed by the C standard, but that we accept as an
    /// extension anyway.
    ICR_C_Conversion_Extension
  };

  ImplicitConversionRank GetConversionRank(ImplicitConversionKind Kind);

  /// NarrowingKind - The kind of narrowing conversion being performed by a
  /// standard conversion sequence according to C++11 [dcl.init.list]p7.
  enum NarrowingKind {
    /// Not a narrowing conversion.
    NK_Not_Narrowing,

    /// A narrowing conversion by virtue of the source and destination types.
    NK_Type_Narrowing,

    /// A narrowing conversion, because a constant expression got narrowed.
    NK_Constant_Narrowing,

    /// A narrowing conversion, because a non-constant-expression variable might
    /// have got narrowed.
    NK_Variable_Narrowing,

    /// Cannot tell whether this is a narrowing conversion because the
    /// expression is value-dependent.
    NK_Dependent_Narrowing,
  };

  /// StandardConversionSequence - represents a standard conversion
  /// sequence (C++ 13.3.3.1.1). A standard conversion sequence
  /// contains between zero and three conversions. If a particular
  /// conversion is not needed, it will be set to the identity conversion
  /// (ICK_Identity). Note that the three conversions are
  /// specified as separate members (rather than in an array) so that
  /// we can keep the size of a standard conversion sequence to a
  /// single word.
  class StandardConversionSequence {
  public:
    /// First -- The first conversion can be an lvalue-to-rvalue
    /// conversion, array-to-pointer conversion, or
    /// function-to-pointer conversion.
    ImplicitConversionKind First : 8;

    /// Second - The second conversion can be an integral promotion,
    /// floating point promotion, integral conversion, floating point
    /// conversion, floating-integral conversion, pointer conversion,
    /// pointer-to-member conversion, or boolean conversion.
    ImplicitConversionKind Second : 8;

    /// Third - The third conversion can be a qualification conversion
    /// or a function conversion.
    ImplicitConversionKind Third : 8;

    /// Whether this is the deprecated conversion of a
    /// string literal to a pointer to non-const character data
    /// (C++ 4.2p2).
    unsigned DeprecatedStringLiteralToCharPtr : 1;

    /// Whether the qualification conversion involves a change in the
    /// Objective-C lifetime (for automatic reference counting).
    unsigned QualificationIncludesObjCLifetime : 1;

    /// IncompatibleObjC - Whether this is an Objective-C conversion
    /// that we should warn about (if we actually use it).
    unsigned IncompatibleObjC : 1;

    /// ReferenceBinding - True when this is a reference binding
    /// (C++ [over.ics.ref]).
    unsigned ReferenceBinding : 1;

    /// DirectBinding - True when this is a reference binding that is a
    /// direct binding (C++ [dcl.init.ref]).
    unsigned DirectBinding : 1;

    /// Whether this is an lvalue reference binding (otherwise, it's
    /// an rvalue reference binding).
    unsigned IsLvalueReference : 1;

    /// Whether we're binding to a function lvalue.
    unsigned BindsToFunctionLvalue : 1;

    /// Whether we're binding to an rvalue.
    unsigned BindsToRvalue : 1;

    /// Whether this binds an implicit object argument to a
    /// non-static member function without a ref-qualifier.
    unsigned BindsImplicitObjectArgumentWithoutRefQualifier : 1;

    /// Whether this binds a reference to an object with a different
    /// Objective-C lifetime qualifier.
    unsigned ObjCLifetimeConversionBinding : 1;

    /// FromType - The type that this conversion is converting
    /// from. This is an opaque pointer that can be translated into a
    /// QualType.
    void *FromTypePtr;

    /// ToType - The types that this conversion is converting to in
    /// each step. This is an opaque pointer that can be translated
    /// into a QualType.
    void *ToTypePtrs[3];

    /// CopyConstructor - The copy constructor that is used to perform
    /// this conversion, when the conversion is actually just the
    /// initialization of an object via copy constructor. Such
    /// conversions are either identity conversions or derived-to-base
    /// conversions.
    CXXConstructorDecl *CopyConstructor;
    DeclAccessPair FoundCopyConstructor;

    void setFromType(QualType T) { FromTypePtr = T.getAsOpaquePtr(); }

    void setToType(unsigned Idx, QualType T) {
      assert(Idx < 3 && "To type index is out of range");
      ToTypePtrs[Idx] = T.getAsOpaquePtr();
    }

    void setAllToTypes(QualType T) {
      ToTypePtrs[0] = T.getAsOpaquePtr();
      ToTypePtrs[1] = ToTypePtrs[0];
      ToTypePtrs[2] = ToTypePtrs[0];
    }

    QualType getFromType() const {
      return QualType::getFromOpaquePtr(FromTypePtr);
    }

    QualType getToType(unsigned Idx) const {
      assert(Idx < 3 && "To type index is out of range");
      return QualType::getFromOpaquePtr(ToTypePtrs[Idx]);
    }

    void setAsIdentityConversion();

    bool isIdentityConversion() const {
      return Second == ICK_Identity && Third == ICK_Identity;
    }

    ImplicitConversionRank getRank() const;
    NarrowingKind
    getNarrowingKind(ASTContext &Context, const Expr *Converted,
                     APValue &ConstantValue, QualType &ConstantType,
                     bool IgnoreFloatToIntegralConversion = false) const;
    bool isPointerConversionToBool() const;
    bool isPointerConversionToVoidPointer(ASTContext& Context) const;
    void dump() const;
  };

  /// UserDefinedConversionSequence - Represents a user-defined
  /// conversion sequence (C++ 13.3.3.1.2).
  struct UserDefinedConversionSequence {
    /// Represents the standard conversion that occurs before
    /// the actual user-defined conversion.
    ///
    /// C++11 13.3.3.1.2p1:
    ///   If the user-defined conversion is specified by a constructor
    ///   (12.3.1), the initial standard conversion sequence converts
    ///   the source type to the type required by the argument of the
    ///   constructor. If the user-defined conversion is specified by
    ///   a conversion function (12.3.2), the initial standard
    ///   conversion sequence converts the source type to the implicit
    ///   object parameter of the conversion function.
    StandardConversionSequence Before;

    /// EllipsisConversion - When this is true, it means user-defined
    /// conversion sequence starts with a ... (ellipsis) conversion, instead of
    /// a standard conversion. In this case, 'Before' field must be ignored.
    // FIXME. I much rather put this as the first field. But there seems to be
    // a gcc code gen. bug which causes a crash in a test. Putting it here seems
    // to work around the crash.
    bool EllipsisConversion : 1;

    /// HadMultipleCandidates - When this is true, it means that the
    /// conversion function was resolved from an overloaded set having
    /// size greater than 1.
    bool HadMultipleCandidates : 1;

    /// After - Represents the standard conversion that occurs after
    /// the actual user-defined conversion.
    StandardConversionSequence After;

    /// ConversionFunction - The function that will perform the
    /// user-defined conversion. Null if the conversion is an
    /// aggregate initialization from an initializer list.
    FunctionDecl* ConversionFunction;

    /// The declaration that we found via name lookup, which might be
    /// the same as \c ConversionFunction or it might be a using declaration
    /// that refers to \c ConversionFunction.
    DeclAccessPair FoundConversionFunction;

    void dump() const;
  };

  /// Represents an ambiguous user-defined conversion sequence.
  struct AmbiguousConversionSequence {
    using ConversionSet =
        SmallVector<std::pair<NamedDecl *, FunctionDecl *>, 4>;

    void *FromTypePtr;
    void *ToTypePtr;
    char Buffer[sizeof(ConversionSet)];

    QualType getFromType() const {
      return QualType::getFromOpaquePtr(FromTypePtr);
    }

    QualType getToType() const {
      return QualType::getFromOpaquePtr(ToTypePtr);
    }

    void setFromType(QualType T) { FromTypePtr = T.getAsOpaquePtr(); }
    void setToType(QualType T) { ToTypePtr = T.getAsOpaquePtr(); }

    ConversionSet &conversions() {
      return *reinterpret_cast<ConversionSet*>(Buffer);
    }

    const ConversionSet &conversions() const {
      return *reinterpret_cast<const ConversionSet*>(Buffer);
    }

    void addConversion(NamedDecl *Found, FunctionDecl *D) {
      conversions().push_back(std::make_pair(Found, D));
    }

    using iterator = ConversionSet::iterator;

    iterator begin() { return conversions().begin(); }
    iterator end() { return conversions().end(); }

    using const_iterator = ConversionSet::const_iterator;

    const_iterator begin() const { return conversions().begin(); }
    const_iterator end() const { return conversions().end(); }

    void construct();
    void destruct();
    void copyFrom(const AmbiguousConversionSequence &);
  };

  /// BadConversionSequence - Records information about an invalid
  /// conversion sequence.
  struct BadConversionSequence {
    enum FailureKind {
      no_conversion,
      unrelated_class,
      bad_qualifiers,
      lvalue_ref_to_rvalue,
      rvalue_ref_to_lvalue
    };

    // This can be null, e.g. for implicit object arguments.
    Expr *FromExpr;

    FailureKind Kind;

  private:
    // The type we're converting from (an opaque QualType).
    void *FromTy;

    // The type we're converting to (an opaque QualType).
    void *ToTy;

  public:
    void init(FailureKind K, Expr *From, QualType To) {
      init(K, From->getType(), To);
      FromExpr = From;
    }

    void init(FailureKind K, QualType From, QualType To) {
      Kind = K;
      FromExpr = nullptr;
      setFromType(From);
      setToType(To);
    }

    QualType getFromType() const { return QualType::getFromOpaquePtr(FromTy); }
    QualType getToType() const { return QualType::getFromOpaquePtr(ToTy); }

    void setFromExpr(Expr *E) {
      FromExpr = E;
      setFromType(E->getType());
    }

    void setFromType(QualType T) { FromTy = T.getAsOpaquePtr(); }
    void setToType(QualType T) { ToTy = T.getAsOpaquePtr(); }
  };

  /// ImplicitConversionSequence - Represents an implicit conversion
  /// sequence, which may be a standard conversion sequence
  /// (C++ 13.3.3.1.1), user-defined conversion sequence (C++ 13.3.3.1.2),
  /// or an ellipsis conversion sequence (C++ 13.3.3.1.3).
  class ImplicitConversionSequence {
  public:
    /// Kind - The kind of implicit conversion sequence. BadConversion
    /// specifies that there is no conversion from the source type to
    /// the target type.  AmbiguousConversion represents the unique
    /// ambiguous conversion (C++0x [over.best.ics]p10).
    enum Kind {
      StandardConversion = 0,
      UserDefinedConversion,
      AmbiguousConversion,
      EllipsisConversion,
      BadConversion
    };

  private:
    enum {
      Uninitialized = BadConversion + 1
    };

    /// ConversionKind - The kind of implicit conversion sequence.
    unsigned ConversionKind : 30;

    /// Whether the target is really a std::initializer_list, and the
    /// sequence only represents the worst element conversion.
    unsigned StdInitializerListElement : 1;

    void setKind(Kind K) {
      destruct();
      ConversionKind = K;
    }

    void destruct() {
      if (ConversionKind == AmbiguousConversion) Ambiguous.destruct();
    }

  public:
    union {
      /// When ConversionKind == StandardConversion, provides the
      /// details of the standard conversion sequence.
      StandardConversionSequence Standard;

      /// When ConversionKind == UserDefinedConversion, provides the
      /// details of the user-defined conversion sequence.
      UserDefinedConversionSequence UserDefined;

      /// When ConversionKind == AmbiguousConversion, provides the
      /// details of the ambiguous conversion.
      AmbiguousConversionSequence Ambiguous;

      /// When ConversionKind == BadConversion, provides the details
      /// of the bad conversion.
      BadConversionSequence Bad;
    };

    ImplicitConversionSequence()
        : ConversionKind(Uninitialized), StdInitializerListElement(false) {
      Standard.setAsIdentityConversion();
    }

    ImplicitConversionSequence(const ImplicitConversionSequence &Other)
        : ConversionKind(Other.ConversionKind),
          StdInitializerListElement(Other.StdInitializerListElement) {
      switch (ConversionKind) {
      case Uninitialized: break;
      case StandardConversion: Standard = Other.Standard; break;
      case UserDefinedConversion: UserDefined = Other.UserDefined; break;
      case AmbiguousConversion: Ambiguous.copyFrom(Other.Ambiguous); break;
      case EllipsisConversion: break;
      case BadConversion: Bad = Other.Bad; break;
      }
    }

    ImplicitConversionSequence &
    operator=(const ImplicitConversionSequence &Other) {
      destruct();
      new (this) ImplicitConversionSequence(Other);
      return *this;
    }

    ~ImplicitConversionSequence() {
      destruct();
    }

    Kind getKind() const {
      assert(isInitialized() && "querying uninitialized conversion");
      return Kind(ConversionKind);
    }

    /// Return a ranking of the implicit conversion sequence
    /// kind, where smaller ranks represent better conversion
    /// sequences.
    ///
    /// In particular, this routine gives user-defined conversion
    /// sequences and ambiguous conversion sequences the same rank,
    /// per C++ [over.best.ics]p10.
    unsigned getKindRank() const {
      switch (getKind()) {
      case StandardConversion:
        return 0;

      case UserDefinedConversion:
      case AmbiguousConversion:
        return 1;

      case EllipsisConversion:
        return 2;

      case BadConversion:
        return 3;
      }

      llvm_unreachable("Invalid ImplicitConversionSequence::Kind!");
    }

    bool isBad() const { return getKind() == BadConversion; }
    bool isStandard() const { return getKind() == StandardConversion; }
    bool isEllipsis() const { return getKind() == EllipsisConversion; }
    bool isAmbiguous() const { return getKind() == AmbiguousConversion; }
    bool isUserDefined() const { return getKind() == UserDefinedConversion; }
    bool isFailure() const { return isBad() || isAmbiguous(); }

    /// Determines whether this conversion sequence has been
    /// initialized.  Most operations should never need to query
    /// uninitialized conversions and should assert as above.
    bool isInitialized() const { return ConversionKind != Uninitialized; }

    /// Sets this sequence as a bad conversion for an explicit argument.
    void setBad(BadConversionSequence::FailureKind Failure,
                Expr *FromExpr, QualType ToType) {
      setKind(BadConversion);
      Bad.init(Failure, FromExpr, ToType);
    }

    /// Sets this sequence as a bad conversion for an implicit argument.
    void setBad(BadConversionSequence::FailureKind Failure,
                QualType FromType, QualType ToType) {
      setKind(BadConversion);
      Bad.init(Failure, FromType, ToType);
    }

    void setStandard() { setKind(StandardConversion); }
    void setEllipsis() { setKind(EllipsisConversion); }
    void setUserDefined() { setKind(UserDefinedConversion); }

    void setAmbiguous() {
      if (ConversionKind == AmbiguousConversion) return;
      ConversionKind = AmbiguousConversion;
      Ambiguous.construct();
    }

    void setAsIdentityConversion(QualType T) {
      setStandard();
      Standard.setAsIdentityConversion();
      Standard.setFromType(T);
      Standard.setAllToTypes(T);
    }

    /// Whether the target is really a std::initializer_list, and the
    /// sequence only represents the worst element conversion.
    bool isStdInitializerListElement() const {
      return StdInitializerListElement;
    }

    void setStdInitializerListElement(bool V = true) {
      StdInitializerListElement = V;
    }

    // The result of a comparison between implicit conversion
    // sequences. Use Sema::CompareImplicitConversionSequences to
    // actually perform the comparison.
    enum CompareKind {
      Better = -1,
      Indistinguishable = 0,
      Worse = 1
    };

    void DiagnoseAmbiguousConversion(Sema &S,
                                     SourceLocation CaretLoc,
                                     const PartialDiagnostic &PDiag) const;

    void dump() const;
  };

  enum OverloadFailureKind {
    ovl_fail_too_many_arguments,
    ovl_fail_too_few_arguments,
    ovl_fail_bad_conversion,
    ovl_fail_bad_deduction,

    /// This conversion candidate was not considered because it
    /// duplicates the work of a trivial or derived-to-base
    /// conversion.
    ovl_fail_trivial_conversion,

    /// This conversion candidate was not considered because it is
    /// an illegal instantiation of a constructor temploid: it is
    /// callable with one argument, we only have one argument, and
    /// its first parameter type is exactly the type of the class.
    ///
    /// Defining such a constructor directly is illegal, and
    /// template-argument deduction is supposed to ignore such
    /// instantiations, but we can still get one with the right
    /// kind of implicit instantiation.
    ovl_fail_illegal_constructor,

    /// This conversion candidate is not viable because its result
    /// type is not implicitly convertible to the desired type.
    ovl_fail_bad_final_conversion,

    /// This conversion function template specialization candidate is not
    /// viable because the final conversion was not an exact match.
    ovl_fail_final_conversion_not_exact,

    /// (CUDA) This candidate was not viable because the callee
    /// was not accessible from the caller's target (i.e. host->device,
    /// global->host, device->host).
    ovl_fail_bad_target,

    /// This candidate function was not viable because an enable_if
    /// attribute disabled it.
    ovl_fail_enable_if,

    /// This candidate constructor or conversion function is explicit but
    /// the context doesn't permit explicit functions.
    ovl_fail_explicit,

    /// This candidate was not viable because its address could not be taken.
    ovl_fail_addr_not_available,

    /// This candidate was not viable because its OpenCL extension is disabled.
    ovl_fail_ext_disabled,

    /// This inherited constructor is not viable because it would slice the
    /// argument.
    ovl_fail_inhctor_slice,

    /// This candidate was not viable because it is a non-default multiversioned
    /// function.
    ovl_non_default_multiversion_function,

    /// This constructor/conversion candidate fail due to an address space
    /// mismatch between the object being constructed and the overload
    /// candidate.
    ovl_fail_object_addrspace_mismatch,

    /// This candidate was not viable because its associated constraints were
    /// not satisfied.
    ovl_fail_constraints_not_satisfied,
  };

  /// A list of implicit conversion sequences for the arguments of an
  /// OverloadCandidate.
  using ConversionSequenceList =
      llvm::MutableArrayRef<ImplicitConversionSequence>;

  /// OverloadCandidate - A single candidate in an overload set (C++ 13.3).
  struct OverloadCandidate {
    /// Function - The actual function that this candidate
    /// represents. When NULL, this is a built-in candidate
    /// (C++ [over.oper]) or a surrogate for a conversion to a
    /// function pointer or reference (C++ [over.call.object]).
    FunctionDecl *Function;

    /// FoundDecl - The original declaration that was looked up /
    /// invented / otherwise found, together with its access.
    /// Might be a UsingShadowDecl or a FunctionTemplateDecl.
    DeclAccessPair FoundDecl;

    /// BuiltinParamTypes - Provides the parameter types of a built-in overload
    /// candidate. Only valid when Function is NULL.
    QualType BuiltinParamTypes[3];

    /// Surrogate - The conversion function for which this candidate
    /// is a surrogate, but only if IsSurrogate is true.
    CXXConversionDecl *Surrogate;

    /// The conversion sequences used to convert the function arguments
    /// to the function parameters. Note that these are indexed by argument,
    /// so may not match the parameter order of Function.
    ConversionSequenceList Conversions;

    /// The FixIt hints which can be used to fix the Bad candidate.
    ConversionFixItGenerator Fix;

    /// Viable - True to indicate that this overload candidate is viable.
    bool Viable : 1;

    /// Whether this candidate is the best viable function, or tied for being
    /// the best viable function.
    ///
    /// For an ambiguous overload resolution, indicates whether this candidate
    /// was part of the ambiguity kernel: the minimal non-empty set of viable
    /// candidates such that all elements of the ambiguity kernel are better
    /// than all viable candidates not in the ambiguity kernel.
    bool Best : 1;

    /// IsSurrogate - True to indicate that this candidate is a
    /// surrogate for a conversion to a function pointer or reference
    /// (C++ [over.call.object]).
    bool IsSurrogate : 1;

    /// IgnoreObjectArgument - True to indicate that the first
    /// argument's conversion, which for this function represents the
    /// implicit object argument, should be ignored. This will be true
    /// when the candidate is a static member function (where the
    /// implicit object argument is just a placeholder) or a
    /// non-static member function when the call doesn't have an
    /// object argument.
    bool IgnoreObjectArgument : 1;

    /// True if the candidate was found using ADL.
    CallExpr::ADLCallKind IsADLCandidate : 1;

    /// Whether this is a rewritten candidate, and if so, of what kind?
    unsigned RewriteKind : 2;

    /// FailureKind - The reason why this candidate is not viable.
    /// Actually an OverloadFailureKind.
    unsigned char FailureKind;

    /// The number of call arguments that were explicitly provided,
    /// to be used while performing partial ordering of function templates.
    unsigned ExplicitCallArguments;

    union {
      DeductionFailureInfo DeductionFailure;

      /// FinalConversion - For a conversion function (where Function is
      /// a CXXConversionDecl), the standard conversion that occurs
      /// after the call to the overload candidate to convert the result
      /// of calling the conversion function to the required type.
      StandardConversionSequence FinalConversion;
    };

    /// Get RewriteKind value in OverloadCandidateRewriteKind type (This
    /// function is to workaround the spurious GCC bitfield enum warning)
    OverloadCandidateRewriteKind getRewriteKind() const {
      return static_cast<OverloadCandidateRewriteKind>(RewriteKind);
    }

    /// hasAmbiguousConversion - Returns whether this overload
    /// candidate requires an ambiguous conversion or not.
    bool hasAmbiguousConversion() const {
      for (auto &C : Conversions) {
        if (!C.isInitialized()) return false;
        if (C.isAmbiguous()) return true;
      }
      return false;
    }

    bool TryToFixBadConversion(unsigned Idx, Sema &S) {
      bool CanFix = Fix.tryToFixConversion(
                      Conversions[Idx].Bad.FromExpr,
                      Conversions[Idx].Bad.getFromType(),
                      Conversions[Idx].Bad.getToType(), S);

      // If at least one conversion fails, the candidate cannot be fixed.
      if (!CanFix)
        Fix.clear();

      return CanFix;
    }

    unsigned getNumParams() const {
      if (IsSurrogate) {
        QualType STy = Surrogate->getConversionType();
        while (STy->isPointerType() || STy->isReferenceType())
          STy = STy->getPointeeType();
        return STy->castAs<FunctionProtoType>()->getNumParams();
      }
      if (Function)
        return Function->getNumParams();
      return ExplicitCallArguments;
    }

  private:
    friend class OverloadCandidateSet;
    OverloadCandidate()
        : IsADLCandidate(CallExpr::NotADL), RewriteKind(CRK_None) {}
  };

  /// OverloadCandidateSet - A set of overload candidates, used in C++
  /// overload resolution (C++ 13.3).
  class OverloadCandidateSet {
  public:
    enum CandidateSetKind {
      /// Normal lookup.
      CSK_Normal,

      /// C++ [over.match.oper]:
      /// Lookup of operator function candidates in a call using operator
      /// syntax. Candidates that have no parameters of class type will be
      /// skipped unless there is a parameter of (reference to) enum type and
      /// the corresponding argument is of the same enum type.
      CSK_Operator,

      /// C++ [over.match.copy]:
      /// Copy-initialization of an object of class type by user-defined
      /// conversion.
      CSK_InitByUserDefinedConversion,

      /// C++ [over.match.ctor], [over.match.list]
      /// Initialization of an object of class type by constructor,
      /// using either a parenthesized or braced list of arguments.
      CSK_InitByConstructor,
    };

    /// Information about operator rewrites to consider when adding operator
    /// functions to a candidate set.
    struct OperatorRewriteInfo {
      OperatorRewriteInfo()
          : OriginalOperator(OO_None), AllowRewrittenCandidates(false) {}
      OperatorRewriteInfo(OverloadedOperatorKind Op, bool AllowRewritten)
          : OriginalOperator(Op), AllowRewrittenCandidates(AllowRewritten) {}

      /// The original operator as written in the source.
      OverloadedOperatorKind OriginalOperator;
      /// Whether we should include rewritten candidates in the overload set.
      bool AllowRewrittenCandidates;

      /// Would use of this function result in a rewrite using a different
      /// operator?
      bool isRewrittenOperator(const FunctionDecl *FD) {
        return OriginalOperator &&
               FD->getDeclName().getCXXOverloadedOperator() != OriginalOperator;
      }

      bool isAcceptableCandidate(const FunctionDecl *FD) {
        if (!OriginalOperator)
          return true;

        // For an overloaded operator, we can have candidates with a different
        // name in our unqualified lookup set. Make sure we only consider the
        // ones we're supposed to.
        OverloadedOperatorKind OO =
            FD->getDeclName().getCXXOverloadedOperator();
        return OO && (OO == OriginalOperator ||
                      (AllowRewrittenCandidates &&
                       OO == getRewrittenOverloadedOperator(OriginalOperator)));
      }

      /// Determine the kind of rewrite that should be performed for this
      /// candidate.
      OverloadCandidateRewriteKind
      getRewriteKind(const FunctionDecl *FD, OverloadCandidateParamOrder PO) {
        OverloadCandidateRewriteKind CRK = CRK_None;
        if (isRewrittenOperator(FD))
          CRK = OverloadCandidateRewriteKind(CRK | CRK_DifferentOperator);
        if (PO == OverloadCandidateParamOrder::Reversed)
          CRK = OverloadCandidateRewriteKind(CRK | CRK_Reversed);
        return CRK;
      }

      /// Determine whether we should consider looking for and adding reversed
      /// candidates for operator Op.
      bool shouldAddReversed(OverloadedOperatorKind Op);

      /// Determine whether we should add a rewritten candidate for \p FD with
      /// reversed parameter order.
      bool shouldAddReversed(ASTContext &Ctx, const FunctionDecl *FD);
    };

  private:
    SmallVector<OverloadCandidate, 16> Candidates;
    llvm::SmallPtrSet<uintptr_t, 16> Functions;

    // Allocator for ConversionSequenceLists. We store the first few of these
    // inline to avoid allocation for small sets.
    llvm::BumpPtrAllocator SlabAllocator;

    SourceLocation Loc;
    CandidateSetKind Kind;
    OperatorRewriteInfo RewriteInfo;

    constexpr static unsigned NumInlineBytes =
        24 * sizeof(ImplicitConversionSequence);
    unsigned NumInlineBytesUsed = 0;
    alignas(void *) char InlineSpace[NumInlineBytes];

    // Address space of the object being constructed.
    LangAS DestAS = LangAS::Default;

    /// If we have space, allocates from inline storage. Otherwise, allocates
    /// from the slab allocator.
    /// FIXME: It would probably be nice to have a SmallBumpPtrAllocator
    /// instead.
    /// FIXME: Now that this only allocates ImplicitConversionSequences, do we
    /// want to un-generalize this?
    template <typename T>
    T *slabAllocate(unsigned N) {
      // It's simpler if this doesn't need to consider alignment.
      static_assert(alignof(T) == alignof(void *),
                    "Only works for pointer-aligned types.");
      static_assert(std::is_trivial<T>::value ||
                        std::is_same<ImplicitConversionSequence, T>::value,
                    "Add destruction logic to OverloadCandidateSet::clear().");

      unsigned NBytes = sizeof(T) * N;
      if (NBytes > NumInlineBytes - NumInlineBytesUsed)
        return SlabAllocator.Allocate<T>(N);
      char *FreeSpaceStart = InlineSpace + NumInlineBytesUsed;
      assert(uintptr_t(FreeSpaceStart) % alignof(void *) == 0 &&
             "Misaligned storage!");

      NumInlineBytesUsed += NBytes;
      return reinterpret_cast<T *>(FreeSpaceStart);
    }

    void destroyCandidates();

  public:
    OverloadCandidateSet(SourceLocation Loc, CandidateSetKind CSK,
                         OperatorRewriteInfo RewriteInfo = {})
        : Loc(Loc), Kind(CSK), RewriteInfo(RewriteInfo) {}
    OverloadCandidateSet(const OverloadCandidateSet &) = delete;
    OverloadCandidateSet &operator=(const OverloadCandidateSet &) = delete;
    ~OverloadCandidateSet() { destroyCandidates(); }

    SourceLocation getLocation() const { return Loc; }
    CandidateSetKind getKind() const { return Kind; }
    OperatorRewriteInfo getRewriteInfo() const { return RewriteInfo; }

    /// Determine when this overload candidate will be new to the
    /// overload set.
    bool isNewCandidate(Decl *F, OverloadCandidateParamOrder PO =
                                     OverloadCandidateParamOrder::Normal) {
      uintptr_t Key = reinterpret_cast<uintptr_t>(F->getCanonicalDecl());
      Key |= static_cast<uintptr_t>(PO);
      return Functions.insert(Key).second;
    }

    /// Exclude a function from being considered by overload resolution.
    void exclude(Decl *F) {
      isNewCandidate(F, OverloadCandidateParamOrder::Normal);
      isNewCandidate(F, OverloadCandidateParamOrder::Reversed);
    }

    /// Clear out all of the candidates.
    void clear(CandidateSetKind CSK);

    using iterator = SmallVectorImpl<OverloadCandidate>::iterator;

    iterator begin() { return Candidates.begin(); }
    iterator end() { return Candidates.end(); }

    size_t size() const { return Candidates.size(); }
    bool empty() const { return Candidates.empty(); }

    /// Allocate storage for conversion sequences for NumConversions
    /// conversions.
    ConversionSequenceList
    allocateConversionSequences(unsigned NumConversions) {
      ImplicitConversionSequence *Conversions =
          slabAllocate<ImplicitConversionSequence>(NumConversions);

      // Construct the new objects.
      for (unsigned I = 0; I != NumConversions; ++I)
        new (&Conversions[I]) ImplicitConversionSequence();

      return ConversionSequenceList(Conversions, NumConversions);
    }

    /// Add a new candidate with NumConversions conversion sequence slots
    /// to the overload set.
    OverloadCandidate &addCandidate(unsigned NumConversions = 0,
                                    ConversionSequenceList Conversions = None) {
      assert((Conversions.empty() || Conversions.size() == NumConversions) &&
             "preallocated conversion sequence has wrong length");

      Candidates.push_back(OverloadCandidate());
      OverloadCandidate &C = Candidates.back();
      C.Conversions = Conversions.empty()
                          ? allocateConversionSequences(NumConversions)
                          : Conversions;
      return C;
    }

    /// Find the best viable function on this overload set, if it exists.
    OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc,
                                         OverloadCandidateSet::iterator& Best);

    SmallVector<OverloadCandidate *, 32> CompleteCandidates(
        Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef<Expr *> Args,
        SourceLocation OpLoc = SourceLocation(),
        llvm::function_ref<bool(OverloadCandidate &)> Filter =
            [](OverloadCandidate &) { return true; });

    void NoteCandidates(
        PartialDiagnosticAt PA, Sema &S, OverloadCandidateDisplayKind OCD,
        ArrayRef<Expr *> Args, StringRef Opc = "",
        SourceLocation Loc = SourceLocation(),
        llvm::function_ref<bool(OverloadCandidate &)> Filter =
            [](OverloadCandidate &) { return true; });

    void NoteCandidates(Sema &S, ArrayRef<Expr *> Args,
                        ArrayRef<OverloadCandidate *> Cands,
                        StringRef Opc = "",
                        SourceLocation OpLoc = SourceLocation());

    LangAS getDestAS() { return DestAS; }

    void setDestAS(LangAS AS) {
      assert((Kind == CSK_InitByConstructor ||
              Kind == CSK_InitByUserDefinedConversion) &&
             "can't set the destination address space when not constructing an "
             "object");
      DestAS = AS;
    }

  };

  bool isBetterOverloadCandidate(Sema &S,
                                 const OverloadCandidate &Cand1,
                                 const OverloadCandidate &Cand2,
                                 SourceLocation Loc,
                                 OverloadCandidateSet::CandidateSetKind Kind);

  struct ConstructorInfo {
    DeclAccessPair FoundDecl;
    CXXConstructorDecl *Constructor;
    FunctionTemplateDecl *ConstructorTmpl;

    explicit operator bool() const { return Constructor; }
  };

  // FIXME: Add an AddOverloadCandidate / AddTemplateOverloadCandidate overload
  // that takes one of these.
  inline ConstructorInfo getConstructorInfo(NamedDecl *ND) {
    if (isa<UsingDecl>(ND))
      return ConstructorInfo{};

    // For constructors, the access check is performed against the underlying
    // declaration, not the found declaration.
    auto *D = ND->getUnderlyingDecl();
    ConstructorInfo Info = {DeclAccessPair::make(ND, D->getAccess()), nullptr,
                            nullptr};
    Info.ConstructorTmpl = dyn_cast<FunctionTemplateDecl>(D);
    if (Info.ConstructorTmpl)
      D = Info.ConstructorTmpl->getTemplatedDecl();
    Info.Constructor = dyn_cast<CXXConstructorDecl>(D);
    return Info;
  }

} // namespace clang

#endif // LLVM_CLANG_SEMA_OVERLOAD_H


text:
package gitea

import (
	"bytes"
	"encoding/json"
	"fmt"
)

// CreateRepoFromTemplateOption options when creating repository using a template
type CreateRepoFromTemplateOption struct {
	// Owner is the organization or person who will own the new repository
	Owner string `json:"owner"`
	// Name of the repository to create
	Name string `json:"name"`
	// Description of the repository to create
	Description string `json:"description"`
	// Private is whether the repository is private
	Private bool `json:"private"`
	// GitContent include git content of default branch in template repo
	GitContent bool `json:"git_content"`
	// Topics include topics of template repo
	Topics bool `json:"topics"`
	// GitHooks include git hooks of template repo
	GitHooks bool `json:"git_hooks"`
	// Webhooks include webhooks of template repo
	Webhooks bool `json:"webhooks"`
	// Avatar include avatar of the template repo
	Avatar bool `json:"avatar"`
	// Labels include labels of template repo
	Labels bool `json:"labels"`
}

// Validate validates CreateRepoFromTemplateOption
func (opt CreateRepoFromTemplateOption) Validate() error {
	if len(opt.Owner) == 0 {
		return fmt.Errorf("field Owner is required")
	}
	if len(opt.Name) == 0 {
		return fmt.Errorf("field Name is required")
	}
	return nil
}

// CreateRepoFromTemplate create a repository using a template
func (c *Client) CreateRepoFromTemplate(templateOwner, templateRepo string, opt CreateRepoFromTemplateOption) (*Repository, *Response, error) {
	if err := escapeValidatePathSegments(&templateOwner, &templateRepo); err != nil {
		return nil, nil, err
	}

	if err := opt.Validate(); err != nil {
		return nil, nil, err
	}
	body, err := json.Marshal(&opt)
	if err != nil {
		return nil, nil, err
	}

	repo := new(Repository)
	resp, err := c.getParsedResponse("POST", fmt.Sprintf("/repos/%s/%s/generate", templateOwner, templateRepo), jsonHeader, bytes.NewReader(body), &repo)
	return repo, resp, err
}


text:
module TestHelper.Tape where

import State.Tape
import Syntax.Tree

-- Returns whether the tape should contain the string `syms` at its start.
tapeShouldRead :: Tape -> [TapeSymbol] -> Bool
tapeShouldRead tape syms = tape == (fromString syms)


text:
package com.yunbao.idogs.coordinatorlayout;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;

public class MainActivity extends AppCompatActivity {

    private ViewPager viewPager;
    private TabLayout tabLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //初始化toolbar
        Toolbar toolbar =findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        tabLayout=findViewById(R.id.tabs);

        //为TabLayout添加tab名称
        tabLayout.addTab(tabLayout.newTab().setText("推荐"));
        tabLayout.addTab(tabLayout.newTab().setText("视频"));
        tabLayout.addTab(tabLayout.newTab().setText("图片"));
        viewPager = findViewById(R.id.viewpager);
        // 添加tab适配器
        PagerAdapter adapter = new PagerAdapter
                (getSupportFragmentManager(), tabLayout.getTabCount());
        viewPager.setAdapter(adapter);
        //绑定移动
        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
        tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
            @Override
            public void onTabSelected(TabLayout.Tab tab) {
                viewPager.setCurrentItem(tab.getPosition());
            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(TabLayout.Tab tab) {

            }
        });

    }

    }


text:
package gov.samhsa.acs.xdsb.registry.wsclient;

import gov.samhsa.acs.common.cxf.AbstractCXFLoggingConfigurerClient;
import gov.samhsa.acs.common.tool.SimpleMarshaller;
import gov.samhsa.acs.common.tool.exception.SimpleMarshallerException;
import gov.samhsa.acs.xdsb.registry.wsclient.exception.XdsbRegistryClientException;
import gov.samhsa.ds4p.xdsbregistry.DocumentRegistryService;
import gov.samhsa.ds4p.xdsbregistry.DocumentRegistryService.XDSRegistryProxy;

import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;

import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;

import org.hl7.v3.MCCIIN000002UV01;
import org.hl7.v3.PRPAIN201301UV02;
import org.hl7.v3.PRPAIN201302UV02;
import org.hl7.v3.PRPAIN201304UV02;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;

/**
 * The Class XdsbRegistryWebServiceClient.
 */
public class XdsbRegistryWebServiceClient extends
		AbstractCXFLoggingConfigurerClient {

	/** The logger. */
	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	/** The endpoint address. */
	private final String endpointAddress;

	/** The wsdl url. */
	final URL wsdlURL = this.getClass().getClassLoader()
			.getResource("XDS.b_registry.net.wsdl");

	/** The service name. */
	final QName serviceName = new QName("http://samhsa.gov/ds4p/XDSbRegistry/",
			"DocumentRegistryService");

	/** The port name. */
	final QName portName = new QName("http://samhsa.gov/ds4p/XDSbRegistry/",
			"XDSRegistry_HTTP_Endpoint");

	/** The marshaller. */
	private final SimpleMarshaller marshaller;

	/**
	 * Instantiates a new xdsb registry web service client.
	 *
	 * @param endpointAddress
	 *            the endpoint address
	 * @param marshaller
	 *            the marshaller
	 */
	public XdsbRegistryWebServiceClient(String endpointAddress,
			SimpleMarshaller marshaller) {
		this.endpointAddress = endpointAddress;
		this.marshaller = marshaller;
	}

	/**
	 * Adds the patient registry record.
	 *
	 * @param input
	 *            the input
	 * @return the string
	 * @throws XdsbRegistryClientException
	 *             the xdsb registry client exception
	 */
	public String addPatientRegistryRecord(PRPAIN201301UV02 input)
			throws XdsbRegistryClientException {
		try (XDSRegistryProxy port = createPort()) {
			final MCCIIN000002UV01 patientRegistryRecordAddedResponse = port
					.patientRegistryRecordAdded(input);
			final String patientRegistryRecordAddedResponseString = marshaller
					.marshal(patientRegistryRecordAddedResponse);
			return patientRegistryRecordAddedResponseString;
		} catch (final SimpleMarshallerException e) {
			throw new XdsbRegistryClientException(e);
		} catch (final Exception e) {
			throw toXdsbRegistryClientException(e);
		}
	}

	/**
	 * Registry stored query.
	 *
	 * @param registryStoredQuery
	 *            the registry stored query
	 * @return the adhoc query response
	 */
	public AdhocQueryResponse registryStoredQuery(
			AdhocQueryRequest registryStoredQuery) {
		try (XDSRegistryProxy port = createPort()) {
			final AdhocQueryResponse adhocQueryResponse = port
					.registryStoredQuery(registryStoredQuery);
			return adhocQueryResponse;
		} catch (final Exception e) {
			throw toXdsbRegistryClientException(e);
		}
	}

	/**
	 * Resolve patient registry duplicates.
	 *
	 * @param input
	 *            the input
	 * @return the string
	 * @throws XdsbRegistryClientException
	 *             the xdsb registry client exception
	 */
	public String resolvePatientRegistryDuplicates(PRPAIN201304UV02 input)
			throws XdsbRegistryClientException {
		try (XDSRegistryProxy port = createPort()) {
			final MCCIIN000002UV01 patientRegistryDuplicatesResolvedResponse = port
					.patientRegistryDuplicatesResolved(input);
			final String patientRegistryDuplicatesResolvedResponseString = marshaller
					.marshal(patientRegistryDuplicatesResolvedResponse);
			return patientRegistryDuplicatesResolvedResponseString;
		} catch (final SimpleMarshallerException e) {
			throw new XdsbRegistryClientException(e);
		} catch (final Exception e) {
			throw toXdsbRegistryClientException(e);
		}
	}

	/**
	 * Revise patient registry record.
	 *
	 * @param input
	 *            the input
	 * @return the string
	 * @throws XdsbRegistryClientException
	 *             the xdsb registry client exception
	 */
	public String revisePatientRegistryRecord(PRPAIN201302UV02 input)
			throws XdsbRegistryClientException {
		try (XDSRegistryProxy port = createPort()) {
			final MCCIIN000002UV01 patientRegistryRecordRevisedResponse = port
					.patientRegistryRecordRevised(input);
			final String patientRegistryRecordRevisedResponseString = marshaller
					.marshal(patientRegistryRecordRevisedResponse);
			return patientRegistryRecordRevisedResponseString;
		} catch (final SimpleMarshallerException e) {
			throw new XdsbRegistryClientException(e);
		} catch (final Exception e) {
			throw toXdsbRegistryClientException(e);
		}
	}

	/**
	 * Creates the port.
	 *
	 * @return the XDS registry proxy
	 */
	private XDSRegistryProxy createPort() {
		return configurePort(this::createPortProxy);
	}

	/**
	 * Creates the port proxy.
	 *
	 * @return the XDS registry proxy
	 */
	private XDSRegistryProxy createPortProxy() {
		final XDSRegistryProxy port = new DocumentRegistryService(wsdlURL,
				serviceName).getXDSRegistryHTTPEndpoint();
		if (StringUtils.hasText(this.endpointAddress)) {
			final BindingProvider bp = port;
			bp.getRequestContext().put(
					BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
		}
		return port;
	}

	/**
	 * To xdsb registry client exception.
	 *
	 * @param exception
	 *            the exception
	 * @return the xdsb registry client exception
	 */
	private XdsbRegistryClientException toXdsbRegistryClientException(
			Exception exception) {
		logger.error("Error closing XDS.b Registry client port");
		logger.error(exception.getMessage(), exception);
		return new XdsbRegistryClientException(exception);
	}
}


text:
#ifndef BOOST_ICL_TYPE_TRAITS_IS_INTERVAL_SEPARATOR_HPP_JOFA_081004
#define BOOST_ICL_TYPE_TRAITS_IS_INTERVAL_SEPARATOR_HPP_JOFA_081004

namespace boost{ namespace icl
{
    template <class Type> struct is_interval_separator
    {
        typedef is_interval_separator<Type> type;
        BOOST_STATIC_CONSTANT(bool, value = false);
    };

}} // namespace boost icl

#endif


text:
/**
 * Files Collection
 */

Files = new FS.Collection("files", {
	stores: [
		new FS.Store.GridFS("files", {})
	],
	filter: {
		allow: {
			contentTypes: [
				'application/pdf',
				// MS Office standard files
				'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
				'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
				'application/vnd.openxmlformats-officedocument.presentationml.presentation',
				'application/msword',
				'application/vnd.ms-excel',
				'application/vnd.ms-powerpoint',
			]
		},
    onInvalid: function (message) {
      Notifications.warn('Feil format', 'Vi støtter bare PDF, Word, Excel og PowerPoint akkurat nå. Hvis du skal laste opp bilder, prøv det andre opplastningsfeltet.');
    }
	}
});


text:
<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=page.list.tags
Tags=page.list.tpl:{LIST_COMMENTS},{LIST_COMMENTS_DISPLAY}
[END_COT_EXT]
==================== */

/**
 * Comments system for Feliz
 *
 * @package comments
 * @version 0.7.0
 * @author Feliz Team
 * @copyright Copyright (c) Feliz Team 2008-2014
 * @license BSD
 */

defined('COT_CODE') or die('Wrong URL');

require_once cot_incfile('comments', 'functions');

$t->assign(array(
	'LIST_COMMENTS' => cot_comments_link('page', 'c='.$c, 'page', $c),
	'LIST_COMMENTS_COUNT' => cot_comments_count('page', $c),
	'LIST_COMMENTS_DISPLAY' => cot_comments_display('page', $c, $c)
));


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

namespace Nucleus.Game
{
    /// <summary>
    /// Wrapper ability which allows for other abilities to be conditional on
    /// </summary>
    [Serializable]
    public class ConditionalAbility : Ability
    {
        private Func<TurnContext, bool> _Condition;
        private Ability _Ability;

        public ConditionalAbility(Func<TurnContext, bool> condition, Ability ability)
        {
            _Condition = condition;
            _Ability = ability;
        }

        public override void GenerateActions(TurnContext context, AvailableActions addTo)
        {
            if (!_Condition.Invoke(context)) return;

            _Ability.GenerateActions(context, addTo);
        }
    }
}


text:
var fbTopics = new Firebase('https://hrkitchen.firebaseio.com/topics');

var appControllers = angular.module('appControllers');


text:
#include "com/centreon/task_manager.hh"
#include <gtest/gtest.h>
#include <iostream>
#include "com/centreon/exceptions/basic.hh"
// Global task manager.

using namespace com::centreon;

task_manager tm;

class task_test : public task {
 public:
  task_test() : task() {}
  ~task_test() noexcept {}
  void run() {}
};

class task_test2 : public task {
 public:
  task_test2() : task() {}
  ~task_test2() noexcept {}
  void run() { tm.remove(this); }
};

TEST(ClibTaskManager, Add) {
  task_manager tm;

  task_test* t1 = new task_test;
  tm.add(t1, timestamp::now(), true, true);
  ASSERT_TRUE(tm.next_execution_time().to_useconds());

  task_test* t2 = new task_test;
  tm.add(t2, timestamp::now(), false, false);
  delete t2;
}

TEST(ClibTaskManager, AddRecurring) {
  task_manager tm;

  task_test* t1(new task_test);
  tm.add(t1, timestamp::now(), 10, true, true);
  ASSERT_TRUE(tm.next_execution_time().to_useconds());

  task_test* t2(new task_test);
  tm.add(t2, timestamp::now(), 10, false, false);
  delete t2;
}

TEST(ClibTaskManager, Execute) {
  task_manager tm;

  ASSERT_FALSE(tm.execute(timestamp::now()));

  task_test* t1(new task_test);
  tm.add(t1, timestamp::now(), true, true);
  ASSERT_TRUE(tm.next_execution_time().to_useconds());

  ASSERT_EQ(tm.execute(timestamp::now()), 1);

  task_test* t2(new task_test);
  tm.add(t2, timestamp(), false, false);
  tm.add(t2, timestamp(), false, false);
  tm.add(t2, timestamp(), false, false);
  tm.add(t2, timestamp(), false, false);

  ASSERT_EQ(tm.execute(timestamp::now()), 4);

  timestamp future(timestamp::now());
  future.add_seconds(42);
  tm.add(t2, future, false, false);
  ASSERT_FALSE(tm.execute(timestamp::now()));
  delete t2;
}

TEST(ClibTaskManager, ExecuteRecurring) {
  {
    task_manager tm;

    task_test* t1(new task_test);
    tm.add(t1, timestamp(), 1, true, true);

    ASSERT_EQ(tm.execute(timestamp::now()), 1);
    ASSERT_EQ(tm.execute(timestamp::now()), 1);
    ASSERT_EQ(tm.execute(timestamp::now()), 1);
  }

  {
    task_manager tm;

    task_test* t2(new task_test);
    tm.add(t2, timestamp(), 1, false, false);
    tm.add(t2, timestamp(), 1, false, false);
    tm.add(t2, timestamp(), 1, false, false);
    tm.add(t2, timestamp(), 1, false, false);

    ASSERT_EQ(tm.execute(timestamp::now()), 4);
    ASSERT_EQ(tm.execute(timestamp::now()), 4);
    ASSERT_EQ(tm.execute(timestamp::now()), 4);
    delete t2;
  }

  {
    task_manager tm;

    timestamp future(timestamp::now());
    future.add_seconds(42);

    task_test* t2(new task_test);
    tm.add(t2, future, 0, false, false);
    ASSERT_FALSE(tm.execute(timestamp::now()));
    delete t2;
  }
}

TEST(ClibTaskManager, NextExecutionTime) {
  task_manager tm;
  timestamp now(timestamp::now());
  timestamp max_time(timestamp::max_time());

  ASSERT_EQ(tm.next_execution_time(), max_time);

  task_test* t1(new task_test);
  tm.add(t1, now, true, true);
  ASSERT_EQ(tm.next_execution_time(), now);
}

TEST(ClibTaskManager, RemoveById) {
  task_manager tm;

  task_test* t1(new task_test);
  unsigned long id1(tm.add(t1, timestamp::now(), true, true));

  ASSERT_FALSE(tm.remove(42));

  ASSERT_TRUE(tm.remove(id1));

  task_test* t2(new task_test);
  unsigned long id2(tm.add(t2, timestamp::now(), false, false));
  ASSERT_TRUE(tm.remove(id2));
  delete t2;

  ASSERT_FALSE(tm.remove(42));

  ASSERT_EQ(tm.next_execution_time(), timestamp::max_time());
}

TEST(ClibTaskManager, RemoveByTask) {
  task_manager tm;

  task_test* t1(new task_test);
  tm.add(t1, timestamp::now(), true, true);

  task_test none;
  ASSERT_FALSE(tm.remove(&none));

  ASSERT_EQ(tm.remove(t1), 1);

  task_test* t2(new task_test);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  ASSERT_EQ(tm.remove(t2), 4);
  delete t2;

  ASSERT_FALSE(tm.remove(reinterpret_cast<task*>(0x4242)));

  ASSERT_EQ(tm.next_execution_time(), timestamp::max_time());
}

TEST(ClibTaskManager, RemoveSelf) {
  task_test* t1(new task_test);
  tm.add(t1, timestamp::now(), true, true);
  tm.execute();

  task_test* t2(new task_test);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  tm.add(t2, timestamp::now(), false, false);
  tm.execute();
  delete t2;
}


text:
[![Build Status](https://travis-ci.org/xephonhq/xephon-b.svg?branch=feature%2Fdata-generation)](https://travis-ci.org/xephonhq/xephon-b)
[![Join the chat at https://gitter.im/xephonhq/xephon-b](https://badges.gitter.im/xephonhq/xephon-b.svg)](https://gitter.im/xephonhq/xephon-b?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![GoDoc](https://godoc.org/github.com/xephonhq/xephon-b?status.svg)](https://godoc.org/github.com/xephonhq/xephon-b)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fxephonhq%2Fxephon-b.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fxephonhq%2Fxephon-b?ref=badge_shield)

A time series database benchmark tool. NOTE: it is under major rewrite, See [roadmap](doc/ROADMAP.md).

- status: Under major rewrite, along with [libtsdb-go](https://github.com/libtsdb/libtsdb-go)
- [Documentation](doc)
- [Slide: Introduce Xephon-B](http://www.slideshare.net/ssuser7e134a/intoduce-xephonb)

![system design](doc/system-design.png)

## Related

- [awesome-time-series-database](https://github.com/xephonhq/awesome-time-series-database)
- [libtsdb](https://github.com/libtsdb)
- [Xephon-K A time series database with multiple backends](https://github.com/xephonhq/xephon-k)
- [BenchHub: Store benchmark result in database](https://github.com/benchhub)

## License

MIT

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fxephonhq%2Fxephon-b.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fxephonhq%2Fxephon-b?ref=badge_large)

## Authors

- [Pinglei Guo](https://at15.github.io) [@at15](https://github.com/at15), [twitter](https://twitter.com/at1510086)
- [Zheyuan Chen](http://czheo.github.io/) [@czheo](https://github.com/czheo), [twitter](https://twitter.com/czheo)

## About

B is for benchmark and Xephon comes from the animation [RahXephon](https://en.wikipedia.org/wiki/RahXephon)


text:
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyCompany("StoneSoupDeveloper.com")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("Sitecore.Ship")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyConfiguration("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: NeutralResourcesLanguage("en-GB")]


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="style.css" />

Bases JS

Tuto présentant les bases de javascript

Ouvrir la console développeur (f12)

Se rendre dans l'onglet débogueur

Ouvrir le fichier script.js (ctrl+o)

Mettre un point d'arret à la ligne 10

Quand c'est terminé recommencer avec le fichier script2.js -> script4.js

    <input id="champSaisie" type="text" placeholder="Taper un truc ici" />
    <button onclick="updateDOM()">Ajouter à la liste (en JS pur)</button>
    <button onclick="updateDOMJQuery()">Ajouter à la liste (avec JQuery)</button>

Ma liste dynamique

Envoyer une requête synchrone (voir résultat dans console)

    <button onclick="sendSynchronousRequest()">Envoyer</button>

Envoyer une requête asynchrone (voir résultat dans console)

    <button onclick="sendAsynchronousRequest()">Envoyer</button>


text:
require 'active_support/concern'
require 'active_support/core_ext/array/wrap'

module ChewyResque

  def self.default_queue=(queue)
    @default_queue = queue
  end

  def self.default_queue
    @default_queue || 'default'
  end

  module Mixin

    extend ActiveSupport::Concern

    included do
      class_attribute :indexers
      self.indexers = []
    end

    module ClassMethods

      def async_update_index(index, queue: nil, backref: :self, only_if: nil)
        install_chewy_hooks if indexers.empty? # Only install them once
        indexers << ChewyResque::Index.new(index: index, queue: queue, backref: backref, only_if: only_if)
      end

      def install_chewy_hooks
        after_commit :queue_chewy_jobs
      end
    end

    def queue_chewy_jobs
      ActiveSupport::Notifications.instrument('queue_jobs.chewy_resque', class: self.class.name, id: self.id) do
        self.class.indexers or return
        self.class.indexers.each do |idx|
          begin
            idx.enqueue(self)
          rescue => e
            # ResqueSpec stubs all exeptions from here in tests, even no logs
            if ChewyResque.logger.respond_to? :error
              ChewyResque.logger.error "Cannot update index #{idx.index_name}: #{e}\n#{e.backtrace}"
            end
            raise e
          end
        end
      end
    end
  end
end


text:
MAVEN_HOME=/opt/maven-latest
PATH=$MAVEN_HOME/bin:$PATH
export PATH MAVEN_HOME
export CLASSPATH=.


text:
package org.zaproxy.zap.view.messagelocation;

import org.zaproxy.zap.extension.httppanel.Message;
import org.zaproxy.zap.model.MessageLocation;

/**
 * An object responsible to manage highlights of message locations.
 *
 * @since 2.4.0
 * @see TextMessageLocationHighlightsManager
 */
public interface MessageLocationHighlightsManager {

    void init(Message message);

    MessageLocationHighlight getHighlight(MessageLocation messageLocation);
}