text:
package org.mitre.taxii.validator;

import static spark.SparkBase.port;
import static spark.SparkBase.staticFileLocation;

public class App {
	private static final int PORT = System.getenv("PORT") != null ? Integer.parseInt(System.getenv("PORT")) : 8080;

	public static void main(String[] args) {

		port(PORT);
		staticFileLocation("/public");

		new ValidatorResource(new ValidatorService());
	}
}

redpajama_set_name: RedPajamaGithub


text:
curl -X POST https://threatfox-api.abuse.ch/api/v1/ -d '{ "query": "taginfo", "tag": "Mozi", "limit": 1000 }' > mozi-raw.json

# Local Elasticsearch & Kibana
ES_HOST='http://elastic:password@localhost:9200'
KBN_HOST='http://elastic:password@localhost:5601'

# Elastic Cloud
# ES_HOST='https://elastic:changeme@abcdef0123456789abcdef0123456789.us-central1.gcp.cloud.es.io:9243'
# KBN_HOST='https://elastic:changeme@0123456789abcdef01234567890abcdef.us-central1.gcp.cloud.es.io:9243'

# Create the Threat Fox Ingest Pipeline
curl -XPUT ${ES_HOST}/_ingest/pipeline/threatfox-enrichment -H 'Content-Type: application/json' -d@ingest-node-pipeline.json

# Creates a new index called 'indicators' with the given settings
curl -XPUT ${ES_HOST}/indicators -H 'Content-Type: application/json' -d@index-settings.json

# Ingests raw data from the cURL response of Threat Fox in the file listed, then does a bulk upload to ES
cat mozi-raw.json | jq -c -r '.data[]' | \
while read line; do
    echo '{"index":{}}';
    echo $line;
done | \
curl --silent -XPOST \
    -H 'Content-Type: application/x-ndjson' \
    --data-binary \
    @- \
    ${ES_HOST}/indicators/_doc/_bulk

# Create Kibana index pattern
curl -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
     ${KBN_HOST}/api/index_patterns/index_pattern -d'
{
    "override": false,
    "refresh_fields": true,
    "index_pattern": {
        "title": "indicators*",
        "timeFieldName": "event.ingested"
    }
}'


text:
<?php

namespace AppBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class NewsType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('title')
            ->add('text', 'textarea')
            ->add('image', 'file', [
                'required' => false
            ]);
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'AppBundle\Document\News',
        ));
    }

    public function getName()
    {
        return 'chord';
    }
}


text:
targets		:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \
		   piggy.o vmlinux.lds
EXTRA_AFLAGS	:= -traditional

OBJECTS = $(obj)/head.o $(obj)/misc.o

#
# IMAGE_OFFSET is the load offset of the compression loader
#
#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x2000])
#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x00400000])

LDFLAGS_vmlinux := -T

$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o FORCE
	$(call if_changed,ld)
	@:

$(obj)/vmlinux.bin: vmlinux FORCE
	$(call if_changed,objcopy)

$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
	$(call if_changed,gzip)

CFLAGS_misc.o += -fpic

ifdef CONFIG_MMU
LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T
else
LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r -T
endif

OBJCOPYFLAGS += -R .empty_zero_page

$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
	$(call if_changed,ld)


text:
package ru.stqa.ptf.addressbook.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * Created by legai on 12.10.2016.
 */
public class HelperBase {
  protected WebDriver wd;

  public HelperBase(WebDriver wd) {
    this.wd = wd;
  }

  protected void click(By locator) {
    wd.findElement(locator).click();
  }

  protected void findElementByCss(String cssSelector){
    findElement(By.cssSelector(cssSelector));
  }

  private void findElement(By by) {
    wd.findElement(by);
  }

  protected void type(By locator, String text) {
    click(locator);
    if (text != null) {
      String existingText = wd.findElement(locator).getAttribute("value");
      if (! text.equals(existingText)) {
        wd.findElement(locator).clear();
        wd.findElement(locator).sendKeys(text);
      }
    }
  }
  public boolean isAlertPresent() {
    try {
      wd.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  /**
   * Нажимаем Ок на алерте
   */
  public void alertOK() {
    wd.switchTo().alert().accept();
  }

  protected boolean isElementPresent(By locator) {
    try {
      wd.findElement(locator);
      return true;
    } catch (NoSuchElementException ex) {
      return false;
    }
  }

  public void sleepSeconds(int seconds){
    try {
      Thread.sleep(seconds*1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.kusto.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The locations and zones info for SKU. */
@Fluent
public final class SkuLocationInfoItem {
    /*
     * The available location of the SKU.
     */
    @JsonProperty(value = "location", required = true)
    private String location;

    /*
     * The available zone of the SKU.
     */
    @JsonProperty(value = "zones")
    private List<String> zones;

    /**
     * Get the location property: The available location of the SKU.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The available location of the SKU.
     *
     * @param location the location value to set.
     * @return the SkuLocationInfoItem object itself.
     */
    public SkuLocationInfoItem withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the zones property: The available zone of the SKU.
     *
     * @return the zones value.
     */
    public List<String> zones() {
        return this.zones;
    }

    /**
     * Set the zones property: The available zone of the SKU.
     *
     * @param zones the zones value to set.
     * @return the SkuLocationInfoItem object itself.
     */
    public SkuLocationInfoItem withZones(List<String> zones) {
        this.zones = zones;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (location() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property location in model SkuLocationInfoItem"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(SkuLocationInfoItem.class);
}


text:
import ejs from 'ejs';
import helpers from '../util/ejsHelpers';

require('shelljs/global');

/**
 * Render the target path with the given input using ejs
 * @param targetPath
 * @param entityName
 * @param ui
 * @param parentPath
 * @param parent
 * @returns {*}
 */
export default (targetPath, entityName, ui, parentPath = null, parent = null) => {
    const parsedPath = ejs.render(targetPath, {
        name: entityName,
        helpers,
    });
    let parsedParentPath = '';

    // If parent is provided, check whether the parent folder exists or not
    if (parent) {
        parsedParentPath = ejs.render(parentPath, {
            parent,
            helpers,
        });
        if (test('-e', `${process.cwd()}/${parsedParentPath}`)) {
            parsedParentPath = `${parsedParentPath}/`;
        } else {
            ui.writeError(`Module ${parent} doesn't exist in ${parsedParentPath}.`);
            return process.exit(1);
        }
    }

    if (!test('-e', parsedParentPath + parsedPath)) {
        return parsedParentPath + parsedPath;
    }

    ui.writeError(`File already exists in ${parsedPath}. Please choose another name.`);
    return process.exit(1);
};


text:
import itertools
import os

from conary.lib.sha1helper import md5FromString
from conary import dbstore

from rmake import errors
from rmake.build import buildcfg
from rmake.build.subscriber import _JobDbLogger
from rmake.db import authcache
from rmake.db import schema
from rmake.db import jobstore
from rmake.db import logstore
from rmake.db import nodestore
from rmake.db import subscriber

class DBInterface(object):
    def __init__(self, db):
        self._holdCommits = False
        self.db = db
        self.schemaVersion = self.loadSchema(migrate=True)

    def _getOne(self, cu, key):
        try:
            cu = iter(cu)
            res = cu.next()
            assert(not(list(cu))) # make sure that we really only
                                 # got one entry
            return res
        except:
            raise KeyError, key

    def cursor(self):
        return self.db.cursor()

    def commitAfter(self, fn, *args, **kw):
        """
            Commits after running a function
        """
        self._holdCommits = True
        self.db.transaction()
        try:
            rv = fn(*args, **kw)
            self._holdCommits = False
            self.commit()
            return rv
        except:
            self.rollback()
            self._holdCommits = False
            raise

    def commit(self):
        if not self._holdCommits:
            return self.db.commit()
        else:
            return True

    def rollback(self):
        return self.db.rollback()

    def inTransaction(self):
        return self.db.inTransaction()

    def reopen(self):
        if self.db:
            self.db.close_fork()
        self.db = self.open()

    def close(self):
        self.db.close_fork()
        self.db = None

class Database(DBInterface):

    def __init__(self, path, contentsPath, clean = False):
        self.driver, self.dbpath = path

        if os.path.exists(self.dbpath) and clean:
            os.unlink(self.dbpath)

        db = self.open()
        DBInterface.__init__(self, db)

        self.auth = authcache.AuthenticationCache(self)
        self.jobStore = jobstore.JobStore(self)
        self.logStore = logstore.LogStore(contentsPath + '/logs')
        self.jobQueue = jobstore.JobQueue(self)
        self.subscriberStore = subscriber.SubscriberData(self)
        self.nodeStore = nodestore.NodeStore(self)

    def loadSchema(self, migrate=True):
        if migrate:
            return schema.SchemaManager(self.db).loadAndMigrate()
        else:
            return schema.SchemaManager(self.db).loadSchema()

    def open(self):
        return dbstore.connect(self.dbpath, driver=self.driver, timeout=120000,
                               lockJournal=True)

    def subscribeToJob(self, job):
        """
            Watches updates to this job object and will record them
            in the db.
        """
        _JobDbLogger(self).attach(job)

    def addJob(self, job):
        jobId = self.jobStore.addJob(job)
        cfg = job.getMainConfig()
        if cfg:
            for subscriber in cfg.subscribe.values():
                self.subscriberStore.add(jobId, subscriber)
        self.commit()
        return job

    def deleteJobs(self, jobIdList):
        troveInfoList = self.jobStore.deleteJobs(jobIdList)
        self.logStore.deleteLogs(troveInfoList)
        self.commit()
        return jobIdList

    def getJob(self, jobId, withTroves=True, withConfigs=True):
        try:
            return self.jobStore.getJob(jobId, withTroves=withTroves,
                                        withConfigs=withConfigs)
        except KeyError:
            raise errors.JobNotFound(jobId)

    def _getChrootIdForTrove(self, trove):
        return self.nodeStore.getOrCreateChrootId(trove)

    def getJobs(self, jobIds, withTroves=True, withConfigs=True):
        try:
            return self.jobStore.getJobs(jobIds, withTroves=withTroves,
                                         withConfigs=withConfigs)
        except KeyError, err:
            raise errors.JobNotFound(err.args[0])

    def getTrove(self, jobId, name, version, flavor, context=''):
        try:
            return self.jobStore.getTrove(jobId, name, version, flavor, context)
        except KeyError:
            raise errors.TroveNotFound(jobId, name, version, flavor, context)

    def getTroves(self, troveList):
        try:
            return self.jobStore.getTroves(troveList)
        except KeyError, err:
            raise errors.TroveNotFound(*err.args[0])

    def getConfig(self, jobId, context=''):
        try:
            return self.jobStore.getConfig(jobId, context)
        except KeyError, err:
            raise errors.JobNotFound(err.args[0])

    def convertToJobId(self, jobIdOrUUId):
        return self.convertToJobIds([jobIdOrUUId])[0]

    def convertToJobIds(self, items):
        """
            Converts a list of mixed jobIds and uuids to jobIds
            @param jobIdUUIDList: list of jobIds or uuids, or an
            @return list of jobIds
        """
        uuids = [ x for x in items if isinstance(x, str) and len(x) == 32]

        try:
            d = dict(itertools.izip(uuids,
                                    self.jobStore.getJobIdsFromUUIDs(uuids)))
        except KeyError, err:
            raise errors.JobNotFound(err.args[0])

        jobIds = []
        for jobIdUUId in items:
            if isinstance(jobIdUUId, int):
                jobIds.append(jobIdUUId)
            elif jobIdUUId in d:
                jobIds.append(d[jobIdUUId])
            else:
                try:
                    jobId = int(jobIdUUId)
                except ValueError:
                    raise errors.JobNotFound(jobIdUUId)
                jobIds.append(jobId)

        return jobIds

    def getJobsByState(self, state, withTroves=True):
        return self.jobStore.getJobsByState(state, withTroves=withTroves)

    def popJobFromQueue(self):
        try:
            jobId = self.jobQueue.pop()
        except IndexError:
            return None
        self.commit()
        return self.getJob(jobId)

    def listJobIdsOnQueue(self):
        return self.jobQueue.listJobIds()

    def queueJob(self, job):
        self.jobQueue.add(job)
        self.commit()

    def getJobConfig(self, jobId):
        return self.jobStore.getJobConfig(jobId)

    def getSubscriber(self, subscriberId):
        return self.subscriberStore.get(subscriberId)

    def getSubscribersForEvents(self, jobId, eventList):
        subscribers = self.subscriberStore.getMatches(jobId, eventList)
        return subscribers

    def listSubscribers(self, jobId):
        subscribers = self.subscriberStore.getByJobId(jobId)
        return subscribers

    def listSubscribersByUri(self, jobId, uri):
        subscribers = self.subscriberStore.getByUri(jobId, uri)
        return subscribers

    def addSubscriber(self, jobId, subscriber):
        self.subscriberStore.add(jobId, subscriber)
        self.db.commit()
        # subscriber object is modified to store subscriberId

    def removeSubscriber(self, subscriberId):
        self.subscriberStore.remove(subscriberId)
        self.db.commit()

    def listJobs(self, activeOnly=False, jobLimit=None):
        return self.jobStore.listJobs(activeOnly, jobLimit)

    def listTrovesByState(self, jobId, state=None):
        return self.jobStore.listTrovesByState(jobId, state)

    def jobExists(self, jobId):
        return self.jobStore.jobExists(jobId)

    def isJobBuilding(self):
        return self.jobStore.isJobBuilding()

    def hasTroveBuildLog(self, trove):
        if ((trove.logPath and os.path.exists(trove.logPath))
             or self.logStore.hasTroveLog(trove)):
            return True
        return False

    def openTroveBuildLog(self, trove):
        if trove.logPath:
            try:
                return open(trove.logPath, 'r')
            except (IOError, OSError), err:
                raise errors.RmakeError('Could not open log for %s=%s[%s] from %s: %s' % (trove.getNameVersionFlavor() + (trove.jobId, err)))
        else:
            if self.logStore.hasTroveLog(trove):
                return self.logStore.openTroveLog(trove)
            raise errors.RmakeError('Log for %s=%s[%s] from %s missing' % \
                                     (trove.getNameVersionFlavor() +
                                      (trove.jobId,)))

    def updateJobStatus(self, job):
        self.jobStore.updateJobLog(job, job.status)
        self.jobStore.updateJob(job)
        self.commit()

    def updateJobLog(self, job, message):
        self.jobStore.updateJobLog(job, message)
        self.jobStore.updateJob(job)
        self.commit()

    def updateTroveLog(self, trove, message):
        self.jobStore.updateTroveLog(trove, message)
        self.jobStore.updateTrove(trove)
        self.commit()

    def updateTrove(self, trove):
        self.jobStore.updateTrove(trove)
        self.commit()

    def setBuildTroves(self, job):
        self.jobStore.setBuildTroves(job)
        self.commit()

    def trovePreparingChroot(self, trove):
        self.jobStore.updateTrove(trove)
        self.nodeStore.setChrootActive(trove, True)
        self.commit()

    def troveResolving(self, trove):
        self.jobStore.updateTrove(trove)
        self.commit()

    def troveBuilding(self, trove):
        self.jobStore.updateTrove(trove)
        self.nodeStore.setChrootActive(trove, True)
        self.commit()

    def troveBuilt(self, trove):
        self.jobStore.updateTrove(trove)
        self.jobStore.setBinaryTroves(trove, trove.getBinaryTroves())
        self.commit()

    def jobCommitted(self, job,  troveMap):
        for trove in job.iterTroves():
            committedTups = troveMap.get(trove.getNameVersionFlavor(withContext=True), None)
            if committedTups:
                binaries = [ x for x in committedTups
                             if not x[0].endswith(':source') ]
                if binaries:
                    self.jobStore.setBinaryTroves(trove, binaries)
        self.commit()

    def troveFailed(self, trove):
        self.jobStore.updateTrove(trove)
        self.commit()

    def updateTroveStatus(self, trove):
        self.jobStore.updateTrove(trove)
        if trove.isFinished():
            self.nodeStore.setChrootActive(trove, False)
        self.commit()

    # return all the log messages since last mark
    def getJobLogs(self, jobId, mark = 0):
        return self.jobStore.getJobLogs(jobId, mark=mark)

    def getTroveLogs(self, jobId, troveTuple, mark = 0):
        return self.jobStore.getTroveLogs(jobId, troveTuple, mark=mark)

    def getTroveBuildLog(self, jobId, troveTuple, mark):
        jobId = self.convertToJobId(jobId)
        trove = self.getTrove(jobId, *troveTuple)
        if not self.hasTroveBuildLog(trove):
            return not trove.isFinished(), '', 0
        f = self.openTroveBuildLog(trove)
        if mark < 0:
            f.seek(0, 2)
            end = f.tell()
            f.seek(max(end + mark, 0))
        else:
            f.seek(mark)
        return not trove.isFinished(), f.read(), f.tell()

    def addNode(self, name, host, slots, buildFlavors, chrootPaths):
        self.nodeStore.addNode(name, host, slots, buildFlavors)
        self.nodeStore.setChrootsForNode(name, chrootPaths)
        self.commit()

    def removeNode(self, name):
        self.nodeStore.removeNode(name)
        self.commit()

    def deactivateAllNodes(self):
        self.nodeStore.deactivateAllNodes()
        self.commit()

    def chrootIsActive(self, nodeName, path):
        try:
            return self.nodeStore.chrootIsActive(nodeName, path)
        except KeyError, err:
            raise errors.RmakeError('Chroot %s does not exist!' % err.args[1])

    def moveChroot(self, nodeName, path, newPath):
        self.nodeStore.moveChroot(nodeName, path, newPath)
        self.commit()

    def removeChroot(self, nodeName, path):
        self.nodeStore.removeChroot(nodeName, path)
        self.commit()

    def listChroots(self):
        return self.nodeStore.getAllChroots()

    def listNodes(self):
        return self.nodeStore.listNodes()

    def getEmptySlots(self):
        return self.nodeStore.getEmptySlots()


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/cpg/humility-and-overcoming-pride</sem:subject>
    <sem:predicate>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</sem:predicate>
    <sem:object datatype="sem:iri">http://www.w3.org/2004/02/skos/core#Concept</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/cpg/humility-and-overcoming-pride</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/curriculum-planning-guide</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/cpg/humility-and-overcoming-pride</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object xml:lang="eng" datatype="xsd:string">Humility and overcoming pride</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/cpg/humility-and-overcoming-pride</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#narrower</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept/cpg/developing-a-christ-like-character</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/cpg/humility-and-overcoming-pride</sem:subject>
    <sem:predicate>http://www.lds.org/core#relCount</sem:predicate>
    <sem:object datatype="xsd:integer">1</sem:object>
  </sem:triple>
</sem:triples>


text:
import static org.hamcrest.CoreMatchers.equalTo;
import org.junit.Test;
import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.elsewhen.palindromes.Application;

public class ApplicationTest {
    @Test public void testIsPalindromeMethod() {
        assertTrue("isPalindrome should return true",
        		Application.isPalindrome("AManAPlanACanalPanama"));
        assertFalse("isPalindrome should return false",
        		Application.isPalindrome("FooBar"));
    }

    @Test public void testGetPermutationsMethod() {
    	Set<String> expectedResult = new HashSet<>();
    	expectedResult.addAll(Arrays.asList(
    			new String[] {"ab", "ac", "ba", "bc", "ca", "cb"}));
    	assertThat(Application.getPermutations(2,
    			Arrays.asList(new String[] {"a", "b", "c"})),
    			equalTo(expectedResult));
    }
}


text:
#define INITGUID

#include "d3d11_test.h"
#include <stdio.h>
#include "../3rdparty/lz4/lz4.h"
#include "../renderdoc_app.h"
#include "../win32/win32_window.h"

typedef HRESULT(WINAPI *PFN_CREATE_DXGI_FACTORY)(REFIID, void **);

bool D3D11GraphicsTest::Init(int argc, char **argv)
{
  // parse parameters here to override parameters
  GraphicsTest::Init(argc, argv);

  // D3D11 specific can go here
  // ...

  HMODULE d3d11 = LoadLibraryA("d3d11.dll");
  HMODULE dxgi = LoadLibraryA("dxgi.dll");
  HMODULE d3dcompiler = LoadLibraryA("d3dcompiler_47.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_46.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_45.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_44.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_43.dll");

  if(!d3d11 || !dxgi || !d3dcompiler)
  {
    TEST_ERROR("Couldn't load D3D11");
    return false;
  }

  PFN_CREATE_DXGI_FACTORY createFactory =
      (PFN_CREATE_DXGI_FACTORY)GetProcAddress(dxgi, "CreateDXGIFactory");

  dyn_D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(d3d11, "D3D11CreateDevice");
  dyn_D3D11CreateDeviceAndSwapChain = (PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)GetProcAddress(
      d3d11, "D3D11CreateDeviceAndSwapChain");

  dyn_D3DCompile = (pD3DCompile)GetProcAddress(d3dcompiler, "D3DCompile");
  dyn_D3DStripShader = (pD3DStripShader)GetProcAddress(d3dcompiler, "D3DStripShader");
  dyn_D3DSetBlobPart = (pD3DSetBlobPart)GetProcAddress(d3dcompiler, "D3DSetBlobPart");

  D3D_FEATURE_LEVEL features[] = {D3D_FEATURE_LEVEL_11_0};
  D3D_DRIVER_TYPE driver = D3D_DRIVER_TYPE_HARDWARE;

  if(d3d11_1)
    features[0] = D3D_FEATURE_LEVEL_11_1;

  HRESULT hr = S_OK;

  IDXGIFactoryPtr factory = NULL;

  hr = createFactory(__uuidof(IDXGIFactory), (void **)&factory);

  if(factory.GetInterfacePtr() == NULL || FAILED(hr))
  {
    TEST_ERROR("CreateDXGIFactory failed: %x", hr);
    return false;
  }

  struct AdapterInfo
  {
    IDXGIAdapterPtr adapter;
    DXGI_ADAPTER_DESC desc;
  };

  std::vector<AdapterInfo> adapters;

  for(UINT i = 0; i < 10; i++)
  {
    IDXGIAdapterPtr a;
    hr = factory->EnumAdapters(i, &a);
    if(hr == S_OK && a)
    {
      DXGI_ADAPTER_DESC desc;
      a->GetDesc(&desc);
      adapters.push_back({a, desc});
    }
    else
    {
      break;
    }
  }

  IDXGIAdapterPtr adapter = NULL;

  for(int i = 0; i < argc; i++)
  {
    if(!strcmp(argv[i], "--warp"))
    {
      driver = D3D_DRIVER_TYPE_WARP;
      break;
    }
    if(!strcmp(argv[i], "--gpu") && i + 1 < argc)
    {
      std::string needle = strlower(argv[i + 1]);

      if(needle == "warp")
      {
        driver = D3D_DRIVER_TYPE_WARP;
        break;
      }

      const bool nv = (needle == "nv" || needle == "nvidia");
      const bool amd = (needle == "amd");
      const bool intel = (needle == "intel");

      for(size_t a = 0; a < adapters.size(); a++)
      {
        std::string haystack = strlower(Wide2UTF8(adapters[a].desc.Description));

        if(haystack.find(needle) != std::string::npos || (nv && adapters[a].desc.VendorId == 0x10DE) ||
           (amd && adapters[a].desc.VendorId == 0x1002) ||
           (intel && adapters[a].desc.VendorId == 0x8086))
        {
          driver = D3D_DRIVER_TYPE_UNKNOWN;
          adapter = adapters[a].adapter;
          break;
        }
      }

      break;
    }
  }

  UINT flags = createFlags | (debugDevice ? D3D11_CREATE_DEVICE_DEBUG : 0);

  if(headless)
  {
    hr = dyn_D3D11CreateDevice(adapter, driver, NULL, flags, features, 1, D3D11_SDK_VERSION, &dev,
                               NULL, &ctx);

    // if it failed but on a high feature level, try again on warp
    if(FAILED(hr) && features[0] != D3D_FEATURE_LEVEL_11_0)
    {
      driver = D3D_DRIVER_TYPE_WARP;
      hr = dyn_D3D11CreateDevice(adapter, driver, NULL, flags, features, 1, D3D11_SDK_VERSION, &dev,
                                 NULL, &ctx);
    }

    // if it failed again on a high feature level, try last on ref
    if(FAILED(hr) && features[0] != D3D_FEATURE_LEVEL_11_0)
    {
      driver = D3D_DRIVER_TYPE_REFERENCE;
      hr = dyn_D3D11CreateDevice(adapter, driver, NULL, flags, features, 1, D3D11_SDK_VERSION, &dev,
                                 NULL, &ctx);
    }

    if(FAILED(hr))
    {
      TEST_ERROR("D3D11CreateDevice failed: %x", hr);
      return false;
    }

    PostDeviceCreate();
    return true;
  }

  Win32Window *win = new Win32Window(screenWidth, screenHeight, screenTitle);

  mainWindow = win;

  DXGI_SWAP_CHAIN_DESC swapDesc;
  ZeroMemory(&swapDesc, sizeof(swapDesc));

  swapDesc.BufferCount = backbufferCount;
  swapDesc.BufferDesc.Format = backbufferFmt;
  swapDesc.BufferDesc.Width = screenWidth;
  swapDesc.BufferDesc.Height = screenHeight;
  swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
  swapDesc.SampleDesc.Count = backbufferMSAA;
  swapDesc.SampleDesc.Quality = 0;
  swapDesc.OutputWindow = win->wnd;
  swapDesc.Windowed = fullscreen ? FALSE : TRUE;
  swapDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
  swapDesc.Flags = 0;

  hr = dyn_D3D11CreateDeviceAndSwapChain(adapter, driver, NULL, flags, features, 1,
                                         D3D11_SDK_VERSION, &swapDesc, &swap, &dev, NULL, &ctx);

  // if it failed but on a high feature level, try again on warp
  if(FAILED(hr))
  {
    driver = D3D_DRIVER_TYPE_WARP;
    hr = dyn_D3D11CreateDeviceAndSwapChain(adapter, driver, NULL, flags, features, 1,
                                           D3D11_SDK_VERSION, &swapDesc, &swap, &dev, NULL, &ctx);
  }

  // if it failed again on a high feature level, try last on ref
  if(FAILED(hr))
  {
    driver = D3D_DRIVER_TYPE_REFERENCE;
    hr = dyn_D3D11CreateDeviceAndSwapChain(adapter, driver, NULL, flags, features, 1,
                                           D3D11_SDK_VERSION, &swapDesc, &swap, &dev, NULL, &ctx);
  }

  if(FAILED(hr))
  {
    TEST_ERROR("D3D11CreateDeviceAndSwapChain failed: %x", hr);
    return false;
  }

  hr = swap->GetBuffer(0, __uuidof(ID3D11Texture2D), (void **)&bbTex);

  if(FAILED(hr))
  {
    TEST_ERROR("swap->GetBuffer failed: %x", hr);
    dev = NULL;
    ctx = NULL;
    swap = NULL;
    return false;
  }

  hr = dev->CreateRenderTargetView(bbTex, NULL, &bbRTV);

  if(FAILED(hr))
  {
    TEST_ERROR("CreateRenderTargetView failed: %x", hr);
    return false;
  }

  PostDeviceCreate();

  return true;
}

GraphicsWindow *D3D11GraphicsTest::MakeWindow(int width, int height, const char *title)
{
  return new Win32Window(width, height, title);
}

bool D3D11GraphicsTest::IsSupported()
{
  static bool checked = false, result = false;

  if(checked)
    return result;

  checked = true;

  HMODULE d3d11 = LoadLibraryA("d3d11.dll");
  HMODULE d3dcompiler = LoadLibraryA("d3dcompiler_47.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_46.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_45.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_44.dll");
  if(!d3dcompiler)
    d3dcompiler = LoadLibraryA("d3dcompiler_43.dll");

  if(d3d11)
    FreeLibrary(d3d11);
  if(d3dcompiler)
    FreeLibrary(d3dcompiler);

  if(d3d11 && d3dcompiler)
    result = true;

  return result;
}

void D3D11GraphicsTest::PostDeviceCreate()
{
  {
    IDXGIDevicePtr pDXGIDevice;
    HRESULT hr = dev->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice);

    if(FAILED(hr) || !pDXGIDevice)
    {
      TEST_ERROR("Couldn't get DXGI Device");
    }
    else
    {
      IDXGIAdapterPtr pDXGIAdapter;
      hr = pDXGIDevice->GetParent(__uuidof(IDXGIAdapter), (void **)&pDXGIAdapter);

      if(FAILED(hr) || !pDXGIAdapter)
      {
        TEST_ERROR("Couldn't get DXGI Adapter");
      }
      else
      {
        DXGI_ADAPTER_DESC desc = {};
        pDXGIAdapter->GetDesc(&desc);

        TEST_LOG("Running D3D11 test on %ls", desc.Description);
      }
    }
  }

  // if(d3d11_1)
  {
    dev->QueryInterface(__uuidof(ID3D11Device1), (void **)&dev1);
    ctx->QueryInterface(__uuidof(ID3D11DeviceContext1), (void **)&ctx1);
  }

  // if(d3d11_2)
  {
    dev->QueryInterface(__uuidof(ID3D11Device2), (void **)&dev2);
    ctx->QueryInterface(__uuidof(ID3D11DeviceContext2), (void **)&ctx2);
  }

  ctx->QueryInterface(__uuidof(ID3DUserDefinedAnnotation), (void **)&annot);

  dev->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &opts, sizeof(opts));

  memset(&opts1, 0, sizeof(opts1));
  if(dev1)
    dev1->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS1, &opts1, sizeof(opts1));
}

void D3D11GraphicsTest::Shutdown()
{
  delete mainWindow;

  swap = NULL;
  defaultLayout = NULL;

  bbTex = NULL;
  bbRTV = NULL;

  annot = NULL;
  ctx2 = NULL;
  ctx1 = NULL;
  ctx = NULL;

  dev1 = NULL;
  dev2 = NULL;
  dev = NULL;
}

bool D3D11GraphicsTest::Running()
{
  if(!FrameLimit())
    return false;

  return mainWindow->Update();
}

void D3D11GraphicsTest::Present()
{
  swap->Present(0, 0);
}

std::vector<byte> D3D11GraphicsTest::GetBufferData(ID3D11Buffer *buffer, uint32_t offset, uint32_t len)
{
  D3D11_MAPPED_SUBRESOURCE mapped;

  TEST_ASSERT(buffer, "buffer is NULL");

  D3D11_BUFFER_DESC desc;
  buffer->GetDesc(&desc);

  if(len == 0)
    len = desc.ByteWidth - offset;

  if(len > 0 && offset + len > desc.ByteWidth)
  {
    TEST_WARN("Attempting to read off the end of the array. Will be clamped");
    len = std::min(len, desc.ByteWidth - offset);
  }

  ID3D11BufferPtr stage;

  desc.BindFlags = 0;
  desc.Usage = D3D11_USAGE_STAGING;
  desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
  desc.MiscFlags = 0;
  desc.StructureByteStride = 0;

  CHECK_HR(dev->CreateBuffer(&desc, NULL, &stage));

  std::vector<byte> ret;
  ret.resize(len);

  if(len > 0)
  {
    ctx->CopyResource(stage, buffer);

    CHECK_HR(ctx->Map(stage, 0, D3D11_MAP_READ, 0, &mapped))

    memcpy(&ret[0], mapped.pData, len);

    ctx->Unmap(stage, 0);
  }

  return ret;
}

void D3D11GraphicsTest::IASetVertexBuffer(ID3D11Buffer *vb, UINT stride, UINT offset)
{
  ctx->IASetVertexBuffers(0, 1, &vb, &stride, &offset);
}

void D3D11GraphicsTest::ClearRenderTargetView(ID3D11RenderTargetView *rt, Vec4f col)
{
  ctx->ClearRenderTargetView(rt, &col.x);
}

void D3D11GraphicsTest::RSSetViewport(D3D11_VIEWPORT view)
{
  ctx->RSSetViewports(1, &view);
}

D3D11_DEPTH_STENCIL_DESC D3D11GraphicsTest::GetDepthState()
{
  ID3D11DepthStencilState *state = NULL;
  UINT ref = 0;
  ctx->OMGetDepthStencilState(&state, &ref);

  D3D11_DEPTH_STENCIL_DESC ret;

  if(state)
  {
    state->GetDesc(&ret);
    return ret;
  }

  ret.DepthEnable = TRUE;
  ret.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
  ret.DepthFunc = D3D11_COMPARISON_LESS;
  ret.StencilEnable = FALSE;
  ret.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
  ret.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
  const D3D11_DEPTH_STENCILOP_DESC op = {
      D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS,
  };
  ret.FrontFace = op;
  ret.BackFace = op;

  return ret;
}

void D3D11GraphicsTest::SetDepthState(const D3D11_DEPTH_STENCIL_DESC &desc)
{
  ID3D11DepthStencilState *state = NULL;
  UINT ref = 0;
  ctx->OMGetDepthStencilState(&state, &ref);

  depthState = NULL;
  dev->CreateDepthStencilState(&desc, &depthState);

  ctx->OMSetDepthStencilState(depthState, ref);
}

void D3D11GraphicsTest::SetStencilRef(UINT ref)
{
  ID3D11DepthStencilState *state = NULL;
  UINT dummy = 0;
  ctx->OMGetDepthStencilState(&state, &dummy);

  ctx->OMSetDepthStencilState(state, ref);
}

ID3DBlobPtr D3D11GraphicsTest::Compile(std::string src, std::string entry, std::string profile,
                                       ID3DBlob **unstripped)
{
  ID3DBlobPtr blob = NULL;
  ID3DBlobPtr error = NULL;

  HRESULT hr =
      dyn_D3DCompile(src.c_str(), src.length(), "", NULL, NULL, entry.c_str(), profile.c_str(),
                     D3DCOMPILE_WARNINGS_ARE_ERRORS | D3DCOMPILE_DEBUG |
                         D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_OPTIMIZATION_LEVEL0,
                     0, &blob, &error);

  if(FAILED(hr))
  {
    TEST_ERROR("Failed to compile shader, error %x / %s", hr,
               error ? (char *)error->GetBufferPointer() : "Unknown");

    blob = NULL;
    error = NULL;
    return NULL;
  }

  if(unstripped)
  {
    blob.AddRef();
    *unstripped = blob.GetInterfacePtr();

    ID3DBlobPtr stripped = NULL;

    dyn_D3DStripShader(blob->GetBufferPointer(), blob->GetBufferSize(),
                       D3DCOMPILER_STRIP_REFLECTION_DATA | D3DCOMPILER_STRIP_DEBUG_INFO, &stripped);

    blob = NULL;

    return stripped;
  }

  return blob;
}

void D3D11GraphicsTest::WriteBlob(std::string name, ID3DBlob *blob, bool compress)
{
  FILE *f = NULL;
  fopen_s(&f, name.c_str(), "wb");

  if(f == NULL)
  {
    TEST_ERROR("Can't open blob file to write %s", name.c_str());
    return;
  }

  if(compress)
  {
    int uncompSize = (int)blob->GetBufferSize();
    char *compBuf = new char[uncompSize];

    int compressedSize = LZ4_compress_default((const char *)blob->GetBufferPointer(), compBuf,
                                              uncompSize, uncompSize);

    fwrite(compBuf, 1, compressedSize, f);

    delete[] compBuf;
  }
  else
  {
    fwrite(blob->GetBufferPointer(), 1, blob->GetBufferSize(), f);
  }

  fclose(f);
}

ID3DBlobPtr D3D11GraphicsTest::SetBlobPath(std::string name, ID3DBlob *blob)
{
  ID3DBlobPtr newBlob = NULL;

  const GUID RENDERDOC_ShaderDebugMagicValue = RENDERDOC_ShaderDebugMagicValue_struct;

  std::string pathData;
  for(size_t i = 0; i < sizeof(RENDERDOC_ShaderDebugMagicValue); i++)
    pathData.push_back(' ');

  pathData += name;

  memcpy(&pathData[0], &RENDERDOC_ShaderDebugMagicValue, sizeof(RENDERDOC_ShaderDebugMagicValue));

  dyn_D3DSetBlobPart(blob->GetBufferPointer(), blob->GetBufferSize(), D3D_BLOB_PRIVATE_DATA, 0,
                     pathData.c_str(), pathData.size() + 1, &newBlob);

  return newBlob;
}

void D3D11GraphicsTest::SetBlobPath(std::string name, ID3D11DeviceChild *shader)
{
  const GUID RENDERDOC_ShaderDebugMagicValue = RENDERDOC_ShaderDebugMagicValue_struct;

  shader->SetPrivateData(RENDERDOC_ShaderDebugMagicValue, (UINT)name.size() + 1, name.c_str());
}

void D3D11GraphicsTest::CreateDefaultInputLayout(ID3DBlobPtr vsblob)
{
  D3D11_INPUT_ELEMENT_DESC layoutdesc[] = {
      {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
      {"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
      {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 28, D3D11_INPUT_PER_VERTEX_DATA, 0},
  };

  CHECK_HR(dev->CreateInputLayout(layoutdesc, ARRAY_COUNT(layoutdesc), vsblob->GetBufferPointer(),
                                  vsblob->GetBufferSize(), &defaultLayout));
}

ID3D11VertexShaderPtr D3D11GraphicsTest::CreateVS(ID3DBlobPtr blob)
{
  ID3D11VertexShaderPtr ret;
  CHECK_HR(dev->CreateVertexShader(blob->GetBufferPointer(), blob->GetBufferSize(), NULL, &ret));
  return ret;
}

ID3D11PixelShaderPtr D3D11GraphicsTest::CreatePS(ID3DBlobPtr blob)
{
  ID3D11PixelShaderPtr ret;
  CHECK_HR(dev->CreatePixelShader(blob->GetBufferPointer(), blob->GetBufferSize(), NULL, &ret));
  return ret;
}

ID3D11ComputeShaderPtr D3D11GraphicsTest::CreateCS(ID3DBlobPtr blob)
{
  ID3D11ComputeShaderPtr ret;
  CHECK_HR(dev->CreateComputeShader(blob->GetBufferPointer(), blob->GetBufferSize(), NULL, &ret));
  return ret;
}

ID3D11GeometryShaderPtr D3D11GraphicsTest::CreateGS(ID3DBlobPtr blob,
                                                    const std::vector<D3D11_SO_DECLARATION_ENTRY> &sodecl,
                                                    const std::vector<UINT> &strides)
{
  ID3D11GeometryShaderPtr ret;
  CHECK_HR(dev->CreateGeometryShaderWithStreamOutput(blob->GetBufferPointer(), blob->GetBufferSize(),
                                                     &sodecl[0], (UINT)sodecl.size(), &strides[0],
                                                     (UINT)strides.size(), 0, NULL, &ret));
  return ret;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="nt:unstructured">
    <navigation
        jcr:primaryType="nt:unstructured"
        sling:resourceType="citraining/components/structure/navigation"/>
    <search
        jcr:primaryType="nt:unstructured"
        sling:resourceType="citraining/components/structure/search"/>
</jcr:root>


text:
package com.serviceenabled.dropwizardrequesttracker;

public class RequestTrackerConfiguration {

	public RequestTrackerConfiguration() {}

	public RequestTrackerConfiguration(String headerName, String mdcKey) {
		setHeaderName(headerName);
		setMdcKey(mdcKey);
	}

	private String headerName = "X-Request-Tracker";
	private String mdcKey = "Request-Tracker";
	private Boolean addResponseHeader = false;

	public Boolean getAddResponseHeader() {
		return this.addResponseHeader;
	}

	public void setAddResponseHeader(Boolean val) {
		this.addResponseHeader = val;
	}

	public String getHeaderName() {
		return headerName;
	}

	public void setHeaderName(String headerName) {
		this.headerName = headerName;
	}

	public String getMdcKey() {
		return mdcKey;
	}

	public void setMdcKey(String mdcKey) {
		this.mdcKey = mdcKey;
	}
}


text:
describe('Pinocchio.Application', function() {

  describe('Plugin System', function() {

    it('should add plugin method to the instance of an application', function() {
      Pinocchio.Application.Plugin.test = function() {
        return true;
      };
      var app = new Pinocchio.Application;
      expect(app.test).toBeTruthy();
    });

    it('should execute the method when called from a instance of app', function() {
      Pinocchio.Application.Plugin.test = sinon.spy();
      var app = new Pinocchio.Application;
      app.test();
      expect(Pinocchio.Application.Plugin.test).toHaveBeenCalledOnce();
    });

  });

});


text:
package trafficmanager

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"encoding/json"
	"github.com/Azure/go-autorest/autorest"
)

// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-03-01/trafficmanager"

// CheckTrafficManagerRelativeDNSNameAvailabilityParameters parameters supplied to check Traffic Manager
// name operation.
type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct {
	// Name - Gets or sets the name of the resource.
	Name *string `json:"name,omitempty"`
	// Type - Gets or sets the type of the resource.
	Type *string `json:"type,omitempty"`
}

// CloudError ...
type CloudError struct {
	Error *CloudErrorBody `json:"error,omitempty"`
}

// CloudErrorBody ...
type CloudErrorBody struct {
	Code    *string           `json:"code,omitempty"`
	Message *string           `json:"message,omitempty"`
	Target  *string           `json:"target,omitempty"`
	Details *[]CloudErrorBody `json:"details,omitempty"`
}

// DeleteOperationResult the result of the request or operation.
type DeleteOperationResult struct {
	autorest.Response `json:"-"`
	// OperationResult - READ-ONLY; The result of the operation or request.
	OperationResult *bool `json:"boolean,omitempty"`
}

// DNSConfig class containing DNS settings in a Traffic Manager profile.
type DNSConfig struct {
	// RelativeName - Gets or sets the relative DNS name provided by this Traffic Manager profile.  This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile.
	RelativeName *string `json:"relativeName,omitempty"`
	// Fqdn - Gets or sets the fully-qualified domain name (FQDN) of the Traffic Manager profile.  This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager.
	Fqdn *string `json:"fqdn,omitempty"`
	// TTL - Gets or sets the DNS Time-To-Live (TTL), in seconds.  This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile.
	TTL *int64 `json:"ttl,omitempty"`
}

// Endpoint class representing a Traffic Manager endpoint.
type Endpoint struct {
	autorest.Response `json:"-"`
	// ID - Gets or sets the ID of the Traffic Manager endpoint.
	ID *string `json:"id,omitempty"`
	// Name - Gets or sets the name of the Traffic Manager endpoint.
	Name *string `json:"name,omitempty"`
	// Type - Gets or sets the endpoint type of the Traffic Manager endpoint.
	Type                *string `json:"type,omitempty"`
	*EndpointProperties `json:"properties,omitempty"`
}

// MarshalJSON is the custom marshaler for Endpoint.
func (e Endpoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if e.ID != nil {
		objectMap["id"] = e.ID
	}
	if e.Name != nil {
		objectMap["name"] = e.Name
	}
	if e.Type != nil {
		objectMap["type"] = e.Type
	}
	if e.EndpointProperties != nil {
		objectMap["properties"] = e.EndpointProperties
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for Endpoint struct.
func (e *Endpoint) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				e.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				e.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				e.Type = &typeVar
			}
		case "properties":
			if v != nil {
				var endpointProperties EndpointProperties
				err = json.Unmarshal(*v, &endpointProperties)
				if err != nil {
					return err
				}
				e.EndpointProperties = &endpointProperties
			}
		}
	}

	return nil
}

// EndpointProperties class representing a Traffic Manager endpoint properties.
type EndpointProperties struct {
	// TargetResourceID - Gets or sets the Azure Resource URI of the of the endpoint.  Not applicable to endpoints of type 'ExternalEndpoints'.
	TargetResourceID *string `json:"targetResourceId,omitempty"`
	// Target - Gets or sets the fully-qualified DNS name of the endpoint.  Traffic Manager returns this value in DNS responses to direct traffic to this endpoint.
	Target *string `json:"target,omitempty"`
	// EndpointStatus - Gets or sets the status of the endpoint..  If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method.  Possible values are 'Enabled' and 'Disabled'.
	EndpointStatus *string `json:"endpointStatus,omitempty"`
	// Weight - Gets or sets the weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000.
	Weight *int64 `json:"weight,omitempty"`
	// Priority - Gets or sets the priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter.  If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value.
	Priority *int64 `json:"priority,omitempty"`
	// EndpointLocation - Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method.
	EndpointLocation *string `json:"endpointLocation,omitempty"`
	// EndpointMonitorStatus - Gets or sets the monitoring status of the endpoint.
	EndpointMonitorStatus *string `json:"endpointMonitorStatus,omitempty"`
	// MinChildEndpoints - Gets or sets the minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'.
	MinChildEndpoints *int64 `json:"minChildEndpoints,omitempty"`
	// GeoMapping - Gets or sets the list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values.
	GeoMapping *[]string `json:"geoMapping,omitempty"`
}

// GeographicHierarchy class representing the Geographic hierarchy used with the Geographic traffic routing
// method.
type GeographicHierarchy struct {
	autorest.Response              `json:"-"`
	*GeographicHierarchyProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Resource Id
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Resource name
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; Resource type
	Type *string `json:"type,omitempty"`
	// Location - Resource location
	Location *string `json:"location,omitempty"`
	// Tags - Resource tags
	Tags map[string]*string `json:"tags"`
}

// MarshalJSON is the custom marshaler for GeographicHierarchy.
func (gh GeographicHierarchy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if gh.GeographicHierarchyProperties != nil {
		objectMap["properties"] = gh.GeographicHierarchyProperties
	}
	if gh.Location != nil {
		objectMap["location"] = gh.Location
	}
	if gh.Tags != nil {
		objectMap["tags"] = gh.Tags
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for GeographicHierarchy struct.
func (gh *GeographicHierarchy) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var geographicHierarchyProperties GeographicHierarchyProperties
				err = json.Unmarshal(*v, &geographicHierarchyProperties)
				if err != nil {
					return err
				}
				gh.GeographicHierarchyProperties = &geographicHierarchyProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				gh.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				gh.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				gh.Type = &typeVar
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				gh.Location = &location
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				gh.Tags = tags
			}
		}
	}

	return nil
}

// GeographicHierarchyProperties class representing the properties of the Geographic hierarchy used with
// the Geographic traffic routing method.
type GeographicHierarchyProperties struct {
	// GeographicHierarchy - The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved.
	GeographicHierarchy *Region `json:"geographicHierarchy,omitempty"`
}

// MonitorConfig class containing endpoint monitoring settings in a Traffic Manager profile.
type MonitorConfig struct {
	// ProfileMonitorStatus - Gets or sets the profile-level monitoring status of the Traffic Manager profile.
	ProfileMonitorStatus *string `json:"profileMonitorStatus,omitempty"`
	// Protocol - Gets or sets the protocol (HTTP or HTTPS) used to probe for endpoint health.
	Protocol *string `json:"protocol,omitempty"`
	// Port - Gets or sets the TCP port used to probe for endpoint health.
	Port *int64 `json:"port,omitempty"`
	// Path - Gets or sets the path relative to the endpoint domain name used to probe for endpoint health.
	Path *string `json:"path,omitempty"`
}

// NameAvailability class representing a Traffic Manager Name Availability response.
type NameAvailability struct {
	autorest.Response `json:"-"`
	// Name - The relative name.
	Name *string `json:"name,omitempty"`
	// Type - Traffic Manager profile resource type.
	Type *string `json:"type,omitempty"`
	// NameAvailable - Describes whether the relative name is available or not.
	NameAvailable *bool `json:"nameAvailable,omitempty"`
	// Reason - The reason why the name is not available, when applicable.
	Reason *string `json:"reason,omitempty"`
	// Message - Descriptive message that explains why the name is not available, when applicable.
	Message *string `json:"message,omitempty"`
}

// Profile class representing a Traffic Manager profile.
type Profile struct {
	autorest.Response  `json:"-"`
	*ProfileProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Resource Id
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Resource name
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; Resource type
	Type *string `json:"type,omitempty"`
	// Location - Resource location
	Location *string `json:"location,omitempty"`
	// Tags - Resource tags
	Tags map[string]*string `json:"tags"`
}

// MarshalJSON is the custom marshaler for Profile.
func (p Profile) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if p.ProfileProperties != nil {
		objectMap["properties"] = p.ProfileProperties
	}
	if p.Location != nil {
		objectMap["location"] = p.Location
	}
	if p.Tags != nil {
		objectMap["tags"] = p.Tags
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for Profile struct.
func (p *Profile) UnmarshalJSON(body []byte) error {
	var m map[string]*json.RawMessage
	err := json.Unmarshal(body, &m)
	if err != nil {
		return err
	}
	for k, v := range m {
		switch k {
		case "properties":
			if v != nil {
				var profileProperties ProfileProperties
				err = json.Unmarshal(*v, &profileProperties)
				if err != nil {
					return err
				}
				p.ProfileProperties = &profileProperties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				p.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				p.Name = &name
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				p.Type = &typeVar
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				p.Location = &location
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				p.Tags = tags
			}
		}
	}

	return nil
}

// ProfileListResult the list Traffic Manager profiles operation response.
type ProfileListResult struct {
	autorest.Response `json:"-"`
	// Value - Gets the list of Traffic manager profiles.
	Value *[]Profile `json:"value,omitempty"`
}

// ProfileProperties class representing the Traffic Manager profile properties.
type ProfileProperties struct {
	// ProfileStatus - Gets or sets the status of the Traffic Manager profile.  Possible values are 'Enabled' and 'Disabled'.
	ProfileStatus *string `json:"profileStatus,omitempty"`
	// TrafficRoutingMethod - Gets or sets the traffic routing method of the Traffic Manager profile.  Possible values are 'Performance', 'Weighted', 'Priority' or 'Geographic'.
	TrafficRoutingMethod *string `json:"trafficRoutingMethod,omitempty"`
	// DNSConfig - Gets or sets the DNS settings of the Traffic Manager profile.
	DNSConfig *DNSConfig `json:"dnsConfig,omitempty"`
	// MonitorConfig - Gets or sets the endpoint monitoring settings of the Traffic Manager profile.
	MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
	// Endpoints - Gets or sets the list of endpoints in the Traffic Manager profile.
	Endpoints *[]Endpoint `json:"endpoints,omitempty"`
}

// Region class representing a region in the Geographic hierarchy used with the Geographic traffic routing
// method.
type Region struct {
	// Code - The code of the region
	Code *string `json:"code,omitempty"`
	// Name - The name of the region
	Name *string `json:"name,omitempty"`
	// Regions - The list of Regions grouped under this Region in the Geographic Hierarchy.
	Regions *[]Region `json:"regions,omitempty"`
}

// Resource the Resource model definition.
type Resource struct {
	// ID - READ-ONLY; Resource Id
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Resource name
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; Resource type
	Type *string `json:"type,omitempty"`
	// Location - Resource location
	Location *string `json:"location,omitempty"`
	// Tags - Resource tags
	Tags map[string]*string `json:"tags"`
}

// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if r.Location != nil {
		objectMap["location"] = r.Location
	}
	if r.Tags != nil {
		objectMap["tags"] = r.Tags
	}
	return json.Marshal(objectMap)
}

// SubResource ...
type SubResource struct {
	// ID - Resource Id
	ID *string `json:"id,omitempty"`
}


text:
require 'chef/provider'
require 'chef/resource'

require 'poise/utils/resource_provider_mixin'

module Poise
  include Poise::Utils::ResourceProviderMixin
  autoload :Backports, 'poise/backports'
  autoload :Helpers, 'poise/helpers'
  autoload :NOT_PASSED, 'poise/backports/not_passed'
  autoload :Provider, 'poise/provider'
  autoload :Resource, 'poise/resource'
  autoload :Subcontext, 'poise/subcontext'
  autoload :Utils, 'poise/utils'
  autoload :VERSION, 'poise/version'

  # Check if Poise's extra debugging output is enabled. This produces a *lot*
  # of logging.
  #
  # @param node [Chef::Node, Chef::RunContext] Optional node to check for
  #   attributes. If not given, Chef.node is used instead.
  # @return [Boolean]
  def self.debug?(node=nil)
    node = node.node if node.is_a?(Chef::RunContext)
    node ||= Chef.node if defined?(Chef.node)
    @debug_file_upper = ::File.exist?('/POISE_DEBUG') unless defined?(@debug_file_upper)
    @debug_file_lower = ::File.exist?('/poise_debug') unless defined?(@debug_file_lower)
    !!(
      (ENV['POISE_DEBUG'] && ENV['POISE_DEBUG'] != 'false') ||
      (ENV['poise_debug'] && ENV['poise_debug'] != 'false') ||
      (node && node['POISE_DEBUG']) ||
      (node && node['poise_debug']) ||
      @debug_file_upper ||
      @debug_file_lower
    )
  end

  # Log a message only if Poise's extra debugging output is enabled.
  #
  # @see #debug?
  # @param msg [String] Log message.
  # @return [void]
  def self.debug(msg)
    Chef::Log.debug(msg) if debug?
  end
end

# Callable form to allow passing in options:
#   include Poise(ParentResource)
#   include Poise(parent: ParentResource)
#   include Poise(container: true)
def Poise(options={})
  # Allow passing a class as a shortcut
  if options.is_a?(Class)
    options = {parent: options}
  end

  # Create a new anonymous module
  mod = Module.new

  # Fake the name.
  mod.define_singleton_method(:name) do
    super() || 'Poise'
  end

  mod.define_singleton_method(:included) do |klass|
    super(klass)
    # Pull in the main helper to cover most of the needed logic.
    klass.class_exec { include Poise }
    # Set the defined_in values as needed.
    klass.poise_defined!(caller)
    # Resource-specific options.
    if klass < Chef::Resource
      klass.poise_subresource(options[:parent], options[:parent_optional], options[:parent_auto]) if options[:parent]
      klass.poise_subresource_container(options[:container_namespace], options[:container_default]) if options[:container]
      klass.poise_fused if options[:fused]
      klass.poise_inversion(options[:inversion_options_resource]) if options[:inversion]
    end
    # Provider-specific options.
    if klass < Chef::Provider
      klass.poise_inversion(options[:inversion], options[:inversion_attribute]) if options[:inversion]
    end
  end

  mod
end

# Display a message if poise_debug is enabled. Off in ChefSpec so I don't get
# extra logging stuff that I don't care about.
Poise.debug('[Poise] Extra verbose logging enabled') unless defined?(ChefSpec)


text:
/* $Id: utf8.h,v 1.1 2003/06/04 00:25:44 marka Exp $ */
/*
 * Copyright (c) 2000 Japan Network Information Center.  All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set forth bellow.
 *
 * 			LICENSE TERMS AND CONDITIONS
 *
 * The following License Terms and Conditions apply, unless a different
 * license is obtained from Japan Network Information Center ("JPNIC"),
 * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
 * Chiyoda-ku, Tokyo 101-0047, Japan.
 *
 * 1. Use, Modification and Redistribution (including distribution of any
 *    modified or derived work) in source and/or binary forms is permitted
 *    under this License Terms and Conditions.
 *
 * 2. Redistribution of source code must retain the copyright notices as they
 *    appear in each source code file, this License Terms and Conditions.
 *
 * 3. Redistribution in binary form must reproduce the Copyright Notice,
 *    this License Terms and Conditions, in the documentation and/or other
 *    materials provided with the distribution.  For the purposes of binary
 *    distribution the "Copyright Notice" refers to the following language:
 *    "Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved."
 *
 * 4. The name of JPNIC may not be used to endorse or promote products
 *    derived from this Software without specific prior written approval of
 *    JPNIC.
 *
 * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
 *    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 *    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL JPNIC BE LIABLE
 *    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 *    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 *    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 *    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 *    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 */

#ifndef IDN_UTF8_H
#define IDN_UTF8_H 1

#ifdef __cplusplus
extern "C" {
#endif

/*
 * UTF-8 encoded string facility.
 */

#include <idn/export.h>

/*
 * Get the length of a character.
 *
 * Get the length (in bytes) of a character whose first byte is pointed
 * by 's'.  Since this function only looks one first byte to determine the
 * length, it is possible some of the following bytes are invalid.
 */
IDN_EXPORT int
idn_utf8_mblen(const char *s);

/*
 * Get one character.
 *
 * Get the first character of the string pointed by 's', and copy it
 * to 'buf', whose length is 'len'.  Returns the number of bytes copied,
 * or zero if the encoding is invalid or len is too small.
 *
 * The area pointed by 'buf' must be large enough to store any UTF-8 encoded
 * character.
 *
 * Note that the copied string is not NUL-terminated.
 */
IDN_EXPORT int
idn_utf8_getmb(const char *s, size_t len, char *buf);

/*
 * Get one character in UCS-4.
 *
 * Similar to 'idn_utf8_getmb', except that the result is not in UTF-8
 * encoding, but in UCS-4 format (plain 32bit integer value).
 */
IDN_EXPORT int
idn_utf8_getwc(const char *s, size_t len, unsigned long *vp);

/*
 * Put one character.
 *
 * This function is an opposite of 'idn_utf8_getwc'.  It takes a UCS-4
 * value 'v', convert it to UTF-8 encoded sequence, and store it to 's',
 * whose length is 'len'.  It returns the number of bytes written, or
 * zero 'v' is out of range or 'len' is too small.
 */
IDN_EXPORT int
idn_utf8_putwc(char *s, size_t len, unsigned long v);

/*
 * Check the validity of UTF-8 encoded character.
 *
 * Check if the character pointed by 's' is a valid UTF-8 encoded
 * character.  Return the length of the character (in bytes) if it is valid,
 * 0 otherwise.
 */
IDN_EXPORT int
idn_utf8_isvalidchar(const char *s);

/*
 * Check the validity of UTF-8 encoded string.
 *
 * Check if the NUL-terminated string 's' is valid as a UTF-8 encoded
 * string.  Return 1 if it is valid, 0 otherwise.
 */
IDN_EXPORT int
idn_utf8_isvalidstring(const char *s);

/*
 * Find first byte of a character.
 *
 * Find the first byte of a character 's' points to.  's' may point
 * the 2nd or later byte of a character.  'known_top' is a pointer to
 * a string which contains 's', and is known to be the first byte of
 * a character.  If it couldn't find the first byte between 'known_top'
 * and 's', NULL will be returned.
 */
IDN_EXPORT char *
idn_utf8_findfirstbyte(const char *s, const char *known_top);

#ifdef __cplusplus
}
#endif

#endif /* IDN_UTF8_H */


text:
export interface OutlinedInputClasses {
    /** Styles applied to the root element. */
    root: string;
    /** Styles applied to the root element if the color is secondary. */
    colorSecondary: string;
    /** Styles applied to the root element if the component is focused. */
    focused: string;
    /** Styles applied to the root element if `disabled={true}`. */
    disabled: string;
    /** Styles applied to the root element if `startAdornment` is provided. */
    adornedStart: string;
    /** Styles applied to the root element if `endAdornment` is provided. */
    adornedEnd: string;
    /** Pseudo-class applied to the root element if `error={true}`. */
    error: string;
    /** Styles applied to the input element if `size="small"`. */
    sizeSmall: string;
    /** Styles applied to the root element if `multiline={true}`. */
    multiline: string;
    /** Styles applied to the NotchedOutline element. */
    notchedOutline: string;
    /** Styles applied to the input element. */
    input: string;
    /** Styles applied to the input element if `size="small"`. */
    inputSizeSmall: string;
    /** Styles applied to the input element if `multiline={true}`. */
    inputMultiline: string;
    /** Styles applied to the input element if `startAdornment` is provided. */
    inputAdornedStart: string;
    /** Styles applied to the input element if `endAdornment` is provided. */
    inputAdornedEnd: string;
}
export declare type OutlinedInputClassKey = keyof OutlinedInputClasses;
export declare function getOutlinedInputUtilityClass(slot: string): string;
declare const outlinedInputClasses: OutlinedInputClasses;
export default outlinedInputClasses;


text:
git() {
    _root=$(command git rev-parse --show-toplevel 2>/dev/null);

    # check that this is a git-svn repo
    [ -n "$_root" ] && [ -d "$_root/.git/svn"  ] && [ x != x"$(ls -A "$_root/.git/svn/")" ] && _git_svn=1

    # otherwise just pass through to git
    if [ -z "$_git_svn" ]; then
        unset _root _git_svn
        command git "$@"
        return $?
    fi

    unset _git_svn

    # Expand git aliases
    _param_1=$1
    export _param_1

    _expanded="$(command git config --get-regexp ^alias.$_param_1$ | sed -e 's/[^ ]* //')"

    unset _param_1

    # check for !shell-command aliases
    case "$_expanded" in
    \!*)
        _expanded=$(echo "$_expanded" | sed -e 's/.//')
        shift
        eval "$_expanded \"\$@\""
        unset _expanded _root
        return $?
        ;;
    *)
        if [ -n "$_expanded" ]; then
            shift
            eval "git $_expanded \"\$@\""
            unset _expanded _root
            return $?
        fi
        ;;
    esac

    unset _expanded

    if [ "$1" != "svn" ]; then
        unset _root
        command git "$@"
        return $?
    else
        shift;
    fi

    if [ -n "$GIT_SVN_USERNAME" ]; then
        echo yes | svn log -rHEAD --username $GIT_SVN_USERNAME $(cd $(command git rev-parse --show-toplevel); command git config svn-remote.svn.url) >/dev/null
        _svn_username="$GIT_SVN_USERNAME"
        unset GIT_SVN_USERNAME
    fi

    # Find out if we have a --force arg
    _force=
    _first=1
    for _arg in "$@"; do
        if [ -n "$_first" ]; then
            set --
            unset _first
        fi

        if [ "$_arg" = --force ]; then
            _force=1
            continue
        fi

        set -- "$@" "$_arg"
    done
    unset _arg

    # Pre hooks
    if [ -z "${_force}" ]; then
        if [ -x "$_root/.git/hooks/pre-svn-$1" ]; then
            "$_root/.git/hooks/pre-svn-$1"
            _exit_val=$?

            if [ -n "$_svn_username" ]; then
                export GIT_SVN_USERNAME="$_svn_username"
                unset _svn_username
            fi

            if [ $_exit_val -ne 0 ]; then
                unset _root
                return $_exit_val
            fi
        fi
    fi

    # call git-svn
    command git svn "$@"
    _exit_val=$?

    # skip post hook for non-zero exit
    if [ $_exit_val -ne 0 ]; then
        unset _root
        return $_exit_val
    fi

    # Post hooks
    if [ -x "$_root/.git/hooks/post-svn-$1" ]; then
        "$_root/.git/hooks/post-svn-$1"
        _exit_val=$?
    fi

    if [ -n "$_svn_username" ]; then
        export GIT_SVN_USERNAME="$_svn_username"
        unset _svn_username
    fi

    unset _root

    return $_exit_val
}

# Copyright (c) 2013, Rafael Kitover
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
package sys.stats.sliced.slices;

import java.util.concurrent.atomic.AtomicInteger;

import sys.stats.sliced.SlicedStatistics;

public class CounterImpl implements SlicedStatistics<CounterImpl> {

    AtomicInteger counter;

    public CounterImpl() {
        counter = new AtomicInteger();
    }

    public void incCounter() {
        counter.incrementAndGet();
    }

    public int getTotalOperations() {
        return counter.get();
    }

    public CounterImpl createNew() {
        return new CounterImpl();
    }

    public void decCounter() {
        counter.decrementAndGet();

    }

}


text:
package org.springframework.cloud.contract.spec.internal;

/**
 * Represents the type of matching the should be done against the body of the request or
 * response.
 *
 * @author Marcin Grzejszczak
 * @author Tim Ysewyn
 * @author Olga Maciaszek-Sharma
 * @since 1.0.3
 */
public enum MatchingType {

	/**
	 * Verification by equality.
	 */
	EQUALITY,
	/**
	 * Verification by type - is the type received in a body for the given path is of the
	 * same type. If it's a collection you can verify number of occurrences.
	 */
	TYPE,
	/**
	 * Special version of regex for date check.
	 */
	DATE,
	/**
	 * Special version of regex for time check.
	 */
	TIME,
	/**
	 * Special version of regex for timestamp check.
	 */
	TIMESTAMP,
	/**
	 * Verification if the value for the given path matches the provided regex.
	 */
	REGEX,
	/**
	 * The user can provide custom command to execute.
	 */
	COMMAND,
	/**
	 * Verification if the value for the given path is null.
	 */
	NULL;

	public static boolean regexRelated(MatchingType type) {
		return !type.equals(EQUALITY) && !type.equals(TYPE) && !type.equals(COMMAND) && !type.equals(NULL);
	}

}


text:
<?php

/**
 * IAddForeignKeySpecificationStatement interface file.
 *
 * @author Anastaszor
 */
interface IAddForeignKeySpecificationStatement extends ITableSpecificationStatement
{

	const RESTRICT = 'RESTRICT';
	const CASCADE = 'CASCADE';
	const SET_NULL = 'SET NULL';
	const NO_ACTION = 'NO ACTION';

	/**
	 *
	 * @return string
	 */
	public function getSymbol();

	/**
	 *
	 * @return string
	 */
	public function getIndexName();

	/**
	 *
	 * @return IIndexColumnNameSpecificationStatement[]
	 */
	public function getIndexColumnNames();

	/**
	 *
	 * @return string
	 */
	public function getTargetTableName();

	/**
	 *
	 * @return string[]
	 */
	public function getTargetIndexNames();

	/**
	 *
	 * @return enum('RESTRICT', 'CASCADE', 'SET NULL', 'NO ACTION')
	 */
	public function getOnUpdateConstraint();

	/**
	 *
	 * @return enum('RESTRICT', 'CASCADE', 'SET NULL', 'NO ACTION')
	 */
	public function getOnDeleteConstraint();

}


text:
Originally published: 2016-12-15 01:45:22
Last updated: 2017-04-07 12:30:13
Author: Miguel Martínez López

Tag editing widget for tkinter. It's similar to jQuery tag it:
http://aehlke.github.io/tag-it/


text:
package org.apache.activemq.artemis.service.extensions.xa.recovery;

public class ActiveMQRegistryImpl implements ActiveMQRegistry {

   private static ActiveMQRegistryImpl instance;

   public static ActiveMQRegistry getInstance() {
      if (instance == null) {
         instance = new ActiveMQRegistryImpl();
      }
      return instance;
   }

   @Override
   public void register(XARecoveryConfig resourceConfig) {

   }

   @Override
   public void unRegister(XARecoveryConfig resourceConfig) {

   }

   @Override
   public void stop() {

   }

   @Override
   public void init() {

   }
}


text:
package ch.m02.comet.pinball.core.presentation.screen;

public interface SplashScreen extends PinballScreen {

}


text:
package com.jcodeing.anchorimageview.widget;

import android.view.GestureDetector;
import android.view.MotionEvent;

class OnGestureListenerAnchor implements GestureDetector.OnGestureListener {
    private AnchorImageView anchorImageView;

    OnGestureListenerAnchor(AnchorImageView anchorImageView) {
        super();
        this.anchorImageView = anchorImageView;
    }

    @Override
    public boolean onDown(MotionEvent e) {
        return true;
    }

    @Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
        return false;
    }

    @Override
    public void onLongPress(MotionEvent e) {
    }

    @Override
    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
        return false;
    }

    @Override
    public void onShowPress(MotionEvent e) {
    }

    public boolean onSingleTapUp(MotionEvent e) {
        if (!anchorImageView.isAnchorCutProcess) {
            anchorImageView.disposeEvent(e);
        }
        return false;
    }
}


text:
package org.apache.geode.internal.cache;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.DistributedCacheOperation.CacheOperationMessage;
import org.apache.geode.internal.cache.persistence.PersistentMemberID;
import org.apache.geode.test.junit.categories.UnitTest;

@Category(UnitTest.class)
public class DistributedCacheOperationTest {

  @Test
  public void shouldBeMockable() throws Exception {
    DistributedCacheOperation mockDistributedCacheOperation = mock(DistributedCacheOperation.class);
    CacheOperationMessage mockCacheOperationMessage = mock(CacheOperationMessage.class);
    Map<InternalDistributedMember, PersistentMemberID> persistentIds = new HashMap<>();
    when(mockDistributedCacheOperation.supportsDirectAck()).thenReturn(false);

    mockDistributedCacheOperation.waitForAckIfNeeded(mockCacheOperationMessage, persistentIds);

    verify(mockDistributedCacheOperation, times(1)).waitForAckIfNeeded(mockCacheOperationMessage,
        persistentIds);

    assertThat(mockDistributedCacheOperation.supportsDirectAck()).isFalse();
  }
}


text:
package com.frankzhu.recyclerviewdemo.adapter;

import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.frankzhu.recyclerviewdemo.ui.DetailActivity;
import com.frankzhu.recyclerviewdemo.R;
import com.frankzhu.recyclerviewdemo.bean.DemoItem;
import com.frankzhu.recyclerviewdemo.ui.SelectActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Author:    ZhuWenWu
 * Version    V1.0
 * Date:      2015/2/25  18:21.
 * Description:
 * Modification  History:
 * Date         	Author        		Version        	Description
 * -----------------------------------------------------------------------------------
 * 2015/2/25        ZhuWenWu            1.0                    1.0
 * Why & What is modified:
 */
public class ItemsAdapter extends BaseAbstractRecycleCursorAdapter<RecyclerView.ViewHolder> {
    private final LayoutInflater mLayoutInflater;

    public ItemsAdapter(Context context) {
        super(context, null);
        mLayoutInflater = LayoutInflater.from(context);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, Cursor cursor) {
        DemoItem item = DemoItem.fromCursor(cursor);
        ((NormalTextViewHolder) holder).mTextView.setText(item.title);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new NormalTextViewHolder(mLayoutInflater.inflate(R.layout.item_text, parent, false), this);
    }

    public static class NormalTextViewHolder extends RecyclerView.ViewHolder {
        @Bind(R.id.text_view)
        TextView mTextView;
        ItemsAdapter mAdapter;

        NormalTextViewHolder(View view, ItemsAdapter adapter) {
            super(view);
            mAdapter = adapter;
            ButterKnife.bind(this, view);
        }

        @OnClick(R.id.cv_item)
        void onItemClick() {
            Log.d("NormalTextViewHolder", "onClick--> position = " + getPosition());
            DemoItem item = DemoItem.fromCursor((Cursor) mAdapter.getItem(getPosition()));
            if(getPosition() < 11) {
                Intent intent = new Intent(mAdapter.mContext, DetailActivity.class);
                intent.putExtra("position", getPosition());
                intent.putExtra("title", item.title);
                mAdapter.mContext.startActivity(intent);
            }else {
                Intent intent = new Intent(mAdapter.mContext, SelectActivity.class);
                intent.putExtra("position", getPosition());
                intent.putExtra("title", item.title);
                mAdapter.mContext.startActivity(intent);
            }
        }
    }
}


text:
int main() {

  std::vector<int> size;
  size.push_back(10);
  size.push_back(5);
  size.push_back(10);

  NeuralNetwork network(size, 5, 5, new SigmoidFunction());
  network.initializeRandomWeights();

  boost::numeric::ublas::vector<double> tmp(5);

  for (int i=0; i < tmp.size(); ++i) {
    tmp[i] = i;
  }

  std::cout << "Output:- " <<  network.feedForwardVector(tmp) << std::endl;
  network.backPropogateVector(tmp, tmp);

};


text:
```
cd turbine-appication
```

If using Maven:
```
./bin/boot-maven.sh
```

Otherwise, if using Gradle:
```
./bin/boot-gradle.sh
```

This will initialise a Spring Boot with the following:

- cloud-turbine
- cloud-eureka

NOTE: This is not using 'cloud-turbine-stream', which uses Spring Cloud Stream.

Rename application.properties to application.yml

```
mv src/main/resources/application.properties src/main/resources/application.yml
```

Test with:

```
mvn spring-boot:run
```

OR

```
./gradlew bootRun
```

Browse to:
```
http://localhost:8989
```

##0.7.1 - Testing the stream aggregation

Start the following applications in this order:

- ConfigServerApplication
- DiscoveryServerApplication
- ExampleClientApplication
- HystrixDashboardApplication
- TurbineApplication

Check applications have registered with [http://localhost:8761](http://localhost:8761)

As APIGatewayApplication is not being used, request message using direct endpoint:

ExampleClient application:
```
curl http://localhost:8083/balance
```
Example application:
```
curl http://localhost:8081/message
```

Result should be 'Fallback method handled exception'

Browse to the Hystrix Dashboard at [http://localhost:7979/hystrix](http://localhost:7979/hystrix)

Enter the following stream:

```
http://localhost:8989/turbine.stream
```


text:
class NullPolicyMaintenance
  def execute(request)
  end
end


text:
package es.startuphero.checkstyle.util;

import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.Scope;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.utils.ScopeUtil;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;

/**
 * @author ozlem.ulag
 */
public final class VariableUtils {

  private VariableUtils() {
  }

  /**
   * @param classAst : required to be CLASS_DEF type
   * @return variable asts
   */
  public static List<DetailAST> getVariables(DetailAST classAst) {
    DetailAST objBlock = classAst.findFirstToken(TokenTypes.OBJBLOCK);
    return CommonUtils.getChildsByType(objBlock, TokenTypes.VARIABLE_DEF);
  }

  public static List<DetailAST> getStaticVariables(DetailAST classAst) {
    DetailAST objBlock = classAst.findFirstToken(TokenTypes.OBJBLOCK);
    return CommonUtils.getChildsByType(objBlock, TokenTypes.VARIABLE_DEF).stream()
                      .filter(CommonUtils::isStatic)
                      .collect(toList());
  }

  public static List<DetailAST> getNonStaticVariables(DetailAST classAst) {
    DetailAST objBlock = classAst.findFirstToken(TokenTypes.OBJBLOCK);
    return CommonUtils.getChildsByType(objBlock, TokenTypes.VARIABLE_DEF).stream()
                      .filter(ast -> !CommonUtils.isStatic(ast))
                      .collect(toList());
  }

  /**
   * @param classAst : required to be CLASS_DEF type
   * @param scope : modifier of returned variables
   * @return variable asts that in given scope
   */
  public static List<DetailAST> getVariables(DetailAST classAst, Scope scope) {
    return getVariables(classAst).stream()
                                 .filter(variableAst -> scope.equals(getScopeOf(variableAst)))
                                 .collect(toList());
  }

  public static Scope getScopeOf(DetailAST variableAst) {
    DetailAST variableModifiersNode = variableAst.findFirstToken(TokenTypes.MODIFIERS);
    return ScopeUtil.getScopeFromMods(variableModifiersNode);
  }

  /**
   * @param variableAst : required to be VARIABLE_DEF type
   * @return name of the variable
   */
  public static String getVariableName(DetailAST variableAst) {
    DetailAST type = variableAst.findFirstToken(TokenTypes.TYPE);
    return type.getNextSibling().getText();
  }

  /**
   * @param classAst : required to be CLASS_DEF type
   * @return variable names
   */
  public static List<String> getVariableNames(DetailAST classAst) {
    return getVariables(classAst).stream()
                                 .map(VariableUtils::getVariableName)
                                 .collect(toList());
  }

  /**
   * @param classAst required to be CLASS_DEF type
   * @return : ordered variable name -> variable AST
   */
  public static Map<String, DetailAST> getVariableNameAstMap(DetailAST classAst) {
    List<DetailAST> variables = getVariables(classAst);
    return variables.stream().collect(toMap(VariableUtils::getVariableName,
                                            Function.identity(), (v1, v2) -> null,
                                            LinkedHashMap::new));
  }

  public static Map<String, DetailAST> getVariableNameAstMap(DetailAST classAst, Boolean isStatic) {
    List<DetailAST> variables = isStatic ? getStaticVariables(classAst) : getNonStaticVariables(classAst);
    return variables.stream().collect(toMap(VariableUtils::getVariableName,
                                            Function.identity(), (v1, v2) -> null,
                                            LinkedHashMap::new));
  }

  public static Map<String, DetailAST> getVariableNameAstMap(DetailAST classAst, Scope scope) {
    List<DetailAST> variables = getVariables(classAst, scope);
    return variables.stream().collect(toMap(VariableUtils::getVariableName,
                                            Function.identity(), (v1, v2) -> null,
                                            LinkedHashMap::new));
  }
}


text:
package helpers

import (
	"errors"
	"io"
	"os"
	"path"
	"time"

	"github.com/Sirupsen/logrus"
	"github.com/codegangsta/cli"

	"gitlab.com/gitlab-org/gitlab-ci-multi-runner/common"
	"gitlab.com/gitlab-org/gitlab-ci-multi-runner/helpers/archives"
	"gitlab.com/gitlab-org/gitlab-ci-multi-runner/helpers/formatter"
	"gitlab.com/gitlab-org/gitlab-ci-multi-runner/network"
)

type ArtifactsUploaderCommand struct {
	common.BuildCredentials
	fileArchiver
	retryHelper
	network common.Network

	Name     string `long:"name" description:"The name of the archive"`
	ExpireIn string `long:"expire-in" description:"When to expire artifacts"`
}

func (c *ArtifactsUploaderCommand) createAndUpload() (bool, error) {
	pr, pw := io.Pipe()
	defer pr.Close()

	// Create the archive
	go func() {
		err := archives.CreateZipArchive(pw, c.sortedFiles())
		pw.CloseWithError(err)
	}()

	artifactsName := path.Base(c.Name) + ".zip"

	// Upload the data
	switch c.network.UploadRawArtifacts(c.BuildCredentials, pr, artifactsName, c.ExpireIn) {
	case common.UploadSucceeded:
		return false, nil
	case common.UploadForbidden:
		return false, os.ErrPermission
	case common.UploadTooLarge:
		return false, errors.New("Too large")
	case common.UploadFailed:
		return true, os.ErrInvalid
	default:
		return false, os.ErrInvalid
	}
}

func (c *ArtifactsUploaderCommand) Execute(*cli.Context) {
	formatter.SetRunnerFormatter()

	if len(c.URL) == 0 || len(c.Token) == 0 {
		logrus.Fatalln("Missing runner credentials")
	}
	if c.ID <= 0 {
		logrus.Fatalln("Missing build ID")
	}

	// Enumerate files
	err := c.enumerate()
	if err != nil {
		logrus.Fatalln(err)
	}

	// If the upload fails, exit with a non-zero exit code to indicate an issue?
	err = c.doRetry(c.createAndUpload)
	if err != nil {
		logrus.Fatalln(err)
	}
}

func init() {
	common.RegisterCommand2("artifacts-uploader", "create and upload build artifacts (internal)", &ArtifactsUploaderCommand{
		network: &network.GitLabClient{},
		retryHelper: retryHelper{
			Retry:     2,
			RetryTime: time.Second,
		},
		Name: "artifacts",
	})
}


text:
#ifndef ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__
#define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__

#include <istream>
#include <ostream>
#include <string>

namespace alexaClientSDK {
namespace settings {
namespace types {

/**
 * Defines the values for alarm volume ramp setting.
 */
enum class AlarmVolumeRampTypes {
    /// Alarm should start with final volume.
    NONE,

    /// Alarm will include a fade-in period.
    ASCENDING
};

/**
 * Retrieves the default value of alarm volume ramp.
 *
 * @return The default value ramp.
 */
constexpr AlarmVolumeRampTypes getAlarmVolumeRampDefault() {
    return AlarmVolumeRampTypes::NONE;
}

/**
 * Convert @c AlarmVolumeRampTypes to boolean logic since the UI experience is enable / disable.
 *
 * @param volumeRamp The setting value.
 * @return Whether the setting value is enabled (ASCENDING) or not (NONE).
 */
constexpr bool isEnabled(AlarmVolumeRampTypes volumeRamp) {
    return volumeRamp != AlarmVolumeRampTypes::NONE;
}

/**
 * Convert boolean to @c AlarmVolumeRampTypes.
 *
 * @param enabled Whether fade-in is enabled or not.
 * @return The corresponding setting value.
 */
constexpr AlarmVolumeRampTypes toAlarmRamp(bool enabled) {
    return enabled ? AlarmVolumeRampTypes::ASCENDING : AlarmVolumeRampTypes::NONE;
}

/**
 * Write a @c AlarmVolumeRampTypes value to the given stream.
 *
 * @param stream The stream to write the value to.
 * @param value The value to write to the stream as a string.
 * @return The stream that was passed in and written to.
 */
inline std::ostream& operator<<(std::ostream& stream, const AlarmVolumeRampTypes& value) {
    switch (value) {
        case AlarmVolumeRampTypes::NONE:
            stream << "NONE";
            return stream;
        case AlarmVolumeRampTypes::ASCENDING:
            stream << "ASCENDING";
            return stream;
    }

    stream.setstate(std::ios_base::failbit);
    return stream;
}

/**
 * Converts an input string stream value to AlarmVolumeRampTypes.
 *
 * @param stream The string stream to retrieve the value from.
 * @param [out] value The value to write to.
 * @return The stream that was passed in.
 */
inline std::istream& operator>>(std::istream& is, AlarmVolumeRampTypes& value) {
    std::string str;
    is >> str;
    if ("NONE" == str) {
        value = AlarmVolumeRampTypes::NONE;
    } else if ("ASCENDING" == str) {
        value = AlarmVolumeRampTypes::ASCENDING;
    } else {
        is.setstate(std::ios_base::failbit);
    }
    return is;
}

}  // namespace types
}  // namespace settings
}  // namespace alexaClientSDK

#endif  // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_TYPES_ALARMVOLUMERAMPTYPES_H__


text:
import _ from 'lodash'
import { Schema, arrayOf, normalize } from 'normalizr'

import { SyncApp } from '../app/Api'

const TreeSchema = new Schema('tree', {
  idAttribute: 'id',
})

TreeSchema.define({
  children: arrayOf(TreeSchema),
})

export const LOCAL_FILETREE_GET_CHILDREN_SUCCESS = 'LOCAL_FILETREE_GET_CHILDREN_SUCCESS'
export const LOCAL_FILETREE_GET_CHILDREN_ERROR = 'LOCAL_FILETREE_GET_CHILDREN_ERROR'
export function GetChildren(parent) {
  return (dispatch, getState) => {
    SyncApp
      .Tree(parent)
      .then(response => {
        let children = _.map(response.body.folders, c => ({
          id: c.path,
          name: c.name,
          parentId: c.parent,
        }))

        let parentOfParent = _.slice(
          response.body.parent.split('/'),
          0,
          response.body.parent.split('/').length - 1
        ).join('/')

        let parentName = _.slice(
          response.body.parent.split('/'),
          response.body.parent.split('/').length - 1,
        )

        const tree = normalize({
          id: response.body.parent,
          name: parentName,
          unfolded: true,
          parentId: parentOfParent,
          children,
        }, TreeSchema)

        dispatch({
          type: LOCAL_FILETREE_GET_CHILDREN_SUCCESS,
          tree,
          root: (!parent) ? response.body.parent : getState().getIn([
            'localfiletree',
            'tree',
            'result',
          ])
        })
      })
      .catch(err => {
        dispatch({
          type: LOCAL_FILETREE_GET_CHILDREN_ERROR,
          err,
          parent,
        })
      })
  }
}

export const LOCAL_FILETREE_HIGHLIGHT_FOLDER = 'LOCAL_FILETREE_HIGHLIGHT_FOLDER'
export function HighlightFolder(id) {
  return (dispatch, getState) => {
    let newHighlight = (getState().getIn([
      'localfiletree',
      'tree',
      'entities',
      'tree',
      id.toString(),
      'highlighted',
    ])) ? false : true

    dispatch({
      type: LOCAL_FILETREE_HIGHLIGHT_FOLDER,
      id,
      newHighlight,
    })
  }
}

export const LOCAL_FILETREE_SET_FOLDER_FOLD = 'LOCAL_FILETREE_SET_FOLDER_FOLD'
export function ToggleFold(id) {
  return (dispatch, getState) => {
    let newFold = (getState().getIn([
      'localfiletree',
      'tree',
      'entities',
      'tree',
      id.toString(),
      'unfolded',
    ])) ? false : true

    dispatch({
      type: LOCAL_FILETREE_SET_FOLDER_FOLD,
      id,
      newFold,
    })

    if (newFold) {
      dispatch(GetChildren(id))
    }
  }
}


text:
#ifndef SWAPICLIENT_H
#define SWAPICLIENT_H

#include <iostream>
#include <string>
#include <curl/curl.h>
#include "json.hpp"

/*
===============================================================================

    This is a sample client for the Shapeways API.  It is intended to
    illustrate the capabilities of and patterns for interacting with
    the API, not to provide a full reference client.

    We welcome any pull requests to improve or further implement the API
    for the community to use.

    More information available at
    http://developers.shapeways.com/docs

===============================================================================
*/
class swApiClient
{
    private:
        std::string             consumerKey;
        std::string             consumerSecret;
        std::string             accessToken;

        struct curl_slist * SetAuthHeader();

    public:
        swApiClient( std::string consumerKey, std::string consumerSecret );
        void Authorize();
        std::string GetMaterials();
        std::string UploadModel( std::string modelFilePath );
};

#endif


text:
package com.delmar.sys.model;

import com.delmar.core.model.CoreModel;

/**
 * @author 刘大磊 2015年1月16日 上午8:52:41
 */
public class Org extends CoreModel {
	public static final Integer ORG_LEVEL_1=1;
	public static final Integer ORG_LEVEL_2=2;
	public static final Integer ORG_LEVEL_3=3;

    private String value;
    private String name;
    private String remark;
    private Integer orgLevel;
    private Integer parentOrgId;
    private Integer clientId;
    private Org parentOrg;
    private Client client;

    public Org()
    {

    }

    public Org(Integer id,String name)
    {
    	this.id=id;
    	this.name=name;
    }
    /**
	 * @return the client
	 */
	public Client getClient() {
		return client;
	}

	/**
	 * @param client the client to set
	 */
	public void setClient(Client client) {
		this.client = client;
	}

	/**
	 * @return the parentOrg
	 */
	public Org getParentOrg() {
		return parentOrg;
	}

	/**
	 * @param parentOrg the parentOrg to set
	 */
	public void setParentOrg(Org parentOrg) {
		this.parentOrg = parentOrg;
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column sys_org.id
     *
     * @return the value of sys_org.id
     *
     *
     */
    public Integer getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column sys_org.id
     *
     * @param id the value for sys_org.id
     *
     *
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column sys_org.value
     *
     * @return the value of sys_org.value
     *
     *
     */
    public String getValue() {
        return value;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column sys_org.value
     *
     * @param value the value for sys_org.value
     *
     *
     */
    public void setValue(String value) {
        this.value = value == null ? null : value.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column sys_org.name
     *
     * @return the value of sys_org.name
     *
     *
     */
    public String getName() {
        return name;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column sys_org.name
     *
     * @param name the value for sys_org.name
     *
     *
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column sys_org.remark
     *
     * @return the value of sys_org.remark
     *
     *
     */
    public String getRemark() {
        return remark;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column sys_org.remark
     *
     * @param remark the value for sys_org.remark
     *
     *
     */
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    /**
	 * @return the orgLevel
	 */
	public Integer getOrgLevel() {
		return orgLevel;
	}

	/**
	 * @param orgLevel the orgLevel to set
	 */
	public void setOrgLevel(Integer orgLevel) {
		this.orgLevel = orgLevel;
	}

	/**
	 * @return the parentOrgId
	 */
	public Integer getParentOrgId() {
		return parentOrgId;
	}

	/**
	 * @param parentOrgId the parentOrgId to set
	 */
	public void setParentOrgId(Integer parentOrgId) {
		this.parentOrgId = parentOrgId;
	}

}


text:
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/utils.js"></script>

<textarea autofocus disabled></textarea>
<select autofocus></select>

<script>
'use strict';

promise_test(async () => {
  const [textarea, select] = document.querySelectorAll('[autofocus]');

  await waitUntilStableAutofocusState();
  assert_not_equals(document.activeElement, textarea);
  assert_equals(document.activeElement, select);
}, 'Non-focusable autofocus element is skipped.');
</script>