text:
//===-lto.cpp - LLVM Link Time Optimizer ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements the Link Time Optimization library. This library is
// intended to be used by linker to optimize code at link time.
//
//===----------------------------------------------------------------------===//

#include "llvm-c/lto.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/CommandFlags.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/LTO/LTOCodeGenerator.h"
#include "llvm/LTO/LTOModule.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h"

// extra command-line flags needed for LTOCodeGenerator
static cl::opt<char>
OptLevel("O",
         cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
                  "(default = '-O2')"),
         cl::Prefix,
         cl::ZeroOrMore,
         cl::init('2'));

static cl::opt<bool>
DisableInline("disable-inlining", cl::init(false),
  cl::desc("Do not run the inliner pass"));

static cl::opt<bool>
DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false),
  cl::desc("Do not run the GVN load PRE pass"));

static cl::opt<bool>
DisableLTOVectorization("disable-lto-vectorization", cl::init(false),
  cl::desc("Do not run loop or slp vectorization during LTO"));

// Holds most recent error string.
// *** Not thread safe ***
static std::string sLastErrorString;

// Holds the initialization state of the LTO module.
// *** Not thread safe ***
static bool initialized = false;

// Holds the command-line option parsing state of the LTO module.
static bool parsedOptions = false;

// Initialize the configured targets if they have not been initialized.
static void lto_initialize() {
  if (!initialized) {
#ifdef LLVM_ON_WIN32
    // Dialog box on crash disabling doesn't work across DLL boundaries, so do
    // it here.
    llvm::sys::DisableSystemDialogsOnCrash();
#endif

    InitializeAllTargetInfos();
    InitializeAllTargets();
    InitializeAllTargetMCs();
    InitializeAllAsmParsers();
    InitializeAllAsmPrinters();
    InitializeAllDisassemblers();
    initialized = true;
  }
}

namespace {

// This derived class owns the native object file. This helps implement the
// libLTO API semantics, which require that the code generator owns the object
// file.
struct LibLTOCodeGenerator : LTOCodeGenerator {
  LibLTOCodeGenerator() {}
  LibLTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
      : LTOCodeGenerator(std::move(Context)) {}

  std::unique_ptr<MemoryBuffer> NativeObjectFile;
};

}

DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LibLTOCodeGenerator, lto_code_gen_t)
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LTOModule, lto_module_t)

// Convert the subtarget features into a string to pass to LTOCodeGenerator.
static void lto_add_attrs(lto_code_gen_t cg) {
  LTOCodeGenerator *CG = unwrap(cg);
  if (MAttrs.size()) {
    std::string attrs;
    for (unsigned i = 0; i < MAttrs.size(); ++i) {
      if (i > 0)
        attrs.append(",");
      attrs.append(MAttrs[i]);
    }

    CG->setAttr(attrs.c_str());
  }

  if (OptLevel < '0' || OptLevel > '3')
    report_fatal_error("Optimization level must be between 0 and 3");
  CG->setOptLevel(OptLevel - '0');
}

extern const char* lto_get_version() {
  return LTOCodeGenerator::getVersionString();
}

const char* lto_get_error_message() {
  return sLastErrorString.c_str();
}

bool lto_module_is_object_file(const char* path) {
  return LTOModule::isBitcodeFile(path);
}

bool lto_module_is_object_file_for_target(const char* path,
                                          const char* target_triplet_prefix) {
  ErrorOr<std::unique_ptr<MemoryBuffer>> Buffer = MemoryBuffer::getFile(path);
  if (!Buffer)
    return false;
  return LTOModule::isBitcodeForTarget(Buffer->get(), target_triplet_prefix);
}

bool lto_module_is_object_file_in_memory(const void* mem, size_t length) {
  return LTOModule::isBitcodeFile(mem, length);
}

bool
lto_module_is_object_file_in_memory_for_target(const void* mem,
                                            size_t length,
                                            const char* target_triplet_prefix) {
  std::unique_ptr<MemoryBuffer> buffer(LTOModule::makeBuffer(mem, length));
  if (!buffer)
    return false;
  return LTOModule::isBitcodeForTarget(buffer.get(), target_triplet_prefix);
}

lto_module_t lto_module_create(const char* path) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(LTOModule::createFromFile(path, Options, sLastErrorString));
}

lto_module_t lto_module_create_from_fd(int fd, const char *path, size_t size) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(
      LTOModule::createFromOpenFile(fd, path, size, Options, sLastErrorString));
}

lto_module_t lto_module_create_from_fd_at_offset(int fd, const char *path,
                                                 size_t file_size,
                                                 size_t map_size,
                                                 off_t offset) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(LTOModule::createFromOpenFileSlice(fd, path, map_size, offset,
                                                 Options, sLastErrorString));
}

lto_module_t lto_module_create_from_memory(const void* mem, size_t length) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(LTOModule::createFromBuffer(mem, length, Options, sLastErrorString));
}

lto_module_t lto_module_create_from_memory_with_path(const void* mem,
                                                     size_t length,
                                                     const char *path) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(
      LTOModule::createFromBuffer(mem, length, Options, sLastErrorString, path));
}

lto_module_t lto_module_create_in_local_context(const void *mem, size_t length,
                                                const char *path) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(LTOModule::createInLocalContext(mem, length, Options,
                                              sLastErrorString, path));
}

lto_module_t lto_module_create_in_codegen_context(const void *mem,
                                                  size_t length,
                                                  const char *path,
                                                  lto_code_gen_t cg) {
  lto_initialize();
  llvm::TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
  return wrap(LTOModule::createInContext(mem, length, Options, sLastErrorString,
                                         path, &unwrap(cg)->getContext()));
}

void lto_module_dispose(lto_module_t mod) { delete unwrap(mod); }

const char* lto_module_get_target_triple(lto_module_t mod) {
  return unwrap(mod)->getTargetTriple().c_str();
}

void lto_module_set_target_triple(lto_module_t mod, const char *triple) {
  return unwrap(mod)->setTargetTriple(triple);
}

unsigned int lto_module_get_num_symbols(lto_module_t mod) {
  return unwrap(mod)->getSymbolCount();
}

const char* lto_module_get_symbol_name(lto_module_t mod, unsigned int index) {
  return unwrap(mod)->getSymbolName(index);
}

lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod,
                                                      unsigned int index) {
  return unwrap(mod)->getSymbolAttributes(index);
}

const char* lto_module_get_linkeropts(lto_module_t mod) {
  return unwrap(mod)->getLinkerOpts();
}

void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg,
                                        lto_diagnostic_handler_t diag_handler,
                                        void *ctxt) {
  unwrap(cg)->setDiagnosticHandler(diag_handler, ctxt);
}

static lto_code_gen_t createCodeGen(bool InLocalContext) {
  lto_initialize();

  TargetOptions Options = InitTargetOptionsFromCodeGenFlags();

  LibLTOCodeGenerator *CodeGen =
      InLocalContext ? new LibLTOCodeGenerator(make_unique<LLVMContext>())
                     : new LibLTOCodeGenerator();
  CodeGen->setTargetOptions(Options);
  return wrap(CodeGen);
}

lto_code_gen_t lto_codegen_create(void) {
  return createCodeGen(/* InLocalContext */ false);
}

lto_code_gen_t lto_codegen_create_in_local_context(void) {
  return createCodeGen(/* InLocalContext */ true);
}

void lto_codegen_dispose(lto_code_gen_t cg) { delete unwrap(cg); }

bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) {
  return !unwrap(cg)->addModule(unwrap(mod));
}

void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod) {
  unwrap(cg)->setModule(unwrap(mod));
}

bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) {
  unwrap(cg)->setDebugInfo(debug);
  return false;
}

bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) {
  unwrap(cg)->setCodePICModel(model);
  return false;
}

void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu) {
  return unwrap(cg)->setCpu(cpu);
}

void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char *path) {
  // In here only for backwards compatibility. We use MC now.
}

void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args,
                                    int nargs) {
  // In here only for backwards compatibility. We use MC now.
}

void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg,
                                          const char *symbol) {
  unwrap(cg)->addMustPreserveSymbol(symbol);
}

static void maybeParseOptions(lto_code_gen_t cg) {
  if (!parsedOptions) {
    unwrap(cg)->parseCodeGenDebugOptions();
    lto_add_attrs(cg);
    parsedOptions = true;
  }
}

bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) {
  maybeParseOptions(cg);
  return !unwrap(cg)->writeMergedModules(path, sLastErrorString);
}

const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) {
  maybeParseOptions(cg);
  LibLTOCodeGenerator *CG = unwrap(cg);
  CG->NativeObjectFile = CG->compile(DisableInline, DisableGVNLoadPRE,
                                     DisableLTOVectorization, sLastErrorString);
  if (!CG->NativeObjectFile)
    return nullptr;
  *length = CG->NativeObjectFile->getBufferSize();
  return CG->NativeObjectFile->getBufferStart();
}

bool lto_codegen_optimize(lto_code_gen_t cg) {
  maybeParseOptions(cg);
  return !unwrap(cg)->optimize(DisableInline,
                               DisableGVNLoadPRE, DisableLTOVectorization,
                               sLastErrorString);
}

const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) {
  maybeParseOptions(cg);
  LibLTOCodeGenerator *CG = unwrap(cg);
  CG->NativeObjectFile = CG->compileOptimized(sLastErrorString);
  if (!CG->NativeObjectFile)
    return nullptr;
  *length = CG->NativeObjectFile->getBufferSize();
  return CG->NativeObjectFile->getBufferStart();
}

bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {
  maybeParseOptions(cg);
  return !unwrap(cg)->compile_to_file(
      name, DisableInline, DisableGVNLoadPRE,
      DisableLTOVectorization, sLastErrorString);
}

void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) {
  unwrap(cg)->setCodeGenDebugOptions(opt);
}

unsigned int lto_api_version() { return LTO_API_VERSION; }

void lto_codegen_set_should_internalize(lto_code_gen_t cg,
                                        bool ShouldInternalize) {
  unwrap(cg)->setShouldInternalize(ShouldInternalize);
}

void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg,
                                           lto_bool_t ShouldEmbedUselists) {
  unwrap(cg)->setShouldEmbedUselists(ShouldEmbedUselists);
}


text:
extern NSString *const FTAppBaseURL;
extern NSString *const FTKeychainServiceName;

extern NSString *const FTErrorUndefined;
extern NSString *const FTErrorSocketConnectionFailed;

extern NSString *const FTErrorValidationEmail;
extern NSString *const FTErrorValidationPassword;

extern NSString *const FTControllerTitleLogin;
extern NSString *const FTControllerTitleInformation;

extern NSString *const FTExpirationDateFormat;

redpajama_set_name: RedPajamaGithub


text:
#ifndef _NSDECIMAL_H_
#define _NSDECIMAL_H_

#include <limits.h>

#define NSDecimalMaxSize (8)
#define NSDecimalNoScale SHRT_MAX

enum {
    NSRoundPlain,
    NSRoundDown,
    NSRoundUp,
    NSRoundBankers
};
typedef uint32_t NSRoundingMode;

enum {
    NSCalculationNoError = 0,
    NSCalculationLossOfPrecision,
    NSCalculationUnderflow,
    NSCalculationOverflow,
    NSCalculationDivideByZero
};
typedef uint32_t NSCalculationError;

typedef struct {
    union {
        signed int _exponent : 8;
        unsigned int _length : 4;
        unsigned int _isNegative : 1;
        unsigned int _isCompact : 1;
        unsigned int _reserved : 18;
        unsigned short _mantissa[NSDecimalMaxSize];
    };
    double val;
} NSDecimal;

SB_EXPORT BOOL NSDecimalIsNotANumber(const NSDecimal *dcm);
SB_EXPORT NSString * NSDecimalString(const NSDecimal *dcm, id locale);
SB_EXPORT NSComparisonResult NSDecimalCompare(const NSDecimal *leftOperand, const NSDecimal *rightOperand);
SB_EXPORT NSCalculationError NSDecimalAdd(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
SB_EXPORT NSCalculationError NSDecimalSubtract(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
SB_EXPORT NSCalculationError NSDecimalMultiply(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
SB_EXPORT NSCalculationError NSDecimalDivide(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
SB_EXPORT void NSDecimalRound(NSDecimal *result, const NSDecimal *number, NSInteger scale, NSRoundingMode roundingMode);

#endif /* _NSDECIMAL_H_ */


text:
using System;

class Program
{
    static void Main(string[] args)
    {
        string a = null;
        string b = "I'm B";
        string c = null;
        Console.WriteLine(a ?? b ?? c ?? "Hello!");
    }
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1873d20c3">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court District of Kansas</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2014-02-21</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2006-01-26</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-ksd-5_05-cv-03237</identifier>
<identifier type="local">P0b002ee1873d20c3</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2014-02-21</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2014-02-21</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-ksd-5_05-cv-03237</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ksd-5_05-cv-03237</accessId>
 <courtType>District</courtType>
 <courtCode>ksd</courtCode>
 <courtCircuit>10th</courtCircuit>
 <courtState>Kansas</courtState>
 <courtSortOrder>2190</courtSortOrder>
 <caseNumber>5:05-cv-03237</caseNumber>
 <caseOffice>Topeka</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>530</natureSuitCode>
 <natureSuit>Prisoner Petitions - Habeas Corpus</natureSuit>
 <cause>28:2254 Petition for Writ of Habeas Corpus (State)</cause>
 <party fullName="Attorney General of Kansas" lastName="Attorney General of Kansas" role="Respondent"></party>
 <party firstName="Louis" fullName="Louis E. Bruce" lastName="Bruce" middleName="E." role="Respondent"></party>
 <party firstName="Anthony" fullName="Anthony Hernandez" lastName="Hernandez" role="Petitioner"></party>
</extension>
<titleInfo>
 <title>Hernandez v. Bruce et al</title>
 <partNumber>5:05-cv-03237</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-ksd-5_05-cv-03237/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">5:05-cv-03237;05-3237</identifier>
<name type="corporate">
 <namePart>United States District Court District of Kansas</namePart>
 <namePart>10th Circuit</namePart>
 <namePart>Topeka</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Attorney General of Kansas</displayForm>
 <namePart type="family">Attorney General of Kansas</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Respondent</description>
</name>
<name type="personal">
 <displayForm>Louis E. Bruce</displayForm>
 <namePart type="family">Bruce</namePart>
 <namePart type="given">Louis</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Respondent</description>
</name>
<name type="personal">
 <displayForm>Anthony Hernandez</displayForm>
 <namePart type="family">Hernandez</namePart>
 <namePart type="given">Anthony</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Petitioner</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-ksd-5_05-cv-03237</accessId>
 <courtType>District</courtType>
 <courtCode>ksd</courtCode>
 <courtCircuit>10th</courtCircuit>
 <courtState>Kansas</courtState>
 <courtSortOrder>2190</courtSortOrder>
 <caseNumber>5:05-cv-03237</caseNumber>
 <caseOffice>Topeka</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>530</natureSuitCode>
 <natureSuit>Prisoner Petitions - Habeas Corpus</natureSuit>
 <cause>28:2254 Petition for Writ of Habeas Corpus (State)</cause>
 <party fullName="Attorney General of Kansas" lastName="Attorney General of Kansas" role="Respondent"></party>
 <party firstName="Louis" fullName="Louis E. Bruce" lastName="Bruce" middleName="E." role="Respondent"></party>
 <party firstName="Anthony" fullName="Anthony Hernandez" lastName="Hernandez" role="Petitioner"></party>
 <state>Kansas</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-ksd-5_05-cv-03237-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-ksd-5_05-cv-03237/USCOURTS-ksd-5_05-cv-03237-0/mods.xml">
 <titleInfo>
  <title>Hernandez v. Bruce et al</title>
  <subTitle>MEMORANDUM ORDER AND OPINION re 1 Petition for Writ of Habeas Corpus filed by Anthony Hernandez. This Court concludes that the Kansas courts enhancement of petitioner's sentence, based on prior juvenile convictions, was neither contrary to nor involved an unreasonable application of clearly established federal law. SEE MEMORANDUM ORDER AND OPINION FOR DETAILS. Signed by Judge Julie A. Robinson on 1/26/2006.(mkc)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2006-01-26</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-ksd-5_05-cv-03237/pdf/USCOURTS-ksd-5_05-cv-03237-0.pdf">
  <identifier type="FDsys Unique ID">D09002ee1875c7273</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-ksd-5_05-cv-03237/USCOURTS-ksd-5_05-cv-03237-0</identifier>
 <identifier type="former granule identifier">ksd-5_05-cv-03237_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-ksd-5_05-cv-03237/USCOURTS-ksd-5_05-cv-03237-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-ksd-5_05-cv-03237/pdf/USCOURTS-ksd-5_05-cv-03237-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 5:05-cv-03237; Hernandez v. Bruce et al; </searchTitle>
  <courtName>United States District Court District of Kansas</courtName>
  <state>Kansas</state>
  <accessId>USCOURTS-ksd-5_05-cv-03237-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2006-01-26</dateIssued>
  <docketText>MEMORANDUM ORDER AND OPINION re 1 Petition for Writ of Habeas Corpus filed by Anthony Hernandez. This Court concludes that the Kansas courts enhancement of petitioner's sentence, based on prior juvenile convictions, was neither contrary to nor involved an unreasonable application of clearly established federal law. SEE MEMORANDUM ORDER AND OPINION FOR DETAILS. Signed by Judge Julie A. Robinson on 1/26/2006.(mkc)</docketText>
</extension>
</relatedItem>
</mods>


text:
package com.vzw.wallet.util;

import java.util.Locale;

import com.vzw.wallet.model.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service("Utils")
public class Utils {

	@Autowired
    private MessageSource messageSource;

	public String getMessage(String key){
		String message = null;

		if(key != null){
			Locale currentLocale =  LocaleContextHolder.getLocale();
			message = messageSource.getMessage(key, null, currentLocale);
		}

		return message;
	}

	public Response getResponse(int errorCode, String errorMessageKey){
		Response response = new Response();
		response.setErrorCode(errorCode);
		response.setErrorMessage(this.getMessage(errorMessageKey));
		return response;
	}
}


text:
package main

import ()

func commentOwnershipVerify(commenterHex string, commentHex string) (bool, error) {
	if commenterHex == "" || commentHex == "" {
		return false, errorMissingField
	}

	statement := `
		SELECT EXISTS (
			SELECT 1
			FROM comments
			WHERE commenterHex=$1 AND commentHex=$2
		);
	`
	row := db.QueryRow(statement, commenterHex, commentHex)

	var exists bool
	if err := row.Scan(&exists); err != nil {
		logger.Errorf("cannot query if comment owner: %v", err)
		return false, errorInternal
	}

	return exists, nil
}


text:
require "spec_helper"

describe Wego::Result do
  describe ".find" do
    context "when no hotel specified" do
      it "returns search results" do
        search_id = 716_073_46
        stub_search_results_api(search_id)
        results = Wego::Result.find search_id

        expect(results.count).to eq(5)
        expect(results.hotels.first.name).to eq("Parkroyal Darling Harbour")
      end
    end

    context "when hotel_id specified" do
      it "returns one specific hotels" do
        search_id = 716_073_46
        hotel_id = 273_451
        stub_search_result_api(search_id: search_id, hotel_id: hotel_id)
        result = Wego::Result.find search_id, hotel_id: hotel_id

        expect(result.hotel.name).to eq("InterContinental Sydney")
      end
    end

    context "when customized option provided" do
      it "filters the search results" do
        search_id = 716_073_46
        options = { lang: "en", sort: "popularity" }
        stub_search_results_api(search_id, options)
        results = Wego::Result.find search_id, options

        expect(results.hotels.first.name).to eq("Parkroyal Darling Harbour")
      end
    end
  end
end


text:
<?php

declare(strict_types=1);

namespace OAuth2Framework\Component\AuthorizationEndpoint\Consent;

class Consent
{
    private string $clientId;

    private string $userAccountId;

    private string $requestedScope;

    private ?string $grantedScope = null;

    private string $requestedClaims;

    private ?string $grantedClaims = null;

    public function __construct(string $clientId, string $userAccountId, string $scope, string $claims)
    {
        $this->clientId = $clientId;
        $this->userAccountId = $userAccountId;
        $this->requestedScope = $scope;
        $this->requestedClaims = $claims;
    }

    public function getClientId(): string
    {
        return $this->clientId;
    }

    public function getUserAccountId(): string
    {
        return $this->userAccountId;
    }

    public function getRequestedScope(): string
    {
        return $this->requestedScope;
    }

    public function getRequestedClaims(): string
    {
        return $this->requestedClaims;
    }

    public function getGrantedScope(): string
    {
        return $this->grantedScope;
    }

    public function setGrantedScope(string $grantedScope): void
    {
        $this->grantedScope = $grantedScope;
    }

    public function getGrantedClaims(): string
    {
        return $this->grantedClaims;
    }

    public function setGrantedClaims(string $grantedClaims): void
    {
        $this->grantedClaims = $grantedClaims;
    }
}


text:
module Para
  module Cloneable
    class AttachmentsCloner
      attr_reader :original, :clone

      def initialize(original, clone)
        @original = original
        @clone = clone
      end

      def clone!
        return unless defined?(ActiveStorage)

        attachment_reflections = original.class.reflections.select { |k, v|
          k.to_s.match(/_attachment\z/) &&
          v.options[:class_name] == "ActiveStorage::Attachment"
        }

        attachment_reflections.each do |name, reflection|
          original_attachment = original.send(name)
          next unless original_attachment

          association_name = name.gsub(/_attachment\z/, "")

          Para::ActiveStorageDownloader.new(original_attachment).download_blob_to_tempfile do |tempfile|
            clone.send(association_name).attach({
              io: tempfile,
              filename: original_attachment.blob.filename,
              content_type: original_attachment.blob.content_type
            })
          end
        end
      end
    end
  end
end


text:
namespace lslboost
{
    namespace range_detail
    {
        template< class Pred, class Value >
        class replace_value_if
        {
        public:
            typedef const Value& result_type;
            typedef const Value& first_argument_type;

            replace_value_if(const Pred& pred, const Value& to)
                :   m_pred(pred), m_to(to)
            {
            }

            const Value& operator()(const Value& x) const
            {
                return m_pred(x) ? m_to : x;
            }

        private:
            Pred  m_pred;
            Value m_to;
        };

        template< class Pred, class R >
        class replaced_if_range :
            public lslboost::iterator_range<
                lslboost::transform_iterator<
                    replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value<R>::type >,
                    BOOST_DEDUCED_TYPENAME range_iterator<R>::type > >
        {
        private:
            typedef replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value<R>::type > Fn;

            typedef lslboost::iterator_range<
                lslboost::transform_iterator<
                    replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value<R>::type >,
                    BOOST_DEDUCED_TYPENAME range_iterator<R>::type > > base_t;

        public:
            typedef BOOST_DEDUCED_TYPENAME range_value<R>::type value_type;

            replaced_if_range( R& r, const Pred& pred, value_type to )
                : base_t( make_transform_iterator( lslboost::begin(r), Fn(pred, to) ),
                          make_transform_iterator( lslboost::end(r), Fn(pred, to) ) )
            { }
        };

        template< class Pred, class T >
        class replace_if_holder
        {
        public:
            replace_if_holder( const Pred& pred, const T& to )
                : m_pred(pred), m_to(to)
            { }

            const Pred& pred() const { return m_pred; }
            const T& to() const { return m_to; }

        private:
            Pred m_pred;
            T m_to;
        };

        template< class Pred, class InputRng >
        inline replaced_if_range<Pred, InputRng>
        operator|( InputRng& r,
                   const replace_if_holder<Pred, BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f )
        {
            return replaced_if_range<Pred, InputRng>(r, f.pred(), f.to());
        }

        template< class Pred, class InputRng >
        inline replaced_if_range<Pred, const InputRng>
        operator|( const InputRng& r,
                   const replace_if_holder<Pred, BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f )
        {
            return replaced_if_range<Pred, const InputRng>(r, f.pred(), f.to());
        }
    } // 'range_detail'

    using range_detail::replaced_if_range;

    namespace adaptors
    {
        namespace
        {
            const range_detail::forwarder2TU<range_detail::replace_if_holder>
                replaced_if =
                    range_detail::forwarder2TU<range_detail::replace_if_holder>();
        }

        template<class Pred, class InputRange>
        inline replaced_if_range<Pred, InputRange>
        replace_if(InputRange& rng, Pred pred,
                   BOOST_DEDUCED_TYPENAME range_value<InputRange>::type to)
        {
            return range_detail::replaced_if_range<Pred, InputRange>(rng, pred, to);
        }

        template<class Pred, class InputRange>
        inline replaced_if_range<Pred, const InputRange>
        replace_if(const InputRange& rng, Pred pred,
                   BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type to)
        {
            return range_detail::replaced_if_range<Pred, const InputRange>(rng, pred, to);
        }
    } // 'adaptors'

} // 'lslboost'

#endif // include guard


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Leptosphaeria ternata Hazsl.

### Remarks
null


text:
/*
This source was modified by Cory Parks to add additional key modifier support.
*/
#include "OISKeyboard.h"
#include "OISException.h"

using namespace OIS;

//----------------------------------------------------------------------//
void Keyboard::setTextTranslation( TextTranslationMode mode )
{
	mTextMode = mode;
}

//----------------------------------------------------------------------//
bool Keyboard::isModifierDown( Modifier mod ) const
{
#if defined(OIS_MSVC_COMPILER)
  #pragma warning (push)
  #pragma warning (disable : 4800)
#endif
	return (mModifiers & mod);
#if defined(OIS_MSVC_COMPILER)
  #pragma warning (pop)
#endif
}

//----------------------------------------------------------------------//
unsigned int Keyboard::getModifiers() const
{
	return mModifiers;
}


text:
package com.jeesuite.gateway.filter;

import org.springframework.web.server.ServerWebExchange;

import com.jeesuite.gateway.model.BizSystemModule;

/**
 *
 *
 *

 * Class Name   : PreFilterHandler
 *
 * @author vakin
 * @version 1.0.0
 * @date 2020年9月15日
 */
public interface PostFilterHandler {

	String process(ServerWebExchange exchange,BizSystemModule module,String respBodyAsString);

	int order();

}


text:
function [ lines ] = CalculateHoughLines( image, maxLineCount, minLineLength, threshold, fillGap )
%CALCULATEHOUGHLINES Summary of this function goes here
%   Detailed explanation goes here
% maxLines
% NUMPEAKS
%     specifies the maximum number of peaks to identify. PEAKS is
%     a Q-by-2 matrix, where Q can range from 0 to NUMPEAKS. Q holds
%     the row and column coordinates of the peaks. If NUMPEAKS is
%     omitted, it defaults to 1.

% threshold
% 'Threshold' Nonnegative scalar.
%                 Values of H below 'Threshold' will not be considered
%                 to be peaks. Threshold can vary from 0 to Inf.
%
%                 Default: 0.5*max(H(:))

% FillGap
% 'FillGap'   Positive real scalar.
%                 When houghlines finds two line segments associated
%                 with the same Hough transform bin that are separated
%                 by less than 'FillGap' distance, houghlines merges
%                 them into a single line segment.
%
%                 Default: 20
%
% MinLength
%     'MinLength' Positive real scalar.
%                 Merged line segments shorter than 'MinLength'
%                 are discarded.
%
%                 Default: 40

if nargin < 2
    maxLineCount = 1;
    minLineLength = 40;
    threshold = 0;
    fillGap = 20;
elseif nargin < 3
    minLineLength = 40;
    threshold = 0;
    fillGap = 20;
elseif nargin < 4
    threshold = 0;
    fillGap = 20;
elseif nargin < 5
    fillGap = 20;
end

if size(image, 3) > 1
    image = im2double(image);
    image = rgb2gray(image);
end

image = edge(image, 'canny');

[H, T, R] = hough(image);

if nargin < 4
    threshold = ceil(0.5 * max(H(:)));
end

P  = houghpeaks(H, maxLineCount, 'threshold', threshold);

lines = houghlines(image, T, R, P, 'FillGap', fillGap, 'MinLength', minLineLength);

end


text:
create database sample
  charset utf8mb4
  collate utf8mb4_bin;

# --- !Downs

drop database sample;


text:
namespace GemsWeb
{
    public static class UserAgent
    {
        public const string MOZILLA = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)";

        /// <summary>
        /// Formulate a user agent to identify the robot.
        /// </summary>
        /// <param name="pAppName">The name of the application.</param>
        /// <param name="pDomain">The website domain</param>
        /// <param name="pEmail">The support email address</param>
        /// <returns>The user agent string.</returns>
        public static string Format(string pAppName, string pDomain, string pEmail)
        {
            return string.Format("{0}/1.0 (+http://{1}; email:{2}; Mozilla/5.0; please report problems)",
                pAppName,
                pDomain,
                pEmail);
        }
    }
}


text:
template<typename T, unsigned Alignment>
class StdAllocatorAligned {
public :
    typedef T value_type;
    typedef value_type* pointer;
    typedef const value_type* const_pointer;
    typedef value_type& reference;
    typedef const value_type& const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;

public :
    template<typename U>
    struct rebind {
		typedef StdAllocatorAligned<U, Alignment> other;
    };

public :
	inline StdAllocatorAligned(){}
	inline ~StdAllocatorAligned() {}
	inline StdAllocatorAligned(const StdAllocatorAligned& rhs) {}

    template<typename U>
	inline explicit StdAllocatorAligned(const StdAllocatorAligned<U, Alignment>& rhs){}

    inline pointer address(reference r) { return &r; }
    inline const_pointer address(const_reference r) { return &r; }

    inline pointer allocate(size_type cnt, typename std::allocator<void>::const_pointer = 0)
	{
		return reinterpret_cast<pointer>(voxel_alloc_aligned(cnt * sizeof (T), Alignment));
    }
    inline void deallocate(pointer p, size_type)
	{
		voxel_dealloc_aligned(p);
    }

    inline size_type max_size() const
	{
        return std::numeric_limits<size_type>::max() / sizeof(T);
	}

    inline void construct(pointer p, const T& t) { new(p) T(t); }
    inline void destroy(pointer p) { p->~T(); }

	inline bool operator==(StdAllocatorAligned const&) { return true; }
	inline bool operator!=(StdAllocatorAligned const& a) { return !operator==(a); }

private:
	template<typename U, unsigned A> friend class StdAllocatorAligned;
};


text:
require 'spec_helper'

describe Puppet::Type.type(:cs_clone).provider(:pcs) do
  before do
    described_class.stubs(:command).with(:pcs).returns 'pcs'
  end

  context 'when getting instances' do
    let :instances do
      test_cib = <<-EOS
        <cib>
        <configuration>
          <resources>
            <clone id="p_keystone-clone">
              <primitive class="systemd" id="p_keystone" type="openstack-keystone">
                <meta_attributes id="p_keystone-meta_attributes"/>
                <operations/>
              </primitive>
              <meta_attributes id="p_keystone-clone-meta"/>
            </clone>
          </resources>
        </configuration>
        </cib>
      EOS

      described_class.expects(:block_until_ready).returns(nil)
      if Puppet::Util::Package.versioncmp(Puppet::PUPPETVERSION, '3.4') == -1
        Puppet::Util::SUIDManager.expects(:run_and_capture).with(%w(pcs cluster cib)).at_least_once.returns([test_cib, 0])
      else
        Puppet::Util::Execution.expects(:execute).with(%w(pcs cluster cib), :failonfail => true).at_least_once.returns(
          Puppet::Util::Execution::ProcessOutput.new(test_cib, 0)
        )
      end
      # rubocop:disable Lint/UselessAssignment
      instances = described_class.instances
      # rubocop:enable Lint/UselessAssignment
    end

    it 'should have an instance for each <clone>' do
      expect(instances.count).to eq(1)
    end

    describe 'each instance' do
      let :instance do
        instances.first
      end

      it "is a kind of #{described_class.name}" do
        expect(instance).to be_a_kind_of(described_class)
      end

      it "is named by the <primitive>'s id attribute" do
        expect(instance.name).to eq('p_keystone-clone')
      end
    end
  end

  context 'when flushing' do
    def expect_update(pattern)
      if Puppet::Util::Package.versioncmp(Puppet::PUPPETVERSION, '3.4') == -1
        Puppet::Util::SUIDManager.expects(:run_and_capture).with { |*args|
          cmdline = args[0].join(' ')
          expect(cmdline).to match(pattern)
          true
        }.at_least_once.returns(['', 0])
      else
        Puppet::Util::Execution.expects(:execute).with { |*args|
          cmdline = args[0].join(' ')
          expect(cmdline).to match(pattern)
          true
        }.at_least_once.returns(
          Puppet::Util::Execution::ProcessOutput.new('', 0)
        )
      end
    end

    let :resource do
      Puppet::Type.type(:cs_clone).new(
        :name      => 'p_keystone',
        :provider  => :pcs,
        :primitive => 'p_keystone',
        :ensure    => :present)
    end

    let :instance do
      instance = described_class.new(resource)
      instance.create
      instance
    end

    it 'creates clone' do
      expect_update(/pcs resource clone p_keystone/)
      instance.flush
    end

    it 'sets max clones' do
      instance.clone_max = 3
      expect_update(/clone-max=3/)
      instance.flush
    end

    it 'sets max node clones' do
      instance.clone_node_max = 3
      expect_update(/clone-node-max=3/)
      instance.flush
    end

    it 'sets notify_clones' do
      instance.notify_clones = :true
      expect_update(/notify=true/)
      instance.flush
    end

    it 'sets globally unique' do
      instance.globally_unique = :true
      expect_update(/globally-unique=true/)
      instance.flush
    end

    it 'sets ordered' do
      instance.ordered = :true
      expect_update(/ordered=true/)
      instance.flush
    end

    it 'sets interleave' do
      instance.interleave = :true
      expect_update(/interleave=true/)
      instance.flush
    end
  end
end


text:
<?php

namespace App\OrderformBundle\Form;

use App\OrderformBundle\Form\CustomType\ScanCustomSelectorType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;

use Doctrine\ORM\EntityRepository;

class SpecialStainsType extends AbstractType
{

    protected $params;

    public function formConstructor( $params=null )
    {
        $this->params = $params;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->formConstructor($options['form_custom_value']);

        //field
        $builder->add('field', TextareaType::class, array(
            'label' => 'Associated Special Stain Result:',
            'required' => false,
            'attr' => array('class'=>'textarea form-control form-control-modif')
        ));

        //staintype
        $attr = array('class' => 'ajax-combobox-staintype', 'type' => 'hidden');
        $options = array(
            'label' => 'Associated Special Stain Name:',
            'required' => false,
            'attr' => $attr,
            'classtype' => 'staintype'
        );
        //do not default "H&E" in Associated Stains
        //if($this->params['cycle'] == "" || $this->params['cycle'] == 'new' || $this->params['cycle'] == 'create') {
        //    $options['data'] = 1;
        //}
        $builder->add('staintype', ScanCustomSelectorType::class, $options );

        //stainothers
        $builder->add('others', ArrayFieldType::class, array(
            'data_class' => 'App\OrderformBundle\Entity\BlockSpecialStains',
            'form_custom_value' => $this->params,
            'label' => false,
			'attr' => array('style'=>'display:none;')
        ));

    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'App\OrderformBundle\Entity\BlockSpecialStains',
            'form_custom_value' => null
        ));
    }

    public function getBlockPrefix(): string
    {
        return 'oleg_orderformbundle_specialstainstype';
    }
}


text:
fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {}

fn main() {
    f::<[u8]>("a", b"a");
    //~^ ERROR: this function takes 2 generic arguments but 1 generic argument was supplied
}


text:
package jopt.core.dominances;

import jopt.exceptions.DimensionException;

/**
 * This class does not consider any dominance criterion. It will only check
 * if vectors have the same length and return {@link Relation#INDIFFERENT INDIFFERENT}.
 */
public final class NoDominance implements Dominance {

    /**
     * Sole constructor.
     */
    public NoDominance() {
        // It does nothing
    }

    @Override
    public Relation compare(double[] first, double[] second) {
        if (first.length != second.length) {
            String msg = String.format("Incompatible dimension (first.length=%d, second.length=%d)", first.length, second.length);
            throw new DimensionException(msg);
        }

        return Relation.INDIFFERENT;
    }

}


text:
Originally published: 2004-06-19 02:09:47
Last updated: 2005-01-12 22:00:07
Author: Artur de Sousa Rocha

This module provides two standard Tkinter widgets, Entry and ScrolledText, modified for text editing with key bindings that allow entering accented letters, umlauts, etc.

Usage: To enter an accented character, press Ctrl-symbol, then press the character key. Example: to enter U with umlaut, press Ctrl-", U. For accent symbols that need shift, press Ctrl-Shift-symbol (for example, Ctrl-Shift-' if " is under Shift-').

Accent bindings are defined in the Diacritical.accent table. Not all accents exist on all letters. This is handled by gracefully falling back to the base letter.

Additional changes in default Tk key bindings: Ctrl-A is now select-all.


text:
apache_logfile_analyzer::apache_logfile_analyzer()
{

}

apache_logfile_analyzer::~apache_logfile_analyzer()
{

}

int apache_logfile_analyzer::get_number_of_items()
{
	return items.size();
}

int apache_logfile_analyzer::add_to_items(apache_access_logitem access_log_item)
{
	log_item item;
	item.first = access_log_item.ip;

	if(items.find(item.first)!=items.end())
	{
		items[item.first].push_back(access_log_item);
	}
	else
	{
		item.second.push_back(access_log_item);
		items.insert(item);
	}

	return 1;
}

int apache_logfile_analyzer::remove_from_items(string ip_address)
{
	items.erase(ip_address);

	return 0;
}

log_list apache_logfile_analyzer::find_in_items(string ip_address)
{
	log_list found_items;

	if(items.find(ip_address)!=items.end())
	{
		found_items = items[ip_address];
	}

	return found_items;
}

std::vector<apache_access_relative_occurence> apache_logfile_analyzer::calculate_relative_occurence_of_each_ip()
{
	std::vector<apache_access_relative_occurence> list;

	int total_number_of_logged_items = get_number_of_items();
	std::vector<std::string> keys = get_map_keys();

	for(int i = 0; i < keys.size(); ++i)
	{
		std::string key = keys[i];

		log_list logged_items_for_ip = find_in_items(key);

		apache_access_relative_occurence item;
		item.ip = key;
		item.number_of_occurences = logged_items_for_ip.size();
		item.percent = ((double)item.number_of_occurences) / ((double)total_number_of_logged_items) * 10;
		list.push_back(item);
	}

	std::sort(list.rbegin(), list.rend());

	return list;
}

std::vector<std::string> apache_logfile_analyzer::get_map_keys()
{
	std::vector<std::string> key_list;

	for(log_map_iterator it = items.begin(); it != items.end(); ++it)
	{
		key_list.push_back(it->first);
	}

	return key_list;
}


text:
"""
This file contains various utility functions.
"""
from itertools import islice, chain

def batch(iterable, size):
    """
    Get items from a sequence a batch at a time.

    .. note:

        Adapted from
        https://code.activestate.com/recipes/303279-getting-items-in-batches/.

    .. note:

        All batches must be exhausted immediately.

    :params iterable: An iterable to get batches from.
    :params size: Size of the batches.
    :returns: A new batch of the given size at each time.

    >>> [list(i) for i in batch([1, 2, 3, 4, 5], 2)]
    [[1, 2], [3, 4], [5]]
    """
    item = iter(iterable)
    while True:
        batch_iterator = islice(item, size)
        try:
            yield chain([next(batch_iterator)], batch_iterator)
        except StopIteration:
            return


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="stylesheets/bootstrap.min.css">
    <link rel="stylesheet" href="stylesheets/main.css">

    <title>Waiting</title>

                <button type="button" class="navbar-toggle collapsed"
                        data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

Online Go

Play

Watch Others

User

Chat

Waiting For Play

60%


text:
IMPLEMENT_LUA_CLASS(sfSoundBuffer,sf::SoundBuffer)

#define FUNCTION_TO_BIND \
    X1(loadFromFile     , METHOD   ,HAS_RETURN  , RET_TYPE(bool)      , loadFromFile , std::string   , NO_POINTER )\
    X0(getDuration      , METHOD   ,HAS_RETURN , RET_TYPE(sf::Time)   , getDuration )\

#define __GO_FOR_IMPLEMENTATION__
#include "../../bindingHelper/macro2.hpp"

FUNCTION_TO_BIND

#undef __GO_FOR_IMPLEMENTATION__
#include "../../bindingHelper/macro2.hpp"

luaL_Reg sfSoundBuffer_regs[] =
{
    LUA_DEFAULT_CLASS_FUNC(sfSoundBuffer)
    FUNCTION_TO_BIND
    { NULL, NULL }
};

LUA_REGISTER_CLASS(sfSoundBuffer)


text:
package fr.intech.s5.candiesforall.backend.entity;

public class Login {

	private String userName;

	private String userPassword;

	public Login() {
	}

	public Login(String userName, String userPassword) {
		this.userName = userName;
		this.userPassword = userPassword;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
}


text:
'use strict';

// Load the Chai Assertion Library
var chai = require('chai');

// Extend Chai with assertions about promises
chai.use(require('chai-as-promised'));

// Grab Chai's assert, expect, and should interfaces
var assert = chai.assert,
    expect = chai.expect,
    should = chai.should(); // Note: should has to be executed

// Load utilities for handling and transforming file paths
var path = require('path'),
    FS   = require('fs');

// Module under test
var metadata = require('../../../src/helper/metadata');

// Output directory (for temporary test output)
var outputDirectoryPath = path.resolve(__dirname, 'output');

// Mocks
var project = {
  modules: {
    a: { name: 'a', dependencies: ['b'], path: 'src/a.js'},
    b: { name: 'b', dependencies: ['c'], path: 'src/b.js'},
    c: { name: 'c', dependencies: [   ], path: 'src/c.js'}
  },
  testSuites: {
    test1: { dependencies: ['a','b'], path: 'tests/test1.js'},
    test2: { dependencies: ['b','c'], path: 'tests/test2.js'},
    test3: { dependencies: ['a'],     path: 'tests/test3.js'}
  }
};

describe('metadata', function() {

  // Make sure the output directory exists before running tests
  before(function() {
    if (!FS.existsSync(outputDirectoryPath)) {
      FS.mkdirSync(outputDirectoryPath);
    }
  });

  it('should be able to write metadata to a file and read it back', function(done) {
    metadata.store(project, outputDirectoryPath)
            .then(readMetadata)
            .should.eventually.eql(project)
            .notify(done);

    function readMetadata() {
      return metadata.read(outputDirectoryPath);
    }
  });

});


text:
/**
 * All Cordova plugins
 *
 * Created by Vamsi
 */

cordova.define("com.vamsi.plugins.preferences", function(require, exports, module) {
    var exec = require('cordova/exec');

    var Preferences = function() {};

    Preferences.prototype.save = function(key, value, type, successCallback, errorCallback) {
    		exec(
   	            successCallback, // success callback function
   	            errorCallback, // error callback function
   	            'MyStore',// mapped to our native Java class called "AppPreferences"
   	            'store', // with this action name
   	            [{
   	            	"key": key,
   	            	"value": value,
   	            	"type" : type
   	            }]
   	        );
    }

    Preferences.prototype.fetch = function(key, successCallback, errorCallback) {
    		exec(
   	            successCallback, // success callback function
   	            errorCallback, // error callback function
   	            'MyStore', // mapped to our native Java class called "AppPreferences"
   	            'fetch', // with this action name
   	            [{
   	            	 "key": key
   	            }]
   	        );
    }

    Preferences.prototype.remove = function(key, successCallback, errorCallback) {
    		exec(
   	            successCallback, // success callback function
   	            errorCallback, // error callback function
   	            'MyStore', // mapped to our native Java class called "AppPreferences"
   	            'remove', // with this action name
   	            [{
   	                "key": key
   	            }]
   	        );
    }

    var preferences = new Preferences();
    module.exports = preferences;
});


text:
<?php
/**
 * Members locator "default" search results template file.
 *
 * The information on this file will be displayed as the search results.
 *
 * The function pass 2 args for you to use:
 * $gmw    - the form being used ( array )
 * $member - each member in the loop
 *
 * You could but It is not recomemnded to edit this file directly as your changes will be overridden on the next update of the plugin.
 * Instead you can copy-paste this template ( the "default" folder contains this file and the "css" folder )
 * into the theme's or child theme's folder of your site and apply your changes from there.
 *
 * The template folder will need to be placed under:
 * your-theme's-or-child-theme's-folder/geo-my-wp/friends/search-results/
 *
 * Once the template folder is in the theme's folder you will be able to choose it when editing the Members locator form.
 * It will show in the "Search results" dropdown menu as "Custom: default".
 */
?>

<div class="gmw-results-wrapper gmw-results-wrapper-<?php echo $gmw['ID']; ?> gmw-fl-default-results-wrapper">
	<?php do_action( 'gmw_search_results_start' , $gmw ); ?>

    <?php
    if ( $gmw['search_results']['display_map'] == 'results' ) {
        echo '
'; gmw_results_map( $gmw );echo '
';
    }
    ?>

            <?php bp_members_pagination_count(); ?><?php gmw_results_message( $gmw, false ); ?>

        <?php gmw_per_page( $gmw, $gmw['total_results'], 'paged' ); ?>

            <?php gmw_pagination( $gmw, 'paged', $gmw['max_pages'] ); ?>

    <?php do_action( 'bp_before_directory_members_list' ); ?>

    <?php while ( bp_members() ) : bp_the_member(); ?>
        <?php $vendor_id = bp_get_member_user_id();?>
        <?php $shop_link = (class_exists('WCV_Vendors')) ? WCV_Vendors::get_vendor_shop_page( $vendor_id ) : '';?>
        <?php $member = $members_template->member; ?>
        <?php do_action( 'gmw_search_results_loop_item_start', $gmw, $member ); ?>

                <a href="<?php bp_member_permalink(); ?>">
                    <?php bp_member_avatar( 'type=full&height=70&width=70' ); ?>

                        <a href="<?php bp_member_permalink(); ?>" class="wcvendors_cart_sold_by_meta">
                            <?php the_author_meta( 'display_name',$vendor_id); ?>

                        <?php do_action( 'gmw_search_results_before_distance', $gmw, $member); ?>

                             <?php gmw_distance_to_location( $members_template->member, $gmw ); ?>
                            <?php do_action( 'gmw_search_results_before_address', $gmw, $member ); ?>

                            <?php if ( isset( $gmw['search_results']['get_directions'] ) ) { ?>
                                <?php global $members_template; ?>

                                    <?php gmw_directions_link( $members_template->member, $gmw, $gmw['labels']['search_results']['directions'] ); ?>

                            <?php } ?>

                        <?php do_action( 'gmw_fl_search_results_member_items', $gmw, $member ); ?>

            <?php if (class_exists('WCV_Vendors')):?>
                <?php $shop_name = WCV_Vendors::is_vendor( $vendor_id ) ? WCV_Vendors::get_vendor_sold_by( $vendor_id ) : get_bloginfo( 'name' );?>

<?php echo getShopLikeButton( $vendor_id ); ?>

                            <a href="<?php echo $shop_link; ?>" class="wcvendors_cart_sold_by_meta">
                                <img src="<?php echo rh_show_vendor_avatar( $vendor_id, 50, 50 ) ?>" class="vendor_store_image_single"
                                 width=50 height=50/>

                            <?php _e( 'Shop', 'rehub_framework' ); ?>

                            <a href="<?php echo $shop_link; ?>"><?php echo $shop_name; ?>

            <?php endif;?>

                <?php
                $totaldeals = count_user_posts( $vendor_id, $post_type = 'product' );
                $totaldeals = $totaldeals - 4;
                $args       = array(
                    'post_type'           => 'product',
                    'posts_per_page'      => 4,
                    'author'              => $vendor_id,
                    'ignore_sticky_posts' => true,
                    'no_found_rows'       => true
                );
                $looplatest = new WP_Query( $args );
                if ( $looplatest->have_posts() ) {
                    while ( $looplatest->have_posts() ) : $looplatest->the_post();
                        echo 'ID ) . '">';
                        $showimg            = new WPSM_image_resizer();
                        $showimg->use_thumb = true;
                        $showimg->height    = 70;
                        $showimg->width     = 70;
                        $showimg->crop      = true;
                        $showimg->no_thumb = rehub_woocommerce_placeholder_img_src('');
                        $img                = $showimg->get_resized_url();
                        echo 'ID ) . '"/>';
                        echo '';
                    endwhile;
                    if ( $totaldeals > 0 ) {
                        echo '+' . $totaldeals . '';
                    }

                }
                wp_reset_query(); ?>

        <?php do_action( 'gmw_search_results_loop_item_end', $gmw, $member ); ?>

    <?php endwhile; ?>

    <?php do_action( 'bp_after_directory_members_list' ); ?>

    <?php bp_member_hidden_fields(); ?>

	<?php do_action( 'gmw_search_results_end', $gmw ); ?>


text:
import sys
sys.path.insert(1, "../../../")
import h2o

def tweedie_offset(ip,port):

    insurance = h2o.import_file(h2o.locate("smalldata/glm_test/insurance.csv"))
    insurance["offset"] = insurance["Holders"].log()
    insurance["Group"] = insurance["Group"].asfactor()
    insurance["Age"] = insurance["Age"].asfactor()
    insurance["District"] = insurance["District"].asfactor()

    # without offset
    dl = h2o.deeplearning(x=insurance[0:3],y=insurance["Claims"],distribution="tweedie",hidden=[1],epochs=1000,
                          train_samples_per_iteration=-1,reproducible=True,activation="Tanh",single_node_mode=False,
                          balance_classes=False,force_load_balance=False,seed=23123,tweedie_power=1.5,
                          score_training_samples=0,score_validation_samples=0)

    mean_residual_deviance = dl.mean_residual_deviance()
    assert abs(0.5573887-mean_residual_deviance) < 1e-6, "Expected mean residual deviance to be 0.5573887, but got " \
                                                         "{0}".format(mean_residual_deviance)
    predictions = dl.predict(insurance)
    assert abs(47.80020346-predictions[0].mean()) < 1e-6, "Expected mean of predictions to be 47.80020346, but got " \
                                                          "{0}".format(mean_residual_deviance)
    assert abs(2.017399703-predictions[0].min()) < 1e-6, "Expected min of predictions to be 2.017399703, but got " \
                                                          "{0}".format(mean_residual_deviance)
    assert abs(285.0190279-predictions[0].max()) < 1e-6, "Expected max of predictions to be 285.0190279, but got " \
                                                          "{0}".format(mean_residual_deviance)

    # with offset
    dl = h2o.deeplearning(x=insurance[0:3],y=insurance["Claims"],distribution="tweedie",hidden=[1],epochs=1000,
                          train_samples_per_iteration=-1,reproducible=True,activation="Tanh",single_node_mode=False,
                          balance_classes=False,force_load_balance=False,seed=23123,tweedie_power=1.5,
                          score_training_samples=0,score_validation_samples=0,offset_column="offset",
                          training_frame=insurance)
    mean_residual_deviance = dl.mean_residual_deviance()
    assert abs(0.2606853029-mean_residual_deviance) < 1e-6, "Expected mean residual deviance to be 0.5573887, but got " \
                                                         "{0}".format(mean_residual_deviance)
    predictions = dl.predict(insurance)
    assert abs(49.28646452-predictions[0].mean()) < 1e-6, "Expected mean of predictions to be 49.28646452, but got " \
                                                          "{0}".format(mean_residual_deviance)
    assert abs(1.068305274-predictions[0].min()) < 1e-6, "Expected min of predictions to be 1.068305274, but got " \
                                                         "{0}".format(mean_residual_deviance)
    assert abs(397.0244326-predictions[0].max()) < 1e-6, "Expected max of predictions to be 397.0244326, but got " \
                                                         "{0}".format(mean_residual_deviance)
if __name__ == "__main__":
    h2o.run_test(sys.argv, tweedie_offset)


text:
If you want to add handwriting recognition to your webapp please consider [myscript-math-web](https://github.com/MyScript/myscript-math-web) and [myscript-text-web](https://github.com/MyScript/myscript-text-web) based on MyScriptJS.
If you need more customization please take time to read the [developer guide](http://doc.myscript.com/MyScriptCloud/3.0.0/myscript-web.html).

## Contribute

We welcome your contributions: If you would like to extend MyScriptJS for your needs, feel free to fork it!

Please sign our [Contributor License Agreement](CONTRIBUTING.md) before submitting your pull request.

## Share your feedback

Made a cool app with MyScriptJS? We would love to hear about you!

We're planning to showcase apps using it so let us know by sending a quick mail to [myapp@myscript.com](mailto://myapp@myscript.com)


text:
// -----------------------------------------------------------------------
// <copyright file="AccountsModuleTests.cs" company="SugarCrm + PocoGen + REST">
// Copyright (c) SugarCrm + PocoGen + REST. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace SugarRestSharp.IntegrationTests
{
    using Helpers;
    using Models;
    using Newtonsoft.Json.Linq;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using Xunit;

    public class AccountsModuleTests
    {
        [Fact]
        public void CRUDTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            Account insertAccount = AccountsModule.GetTestAccount();

            // -------------------Create Account-------------------
            SugarRestResponse response = AccountsModule.CreateAccount(client, insertAccount);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string insertId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(insertId);
            Assert.NotEmpty(insertId);
            // -------------------End Create Account-------------------

            // -------------------Read Account-------------------
            response = AccountsModule.ReadAccount(client, insertId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            Account readOnCreateAccount = (Account)response.Data;

            Assert.NotNull(readOnCreateAccount);
            Assert.Equal(insertAccount.Name, readOnCreateAccount.Name);
            Assert.Equal(insertAccount.Industry, readOnCreateAccount.Industry);
            Assert.Equal(insertAccount.Website, readOnCreateAccount.Website);
            Assert.Equal(insertAccount.ShippingAddressCity, readOnCreateAccount.ShippingAddressCity);
            // -------------------End Read Account-------------------

            // -------------------Update Account-------------------
            response = AccountsModule.UpdateAccount(client, readOnCreateAccount.Id);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string updateId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(updateId);
            Assert.NotEmpty(updateId);
            // -------------------End Update Account-------------------

            // -------------------Read Account-------------------
            response = AccountsModule.ReadAccount(client, updateId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            Account readOnUpdateAccount = (Account)response.Data;

            Assert.NotNull(readOnUpdateAccount.Name);
            Assert.NotEmpty(readOnUpdateAccount.Name);
            Assert.Equal(updateId, updateId);
            Assert.NotEqual(readOnCreateAccount.Name, readOnUpdateAccount.Name);
            // -------------------End Read Account-------------------

            // -------------------Delete Account-------------------
            response = AccountsModule.DeleteAccount(client, updateId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string deleteId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(deleteId);
            Assert.NotEmpty(deleteId);
            Assert.Equal(insertId, deleteId);
            // -------------------End Delete Account-------------------
        }

        [Fact]
        public void BulkCRUDTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);
            List<Account> insertAccounts = AccountsModule.GetTestBulkAccount();

            // -------------------Create Bulk Account-------------------
            SugarRestResponse response = AccountsModule.BulkCreateAccount(client, insertAccounts);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            List<string> insertIds = (response.Data == null) ? null : ((IList)response.Data).Cast<string>().ToList();

            Assert.NotNull(insertIds);
            Assert.Equal(insertAccounts.Count, insertIds.Count);

            foreach (string id in insertIds)
            {
                Assert.NotNull(id);
                Assert.NotEmpty(id);
            }
            // -------------------End Bulk Create Account-------------------

            // -------------------Bulk Read Account-------------------
            List<Account> readOnCreateAccounts = AccountsModule.BulkReadAccount2(client, insertIds);

            Assert.NotNull(readOnCreateAccounts);
            Assert.Equal(insertIds.Count, readOnCreateAccounts.Count);

            foreach (var account in readOnCreateAccounts)
            {
                Assert.NotNull(account);
                Assert.NotNull(account.Id);
                Assert.NotEmpty(account.Id);
            }

            // -------------------End Bulk Read Account-------------------

            // -------------------Bulk Update Account-------------------
            Dictionary<string, string> accountNameDic = new Dictionary<string, string>();

            foreach (var account in readOnCreateAccounts)
            {
                accountNameDic[account.Id] = account.Name;
            }

            response = AccountsModule.BulkUpdateAccount(client, readOnCreateAccounts);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            List<string> updateIds = (response.Data == null) ? null :  ((IList)response.Data) as List<string>;

            Assert.NotNull(updateIds);
            foreach (string id in updateIds)
            {
                Assert.NotNull(id);
                Assert.NotEmpty(id);
            }
            // -------------------End Bulk Update Account-------------------

            // -------------------Bulk Read Account-------------------
            List<Account> readOnUpdateAccounts = AccountsModule.BulkReadAccount2(client, updateIds);

            Assert.NotNull(readOnUpdateAccounts);
            Assert.Equal(updateIds.Count, readOnUpdateAccounts.Count);

            foreach (var item in accountNameDic)
            {
                Account account = readOnUpdateAccounts.FirstOrDefault(x => x.Id == item.Key);
                Assert.NotNull(account);
                Assert.NotEqual(item.Value, account.Name);
            }
            // -------------------End Bulk Read Account-------------------

            // -------------------Bulk Delete Account-------------------
            List<string> deleteIds = AccountsModule.BulkDeleteAccount(client, updateIds);

            Assert.NotNull(deleteIds);
            Assert.Equal(updateIds.Count, deleteIds.Count);

            List<string> comparedIds = deleteIds.Except(updateIds, StringComparer.OrdinalIgnoreCase).ToList();

            if (comparedIds != null)
            {
                Assert.Equal(comparedIds.Count, 0);
            }
            // -------------------End Bulk Delete Account-------------------
        }

        [Fact]
        public void ReadByTypeTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            Account insertAccount = AccountsModule.GetTestAccount();

            // -------------------Create Account-------------------
            SugarRestResponse response = AccountsModule.CreateAccountByType(client, insertAccount);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string insertId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(insertId);
            Assert.NotEmpty(insertId);
            // -------------------End Create Account-------------------

            // -------------------Read Account-------------------
            response = AccountsModule.ReadAccountByType(client, insertId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            Account readOnCreateAccount = (Account) response.Data;

            Assert.NotNull(readOnCreateAccount);
            Assert.Equal(insertAccount.Name, readOnCreateAccount.Name);
            Assert.Equal(insertAccount.Industry, readOnCreateAccount.Industry);
            Assert.Equal(insertAccount.Website, readOnCreateAccount.Website);
            Assert.Equal(insertAccount.ShippingAddressCity, readOnCreateAccount.ShippingAddressCity);
            // -------------------End Read Account-------------------

            // -------------------Delete Account-------------------
            response = AccountsModule.DeleteAccountByType(client, readOnCreateAccount.Id);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string deleteId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(deleteId);
            Assert.NotEmpty(deleteId);
            Assert.Equal(insertId, deleteId);
            // -------------------End Delete Account-------------------
        }

        [Fact]
        public void ReadByTypeJDataTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            Account insertAccount = AccountsModule.GetTestAccount();

            // -------------------Create Account-------------------
            SugarRestResponse response = AccountsModule.CreateAccountByType(client, insertAccount);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string insertId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(insertId);
            Assert.NotEmpty(insertId);
            // -------------------End Create Account-------------------

            // -------------------Read Account-------------------
            response = AccountsModule.ReadAccountByType(client, insertId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);
            Assert.NotNull(response.JData);
            Assert.NotEmpty(response.JData);

            JObject jobject = JObject.Parse(response.JData);
            Assert.NotNull(jobject);

            var jproperties = jobject.Properties().ToList();
            List<string> selectedFields = AccountsModule.GetJsonSelectedField();

            Assert.Equal(selectedFields.Count, jproperties.Count);

            foreach (string id in selectedFields)
            {
                JProperty property = jproperties.SingleOrDefault(p => p.Name == id);
                Assert.NotNull(property);
            }

            Account readOnCreateAccount = (Account)response.Data;
            // -------------------End Read Account-------------------

            // -------------------Delete Account-------------------
            response = AccountsModule.DeleteAccountByType(client, readOnCreateAccount.Id);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string deleteId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(deleteId);
            Assert.NotEmpty(deleteId);
            Assert.Equal(insertId, deleteId);
            // -------------------End Delete Account-------------------
        }

        [Fact]
        public async void ReadAsyncTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            Account insertAccount = AccountsModule.GetTestAccount();

            // -------------------Create Account-------------------
            SugarRestResponse response = await AccountsModule.CreateAccountAsync(client, insertAccount);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string insertId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(insertId);
            Assert.NotEmpty(insertId);
            // -------------------End Create Account-------------------

            // -------------------Read Account-------------------
            response = await AccountsModule.ReadAccountAsync(client, insertId);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            Account readOnCreateAccount = (Account) response.Data;

            Assert.NotNull(readOnCreateAccount);
            Assert.Equal(insertAccount.Name, readOnCreateAccount.Name);
            Assert.Equal(insertAccount.Industry, readOnCreateAccount.Industry);
            Assert.Equal(insertAccount.Website, readOnCreateAccount.Website);
            Assert.Equal(insertAccount.ShippingAddressCity, readOnCreateAccount.ShippingAddressCity);
            // -------------------End Read Account-------------------

            // -------------------Delete Account-------------------
            response = await AccountsModule.DeleteAccountAsync(client, readOnCreateAccount.Id);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            string deleteId = (response.Data == null) ? string.Empty : response.Data.ToString();

            Assert.NotNull(deleteId);
            Assert.NotEmpty(deleteId);
            Assert.Equal(insertId, deleteId);
            // -------------------End Delete Account-------------------
        }

        [Fact]
        public void ReadBulkTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            // -------------------Bulk Read Account-------------------
            int count = 10;
            SugarRestResponse response = AccountsModule.BulkReadAccount(client, count);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            List<Account> readAccounts = (List<Account>)(response.Data);
            Assert.NotNull(readAccounts);
            Assert.True(readAccounts.Count <= count);
            // -------------------End Bulk Read Account-------------------
        }

        [Fact]
        public async void ReadBulkAsyncTest()
        {
            var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password);

            // -------------------Bulk Read Account-------------------
            int count = 25;
            SugarRestResponse response = await AccountsModule.BulkReadAccountAsync(client, count);

            Assert.NotNull(response);
            Assert.Equal(response.StatusCode, HttpStatusCode.OK);

            List<Account> readAccounts = (List<Account>) response.Data;
            Assert.NotNull(readAccounts);
            Assert.True(readAccounts.Count <= count);
            // -------------------End Bulk Read Account-------------------
        }
    }
}


text:
package cmd

import (
	"fmt"
	"log"
	"path/filepath"

	"github.com/spf13/cobra"
	"github.com/stve/tn/tags"
)

func init() {
	tagCmd.Flags().BoolVarP(&autoTag, "auto", "", false, "Autotag all files in the current directory by filename")
	tagCmd.Flags().StringVarP(&artist, "artist", "", "", "Set the artist name")
	tagCmd.Flags().StringVarP(&album, "album", "", "", "Set the album name")
	tagCmd.Flags().StringVarP(&title, "title", "", "", "Set the song title")
	tagCmd.Flags().StringVarP(&file, "file", "", "", "A specific file to tag")

	rootCmd.AddCommand(tagCmd)
}

var autoTag bool
var artist string
var album string
var title string
var file string

var tagCmd = &cobra.Command{
	Use:   "tag",
	Short: "Show currently set tags for all mp3 files",
	Run: func(cmd *cobra.Command, args []string) {
		if autoTag {
			tags.AutoTag()
			return
		}

		if file != "" {
			tags.SaveData(file, artist, album, title)
		}

		files, _ := filepath.Glob("*.mp3")
		for i := 0; i < len(files); i++ {

			fmt.Println("\n************************************")
			fmt.Println("File: " + files[i] + ":")

			err := tags.SaveData(files[i], artist, album, title)
			if err != nil {
				log.Println("Error!")
			}

		}
	},
}


text:
require_relative '../../spec_helper'
require_relative 'shared/comparison_coerce'

describe "Integer#>=" do
  ruby_version_is "2.4"..."2.5" do
    it_behaves_like :integer_comparison_coerce_rescue, :>=
  end

  ruby_version_is "2.5" do
    it_behaves_like :integer_comparison_coerce_not_rescue, :>=
  end

  context "fixnum" do
    it "returns true if self is greater than or equal to the given argument" do
      (13 >= 2).should == true
      (-500 >= -600).should == true

      (1 >= 5).should == false
      (2 >= 2).should == true
      (5 >= 5).should == true

      (900 >= bignum_value).should == false
      (5 >= 4.999).should == true
    end

    it "raises an ArgumentError when given a non-Integer" do
      lambda { 5 >= "4"       }.should raise_error(ArgumentError)
      lambda { 5 >= mock('x') }.should raise_error(ArgumentError)
    end
  end

  context "bignum" do
    before :each do
      @bignum = bignum_value(14)
    end

    it "returns true if self is greater than or equal to other" do
      (@bignum >= @bignum).should == true
      (@bignum >= (@bignum + 2)).should == false
      (@bignum >= 5664.2).should == true
      (@bignum >= 4).should == true
    end

    it "raises an ArgumentError when given a non-Integer" do
      lambda { @bignum >= "4" }.should raise_error(ArgumentError)
      lambda { @bignum >= mock('str') }.should raise_error(ArgumentError)
    end
  end
end


text:
// This file is automatically generated.

package adila.db;

/*
 * LG L70
 *
 * DEVICE: w5n
 * MODEL: LG-D320
 */
final class w5n_lg2dd320 {
    public static final String DATA = "LG|L70|";
}


text:
import random

from . import AbstractDome

class Dome(AbstractDome):
    """Simulator for a Dome controller."""

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._state = 'Disconnected'

    @property
    def is_open(self):
        return self.state == 'Open'

    @property
    def is_closed(self):
        return self.state == 'Closed'

    @property
    def state(self):
        return self._state

    def connect(self):
        if not self.is_connected:
            self._is_connected = True
            # Pick a random initial state.
            self._state = random.choice(['Open', 'Closed', 'Unknown'])
        return self.is_connected

    def disconnect(self):
        self._is_connected = False
        return True

    def open(self):
        self._state = 'Open'
        return self.is_open

    def close(self):
        self._state = 'Closed'
        return self.is_closed


text:
import re
import argparse
import html
import requests
from io import BytesIO
from os.path import join
from PIL import Image

class RedditGrabber(object):
    def __init__(self, subreddit):
        self._url = "https://www.reddit.com/r/" + subreddit

    def _decode(self, text):
        text = html.unescape(text)
        m = re.findall(r"<a href=\"([^\"]+)\" class=\"may-blank\">",
                       text)
        return [html.unescape(url) for url in m]

    def download_all(self, folder="", size=None, fit=None):
        if folder is None:
            folder = ""
        headers = {
            "Accept":"*/*",
            "Accept-Encoding":"gzip, deflate",
            "Connection":"keep-alive",
            "User-Agent":"python-requests/2.12.4",
            "User-agent": "Mozilla/5.0"
        }
        r = requests.get(self._url, headers=headers)
        pic_urls = self._decode(r.text)
        if not pic_urls:
            return
        i = 1
        for pic_url in pic_urls:
            # pic_url = html.unescape(pic_url)
            r = requests.get(pic_url, headers=headers)
            if "image/" in r.headers['content-type']:
                print(pic_url, end=" ")
                print("(" + r.headers['content-type'] + ")", end=" ")
                im = Image.open(BytesIO(r.content))
                print(im.size)
                if size:
                    if size[0] > im.size[0] and size[1] > im.size[1]:
                        print("image too small. skipping")
                        continue
                    if fit and size[0] > 0 and size[1] > 0:
                        screen_ratio = size[0] / size[1]
                        img_ratio = im.size[0] / im.size[1]
                        intersect = screen_ratio / img_ratio
                        if intersect > 1:
                            intersect = 1 / intersect
                        if intersect*100 < fit:
                            print("image doesn't fit. skipping")
                            continue
                im.save(join(folder, "img{}.jpg".format(i)))
                i += 1

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('subreddit', help="subreddit to grab from")
    parser.add_argument('-s', '--size', metavar=("WIDTH", "HEIGHT"),
                        help="the minimum width and height"
                        " the picture should have" , nargs=2, type=int)
    parser.add_argument('-o', '--output', help="output folder")
    parser.add_argument('-f', '--fit', help="in percent how much the image "
                        "fit the screen", type=int)
    args = parser.parse_args()

    rg = RedditGrabber(args.subreddit)
    rg.download_all(args.output, args.size, args.fit)

if __name__ == "__main__":
    main()


text:
namespace performancelayers {

int64_t GetThreadId() {
#ifdef __linux__
  static thread_local int64_t tid = syscall(SYS_gettid);
  return tid;
#else
  return 0;
#endif
}

int64_t GetProcessId() {
#ifdef __linux__
  static int64_t pid = getpid();
  return pid;
#else
  return 0;
#endif
}

TimestampClock::time_point GetTimestamp() { return TimestampClock::now(); }

DurationClock::time_point Now() { return DurationClock::now(); }

FunctionInterceptor::FunctionInterceptor(
    InterceptedVulkanFunc intercepted_function) {
  FunctionNameToPtr& registered_functions = GetInterceptedFunctions();
  assert(registered_functions.count(
             intercepted_function.vulkan_function_name) == 0 &&
         "Already registered");
  registered_functions[intercepted_function.vulkan_function_name] =
      intercepted_function.layer_function;
}

PFN_vkVoidFunction FunctionInterceptor::GetInterceptedOrNull(
    std::string_view vk_function_name) {
  assert(!vk_function_name.empty());
  assert(vk_function_name.find("vk") == 0 &&
         "Vulkan function names must start with 'vk'.");
  FunctionNameToPtr& registered_functions = GetInterceptedFunctions();
  if (auto it = registered_functions.find(vk_function_name);
      it != registered_functions.end())
    return it->second;
  return nullptr;
}

FunctionInterceptor::FunctionNameToPtr&
FunctionInterceptor::GetInterceptedFunctions() {
  static auto* registered_functions =
      new FunctionInterceptor::FunctionNameToPtr();
  assert(registered_functions);
  return *registered_functions;
}

}  // namespace performancelayers


text:
package org.apache.skywalking.oap.server.core.analysis.worker;

import java.io.IOException;
import org.apache.skywalking.oap.server.core.analysis.record.Record;
import org.apache.skywalking.oap.server.core.storage.IBatchDAO;
import org.apache.skywalking.oap.server.core.storage.IRecordDAO;
import org.apache.skywalking.oap.server.core.storage.StorageModule;
import org.apache.skywalking.oap.server.core.storage.model.Model;
import org.apache.skywalking.oap.server.core.worker.AbstractWorker;
import org.apache.skywalking.oap.server.library.client.request.InsertRequest;
import org.apache.skywalking.oap.server.library.module.ModuleDefineHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RecordPersistentWorker extends AbstractWorker<Record> {

    private static final Logger LOGGER = LoggerFactory.getLogger(RecordPersistentWorker.class);

    private final Model model;
    private final IRecordDAO recordDAO;
    private final IBatchDAO batchDAO;

    RecordPersistentWorker(ModuleDefineHolder moduleDefineHolder, Model model, IRecordDAO recordDAO) {
        super(moduleDefineHolder);
        this.model = model;
        this.recordDAO = recordDAO;
        this.batchDAO = moduleDefineHolder.find(StorageModule.NAME).provider().getService(IBatchDAO.class);
    }

    @Override
    public void in(Record record) {
        try {
            InsertRequest insertRequest = recordDAO.prepareBatchInsert(model, record);
            batchDAO.insert(insertRequest);
        } catch (IOException e) {
            LOGGER.error(e.getMessage(), e);
        }
    }
}


text:
#include "gl_wrapper/object/x_right_hand.hpp"

using namespace gl_wrapper;

XRightHand::XRightHand(const std::string& config_name, double scale)
  : config_name_(config_name), scale_(scale)
{
}

void XRightHand::display()
{
  glScaled(scale_, scale_, scale_);
  this->getRightHand()->display();
  glScaled(1.0 / scale_, 1.0 / scale_, 1.0 / scale_);
}

RightHandPtr& XRightHand::getRightHand()
{
  static RightHandPtr right_hand = RightHandPtr(new RightHand(config_name_));
  return right_hand;
}


text:
package es.alrocar.utils;

import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Properties;

import es.alrocar.poiproxy.exceptions.POIProxyException;

public class PropertyLocator {

	@PropertyParam(name = "APP.TEST")
	public String test = null;

	@PropertyParam(name = "APP.ENV")
	public String env = null;

	@PropertyParam(name = "APP.TMP")
	public String tempFolder = "/tmp";

	private final static String PROPERTIES = "poiproxy.properties";
	private Properties poiProxyProperties;

	private static PropertyLocator propertyLocator;

	private PropertyLocator() {
		init();
	}

	public static PropertyLocator getInstance() {
		if (propertyLocator == null) {
			propertyLocator = new PropertyLocator();
		}

		return propertyLocator;
	}

	private void init() {
		Field[] fields = this.getClass().getDeclaredFields();

		for (Field field : fields) {
			field.setAccessible(true);

			PropertyParam pParam = field.getAnnotation(PropertyParam.class);

			if (pParam != null) {
				try {
					field.set(
							this,
							this.getAplicacionProperties().getProperty(
									pParam.name()));

				} catch (IllegalArgumentException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (POIProxyException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}

	/**
	 * @NOT generated
	 */
	protected Properties getAplicacionProperties() throws POIProxyException {
		if (poiProxyProperties == null) {
			poiProxyProperties = getProperties(PROPERTIES);
		}
		return poiProxyProperties;
	}

	/**
	 * @NOT generated
	 */
	protected Properties getProperties(String name) throws POIProxyException {
		return PropertyLocator.cargarFicheroPropiedades(name);
	}

	public static Properties cargarFicheroPropiedades(String pStrNombre)
			throws POIProxyException {
		try {
			Properties lObjProps = new Properties();
			lObjProps.load(Thread.currentThread().getContextClassLoader()
					.getResourceAsStream(pStrNombre));
			return lObjProps;
		} catch (IOException e) {
			throw new POIProxyException(e);
		}
	}

}


text:
namespace hector_uav_msgs
{
template <class ContainerAllocator>
struct ServoCommand_
{
  typedef ServoCommand_<ContainerAllocator> Type;

  ServoCommand_()
    : header()
    , value()  {
    }
  ServoCommand_(const ContainerAllocator& _alloc)
    : header(_alloc)
    , value(_alloc)  {
    }

   typedef  ::std_msgs::Header_<ContainerAllocator>  _header_type;
  _header_type header;

   typedef std::vector<uint16_t, typename ContainerAllocator::template rebind<uint16_t>::other >  _value_type;
  _value_type value;

  typedef boost::shared_ptr< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> > Ptr;
  typedef boost::shared_ptr< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> const> ConstPtr;

}; // struct ServoCommand_

typedef ::hector_uav_msgs::ServoCommand_<std::allocator<void> > ServoCommand;

typedef boost::shared_ptr< ::hector_uav_msgs::ServoCommand > ServoCommandPtr;
typedef boost::shared_ptr< ::hector_uav_msgs::ServoCommand const> ServoCommandConstPtr;

// constants requiring out of line definition

template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::hector_uav_msgs::ServoCommand_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >::stream(s, "", v);
return s;
}

} // namespace hector_uav_msgs

namespace ros
{
namespace message_traits
{

// BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': True}
// {'std_msgs': ['/opt/ros/indigo/share/std_msgs/cmake/../msg'], 'hector_uav_msgs': ['/home/formation/catkin_ws/src/hector_quadrotor/hector_uav_msgs/msg']}

// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']

template <class ContainerAllocator>
struct IsFixedSize< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
  : FalseType
  { };

template <class ContainerAllocator>
struct IsFixedSize< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> const>
  : FalseType
  { };

template <class ContainerAllocator>
struct IsMessage< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
  : TrueType
  { };

template <class ContainerAllocator>
struct IsMessage< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> const>
  : TrueType
  { };

template <class ContainerAllocator>
struct HasHeader< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
  : TrueType
  { };

template <class ContainerAllocator>
struct HasHeader< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> const>
  : TrueType
  { };

template<class ContainerAllocator>
struct MD5Sum< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
{
  static const char* value()
  {
    return "d60ef35d4e3412dc6686b189be2523d0";
  }

  static const char* value(const ::hector_uav_msgs::ServoCommand_<ContainerAllocator>&) { return value(); }
  static const uint64_t static_value1 = 0xd60ef35d4e3412dcULL;
  static const uint64_t static_value2 = 0x6686b189be2523d0ULL;
};

template<class ContainerAllocator>
struct DataType< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
{
  static const char* value()
  {
    return "hector_uav_msgs/ServoCommand";
  }

  static const char* value(const ::hector_uav_msgs::ServoCommand_<ContainerAllocator>&) { return value(); }
};

template<class ContainerAllocator>
struct Definition< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
{
  static const char* value()
  {
    return "Header header\n\
uint16[] value\n\
\n\
================================================================================\n\
MSG: std_msgs/Header\n\
# Standard metadata for higher-level stamped data types.\n\
# This is generally used to communicate timestamped data \n\
# in a particular coordinate frame.\n\
# \n\
# sequence ID: consecutively increasing ID \n\
uint32 seq\n\
#Two-integer timestamp that is expressed as:\n\
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
# time-handling sugar is provided by the client library\n\
time stamp\n\
#Frame this data is associated with\n\
# 0: no frame\n\
# 1: global frame\n\
string frame_id\n\
";
  }

  static const char* value(const ::hector_uav_msgs::ServoCommand_<ContainerAllocator>&) { return value(); }
};

} // namespace message_traits
} // namespace ros

namespace ros
{
namespace serialization
{

  template<class ContainerAllocator> struct Serializer< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
  {
    template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
    {
      stream.next(m.header);
      stream.next(m.value);
    }

    ROS_DECLARE_ALLINONE_SERIALIZER;
  }; // struct ServoCommand_

} // namespace serialization
} // namespace ros

namespace ros
{
namespace message_operations
{

template<class ContainerAllocator>
struct Printer< ::hector_uav_msgs::ServoCommand_<ContainerAllocator> >
{
  template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::hector_uav_msgs::ServoCommand_<ContainerAllocator>& v)
  {
    s << indent << "header: ";
    s << std::endl;
    Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + "  ", v.header);
    s << indent << "value[]" << std::endl;
    for (size_t i = 0; i < v.value.size(); ++i)
    {
      s << indent << "  value[" << i << "]: ";
      Printer<uint16_t>::stream(s, indent + "  ", v.value[i]);
    }
  }
};

} // namespace message_operations
} // namespace ros

#endif // HECTOR_UAV_MSGS_MESSAGE_SERVOCOMMAND_H


text:
<?php

/**
 * The smallest unit of an item, the field it self.
 */
abstract class VP_Control_FieldMultiImage extends VP_Control_FieldMulti
{

	protected $_item_max_height;

	protected $_item_max_width;

	/**
	 * Basic self setup of the object
	 * @param  SimpleXMLElement $simpleXML SimpleXML object representation of the field
	 * @return VP_Control_FieldMultiImage Field object
	 */
	protected function _basic_make($arr)
	{
		parent::_basic_make($arr);

		$this->set_item_max_height(isset($arr['item_max_height']) ? $arr['item_max_height'] : '')
		     ->set_item_max_width(isset($arr['item_max_width']) ? $arr['item_max_width'] : '');

		return $this;
	}

	protected function _setup_data()
	{
		parent::_setup_data();
		$this->add_data('item_max_height', $this->get_item_max_height());
		$this->add_data('item_max_width', $this->get_item_max_width());
	}

	public function add_items_from_array($_items){
		foreach ($_items as $item)
		{
			$the_item = new VP_Control_Field_Item_Generic();
			$the_item->value($item['value'])
				 	 ->label($item['label'])
				 	 ->img($item['img']);
			$this->add_item($the_item);
		}
	}

	/**
	 * Get item max height
	 *
	 * @return Integer Item Max Height
	 */
	public function get_item_max_height() {
		return $this->_item_max_height;
	}

	/**
	 * Set item max height
	 *
	 * @param Integer $_item_max_height Item Max Height
	 */
	public function set_item_max_height($_item_max_height) {
		$this->_item_max_height = $_item_max_height;
		return $this;
	}

	/**
	 * Get item max width
	 *
	 * @return Integer Item Max Width
	 */
	public function get_item_max_width() {
		return $this->_item_max_width;
	}

	/**
	 * Set item max width
	 *
	 * @param Integer $_item_max_width Item Max Width
	 */
	public function set_item_max_width($_item_max_width) {
		$this->_item_max_width = $_item_max_width;
		return $this;
	}

}

/**
 * EOF
 */


text:
jquery-plugins
==============

jQuery Plugins


text:
package controllers

import kafka.manager.ActorModel.ConsumerIdentity
import kafka.manager.{ApiError, Kafka_0_8_1_1, Kafka_0_8_2_0, Kafka_0_8_2_1}
import play.api.data.validation.{Constraint, Invalid, Valid}
import play.api.mvc._
import scala.util.{Failure, Success, Try}
import scalaz.{-\/, \/-}

/**
 * @author cvcal
 */
object Consumer extends Controller{
  import play.api.libs.concurrent.Execution.Implicits.defaultContext

  private[this] val kafkaManager = KafkaManagerContext.getKafkaManager

  def consumers(cluster: String) = Action.async {
    kafkaManager.getConsumerListExtended(cluster).map { errorOrConsumerList =>
      Ok(views.html.consumer.consumerList(cluster, errorOrConsumerList))
    }
  }

  def consumer(cluster: String, consumerGroup: String) = Action.async {
    kafkaManager.getConsumerIdentity(cluster,consumerGroup).map { errorOrConsumerIdentity =>
      Ok(views.html.consumer.consumerView(cluster,consumerGroup,errorOrConsumerIdentity))
    }
  }

  def consumerAndTopic(cluster: String, consumerGroup: String, topic: String) = Action.async {
    kafkaManager.getConsumedTopicState(cluster,consumerGroup,topic).map { errorOrConsumedTopicState =>
      Ok(views.html.consumer.consumedTopicView(cluster,consumerGroup,topic,errorOrConsumedTopicState))
    }
  }
}