text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>nl.knaw.dans.dccd</groupId>
	<artifactId>dccd-oai</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>dccd-oai Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<!-- JAX-RS -->
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-server</artifactId>
			<version>1.8</version>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-client</artifactId>
			<version>1.13</version>
		</dependency>
		<!-- to use json object and arrays -->
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-json</artifactId>
			<version>1.8</version>
		</dependency>

		<!-- JUNIT DEPENDENCY FOR TESTING -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

		<!-- LOGGING DEPENDENCIES - LOG4J -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.7.21</version>
		</dependency>

		<!-- date time conversion/formatting -->
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>2.9.4</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.3.2</version>
		</dependency>

		<!-- proai and dependencies below -->

		<!-- proai from https://github.com/fcrepo/proai -->
		<dependency>
			<groupId>proai</groupId>
			<artifactId>proai</artifactId>
			<version>1.1.3</version>
		</dependency>
		<!-- BValid from http://www.sf.net/projects/bvalid needed by proai -->
		<dependency>
			<groupId>bvalid</groupId>
			<artifactId>bvalid</artifactId>
			<version>0.8.1</version>
		</dependency>
		<dependency>
			<groupId>xerces</groupId>
			<artifactId>xercesImpl</artifactId>
			<version>2.11.0</version>
		</dependency>
		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
			<version>3.1-beta1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>2.6.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>2.6.2</version>
		</dependency>
		<dependency>
			<groupId>postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>8.2-504.jdbc3</version>
		</dependency>
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>1.2.1</version>
		</dependency>

<dependency>
	<groupId>net.sf.saxon</groupId>
	<artifactId>Saxon-HE</artifactId>
	<version>9.7.0-8</version>
</dependency>

	</dependencies>

	<build>
		<finalName>dccd-oai</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<downloadSources>true</downloadSources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>rpm-maven-plugin</artifactId>
				<version>2.1.3</version>
				<executions>
					<execution>
						<id>generate-rpm</id>
						<goals>
							<goal>rpm</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<license>Apache 2.0</license>
					<distribution>DANS</distribution>
					<group>Application/Internet</group>
					<packager>Peter Brewer</packager>
					<prefix>/opt</prefix>
					<mappings>
						<mapping>
							<directory>/opt/dccd</directory>
							<filemode>755</filemode>
							<username>tomcat</username>
							<groupname>tomcat</groupname>
							<recurseDirectories>true</recurseDirectories>
							<sources>
								<source>
									<location>target/dccd-oai.war</location>
								</source>
							</sources>
						</mapping>
						<mapping>
							<directory>/opt/dccd/oai</directory>
							<filemode>655</filemode>
							<username>tomcat</username>
							<groupname>tomcat</groupname>
							<recurseDirectories>true</recurseDirectories>
							<sources>
								<source>
									<location>src/main/assembly/oai</location>
								</source>
							</sources>
						</mapping>
						<mapping>
							<directory>/opt/dccd/</directory>
							<filemode>755</filemode>
							<username>tomcat</username>
							<groupname>tomcat</groupname>
							<sources>
								<source>
									<location>src/main/assembly/dccd-oai-configure.sh</location>
								</source>
							</sources>
						</mapping>
					</mappings>
					<requires>
						<require>dccd-http java-devel</require>
					</requires>
				</configuration>
			</plugin>

		</plugins>
	</build>

	<repositories>
		<repository>
			<id>maven2-repository.java.net</id>
			<name>Java.net Repository for Maven</name>
			<url>http://download.java.net/maven/2/</url>
		</repository>
		<repository>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>never</updatePolicy>
				<checksumPolicy>fail</checksumPolicy>
			</snapshots>
			<id>maven-repository</id>
			<name>Maven Repository</name>
			<url>http://repo1.maven.org/maven2/</url>
		</repository>

		<!-- local static repo for jars not in any maven repo -->
		<repository>
			<id>in-project</id>
			<name>In Project Repo</name>
			<url>file://${project.basedir}/repo</url>
		</repository>
	</repositories>

</project>

redpajama_set_name: RedPajamaGithub


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68a.c
Label Definition File: CWE195_Signed_to_Unsigned_Conversion_Error.label.xml
Template File: sources-sink-68a.tmpl.c
*/
/*
 * @description
 * CWE: 195 Signed to Unsigned Conversion Error
 * BadSource: fscanf Read data from the console using fscanf()
 * GoodSource: Positive integer
 * Sink: malloc
 *    BadSink : Allocate memory using malloc() with the size of data
 * Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files
 *
 * */

#include "std_testcase.h"

int CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_badData;
int CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_goodG2BData;

#ifndef OMITBAD

/* bad function declaration */
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68b_badSink();

void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_bad()
{
    int data;
    /* Initialize data */
    data = -1;
    /* POTENTIAL FLAW: Read data from the console using fscanf() */
    fscanf(stdin, "%d", &data);
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_badData = data;
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68b_badSink();
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* good function declarations */
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68b_goodG2BSink();

/* goodG2B uses the GoodSource with the BadSink */
static void goodG2B()
{
    int data;
    /* Initialize data */
    data = -1;
    /* FIX: Use a positive integer less than &InitialDataSize&*/
    data = 100-1;
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_goodG2BData = data;
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68b_goodG2BSink();
}

void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_good()
{
    goodG2B();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_malloc_68_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text: export { MacShift16 as default } from "../../";


text:
BOOL BLRetAuth::Read( SocketInputStream& iStream )
{
    __ENTER_FUNCTION

    iStream.Read( (CHAR*)(&szAccount), sizeof(CHAR)*MAX_ACCOUNT);
    iStream.Read((CHAR*)(&Result),sizeof(LOGIN_RESULT));
    iStream.Read( (CHAR*)(&PlayerID), sizeof(PlayerID_t));
    iStream.Read( (CHAR*)(&PlayerGUID), sizeof(GUID_t));
    iStream.Read( (CHAR*)(&m_Age), sizeof(m_Age));

    return TRUE ;

    __LEAVE_FUNCTION

        return FALSE ;
}

BOOL BLRetAuth::Write( SocketOutputStream& oStream )const
{
    __ENTER_FUNCTION

    oStream.Write( (CHAR*)(&szAccount), sizeof(CHAR)*MAX_ACCOUNT);
    oStream.Write((CHAR*)(&Result),sizeof(LOGIN_RESULT));
    oStream.Write((CHAR*)(&PlayerID),sizeof(PlayerID_t));
    oStream.Write((CHAR*)(&PlayerGUID),sizeof(GUID_t));
    oStream.Write((CHAR*)(&m_Age),sizeof(m_Age));

    return TRUE ;

    __LEAVE_FUNCTION

        return FALSE ;
}

UINT BLRetAuth::Execute( Player* pPlayer )
{
    __ENTER_FUNCTION

        return BLRetAuthHandler::Execute( this, pPlayer ) ;

    __LEAVE_FUNCTION

        return FALSE ;
}

const    CHAR*    BLRetAuth::GetAccount()    const
{
    return szAccount;
}
VOID            BLRetAuth::SetAccount(const CHAR*    pAccount)
{
    Assert(pAccount);
    strncpy(szAccount,pAccount,MAX_ACCOUNT*sizeof(CHAR));
    szAccount[MAX_ACCOUNT] = '\0' ;
}

LOGIN_RESULT    BLRetAuth::GetResult() const
{
    return Result;
}

VOID BLRetAuth::SetResult(LOGIN_RESULT result)
{
    Result = result;
}

const PlayerID_t BLRetAuth::GetPlayerID() const
{
    return PlayerID;
}

VOID        BLRetAuth::SetPlayerID(PlayerID_t pID)
{
    PlayerID = pID;
}

const GUID_t BLRetAuth::GetPlayerGUID() const
{
    return PlayerGUID;
}

VOID        BLRetAuth::SetPlayerGUID(GUID_t guid)
{
    PlayerGUID     = guid;
}

SHORT        BLRetAuth::GetAge()const
{
    return m_Age;
}
VOID        BLRetAuth::SetAge(SHORT NewAge)
{
    m_Age = NewAge;
}


text:
layout: page
title: Price Card Foundation Show
date: 2016-05-24
author: Ashley Collins
tags: weekly links, java
status: published
summary: Donec condimentum quam eros, eu hendrerit nulla.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 09/22/2018
  endDate: 09/23/2018
  ctyhocn: PITDNHX
  groupCode: PCFS
published: true
---
Aliquam sollicitudin sed turpis et lobortis. Aliquam in ligula vel massa porta lobortis vitae ac ex. Duis sit amet justo felis. Integer auctor varius dolor ac auctor. Etiam eleifend ultricies gravida. Vestibulum suscipit ex nisi, at volutpat nunc pulvinar eget. Ut erat sem, bibendum nec odio nec, dignissim mattis turpis.
Integer metus nibh, ultricies id malesuada sed, malesuada in diam. Nam sed leo in arcu gravida pharetra ut eget ligula. Ut a auctor metus. Curabitur eget turpis vitae leo tincidunt porttitor. Nam eget tempor sapien. Fusce laoreet, nulla eget ullamcorper ornare, justo eros convallis tortor, in sodales odio ipsum vitae erat. Curabitur cursus mattis lectus at sodales. Etiam turpis orci, egestas et molestie nec, malesuada sed tellus.

1 Nulla maximus dui id nibh aliquet pretium
1 Phasellus lacinia ex ac urna feugiat, et pellentesque mauris rhoncus
1 Duis sollicitudin ipsum ac dolor placerat, eu pharetra sapien placerat
1 Nam non nulla sit amet ex lacinia efficitur.

Phasellus a porttitor dolor, a sagittis ex. Nam rutrum lacus urna, sed gravida odio egestas id. Fusce leo urna, fermentum at elit non, venenatis dictum tellus. Etiam ex massa, faucibus vitae maximus et, lobortis a mi. Integer sed elit vulputate, semper mi sed, feugiat mauris. Etiam molestie, eros vitae lacinia rhoncus, libero elit tincidunt erat, id imperdiet neque dui eu risus. Duis pharetra, leo at volutpat venenatis, sapien sapien pretium libero, vitae hendrerit lectus mauris eget nulla. Nulla scelerisque metus erat, non pellentesque orci lobortis ac. Nunc consequat elit nec erat porttitor interdum. Aliquam erat volutpat. Sed lobortis nulla id lacus dignissim, eu elementum dolor molestie. Donec ullamcorper hendrerit lacus non luctus. Morbi molestie sapien ipsum, in commodo risus rhoncus a. Curabitur tincidunt, dui at mattis aliquam, odio urna varius orci, sed sagittis nisi enim eu urna.


text:
package org.apache.camel.tests.component;

import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;

import org.apache.camel.AsyncCallback;
import org.apache.camel.AsyncProcessor;
import org.apache.camel.Component;
import org.apache.camel.Consumer;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.support.DefaultComponent;
import org.apache.camel.support.DefaultConsumer;
import org.apache.camel.support.DefaultEndpoint;
import org.apache.camel.support.DefaultProducer;
import org.apache.camel.support.ExchangeHelper;

public class PerformanceTestComponent extends DefaultComponent {
    public static final String HEADER_THREADS = "CamelPerfThreads";
    public static final String HEADER_ITERATIONS = "CamelPerfIterations";

    private static final int DEFAULT_THREADS = 8;
    private static final int DEFAULT_ITERATIONS = 100;

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        Endpoint endpoint = new PerformanceTestEndpoint(uri, this);
        setProperties(endpoint, parameters);
        return endpoint;
    }

    public static int getHeaderValue(Exchange exchange, String header) {
        Integer value = exchange.getContext().getTypeConverter().convertTo(Integer.class, exchange,
                exchange.getIn().getHeader(header));
        return value != null ? value : header.equals(HEADER_THREADS) ? DEFAULT_THREADS
                : header.equals(HEADER_ITERATIONS) ? DEFAULT_ITERATIONS : 0;
    }

    private static final class PerformanceTestEndpoint extends DefaultEndpoint {
        private PerformanceTestConsumer consumer;

        protected PerformanceTestEndpoint(String uri, Component component) {
            super(uri, component);
        }

        @Override
        public Consumer createConsumer(Processor processor) throws Exception {
            synchronized (this) {
                if (consumer != null && processor != consumer.getProcessor()) {
                    throw new Exception("PerformanceTestEndpoint doesn not support multiple consumers per Endpoint");
                }
                consumer = new PerformanceTestConsumer(this, processor);
            }
            return consumer;
        }

        @Override
        public Producer createProducer() throws Exception {
            return new PerformanceTestProducer(this);
        }

        @Override
        public boolean isSingleton() {
            return true;
        }

        public Consumer getConsumer() {
            return consumer;
        }
    }

    private static final class PerformanceTestConsumer extends DefaultConsumer {
        protected PerformanceTestConsumer(Endpoint endpoint, Processor processor) {
            super(endpoint, processor);
        }
    }

    private static final class PerformanceTestProducer extends DefaultProducer implements AsyncProcessor {
        protected PerformanceTestProducer(Endpoint endpoint) {
            super(endpoint);
        }

        @Override
        public void process(final Exchange exchange) throws Exception {
            final int count = getHeaderValue(exchange, HEADER_ITERATIONS);
            final int threads = getHeaderValue(exchange, HEADER_THREADS);
            PerformanceTestEndpoint endpoint = (PerformanceTestEndpoint) getEndpoint();
            if (endpoint != null) {
                final DefaultConsumer consumer = (DefaultConsumer) endpoint.getConsumer();
                ExecutorService executor
                        = exchange.getContext().getExecutorServiceManager().newFixedThreadPool(this, "perf", threads);
                CompletionService<Exchange> tasks = new ExecutorCompletionService<>(executor);

                // StopWatch watch = new StopWatch(); // if we want to clock how
                // long it takes
                for (int i = 0; i < count; i++) {
                    tasks.submit(new Callable<Exchange>() {
                        @Override
                        public Exchange call() throws Exception {
                            Exchange exch = ExchangeHelper.createCopy(exchange, false);
                            try {
                                consumer.getProcessor().process(exch);
                            } catch (final Exception e) {
                                exch.setException(e);
                            }
                            return exch;
                        }
                    });
                }

                for (int i = 0; i < count; i++) {
                    // Future<Exchange> result = tasks.take();
                    tasks.take(); // wait for all exchanges to complete
                }
            }
        }

        @Override
        public boolean process(Exchange exchange, AsyncCallback callback) {
            try {
                this.process(exchange);
            } catch (Exception e) {
                exchange.setException(e);
            }
            callback.done(true);
            return true;
        }

        @Override
        public CompletableFuture<Exchange> processAsync(Exchange exchange) {
            // TODO Auto-generated method stub
            return null;
        }
    }
}