text:
package com.dushyant.flume.sink.aws.sqs;

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.google.common.base.Preconditions;
import org.apache.commons.lang.StringUtils;
import org.apache.flume.Channel;
import org.apache.flume.Context;
import org.apache.flume.CounterGroup;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.Transaction;
import org.apache.flume.conf.Configurable;
import org.apache.flume.instrumentation.SinkCounter;
import org.apache.flume.sink.AbstractSink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An Apache Flume sink for Amazon Simple
 * Queue Service (Amazon SQS).. Configuration Properties:

 *
Name	Default	Description

 *
sqsUrl	 	The url of the SQS to send the messages to

 *
region	us-east-1	The AWS region

awsAccessKey	env
 * .AWS_ACCESS_KEY	The AWS api access key id. This is optional. If {@code awsAccessKey} or {@code awsSecretKey}
 * are not specified then the sink will use the {@link DefaultAWSCredentialsProviderChain} to look for AWS credentials.
 * The {@code awsAccessKey} can also be specified in {@code env.variableName} format; in that case, the value of system
 * environment variable {@code variableName} will be used.

awsSecretKey	env
 * .AWS_SECRET_KEY	The AWS api access secret key. This is optional. If {@code awsAccessKey} or {@code
 * awsSecretKey} are not specified then the sink will use the {@link DefaultAWSCredentialsProviderChain} to look for AWS
 * credentials. The {@code awsSecretKey} can also be specified in {@code env.variableName} format; in that case, the
 * value of system environment variable {@code variableName} will be used.

 *
batchSize	10	Number of messages to be sent in one batch. This should be between 1 and 10
 * (inclusive). AWS SQS allows max of 10 messages per batch.

maxMessageSize	262144	The
 * max size of a message or batch (in bytes). Currently AWS allows max of 256KB.

 *
alwaysBatch	true	AWS SQS allows two separate APIs for sending a message to SQS. SendMessage and
 *
 * SendMessageBatch. This flag indicates usage of SendMessageBatch API when batchSize=1. This flag is
 * applicable only when {@code batchSize=1}. It will be ignored for all cases of {@code batchSize>1}. For example
 * when,

{@code batchSize=1,alwaysBatch=true}: SendMessageBatch will be used

batchSize=1,
 * alwaysBatch=false: SendMessage will be used

{@code batchSize>1,alwaysBatch=true|false}: SendMessageBatch
 * will be used

 *

 * Here is a sample flume config for the sink that uses system environment variables named {@code AWS_ACCESS_KEY} and
 * {@code AWS_SECRET_KEY} to set aws credentials.
 *

 * {@code
 *
 * agent.sources = s1
 * agent.channels = c1
 * agent.sinks = k1
 *
 * agent.sinks.k1.type = com.dushyant.flume.sink.aws.sqs.SQSSink
 * agent.sinks.k1.channel = c1
 * agent.sinks.k1.sqsUrl = https://sqs.us-east-1.amazonaws.com/12345646/some-sqs-name
 * agent.sinks.k1.awsAccessKey = env.AWS_ACCESS_KEY
 * agent.sinks.k1.awsSecretKey = env.AWS_SECRET_KEY
 * agent.sinks.k1.region = us-east-1
 * agent.sinks.k1.batchSize = 10
 * agent.sinks.k1.alwaysBatch = true
 * }
 *

 *

 * Here is another sample flume config for the sink that relies on {@link DefaultAWSCredentialsProviderChain} to look
 * for aws credentials in the following order

Environment Variables - AWS_ACCESS_KEY_ID and
 * AWS_SECRET_ACCESS_KEY (RECOMMENDED since they are recognized by all the AWS SDKs and CLI except for
 * .NET), or AWS_ACCESS_KEY and AWS_SECRET_KEY (only recognized by Java SDK)

Java
 * System Properties - aws.accessKeyId and aws.secretKey

Credential profiles file at the default location
 * (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

Instance profile credentials delivered through
 * the Amazon EC2 metadata service

 *

 * {@code
 *
 * agent.sources = s1
 * agent.channels = c1
 * agent.sinks = k1
 *
 * agent.sinks.k1.type = com.dushyant.flume.sink.aws.sqs.SQSSink
 * agent.sinks.k1.channel = c1
 * agent.sinks.k1.sqsUrl = https://sqs.us-east-1.amazonaws.com/12345646/some-sqs-name
 * agent.sinks.k1.region = us-east-1
 * agent.sinks.k1.batchSize = 10
 * agent.sinks.k1.alwaysBatch = true
 * }
 *

 *
 * @author dpandya
 */
public class SQSSink extends AbstractSink implements Configurable {
    private static final Logger LOG = LoggerFactory.getLogger(SQSSink.class);

    // The default max message size in Kb. Amazon currently allows payload size per message or per batch as 256KB.
    private static final int DEFAULT_MAX_MSG_SIZE_KB = 256;
    private static final long DEFAULT_MAX_MSG_SIZE_BYTES = 256L * 1024L;

    private SQSMsgSender sqsMsgSender;

    // Internal counters for sink related metrics collection. Used for Flume Monitoring.
    private SinkCounter sinkCounter;

    private CounterGroup counterGroup = new CounterGroup();
    private int batchSize;

    @Override
    public void start() {
        sinkCounter.start();
        super.start();
    }

    @Override
    public void stop() {
        sinkCounter.stop();
        super.stop();
    }

    @Override
    public void configure(Context context) {
        final String sqsUrl = resolve(context.getString("sqsUrl", null));
        Preconditions.checkState(sqsUrl != null, "SQS url not configured.");
        LOG.debug("sqsUrl:{}", sqsUrl);

        final String region = resolve(context.getString("region", "us-east-1"));
        LOG.debug("region:{}", region);

        final String awsAccessKey = resolve(context.getString("awsAccessKey", "env.AWS_ACCESS_KEY"));
        final String awsSecretKey = resolve(context.getString("awsSecretKey", "env.AWS_SECRET_KEY"));
        LOG.debug("awsAccessKey:{}", awsAccessKey);

        this.batchSize = context.getInteger("batchSize", 10);
        Preconditions.checkState(1 <= batchSize && batchSize <= 10,
            "Invalid batchSize specified. The batchSize must be a positive integer between 1 and 10 " +
                "(inclusive). The batch size 1 means no batching and each event will be attempted to be sent " +
                "to SQS as soon as received by the sink. AWS SQS allows max of 10 messages per batch.");
        LOG.debug("batchSize:{}", batchSize);

        final long maxMessageSize = context.getLong("maxMessageSize", DEFAULT_MAX_MSG_SIZE_BYTES);
        Preconditions.checkState(1 <= maxMessageSize && maxMessageSize <= DEFAULT_MAX_MSG_SIZE_BYTES,
            "Invalid maxMessageSize specified. The maxMessageSize must be " +
                "between 1 and " + DEFAULT_MAX_MSG_SIZE_BYTES +
                "(inclusive). Currently, Amazon allows max payload size of " + DEFAULT_MAX_MSG_SIZE_KB +
                "KB per request or per batch.");
        LOG.debug("maxMessageSize:{}", maxMessageSize);

        final boolean alwaysBatch = context.getBoolean("alwaysBatch", true);
        LOG.debug("alwaysBatch:{}", alwaysBatch);

        // TODO: Add dynamic reconfiguration support
        if (sqsMsgSender == null) {
            if (alwaysBatch || batchSize > 1) {
                LOG.info("Using sqsMsgSender:{}", BatchSQSMsgSender.class);
                sqsMsgSender =
                    new BatchSQSMsgSender(sqsUrl, region, awsAccessKey, awsSecretKey, batchSize, maxMessageSize);
            }
            else {
                LOG.info("Using sqsMsgSender:{}", BasicSQSMsgSender.class);
                sqsMsgSender = new BasicSQSMsgSender(sqsUrl, region, awsAccessKey, awsSecretKey);
            }
        }

        if (sinkCounter == null) {
            sinkCounter = new SinkCounter(getName());
        }
    }

    /**
     * The method for resolving the configured property value.
     *

     * For example, the configuration allows properties to be specified in the {@code env.propertyName} format. This
     * method resolves that configuration property value using the environment variable named {@code propertyName}. In
     * other cases, the method returns the given property as is.
     *
     * @param property The configured property value to be resolved
     *
     * @return The resolved property value
     */
    protected String resolve(String property) {
        String resolved = property;
        if (StringUtils.isNotBlank(property) && property.startsWith("env.")) {
            String envVariableName = StringUtils.substringAfter(property, "env.");
            resolved = System.getenv(envVariableName);
        }
        return resolved;
    }

    @Override
    public Status process() throws EventDeliveryException {
        Status status = null;

        // Start transaction
        Channel channel = getChannel();
        Transaction transaction = channel.getTransaction();
        transaction.begin();
        try {
            // Call the sender to take and send events to SQS. The method call below returns the number of events
            // sent to SQS in one call.
            int txnEventCount = sqsMsgSender.send(channel);
            status = Status.READY;

            // Increment sinkCounter appropriately
            if (txnEventCount == 0) {
                // Return status of BACKOFF when no events were processed. This will cause flume to "backoff" from
                // the sink for sometime before trying again.
                // Usually happens when the channel is empty.
                status = Status.BACKOFF;
                sinkCounter.incrementBatchEmptyCount();
            }
            else if (txnEventCount == batchSize) {
                // Entire batch is processed in this transaction. Increment the complete batch count.
                sinkCounter.incrementBatchCompleteCount();
            }
            else {
                // There were less events to process in this transaction then the batch size. Increment the batch
                // underflow count.
                sinkCounter.incrementBatchUnderflowCount();
            }

            // No exceptions or errors so happily commit the transaction
            transaction.commit();

            // The "txnEventCount" number of events are successfully drained (i.e.,
            // sent to SQS already) so increment the drain success count
            sinkCounter.addToEventDrainSuccessCount(txnEventCount);
            counterGroup.incrementAndGet("transaction.success");
        }
        catch (EventDeliveryException ede) {
            // Rollback and rethrow event delivery exception
            rollback(transaction);
            throw ede;
        }
        catch (Exception e) {
            // Rollback and convert to event delivery exception and throw
            rollback(transaction);
            throw new EventDeliveryException("Exception while sending message(s) to SQS", e);
        }
        catch (Error err) {
            // Rollback and rethrow error
            rollback(transaction);
            throw err;
        }
        finally {
            transaction.close();
        }
        return status;
    }

    private void rollback(Transaction transaction) {
        transaction.rollback();
        counterGroup.incrementAndGet("transaction.rollback");
    }

    public void setSqsMsgSender(SQSMsgSender sqsMsgSender) {
        this.sqsMsgSender = sqsMsgSender;
    }

    protected void setSinkCounter(SinkCounter sinkCounter) {
        this.sinkCounter = sinkCounter;
    }

    protected void setCounterGroup(CounterGroup counterGroup) {
        this.counterGroup = counterGroup;
    }
}


text:
.ucl-itkpd-configurator-component-item-form .wizard {
    margin-bottom: 20px;
}

.ucl-itkpd-configurator-component-item-form .wizardStep {
    margin-top: 20px;
}

.ucl-itkpd-configurator-component-item-form .wizard a,
.ucl-itkpd-configurator-component-item-form .wizard a:hover,
.ucl-itkpd-configurator-component-item-form .wizard a:active {
    text-decoration: none;
    color: #5b6d79;
    cursor: default;
}

.ucl-itkpd-configurator-component-item-form .wizard a {
    padding: 10px 12px 10px;
    margin-right: 5px;
    background: #efefef;
    position: relative;
    display: inline-block;

}

.ucl-itkpd-configurator-component-item-form .wizard a:before {
    width: 0;
    height: 0;
    border-top: 20px inset transparent;
    border-bottom: 20px inset transparent;
    border-left: 20px solid #fff;
    position: absolute;
    content: "";
    top: 0;
    left: 0;
}
.ucl-itkpd-configurator-component-item-form .wizard a:after {
    width: 0;
    height: 0;
    border-top: 20px inset transparent;
    border-bottom: 20px inset transparent;
    border-left: 20px solid #efefef;
    position: absolute;
    content: "";
    top: 0;
    right: -20px;
    z-index: 2;
}
.ucl-itkpd-configurator-component-item-form .wizard a:first-child:before,
.ucl-itkpd-configurator-component-item-form .wizard a:last-child:after {
    border: none;
}
.ucl-itkpd-configurator-component-item-form .wizard a:first-child {
    -webkit-border-radius: 4px 0 0 4px;
    -moz-border-radius: 4px 0 0 4px;
    border-radius: 4px 0 0 4px;
}
.ucl-itkpd-configurator-component-item-form .wizard a:last-child {
    -webkit-border-radius: 0 4px 4px 0;
    -moz-border-radius: 0 4px 4px 0;
    border-radius: 0 4px 4px 0;
}
.ucl-itkpd-configurator-component-item-form .wizard .badge {
    margin: 0 5px 0 18px;
    position: relative;
    top: -1px;
}
.ucl-itkpd-configurator-component-item-form .wizard a:first-child .badge {
    margin-left: 0;
}

.ucl-itkpd-configurator-component-item-form .wizard a.current:hover,
.ucl-itkpd-configurator-component-item-form .wizard a.current:active,
.ucl-itkpd-configurator-component-item-form .wizard .current {
    background: #4d94cc;
    color: #fff;
    cursor: default;
}

.ucl-itkpd-configurator-component-item-form .wizard .current:after {
    border-left-color: #4d94cc;
}

.ucl-itkpd-configurator-component-item-form h2 {
    padding-bottom: 0.5em;
    font-size: 1.8em;
}

.ucl-itkpd-configurator-component-item-form .uu5-forms-select-input-btn-group:last-child,
.ucl-itkpd-configurator-component-item-form .uu5-forms-select-input-header {
    z-index: 20;
}

.ucl-itkpd-configurator-component-item-form .uu5-forms-select-input-menu {
    z-index: 40;
}

/*Basic Form submit and cancel buttons*/
.ucl-itkpd-configurator-component-item-form-btn-form {
    padding: 20px 0;
}

redpajama_set_name: RedPajamaGithub


text:
package cn.smssdk.gui;

import static com.mob.tools.utils.R.getColorRes;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;

import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.smssdk.SMSSDK;
import cn.smssdk.gui.GroupListView.GroupAdapter;
import cn.smssdk.gui.layout.SizeHelper;
import cn.smssdk.utils.SMSLog;

/** 自定义的国家列表,适配器,用于填充国家listview*/
public class CountryAdapter extends GroupAdapter {
	private HashMap<Character, ArrayList<String[]>> rawData;
	private ArrayList<String> titles;
	private ArrayList<ArrayList<String[]>> countries;
	private SearchEngine sEngine;

	public CountryAdapter(GroupListView view) {
		super(view);
		rawData = SMSSDK.getGroupedCountryList();
		initSearchEngine();
		search(null);
	}

	private void initSearchEngine() {
		sEngine = new SearchEngine();
		ArrayList<String> countries = new ArrayList<String>();
		for (Entry<Character, ArrayList<String[]>> ent : rawData.entrySet()) {
			ArrayList<String[]> cl = ent.getValue();
			for (String[] paire : cl) {
				countries.add(paire[0]);
			}
		}
		sEngine.setIndex(countries);
	}

	/**
	 * 搜索
	 * @param token
	 */
	public void search(String token) {
		ArrayList<String> res = sEngine.match(token);
		boolean isEmptyToken = false;
		if (res == null || res.size() <= 0) {
			res = new ArrayList<String>();
			isEmptyToken = true;
		}

		HashMap<String, String> resMap = new HashMap<String, String>();
		for (String r : res) {
			resMap.put(r, r);
		}

		titles = new ArrayList<String>();
		countries = new ArrayList<ArrayList<String[]>>();
		for (Entry<Character, ArrayList<String[]>> ent : rawData.entrySet()) {
			ArrayList<String[]> cl = ent.getValue();
			ArrayList<String[]> list = new ArrayList<String[]>();
			for (String[] paire : cl) {
				if (isEmptyToken || resMap.containsKey(paire[0])) {
					list.add(paire);
				}
			}
			if (list.size() > 0) {
				titles.add(String.valueOf(ent.getKey()));
				countries.add(list);
			}
		}

//		boolean isEmptyToken = TextUtils.isEmpty(token);
//
//		titles = new ArrayList<String>();
//		countries = new ArrayList<ArrayList<String[]>>();
//		for (Entry<Character, ArrayList<String[]>> ent : rawData.entrySet()) {
//			ArrayList<String[]> cl = ent.getValue();
//			ArrayList<String[]> list = new ArrayList<String[]>();
//			for (String[] paire : cl) {
//				if (isEmptyToken || paire[0].contains(token)) {
//					list.add(paire);
//				}
//			}
//			if (list.size() > 0) {
//				titles.add(String.valueOf(ent.getKey()));
//				countries.add(list);
//			}
//		}
	}

	public int getGroupCount() {
		return titles == null ? 0 : titles.size();
	}

	public int getCount(int group) {
		if (countries == null) {
			return 0;
		}

		ArrayList<String[]> list = countries.get(group);
		if (list == null) {
			return 0;
		}

		return list.size();
	}

	public String getGroupTitle(int group) {
		if(titles.size() != 0){
			return titles.get(group).toString();
		}else{
			return null;
		}
	}

	public String[] getItem(int group, int position) {
		String[] countriesArray = null;
		if(countries.size() != 0){
			try {
				countriesArray = countries.get(group).get(position);
			} catch (Throwable e) {
				SMSLog.getInstance().w(e);
			}
			return countriesArray;
		}else{
			return null;
		}
	}

	/** 获取组标题的view,如 组 A*/
	public View getTitleView(int group, View convertView, ViewGroup parent) {
		if (convertView == null) {
			LinearLayout ll = new LinearLayout(parent.getContext());
			ll.setOrientation(LinearLayout.VERTICAL);
			ll.setBackgroundColor(0xffffffff);
			convertView = ll;

			SizeHelper.prepare(parent.getContext());

			TextView tv = new TextView(parent.getContext());
			tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(16));
			int resId = getColorRes(parent.getContext(), "smssdk_lv_title_color");
			if (resId > 0) {
				tv.setTextColor(parent.getContext().getResources().getColor(resId));
			}
			int dp_6 = SizeHelper.fromPxWidth(14);
			tv.setPadding(0, dp_6, 0, dp_6);
			tv.setLayoutParams(new LinearLayout.LayoutParams(
					LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
			ll.addView(tv);

			View vDiv = new View(parent.getContext());
			vDiv.setBackgroundColor(0xffe3e3e3);
			ll.addView(vDiv, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 1));
		}

		String title = getGroupTitle(group);
		TextView tv = (TextView) ((LinearLayout) convertView).getChildAt(0);
		tv.setText(title);
		return convertView;
	}

	/** listview 滑动时,改变组的标题 */
	public void onGroupChange(View titleView, String title) {
		TextView tv = (TextView) ((LinearLayout) titleView).getChildAt(0);
		tv.setText(title);
	}

	/** 设置国家列表listview组中的item项 */
	public View getView(int group, int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			LinearLayout ll = new LinearLayout(parent.getContext());
			ll.setBackgroundColor(0xffffffff);
			convertView = ll;

			SizeHelper.prepare(parent.getContext());

			TextView tv = new TextView(parent.getContext());
			int resId = getColorRes(parent.getContext(), "smssdk_lv_tv_color");
			if (resId > 0) {
				tv.setTextColor(parent.getContext().getResources().getColor(resId));
			}
			tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, SizeHelper.fromPxWidth(24));
			int dp_16 = SizeHelper.fromPxWidth(30);
			tv.setPadding(0, dp_16, 0, dp_16);
			ll.addView(tv, new LinearLayout.LayoutParams(
					LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
		}

		String[] data = getItem(group, position);
		if(data != null){
			TextView tv = (TextView) ((LinearLayout) convertView).getChildAt(0);
			tv.setText(data[0]);
		}
		return convertView;
	}

}


text:
'use strict'
const http = require('http')

function getPathWithQueryStringParams(event) {
    const queryStringKeys = Object.keys(event.queryStringParameters || {})

    if (queryStringKeys.length === 0) return event.path

    const queryStringParams = queryStringKeys.map(queryStringKey => `${queryStringKey}=${encodeURIComponent(event.queryStringParameters[queryStringKey])}`).join('&')

    return `${event.path}?${queryStringParams}`
}

function mapApiGatewayEventToHttpRequest(event, context, socketPath) {
    const headers = event.headers || {} // NOTE: Mutating event.headers; prefer deep clone of event.headers
    const eventWithoutBody = Object.assign({}, event)
    delete eventWithoutBody.body

    headers['x-apigateway-event'] = JSON.stringify(eventWithoutBody)
    headers['x-apigateway-context'] = JSON.stringify(context)

    return {
        method: event.httpMethod,
        path: getPathWithQueryStringParams(event),
        headers,
        socketPath
        // protocol: `${headers['X-Forwarded-Proto']}:`,
        // host: headers.Host,
        // hostname: headers.Host, // Alias for host
        // port: headers['X-Forwarded-Port']
    }
}

function forwardResponseToApiGateway(server, response, context) {
    const gunzip = require('zlib').createGunzip()
    let buf = []

    let parsedResponse = null

    if (response.headers['content-encoding'] == "gzip") {
        response.pipe(gunzip)
        parsedResponse = gunzip
        response.headers['content-encoding'] = undefined
        response.headers['transfer-encoding'] = undefined
    } else {
        parsedResponse = response
    }

    parsedResponse
        .on('data', (chunk) => buf.push(chunk))
        .on('end', () => {
            let body = Buffer.concat(buf)
            const statusCode = response.statusCode
            const headers = response.headers

            Object.keys(headers)
                .forEach(h => {
                    if(Array.isArray(headers[h])) headers[h] = headers[h].join(',')
                })

            const contentType = headers['content-type']
            let isBase64Encoded

            if (server._binaryTypes.indexOf(contentType) !== -1) {
                body = body.toString('base64')
                isBase64Encoded = true
            } else {
                body = body.toString('utf8')
                isBase64Encoded = false
            }

            const successResponse = {statusCode, body, headers, isBase64Encoded}
            console.log('Aqui: ', JSON.stringify(successResponse))
            context.succeed(successResponse)
        })
}

function forwardConnectionErrorResponseToApiGateway(server, error, context) {
    console.error(error)
    const errorResponse = {
        statusCode: 502, // "DNS resolution, TCP level errors, or actual HTTP parse errors" - https://nodejs.org/api/http.html#http_http_request_options_callback
        body: '',
        headers: {}
    }

    context.succeed(errorResponse)
}

function forwardLibraryErrorResponseToApiGateway(server, error, context) {
    console.error(error)
    const errorResponse = {
        statusCode: 500,
        body: '',
        headers: {}
    }

    context.succeed(errorResponse)
}

function forwardRequestToNodeServer(server, event, context) {
    const requestOptions = mapApiGatewayEventToHttpRequest(event, context, getSocketPath(server._socketPathSuffix))
    const req = http.request(requestOptions, (response) => forwardResponseToApiGateway(server, response, context))
    if (event.body) {
        req.write(event.body)
    }
    req.on('error', (error) => forwardConnectionErrorResponseToApiGateway(server, error, context))
    .end()
}

function startServer(server) {
    return server.listen(getSocketPath(server._socketPathSuffix))
}

function getSocketPath(socketPathSuffix) {
    return `/tmp/server${socketPathSuffix}.sock`
}

exports.createServer = (requestListener, serverListenCallback, binaryTypes) => {
    const server = http.createServer(requestListener)

    server._socketPathSuffix = 0
    server._binaryTypes = binaryTypes ? binaryTypes.slice() : []
    server.on('listening', () => {
        server._isListening = true

        if (serverListenCallback) serverListenCallback()
    })
    server.on('close', () => {
        server._isListening = false
    })
    .on('error', (err) => {
        if (err.code === 'EADDRINUSE') {
            console.warn(`EADDRINUSE ${getSocketPath(server._socketPathSuffix)} incrementing socketPathSuffix.`)
            ++server._socketPathSuffix
            server.close(() => startServer(server))
        }
    })

    return server
}

exports.proxy = (server, event, context) => {
    try {
        if (server._isListening) {
            forwardRequestToNodeServer(server, event, context)
        } else {
            startServer(server)
            .on('listening', () => {
                try {
                    forwardRequestToNodeServer(server, event, context)
                } catch(error) {
                    console.log('There was an error:' + error)
                    forwardLibraryErrorResponseToApiGateway(server, error, context)
                }
            })
        }
    } catch (error) {
        forwardLibraryErrorResponseToApiGateway(server, error, context)
    }
}

if (process.env.NODE_ENV === 'test') {
    exports.getPathWithQueryStringParams = getPathWithQueryStringParams
    exports.mapApiGatewayEventToHttpRequest = mapApiGatewayEventToHttpRequest
    exports.forwardResponseToApiGateway = forwardResponseToApiGateway
    exports.forwardConnectionErrorResponseToApiGateway = forwardConnectionErrorResponseToApiGateway
    exports.forwardLibraryErrorResponseToApiGateway = forwardLibraryErrorResponseToApiGateway
    exports.forwardRequestToNodeServer = forwardRequestToNodeServer
    exports.startServer = startServer
    exports.getSocketPath = getSocketPath
}


text:
Write a program to convert hexadecimal numbers to binary numbers (directly).

## Input
- On the only line you will receive a decimal number - **N**
  - There will not be leading zeros
  - Letters will be uppercase

## Output
- Print the its binary representation on a single line
  - There should not be leading zeros

## Constraints
- 1 <= **N** <= 1018 = DE0B6B3A7640000(16)
- Time limit: **0.1s**
- Memory limit: **16MB**

## Sample tests

| Input | Output |
|:-----:|:------:|
| 13    | 10011  |

## Submission
- Submit your code [here](http://bgcoder.com/Contests/Compete/Index/318#4)


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

import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import com.googlecode.junittoolbox.MultithreadingTester;
import com.googlecode.junittoolbox.RunnableAssert;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.thrift.generated.Calculator;
import org.apache.camel.component.thrift.generated.Operation;
import org.apache.camel.component.thrift.generated.Work;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.async.TAsyncClientManager;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TNonblockingSocket;
import org.apache.thrift.transport.TNonblockingTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.transport.layered.TFramedTransport;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

public class ThriftConsumerConcurrentTest extends CamelTestSupport {
    private static final Logger LOG = LoggerFactory.getLogger(ThriftConsumerConcurrentTest.class);

    private static final int THRIFT_SYNC_REQUEST_TEST_PORT = AvailablePortFinder.getNextAvailable();
    private static final int THRIFT_ASYNC_REQUEST_TEST_PORT = AvailablePortFinder.getNextAvailable();
    private static final int THRIFT_TEST_NUM1 = 12;
    private static final int CONCURRENT_THREAD_COUNT = 30;
    private static final int ROUNDS_PER_THREAD_COUNT = 10;

    private static AtomicInteger idCounter = new AtomicInteger();

    public static Integer createId() {
        return idCounter.getAndIncrement();
    }

    public static Integer getId() {
        return idCounter.get();
    }

    @Test
    public void testSyncWithConcurrentThreads() throws Exception {
        RunnableAssert ra = new RunnableAssert("testSyncWithConcurrentThreads") {

            @Override
            public void run() throws TTransportException {
                TTransport transport = new TSocket("localhost", THRIFT_SYNC_REQUEST_TEST_PORT);
                transport.open();
                TProtocol protocol = new TBinaryProtocol(new TFramedTransport(transport));
                Calculator.Client client = (new Calculator.Client.Factory()).getClient(protocol);

                int instanceId = createId();

                int calculateResponse = 0;
                try {
                    calculateResponse = client.calculate(1, new Work(instanceId, THRIFT_TEST_NUM1, Operation.MULTIPLY));
                } catch (TException e) {
                    LOG.info("Exception", e);
                }

                assertNotEquals(0, calculateResponse, "instanceId = " + instanceId);
                assertEquals(instanceId * THRIFT_TEST_NUM1, calculateResponse);

                transport.close();
            }
        };

        new MultithreadingTester().add(ra).numThreads(CONCURRENT_THREAD_COUNT).numRoundsPerThread(ROUNDS_PER_THREAD_COUNT)
                .run();
    }

    @Test
    public void testAsyncWithConcurrentThreads() throws Exception {
        RunnableAssert ra = new RunnableAssert("testAsyncWithConcurrentThreads") {

            @Override
            public void run() throws TTransportException, IOException, InterruptedException {
                final CountDownLatch latch = new CountDownLatch(1);

                TNonblockingTransport transport = new TNonblockingSocket("localhost", THRIFT_ASYNC_REQUEST_TEST_PORT);
                Calculator.AsyncClient client
                        = (new Calculator.AsyncClient.Factory(new TAsyncClientManager(), new TBinaryProtocol.Factory()))
                                .getAsyncClient(transport);

                int instanceId = createId();
                CalculateAsyncMethodCallback calculateCallback = new CalculateAsyncMethodCallback(latch);
                try {
                    client.calculate(1, new Work(instanceId, THRIFT_TEST_NUM1, Operation.MULTIPLY), calculateCallback);
                } catch (TException e) {
                    LOG.info("Exception", e);
                }
                latch.await(5, TimeUnit.SECONDS);

                int calculateResponse = calculateCallback.getCalculateResponse();
                LOG.debug("instanceId = {}", instanceId);
                assertEquals(instanceId * THRIFT_TEST_NUM1, calculateResponse);

                transport.close();
            }
        };

        new MultithreadingTester().add(ra).numThreads(CONCURRENT_THREAD_COUNT).numRoundsPerThread(ROUNDS_PER_THREAD_COUNT)
                .run();
    }

    public class CalculateAsyncMethodCallback implements AsyncMethodCallback<Integer> {
        private final CountDownLatch latch;
        private Integer calculateResponse;

        public CalculateAsyncMethodCallback(CountDownLatch latch) {
            this.latch = latch;
        }

        @Override
        public void onComplete(Integer response) {
            calculateResponse = response;
            latch.countDown();
        }

        @Override
        public void onError(Exception exception) {
            LOG.info("Exception", exception);
            latch.countDown();
        }

        public Integer getCalculateResponse() {
            return calculateResponse;
        }
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() {

                from("thrift://localhost:" + THRIFT_SYNC_REQUEST_TEST_PORT
                     + "/org.apache.camel.component.thrift.generated.Calculator?synchronous=true")
                             .setBody(simple("${body[1]}")).bean(new CalculatorMessageBuilder(), "multiply");

                from("thrift://localhost:" + THRIFT_ASYNC_REQUEST_TEST_PORT
                     + "/org.apache.camel.component.thrift.generated.Calculator")
                             .setBody(simple("${body[1]}")).bean(new CalculatorMessageBuilder(), "multiply");
            }
        };
    }

    public class CalculatorMessageBuilder {
        public Integer multiply(Work work) {
            return work.num1 * work.num2;
        }
    }
}


text:
'use strict';

/**
 * @ngdoc function
 * @name initApp.controller:ProfileCtrl
 * @description
 * # AboutCtrl
 * Controller of the initApp
 */
function ProfileCtrl($routeParams, awesomeThings) {
  var profileCtrl = this,
    id = $routeParams.awesomeThingId;

  profileCtrl.awesomeThing = awesomeThings.get(id);
}

ProfileCtrl.$inject = ['$routeParams', 'awesomeThings'];

angular.module('initApp')
  .controller('ProfileCtrl', ProfileCtrl);


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>YGameFrame: 类成员</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

YGameFrame

首页

相关页面

包

类

文件

          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

类列表

类索引

类继承关系

类成员

全部

函数

变量

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

x

y

z

 全部 类 命名空间 文件 函数 变量 页

这里列出了所有类成员,并附带类的详细说明:

- g -

getAngle()
: ygame.framework.core.YCamera
, ygame.transformable.YIMoverGetter
, ygame.transformable.YMover

getAttribute()
: ygame.program.YAShaderProgram

getColorDataSource()
: ygame.skeleton.YSkeleton

getCondition()
: ygame.state_machine.impl.Transition< S, R, C >

getContext()
: ygame.framework.core.YSystem

getCurrentScene()
: ygame.framework.core.YSystem

getCurrentState()
: ygame.state_machine.StateMachine< S, R, C >

getHandle()
: ygame.skeleton.YAttributeDataSource
, ygame.texture.YTexture

getHeight()
: ygame.texture.YTexture

getIndexData()
: ygame.skeleton.YSkeleton

getIndexHandle()
: ygame.skeleton.YSkeleton

getInstance()
: ygame.extension.program.YSimpleProgram
, ygame.extension.program.YTextureProgram
, ygame.extension.program.YTextureWaveProgram
, ygame.extension.program.YTileMapProgram
, ygame.extension.program.YTileProgram

getInstanceInGL()
: ygame.framework.core.YGL_Configuration

getMatrix()
: ygame.transformable.YMover

getMaxAliasedLineWidth()
: ygame.framework.core.YGL_Configuration

getMaxAliasedPointSize()
: ygame.framework.core.YGL_Configuration

getMaxCombinedTextureUnits()
: ygame.framework.core.YGL_Configuration

getMaxCubeMapTextureSize()
: ygame.framework.core.YGL_Configuration

getMaxFragmentUniformVectors()
: ygame.framework.core.YGL_Configuration

getMaxRenderbufferSize()
: ygame.framework.core.YGL_Configuration

getMaxTextureImageUnits()
: ygame.framework.core.YGL_Configuration

getMaxTextureSize()
: ygame.framework.core.YGL_Configuration

getMaxVaryingVectors()
: ygame.framework.core.YGL_Configuration

getMaxVertexAttribs()
: ygame.framework.core.YGL_Configuration

getMaxVertexTextureImageUnits()
: ygame.framework.core.YGL_Configuration

getMaxVertexUniformVectors()
: ygame.framework.core.YGL_Configuration

getMaxViewportHeight()
: ygame.framework.core.YGL_Configuration

getMaxViewportWidth()
: ygame.framework.core.YGL_Configuration

getMinAliasedLineWidth()
: ygame.framework.core.YGL_Configuration

getMinAliasedPointSize()
: ygame.framework.core.YGL_Configuration

getNormalDataSource()
: ygame.skeleton.YSkeleton

getParametersAdapter()
: ygame.domain.YDomain

getPositionDataSource()
: ygame.skeleton.YSkeleton

getProjectMatrix()
: ygame.framework.core.YCamera

getShaft()
: ygame.framework.core.YCamera
, ygame.transformable.YIMoverGetter
, ygame.transformable.YMover

getStringFromAssets()
: ygame.utils.YTextFileUtils

getStringFromResRaw()
: ygame.utils.YTextFileUtils

getTexCoordDataSource()
: ygame.skeleton.YSkeleton

getTexture()
: ygame.framebuffer.YFrameBuffer

getTo()
: ygame.state_machine.impl.Transition< S, R, C >

getUniform()
: ygame.program.YAShaderProgram

getVertexNum()
: ygame.skeleton.YSkeleton

getViewMatrix()
: ygame.framework.core.YCamera

getWidth()
: ygame.texture.YTexture

getX()
: ygame.framework.core.YCamera
, ygame.transformable.YIMoverGetter
, ygame.transformable.YMover

getY()
: ygame.framework.core.YCamera
, ygame.transformable.YIMoverGetter
, ygame.transformable.YMover

getZ()
: ygame.framework.core.YCamera
, ygame.transformable.YIMoverGetter
, ygame.transformable.YMover

GLThreadName
: ygame.framework.core.YSystem

GRID_HEIGHT
: ygame.texture.YTileSheet

GRID_WIDTH
: ygame.texture.YTileSheet

<address class="footer">
生成于 2014年 十一月 11日 星期二 22:24:03 , 为 YGameFrame使用

 1.8.8
</address>


text:
using System.Web.Mvc;
using DI06.CustomFilters;
using DI06.Services.Contracts;

namespace DI06.Controllers
{
    public class MyBaseController : Controller
    {
        /// <summary>
        /// from http://forums.asp.net/t/1776480.aspx/1?ExecuteCore+in+base+class+not+fired+in+MVC+4+beta
        /// </summary>
        protected override bool DisableAsyncSupport
        {
            get { return true; }
        }

        protected override void ExecuteCore()
        {
            base.ExecuteCore();
        }
    }

    public class HomeController : MyBaseController
    {
        readonly IWebClientServices _webClientServices;
        public HomeController(IWebClientServices webClientServices)
        {
            _webClientServices = webClientServices;
        }

        //[Log]
        public ActionResult Index()
        {
            // ViewBag.PageTitle = _webClientServices.GetWebPageTitle("http://www.dotnettips.info/");
            return View();
        }
    }
}


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
    value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _tokens = require('./tokens');

var _tokens2 = _interopRequireDefault(_tokens);

var _Location = require('./Location');

var _Location2 = _interopRequireDefault(_Location);

const BEGIN_EXPRESSION = '${';
const END_EXPRESSION = '}';
const BEGIN_JAVASCRIPT = '<%';
const END_JAVASCRIPT = '%>';
const BEGIN_COMMENT = '</*';
const END_COMMENT = '*/>';
const BEGIN_BLOCK = '<[';
const END_BLOCK = ']>';
const BEGIN_DOCUMENT = '<:';
const END_DOCUMENT = ':>';
const BEGIN_BLOCK_REFERENCE = '<*';
const END_BLOCK_REFERENCE = '*>';
const BEGIN_LAYOUT = '<!';
const END_LAYOUT = '!>';
const BEGIN_PARTIAL = '<(';
const END_PARTIAL = ')>';

function regex() {
    for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
        values[_key] = arguments[_key];
    }

    return new RegExp(values.map(x => _lodash2.default.escapeRegExp(x)).join('|'), 'g');
}

const rootContextRegex = regex(BEGIN_EXPRESSION, BEGIN_JAVASCRIPT, BEGIN_COMMENT, BEGIN_BLOCK_REFERENCE, BEGIN_PARTIAL, BEGIN_BLOCK, BEGIN_LAYOUT);

const documentContextRegex = regex(END_DOCUMENT, BEGIN_EXPRESSION, BEGIN_JAVASCRIPT, BEGIN_COMMENT, BEGIN_BLOCK_REFERENCE, BEGIN_PARTIAL);

const javascriptContextRegex = regex(END_JAVASCRIPT, BEGIN_COMMENT, BEGIN_DOCUMENT);

const commentContextRegex = regex(BEGIN_COMMENT, END_COMMENT);

class Lexer {
    constructor(text, filename) {
        this.text = text;
        this.index = 0;
        this.lineIndex = 0;
        this.line = 1;
        this.filename = filename;
    }

    currentLocation() {
        return new _Location2.default(this.filename, this.line, this.index - this.lineIndex + 1);
    }

    moveForward(toIndex, str) {
        str = str || this.text.substring(this.index, toIndex);
        const re = /[\n\v\f\r\x85\u2028\u2029]/g;
        let match;
        while (match = re.exec(str)) {
            ++this.line;
            this.lineIndex = re.lastIndex;
        }
        this.index = toIndex;
    }

    // TODO: Remove token values that aren't actually used (.end, etc).
    getToken(newIndex, token, matchIndex) {
        if (this.index === matchIndex) {
            switch (token) {
                case _tokens2.default.DOCUMENT:
                    this.index = newIndex;
                    return null;
                case _tokens2.default.BLOCK_REFERENCE:
                    break;
                default:
                    throw new Error(token + ' tag cannot be empty.');
            }
        }

        const result = {
            token: token,
            value: this.text.substring(this.index, matchIndex),
            begin: this.currentLocation()
        };
        this.moveForward(newIndex, result.value);
        result.end = this.currentLocation();
        return result;
    }

    *comment() {
        const openLocation = this.currentLocation();
        this.index += BEGIN_COMMENT.length;
        commentContextRegex.lastIndex = this.index;
        while (true) {
            const match = commentContextRegex.exec(this.text);
            if (match === null) {
                throw new Error('Comment tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_COMMENT);
            }
            this.moveForward(commentContextRegex.lastIndex);
            if (match[0] === END_COMMENT) {
                return;
            } else if (match[0] === BEGIN_COMMENT) {
                yield* this.comment();
                commentContextRegex.lastIndex = this.index;
            } else {
                throw new Error("Internal error.");
            }
        }
    }

    *javascript() {
        const openLocation = this.currentLocation();
        javascriptContextRegex.lastIndex = this.index;
        while (true) {
            const match = javascriptContextRegex.exec(this.text);
            if (match === null) {
                throw new Error('Javascript tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_JAVASCRIPT);
            }
            yield this.getToken(javascriptContextRegex.lastIndex, _tokens2.default.JAVASCRIPT, match.index);
            if (match[0] === END_JAVASCRIPT) {
                return;
            }
            if (match[0] === BEGIN_COMMENT) {
                yield* this.comment();
                javascriptContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_DOCUMENT) {
                yield* this.document();
                javascriptContextRegex.lastIndex = this.index;
            } else {
                throw new Error("Internal error.");
            }
        }
    }

    *expression() {
        const openLocation = this.currentLocation();
        const matchIndex = this.text.indexOf(END_EXPRESSION, this.index);
        if (matchIndex === -1) {
            throw new Error('Expression tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_EXPRESSION);
        }
        yield this.getToken(matchIndex + END_EXPRESSION.length, _tokens2.default.EXPRESSION, matchIndex);
    }

    *layout() {
        const openLocation = this.currentLocation();
        const matchIndex = this.text.indexOf(END_LAYOUT, this.index);
        if (matchIndex === -1) {
            throw new Error('Layout tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_LAYOUT);
        }
        yield this.getToken(matchIndex + END_LAYOUT.length, _tokens2.default.LAYOUT, matchIndex);
    }

    *blockReference() {
        const openLocation = this.currentLocation();
        const matchIndex = this.text.indexOf(END_BLOCK_REFERENCE, this.index);
        if (matchIndex === -1) {
            throw new Error('Block Reference tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_BLOCK_REFERENCE);
        }
        yield this.getToken(matchIndex + END_BLOCK_REFERENCE.length, _tokens2.default.BLOCK_REFERENCE, matchIndex);
    }

    *partial() {
        const openLocation = this.currentLocation();
        const matchIndex = this.text.indexOf(END_PARTIAL, this.index);
        if (matchIndex === -1) {
            throw new Error('Partial tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_PARTIAL);
        }
        yield this.getToken(matchIndex + END_PARTIAL.length, _tokens2.default.PARTIAL, matchIndex);
    }

    *block() {
        const openLocation = this.currentLocation();

        let matchIndex = this.text.indexOf(BEGIN_DOCUMENT, this.index);
        if (matchIndex === -1) {
            throw new Error('Block tag opened at ' + openLocation.locationString() + ' missing opening document tag ' + BEGIN_DOCUMENT);
        }
        yield this.getToken(matchIndex + BEGIN_DOCUMENT.length, _tokens2.default.BLOCK_NAME, matchIndex);

        yield* this.document();

        matchIndex = this.text.indexOf(END_BLOCK, this.index);
        if (matchIndex === -1) {
            throw new Error('Block tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_BLOCK);
        }
        this.moveForward(matchIndex + END_BLOCK.length);
    }

    *document() {
        const openLocation = this.currentLocation();
        documentContextRegex.lastIndex = this.index;
        while (true) {
            const match = documentContextRegex.exec(this.text);
            if (match === null) {
                throw new Error('Document tag opened at ' + openLocation.locationString() + ' missing closing tag ' + END_DOCUMENT);
            }
            yield this.getToken(documentContextRegex.lastIndex, _tokens2.default.DOCUMENT, match.index);
            if (match[0] === END_DOCUMENT) {
                return;
            }
            if (match[0] === BEGIN_EXPRESSION) {
                yield* this.expression();
                documentContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_JAVASCRIPT) {
                yield* this.javascript();
                documentContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_COMMENT) {
                yield* this.comment();
                documentContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_BLOCK_REFERENCE) {
                yield* this.blockReference();
                documentContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_PARTIAL) {
                yield* this.partial();
                rootContextRegex.lastIndex = this.index;
            } else {
                throw new Error("Internal error.");
            }
        }
    }

    *root() {
        rootContextRegex.lastIndex = this.index;
        while (true) {
            const match = rootContextRegex.exec(this.text);
            if (match === null) {
                yield this.getToken(this.text.length, _tokens2.default.DOCUMENT, this.text.length);
                return;
            }
            yield this.getToken(rootContextRegex.lastIndex, _tokens2.default.DOCUMENT, match.index);
            if (match[0] === BEGIN_EXPRESSION) {
                yield* this.expression();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_JAVASCRIPT) {
                yield* this.javascript();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_COMMENT) {
                yield* this.comment();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_BLOCK) {
                yield* this.block();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_BLOCK_REFERENCE) {
                yield* this.blockReference();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_PARTIAL) {
                yield* this.partial();
                rootContextRegex.lastIndex = this.index;
            } else if (match[0] === BEGIN_LAYOUT) {
                yield* this.layout();
                rootContextRegex.lastIndex = this.index;
            } else {
                throw new Error("Internal error.");
            }
        }
    }

    *lex() {
        try {
            for (let token of this.root()) {
                if (token !== null) {
                    yield token;
                }
            }
        } catch (err) {
            err.message = this.currentLocation() + ': ' + err.message;
            throw err;
        }
    }
}

exports.default = Lexer;
module.exports = exports.default;
//# sourceMappingURL=Lexer.js.map


text:
registerPlugin({
  install: function(less, pluginManager, functions) {
    functions.add('run', function() {
      if (typeof pluginManager.webpackLoaderContext !== 'undefined') {
        return 'true';
      }

      return 'false';
    });
  }
})


text:
package org.seasar.doma.internal.jdbc.command;

import java.util.function.Supplier;

import org.seasar.doma.internal.jdbc.scalar.Scalar;

/**
 * @author taedium
 * @param <BASIC>
 *            基本型
 * @param <CONTAINER>
 *            基本型のコンテナ
 *
 */
public class ScalarSingleResultHandler<BASIC, CONTAINER> extends
        AbstractSingleResultHandler<CONTAINER> {

    public ScalarSingleResultHandler(Supplier<Scalar<BASIC, CONTAINER>> supplier) {
        super(new ScalarIterationHandler<>(supplier,
                new SingleResultCallback<CONTAINER>(() -> supplier.get()
                        .getDefault())));
    }
}


text:
using System;
using System.Linq;

namespace Telerik.JustMock.Setup
{
	///
	/// Used to disable the automatic generation of calls to Mock.Reset() in test methods by the profiler.
	///
	/// <remarks>
	/// When the JustMock profiler is enabled, it is quite necessary to call Mock.Reset() at the end of
	/// every test method that does mocking or calls other methods that do mocking. This way you'll be
	/// sure that no state leaks from test to test and your tests always run at top speed.
	///
	/// The JustMock profiler automatically adds calls to Mock.Reset() to the end of every test method
	/// that is in an assembly that has a reference to the Telerik.JustMock assembly. If your test method looks like
	///
	/// [Test]
	/// public void MyTest()
	/// {
	///     ... // body of test
	/// }
	///
	/// ...then the profiler wraps it in a try/finally block like so:
	///
	/// [Test]
	/// public void MyTest()
	/// {
	///     try {
	///         ... // body of test
	///     } finally {
	///         Mock.Reset();
	///     }
	/// }
	///
	/// ...thus ensuring that Mock.Reset() is called at the end of every test method without any
	/// burden imposed on the test author.
	///
	/// Sometimes this try/finally block gets in your way though. For example, try/catch/finally
	/// blocks change the lifetime of objects in such a way that objects referenced only by WeakReferences
	/// will not be collected in the scope they're handled if you call GC.Collect() in that same scope.
	///
	/// Whenever you have a test that passes with the JustMock profiler disabled, but fails when the profiler
	/// is enabled, *and* you don't use mocking in that test, the issue may be resolved by decorating your
	/// test with this attribute.
	/// </remarks>
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	public sealed class DisableAutomaticRepositoryResetAttribute : Attribute
	{
		///
		/// Allow the use of the mocking API inside this method. You must explicitly call
		/// Mock.Reset() at the end of your test method.
		///
		public bool AllowMocking { get; set; }
	}
}


text:
package com.enioka.jqm.jdbc;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.enioka.jqm.model.JobInstance;
import com.enioka.jqm.model.Node;
import com.enioka.jqm.model.Queue;

/**
 * The interface to implement to create a new database adapter. Adapters contain all the database-specific stuff for running JQM on a
 * specific database brand.

 *

 * All implementations must have a no-argument constructor.
 *
 */
public abstract class DbAdapter
{
    private static Logger jqmlogger = LoggerFactory.getLogger(DbAdapter.class);

    protected String[] IDS = new String[] { "ID" };

    /**
     * Query cache.
     */
    protected Map<String, String> queries = new HashMap<String, String>();

    /**
     * Prefix to use for all tables and views.
     */
    protected String tablePrefix = null;

    /**
     * Tests if the adapter is compatible with a given database. When in doubt, answer no.
     *
     * @param product
     *                    the product code (from Connection.getMetaData().getDatabaseProductName()) in lower case.
     * @return true if compatible, false otherwise.
     */
    public abstract boolean compatibleWith(DatabaseMetaData product) throws SQLException;

    /**
     * Adapt the given query template to enable it to run on the target database. This is only called on startup, and the results are
     * cached.
     *
     * @param sql
     *                the SQL query (full text, no terminator).
     * @return a ready to use query.
     */
    public abstract String adaptSql(String sql);

    /**
     * The name of the columns to retrieve for getGeneratedKeys calls. (some dbs want uppercase, other lowercase).
     *
     * @return the list of id columns.
     */
    public String[] keyRetrievalColumn()
    {
        return IDS;
    }

    /**
     * A list of files to run (from the classpath) before running schema upgrades. Default is empty.
     */
    public List<String> preSchemaCreationScripts()
    {
        return new ArrayList<String>();
    }

    /**
     * Hook run before creating a new update Statement.
     *
     * @param cnx
     *                an open and ready to use connection to the database. Please return it without any open statement/result set.
     * @param q
     *                the query which will be run. Can be modified by this method.
     * @return a generated ID or null;
     */
    public void beforeUpdate(Connection cnx, QueryPreparation q)
    {
    }

    /**
     * Called after creating the first connection. The adapter should create its caches and do all initialization it requires. Most
     * importantly, the SQL query cache should be created.
     *
     * @param cnx
     *                an open ready to use connection to the database.
     */
    public void prepare(Properties p, Connection cnx)
    {
        this.tablePrefix = p.getProperty("com.enioka.jqm.jdbc.tablePrefix", "");
        queries.putAll(DbImplBase.queries);
        for (Map.Entry<String, String> entry : DbImplBase.queries.entrySet())
        {
            queries.put(entry.getKey(), this.adaptSql(entry.getValue()));
        }
    }

    /**
     * Returns a ready to run SQL text for the given key. (adaptSql does not need to be run on the returned string)
     *
     * @param key
     *                key of the SQL order
     * @return full text to run on the database. Null if key not found.
     */
    public String getSqlText(String key)
    {
        return queries.get(key);
    }

    /**
     * Databases all have different issues when settings null parameters.
     *
     * @param position
     *                     in the statement (sql parameters).
     * @param s
     *                     statement being built.
     */
    public abstract void setNullParameter(int position, PreparedStatement s) throws SQLException;

    /**
     * Adds pagination elements to a query.
     *
     * @param sql
     *                       the full SQL text
     * @param start
     *                       the first included row (start of page). First row is zero, not one.
     * @param stopBefore
     *                       the first excluded row (end of page)
     * @param prms
     *                       the bind variables values. Can be modified.
     * @return the ready to use SQL query for this database.
     */
    public abstract String paginateQuery(String sql, int start, int stopBefore, List<Object> prms);

    /**
     * The polling method. Creating "queues" on the different databases can be extremely different in the different supported RDBMS, so this
     * method allows to fully change the polling method.

     *

     * Default implementation uses the ji_select_poll SQL template query and does retrieve the whole queue without using headSize, so is a
     * performance waste.
     *
     * @param cnx
     *                     a session without active TX.
     * @param queue
     *                     the queue being polled
     * @param headSize
     *                     upper estimate of how many slots are available - i.e. max JI which can be taken from the queue.
     * @return a list of JI, or an empty list. Never null.
     */
    public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize)
    {
        return JobInstance.select(cnx, "ji_select_poll", queue.getId());
    }
}


text:
package nl.nn.adapterframework.extensions.sap.jco3;

import nl.nn.adapterframework.configuration.ConfigurationWarning;

@Deprecated
@ConfigurationWarning("Please do not specify jco version in package name")
public class SapListener extends SapListenerImpl {
}


text:
<?php

/*
 * This file is part of the RollerworksDatagrid package.
 *
 * (c) Sebastiaan Stok <s.stok@rollerscapes.net>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Rollerworks\Component\Datagrid\Column;

use Rollerworks\Component\Datagrid\DatagridExtensionInterface;
use Rollerworks\Component\Datagrid\Exception\ExceptionInterface;
use Rollerworks\Component\Datagrid\Exception\InvalidArgumentException;
use Rollerworks\Component\Datagrid\Exception\UnexpectedTypeException;

/**
 * @author Sebastiaan Stok <s.stok@rollerscapes.net>
 */
class ColumnTypeRegistry implements ColumnTypeRegistryInterface
{
    /**
     * Extensions.
     *
     * @var DatagridExtensionInterface[] An array of FormExtensionInterface
     */
    private $extensions = [];

    /**
     * @var array
     */
    private $types = [];

    /**
     * @var ResolvedColumnTypeFactoryInterface
     */
    private $resolvedTypeFactory;

    /**
     * Constructor.
     *
     * @param DatagridExtensionInterface[]       $extensions          An array of DatagridExtensionInterface
     * @param ResolvedColumnTypeFactoryInterface $resolvedTypeFactory The factory for resolved form types.
     *
     * @throws UnexpectedTypeException if an extension does not implement DatagridExtensionInterface
     */
    public function __construct(array $extensions, ResolvedColumnTypeFactoryInterface $resolvedTypeFactory)
    {
        foreach ($extensions as $extension) {
            if (!$extension instanceof DatagridExtensionInterface) {
                throw new UnexpectedTypeException($extension, 'Rollerworks\Component\Datagrid\DatagridExtensionInterface');
            }
        }

        $this->extensions = $extensions;
        $this->resolvedTypeFactory = $resolvedTypeFactory;
    }

    /**
     * {@inheritDoc}
     */
    public function getType($name)
    {
        if (!is_string($name)) {
            throw new UnexpectedTypeException($name, 'string');
        }

        if (!isset($this->types[$name])) {
            /** @var ColumnTypeInterface $type */
            $type = null;

            foreach ($this->extensions as $extension) {
                /* @var DatagridExtensionInterface $extension */
                if ($extension->hasColumnType($name)) {
                    $type = $extension->getColumnType($name);
                    break;
                }
            }

            if (!$type) {
                throw new InvalidArgumentException(sprintf('Could not load column type "%s".', $name));
            }

            $this->resolveAndAddType($type);
        }

        return $this->types[$name];
    }

    /**
     * {@inheritDoc}
     */
    public function hasType($name)
    {
        if (isset($this->types[$name])) {
            return true;
        }

        try {
            $this->getType($name);
        } catch (ExceptionInterface $e) {
            return false;
        }

        return true;
    }

    /**
     * {@inheritDoc}
     */
    public function getExtensions()
    {
        return $this->extensions;
    }

    /**
     * Wraps a type into a ResolvedFormTypeInterface implementation and connects
     * it with its parent type.
     *
     * @param ColumnTypeInterface $type The type to resolve.
     *
     * @return ResolvedColumnTypeInterface The resolved type.
     */
    private function resolveAndAddType(ColumnTypeInterface $type)
    {
        $parentType = $type->getParent();

        if ($parentType instanceof ColumnTypeInterface) {
            $this->resolveAndAddType($parentType);
            $parentType = $parentType->getName();
        }

        $typeExtensions = [];

        foreach ($this->extensions as $extension) {
            /* @var DatagridExtensionInterface $extension */

            if ($extension->hasColumnTypeExtensions($type->getName())) {
                $typeExtensions = array_merge(
                    $typeExtensions, $extension->getColumnTypeExtensions($type->getName())
                );
            }
        }

        $this->types[$type->getName()] = $this->resolvedTypeFactory->createResolvedType(
            $type, $typeExtensions, $parentType ? $this->getType($parentType) : null
        );
    }
}


text:
package com.google.cloud.dataflow.sdk.testing;

import static org.junit.Assert.assertThat;

import com.google.cloud.dataflow.sdk.coders.AtomicCoder;
import com.google.cloud.dataflow.sdk.coders.CoderException;
import com.google.cloud.dataflow.sdk.transforms.windowing.BoundedWindow;
import com.google.cloud.dataflow.sdk.transforms.windowing.IntervalWindow;
import com.google.cloud.dataflow.sdk.util.SerializableUtils;
import com.google.common.collect.ImmutableList;

import org.hamcrest.Matchers;
import org.joda.time.Instant;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collections;

/**
 * Tests for {@link WindowSupplier}.
 */
@RunWith(JUnit4.class)
public class WindowSupplierTest {
  private final IntervalWindow window = new IntervalWindow(new Instant(0L), new Instant(100L));
  private final IntervalWindow otherWindow =
      new IntervalWindow(new Instant(-100L), new Instant(100L));
  @Rule public ExpectedException thrown = ExpectedException.none();

  @Test
  public void getReturnsProvidedWindows() {
    assertThat(
        WindowSupplier.of(IntervalWindow.getCoder(), ImmutableList.of(window, otherWindow)).get(),
        Matchers.<BoundedWindow>containsInAnyOrder(otherWindow, window));
  }

  @Test
  public void getAfterSerialization() {
    WindowSupplier supplier =
        WindowSupplier.of(IntervalWindow.getCoder(), ImmutableList.of(window, otherWindow));
    assertThat(
        SerializableUtils.clone(supplier).get(),
        Matchers.<BoundedWindow>containsInAnyOrder(otherWindow, window));
  }

  @Test
  public void unencodableWindowFails() {
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Could not encode");
    WindowSupplier.of(
        new FailingCoder(),
        Collections.<BoundedWindow>singleton(window));
  }

  private static class FailingCoder extends AtomicCoder<BoundedWindow> {
    @Override
    public void encode(
        BoundedWindow value, OutputStream outStream, Context context)
        throws CoderException, IOException {
      throw new CoderException("Test Enccode Exception");
    }

    @Override
    public BoundedWindow decode(
        InputStream inStream, Context context) throws CoderException, IOException {
      throw new CoderException("Test Decode Exception");
    }
  }
}


text:
package com.dozenx.game.engine.ui.head.view;

import cola.machine.game.myblocks.lifething.bean.LivingThing;
import cola.machine.game.myblocks.manager.TextureManager;
import cola.machine.game.myblocks.model.ui.html.*;

import javax.vecmath.Vector4f;

/**
 * A simple login panel
 *
 * @author Matthias Mann
 */
public class HeadPanel extends HtmlObject {

    LivingThing livingThing;
    //final HeadPanel headPanel;

    boolean quit;
    Div bloodBar = new Div();
    Div blueBar = new Div();

    public HeadPanel(/*LivingThing livingThing*/) {
    /*this.livingThing=livingThing;*/
    //ProgressBar pro =new ProgressBar();
        //headPanel = new HeadPanel();//10行5列
        //CoreRegistry.put(HeadPanel.class,this);
       // this.position=HtmlObject.POSITION_ABSOLUTE;
        this.setId("headPanel");
        this.setMarginTop((short)10);
        this.setMarginLeft((short)30);
        this.setBorderWidth(2);
        this.setBorderColor(new Vector4f(1,1,1,1));

        Div headImg =new Div();
        headImg.setWidth(40);
        headImg.setHeight(40);
        headImg.setBackgroundImage(new Image(TextureManager.getTextureInfo("human_head_front")));

        this.appendChild(headImg);

        Div leftDiv =new Div();
        leftDiv.setDisplay(HtmlObject.INLINE);
        leftDiv.setWidth(100);

        bloodBar.setHeight(5);
        bloodBar.setId("bloodBar");
        bloodBar.setWidth(100);
        //bloodBar.setBackgroundImage(new Image(TextureManager.getTextureInfo("human_head_front")));
        bloodBar.setBorderColor(new Vector4f(1,1,1,1));
        bloodBar.setBackgroundColor(new Vector4f(1,0,0,1));
        leftDiv.appendChild(bloodBar);

        leftDiv.appendChild(new Br());

        blueBar.setHeight(20);
        blueBar.setBorderWidth(1);
        blueBar.setBorderColor(new Vector4f(0, 0, 1, 1));
        blueBar.setWidth(100);
        blueBar.setBackgroundColor(new Vector4f(0,0,1,1));
        leftDiv.appendChild(blueBar);

        appendChild(leftDiv);
        //Div bloodColorDiv = new Div();
       // setTitle("head");//整个包裹的标题
        //setResizableAxis(ResizableAxis.NONE);//是否可以调整大小
        //add(headPanel);//添加panel
       // pro.setTheme("progressbar");
       // add(pro);
        //setMinSize(200,40);

       // setPosition(0,0);
    }
    @Override
    public void update(){

        if(livingThing!=null){

            int width_= 100*livingThing.nowHP/livingThing.HP;
            if(width_ ==0)width_=1;
            this.bloodBar.setWidth(width_);
            this.bloodBar.innerText = livingThing.nowHP+"/"+livingThing.HP;
            this.blueBar.setWidth(100*livingThing.nowMP/livingThing.MP);
            super.update();
        }else{
            this.setVisible(false);
        }

    }
    public HeadPanel bind(LivingThing livingThing){
        this.livingThing=livingThing;
        this.bloodBar.setWidth(100*livingThing.nowHP/livingThing.HP);
        this.bloodBar.innerText = livingThing.nowHP+"/"+livingThing.HP;
        this.blueBar.setWidth(100*livingThing.nowMP/livingThing.MP);
        Document.needUpdate=true;
        return this;
    }
    public void show(){
        this.setVisible(true);
    }

}


text:
<resources>
    <string name="app_name">couchdb</string>
</resources>


text:
package example.full.clients;

import core.broker.MessageBrokerWrapper;
import core.client.Client;
import core.message.AtomisException;
import core.message.MessagePayload;
import example.full.messages.*;
import example.full.module.FibonacciModule;

import java.util.List;
import java.util.function.Consumer;

/**
 * Created by siberis on 10/27/2016.
 */
public class FibonacciClient implements Client {

    private int lastResult;
    private List<Integer> lastResults;
    private int clientId;
    private Consumer callback = null;

    public FibonacciClient(int clientId, Consumer r) {
        this.clientId = clientId;
        callback = r;
    }

    public int getClientId() {
        return clientId;
    }

    @Override
    public <T extends MessagePayload> void receiveMessage(T payload, String targetTopic, int stateId) {
        if (payload instanceof ComputeFibonacciResult) {
            lastResult = ((ComputeFibonacciResult) payload).getResult();
            if (callback != null) {
                callback.accept(lastResult);
            }
        } else if (payload instanceof ComputeFibonacciListResult) {
            lastResults = ((ComputeFibonacciListResult) payload).getNumbers();
            if (callback != null) {
                callback.accept(lastResults);
            }
        } else if (payload instanceof ComputeFibonacciSumResult) {
            lastResults = ((ComputeFibonacciSumResult) payload).getNumbers();
            if (callback != null) {
                callback.accept(lastResults);
            }
        }
    }

    public List<Integer> getLastResults() {
        return lastResults;
    }

    public int getLastResult() {
        return lastResult;
    }

    public void requestCompute(int number) {
        ComputeFibonacci req = new ComputeFibonacci(number);
        MessageBrokerWrapper.sendRequest(this, req);
    }

    public void requestCollection(List<Integer> numbers) {
        ComputeFibonacciList req = new ComputeFibonacciList(numbers);
        MessageBrokerWrapper.sendRequest(this, req);
    }

    public void requestSumCollection(List<Integer> numbers) {
        ComputeFibonacciSum req = new ComputeFibonacciSum(numbers);
        MessageBrokerWrapper.sendRequest(this, req);
    }

    @Override
    public void receiveUnknownMessage(Long typeId, String rawPayload, String targetTopic, int stateId) {
        System.out.println("Unknown message received : (id:" + typeId + ",value:" + rawPayload + ")");
    }

    @Override
    public void handleException(AtomisException e, String targetTopic, int stateId) {

    }

    @Override
    public Long getServiceId() {
        return FibonacciModule.FIBONACCICLIENT_ID;
    }
}


text:
using uWebshop.Domain.Interfaces;
using umbraco.NodeFactory;
using System.Linq;

namespace uWebshop.Umbraco.Repositories
{
	public class UmbracoNodePropertyProvider : IPropertyProvider
	{
		private readonly Node _node;

		public UmbracoNodePropertyProvider(Node node)
		{
			_node = node;
		}

		public bool ContainsKey(string property)
		{
			property = property.ToLowerInvariant();
			// todo: check efficiency
			return _node.PropertiesAsList.Any(p => p.Alias.ToLowerInvariant() == property);
		}

		public bool UpdateValueIfPropertyPresent(string property, ref string value)
		{
			property = property.ToLowerInvariant();
			// todo: check efficiency
			var prop = _node.PropertiesAsList.FirstOrDefault(p => p.Alias.ToLowerInvariant() == property);
			if (prop != null)
			{
				value = prop.Value;
				return true;
			}
			return false;
		}

		public string GetStringValue(string property)
		{
			property = property.ToLowerInvariant();
			// todo: check efficiency
			var prop = _node.PropertiesAsList.FirstOrDefault(p => p.Alias.ToLowerInvariant() == property);
			return prop != null ? prop.Value : null;
		}
	}
}


text:
package aog.sample;

import java.util.ArrayList;

public class Sample {
	public ArrayList<PatternInstance> elements = new ArrayList<>();

	// summation at or nodes for the probability

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[");
		for (PatternInstance e : elements) {
			sb.append(e + " ");
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append("]");
		return sb.toString();
	}

}


text:
package org.cdlib.xtf.util;

/** A simple implementation of the Linkable interface. */
public class LinkableImpl implements Linkable
{
  /** Pointer to the next link in the chain */
  private Linkable nextLink;

  /** Pointer to the previous link in the chain */
  private Linkable prevLink;

  /** The list that owns this item */
  private EmbeddedList owner;

  public Linkable getNext() {
    return nextLink;
  }

  public Linkable getPrev() {
    return prevLink;
  }

  public EmbeddedList getOwner() {
    return owner;
  }

  public void setNext(Linkable l) {
    nextLink = l;
  }

  public void setPrev(Linkable l) {
    prevLink = l;
  }

  public void setOwner(EmbeddedList o) {
    owner = o;
  }
} // class LinkableImpl


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Tweaker.Core
{
	public class InvokableEvent : BaseInvokable
	{
		private readonly FieldInfo fieldInfo;

		private string methodSignature;
		public override string MethodSignature
		{
			get { return methodSignature; }
		}

		public FieldInfo FieldInfo
		{
			get { return fieldInfo; }
		}

		public InvokableEvent(InvokableInfo info, EventInfo eventInfo, FieldInfo fieldInfo, WeakReference instance)
			: base(info, fieldInfo.ReflectedType.Assembly, instance, fieldInfo.IsPublic)
		{
			this.fieldInfo = fieldInfo;
			methodSignature = "[Unknown]";

			var invokeMethod = eventInfo.EventHandlerType.GetMethod("Invoke");
			SetParameters(invokeMethod.GetParameters());
			methodSignature = invokeMethod.GetSignature();
		}

		private MulticastDelegate GetEventDelegate()
		{
			MulticastDelegate eventDelegate = null;
			var value = fieldInfo.GetValue(StrongInstance);
			// value will be null if no listeners added.
			if (value != null)
			{
				eventDelegate = (MulticastDelegate)value;
				if (eventDelegate == null)
				{
					throw new Exception("Could not retrieve the event delegate for invokable '" + Name + "'.");
				}
			}
			return eventDelegate;
		}

		protected override object DoInvoke(object[] args)
		{
			object ret = default(object);
			MulticastDelegate eventDelegate = GetEventDelegate();
			if (eventDelegate != null)
			{
				foreach (var handler in eventDelegate.GetInvocationList())
				{
					ret = handler.Method.Invoke(handler.Target, args);
				}
			}
			return ret;
		}
	}
}


text:
#ifndef LIBPSEC_CRYPT_OTP_GENERIC_H
#define LIBPSEC_CRYPT_OTP_GENERIC_H

#include <stdio.h>

/* Prototypes */
unsigned char *otp_encrypt(
	unsigned char *out,
	size_t *out_len,
	const unsigned char *in,
	size_t in_len,
	const unsigned char *nonce,
	const unsigned char *key);
unsigned char *otp_decrypt(
	unsigned char *out,
	size_t *out_len,
	const unsigned char *in,
	size_t in_len,
	const unsigned char *nonce,
	const unsigned char *key);

#endif


text:
package com.cineplex.dao;

import com.cineplex.entity.MemberCard;

/**
 * DAO interface of member card entity
 * @author Andy 1993sj19993@gmail.com
 * @date 2015年2月6日 下午8:39:42
 *
 */

public interface MemberCardDao extends BaseDao<MemberCard> {
	/**
	 * find member card info by its own's id
	 * @param  id
	 * @return MemberCard:
	 * @throws
	 */
	public MemberCard findByMemberId(int id);

	/**
	 * get count of member cards by their state
	 * @param state
	 * @return int:
	 * @throws
	 */
	public int getCountByState(char state);

}


text:
DROP INDEX IF EXISTS idx1;
-- end_ignore
CREATE INDEX idx1 on pt_lt_tab(col1,col2);
SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3 LIMIT 5;


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.camunda.bpm.container.impl.deployment;

import org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl;
import org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins;
import org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins;
import org.camunda.bpm.container.impl.spi.DeploymentOperation;
import org.camunda.bpm.container.impl.spi.DeploymentOperationStep;
import org.camunda.bpm.container.impl.spi.PlatformServiceContainer;
import org.camunda.bpm.container.impl.spi.ServiceTypes;
import org.camunda.bpm.engine.impl.util.ClassLoaderUtil;

/**
 * @author Thorben Lindhauer
 *
 */
public class DiscoverBpmPlatformPluginsStep extends DeploymentOperationStep {

  public String getName() {
    return "Discover BPM Platform Plugins";
  }

  public void performOperationStep(DeploymentOperation operationContext) {
    PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();

    BpmPlatformPlugins plugins = BpmPlatformPlugins.load(ClassLoaderUtil.getContextClassloader());

    JmxManagedBpmPlatformPlugins jmxManagedPlugins = new JmxManagedBpmPlatformPlugins(plugins);
    serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_PLATFORM_PLUGINS, jmxManagedPlugins);

  }

}


text:
function Test() {}

Test.prototype = Object.create(Foo.prototype);
Object.assign(Test.prototype, {
  constructor: Test
});


text:
This is a simple Piku app to demonstrate deploying a Postgres backed Django app.

During the `release` worker phase this app creates a Postgres database, as well as running the Django `collectstatic` and `migrate` tasks. The `release` worker will use the domain name (`NGINX_SERVER_NAME`) for the database name and the Django app assumes this in [settings.py](pikudjango/settings.py), so make sure you set the config variable to specify a domain name. See below for instructions.

In order for this to work you will first need to install `postgresql` on your Piku server. You can do this with the bootstrap script:

```shell
piku-bootstrap root@myserver.net postgres.yml
```

To publish this app to `piku`, make a copy of this folder and run the following commands inside the copy:

```bash
git init .
git remote add piku piku@your_server:pypostgres
git add .
git commit -a -m "initial commit"
git push piku master
```

Then you can connect a domain, set up an SSL cert, and create a database, by setting the `NGINX_SERVER_NAME` config variable.

```bash
piku config:set NGINX_SERVER_NAME=your_domain_name.com NGINX_HTTPS_ONLY=1
```

You can also create a super user and set a password like this:

```bash
piku run -- ./manage.py createsuperuser --email your@email.com --username admin --no-input
piku run -- ./manage.py changepassword admin
```

You will not see a prompt after the second command but you can type a new password anyway and hit enter.