text:
#ifndef _TEEC_TA_LOAD_H
#define _TEEC_TA_LOAD_H
#include <tee_client_api.h>

#define TA_BINARY_FOUND 0
#define TA_BINARY_NOT_FOUND -1

/**
 * Based on the uuid this function will try to find a TA-binary on the
 * filesystem and return it back to the caller in the parameter ta.
 *
 * @param: destination  The uuid of the TA we are searching for.
 * @param: ta           A pointer which this function will copy
 *                      the TA from the filesystem to if *@ta_size i large
 *                      enough.
 * @param: ta_size      The size of the TA found on file system. It will be 0
 *                      if no TA was not found.
 *
 * @return              0 if TA was found, otherwise -1.
 */
int TEECI_LoadSecureModule(const char *name,
			   const TEEC_UUID *destination, void *ta,
			   size_t *ta_size);
#endif


text:
package com.microsoft.azure.management.batchai.v2018_05_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.batchai.v2018_05_01.implementation.ClusterInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.model.Creatable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.batchai.v2018_05_01.implementation.BatchAIManager;
import java.util.Map;
import org.joda.time.DateTime;
import java.util.List;

/**
 * Type representing Cluster.
 */
public interface Cluster extends HasInner<ClusterInner>, Indexable, Refreshable<Cluster>, Updatable<Cluster.Update>, HasManager<BatchAIManager> {
    /**
     * @return the allocationState value.
     */
    AllocationState allocationState();

    /**
     * @return the allocationStateTransitionTime value.
     */
    DateTime allocationStateTransitionTime();

    /**
     * @return the creationTime value.
     */
    DateTime creationTime();

    /**
     * @return the currentNodeCount value.
     */
    Integer currentNodeCount();

    /**
     * @return the errors value.
     */
    List<BatchAIError> errors();

    /**
     * @return the id value.
     */
    String id();

    /**
     * @return the location value.
     */
    String location();

    /**
     * @return the name value.
     */
    String name();

    /**
     * @return the nodeSetup value.
     */
    NodeSetup nodeSetup();

    /**
     * @return the nodeStateCounts value.
     */
    NodeStateCounts nodeStateCounts();

    /**
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * @return the provisioningStateTransitionTime value.
     */
    DateTime provisioningStateTransitionTime();

    /**
     * @return the scaleSettings value.
     */
    ScaleSettings scaleSettings();

    /**
     * @return the subnet value.
     */
    ResourceId subnet();

    /**
     * @return the tags value.
     */
    Map<String, String> tags();

    /**
     * @return the type value.
     */
    String type();

    /**
     * @return the userAccountSettings value.
     */
    UserAccountSettings userAccountSettings();

    /**
     * @return the virtualMachineConfiguration value.
     */
    VirtualMachineConfiguration virtualMachineConfiguration();

    /**
     * @return the vmPriority value.
     */
    VmPriority vmPriority();

    /**
     * @return the vmSize value.
     */
    String vmSize();

    /**
     * The entirety of the Cluster definition.
     */
    interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithLocation, DefinitionStages.WithUserAccountSettings, DefinitionStages.WithVmSize, DefinitionStages.WithCreate {
    }

    /**
     * Grouping of Cluster definition stages.
     */
    interface DefinitionStages {
        /**
         * The first stage of a Cluster definition.
         */
        interface Blank extends WithWorkspace {
        }

        /**
         * The stage of the cluster definition allowing to specify Workspace.
         */
        interface WithWorkspace {
           /**
            * Specifies resourceGroupName, workspaceName.
            */
            WithLocation withExistingWorkspace(String resourceGroupName, String workspaceName);
        }

        /**
         * The stage of the cluster definition allowing to specify Location.
         */
        interface WithLocation {
           /**
            * Specifies location.
            */
            WithUserAccountSettings withLocation(String location);
        }

        /**
         * The stage of the cluster definition allowing to specify UserAccountSettings.
         */
        interface WithUserAccountSettings {
           /**
            * Specifies userAccountSettings.
            */
            WithVmSize withUserAccountSettings(UserAccountSettings userAccountSettings);
        }

        /**
         * The stage of the cluster definition allowing to specify VmSize.
         */
        interface WithVmSize {
           /**
            * Specifies vmSize.
            */
            WithCreate withVmSize(String vmSize);
        }

        /**
         * The stage of the cluster definition allowing to specify NodeSetup.
         */
        interface WithNodeSetup {
            /**
             * Specifies nodeSetup.
             */
            WithCreate withNodeSetup(NodeSetup nodeSetup);
        }

        /**
         * The stage of the cluster definition allowing to specify ScaleSettings.
         */
        interface WithScaleSettings {
            /**
             * Specifies scaleSettings.
             */
            WithCreate withScaleSettings(ScaleSettings scaleSettings);
        }

        /**
         * The stage of the cluster definition allowing to specify Subnet.
         */
        interface WithSubnet {
            /**
             * Specifies subnet.
             */
            WithCreate withSubnet(ResourceId subnet);
        }

        /**
         * The stage of the cluster definition allowing to specify Tags.
         */
        interface WithTags {
            /**
             * Specifies tags.
             */
            WithCreate withTags(Map<String, String> tags);
        }

        /**
         * The stage of the cluster definition allowing to specify VirtualMachineConfiguration.
         */
        interface WithVirtualMachineConfiguration {
            /**
             * Specifies virtualMachineConfiguration.
             */
            WithCreate withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration);
        }

        /**
         * The stage of the cluster definition allowing to specify VmPriority.
         */
        interface WithVmPriority {
            /**
             * Specifies vmPriority.
             */
            WithCreate withVmPriority(VmPriority vmPriority);
        }

        /**
         * The stage of the definition which contains all the minimum required inputs for
         * the resource to be created (via {@link WithCreate#create()}), but also allows
         * for any other optional settings to be specified.
         */
        interface WithCreate extends Creatable<Cluster>, DefinitionStages.WithNodeSetup, DefinitionStages.WithScaleSettings, DefinitionStages.WithSubnet, DefinitionStages.WithTags, DefinitionStages.WithVirtualMachineConfiguration, DefinitionStages.WithVmPriority {
        }
    }
    /**
     * The template for a Cluster update operation, containing all the settings that can be modified.
     */
    interface Update extends Appliable<Cluster>, UpdateStages.WithScaleSettings, UpdateStages.WithTags {
    }

    /**
     * Grouping of Cluster update stages.
     */
    interface UpdateStages {
        /**
         * The stage of the cluster update allowing to specify ScaleSettings.
         */
        interface WithScaleSettings {
            /**
             * Specifies scaleSettings.
             */
            Update withScaleSettings(ScaleSettings scaleSettings);
        }

        /**
         * The stage of the cluster update allowing to specify Tags.
         */
        interface WithTags {
            /**
             * Specifies tags.
             */
            Update withTags(Map<String, String> tags);
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * HTTP Engine
 */

var http = require('http');
var router = require('./router.js');
var fs = require('fs');
var url = require('url');
var querystring = require('querystring');
var mime = require('mime');

var engine = function(config){
	console.log(config);

	var modules = {};

	function loadModule(module){

		var modulePath = config.root+config.path.controllers+''+module+'.js';
		console.log('Search module '+modulePath);
		if(fs.existsSync(modulePath)){
			try{
				modules[module] = require(modulePath);
				console.log('Loading success!');
				return true;
			} catch(e){
				return false;
			}

		}
		console.log('Module '+module+' not found in '+config.path.controllers);
		return false;

	}

	function resolveStatic(req,resp){
		console.log('Search '+config.root+config.path.statics+req.url.pathname);
		if (fs.existsSync(config.root+config.path.statics+req.url.pathname)){
			console.log('Found static resource at '+req.url.pathname);
			var mimetype = mime.lookup(config.root+config.path.statics+req.url.pathname);
			fs.readFile(config.root+config.path.statics+req.url.pathname,  function(err,data){
				resp.writeHead(200,{
				    "Content-type":mimetype,
				    "Content-length":data.length
				});
				resp.write(data,'binary');
				resp.end();
			});
			return true;
		} else {
			return false;
		}
	}

	function resolveDynamic(req,resp){
		var pathParts = req.url.pathname.split('.');
		if (pathParts.length==1){
			pathParts[1] = 'html';
		}
		var methodPath = pathParts.slice(0,pathParts.length-1).join('.');
		var viewName = pathParts[pathParts.length-1];
		console.log('Parts='+pathParts.slice(0,1));
		console.log('Method path='+methodPath);
		console.log('View='+viewName);

		var path = methodPath.split('/');

		if (path.length>=3){
			var methodName = path[path.length-1];
			var className = path[path.length-2];
			var moduleName = path.slice(0,path.length-2).join('/');

			console.log('Module='+moduleName);
			console.log('Class='+className);
			console.log('Method='+methodName);

			if (typeof(modules[moduleName])==='undefined'){
				if (loadModule(moduleName)){
					module = modules[moduleName];
					console.log(typeof(module[className]));
					if (typeof(module[className])==='function'){
						var ctrlConstructor = module[className];
						var ctrl = new ctrlConstructor();
						console.log(typeof(ctrl));
						if (typeof(ctrl)==='object'&&typeof(ctrl[methodName])==='function'){
							ctrl[methodName].apply(ctrl);
						}
					}
				}
			}
		}
		return false;
	}

	var server = http.createServer(function(req,resp){
		console.log('Resolving request '+req.url);
		req.url = url.parse(req.url,true);

		if (!resolveStatic(req, resp)){
			if (!resolveDynamic(req, resp)){
				resp.statusCode = 404;
				resp.write('Error!');
				resp.end();
			}
		}
	});

	this.start = function(){
		console.log('Starting HTTP server on port '+config.port);
		server.listen(config.port);
	};

};

exports.Engine = engine;


text:
import os, sys
from setuptools import setup
from setuptools.extension import Extension
from glob import glob

with open('README.rst') as readme_file:
    readme = readme_file.read()

with open('HISTORY.rst') as history_file:
    history = history_file.read()

requirements = [
    #'Click>=6.0',
    #'numpy',
    #'matplotlib',
    #'scipy',
    #'pandas',
    #'ipython',
]

test_requirements = [
    # TODO: put package test requirements here
]

setup(
    name='sfg2d',
    version='0.6.0',
    description="Python Toolkit for Analsys of 2d-sfg spectra",
    long_description=readme + '\n\n' + history,
    author="Malte Deiseroth",
    author_email='deiseroth@mpip-mainz.mpgs.de',
    url='https://github.com/deisi/sfg2d',
    packages=[
        'sfg2d',
        'sfg2d.data',
        'sfg2d.data.calib',
        'sfg2d.io',
        'sfg2d.utils',
    ],
    package_dir={'sfg2d':
                 'sfg2d'},
    entry_points={
        'console_scripts': [
            'sfg2d=sfg2d.cli:main'
        ]
    },
    package_data={
        'sfg2d': ['data/calib/params_Ne_670.npy']
    },
    include_package_data=True,
    install_requires=requirements,
    license="MIT license",
    zip_safe=False,
    keywords='sfg2d',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Scientists',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3.5',
    ],
    test_suite='tests',
    tests_require=test_requirements,
)


text:
package mat.client.shared;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;

// TODO: Auto-generated Javadoc
/**
 * The Class PasswordRules.
 */
public class PasswordRules extends Composite {

	/**
	 * Instantiates a new password rules.
	 */
	public PasswordRules() {
		FlowPanel fPanel = new FlowPanel();
		fPanel.getElement().setId("fPanel_FlowPanel");
		Label rules = new Label("Password Rules");
		rules.addStyleName("bold");
		HTML desc = new HTML("Passwords must not consist of a single dictionary word with letters, numbers and symbols.

" +
		                     " Current password cannot be reused.

"+ " A Password needs to be at least one day old before you can change it again.

"+
				            " Passwords must be between 8 and 16 characters and contain at least one of each of  the following:"
							);
		desc.addStyleName("passwordRulesDescription");
		HTML b1 = new HTML(" Upper case character");
		HTML b2 = new HTML(" Lower case character");
		HTML b3 = new HTML(" One of the following special characters %   #   *   +   ,   ;   =   ?   _");
		HTML b4 = new HTML(" Numeric character");

		fPanel.add(rules);
		fPanel.add(desc);
		fPanel.add(b1);
		fPanel.add(b2);
		fPanel.add(b3);
		fPanel.add(b4);
		initWidget(fPanel);
	}
}


text:
Socket::Socket(int sockfd)
  : sockfd_(sockfd)
{
  assert(sockfd_ >= 0);
}

Socket::~Socket()
{
  if (sockfd_ >= 0)
  {
    int ret = ::close(sockfd_);
    assert(ret == 0); (void)ret;
  }
}

void Socket::bindOrDie(const InetAddress& addr)
{
  int ret = ::bind(sockfd_, addr.get_sockaddr(), addr.length());
  if (ret)
  {
    perror("Socket::bindOrDie");
    abort();
  }
}

void Socket::listenOrDie()
{
  int ret = ::listen(sockfd_, SOMAXCONN);
  if (ret)
  {
    perror("Socket::listen");
    abort();
  }
}

int Socket::connect(const InetAddress& addr)
{
  return ::connect(sockfd_, addr.get_sockaddr(), addr.length());
}

void Socket::shutdownWrite()
{
  if (::shutdown(sockfd_, SHUT_WR) < 0)
  {
    perror("Socket::shutdownWrite");
  }
}

void Socket::setReuseAddr(bool on)
{
  int optval = on ? 1 : 0;
  if (::setsockopt(sockfd_, SOL_SOCKET, SO_REUSEADDR,
                   &optval, sizeof optval) < 0)
  {
    perror("Socket::setReuseAddr");
  }
}

void Socket::setTcpNoDelay(bool on)
{
  int optval = on ? 1 : 0;
  if (::setsockopt(sockfd_, IPPROTO_TCP, TCP_NODELAY,
               &optval, static_cast<socklen_t>(sizeof optval)) < 0)
  {
    perror("Socket::setTcpNoDelay");
  }
}

InetAddress Socket::getLocalAddr() const
{
  struct sockaddr_storage localaddr;
  socklen_t addrlen = sizeof localaddr;
  struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(&localaddr);
  if (::getsockname(sockfd_, addr, &addrlen) < 0)
  {
    perror("Socket::getLocalAddr");
  }
  return InetAddress(*addr);
}

InetAddress Socket::getPeerAddr() const
{
  struct sockaddr_storage peeraddr;
  socklen_t addrlen = sizeof peeraddr;
  struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(&peeraddr);
  if (::getpeername(sockfd_, addr, &addrlen) < 0)
  {
    perror("Socket::getPeerAddr");
  }
  return InetAddress(*addr);
}

int Socket::recv(void* buf, int len)
{
#ifdef TEMP_FAILURE_RETRY
  return TEMP_FAILURE_RETRY(::recv(sockfd_, buf, len, 0));
#else
  return ::recv(sockfd_, buf, len, 0);
#endif
}

int Socket::send(const void* buf, int len)
{
#ifdef TEMP_FAILURE_RETRY
  return TEMP_FAILURE_RETRY(::send(sockfd_, buf, len, 0));
#else
  return ::send(sockfd_, buf, len, 0);
#endif
}

Socket Socket::createTCP(sa_family_t family)
{
  int sockfd = ::socket(family, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
  assert(sockfd >= 0);
  return Socket(sockfd);
}

Socket Socket::createUDP(sa_family_t family)
{
  int sockfd = ::socket(family, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP);
  assert(sockfd >= 0);
  return Socket(sockfd);
}


text:
package org.tuckey.web.filters.urlrewrite.utils;

import junit.framework.TestCase;
import org.tuckey.web.filters.urlrewrite.substitution.ChainedSubstitutionFilters;
import org.tuckey.web.filters.urlrewrite.substitution.SubstitutionContext;
import org.tuckey.web.filters.urlrewrite.substitution.SubstitutionFilterChain;

/**
 * @author Paul Tuckey
 * @version $Revision: 36 $ $Date: 2006-09-19 18:32:39 +1200 (Tue, 19 Sep 2006) $
 */
public class StringMatchingMatcherTest extends TestCase {

    public static String replaceAll(StringMatchingMatcher matcher, String from, String replacement) {
        SubstitutionContext substitutionContext = new SubstitutionContext(null, matcher, null, replacement);
        SubstitutionFilterChain substitutionFilter = ChainedSubstitutionFilters.getDefaultSubstitutionChain(true, false, false, false);
        return substitutionFilter.substitute(from, substitutionContext);
    }

    public void testPatterns() throws StringMatchingPatternSyntaxException {
        RegexPattern pat1 = new RegexPattern("a(a)", false);
        StringMatchingMatcher mat1 = pat1.matcher("aaf");
        assertEquals("$1f", replaceAll(mat1, "aaf", "\\$1"));

        RegexPattern pat2 = new RegexPattern("aa", false);
        StringMatchingMatcher mat2 = pat2.matcher("aaf");
        assertEquals("$1f", replaceAll(mat2, "aaf", "\\$1"));

        WildcardPattern pat3 = new WildcardPattern("/*/*/*/");
        StringMatchingMatcher mat3 = pat3.matcher("/aa/bb/cc/");
        assertTrue(mat3.find());
        assertEquals(3, mat3.groupCount());
        assertEquals("aabbcc$3$2", replaceAll(mat3, "/aa/bb/cc/", "$1$2$3\\$3\\$2"));

        // try again with no matches
        WildcardPattern pat4 = new WildcardPattern("aa");
        StringMatchingMatcher mat4 = pat4.matcher("aaf");
        assertEquals("aaf", replaceAll(mat4, "aaf", "a\\$1b"));

        WildcardPattern pat5 = new WildcardPattern("/**");
        StringMatchingMatcher mat5 = pat5.matcher("/aa/bb/cc/?aa&bb#cc");
        assertTrue(mat5.find());
        assertEquals(1, mat5.groupCount());
        assertEquals("aa/bb/cc/?aa&bb#cc$3$2", replaceAll(mat5, "/aa/bb/cc/?aa&bb#cc", "$1$2$3\\$3\\$2"));

        WildcardPattern pat6 = new WildcardPattern("/aa/**");
        StringMatchingMatcher mat6 = pat6.matcher("/aa/bb/cc/?aa&bb#cc");
        assertTrue(mat6.find());
        assertEquals(1, mat6.groupCount());
        assertEquals("bb/cc/?aa&bb#cc$3$2", replaceAll(mat6, "/aa/bb/cc/?aa&bb#cc", "$1$2$3\\$3\\$2"));

        WildcardPattern pat7 = new WildcardPattern("/ee/**");
        StringMatchingMatcher mat7 = pat7.matcher("/aa/bb/cc/?aa&bb#cc");
        assertFalse(mat7.find());

    }

    /**
     * this was throwing an exception... it shouldn't.
     */
    public void testStrangeProblem1() throws StringMatchingPatternSyntaxException {
        RegexPattern pat = new RegexPattern("^(/.*)$", false);
        StringMatchingMatcher mat = pat.matcher("/tester/one-level-sub/two-leel-sub/");
        mat.find();
        mat.groupCount();
        mat.groupCount();
        mat.groupCount();
        mat.group(1);

    }

}


text:
const assert = require('assert');
const async = require('async');
const schedule = require('node-schedule');

const QueueProcessor = require('../../../extensions/replication' +
                               '/queueProcessor/QueueProcessor');
const TimeMachine = require('../utils/timeMachine');
const ZKStateHelper = require('../utils/pauseResumeUtils/zkStateHelper');
const MockAPI = require('../utils/pauseResumeUtils/mockAPI');

// Configs
const config = require('../../config.json');
const {
    zookeeperNamespace,
    zkStatePath,
    zkReplayStatePath,
} = require('../../../extensions/replication/constants');
const redisConfig = {
    host: config.redis.host,
    port: config.redis.port,
};
const zkConfig = config.zookeeper;
const kafkaConfig = config.kafka;
const repConfig = config.extensions.replication;
const sourceConfig = {
    auth: { type: 'skip' },
};
const destConfig = {
    auth: { type: 'skip', vault: 'skip' },
    bootstrapList: repConfig.destination.bootstrapList,
};
const mConfig = config.metrics;

// Constants
const ZK_TEST_CRR_STATE_PATH = `${zookeeperNamespace}${zkStatePath}`;
const ZK_TEST_CRR_REPLAY_TOPIC = 'backbeat-func-replay-topic';
const ZK_TEST_CRR_REPLAY_STATE_PATH = `${zookeeperNamespace}${zkReplayStatePath}/${ZK_TEST_CRR_REPLAY_TOPIC}`;

// Future Date to be used in tests
const futureDate = new Date();
futureDate.setHours(futureDate.getHours() + 5);

function isConsumerActive(consumer) {
    return consumer.getServiceStatus();
}

describe('CRR Pause/Resume status updates', function d() {
    this.timeout(10000);
    let zkHelper;
    let mockAPI;
    const firstSite = destConfig.bootstrapList[0].site;
    const secondSite = destConfig.bootstrapList[1].site;
    let qpSite1;
    let qpSite2;
    let consumer1;
    let consumer2;

    let replayConsumer1;
    let replayConsumer2;
    let replayProcessor1;
    let replayProcessor2;
    let zkReplayHelper;

    before(done => {
        mockAPI = new MockAPI(repConfig);
        zkHelper = new ZKStateHelper(config.zookeeper, ZK_TEST_CRR_STATE_PATH,
            firstSite, secondSite, futureDate);
        zkHelper.init(err => {
            if (err) {
                return done(err);
            }
            const zkClient = zkHelper.getClient();

            // qpSite1 (first site) is not paused
            qpSite1 = new QueueProcessor(
                'backbeat-func-test-dummy-topic', zkConfig, zkClient,
                kafkaConfig, sourceConfig, destConfig, repConfig,
                redisConfig, mConfig, {}, {}, firstSite);
            qpSite1.start();

            // qpSite2 (second site) is paused and has a scheduled resume
            qpSite2 = new QueueProcessor(
                'backbeat-func-test-dummy-topic', zkConfig, zkClient,
               kafkaConfig, sourceConfig, destConfig, repConfig,
               redisConfig, mConfig, {}, {}, secondSite);
            qpSite2.start({ paused: true });
            qpSite2.scheduleResume(futureDate);

            // wait for clients/jobs to set
            return async.whilst(() => (
                !consumer1 && !consumer2 && !qpSite2.scheduledResume
            ), cb => setTimeout(() => {
                consumer1 = qpSite1._consumer;
                consumer2 = qpSite2._consumer;
                return cb();
            }, 1000), done);
        });
    });

    before(done => {
        zkReplayHelper = new ZKStateHelper(config.zookeeper, ZK_TEST_CRR_REPLAY_STATE_PATH,
            firstSite, secondSite, futureDate);
        zkReplayHelper.init(err => {
            if (err) {
                return done(err);
            }
            const zkClient = zkReplayHelper.getClient();
            const replayConfig = { ...repConfig };
            replayConfig.replayTopics = [
                { topicName: ZK_TEST_CRR_REPLAY_TOPIC, retries: 5 }
            ];
            // replay processor
            replayProcessor1 = new QueueProcessor(
                ZK_TEST_CRR_REPLAY_TOPIC, zkConfig, zkClient,
                kafkaConfig, sourceConfig, destConfig, replayConfig,
                redisConfig, mConfig, {}, {}, firstSite);
            replayProcessor1.start();

            // replay processor 2 (second site) is paused
            replayProcessor2 = new QueueProcessor(
                ZK_TEST_CRR_REPLAY_TOPIC, zkConfig, zkClient,
                kafkaConfig, sourceConfig, destConfig, replayConfig,
                redisConfig, mConfig, {}, {}, secondSite);
            replayProcessor2.start({ paused: true });
            replayProcessor2.scheduleResume(futureDate);

            // wait for clients/jobs to set
            return async.whilst(() => (
                !replayConsumer1 && !replayConsumer2 && !replayProcessor2.scheduledResume
            ), cb => setTimeout(() => {
                replayConsumer1 = replayProcessor1._consumer;
                replayConsumer2 = replayProcessor2._consumer;
                return cb();
            }, 1000), done);
        });
    });

    afterEach(done => {
        consumer1.resume();
        consumer2.pause();
        async.whilst(() => qpSite1.scheduledResume !== null ||
            !qpSite2.scheduledResume,
        cb => setTimeout(() => {
            qpSite1._deleteScheduledResumeService();
            qpSite2.scheduleResume(futureDate);
            cb();
        }, 1000), err => {
            assert.ifError(err);
            zkHelper.reset(done);
        });
    });

    afterEach(done => {
        replayConsumer1.resume();
        replayConsumer2.pause();
        async.whilst(() => replayProcessor1.scheduledResume !== null ||
            !replayProcessor2.scheduledResume,
        cb => setTimeout(() => {
            replayProcessor1._deleteScheduledResumeService();
            replayProcessor2.scheduleResume(futureDate);
            cb();
        }, 1000), err => {
            assert.ifError(err);
            zkReplayHelper.reset(done);
        });
    });

    after(() => {
        zkHelper.close();
        zkReplayHelper.close();
    });

    it('should pause an active location', done => {
        let zkPauseState;
        // send fake api request
        mockAPI.pauseService(firstSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(firstSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                return cb();
            });
        }, 1000), () => isConsumerActive(consumer1),
        err => {
            assert.ifError(err);
            // is zookeeper state shown as paused?
            assert.strictEqual(zkPauseState, true);
            // is the consumer currently subscribed to any topics?
            assert.strictEqual(isConsumerActive(consumer1), false);
            return done();
        });
    });

    it('should use a different path for replay processor', done => {
        assert.notStrictEqual(replayProcessor1._getZkSiteNode(), qpSite1._getZkSiteNode());
        return done();
    });

    it('should pause replay processor as well', done => {
        let zkPauseState;
        // send fake api request
        mockAPI.pauseService(firstSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkReplayHelper.get(firstSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                return cb();
            });
        }, 1000), () => isConsumerActive(replayConsumer1),
        err => {
            assert.ifError(err);
            // is zookeeper state shown as paused?
            assert.strictEqual(zkPauseState, true);
            // is the consumer currently subscribed to any topics?
            assert.strictEqual(isConsumerActive(replayConsumer1), false);
            return done();
        });
    });

    it('should not change state if pausing an already paused location',
    done => {
        let zkPauseState;
        let zkScheduleState;
        // double-check initial state
        assert.strictEqual(isConsumerActive(consumer2), false);
        // send fake api request
        mockAPI.pauseService(secondSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                zkScheduleState = data.scheduledResume;
                return cb();
            });
        }, 1000), () => isConsumerActive(consumer2),
        err => {
            assert.ifError(err);
            assert.strictEqual(zkPauseState, true);
            assert.strictEqual(isConsumerActive(consumer2), false);
            assert.strictEqual(new Date(zkScheduleState).toString(),
                futureDate.toString());
            return done();
        });
    });

    it('should resume a paused location', done => {
        let zkPauseState;
        // send fake api request
        mockAPI.resumeService(secondSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                return cb();
            });
        }, 1000), () => !isConsumerActive(consumer2),
        err => {
            assert.ifError(err);
            assert.strictEqual(zkPauseState, false);
            assert.strictEqual(isConsumerActive(consumer2), true);
            return done();
        });
    });

    it('should resume replay processor as well', done => {
        let zkPauseState;
        // send fake api request
        mockAPI.resumeService(secondSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkReplayHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                return cb();
            });
        }, 1000), () => !isConsumerActive(replayConsumer2),
        err => {
            assert.ifError(err);
            assert.strictEqual(zkPauseState, false);
            assert.strictEqual(isConsumerActive(replayConsumer2), true);
            return done();
        });
    });

    it('should not change state if resuming an already active location',
    done => {
        let zkPauseState;
        // double-check initial state
        assert.strictEqual(isConsumerActive(consumer1), true);
        // send fake api request
        mockAPI.resumeService(firstSite);
        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(firstSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                return cb();
            });
        }, 1000), () => isConsumerActive(consumer1) !== true,
        err => {
            assert.ifError(err);
            assert.strictEqual(zkPauseState, false);
            assert.strictEqual(isConsumerActive(consumer1), true);
            return done();
        });
    });

    it('should cancel a scheduled resume for a given location', done => {
        let zkScheduleState;
        // send fake api request
        mockAPI.deleteScheduledResumeService(secondSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkScheduleState = data.scheduledResume;
                return cb();
            });
        }, 1000), () => zkScheduleState !== null,
        err => {
            assert.ifError(err);
            assert.strictEqual(zkScheduleState, null);
            return done();
        });
    });

    it('should schedule a resume', done => {
        let zkPauseState;
        let zkScheduleState;
        // since re-using firstSite, pause it first for this test
        const pauseState = JSON.stringify({ paused: true });
        zkHelper.set(firstSite, pauseState, err => {
            assert.ifError(err);
            consumer1.pause();
            // send fake api request
            mockAPI.resumeService(firstSite, futureDate);

            return async.doWhilst(cb => setTimeout(() => {
                zkHelper.get(firstSite, (err, data) => {
                    if (err) {
                        return cb(err);
                    }
                    zkPauseState = data.paused;
                    zkScheduleState = data.scheduledResume;
                    return cb();
                });
            }, 1000), () => {
                if (zkScheduleState) {
                    const zkStateDate = new Date(zkScheduleState);
                    return zkStateDate.getTime() !== futureDate.getTime();
                }
                return true;
            }, err => {
                assert.ifError(err);
                assert.strictEqual(zkPauseState, true);
                assert.strictEqual(new Date(zkScheduleState).toString(),
                    futureDate.toString());
                done();
            });
        });
    });

    [
        // new schedule time is less than current scheduled time
        {
            testCase: 'less than',
            timeChange: -1,
        },
        // new schedule time is greater than current scheduled time
        {
            testCase: 'greater than',
            timeChange: 1,
        },
    ].forEach(item => {
        it('should overwrite an existing scheduled resume on new valid ' +
        `request where new time is ${item.testCase} current scheduled time`,
        done => {
            let zkScheduleState;
            const newScheduledDate = new Date(futureDate);
            newScheduledDate.setHours(newScheduledDate.getHours() +
                item.timeChange);
            // send fake api request
            mockAPI.resumeService(secondSite, newScheduledDate);

            return async.doWhilst(cb => setTimeout(() => {
                zkHelper.get(secondSite, (err, data) => {
                    if (err) {
                        return cb(err);
                    }
                    zkScheduleState = data.scheduledResume;
                    return cb();
                });
            }, 1000), () => {
                if (zkScheduleState) {
                    const zkStateDate = new Date(zkScheduleState);
                    return zkStateDate.getTime() !== newScheduledDate.getTime();
                }
                return true;
            }, err => {
                assert.ifError(err);
                assert.strictEqual(new Date(zkScheduleState).toString(),
                    newScheduledDate.toString());
                done();
            });
        });
    });

    it('should cancel a scheduled resume when the location is manually ' +
    'resumed', done => {
        let zkScheduleState;
        let zkPauseState;
        // send fake api request
        mockAPI.resumeService(secondSite);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                zkScheduleState = data.scheduledResume;
                return cb();
            });
        }, 1000), () => isConsumerActive(consumer2) !== true,
        err => {
            assert.ifError(err);
            assert.strictEqual(zkPauseState, false);
            assert.strictEqual(zkScheduleState, null);
            done();
        });
    });

    it('should not schedule a resume when the location is already active',
    done => {
        // send fake api request
        mockAPI.resumeService(firstSite, futureDate);

        setTimeout(() => {
            zkHelper.get(firstSite, (err, data) => {
                assert.ifError(err);

                assert.strictEqual(data.scheduledResume, null);
                assert.strictEqual(data.paused, false);
                assert.strictEqual(isConsumerActive(consumer1), true);
                done();
            });
        }, 1000);
    });

    it('should resume a location when a scheduled resume triggers',
    done => {
        let zkPauseState;
        let zkScheduleState;
        // move time forward to trigger scheduled resume
        const timeMachine = new TimeMachine();
        timeMachine.install();
        // hack - for some reason, the scheduled job in QueueProcessor does not
        // trigger unless I schedule a job here.
        schedule.scheduleJob(new Date(), () => {});
        timeMachine.moveTimeForward(6);

        return async.doWhilst(cb => setTimeout(() => {
            zkHelper.get(secondSite, (err, data) => {
                if (err) {
                    return cb(err);
                }
                zkPauseState = data.paused;
                zkScheduleState = data.scheduledResume;
                return cb();
            });
        }, 1000), () => isConsumerActive(consumer2) !== true,
        err => {
            timeMachine.uninstall();
            assert.ifError(err);
            assert.strictEqual(zkPauseState, false);
            assert.strictEqual(isConsumerActive(consumer2), true);
            assert.strictEqual(zkScheduleState, null);
            done();
        });
    });
});


text:
import os
import sys
import argparse
import datetime
import time
import sqlite3
import logging
import csv
import struct

import NotionalSQLite

version = '0.6.2'
build = '20131207'

headerfields = (("Signature","sig"),
                ("Page Size","pagesize"),
                ("Read Format","readver"),
                ("Write Format","writever"),
                ("Max Reserved Bytes","maxpayload"),
                ("Min Reserved Bytes","minpayload"),
                ("Leaf Reserved Bytes","leafpayload"),
                ("File Change Count","changecount"),
                ("In-header DB Size","dbsize"),
                ("Free Page List starting page","freepagelist"),
                ("Total Free Pages","totalfreepage"),
                ("Schema Cookie","schemacookie"),
                ("Schema Format number","schemanum"),
                ("Suggested cache size","defpagecache"),
                ("Largest Root Page Number","bigroottree"),
                ("Text Encoding","textencode"),
                ("User Version","userver"),
                ("Vacuum Settings","incvac"),
                ("Expansion block","expansion"),
                ("Valid-For Version","validfor"),
                ("Last SQLite Version","sqlver"))

def main():
    startTime = datetime.datetime.now()
    startTimeStr = str(startTime)[:19].replace(":","-").replace(" ","_")

    outfile, infile, pagemap, debug, active, content, unalloc = validateArgs()
    setupLogging(outfile)

    print "\n[CONFIGURATION]"
    logging.info(" Target Database: " + os.path.abspath(infile))
    logging.info(" Report File: " + os.path.abspath(outfile))

    print "\n <SETTING UP REPORT FILE(S)...>"
    outcsv = csv.writer(open(outfile+".csv","wb"))
    if active:
        outactivecsv = csv.writer(open(outfile+"_active.csv","wb"))
    if unalloc:
        outunalloctsv = csv.writer(open(outfile+"_unalloc.csv","wb"), delimiter='\t',quotechar='"')

    print "\n[DATABASE HEADER]"
    header = NotionalSQLite.NotionalSQLite(infile,debug)
    if header.statuscode == 1:
        logging.error("ERROR: Could not create NotionalSQL object - check that the target database is closed and unlocked.")
        logging.error("ERROR: Cannot continue - exiting.")
        sys.exit(1)
    if header.checkSignature():
        logging.info(" Signature check: Valid")
    else:
        logging.info(" Signature check: Invalid")
        logging.error("ERROR: Database is corrupt or encrypted - Signature: %s" % header.headerdict["sig"])
        logging.error("ERROR: Cannot continue - exiting.")
        sys.exit(1)

    transheaderdict = header.translateHeader()

    outcsv.writerow(["{HEADER}"])
    outcsv.writerow(["Field Name","Raw Value","Translated Value"])
    for value in headerfields:
        print " %s: %s" % (value[0],transheaderdict[value[1]])
        outcsv.writerow((value[0],header.headerdict[value[1]],transheaderdict[value[1]]))

    pagetypedict = header.getPageTypeDict(header.headerdict['pagesize'])

    if pagemap: # if 'm' switch is used.
        mapPages(header, outcsv)
    if content: # if 'c' switch is used.
        contentanalysis(infile, outcsv)
    if active: # if 'a' switch is used.
        dumpActiveRows(header,outactivecsv,pagetypedict)
    if unalloc: # if 'u' switch is used.
        dumpUnallocated(header,outunalloctsv,pagetypedict)

    print ""
    logging.info("[REPORTING COMPLETED]")
    print ""
    logging.info("SQLiteZer took " + str(datetime.datetime.now()-startTime) + " to run.")

def getRowCount(tablename,dbcurs):
    """
    Return the number of rows in the table.
    """
    try:
        sqlquery = "SELECT count(*) FROM %s" % (tablename)
        dbcurs.execute(sqlquery)
    except sqlite3.OperationalError as e:
        logging.error('ERROR: The SQLite3 module encountered an error querying the table "%s" - check that you replaced the sqlite3.dll with the latest Amalgamation DLL from http://www.sqlite.org/download.html\nError: %s' % (tablename,e))
        return 'ERROR'
    rowcount = dbcurs.fetchall()
    return rowcount[0][0]

def getElements(dbcurs):
    """
    Return a Dict of all elements in DB.
    """
    try:
        dbcurs.execute("SELECT * FROM sqlite_master")
        elementresults = dbcurs.fetchall()
    except sqlite3.OperationalError as e:
        logging.error('ERROR: The SQLite3 module encountered an error querying the master table - check that the database is not locked or in-use. The application cannot continue.\nError: %s' % e)
        sys.exit(1)

    elementdict = dict({"tables":list(),"indexes":list(),"triggers":list(),"views":list()})
    elementcount = 0
    tablenamelen = 0
    triggernamelen = 0
    indexnamelen = 0
    indextblnamelen = 0
    viewnamelen = 0
    viewtblnamelen = 0

    for element in elementresults:
        if element[0] == "table":
            elementdict["tables"].append([element[1],element[2],element[3], element[4]])
            if (len(element[1]) > tablenamelen):
                tablenamelen = len(element[1])
            elementcount += 1
        elif element[0] == "index":
            elementdict["indexes"].append([element[1],element[2],element[3], element[4]])
            if (len(element[1]) > indexnamelen):
                indexnamelen = len(element[1])
            if (len(element[2]) > indextblnamelen):
                indextblnamelen = len(element[2])
            elementcount += 1
        elif element[0] == "trigger":
            elementdict["triggers"].append([element[1],element[2],element[3], element[4]])
            if (len(element[1]) > triggernamelen):
                triggernamelen = len(element[1])
            elementcount += 1
        elif element[0] == "view":
            elementdict["views"].append([element[1],element[2],element[3], element[4]])
            if (len(element[1]) > viewnamelen):
                viewnamelen = len(element[1])
            if (len(element[2]) > viewtblnamelen):
                viewtblnamelen = len(element[2])
            elementcount += 1

    elementdict["maxtablenamelen"] = tablenamelen
    elementdict["maxindexnamelen"] = indexnamelen
    elementdict["maxindextblnamelen"] = indextblnamelen
    elementdict["maxtriggernamelen"] = triggernamelen
    elementdict["maxviewnamelen"] = viewnamelen
    elementdict["macviewtblnamelen"] = viewtblnamelen

    return elementcount, elementdict

def contentanalysis(infile,outcsv):
    """
    Triggered if the 'c' switch is supplied.
    Enumerates the tables, indexes, triggers, etc... and enumerates the rows in each.
    """
    print "\n[CONTENT ANALYSIS]"
    print "\n <CONNECTING TO DB...>"
    try:
        dbconn = sqlite3.connect(infile)
        dbcurs = dbconn.cursor()
    except:
        logging.error("Could not connect to SQLite DB - Exiting...")
        sys.exit(1)

    print " <GENERATING TABLE CONTENT REPORT>\n"
    elementCount, elementDict = getElements(dbcurs)

    logging.info("Total elements identified in database: %s" % str(elementCount))
    logging.info(" - # of Tables: %s" % str(len(elementDict["tables"])))
    logging.info(" - # of Indexes: %s" % str(len(elementDict["indexes"])))
    logging.info(" - # of Triggers: %s" % str(len(elementDict["triggers"])))
    logging.info(" - # of Views: %s" % str(len(elementDict["views"])))

    if (elementCount > 0):
        rowdata = list()
    # TABLES - Collect, Print, and Export.
        if len(elementDict["tables"]) > 0:
            for tablename in elementDict["tables"]:
                rowcount = getRowCount(tablename[0],dbcurs)
                rowdata.append([rowcount,0])

            row_format = "{:^4} {:<%s} {:<12}" % str(elementDict["maxtablenamelen"] + 1)
            column_header = ['#','Table Name', 'Row Count']
            column_divider = ['-','----------','---------']

            print "\n{TABLES}\n"
            print row_format.format(*column_header)
            print row_format.format(*column_divider)
            outcsv.writerow(["{TABLES}"])
            outcsv.writerow(["#","Table Name","Row Count","Rootpage","SQL Statement"])

            for table, row in zip(elementDict["tables"], rowdata):
                print row_format.format(elementDict["tables"].index(table)+1, table[0], *row)
                outcsv.writerow([elementDict["tables"].index(table)+1, table[0],row[0],table[2],table[3].replace(os.linesep,"")])

    # INDEXES - Collect, Print, and Export.
        if len(elementDict["indexes"]) > 0:
            row_format = "{:^4} {:<%s} {:<%s}" % (str(elementDict["maxindexnamelen"] + 5), str(elementDict["maxindextblnamelen"] + 1))
            column_header = ['#','Index Name', 'Associated Table']
            column_divider = ['-','----------','----------------']

            print "\n{INDEXES}\n"
            print row_format.format(*column_header)
            print row_format.format(*column_divider)
            outcsv.writerow(["{INDEXES}"])
            outcsv.writerow(["#","Index Name","Associated Table Name","Rootpage","SQL Statement"])

            for index in elementDict["indexes"]:
                if index[3] is None:
                    index[3] = "<EMPTY>"
                print row_format.format(elementDict["indexes"].index(index)+1, index[0], index[1])
                outcsv.writerow([elementDict["indexes"].index(index)+1,index[0],index[1],index[2],index[3].replace(os.linesep,"")])

    # TRIGGERS - Collect, Print, and Export.
        if len(elementDict["triggers"]) > 0:
            row_format = "{:^4} {:<15} {:<%s}" % (str(elementDict["maxtriggernamelen"] + 5))
            column_header = ['#','Triggering Type', 'Associated Table']
            column_divider = ['-','---------------','----------------']

            print "\n{TRIGGERS}\n"
            print row_format.format(*column_header)
            print row_format.format(*column_divider)
            outcsv.writerow(["{TRIGGERS}"])
            outcsv.writerow(["#","Triggering Type","Associated Table Name","Rootpage","SQL Statement"])

            for trigger in elementDict["triggers"]:
                print row_format.format(elementDict["triggers"].index(trigger)+1, trigger[0], trigger[1])
                outcsv.writerow([elementDict["triggers"].index(trigger)+1,trigger[0],trigger[1],trigger[2],trigger[3].replace(os.linesep,"")])

    # VIEWS - Collect, Print, and Export.
        if len(elementDict["views"]) > 0:
            for viewname in elementDict["views"]:
                rowcount = getRowCount(viewname[0],dbcurs)
                rowdata.append([rowcount,0])

            row_format = "{:^4} {:<%s} {:<12}" % str(elementDict["maxviewnamelen"] + 1)
            column_header = ['#','View Name', 'Row Count']
            column_divider = ['-','----------','---------']

            print "\n{VIEWS}\n"
            print row_format.format(*column_header)
            print row_format.format(*column_divider)
            outcsv.writerow(["{VIEWS}"])
            outcsv.writerow(["#","View Name","Row Count","Rootpage","SQL Statement"])

            for view, row in zip(elementDict["views"], rowdata):
                print row_format.format(elementDict["views"].index(view)+1, view[0], *row)
                outcsv.writerow([elementDict["views"].index(view)+1, view[0],row[0],view[2],view[3].replace(os.linesep,"")])
    else:
        logging.info("WARNING: Database does not contain any elements.")

def dumpActiveRows(header,outactivecsv,pagetypedict):
    """
    Triggered if the 'a' switch is supplied.
    Export all active row content into CSV format. Useful for grep, manual review, etc...
    The first value of each line is the Page Offset.
    """
    i=0
    print "\n[DUMP ACTIVE CONTENT]"
    print " <PARSING LEAF TABLE PAGES FOR ACTIVE CELL CONTENT>\n"
    for page in pagetypedict['leaftable']:
        for row in header.getActiveRowContent(page,header.headerdict['pagesize']):
            row.insert(0,page)
            outactivecsv.writerow(row)
            i+=1
            if((i%5000)==0):
                print "  %s cells exported..." % str(i)
    logging.info("Active cell export complete; %s cells exported." % str(i))

def dumpUnallocated(header,outunalloctsv,pagetypedict):
    """
    Triggered if the 'u' switch is supplied.
    Export all unallocated data to a tab-delimited file.
    """
    i=0
    print "\n[DUMP UNALLOCATED CONTENT]"
    outunalloctsv.writerow(["Offset","Unallocated Type","Block Length","Printable Data"])
    print " <PARSING LEAF TABLE PAGES FOR UNALLOCATED CONTENT>\n"
    for page in pagetypedict['leaftable']:
        unalloclist = header.getUnallocContent(page,header.headerdict['pagesize'])
        for row in unalloclist:
            outunalloctsv.writerow(row)
            i+=1
            if((i%5000)==0):
                print "  %s unallocated blocks exported..." % str(i)
    logging.info("Unallocated block export complete; %s blocks exported." % str(i))

def mapPages(header, outcsv):
    """
    Triggered if the 'm' switch is supplied.
    Generate a visual map of the database's page type distribution.
    """
    print "\n[PAGE MAP]\n"
    pagemap = header.mapPages(header.headerdict['pagesize'])
    mapheaderfields = (("Page Map"),
                       ("Interior Index Pages (i)"),
                       ("Interior Table Pages (t)"),
                       ("Leaf Index Pages (I)"),
                       ("Leaf Table Pages (T)"),
                       ("Header Pages (H)"),
                       ("Overflow Pages (O)"),
                       ("Total Identified Pages"))

    outcsv.writerow(["{PAGE MAP}"])
    outcsv.writerow(["Page Statistics","Value"])

    i = pagecount = 0
    for value in mapheaderfields:
        if (i == 0):
            j=0
            rowlabel = "{:>%s}" % len(str(len(pagemap[0]))+"  ")
            print rowlabel.format("  ") + "0       8      16      24      31"
            print rowlabel.format("  ") + "|.......|.......|.......|......."
            while True:
                print rowlabel.format(str(j) + ": ") + pagemap[0][j:j+32]
                j+=32
                if (j>len(pagemap[0])):
                    print ""
                    break
        else:
            print " %s: %s" % (value,pagemap[i])
        outcsv.writerow((value,pagemap[i]))
        i+=1

def setupLogging(outfile):
    """
    Configure basic logging and populate the log with bibliographic info.
    """
    logfile = outfile + ".log"
    logging.basicConfig(filename=os.path.join(logfile),level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s', datefmt='%H:%M:%S')
    console = logging.StreamHandler()
    console.setLevel(logging.INFO)
    console.setFormatter(logging.Formatter('%(message)s'))
    logging.getLogger('').addHandler(console)
    logging.info("""\n   _____ ____    __    _ __    _____
  / ___// __ \  / /   (_) /___/__  / Notional Labs 2013
  \__ \/ / / / / /   / / __/ _ \/ / / _ \/ ___/
 ___/ / /_/ / / /___/ / /_/  __/ /_/  __/ /
/____/\___\_\/_____/_/\__/\___/____|___/_/
Forensic SQLite Database Analyser and Reporting Tool         """)
    print "-------------------------------------------------------"
    logging.info(" Version ["+version+"] Build ["+build+"] Author [James E. Hung]")
    print "-------------------------------------------------------"
    return

def validateArgs():
    """
    Validate input arguments.
    """
    parser = argparse.ArgumentParser(description="Notional-Labs.com: SQLiteZer")
    parser.add_argument('-i','--input', help='Target SQLite database file.', required=True)
    parser.add_argument('-o','--output', help='Output job name (exclude file extension).', required=True)
    parser.add_argument('-a','--active', help='OPTIONAL: Dump all raw active records into a CSV.', action='store_true')
    parser.add_argument('-c','--content', help='OPTIONAL: Generate content report.', action='store_true')
    parser.add_argument('-m','--pagemap', help='OPTIONAL: Print a visual map of the physical page distribution', action='store_true')
    parser.add_argument('-u','--unalloc', help='OPTIONAL: Dump all unallocated areas of each page into a CSV.', action='store_true')
    parser.add_argument('-x','--debug', help='OPTIONAL: Developers Only - Enable debug mode.', action='store_true')

    args = vars(parser.parse_args())

    try:
        with open(args['input']): pass
    except IOError:
        print "Target SQLite DB file does not exist or cannot be opened. Exiting..."
        sys.exit(1)

    return args['output'],args['input'],args['pagemap'],args['debug'],args['active'],args['content'],args['unalloc']

if __name__ == '__main__':
    main()


text:
//==============================================================================
// Editor list item
//==============================================================================

#include "editorlistitem.h"

//==============================================================================

namespace OpenCOR {
namespace EditorList {

//==============================================================================

EditorListItem::EditorListItem(const Type &pType, const int &pLine,
                               const int &pColumn, const QString &pMessage) :
    QStandardItem(),
    mType(pType),
    mLine(pLine),
    mColumn(pColumn),
    mMessage(pMessage)
{
    // Customise ourselves

    static const QIcon ErrorIcon       = QIcon(":/oxygen/emblems/emblem-important.png");
    static const QIcon WarningIcon     = QIcon(":/oxygen/status/task-attention.png");
    static const QIcon HintIcon        = QIcon(":/oxygen/actions/help-hint.png");
    static const QIcon InformationIcon = QIcon(":/oxygen/status/dialog-information.png");

    if ((pLine == -1) && (pColumn == -1))
        setText(QString("%1").arg(pMessage));
    else if (pColumn == -1)
        setText(QString("[%1] %2").arg(pLine).arg(pMessage));
    else
        setText(QString("[%1:%2] %3").arg(pLine).arg(pColumn).arg(pMessage));

    setToolTip(text());

    switch (pType) {
    case Error:
        setIcon(ErrorIcon);

        break;
    case Warning:
        setIcon(WarningIcon);

        break;
    case Hint:
        setIcon(HintIcon);

        break;
    case Information:
        setIcon(InformationIcon);

        break;
    }

}

//==============================================================================

int EditorListItem::type() const
{
    // Return the item's type

    return mType;
}

//==============================================================================

int EditorListItem::line() const
{
    // Return the item's line

    return mLine;
}

//==============================================================================

int EditorListItem::column() const
{
    // Return the item's column

    return mColumn;
}

//==============================================================================

QString EditorListItem::message() const
{
    // Return the item's message

    return mMessage;
}

//==============================================================================

}   // namespace EditorList
}   // namespace OpenCOR

//==============================================================================
// End of file
//==============================================================================


text:
using BenchmarkDotNet.Attributes;

using Science.Cryptography.Ciphers.Specialized;

[MemoryDiagnoser]
public class XorBenchmarks
{
	public XorBenchmarks()
	{

	}

	private static readonly byte[] Input32 = new byte[32];
	private static readonly byte[] Input48 = new byte[48];
	private static readonly byte[] Input72 = new byte[72];
	private static readonly byte[] Input96 = new byte[96];

	private static readonly byte[] Key7 = new byte[7];
	private static readonly byte[] Key32 = new byte[32];
	private static readonly byte[] Key41 = new byte[41];

	private static readonly byte[] Output96 = new byte[96];

	[Benchmark]
	public void SlowXor_I32_K32()
	{
		BinaryXor.SlowXor(Input32, Output96, Key32);
	}

	[Benchmark]
	public void Avx2Xor_I32_K32()
	{
		BinaryXor.Avx2Xor256(Input32, Output96, Key32);
	}

	[Benchmark]
	public void Avx2Xor_I72_K7()
	{
		BinaryXor.Avx2Xor256(Input72, Output96, Key7);
	}

	[Benchmark]
	public void Avx2Xor_I96_K41()
	{
		BinaryXor.Avx2Xor256(Input96, Output96, Key41);
	}

	[Benchmark]
	public void Avx2Xor_I96_K32()
	{
		BinaryXor.Avx2Xor256(Input96, Output96, Key32);
	}
}


text:
from django.contrib import admin
from .models import Category, GroupCategory, Product, ProductImage, Finishing, Accessories, Quota, Segment, Page, PageClass

@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title', 'slug', 'header',)

    model = Category

@admin.register(GroupCategory)
class GroupCategoryAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title',)

    model = GroupCategory

@admin.register(Finishing)
class FinishingAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title',)

    model = Finishing

@admin.register(Accessories)
class FinishingAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title',)

    model = Accessories

@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title',)

    model = Product

@admin.register(ProductImage)
class ProductImageAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'picture',)

    model = ProductImage

@admin.register(Quota)
class QuotaAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'timestamp',)

    model = Quota

@admin.register(Segment)
class SegmentAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title',)

    model = Segment

@admin.register(Page)
class HomePageAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'title', 'pageclass')

    model = Page

@admin.register(PageClass)
class HomePageAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'name',)

    model = PageClass


text:
A regular TileLayer with grayscale makeover.

## Usage

Just use `L.tileLayer.grayscale(url, options)` instead of `L.tileLayer(url, options)`.

I recommend using `fadeAnimation: false` option when creating the map object. Otherwise you
will see a lot of flickering.

## Example

http://zverik.github.com/leaflet-grayscale/

## License

This plugin was written by Ilya Zverev and published under WTFPL license.


text:
<?xml version="1.0" encoding="UTF-8"?>
<context xmlns="http://piwi.googlecode.com/xsd/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://piwi.googlecode.com/xsd/context ../xsd/context.xsd">

    <bean id="configurationManager" class="ConfigurationManager" scope="request">
        <property name="configFilePath" value="test/unit/lib/piwi/authentication/data/config.xml" />
    </bean>
</context>


text:
require 'spec_helper'

describe Id::Model do

  it 'is used by including the module' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    expect(c.cats).to eq 3
  end

  it 'can have fields set on it after creation - creating a new instance' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    expect(c.cats).to eq 3
    d = c.set(cats: 4)
    expect(c.cats).to eq 3
    expect(d.cats).to eq 4
  end

  it 'can have fields removed from it after creation - creating a new instance' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    expect(c.cats).to eq 3
    d = c.unset(:cats)
    expect(c.cats).to eq 3
    expect { d.cats }.to raise_error Id::MissingAttributeError
  end

  it 'is equal to models with the same data' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    d = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    expect(c).to eq d
  end

  it 'is not equal to models with different data' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    d = Class.new { include Id::Model ; field :cats }.new(cats: 4)
    expect(c).not_to eq d
  end

  it 'can be used as keys in a hash' do
    c = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    d = Class.new { include Id::Model ; field :cats }.new(cats: 3)
    e = Class.new { include Id::Model ; field :cats }.new(cats: 4)
    hash = { c => 10, e => 12 }
    expect(hash[d]).to eq 10
    expect(hash[e]).to eq 12
  end
end


text:
package org.apache.axis2.transport.http;

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.commons.httpclient.methods.RequestEntity;

import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLStreamException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class RESTRequestEntity implements RequestEntity {
    private byte[] bytes;
    private String charSetEnc;
    private boolean chunked;
    private OMElement element;
    private MessageContext msgCtxt;
    private String soapActionString;
    private OMOutputFormat format;

    public RESTRequestEntity(OMElement element, boolean chunked,
                             MessageContext msgCtxt,
                             String charSetEncoding,
                             String soapActionString,
                             OMOutputFormat format) {
        this.element = element;
        this.chunked = chunked;
        this.msgCtxt = msgCtxt;
        this.charSetEnc = charSetEncoding;
        this.soapActionString = soapActionString;
        this.format = format;
    }

    private void handleOMOutput(OutputStream out, boolean doingMTOM)
            throws XMLStreamException {
        format.setDoOptimize(doingMTOM);
        element.serializeAndConsume(out, format);
    }

    public byte[] writeBytes() throws AxisFault {
        try {
            ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
            if (!format.isOptimized()) {
                OMOutputFormat format2 = new OMOutputFormat();
                format2.setCharSetEncoding(charSetEnc);
                element.serializeAndConsume(bytesOut, format2);
                return bytesOut.toByteArray();
            } else {
                format.setCharSetEncoding(charSetEnc);
                format.setDoOptimize(true);
                element.serializeAndConsume(bytesOut, format);
                return bytesOut.toByteArray();
            }
        } catch (XMLStreamException e) {
            throw AxisFault.makeFault(e);
        } catch (FactoryConfigurationError e) {
            throw AxisFault.makeFault(e);
        }
    }

    public void writeRequest(OutputStream out) throws IOException {
        try {
            if (chunked) {
                this.handleOMOutput(out, format.isDoingSWA());
            } else {
                if (bytes == null) {
                    bytes = writeBytes();
                }
                out.write(bytes);
            }
            out.flush();
        } catch (XMLStreamException e) {
            throw AxisFault.makeFault(e);
        } catch (FactoryConfigurationError e) {
            throw AxisFault.makeFault(e);
        } catch (IOException e) {
            throw AxisFault.makeFault(e);
        }
    }

    public long getContentLength() {
        try {
            if (chunked) {
                return -1;
            } else {
                if (bytes == null) {
                    bytes = writeBytes();
                }
                return bytes.length;
            }
        } catch (AxisFault e) {
            return -1;
        }
    }

    public String getContentType() {
        String encoding = format.getCharSetEncoding();
        String contentType = format.getContentType();
        if (encoding != null) {
            contentType += "; charset=" + encoding;
        }

        // action header is not mandated in SOAP 1.2. So putting it, if available
        if (!msgCtxt.isSOAP11() && (soapActionString != null)
                && !"".equals(soapActionString.trim()) && !"\"\"".equals(soapActionString.trim())) {
            contentType = contentType + ";action=\"" + soapActionString + "\";";
        }
        return contentType;
    }

    public boolean isRepeatable() {
        return true;
    }
}


text:
<?php
// src/OC/PlatformBundle/Controller/AdvertController.php

namespace OC\PlatformBundle\Controller;

use OC\PlatformBundle\Bigbrother\BigbrotherEvents;
use OC\PlatformBundle\Bigbrother\MessagePostEvent;
use OC\PlatformBundle\Entity\Advert;
use OC\PlatformBundle\Form\AdvertEditType;
use OC\PlatformBundle\Form\AdvertType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\Security\Core\User\User;

class AdvertController extends Controller
{
  public function indexAction($page)
  {
    // On ne sait pas combien de pages il y a
    // Mais on sait qu'une page doit être supérieure ou égale à 1
    if ($page < 1) {
      // On déclenche une exception NotFoundHttpException, cela va afficher
      // une page d'erreur 404 (qu'on pourra personnaliser plus tard d'ailleurs)
      throw new NotFoundHttpException('Page "'.$page.'" inexistante.');
    }

    $listAdverts = array(
      array(
        'title'   => 'Recherche développpeur Symfony2',
        'id'      => 1,
        'author'  => 'Alexandre',
        'content' => 'Nous recherchons un développeur Symfony2 débutant sur Lyon. Blabla…',
        'date'    => new \Datetime()),
      array(
        'title'   => 'Mission de webmaster',
        'id'      => 2,
        'author'  => 'Hugo',
        'content' => 'Nous recherchons un webmaster capable de maintenir notre site internet. Blabla…',
        'date'    => new \Datetime()),
      array(
        'title'   => 'Offre de stage webdesigner',
        'id'      => 3,
        'author'  => 'Mathieu',
        'content' => 'Nous proposons un poste pour webdesigner. Blabla…',
        'date'    => new \Datetime())
    );

    // Mais pour l'instant, on ne fait qu'appeler le template
    return $this->render('OCPlatformBundle:Advert:index.html.twig', array(
      'listAdverts' => $listAdverts
    ));
  }

  public function viewAction(Advert $advert)
  {
    $em = $this->getDoctrine()->getManager();

    // On récupère la liste des candidatures de cette annonce
    $listApplications = $em
      ->getRepository('OCPlatformBundle:Application')
      ->findBy(array('advert' => $advert))
    ;

    // Puis la liste des AdvertSkill
    $listAdvertSkills = $em
      ->getRepository('OCPlatformBundle:AdvertSkill')
      ->findBy(array('advert' => $advert))
    ;

    return $this->render('OCPlatformBundle:Advert:view.html.twig', array(
      'advert'           => $advert,
      'listApplications' => $listApplications,
      'listAdvertSkills' => $listAdvertSkills
    ));
  }

  public function viewSlugAction(Advert $advert)
  {
    return $this->viewAction($advert);
  }

  /**
   * @Security("has_role('ROLE_USER')")
   */
  public function addAction(Request $request)
  {
    $advert = new Advert();
    $form = $this->createForm(new AdvertType(), $advert);

    if ($form->handleRequest($request)->isValid()) {
      $user = new User('username', 'password'); // Bien sûr il faudrait plutôt implémenter $advert->getUser() !

      // On crée l'évènement avec ses 2 arguments
      $event = new MessagePostEvent($advert->getContent(), $user);

      // On déclenche l'évènement
      $this
        ->get('event_dispatcher')
        ->dispatch(BigbrotherEvents::onMessagePost, $event)
      ;

      // On récupère ce qui a été modifié par le ou les listeners, ici le message
      $advert->setContenu($event->getMessage());

      $em = $this->getDoctrine()->getManager();
      $em->persist($advert);
      $em->flush();

      $request->getSession()->getFlashBag()->add('notice', 'Annonce bien enregistrée.');

      return $this->redirect($this->generateUrl('oc_platform_view', array('id' => $advert->getId())));
    }

    // À ce stade :
    // - Soit la requête est de type GET, donc le visiteur vient d'arriver sur la page et veut voir le formulaire
    // - Soit la requête est de type POST, mais le formulaire n'est pas valide, donc on l'affiche de nouveau
    return $this->render('OCPlatformBundle:Advert:add.html.twig', array(
      'form' => $form->createView(),
    ));
  }

  public function editAction($id, Request $request)
  {
    $em = $this->getDoctrine()->getManager();

    // On récupère l'annonce $id
    $advert = $em->getRepository('OCPlatformBundle:Advert')->find($id);

    if (null === $advert) {
      throw new NotFoundHttpException("L'annonce d'id ".$id." n'existe pas.");
    }

    $form = $this->createForm(new AdvertEditType(), $advert);

    if ($form->handleRequest($request)->isValid()) {
      // Inutile de persister ici, Doctrine connait déjà notre annonce
      $em->flush();

      $request->getSession()->getFlashBag()->add('notice', 'Annonce bien modifiée.');

      return $this->redirect($this->generateUrl('oc_platform_view', array('id' => $advert->getId())));
    }

    return $this->render('OCPlatformBundle:Advert:edit.html.twig', array(
      'form'   => $form->createView(),
      'advert' => $advert // Je passe également l'annonce à la vue si jamais elle veut l'afficher
    ));
  }

  public function deleteAction($id, Request $request)
  {
    $em = $this->getDoctrine()->getManager();

    // On récupère l'annonce $id
    $advert = $em->getRepository('OCPlatformBundle:Advert')->find($id);

    if (null === $advert) {
      throw new NotFoundHttpException("L'annonce d'id ".$id." n'existe pas.");
    }

    // On crée un formulaire vide, qui ne contiendra que le champ CSRF
    // Cela permet de protéger la suppression d'annonce contre cette faille
    $form = $this->createFormBuilder()->getForm();

    if ($form->handleRequest($request)->isValid()) {
      $em->remove($advert);
      $em->flush();

      $request->getSession()->getFlashBag()->add('info', "L'annonce a bien été supprimée.");

      return $this->redirect($this->generateUrl('oc_platform_home'));
    }

    // Si la requête est en GET, on affiche une page de confirmation avant de supprimer
    return $this->render('OCPlatformBundle:Advert:delete.html.twig', array(
      'advert' => $advert,
      'form'   => $form->createView()
    ));
  }

  public function menuAction()
  {
    // On fixe en dur une liste ici, bien entendu par la suite
    // on la récupérera depuis la BDD !
    $listAdverts = array(
      array('id' => 2, 'title' => 'Recherche développeur Symfony2'),
      array('id' => 5, 'title' => 'Mission de webmaster'),
      array('id' => 9, 'title' => 'Offre de stage webdesigner')
    );

    return $this->render('OCPlatformBundle:Advert:menu.html.twig', array(
      // Tout l'intérêt est ici : le contrôleur passe les variables nécessaires au template !
      'listAdverts' => $listAdverts
    ));
  }

  public function translationAction($name)
  {
    return $this->render('OCPlatformBundle:Advert:translation.html.twig', array(
      'name' => $name
    ));
  }

  /**
   * @ParamConverter("json")
   */
  public function paramConverterAction($json)
  {
    return new Response(print_r($json, true));
  }
}


text:
//
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2010 Alessandro Tasora
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file at the top level of the distribution
// and at http://projectchrono.org/license-chrono.txt.
//

///////////////////////////////////////////////////
//
//   ChThreads.cpp
//
//	 CHRONO
//   ------
//   Multibody dinamics engine
//
//   Math functions for:
//
//	 - COORDINATES
//
// ------------------------------------------------
//             www.deltaknowledge.com
// ------------------------------------------------
///////////////////////////////////////////////////

#include "parallel/ChThreads.h"

namespace chrono {

/*
ChThreads::~ChThreads()
{

}
*/

}  // end namespace


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Object2689449295.h"

// System.Text.RegularExpressions.Capture[]
struct CaptureU5BU5D_t3470489975;

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Text.RegularExpressions.CaptureCollection
struct  CaptureCollection_t1671345504  : public Il2CppObject
{
public:
	// System.Text.RegularExpressions.Capture[] System.Text.RegularExpressions.CaptureCollection::list
	CaptureU5BU5D_t3470489975* ___list_0;

public:
	inline static int32_t get_offset_of_list_0() { return static_cast<int32_t>(offsetof(CaptureCollection_t1671345504, ___list_0)); }
	inline CaptureU5BU5D_t3470489975* get_list_0() const { return ___list_0; }
	inline CaptureU5BU5D_t3470489975** get_address_of_list_0() { return &___list_0; }
	inline void set_list_0(CaptureU5BU5D_t3470489975* value)
	{
		___list_0 = value;
		Il2CppCodeGenWriteBarrier(&___list_0, value);
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
CC            = gcc
CXX           = g++
DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS      = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.
LINK          = g++
LFLAGS        = -m64 -Wl,-O1
LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread
AR            = ar cqs
RANLIB        =
QMAKE         = /usr/lib/x86_64-linux-gnu/qt4/bin/qmake
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = $(COPY)
COPY_DIR      = $(COPY) -r
STRIP         = strip
INSTALL_FILE  = install -m 644 -p
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE      = rm -f
SYMLINK       = ln -f -s
DEL_DIR       = rmdir
MOVE          = mv -f
CHK_DIR_EXISTS= test -d
MKDIR         = mkdir -p

####### Output directory

OBJECTS_DIR   = ./

####### Files

SOURCES       = loadWindow.cpp \
		main.cpp \
		portfolio.cpp \
		portfolioManager.cpp \
		property.cpp \
		tenant.cpp moc_loadWindow.cpp \
		moc_portfolioManager.cpp
OBJECTS       = loadWindow.o \
		main.o \
		portfolio.o \
		portfolioManager.o \
		property.o \
		tenant.o \
		moc_loadWindow.o \
		moc_portfolioManager.o
DIST          = /usr/share/qt4/mkspecs/common/unix.conf \
		/usr/share/qt4/mkspecs/common/linux.conf \
		/usr/share/qt4/mkspecs/common/gcc-base.conf \
		/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
		/usr/share/qt4/mkspecs/common/g++-base.conf \
		/usr/share/qt4/mkspecs/common/g++-unix.conf \
		/usr/share/qt4/mkspecs/qconfig.pri \
		/usr/share/qt4/mkspecs/modules/qt_phonon.pri \
		/usr/share/qt4/mkspecs/features/qt_functions.prf \
		/usr/share/qt4/mkspecs/features/qt_config.prf \
		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
		/usr/share/qt4/mkspecs/features/default_pre.prf \
		/usr/share/qt4/mkspecs/features/release.prf \
		/usr/share/qt4/mkspecs/features/default_post.prf \
		/usr/share/qt4/mkspecs/features/shared.prf \
		/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
		/usr/share/qt4/mkspecs/features/warn_on.prf \
		/usr/share/qt4/mkspecs/features/qt.prf \
		/usr/share/qt4/mkspecs/features/unix/thread.prf \
		/usr/share/qt4/mkspecs/features/moc.prf \
		/usr/share/qt4/mkspecs/features/resources.prf \
		/usr/share/qt4/mkspecs/features/uic.prf \
		/usr/share/qt4/mkspecs/features/yacc.prf \
		/usr/share/qt4/mkspecs/features/lex.prf \
		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
		long.pro
QMAKE_TARGET  = long
DESTDIR       =
TARGET        = long

first: all
####### Implicit rules

.SUFFIXES: .o .c .cpp .cc .cxx .C

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(OBJECTS)
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: long.pro  /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
		/usr/share/qt4/mkspecs/common/linux.conf \
		/usr/share/qt4/mkspecs/common/gcc-base.conf \
		/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
		/usr/share/qt4/mkspecs/common/g++-base.conf \
		/usr/share/qt4/mkspecs/common/g++-unix.conf \
		/usr/share/qt4/mkspecs/qconfig.pri \
		/usr/share/qt4/mkspecs/modules/qt_phonon.pri \
		/usr/share/qt4/mkspecs/features/qt_functions.prf \
		/usr/share/qt4/mkspecs/features/qt_config.prf \
		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
		/usr/share/qt4/mkspecs/features/default_pre.prf \
		/usr/share/qt4/mkspecs/features/release.prf \
		/usr/share/qt4/mkspecs/features/default_post.prf \
		/usr/share/qt4/mkspecs/features/shared.prf \
		/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
		/usr/share/qt4/mkspecs/features/warn_on.prf \
		/usr/share/qt4/mkspecs/features/qt.prf \
		/usr/share/qt4/mkspecs/features/unix/thread.prf \
		/usr/share/qt4/mkspecs/features/moc.prf \
		/usr/share/qt4/mkspecs/features/resources.prf \
		/usr/share/qt4/mkspecs/features/uic.prf \
		/usr/share/qt4/mkspecs/features/yacc.prf \
		/usr/share/qt4/mkspecs/features/lex.prf \
		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
		/usr/lib/x86_64-linux-gnu/libQtGui.prl \
		/usr/lib/x86_64-linux-gnu/libQtCore.prl
	$(QMAKE) -o Makefile long.pro
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/common/gcc-base.conf:
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
/usr/share/qt4/mkspecs/common/g++-base.conf:
/usr/share/qt4/mkspecs/common/g++-unix.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/modules/qt_phonon.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/usr/share/qt4/mkspecs/features/default_pre.prf:
/usr/share/qt4/mkspecs/features/release.prf:
/usr/share/qt4/mkspecs/features/default_post.prf:
/usr/share/qt4/mkspecs/features/shared.prf:
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
/usr/share/qt4/mkspecs/features/warn_on.prf:
/usr/share/qt4/mkspecs/features/qt.prf:
/usr/share/qt4/mkspecs/features/unix/thread.prf:
/usr/share/qt4/mkspecs/features/moc.prf:
/usr/share/qt4/mkspecs/features/resources.prf:
/usr/share/qt4/mkspecs/features/uic.prf:
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/x86_64-linux-gnu/libQtGui.prl:
/usr/lib/x86_64-linux-gnu/libQtCore.prl:
qmake:  FORCE
	@$(QMAKE) -o Makefile long.pro

dist:
	@$(CHK_DIR_EXISTS) .tmp/long1.0.0 || $(MKDIR) .tmp/long1.0.0
	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/long1.0.0/ && $(COPY_FILE) --parents loadWindow.h multiProperty.h portfolio.h portfolioManager.h property.h tenant.h .tmp/long1.0.0/ && $(COPY_FILE) --parents loadWindow.cpp main.cpp portfolio.cpp portfolioManager.cpp property.cpp tenant.cpp .tmp/long1.0.0/ && (cd `dirname .tmp/long1.0.0` && $(TAR) long1.0.0.tar long1.0.0 && $(COMPRESS) long1.0.0.tar) && $(MOVE) `dirname .tmp/long1.0.0`/long1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/long1.0.0

clean:compiler_clean
	-$(DEL_FILE) $(OBJECTS)
	-$(DEL_FILE) *~ core *.core

####### Sub-libraries

distclean: clean
	-$(DEL_FILE) $(TARGET)
	-$(DEL_FILE) Makefile

check: first

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all: moc_loadWindow.cpp moc_portfolioManager.cpp
compiler_moc_header_clean:
	-$(DEL_FILE) moc_loadWindow.cpp moc_portfolioManager.cpp
moc_loadWindow.cpp: portfolioManager.h \
		portfolio.h \
		tenant.h \
		property.h \
		loadWindow.h
	/usr/lib/x86_64-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) loadWindow.h -o moc_loadWindow.cpp

moc_portfolioManager.cpp: portfolio.h \
		tenant.h \
		property.h \
		portfolioManager.h
	/usr/lib/x86_64-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) portfolioManager.h -o moc_portfolioManager.cpp

compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
	-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean

####### Compile

loadWindow.o: loadWindow.cpp loadWindow.h \
		portfolioManager.h \
		portfolio.h \
		tenant.h \
		property.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o loadWindow.o loadWindow.cpp

main.o: main.cpp loadWindow.h \
		portfolioManager.h \
		portfolio.h \
		tenant.h \
		property.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp

portfolio.o: portfolio.cpp portfolio.h \
		tenant.h \
		property.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o portfolio.o portfolio.cpp

portfolioManager.o: portfolioManager.cpp portfolioManager.h \
		portfolio.h \
		tenant.h \
		property.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o portfolioManager.o portfolioManager.cpp

property.o: property.cpp property.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o property.o property.cpp

tenant.o: tenant.cpp tenant.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tenant.o tenant.cpp

moc_loadWindow.o: moc_loadWindow.cpp
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loadWindow.o moc_loadWindow.cpp

moc_portfolioManager.o: moc_portfolioManager.cpp
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_portfolioManager.o moc_portfolioManager.cpp

####### Install

install:   FORCE

uninstall:   FORCE

FORCE:


text:
<?php
namespace consik\yii2websocket\events;

class WSClientErrorEvent extends WSClientEvent
{
    /**
     * @var \Exception $exception
     */
    public $exception;
}


text:
import * as ts from 'typescript';

import {getIdentifierText, Rewriter} from './rewriter';
import {toArray} from './util';

/**
 * Extracts the namespace part of a goog: import, or returns null if the given
 * import is not a goog: import.
 */
export function extractGoogNamespaceImport(tsImport: string): string|null {
  if (tsImport.match(/^goog:/)) return tsImport.substring('goog:'.length);
  return null;
}

/**
 * ES5Processor postprocesses TypeScript compilation output JS, to rewrite commonjs require()s into
 * goog.require(). Contrary to its name it handles converting the modules in both ES5 and ES6
 * outputs.
 */
class ES5Processor extends Rewriter {
  /**
   * namespaceImports collects the variables for imported goog.modules.
   * If the original TS input is:
   *   import foo from 'goog:bar';
   * then TS produces:
   *   var foo = require('goog:bar');
   * and this class rewrites it to:
   *   var foo = require('goog.bar');
   * After this step, namespaceImports['foo'] is true.
   * (This is used to rewrite 'foo.default' into just 'foo'.)
   */
  namespaceImports = new Set<string>();

  /**
   * moduleVariables maps from module names to the variables they're assigned to.
   * Continuing the above example, moduleVariables['goog.bar'] = 'foo'.
   */
  moduleVariables = new Map<string, string>();

  /** strippedStrict is true once we've stripped a "use strict"; from the input. */
  strippedStrict: boolean = false;

  /** unusedIndex is used to generate fresh symbols for unnamed imports. */
  unusedIndex: number = 0;

  constructor(
      file: ts.SourceFile, private pathToModuleName: (context: string, fileName: string) => string,
      private prelude: string) {
    super(file);
  }

  process(moduleId: string, isES5: boolean): {output: string, referencedModules: string[]} {
    // TODO(evanm): only emit the goog.module *after* the first comment,
    // so that @suppress statements work.
    const moduleName = this.pathToModuleName('', this.file.fileName);
    // NB: No linebreak after module call so sourcemaps are not offset.
    this.emit(`goog.module('${moduleName}');`);
    if (this.prelude) this.emit(this.prelude);
    // Allow code to use `module.id` to discover its module URL, e.g. to resolve
    // a template URL against.
    // Uses 'var', as this code is inserted in ES6 and ES5 modes.
    // The following pattern ensures closure doesn't throw an error in advanced
    // optimizations mode.
    if (isES5) {
      this.emit(`var module = module || {id: '${moduleId}'};`);
    } else {
      // The `exports = {}` serves as a default export to disable Closure Compiler's error checking
      // for mutable exports. That's OK because TS compiler makes sure that consuming code always
      // accesses exports through the module object, so mutable exports work.
      // It is only inserted in ES6 because we strip `.default` accesses in ES5 mode, which breaks
      // when assigning an `exports = {}` object and then later accessing it.
      this.emit(` exports = {}; var module = {id: '${moduleId}'};`);
    }

    let pos = 0;
    for (let stmt of this.file.statements) {
      this.writeRange(pos, stmt.getFullStart());
      this.visitTopLevel(stmt);
      pos = stmt.getEnd();
    }
    this.writeRange(pos, this.file.getEnd());

    let referencedModules = toArray(this.moduleVariables.keys());
    // Note: don't sort referencedModules, as the keys are in the same order
    // they occur in the source file.
    let {output} = this.getOutput();
    return {output, referencedModules};
  }

  /**
   * visitTopLevel processes a top-level ts.Node and emits its contents.
   *
   * It's separate from the normal Rewriter recursive traversal
   * because some top-level statements are handled specially.
   */
  visitTopLevel(node: ts.Node) {
    switch (node.kind) {
      case ts.SyntaxKind.ExpressionStatement:
        // Check for "use strict" and skip it if necessary.
        if (!this.strippedStrict && this.isUseStrict(node)) {
          this.writeRange(node.getFullStart(), node.getStart());
          this.strippedStrict = true;
          return;
        }
        // Check for:
        // - "require('foo');" (a require for its side effects)
        // - "__export(require(...));" (an "export * from ...")
        if (this.emitRewrittenRequires(node)) {
          return;
        }
        // Otherwise fall through to default processing.
        break;
      case ts.SyntaxKind.VariableStatement:
        // Check for a "var x = require('foo');".
        if (this.emitRewrittenRequires(node)) return;
        break;
      default:
        break;
    }
    this.visit(node);
  }

  /** isUseStrict returns true if node is a "use strict"; statement. */
  isUseStrict(node: ts.Node): boolean {
    if (node.kind !== ts.SyntaxKind.ExpressionStatement) return false;
    let exprStmt = node as ts.ExpressionStatement;
    let expr = exprStmt.expression;
    if (expr.kind !== ts.SyntaxKind.StringLiteral) return false;
    let literal = expr as ts.StringLiteral;
    return literal.text === 'use strict';
  }

  /**
   * emitRewrittenRequires rewrites require()s into goog.require() equivalents.
   *
   * @return True if the node was rewritten, false if needs ordinary processing.
   */
  emitRewrittenRequires(node: ts.Node): boolean {
    // We're looking for requires, of one of the forms:
    // - "var importName = require(...);".
    // - "require(...);".
    if (node.kind === ts.SyntaxKind.VariableStatement) {
      // It's possibly of the form "var x = require(...);".
      let varStmt = node as ts.VariableStatement;

      // Verify it's a single decl (and not "var x = ..., y = ...;").
      if (varStmt.declarationList.declarations.length !== 1) return false;
      let decl = varStmt.declarationList.declarations[0];

      // Grab the variable name (avoiding things like destructuring binds).
      if (decl.name.kind !== ts.SyntaxKind.Identifier) return false;
      let varName = getIdentifierText(decl.name as ts.Identifier);
      if (!decl.initializer || decl.initializer.kind !== ts.SyntaxKind.CallExpression) return false;
      let call = decl.initializer as ts.CallExpression;
      let require = this.isRequire(call);
      if (!require) return false;
      this.writeRange(node.getFullStart(), node.getStart());
      this.emitGoogRequire(varName, require);
      return true;
    } else if (node.kind === ts.SyntaxKind.ExpressionStatement) {
      // It's possibly of the form:
      // - require(...);
      // - __export(require(...));
      // Both are CallExpressions.
      let exprStmt = node as ts.ExpressionStatement;
      let expr = exprStmt.expression;
      if (expr.kind !== ts.SyntaxKind.CallExpression) return false;
      let call = expr as ts.CallExpression;

      let require = this.isRequire(call);
      let isExport = false;
      if (!require) {
        // If it's an __export(require(...)), we emit:
        //   var x = require(...);
        //   __export(x);
        // This extra variable is necessary in case there's a later import of the
        // same module name.
        require = this.isExportRequire(call);
        isExport = require != null;
      }
      if (!require) return false;

      this.writeRange(node.getFullStart(), node.getStart());
      let varName = this.emitGoogRequire(null, require);

      if (isExport) {
        this.emit(`__export(${varName});`);
      }
      return true;
    } else {
      // It's some other type of statement.
      return false;
    }
  }

  /**
   * Emits a goog.require() statement for a given variable name and TypeScript import.
   *
   * E.g. from:
   *   var varName = require('tsImport');
   * produces:
   *   var varName = goog.require('goog.module.name');
   *
   * If the input varName is null, generates a new variable name if necessary.
   *
   * @return The variable name for the imported module, reusing a previous import if one
   *    is available.
   */
  emitGoogRequire(varName: string|null, tsImport: string): string {
    let modName: string;
    let isNamespaceImport = false;
    const nsImport = extractGoogNamespaceImport(tsImport);
    if (nsImport !== null) {
      // This is a namespace import, of the form "goog:foo.bar".
      // Fix it to just "foo.bar".
      modName = nsImport;
      isNamespaceImport = true;
    } else {
      modName = this.pathToModuleName(this.file.fileName, tsImport);
    }

    if (!varName) {
      let mv = this.moduleVariables.get(modName);
      if (mv) {
        // Caller didn't request a specific variable name and we've already
        // imported the module, so just return the name we already have for this module.
        return mv;
      }

      // Note: we always introduce a variable for any import, regardless of whether
      // the caller requested one.  This avoids a Closure error.
      varName = this.generateFreshVariableName();
    }

    if (isNamespaceImport) this.namespaceImports.add(varName);
    if (this.moduleVariables.has(modName)) {
      this.emit(`var ${varName} = ${this.moduleVariables.get(modName)};`);
    } else {
      this.emit(`var ${varName} = goog.require('${modName}');`);
      this.moduleVariables.set(modName, varName);
    }
    return varName;
  }
  // workaround for syntax highlighting bug in Sublime: `

  /**
   * Returns the string argument if call is of the form
   *   require('foo')
   */
  isRequire(call: ts.CallExpression): string|null {
    // Verify that the call is a call to require(...).
    if (call.expression.kind !== ts.SyntaxKind.Identifier) return null;
    let ident = call.expression as ts.Identifier;
    if (getIdentifierText(ident) !== 'require') return null;

    // Verify the call takes a single string argument and grab it.
    if (call.arguments.length !== 1) return null;
    let arg = call.arguments[0];
    if (arg.kind !== ts.SyntaxKind.StringLiteral) return null;
    return (arg as ts.StringLiteral).text;
  }

  /**
   * Returns the inner string if call is of the form
   *   __export(require('foo'))
   */
  isExportRequire(call: ts.CallExpression): string|null {
    if (call.expression.kind !== ts.SyntaxKind.Identifier) return null;
    let ident = call.expression as ts.Identifier;
    if (ident.getText() !== '__export') return null;

    // Verify the call takes a single call argument and check it.
    if (call.arguments.length !== 1) return null;
    let arg = call.arguments[0];
    if (arg.kind !== ts.SyntaxKind.CallExpression) return null;
    return this.isRequire(arg as ts.CallExpression);
  }

  /**
   * maybeProcess is called during the recursive traversal of the program's AST.
   *
   * @return True if the node was processed/emitted, false if it should be emitted as is.
   */
  protected maybeProcess(node: ts.Node): boolean {
    switch (node.kind) {
      case ts.SyntaxKind.PropertyAccessExpression:
        let propAccess = node as ts.PropertyAccessExpression;
        // We're looking for an expression of the form:
        //   module_name_var.default
        if (getIdentifierText(propAccess.name) !== 'default') break;
        if (propAccess.expression.kind !== ts.SyntaxKind.Identifier) break;
        let lhs = getIdentifierText(propAccess.expression as ts.Identifier);
        if (!this.namespaceImports.has(lhs)) break;
        // Emit the same expression, with spaces to replace the ".default" part
        // so that source maps still line up.
        this.writeRange(node.getFullStart(), node.getStart());
        this.emit(`${lhs}        `);
        return true;
      default:
        break;
    }
    return false;
  }

  /** Generates a new variable name inside the tsickle_ namespace. */
  generateFreshVariableName(): string {
    return `tsickle_module_${this.unusedIndex++}_`;
  }
}

/**
 * Converts TypeScript's JS+CommonJS output to Closure goog.module etc.
 * For use as a postprocessing step *after* TypeScript emits JavaScript.
 *
 * @param fileName The source file name.
 * @param moduleId The "module id", a module-identifying string that is
 *     the value module.id in the scope of the module.
 * @param pathToModuleName A function that maps a filesystem .ts path to a
 *     Closure module name, as found in a goog.require('...') statement.
 *     The context parameter is the referencing file, used for resolving
 *     imports with relative paths like "import * as foo from '../foo';".
 * @param prelude An additional prelude to insert after the `goog.module` call,
 *     e.g. with additional imports or requires.
 */
export function processES5(
    fileName: string, moduleId: string, content: string,
    pathToModuleName: (context: string, fileName: string) => string, isES5 = true,
    prelude = ''): {output: string, referencedModules: string[]} {
  let file = ts.createSourceFile(fileName, content, ts.ScriptTarget.ES5, true);
  return new ES5Processor(file, pathToModuleName, prelude).process(moduleId, isES5);
}


text:
package uk.ac.ebi.spot.security.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Component;
import uk.ac.ebi.spot.security.model.OrcidUser;
import uk.ac.ebi.spot.security.model.OrcidPrinciple;
import uk.ac.ebi.spot.security.model.Role;
import uk.ac.ebi.spot.security.service.OrcidUserService;

import java.util.List;

/**
 * @author Simon Jupp
 * @since 22/09/2016
 * Samples, Phenotypes and Ontologies Team, EMBL-EBI
 *
 * The authentication provider that authenticates a user by api key. Authentication is done
 * by validating the api key against an existing user in the user repository
 *
 */
@Component
public class ApiKeyAuthenticationProvider implements AuthenticationProvider {

    @Autowired
    OrcidUserService orcidUserService;

    @Override
    public Authentication authenticate(Authentication auth)
            throws AuthenticationException {

        ApiKeyToken token = (ApiKeyToken)auth;

        try{
            //Authenticate token against redis or whatever you want

            OrcidUser orcidUser = orcidUserService.getUserByApiKey(token.getValue());
            List<GrantedAuthority> authorityList = AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER");

            if (orcidUser.getRole().equals(Role.ADMIN)) {
                authorityList = AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER,ROLE_ADMIN");
            }

            OrcidPrinciple orcidPrinciple = new OrcidPrinciple(orcidUser.getGivenName(), orcidUser.getFamilyName(), orcidUser.getOrcid());

            //Our token resolved to a username so i went with this token...you could make your CustomToken take the principal.  getCredentials returns "NO_PASSWORD"..it gets cleared out anyways.  also the getAuthenticated for the thing you return should return true now
            return new UsernamePasswordAuthenticationToken(orcidPrinciple, auth.getCredentials(), authorityList);
        } catch(Exception e){
            //TODO throw appropriate AuthenticationException types
            throw new BadCredentialsException("Authentication failure", e);
        }

    }

    @Override
    public boolean supports(Class<?> authentication) {
        return ApiKeyToken.class.isAssignableFrom(authentication);
    }

}


text:
bool convert_pem_privatekey_to_der(const char *private_key_pem, char **private_key_der, uint16_t *len);
bool convert_pem_x509_to_der(const char *cert_buffer_pem, char **cert_buffer_der, uint16_t *len);

#endif