text:
#ifndef BTSTACK_HAL_H_
#define BTSTACK_HAL_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "btstack.h"
#include "btstack_chipset_bcm.h"
#include "btstack_config.h"
#include "hci_dump.h"
#include "btstack_hal_define.h"

/**@brief BLE status */
typedef enum BLEStatus {
    BLE_STATUS_OK,
    BLE_STATUS_DONE,
    BLE_STATUS_CONNECTION_TIMEOUT,
    BLE_STATUS_CONNECTION_ERROR,
    BLE_STATUS_OTHER_ERROR
} BLEStatus_t;

/**@brief BLE advertising report data. */
typedef struct{
    uint8_t peerAddrType;
    bd_addr_t  peerAddr;
    int     rssi;
    uint8_t advEventType;
    uint8_t advDataLen;
    uint8_t advData[31];
}advertisementReport_t;

typedef struct{
    uint16_t adv_int_min;
    uint16_t adv_int_max;
    uint8_t adv_type;
    uint8_t dir_addr_type;
    uint8_t dir_addr[BD_ADDR_LEN];
    uint8_t channel_map;
    uint8_t filter_policy;
}advParams_t;

typedef uint16_t (*gattReadCallback_t)                   (uint16_t handle, uint8_t * buffer, uint16_t buffer_size);
typedef int      (*gattWriteCallback_t)                  (uint16_t handle, uint8_t *buffer, uint16_t buffer_size);

typedef void     (*bleAdvertismentCallback_t)            (advertisementReport_t * bleAdvertisement);

typedef void     (*bleConnectedCallback_t)               (BLEStatus_t status, uint16_t handle);
typedef void     (*bleDisconnectedCallback_t)            (uint16_t handle);

typedef void     (*gattServicesDiscoveredCallback_t)     (BLEStatus_t status, uint16_t conn_handle, gatt_client_service_t *service);
typedef void     (*gattCharsDiscoveredCallback_t)        (BLEStatus_t status, uint16_t conn_handle, gatt_client_characteristic_t *characteristic);
typedef void     (*gattDescriptorsDiscoveredCallback_t)  (BLEStatus_t status, uint16_t conn_handle, gatt_client_characteristic_descriptor_t *characteristic);

typedef void     (*gattCharacteristicReadCallback_t)     (BLEStatus_t status, uint16_t con_handle, uint16_t value_handle, uint8_t *value, uint16_t length);
typedef void     (*gattCharacteristicWrittenCallback_t)  (BLEStatus_t status, uint16_t con_handle);

typedef void     (*gattDescriptorReadCallback_t)         (BLEStatus_t status, uint16_t con_handle, uint16_t value_handle, uint8_t *value, uint16_t length);
typedef void     (*gattDescriptorWrittenCallback_t)      (BLEStatus_t status, uint16_t con_handle);

typedef void     (*gattWriteCCCDCallback_t)              (BLEStatus_t status, uint16_t con_handle);
typedef void     (*gattNotifyUpdateCallback_t)           (BLEStatus_t status, uint16_t con_handle, uint16_t value_handle, uint8_t *value, uint16_t length);
typedef void     (*gattIndicateUpdateCallback_t)         (BLEStatus_t status, uint16_t con_handle, uint16_t value_handle, uint8_t *value, uint16_t length);

typedef void     (*btstack_timer_handler_t)(btstack_timer_source_t *_ts);

/**@brief Device API */
void hal_btstack_init(void);
void hal_btstack_deInit(void);
void hal_btstack_loop_execute(void);

void     hal_btstack_setTimer(btstack_timer_source_t *ts, uint32_t timeout_in_ms);
void     hal_btstack_setTimerHandler(btstack_timer_source_t *ts, btstack_timer_handler_t handler);
void     hal_btstack_addTimer(btstack_timer_source_t *timer);
int      hal_btstack_removeTimer(btstack_timer_source_t *timer);
uint32_t hal_btstack_getTimeMs(void);

void hal_btstack_Log_info(uint8_t flag);
void hal_btstack_error_info(uint8_t flag);
void hal_btstack_enable_packet_info(void);

/**@brief Gap API */
void hal_btstack_setRandomAddressMode(gap_random_address_type_t random_address_type);
void hal_btstack_setRandomAddr(bd_addr_t addr);
void hal_btstack_setPublicBdAddr(bd_addr_t addr);
void hal_btstack_getLocalBdAddr(bd_addr_t address_buffer);
void hal_btstack_getAddrOfAdvertisement(uint8_t *addr_type, bd_addr_t addr);
void hal_btstack_setLocalName(const char *local_name);
void hal_btstack_setAdvertisementParams(uint16_t adv_int_min, uint16_t adv_int_max, uint8_t adv_type, uint8_t dir_addr_type, bd_addr_t dir_addr, uint8_t channel_map, uint8_t filter_policy);
void hal_btstack_setAdvertisementData(uint16_t size, uint8_t *data);
void hal_btstack_setScanResponseData(uint16_t size, uint8_t *data);

void hal_btstack_startAdvertising(void);
void hal_btstack_stopAdvertising(void);

void hal_btstack_setConnectedCallback(bleConnectedCallback_t cb);
void hal_btstack_setDisconnectedCallback(bleDisconnectedCallback_t cb);

void hal_btstack_disconnect(uint16_t handle);
uint8_t hal_btstack_connect(bd_addr_t addr, bd_addr_type_t type);

void hal_btstack_setConnParamsRange(le_connection_parameter_range_t range);

void hal_btstack_startScanning(void);
void hal_btstack_stopScanning(void);

void hal_btstack_setScanParams(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window);
void hal_btstack_setBLEAdvertisementCallback(bleAdvertismentCallback_t cb);

/**@brief Gatt server API */
int  hal_btstack_attServerCanSend(void);
int  hal_btstack_attServerSendNotify(uint16_t value_handle, uint8_t *value, uint16_t length);
int  hal_btstack_attServerSendIndicate(uint16_t value_handle, uint8_t *value, uint16_t length);

void hal_btstack_setGattCharsRead(gattReadCallback_t cb);
void hal_btstack_setGattCharsWrite(gattWriteCallback_t cb);

void hal_btstack_addServiceUUID16bits(uint16_t uuid);
void hal_btstack_addServiceUUID128bits(uint8_t *uuid);

uint16_t hal_btstack_addCharsUUID16bits(uint16_t uuid, uint16_t flags, uint8_t *data, uint16_t data_len);
uint16_t hal_btstack_addCharsDynamicUUID16bits(uint16_t uuid, uint16_t flags, uint8_t *data, uint16_t data_len);
uint16_t hal_btstack_addCharsUUID128bits(uint8_t *uuid, uint16_t flags, uint8_t *data, uint16_t data_len);
uint16_t hal_btstack_addCharsDynamicUUID128bits(uint8_t *uuid, uint16_t flags, uint8_t *data, uint16_t data_len);

/**@brief Gatt client API */
void hal_btstack_setGattServiceDiscoveredCallback(gattServicesDiscoveredCallback_t cb);
void hal_btstack_setGattCharsDiscoveredCallback(gattCharsDiscoveredCallback_t cb);
void hal_btstack_setGattDescriptorsDiscoveredCallback(gattDescriptorsDiscoveredCallback_t cb);

void hal_btstack_setGattCharacteristicReadCallback(gattCharacteristicReadCallback_t cb);
void hal_btstack_setGattCharacteristicWrittenCallback(gattCharacteristicWrittenCallback_t cb);

void hal_btstack_setGattDescriptorReadCallback(gattDescriptorReadCallback_t cb);
void hal_btstack_setGattDescriptorWrittenCallback(gattDescriptorWrittenCallback_t cb);

void hal_btstack_setGattWriteCCCDCallback(gattWriteCCCDCallback_t cb);
void hal_btstack_setGattNotifyUpdateCallback(gattNotifyUpdateCallback_t cb);
void hal_btstack_setGattIndicateUpdateCallback(gattIndicateUpdateCallback_t cb);

uint8_t hal_btstack_discoverPrimaryServices(uint16_t con_handle);
uint8_t hal_btstack_discoverPrimaryServicesByUUID16(uint16_t con_handle, uint16_t uuid16);
uint8_t hal_btstack_discoverPrimaryServicesByUUID128(uint16_t con_handle, const uint8_t *uuid);

uint8_t hal_btstack_discoverCharsForService(uint16_t con_handle, gatt_client_service_t  *service);
uint8_t hal_btstack_discoverCharsForHandleRangeByUUID16(uint16_t con_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid16);
uint8_t hal_btstack_discoverCharsForHandleRangeByUUID128(uint16_t con_handle, uint16_t start_handle, uint16_t end_handle, uint8_t *uuid);
uint8_t hal_btstack_discoverCharsForServiceByUUID16(uint16_t con_handle, gatt_client_service_t *service, uint16_t uuid16);
uint8_t hal_btstack_discoverCharsForServiceByUUID128(uint16_t con_handle, gatt_client_service_t *service, uint8_t *uuid128);

uint8_t hal_btstack_discoverCharsDescriptors(uint16_t con_handle, gatt_client_characteristic_t *characteristic);

uint8_t hal_btstack_readValueOfCharacteristic(uint16_t con_handle, gatt_client_characteristic_t  *characteristic);
uint8_t hal_btstack_readValueOfCharacteristicUsingValueHandle(uint16_t con_handle, uint16_t characteristic_value_handle);
uint8_t hal_btstack_readValueOfCharacteristicByUUID16(uint16_t con_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid16);
uint8_t hal_btstack_readValueOfCharacteristicByUUID128(uint16_t con_handle, uint16_t start_handle, uint16_t end_handle, uint8_t *uuid128);
uint8_t hal_btstack_readLongValueOfCharacteristic(uint16_t con_handle, gatt_client_characteristic_t *characteristic);
uint8_t hal_btstack_readLongValueOfCharacteristicUsingValueHandle(uint16_t con_handle, uint16_t characteristic_value_handle);
uint8_t hal_btstack_readLongValueOfCharacteristicUsingValueHandleWithOffset(uint16_t con_handle, uint16_t characteristic_value_handle, uint16_t offset);

uint8_t hal_btstack_writeValueOfChracteristicWithoutResponse(uint16_t con_handle, uint16_t characteristic_value_handle, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeValueOfCharacteristic(uint16_t con_handle, uint16_t characteristic_value_handle, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeLongValueOfCharacteristic(uint16_t con_handle, uint16_t characteristic_value_handle, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeLongValueOfCharacteristicWithOffset(uint16_t con_handle, uint16_t characteristic_value_handle, uint16_t offset, uint16_t length, uint8_t *data);

uint8_t hal_btstack_readCharacteristicDescriptor(uint16_t con_handle, gatt_client_characteristic_descriptor_t *descriptor);
uint8_t hal_btstack_readCharacteristicDescriptorUsingDescriptorHandle(uint16_t con_handle, uint16_t descriptor_handle);
uint8_t hal_btstack_readLongCharacteristicDescriptor(uint16_t con_handle, gatt_client_characteristic_descriptor_t *descriptor);
uint8_t hal_btstack_readLongCharacteristicDescriptorUsingDescriptorHandle(uint16_t con_handle, uint16_t descriptor_handle);
uint8_t hal_btstack_readLongCharacteristicDescriptorUsingDescriptorHandleWithOffset(uint16_t con_handle, uint16_t descriptor_handle, uint16_t offset);

uint8_t hal_btstack_writeCharacteristicDescriptor(uint16_t con_handle, gatt_client_characteristic_descriptor_t *descriptor, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeCharacteristicDescriptorUsingDescriptorHandle(uint16_t con_handle, uint16_t descriptor_handle, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeLongCharacteristicDescriptor(uint16_t con_handle, gatt_client_characteristic_descriptor_t *descriptor, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeLongCharacteristicDescriptorUsingDescriptorHandle(uint16_t con_handle, uint16_t descriptor_handle, uint16_t length, uint8_t *data);
uint8_t hal_btstack_writeLongCharacteristicDescriptorUsingDescriptorHandleWithOffset(uint16_t con_handle, uint16_t descriptor_handle, uint16_t offset, uint16_t length, uint8_t *data);

uint8_t hal_btstack_WriteClientCharacteristicConfiguration(uint16_t con_handle, gatt_client_characteristic_t *characteristic, uint16_t configuration);
void hal_btstack_listenForCharacteristicValueUpdates(gatt_client_notification_t *notification, uint16_t con_handle, gatt_client_characteristic_t *characteristic);

#ifdef __cplusplus
}
#endif

#endif


text:
PolygonBody *randomShapedBody(float minimumRadius, float maximumRadius, Vector2 position, float mass)
{
    unsigned int count = (unsigned int)randomInRange(3, 30);
    Vector2 *vertices = new Vector2[count];
    float e = randomInRange(minimumRadius, maximumRadius);
    for(unsigned int i = 0; i < count; ++i)
        vertices[i] = Vector2( randomInRange(-e, e), randomInRange(-e, e) );

    PolygonBody *b = new PolygonBody(position, mass, vertices, count);
    delete[] vertices;
    return b;
}

void giveBodyAttributesFromOther(Body *to, Body *from)
{
    to->setPosition(from->position());
    to->setMass(from->mass());
}

redpajama_set_name: RedPajamaGithub


text:
aqua_color_variant_blue = 1
aqua_color_variant_graphite = 6

osx_defaults "Set aqua appearance color variant" do
  domain "/Users/#{WS_USER}/Library/Preferences/.GlobalPreferences"
  key "AppleAquaColorVariant"
  integer aqua_color_variant_graphite
end


text:
"use strict";

var assert = require("assert");
var fs = require("fs");
var trusted = require("../index.js");

var DEFAULT_CERTSTORE_PATH = "test/CertStore";
var DEFAULT_RESOURCES_PATH = "test/resources";
var DEFAULT_OUT_PATH = "test/out";

describe("CipherSYMMETRIC", function() {
    var cipher;

    it("init", function() {
        try {
            fs.statSync(DEFAULT_OUT_PATH).isDirectory();
        } catch (err) {
            fs.mkdirSync(DEFAULT_OUT_PATH);
        }

        cipher = new trusted.pki.Cipher();
        assert.equal(cipher !== null, true);

    });

    it("method", function() {
        cipher.cryptoMethod = trusted.CryptoMethod.SYMMETRIC;
    });

    it("encrypt", function() {
        cipher.digest = "MD5";
        cipher.password = "4321";
        cipher.encrypt(DEFAULT_RESOURCES_PATH + "/test.txt", DEFAULT_OUT_PATH + "/encSym.txt");
    });

    it("decrypt", function() {
        cipher.decrypt(DEFAULT_OUT_PATH + "/encSym.txt", DEFAULT_OUT_PATH + "/decSym.txt");

        var res = fs.readFileSync(DEFAULT_RESOURCES_PATH + "/test.txt");
        var out = fs.readFileSync(DEFAULT_OUT_PATH + "/decSym.txt");

        assert.equal(res.toString() === out.toString(), true, "Resource and decrypt file diff");
    });
});

describe("CipherASSYMETRIC", function() {
    var cipher;
    var ris, ri;
    var store, cert, key;

    it("init", function() {
        cipher = new trusted.pki.Cipher();
        assert.equal(cipher !== null, true);
    });

    it("recipients", function() {
        var certs = new trusted.pki.CertificateCollection();

        assert.equal(certs.length, 0);
        certs.push(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/cert1.crt", trusted.DataFormat.PEM));
        assert.equal(certs.length, 1);
        certs.push(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/test.crt", trusted.DataFormat.DER));
        assert.equal(certs.length, 2);

        cipher.recipientsCerts = certs;
    });

    it("encrypt", function() {
        cipher.encrypt(DEFAULT_RESOURCES_PATH + "/test.txt", DEFAULT_OUT_PATH + "/encAssym.txt", trusted.DataFormat.PEM);
    });

    it("recipient cert", function() {
        cert = new trusted.pki.Certificate();

        assert.equal(cert !== null, true);
        cert.load(DEFAULT_RESOURCES_PATH + "/cert1.crt", trusted.DataFormat.PEM);

        cipher.recipientCert = cert;
    });

    it("recipient private key", function() {
        key = new trusted.pki.Key();

        assert.equal(key !== null, true);
        key.readPrivateKey(DEFAULT_RESOURCES_PATH + "/cert1.key", trusted.DataFormat.PEM, "");
        cipher.privKey = key;
    });

    it("recipient info", function() {
        ris = cipher.getRecipientInfos(DEFAULT_OUT_PATH + "/encAssym.txt", trusted.DataFormat.PEM);
        assert.equal(ris.length, 2, "Recipients length 2");

        ri = ris.items(0);
        if (ri.serialNumber === "FD7CF8FC52A1D181") {
            assert.equal(ri.issuerName, "/2.5.4.6=RU/2.5.4.8=Mari El/2.5.4.7=Yoshkar-Ola/2.5.4.10=Cifrovie Tehnologii/2.5.4.3=Test certificate/1.2.840.113549.1.9.1= trusted@digt.ru", "Error issuer name");
            assert.equal(ri.serialNumber, "FD7CF8FC52A1D181", "Error serial number");
            assert.equal(ri.ktriCertCmp(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/cert1.crt", trusted.DataFormat.PEM)) === 0, true, "Compare recipient cert");
            assert.equal(ri.ktriCertCmp(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/test.crt", trusted.DataFormat.DER)) !== 0, true, "Compare recipient cert");
        } else {
            assert.equal(ri.issuerName, "/2.5.4.6=IL/2.5.4.10=StartCom Ltd./2.5.4.11=Secure Digital Certificate Signing/2.5.4.3=StartCom Certification Authority", "Error issuer name");
            assert.equal(ri.serialNumber, "1B8612677AE19D", "Error serial number");
            assert.equal(ri.ktriCertCmp(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/cert1.crt", trusted.DataFormat.PEM)) !== 0, true, "Compare recipient cert");
            assert.equal(ri.ktriCertCmp(trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/test.crt", trusted.DataFormat.DER)) === 0, true, "Compare recipient cert");
        }

        ri = ris.items(1);
        assert.equal(typeof (ri.issuerName), "string", "Error issuer name");
        assert.equal(typeof (ri.serialNumber), "string", "Error serial number");
    });

    it("find recipient in store", function() {
        var providerSystem;
        var item;
        var certWithKey;

        for (var j = 0; j < ris.length; j++) {
            ri = ris.items(j);
            if (ri.issuerName === "/2.5.4.6=RU/2.5.4.8=Mari El/2.5.4.7=Yoshkar-Ola/2.5.4.10=Cifrovie Tehnologii/2.5.4.3=Test certificate/1.2.840.113549.1.9.1= trusted@digt.ru") {
                break;
            }
        }

        store = new trusted.pkistore.PkiStore(DEFAULT_CERTSTORE_PATH + "/cash.json");
        assert.equal(store !== null, true);

        providerSystem = new trusted.pkistore.Provider_System(DEFAULT_CERTSTORE_PATH);

        cert = trusted.pki.Certificate.load(DEFAULT_RESOURCES_PATH + "/cert1.crt", trusted.DataFormat.PEM);
        key = trusted.pki.Key.readPrivateKey(DEFAULT_RESOURCES_PATH + "/cert1.key", trusted.DataFormat.PEM, "");

        store.addCert(providerSystem.handle, "MY", cert, 0);
        store.addKey(providerSystem.handle, key, "");

        providerSystem = new trusted.pkistore.Provider_System(DEFAULT_CERTSTORE_PATH);
        assert.equal(providerSystem !== null, true);
        store.addProvider(providerSystem.handle);

        var certs = store.find({
            issuerName: ri.issuerName,
            serial: ri.serialNumber
        });

        for (var i = 0; i < certs.length; i++) {
            item = certs[i];
            if (item.key) {
                certWithKey = store.getItem(item);
            }
            assert.equal(item.type, "CERTIFICATE");
            if (item.type === "CERTIFICATE") {
                cert = store.getItem(item);
                assert.equal(cert.subjectName.length > 0, true);
            }
        }

        assert.equal(!!certWithKey, true, "Error get certificate with key");

        key = store.findKey({
            type: ["CERTIFICATE"],
            provider: ["SYSTEM"],
            category: ["MY"],
            hash: certWithKey.thumbprint.toString("hex")
        });

        assert.equal(!!key, true, "Error get private key");
    });

    it("decrypt", function() {
        cipher = new trusted.pki.Cipher();
        cipher.recipientCert = cert;
        cipher.privKey = store.getItem(key);

        cipher.decrypt(DEFAULT_OUT_PATH + "/encAssym.txt", DEFAULT_OUT_PATH + "/decAssym.txt", trusted.DataFormat.PEM);

        var res = fs.readFileSync(DEFAULT_RESOURCES_PATH + "/test.txt");
        var out = fs.readFileSync(DEFAULT_OUT_PATH + "/decAssym.txt");

        assert.equal(res.toString() === out.toString(), true, "Resource and decrypt file diff");
    });
});


text:
var net = require('net');
var util = require('util');

/*
 Put into your statsite config as:
 ****
 stream_cmd = node sinks/opentsdb.js 127.0.0.1 4242 _t_
 ****
 */

if (process.argv.length != 5)
{
    console.log('Wrong number of arguments');
    console.log('opentsdbsink.js <opentsdbhost> <opentsdbport> <tagprefix>');
    process.exit(1);
}
var host = process.argv[2];
var port = process.argv[3];
var tagprefix = process.argv[4];

// Returns a list of "tagname=tagvalue" strings from the given metric name.
function parse_tags(metric_name) {
    var parts = metric_name.split(".");
    var tags = [];
    var current_tag_name = "";
    for (var i in parts)
    {
        var p = parts[i];
        if (p.indexOf(tagprefix) == 0)
        {
            current_tag_name = p.split(tagprefix)[1]
        }
        else if (current_tag_name != "")
        {
            tags.push(current_tag_name + "=" + p);
            current_tag_name = "";
        }
    }

    return tags;
}

// Strips out all tag information from the given metric name
function strip_tags(metric_name) {
    var parts = metric_name.split(".");
    var rslt_parts = [];
    while (parts.length > 0)
    {
        if (parts[0].indexOf(tagprefix) == 0)
        {
            parts.shift();
            parts.shift();
            continue;
        }
        rslt_parts.push(parts.shift());
    }

    return rslt_parts.join(".");
}

var data = '';

process.stdin.setEncoding('utf8');
process.stdin.on('readable', function () {
    var chunk = process.stdin.read();
    if (chunk !== null) data += chunk
});
process.stdin.on('end', function () {
    var suffix = " source=statsd";
    if (data)
    {
        data = data.split('\n');
        var tString = '';
        for (var i in data)
        {
            var mParts = data[i].split('|');
            tString += ('put ' + strip_tags(mParts[0]) + ' ' + mParts[2] + ' ' + mParts[1] + ' ' + parse_tags(mParts[0]).join(' ') + suffix).replace(/\s+/g, ' ') + '\n';
        }
        try
        {
            var opentsdb = net.createConnection(port, host);
            opentsdb.on('connect', function () {
                this.write(tString);
                this.end();
                process.exit(0);
            });
        }
        catch (e)
        {
            util.log(e);
            process.exit(1);
        }
    }
});


text:
package main

import (
	"reflect"
	"regexp"
	"testing"

	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/resource"
	"k8s.io/kubernetes/pkg/client/unversioned/testclient"
	kubectlResource "k8s.io/kubernetes/pkg/kubectl/resource"
)

func TestDeployApp(t *testing.T) {
	namespace := "foo-namespace"
	spec := &AppDeploymentSpec{
		Namespace:       namespace,
		Name:            "foo-name",
		RunAsPrivileged: true,
	}
	expectedRc := &api.ReplicationController{
		ObjectMeta: api.ObjectMeta{
			Name:        "foo-name",
			Labels:      map[string]string{},
			Annotations: map[string]string{},
		},
		Spec: api.ReplicationControllerSpec{
			Template: &api.PodTemplateSpec{
				ObjectMeta: api.ObjectMeta{
					Name:        "foo-name",
					Labels:      map[string]string{},
					Annotations: map[string]string{},
				},
				Spec: api.PodSpec{
					Containers: []api.Container{{
						Name: "foo-name",
						SecurityContext: &api.SecurityContext{
							Privileged: &spec.RunAsPrivileged,
						},
						Resources: api.ResourceRequirements{
							Requests: make(map[api.ResourceName]resource.Quantity),
						},
					}},
				},
			},
			Selector: map[string]string{},
		},
	}

	testClient := testclient.NewSimpleFake()

	DeployApp(spec, testClient)

	createAction := testClient.Actions()[0].(testclient.CreateActionImpl)
	if len(testClient.Actions()) != 1 {
		t.Errorf("Expected one create action but got %#v", len(testClient.Actions()))
	}

	if createAction.Namespace != namespace {
		t.Errorf("Expected namespace to be %#v but go %#v", namespace, createAction.Namespace)
	}

	rc := createAction.GetObject().(*api.ReplicationController)
	if !reflect.DeepEqual(rc, expectedRc) {
		t.Errorf("Expected replication controller \n%#v\n to be created but got \n%#v\n",
			expectedRc, rc)
	}
}

func TestDeployAppContainerCommands(t *testing.T) {
	command := "foo-command"
	commandArgs := "foo-command-args"
	spec := &AppDeploymentSpec{
		Namespace:            "foo-namespace",
		Name:                 "foo-name",
		ContainerCommand:     &command,
		ContainerCommandArgs: &commandArgs,
	}
	testClient := testclient.NewSimpleFake()

	DeployApp(spec, testClient)

	createAction := testClient.Actions()[0].(testclient.CreateActionImpl)

	rc := createAction.GetObject().(*api.ReplicationController)
	container := rc.Spec.Template.Spec.Containers[0]
	if container.Command[0] != command {
		t.Errorf("Expected command to be %#v but got %#v",
			command, container.Command)
	}

	if container.Args[0] != commandArgs {
		t.Errorf("Expected command args to be %#v but got %#v",
			commandArgs, container.Args)
	}
}

func TestDeployShouldPopulateEnvVars(t *testing.T) {
	spec := &AppDeploymentSpec{
		Namespace: "foo-namespace",
		Name:      "foo-name",
		Variables: []EnvironmentVariable{{"foo", "bar"}},
	}
	testClient := testclient.NewSimpleFake()

	DeployApp(spec, testClient)

	createAction := testClient.Actions()[0].(testclient.CreateActionImpl)

	rc := createAction.GetObject().(*api.ReplicationController)
	container := rc.Spec.Template.Spec.Containers[0]
	if !reflect.DeepEqual(container.Env, []api.EnvVar{{Name: "foo", Value: "bar"}}) {
		t.Errorf("Expected environment variables to be %#v but got %#v",
			[]api.EnvVar{{Name: "foo", Value: "bar"}}, container.Env)
	}
}

func TestDeployShouldGeneratePortNames(t *testing.T) {
	spec := PortMapping{Port: 80, TargetPort: 8080, Protocol: api.ProtocolTCP}

	name := generatePortMappingName(spec)

	pattern := "tcp-80-8080-\\w+"
	match, _ := regexp.MatchString(pattern, name)
	if !match {
		t.Errorf("Expected command to match %#v but got %#v",
			pattern, name)
	}
}

func TestDeployWithResourceRequirements(t *testing.T) {
	cpuRequirement := resource.Quantity{}
	memoryRequirement := resource.Quantity{}
	spec := &AppDeploymentSpec{
		Namespace:         "foo-namespace",
		Name:              "foo-name",
		CpuRequirement:    &cpuRequirement,
		MemoryRequirement: &memoryRequirement,
	}
	expectedResources := api.ResourceRequirements{
		Requests: map[api.ResourceName]resource.Quantity{
			api.ResourceMemory: memoryRequirement,
			api.ResourceCPU:    cpuRequirement,
		},
	}
	testClient := testclient.NewSimpleFake()

	DeployApp(spec, testClient)

	createAction := testClient.Actions()[0].(testclient.CreateActionImpl)

	rc := createAction.GetObject().(*api.ReplicationController)
	container := rc.Spec.Template.Spec.Containers[0]
	if !reflect.DeepEqual(container.Resources, expectedResources) {
		t.Errorf("Expected resource requirements to be %#v but got %#v",
			expectedResources, container.Resources)
	}
}

func TestGetAvailableProtocols(t *testing.T) {
	expected := &Protocols{Protocols: []api.Protocol{"TCP", "UDP"}}

	actual := GetAvailableProtocols()
	if !reflect.DeepEqual(actual, expected) {
		t.Errorf("Expected protocols to be %#v but got %#v",
			expected, actual)
	}
}

func TestDeployAppFromFileWithValidContent(t *testing.T) {
	validContent := "{\"kind\": \"Namespace\"," +
		"\"apiVersion\": \"v1\"," +
		"\"metadata\": {" +
		"\"name\": \"test-deployfile-namespace\"," +
		"\"labels\": {\"name\": \"development\"}}}"
	spec := &AppDeploymentFromFileSpec{
		Name:    "foo-name",
		Content: validContent,
	}
	fakeCreateObjectFromInfo := func(info *kubectlResource.Info) (bool, error) { return true, nil }

	isDeployed, err := DeployAppFromFile(spec, fakeCreateObjectFromInfo, nil)
	if err != nil {
		t.Errorf("Expected return value to have %#v but got %#v", nil, err)
	}
	if !isDeployed {
		t.Errorf("Expected return value to have %#v but got %#v", true, isDeployed)
	}
}

func TestDeployAppFromFileWithInvalidContent(t *testing.T) {
	spec := &AppDeploymentFromFileSpec{
		Name:    "foo-name",
		Content: "foo-content-invalid",
	}
	// return is set to true to check if the validation prior to this function really works
	fakeCreateObjectFromInfo := func(info *kubectlResource.Info) (bool, error) { return true, nil }

	isDeployed, err := DeployAppFromFile(spec, fakeCreateObjectFromInfo, nil)
	if err == nil {
		t.Errorf("Expected return value to have an error but got %#v", nil)
	}
	if isDeployed {
		t.Errorf("Expected return value to have %#v but got %#v", false, isDeployed)
	}
}


text:
package timetakers.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.config.ResourceNotFoundException;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.PagedResourcesAssembler;
import org.springframework.hateoas.PagedResources;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import timetakers.exception.ValidationRuntimeException;
import timetakers.model.Item;
import timetakers.repository.ItemRepository;
import timetakers.repository.specification.ItemSpecification;
import timetakers.services.ItemService;
import timetakers.services.SecurityService;
import timetakers.util.TextKey;
import timetakers.web.assembler.ItemAssembler;
import timetakers.web.model.ItemDto;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author Martin Geßenich
 */

@Controller
@Transactional
@RequestMapping(value = "/item")
public class ItemController {

    private ItemRepository itemRepository;
    private ItemAssembler itemAssembler;
    private ItemService itemService;

    @Autowired
    public ItemController(ItemRepository itemRepository, ItemAssembler itemAssembler, ItemService itemService) {
        this.itemRepository = itemRepository;
        this.itemAssembler = itemAssembler;
        this.itemService = itemService;
    }

    @RequestMapping(value = "/new", method = RequestMethod.POST)
    @ResponseBody
    public void postNewItem( @RequestBody ItemDto itemDto ) {
        Item father = null;
        if (itemDto.father != null) {
            father = itemRepository.getOne(itemDto.father);
        }
        if (StringUtils.isEmpty(itemDto.title)) {
            throw new ValidationRuntimeException(new TextKey("item.validation.emptyTitle"), "itemName");
        }
        Item item = Item.builder()
                .withTitle(itemDto.title)
                .withPerson(SecurityService.getLoggedInPerson())
                .withFather(father)
                .withColor(itemDto.color).createItem();

        itemRepository.save(item);
    }

    @RequestMapping(value = "/new", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
    public ModelAndView getNewItemAsHtml() {
        return new ModelAndView("item");
    }

    @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public PagedResources<ItemDto> getItemAsJson(@RequestParam(required = false) String search, @PageableDefault(size = 20, sort = "title")Pageable pageable, PagedResourcesAssembler<Item> pagedResourcesAssembler) {
        return pagedResourcesAssembler.toResource(itemRepository.findAll( new ItemSpecification(SecurityService.getLoggedInPerson(), search),pageable), itemAssembler);
    }

    @RequestMapping(value = "/lastused", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public List<ItemDto> getLastUsedItemsAsJson(@RequestParam(required = false) Integer limit) {
        return itemAssembler.toResources(itemService.getLastUsedItems(limit));
    }

    @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public ItemDto getItemWithIdAsJson(@PathVariable UUID id) {
        return itemAssembler.toResource(itemRepository.findOne(id));
    }

    @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
    @ResponseStatus(code = HttpStatus.OK)
    public void updateItemWithIdAsJson(@PathVariable UUID id, @RequestBody ItemDto itemDto) {
        if (!id.equals(itemDto.oid)) {
            throw new IllegalArgumentException();
        }
        Item item = itemRepository.findOne(id);
        if (item == null) {
            throw new ResourceNotFoundException("", null);
        }
        if (StringUtils.isEmpty(itemDto.title)) {
            throw new ValidationRuntimeException(new TextKey("item.validation.emptyTitle"), "itemName");
        }
        item.setTitle(itemDto.title);
        item.setColor(itemDto.color);
        if (itemDto.father != null) {
            Item father = itemRepository.findOne(itemDto.father);
            item.setFather(father);
        }
        itemRepository.save(item);
    }

    @RequestMapping(value = "/{id}/children", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public List<ItemDto> getChildrenOfItemAsJson(@PathVariable UUID id) {
        Item father = itemRepository.getOne(id);
        List<Item> items = itemRepository.findByPersonAndFather(SecurityService.getLoggedInPerson(), father);
        return itemAssembler.toResources(items);
    }

    @RequestMapping(value = "/{id}/haschildren", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public Map<String, Boolean> getItemHasChildrenOfItemAsJson(@PathVariable UUID id) {
        Item father = itemRepository.getOne(id);
        return Collections.singletonMap("children", itemRepository.countByPersonAndFather(SecurityService.getLoggedInPerson(), father) > 0);
    }

    @RequestMapping(value = "/{id}/edit", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
    public ModelAndView getEditItemAsHtml(@PathVariable UUID id) {
        ModelAndView modelAndView = new ModelAndView("item");
        Item item = itemRepository.findOne(id);
        ItemDto itemDto = itemAssembler.toResource(item);
        modelAndView.addObject("item", itemDto);
        return modelAndView;
    }

    @RequestMapping(value = "/root", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public List<ItemDto> getRootItemsAsJson() {
        List<Item> items = itemRepository.findByPersonAndFather(SecurityService.getLoggedInPerson(), null);
        return itemAssembler.toResources(items);
    }

}


text:
 /* This file is automatically generated by GenTrustAnchorsTables.py, do not edit */

#include "NptTls.h"

extern const NPT_TlsTrustAnchorData NptTlsDefaultTrustAnchorsBase[137];

/* Verisign/RSA Secure Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0000_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0000_Data[];

/* GTE CyberTrust Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0001_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0001_Data[];

/* GTE CyberTrust Global Root */
extern const unsigned int NptTlsTrustAnchor_Base_0002_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0002_Data[];

/* Thawte Personal Basic CA */
extern const unsigned int NptTlsTrustAnchor_Base_0003_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0003_Data[];

/* Thawte Personal Premium CA */
extern const unsigned int NptTlsTrustAnchor_Base_0004_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0004_Data[];

/* Thawte Personal Freemail CA */
extern const unsigned int NptTlsTrustAnchor_Base_0005_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0005_Data[];

/* Thawte Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0006_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0006_Data[];

/* Thawte Premium Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0007_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0007_Data[];

/* Equifax Secure CA */
extern const unsigned int NptTlsTrustAnchor_Base_0008_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0008_Data[];

/* Digital Signature Trust Co. Global CA 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0009_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0009_Data[];

/* Digital Signature Trust Co. Global CA 3 */
extern const unsigned int NptTlsTrustAnchor_Base_0010_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0010_Data[];

/* Digital Signature Trust Co. Global CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0011_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0011_Data[];

/* Digital Signature Trust Co. Global CA 4 */
extern const unsigned int NptTlsTrustAnchor_Base_0012_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0012_Data[];

/* Verisign Class 1 Public Primary Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0013_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0013_Data[];

/* Verisign Class 2 Public Primary Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0014_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0014_Data[];

/* Verisign Class 3 Public Primary Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0015_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0015_Data[];

/* Verisign Class 1 Public Primary Certification Authority - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0016_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0016_Data[];

/* Verisign Class 2 Public Primary Certification Authority - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0017_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0017_Data[];

/* Verisign Class 3 Public Primary Certification Authority - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0018_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0018_Data[];

/* Verisign Class 4 Public Primary Certification Authority - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0019_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0019_Data[];

/* GlobalSign Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0020_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0020_Data[];

/* GlobalSign Root CA - R2 */
extern const unsigned int NptTlsTrustAnchor_Base_0021_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0021_Data[];

/* ValiCert Class 1 VA */
extern const unsigned int NptTlsTrustAnchor_Base_0022_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0022_Data[];

/* ValiCert Class 2 VA */
extern const unsigned int NptTlsTrustAnchor_Base_0023_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0023_Data[];

/* RSA Root Certificate 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0024_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0024_Data[];

/* Verisign Class 1 Public Primary Certification Authority - G3 */
extern const unsigned int NptTlsTrustAnchor_Base_0025_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0025_Data[];

/* Verisign Class 2 Public Primary Certification Authority - G3 */
extern const unsigned int NptTlsTrustAnchor_Base_0026_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0026_Data[];

/* Verisign Class 3 Public Primary Certification Authority - G3 */
extern const unsigned int NptTlsTrustAnchor_Base_0027_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0027_Data[];

/* Verisign Class 4 Public Primary Certification Authority - G3 */
extern const unsigned int NptTlsTrustAnchor_Base_0028_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0028_Data[];

/* Entrust.net Secure Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0029_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0029_Data[];

/* Entrust.net Secure Personal CA */
extern const unsigned int NptTlsTrustAnchor_Base_0030_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0030_Data[];

/* Entrust.net Premium 2048 Secure Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0031_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0031_Data[];

/* Baltimore CyberTrust Root */
extern const unsigned int NptTlsTrustAnchor_Base_0032_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0032_Data[];

/* Equifax Secure Global eBusiness CA */
extern const unsigned int NptTlsTrustAnchor_Base_0033_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0033_Data[];

/* Equifax Secure eBusiness CA 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0034_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0034_Data[];

/* Equifax Secure eBusiness CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0035_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0035_Data[];

/* Visa International Global Root 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0036_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0036_Data[];

/* AddTrust Low-Value Services Root */
extern const unsigned int NptTlsTrustAnchor_Base_0037_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0037_Data[];

/* AddTrust External Root */
extern const unsigned int NptTlsTrustAnchor_Base_0038_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0038_Data[];

/* AddTrust Public Services Root */
extern const unsigned int NptTlsTrustAnchor_Base_0039_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0039_Data[];

/* AddTrust Qualified Certificates Root */
extern const unsigned int NptTlsTrustAnchor_Base_0040_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0040_Data[];

/* Verisign Time Stamping Authority CA */
extern const unsigned int NptTlsTrustAnchor_Base_0041_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0041_Data[];

/* Thawte Time Stamping CA */
extern const unsigned int NptTlsTrustAnchor_Base_0042_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0042_Data[];

/* Entrust.net Global Secure Server CA */
extern const unsigned int NptTlsTrustAnchor_Base_0043_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0043_Data[];

/* Entrust.net Global Secure Personal CA */
extern const unsigned int NptTlsTrustAnchor_Base_0044_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0044_Data[];

/* Entrust Root Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0045_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0045_Data[];

/* AOL Time Warner Root Certification Authority 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0046_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0046_Data[];

/* AOL Time Warner Root Certification Authority 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0047_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0047_Data[];

/* beTRUSTed Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0048_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0048_Data[];

/* beTRUSTed Root CA-Baltimore Implementation */
extern const unsigned int NptTlsTrustAnchor_Base_0049_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0049_Data[];

/* beTRUSTed Root CA - Entrust Implementation */
extern const unsigned int NptTlsTrustAnchor_Base_0050_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0050_Data[];

/* beTRUSTed Root CA - RSA Implementation */
extern const unsigned int NptTlsTrustAnchor_Base_0051_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0051_Data[];

/* RSA Security 2048 v3 */
extern const unsigned int NptTlsTrustAnchor_Base_0052_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0052_Data[];

/* RSA Security 1024 v3 */
extern const unsigned int NptTlsTrustAnchor_Base_0053_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0053_Data[];

/* GeoTrust Global CA */
extern const unsigned int NptTlsTrustAnchor_Base_0054_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0054_Data[];

/* GeoTrust Global CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0055_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0055_Data[];

/* GeoTrust Universal CA */
extern const unsigned int NptTlsTrustAnchor_Base_0056_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0056_Data[];

/* GeoTrust Universal CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0057_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0057_Data[];

/* UTN-USER First-Network Applications */
extern const unsigned int NptTlsTrustAnchor_Base_0058_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0058_Data[];

/* America Online Root Certification Authority 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0059_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0059_Data[];

/* America Online Root Certification Authority 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0060_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0060_Data[];

/* Visa eCommerce Root */
extern const unsigned int NptTlsTrustAnchor_Base_0061_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0061_Data[];

/* TC TrustCenter, Germany, Class 2 CA */
extern const unsigned int NptTlsTrustAnchor_Base_0062_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0062_Data[];

/* TC TrustCenter, Germany, Class 3 CA */
extern const unsigned int NptTlsTrustAnchor_Base_0063_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0063_Data[];

/* Certum Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0064_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0064_Data[];

/* Comodo AAA Services root */
extern const unsigned int NptTlsTrustAnchor_Base_0065_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0065_Data[];

/* Comodo Secure Services root */
extern const unsigned int NptTlsTrustAnchor_Base_0066_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0066_Data[];

/* Comodo Trusted Services root */
extern const unsigned int NptTlsTrustAnchor_Base_0067_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0067_Data[];

/* IPS Chained CAs root */
extern const unsigned int NptTlsTrustAnchor_Base_0068_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0068_Data[];

/* IPS CLASE1 root */
extern const unsigned int NptTlsTrustAnchor_Base_0069_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0069_Data[];

/* IPS CLASE3 root */
extern const unsigned int NptTlsTrustAnchor_Base_0070_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0070_Data[];

/* IPS CLASEA1 root */
extern const unsigned int NptTlsTrustAnchor_Base_0071_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0071_Data[];

/* IPS CLASEA3 root */
extern const unsigned int NptTlsTrustAnchor_Base_0072_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0072_Data[];

/* IPS Servidores root */
extern const unsigned int NptTlsTrustAnchor_Base_0073_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0073_Data[];

/* IPS Timestamping root */
extern const unsigned int NptTlsTrustAnchor_Base_0074_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0074_Data[];

/* QuoVadis Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0075_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0075_Data[];

/* QuoVadis Root CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0076_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0076_Data[];

/* QuoVadis Root CA 3 */
extern const unsigned int NptTlsTrustAnchor_Base_0077_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0077_Data[];

/* Security Communication Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0078_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0078_Data[];

/* Sonera Class 1 Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0079_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0079_Data[];

/* Sonera Class 2 Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0080_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0080_Data[];

/* Staat der Nederlanden Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0081_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0081_Data[];

/* TDC Internet Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0082_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0082_Data[];

/* TDC OCES Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0083_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0083_Data[];

/* UTN DATACorp SGC Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0084_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0084_Data[];

/* UTN USERFirst Email Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0085_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0085_Data[];

/* UTN USERFirst Hardware Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0086_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0086_Data[];

/* UTN USERFirst Object Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0087_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0087_Data[];

/* Camerfirma Chambers of Commerce Root */
extern const unsigned int NptTlsTrustAnchor_Base_0088_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0088_Data[];

/* Camerfirma Global Chambersign Root */
extern const unsigned int NptTlsTrustAnchor_Base_0089_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0089_Data[];

/* NetLock Qualified (Class QA) Root */
extern const unsigned int NptTlsTrustAnchor_Base_0090_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0090_Data[];

/* NetLock Notary (Class A) Root */
extern const unsigned int NptTlsTrustAnchor_Base_0091_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0091_Data[];

/* NetLock Business (Class B) Root */
extern const unsigned int NptTlsTrustAnchor_Base_0092_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0092_Data[];

/* NetLock Express (Class C) Root */
extern const unsigned int NptTlsTrustAnchor_Base_0093_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0093_Data[];

/* XRamp Global CA Root */
extern const unsigned int NptTlsTrustAnchor_Base_0094_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0094_Data[];

/* Go Daddy Class 2 CA */
extern const unsigned int NptTlsTrustAnchor_Base_0095_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0095_Data[];

/* Starfield Class 2 CA */
extern const unsigned int NptTlsTrustAnchor_Base_0096_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0096_Data[];

/* StartCom Ltd. */
extern const unsigned int NptTlsTrustAnchor_Base_0097_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0097_Data[];

/* StartCom Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0098_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0098_Data[];

/* Firmaprofesional Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0099_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0099_Data[];

/* Wells Fargo Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0100_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0100_Data[];

/* Swisscom Root CA 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0101_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0101_Data[];

/* DigiCert Assured ID Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0102_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0102_Data[];

/* DigiCert Global Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0103_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0103_Data[];

/* DigiCert High Assurance EV Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0104_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0104_Data[];

/* Certplus Class 2 Primary CA */
extern const unsigned int NptTlsTrustAnchor_Base_0105_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0105_Data[];

/* DST Root CA X3 */
extern const unsigned int NptTlsTrustAnchor_Base_0106_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0106_Data[];

/* DST ACES CA X6 */
extern const unsigned int NptTlsTrustAnchor_Base_0107_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0107_Data[];

/* SwissSign Platinum CA - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0108_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0108_Data[];

/* SwissSign Gold CA - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0109_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0109_Data[];

/* SwissSign Silver CA - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0110_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0110_Data[];

/* GeoTrust Primary Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0111_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0111_Data[];

/* thawte Primary Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0112_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0112_Data[];

/* VeriSign Class 3 Public Primary Certification Authority - G5 */
extern const unsigned int NptTlsTrustAnchor_Base_0113_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0113_Data[];

/* SecureTrust CA */
extern const unsigned int NptTlsTrustAnchor_Base_0114_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0114_Data[];

/* Secure Global CA */
extern const unsigned int NptTlsTrustAnchor_Base_0115_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0115_Data[];

/* COMODO Certification Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0116_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0116_Data[];

/* DigiNotar Root CA */
extern const unsigned int NptTlsTrustAnchor_Base_0117_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0117_Data[];

/* Network Solutions Certificate Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0118_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0118_Data[];

/* WellsSecure Public Root Certificate Authority */
extern const unsigned int NptTlsTrustAnchor_Base_0119_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0119_Data[];

/* IGC/A */
extern const unsigned int NptTlsTrustAnchor_Base_0120_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0120_Data[];

/* Security Communication EV RootCA1 */
extern const unsigned int NptTlsTrustAnchor_Base_0121_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0121_Data[];

/* TC TrustCenter Class 2 CA II */
extern const unsigned int NptTlsTrustAnchor_Base_0122_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0122_Data[];

/* TC TrustCenter Class 3 CA II */
extern const unsigned int NptTlsTrustAnchor_Base_0123_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0123_Data[];

/* TC TrustCenter Universal CA I */
extern const unsigned int NptTlsTrustAnchor_Base_0124_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0124_Data[];

/* Deutsche Telekom Root CA 2 */
extern const unsigned int NptTlsTrustAnchor_Base_0125_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0125_Data[];

/* ComSign CA */
extern const unsigned int NptTlsTrustAnchor_Base_0126_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0126_Data[];

/* ComSign Secured CA */
extern const unsigned int NptTlsTrustAnchor_Base_0127_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0127_Data[];

/* Cybertrust Global Root */
extern const unsigned int NptTlsTrustAnchor_Base_0128_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0128_Data[];

/* Buypass Class 2 CA 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0129_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0129_Data[];

/* Buypass Class 3 CA 1 */
extern const unsigned int NptTlsTrustAnchor_Base_0130_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0130_Data[];

/* certSIGN ROOT CA */
extern const unsigned int NptTlsTrustAnchor_Base_0131_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0131_Data[];

/* ApplicationCA - Japanese Government */
extern const unsigned int NptTlsTrustAnchor_Base_0132_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0132_Data[];

/* GeoTrust Primary Certification Authority - G3 */
extern const unsigned int NptTlsTrustAnchor_Base_0133_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0133_Data[];

/* thawte Primary Root CA - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0134_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0134_Data[];

/* GeoTrust Primary Certification Authority - G2 */
extern const unsigned int NptTlsTrustAnchor_Base_0135_Size;
extern const unsigned char NptTlsTrustAnchor_Base_0135_Data[];


text:
``LassoLarsIC``
============================================================================

.. autoclass:: ibex.sklearn.linear_model.LassoLarsIC
    :members:
    :special-members:
    :show-inheritance:


text:
wildcodes
=========

My solutions to http://www.trywildcard.com/challenge


text:
<?php

namespace GoogleApi\external;

class apiClientOAuthConsumer
{

    public $key;
    public $secret;

    public function __construct($key, $secret, $callback_url = NULL)
    {
        $this->key = $key;
        $this->secret = $secret;
        $this->callback_url = $callback_url;
    }

}


text:
"""
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014

Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
"""

import os
from os import path
import re
from StringIO import StringIO

AUTO_FIX = False
##AUTO_FIX = True

def test_newlines_and_tabs():
    print "Testing the source code format..."

    # Regexp to detect separator lines.
    separator = re.compile(r"^ *\#\-+ *\n$")

    # Get the GoLismero folder.
    here = path.split(path.abspath(__file__))[0]
    if not here:  # if it fails use cwd instead
        here = path.abspath(os.getcwd())
    golismero = path.join(here, "..")
    golismero = path.abspath(golismero)
    if not golismero.endswith(path.sep):
        golismero += path.sep

    # Recursively look for all .py files.
    # Skip the third party libs folder and tools folder.
    for root, directories, files in os.walk(golismero):
        if root.endswith(path.sep + "thirdparty_libs"):
            continue
        if (path.sep + "thirdparty_libs" + path.sep) in root:
            continue
        if root.endswith(path.sep + "tools"):
            continue
        if (path.sep + "tools" + path.sep) in root:
            continue
        for filename in files:
            if not filename.endswith(".py") and \
                    not filename.endswith(".golismero"):
                continue
            filename = path.join(root, filename)
            filename = path.abspath(filename)

            # Get the relative file name, for reporting.
            relative = filename[ len(golismero) : ]

            # Read the file bytes in binary mode.
            with open(filename, "rb") as fd:
                data = fd.read()

            # Skip 0 byte files.
            if not data:
                continue

            # If tab characters are present, warn about it.
            if "\t" in data:
                print "+ found tabs in file: %s" % relative

            # If newline characters are not in Linux format, warn about it.
            if "\r\n" in data:
                print "+ found Windows newlines in file: %s" % relative
                if AUTO_FIX:
                    data = data.replace("\r\n", "\n")
                    with open(filename, "wb") as fd:
                        fd.write(data)
            elif "\r" in data:
                print "+ found Mac newlines in file: %s" % relative
                if AUTO_FIX:
                    data = data.replace("\r", "\n")
                    with open(filename, "wb") as fd:
                        fd.write(data)

            # If the file doesn't end with a newline character, warn about it.
            if not data.endswith("\n") and not data.endswith("\r"):
                print "+ found file with no terminating newline: %s" % relative
                if AUTO_FIX:
                    data += "\n"
                    with open(filename, "wb") as fd:
                        fd.write(data)

            # If bad blank lines are found, warn about it.
            fake = StringIO(data)
            warned = False
            fixed = []
            for line in fake:
                if line.strip() == "" and line != "\n":
                    if not warned:
                        print "+ found file with bad blank lines: %s" \
                              % relative
                        warned = True
                    line = "\n"
                fixed.append(line)
            if warned and AUTO_FIX:
                data = "".join(fixed)
                with open(filename, "wb") as fd:
                    fd.write(data)

            # If broken separators are found, warn about it.
            fake = StringIO(data)
            warned = False
            fixed = []
            for line in fake:
                if separator.match(line):
                    if len(line) != 80:
                        if not warned:
                            print "+ found file with broken separators: %s" \
                                  % relative
                            warned = True
                        line = line.rstrip()
                        if len(line) < 79:
                            line += "-" * (80 - len(line))
                        else:
                            line = line[:79]
                        line += "\n"
                    if (len(fixed) < 2 or \
                            fixed[-1] != "\n" or fixed[-2] != "\n") and \
                                    not fixed[-1].lstrip().startswith("#"):
                        if not warned:
                            print "+ found file with broken separators: %s" \
                                  % relative
                            warned = True
                        if fixed[-1] != "\n":
                            fixed.append("\n")
                            fixed.append("\n")
                        elif fixed[-2] != "\n":
                            fixed.append("\n")
                    if len(fixed) > 2 and \
                                fixed[-1] == fixed[-2] == fixed[-3] == "\n":
                        if not warned:
                            print "+ found file with broken separators: %s" \
                                  % relative
                            warned = True
                        while len(fixed) > 2 and \
                                fixed[-1] == fixed[-2] == fixed[-3] == "\n":
                            fixed.pop()
                fixed.append(line)
            if warned and AUTO_FIX:
                data = "".join(fixed)
                with open(filename, "wb") as fd:
                    fd.write(data)

    # Done!
    print "...done!"

# Run the test from the command line.
if __name__ == "__main__":
    test_newlines_and_tabs()


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

namespace BGC.Core.Services
{
    public static class ServiceExtensions
    {
        /// <summary>
        /// Finds the highest priority setting that the service can currently access by using the given setting's name and attempts to cast
        /// it to its actual derived type.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="name"></param>
        /// <returns></returns>
        public static T ReadSetting<T>(this ISettingsService settingsService, string name) where T : Setting
        {
            Shield.ArgumentNotNull(settingsService, nameof(settingsService)).ThrowOnError();
            Shield.IsNotNullOrEmpty(name, nameof(settingsService)).ThrowOnError();

            Setting actualSetting = settingsService.ReadSetting(name);
            return actualSetting == null
                ? null
                : (T)actualSetting;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
             xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:flowable="http://flowable.org/bpmn"
             targetNamespace="Examples">

    <process id="testProcess">

        <startEvent id="start"/>
        <sequenceFlow id="flow1" sourceRef="start" targetRef="theService"/>

        <serviceTask id="theService" flowable:delegateExpression="${testDelegateBean}"/>
        <sequenceFlow id="flow2" sourceRef="theService" targetRef="userTask"/>

        <userTask id="userTask"/>
        <sequenceFlow id="flow3" sourceRef="userTask" targetRef="end"/>

        <endEvent id="end"/>

    </process>

</definitions>


text:
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>

#include "config.h"
#include "torture.h"

#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

static int setup_echo_srv_tcp_ipv4(void **state)
{
	torture_setup_echo_srv_tcp_ipv4(state);

	return 0;
}

static int teardown(void **state)
{
	torture_teardown_echo_srv(state);

	return 0;
}

static void test_connect_broadcast_ipv4(void **state)
{
	struct torture_address addr = {
		.sa_socklen = sizeof(struct sockaddr_in),
	};
	int rc;
	int s;

	(void) state; /* unused */

	s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
	assert_int_not_equal(s, -1);

	addr.sa.in.sin_family = AF_INET;
	addr.sa.in.sin_port = htons(torture_server_port());
	addr.sa.in.sin_addr.s_addr = INADDR_BROADCAST;

	/* We don't allow connect to broadcast addresses */
	rc = connect(s, &addr.sa.s, addr.sa_socklen);
	assert_int_equal(rc, -1);

	close(s);
}

#ifdef HAVE_IPV6
static void test_connect_downgrade_ipv6(void **state)
{
	struct torture_address addr = {
		.sa_socklen = sizeof(struct sockaddr_in),
	};
	int rc;
	int s;

	(void) state; /* unused */

	s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
	assert_int_not_equal(s, -1);

	addr.sa.in.sin_family = AF_INET;
	addr.sa.in.sin_port = htons(torture_server_port());

	rc = inet_pton(addr.sa.in.sin_family,
		       torture_server_address(AF_INET),
		       &addr.sa.in.sin_addr);
	assert_int_equal(rc, 1);

	/* Connect should downgrade to IPv4 and allow the connect */
	rc = connect(s, &addr.sa.s, addr.sa_socklen);
	assert_int_equal(rc, 0);

	close(s);
}
#endif

int main(void) {
	int rc;

	const struct CMUnitTest tcp_connect_tests[] = {
		cmocka_unit_test(test_connect_broadcast_ipv4),
#ifdef HAVE_IPV6
		cmocka_unit_test(test_connect_downgrade_ipv6),
#endif
	};

	rc = cmocka_run_group_tests(tcp_connect_tests,
				    setup_echo_srv_tcp_ipv4,
				    teardown);

	return rc;
}


text:
const Scaffold = require('scaffold-generator')
const mustache = require('mustache')
const argv = require('yargs')
  .usage('Usage: $0 --name moduleName')
  .version(false)
  .option('name', { describe: 'Unique editor class name', type: 'string' })
  .demandOption(['name'], 'Please specify a name')
  .argv;
let editorName = '';

if (typeof argv.name === 'string') {
    editorName = argv.name;
}

if (!editorName || editorName === '') {
    console.error('Please set editor name with --name');
    process.exit(1);
}

mustache.escape = v => v

new Scaffold({
  data: {
    Name: editorName,
  },
  render: mustache.render
})
.copy('templates/Editor', 'src')
.then(() => {
  console.log(`${editorName} generated. Next steps:
  - Add enum to Theme::ElementType
  - Add handler to MainEditor::loadElements()`);
});


text:
#pragma once
#include <aws/elasticmapreduce/EMR_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/elasticmapreduce/model/KeyValue.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace EMR
{
namespace Model
{

  /**
   *
A job flow step consisting of a JAR file whose main function will be
   * executed. The main function submits a job for Hadoop to execute and waits for
   * the job to finish or fail.

See Also:
   AWS
   * API Reference

   */
  class AWS_EMR_API HadoopJarStepConfig
  {
  public:
    HadoopJarStepConfig();
    HadoopJarStepConfig(Aws::Utils::Json::JsonView jsonValue);
    HadoopJarStepConfig& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline const Aws::Vector<KeyValue>& GetProperties() const{ return m_properties; }

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline bool PropertiesHasBeenSet() const { return m_propertiesHasBeenSet; }

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline void SetProperties(const Aws::Vector<KeyValue>& value) { m_propertiesHasBeenSet = true; m_properties = value; }

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline void SetProperties(Aws::Vector<KeyValue>&& value) { m_propertiesHasBeenSet = true; m_properties = std::move(value); }

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline HadoopJarStepConfig& WithProperties(const Aws::Vector<KeyValue>& value) { SetProperties(value); return *this;}

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline HadoopJarStepConfig& WithProperties(Aws::Vector<KeyValue>&& value) { SetProperties(std::move(value)); return *this;}

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline HadoopJarStepConfig& AddProperties(const KeyValue& value) { m_propertiesHasBeenSet = true; m_properties.push_back(value); return *this; }

    /**
     *
A list of Java properties that are set when the step runs. You can use these
     * properties to pass key value pairs to your main function.

     */
    inline HadoopJarStepConfig& AddProperties(KeyValue&& value) { m_propertiesHasBeenSet = true; m_properties.push_back(std::move(value)); return *this; }

    /**
     *
A path to a JAR file run during the step.

     */
    inline const Aws::String& GetJar() const{ return m_jar; }

    /**
     *
A path to a JAR file run during the step.

     */
    inline bool JarHasBeenSet() const { return m_jarHasBeenSet; }

    /**
     *
A path to a JAR file run during the step.

     */
    inline void SetJar(const Aws::String& value) { m_jarHasBeenSet = true; m_jar = value; }

    /**
     *
A path to a JAR file run during the step.

     */
    inline void SetJar(Aws::String&& value) { m_jarHasBeenSet = true; m_jar = std::move(value); }

    /**
     *
A path to a JAR file run during the step.

     */
    inline void SetJar(const char* value) { m_jarHasBeenSet = true; m_jar.assign(value); }

    /**
     *
A path to a JAR file run during the step.

     */
    inline HadoopJarStepConfig& WithJar(const Aws::String& value) { SetJar(value); return *this;}

    /**
     *
A path to a JAR file run during the step.

     */
    inline HadoopJarStepConfig& WithJar(Aws::String&& value) { SetJar(std::move(value)); return *this;}

    /**
     *
A path to a JAR file run during the step.

     */
    inline HadoopJarStepConfig& WithJar(const char* value) { SetJar(value); return *this;}

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline const Aws::String& GetMainClass() const{ return m_mainClass; }

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline bool MainClassHasBeenSet() const { return m_mainClassHasBeenSet; }

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline void SetMainClass(const Aws::String& value) { m_mainClassHasBeenSet = true; m_mainClass = value; }

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline void SetMainClass(Aws::String&& value) { m_mainClassHasBeenSet = true; m_mainClass = std::move(value); }

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline void SetMainClass(const char* value) { m_mainClassHasBeenSet = true; m_mainClass.assign(value); }

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline HadoopJarStepConfig& WithMainClass(const Aws::String& value) { SetMainClass(value); return *this;}

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline HadoopJarStepConfig& WithMainClass(Aws::String&& value) { SetMainClass(std::move(value)); return *this;}

    /**
     *
The name of the main class in the specified Java file. If not specified, the
     * JAR file should specify a Main-Class in its manifest file.

     */
    inline HadoopJarStepConfig& WithMainClass(const char* value) { SetMainClass(value); return *this;}

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline const Aws::Vector<Aws::String>& GetArgs() const{ return m_args; }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline bool ArgsHasBeenSet() const { return m_argsHasBeenSet; }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline void SetArgs(const Aws::Vector<Aws::String>& value) { m_argsHasBeenSet = true; m_args = value; }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline void SetArgs(Aws::Vector<Aws::String>&& value) { m_argsHasBeenSet = true; m_args = std::move(value); }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline HadoopJarStepConfig& WithArgs(const Aws::Vector<Aws::String>& value) { SetArgs(value); return *this;}

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline HadoopJarStepConfig& WithArgs(Aws::Vector<Aws::String>&& value) { SetArgs(std::move(value)); return *this;}

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline HadoopJarStepConfig& AddArgs(const Aws::String& value) { m_argsHasBeenSet = true; m_args.push_back(value); return *this; }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline HadoopJarStepConfig& AddArgs(Aws::String&& value) { m_argsHasBeenSet = true; m_args.push_back(std::move(value)); return *this; }

    /**
     *
A list of command line arguments passed to the JAR file's main function when
     * executed.

     */
    inline HadoopJarStepConfig& AddArgs(const char* value) { m_argsHasBeenSet = true; m_args.push_back(value); return *this; }

  private:

    Aws::Vector<KeyValue> m_properties;
    bool m_propertiesHasBeenSet;

    Aws::String m_jar;
    bool m_jarHasBeenSet;

    Aws::String m_mainClass;
    bool m_mainClassHasBeenSet;

    Aws::Vector<Aws::String> m_args;
    bool m_argsHasBeenSet;
  };

} // namespace Model
} // namespace EMR
} // namespace Aws


text:
package com.amazonaws.services.mediaconvert.model;

import javax.annotation.Generated;

/**
 * Use this setting only when you specify SCTE-35 markers from ESAM. Choose INSERT to put SCTE-35 markers in this output
 * at the insertion points that you specify in an ESAM XML document. Provide the document in the setting SCC XML
 * (sccXml).
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum MpdScte35Esam {

    INSERT("INSERT"),
    NONE("NONE");

    private String value;

    private MpdScte35Esam(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return MpdScte35Esam corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static MpdScte35Esam fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (MpdScte35Esam enumEntry : MpdScte35Esam.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


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

    <string name="app_name">Android Segmented</string>
    <string name="recomend">推荐</string>
    <string name="dynamic">动态</string>
    <string name="topic">话题</string>

</resources>


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class WinNetBIOSConfigInfo extends NetBIOSConfigInfo {
  public String primaryWINS;
  public String secondaryWINS;

  public String getPrimaryWINS() {
    return this.primaryWINS;
  }

  public String getSecondaryWINS() {
    return this.secondaryWINS;
  }

  public void setPrimaryWINS(String primaryWINS) {
    this.primaryWINS=primaryWINS;
  }

  public void setSecondaryWINS(String secondaryWINS) {
    this.secondaryWINS=secondaryWINS;
  }
}


text:
/// <summary>
/// RegexDrawer v1.0.0
///
/// When declaring a variable:
///   * For IPv4: [Regex(@"^(?:\d{1,3}\.){3}\d{1,3}$", "Invalid IPv4 address!\nExample: '127.0.0.1'")]
///   * For IPv6: [Regex(@"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", "Invalid IPv6 address!\nExample: 'FE80:0000:0000:0000:0202:B3FF:FE1E:8329'")]
///
/// Taken from: http://blogs.unity3d.com/2012/09/07/property-drawers-in-unity-4/
/// </summary>
using UnityEditor;
using UnityEngine;
using System.Text.RegularExpressions;

namespace Unitilities
{

    [CustomPropertyDrawer(typeof(RegexAttribute))]
    public class RegexDrawer : PropertyDrawer
    {
        // These constants describe the height of the help box and the text field.
        const int helpHeight = 40;
        const int textHeight = 16;

        // Provide easy access to the RegexAttribute for reading information from it.
        RegexAttribute regexAttribute { get { return ((RegexAttribute) attribute); } }

        // Here you must define the height of your property drawer. Called by Unity.
        public override float GetPropertyHeight(SerializedProperty prop,
                                                 GUIContent label)
        {
            if (IsValid(prop))
                return base.GetPropertyHeight(prop, label);
            else
                return base.GetPropertyHeight(prop, label) + helpHeight;
        }

        // Here you can define the GUI for your property drawer. Called by Unity.
        public override void OnGUI(Rect position,
                                    SerializedProperty prop,
                                    GUIContent label)
        {
            // Adjust height of the text field
            Rect textFieldPosition = position;
            textFieldPosition.height = textHeight;
            DrawTextField(textFieldPosition, prop, label);

            // Adjust the help box position to appear indented underneath the text field.
            Rect helpPosition = EditorGUI.IndentedRect(position);
            helpPosition.y += textHeight;
            helpPosition.height = helpHeight;
            DrawHelpBox(helpPosition, prop);
        }

        void DrawTextField(Rect position, SerializedProperty prop, GUIContent label)
        {
            // Draw the text field control GUI.
            EditorGUI.BeginChangeCheck();
            string value = EditorGUI.TextField(position, label, prop.stringValue);
            if (EditorGUI.EndChangeCheck())
                prop.stringValue = value;
        }

        void DrawHelpBox(Rect position, SerializedProperty prop)
        {
            // No need for a help box if the pattern is valid.
            if (IsValid(prop))
                return;

            EditorGUI.HelpBox(position, regexAttribute.helpMessage, MessageType.Error);
        }

        // Test if the propertys string value matches the regex pattern.
        bool IsValid(SerializedProperty prop)
        {
            return Regex.IsMatch(prop.stringValue, regexAttribute.pattern);
        }
    }
}


text:
Sample project that demonstrates the use of MotionLayout for a Mail client application.

Includes an example of how to use MotionLayout with the paging library.
## ComposeMail Overview
-----------------------------

### App Demo
https://user-images.githubusercontent.com/61845568/176751838-834cdd38-e942-45b6-84a6-92e9d51adf0f.mp4

### Mail Item - [Composable](https://github.com/androidx/constraintlayout/blob/229131491d82ff88cfe65bcaa0de436e9aeb4650/demoProjects/ComposeMail/app/src/main/java/com/example/composemail/ui/mails/MailItem.kt#L70)
https://user-images.githubusercontent.com/61845568/176752054-d8791336-244e-4037-83f3-1d7204fd7562.mp4

### New Mail Button - [Composable](https://github.com/androidx/constraintlayout/blob/229131491d82ff88cfe65bcaa0de436e9aeb4650/demoProjects/ComposeMail/app/src/main/java/com/example/composemail/ui/newmail/NewMail.kt#L321)
https://user-images.githubusercontent.com/61845568/176752227-b79298ee-b4cb-4b2e-a39a-5baf73cc569a.mp4

## Contributing

If you'd like to get involved and contribute please read [CONTRIBUTING](https://github.com/androidx/constraintlayout/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Authors

- **Oscar Adame** ([oscar-ad](https://github.com/oscar-ad))

See also the list of [contributors](https://github.com/androidx/constraintlayout/graphs/contributors) who participated in this project.

## License

This project is licensed under the Apache 2.0 License - see the [LICENSE](https://github.com/androidx/constraintlayout/blob/main/LICENSE) file for details


text:
/*********************************************************************
 * $Id: sup.cc,v 1.1 2001/08/06 17:01:44 ulucs Exp $
 *
 * Example program to test various RHex behaviors.
 *
 * Created       : Eric Klavins, 01/03/2001
 * Last Modified : Uluc Saranli, 06/27/2001
 *
 ********************************************************************/

// ==========================================================================
// This program uses the Supervisor machine to control various
// behaviors of RHex. The Supervisor module accepts input through the
// remote control and performs calibration, standup, sitdown, walking
// and turning behaviors.
//
// Any key exits the program
// ==========================================================================

#include <stdio.h>
#include "sysutil.hh"
#include "ModuleManager.hh"
#include "StdModules.hh"
#include "StateMachine.hh"
#include "Supervisor.hh"

// If we are running QNX, use VirtualHW, otherwise, use SimSect.
#ifdef _QNX4_
#include "VirtualHW.hh"
VirtualHW hw;
#endif

#ifdef _LINUX_
#include "SimSectHW.hh"
SimSectHW hw;
#endif

class UserModule : public Module {

  public:

    UserModule ( void ) : Module( "userinput", 0, false, false ) { };

    void  init ( void ) {}
    void  uninit ( void ) {}
    void  activate ( void ) {}
    void  deactivate ( void ) {}
    void  update ( void ) {

      int i;

      if ( kbhit() ) {

        // Disable all motor drives
        for ( i = 0 ; i < 6 ; i++)
          hw.driveEnable ( i, false );

        MMPowerOff();
      }

    }
} umod;

int main ( void ) {

  // Read the system specific configuration file
  MMReadConfigFile( "rhex_simsect.rc" );

  // Read the application dependent configuration file
  MMReadConfigFile( "sup.rc" );

  MMChooseHardware ( & hw );

  Supervisor supervisor;

  // Create and add all the standard modules
  RHexAddStdModules();

  // Add the user module and supervisor
  MMAddModule ( &umod, 10, 0, USER_CONTROLLERS );
  MMAddModule ( &supervisor, 1, 0, USER_CONTROLLERS );

  // Activate the supervisor modules
  MMActivateModule ( &supervisor );

  // Activate the user module
  MMActivateModule( &umod );

  // Call the Module manager main loop
  MMMainLoop();

  // This part is never reached as the main loop only exits when the
  // program ends.
  MMShutdown();
  return 0;

}