text:
#include "El.hpp"
#include "El.h"

extern "C" {

ElError ElPrintVersion( FILE* stream )
{
    // There does not seem to be a portable means of converting C-style
    // filehandles to C++ filestreams, so we will simply reproduce the
    // functionality of El::PrintVersion.
    fprintf
    ( stream,
      "Elemental version information:\n"
      "  Git revision: %s\n"
      "  Version:      %s.%s\n"
      "  Build type:   %s\n\n",
      EL_GIT_SHA1, EL_VERSION_MAJOR, EL_VERSION_MINOR, EL_CMAKE_BUILD_TYPE );
    return EL_SUCCESS;
}

const char* ElErrorString( ElError error )
{
    if( error == EL_SUCCESS )
    {
        static const char* successString = "EL_SUCCESS";
        return successString;
    }
    else if( error == EL_ALLOC_ERROR )
    {
        static const char* allocString = "EL_ALLOC_ERROR";
        return allocString;
    }
    else if( error == EL_OUT_OF_BOUNDS_ERROR )
    {
        static const char* oobString = "EL_OUT_OF_BOUNDS_ERROR";
        return oobString;
    }
    else if( error == EL_ARG_ERROR )
    {
        static const char* argString = "EL_ARG_ERROR";
        return argString;
    }
    else if( error == EL_LOGIC_ERROR )
    {
        static const char* logicString = "EL_LOGIC_ERROR";
        return logicString;
    }
    else if( error == EL_RUNTIME_ERROR )
    {
        static const char* runtimeString = "EL_RUNTIME_ERROR";
        return runtimeString;
    }
    else
    {
        static const char* errString = "EL_ERROR";
        return errString;
    }
}

ElError ElPrintConfig( FILE* stream )
{
    // There does not seem to be a portable means of converting C-style
    // filehandles to C++ filestreams, so we will simply reproduce the
    // functionality of El::PrintConfig.
    fprintf
    ( stream,
      "Elemental configuration:\n"
      "  Math libraries:               %s\n"
#ifdef EL_HAVE_FLA_BSVD
      "  Have FLAME bidiagonal SVD:    YES\n"
#else
      "  Have FLAME bidiagonal SVD:    NO\n"
#endif
#ifdef EL_HYBRID
      "  Hybrid mode:                  YES\n"
#else
      "  Hybrid mode:                  NO\n"
#endif
#ifdef EL_HAVE_QT5
      "  Have Qt5:                     YES\n"
#else
      "  Have Qt5:                     NO\n"
#endif
#ifdef EL_AVOID_COMPLEX_MPI
      "  Avoiding complex MPI:         YES\n"
#else
      "  Avoiding complex MPI:         NO\n"
#endif
#ifdef EL_HAVE_MPI_REDUCE_SCATTER_BLOCK
      "  Have MPI_Reducescatter_block: YES\n"
#else
      "  Have MPI_Reducescatter_block: NO\n"
#endif
#ifdef EL_HAVE_MPI_IN_PLACE
      "  Have MPI_IN_PLACE:            YES\n"
#else
      "  Have MPI_IN_PLACE:            NO\n"
#endif
#ifdef EL_REDUCE_SCATTER_BLOCK_VIA_ALLREDUCE
      "  AllReduce ReduceScatterBlock: YES\n"
#else
      "  AllReduce ReduceScatterBlock: NO\n"
#endif
#ifdef EL_USE_BYTE_ALLGATHERS
      "  Use byte AllGathers:          YES\n",
#else
      "  Use byte AllGathers:          NO\n",
#endif
      EL_MATH_LIBS );
    return EL_SUCCESS;
}

ElError ElPrintCCompilerInfo( FILE* stream )
{
    // There does not seem to be a portable means of converting C-style
    // filehandles to C++ filestreams, so we will simply reproduce the
    // functionality of El::PrintCCompilerInfo.
    fprintf
    ( stream,
      "Elemental's C compiler info:\n"
      "  EL_CMAKE_C_COMPILER:    %s\n"
      "  EL_MPI_C_COMPILER:      %s\n"
      "  EL_MPI_C_INCLUDE_PATHS: %s\n"
      "  EL_MPI_C_COMPILE_FLAGS: %s\n"
      "  EL_MPI_LINK_FLAGS:      %s\n"
      "  EL_MPI_C_LIBRARIES:     %s\n",
      EL_CMAKE_C_COMPILER, EL_MPI_C_COMPILER, EL_MPI_C_INCLUDE_PATH,
      EL_MPI_C_COMPILE_FLAGS, EL_MPI_LINK_FLAGS, EL_MPI_C_LIBRARIES );
    return EL_SUCCESS;
}

ElError ElPrintCxxCompilerInfo( FILE* stream )
{
    // There does not seem to be a portable means of converting C-style
    // filehandles to C++ filestreams, so we will simply reproduce the
    // functionality of El::PrintCxxCompilerInfo.
    fprintf
    ( stream,
      "Elemental's C compiler info:\n"
      "  EL_CMAKE_CXX_COMPILER:    %s\n"
      "  EL_MPI_CXX_COMPILER:      %s\n"
      "  EL_MPI_CXX_INCLUDE_PATHS: %s\n"
      "  EL_MPI_CXX_COMPILE_FLAGS: %s\n"
      "  EL_MPI_LINK_FLAGS:        %s\n"
      "  EL_MPI_CXX_LIBRARIES:     %s\n",
      EL_CMAKE_CXX_COMPILER, EL_MPI_CXX_COMPILER, EL_MPI_CXX_INCLUDE_PATH,
      EL_MPI_CXX_COMPILE_FLAGS, EL_MPI_LINK_FLAGS, EL_MPI_CXX_LIBRARIES );
    return EL_SUCCESS;
}

ElError ElUsing64BitInt( bool* using64 )
{ EL_TRY( *using64 = El::Using64BitInt() ) }

ElError ElUsing64BitBlasInt( bool* using64 )
{ EL_TRY( *using64 = El::Using64BitBlasInt() ) }

ElError ElSizeOfBool( unsigned* boolSize )
{ EL_TRY( *boolSize = sizeof(bool); ) }

ElError ElInitialize( int* argc, char*** argv )
{ EL_TRY( El::Initialize( *argc, *argv ) ) }

ElError ElFinalize()
{ EL_TRY( El::Finalize() ) }

ElError ElInitialized( bool* initialized )
{ EL_TRY( *initialized = El::Initialized() ) }

ElError ElInput_b
( const char* name, const char* desc, bool defaultVal, bool* val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElInput_i
( const char* name, const char* desc, int defaultVal, int* val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElInput_I
( const char* name, const char* desc, ElInt defaultVal, ElInt* val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElInput_s
( const char* name, const char* desc, float defaultVal, float* val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElInput_d
( const char* name, const char* desc, double defaultVal, double* val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElInput_cstr
( const char* name, const char* desc, const char* defaultVal, const char** val )
{ EL_TRY( *val = El::Input(name,desc,defaultVal) ) }

ElError ElProcessInput()
{ EL_TRY( El::ProcessInput() ) }

ElError ElPrintInputReport()
{ EL_TRY( El::PrintInputReport() ) }

ElError ElBlocksize( ElInt* blocksize )
{ EL_TRY( *blocksize = El::Blocksize() ) }

ElError ElSetBlocksize( ElInt blocksize )
{ EL_TRY( El::SetBlocksize(blocksize) ) }

ElError ElPushBlocksizeStack( ElInt blocksize )
{ EL_TRY( El::PushBlocksizeStack(blocksize) ) }

ElError ElPopBlocksizeStack()
{ EL_TRY( El::PopBlocksizeStack() ) }

} // extern "C"

redpajama_set_name: RedPajamaGithub


text:
import asyncore
import socket
import string
import sys

def blurt (thing):
    sys.stdout.write (thing)
    sys.stdout.flush ()

total_sessions = 0

class http_client (asyncore.dispatcher_with_send):
    def __init__ (self, host='127.0.0.1', port=80, uri='/', num=10):
        asyncore.dispatcher_with_send.__init__ (self)
        self.create_socket (socket.AF_INET, socket.SOCK_STREAM)
        self.host = host
        self.port = port
        self.uri = uri
        self.num = num
        self.bytes = 0
        self.connect ((host, port))

    def log (self, *info):
        pass

    def handle_connect (self):
        self.connected = 1
#               blurt ('o')
        self.send ('GET %s HTTP/1.0\r\n\r\n' % self.uri)

    def handle_read (self):
#               blurt ('.')
        d = self.recv (8192)
        self.bytes = self.bytes + len(d)

    def handle_close (self):
        global total_sessions
#               blurt ('(%d)' % (self.bytes))
        self.close()
        total_sessions = total_sessions + 1
        if self.num:
            http_client (self.host, self.port, self.uri, self.num-1)

import time
class timer:
    def __init__ (self):
        self.start = time.time()
    def end (self):
        return time.time() - self.start

from asyncore import socket_map, poll

MAX = 0

def loop (timeout=30.0):
    global MAX
    while socket_map:
        if len(socket_map) > MAX:
            MAX = len(socket_map)
        poll (timeout)

if __name__ == '__main__':
    if len(sys.argv) < 6:
        print 'usage: %s <host> <port> <uri> <hits> <num_clients>' % sys.argv[0]
    else:
        [host, port, uri, hits, num] = sys.argv[1:]
        hits = string.atoi (hits)
        num = string.atoi (num)
        port = string.atoi (port)
        t = timer()
        clients = map (lambda x: http_client (host, port, uri, hits-1), range(num))
        #import profile
        #profile.run ('loop')
        loop()
        total_time = t.end()
        print (
                '\n%d clients\n%d hits/client\n'
                'total_hits:%d\n%.3f seconds\ntotal hits/sec:%.3f' % (
                        num,
                        hits,
                        total_sessions,
                        total_time,
                        total_sessions / total_time
                        )
                )
        print 'Max. number of concurrent sessions: %d' % (MAX)

# linux 2.x, talking to medusa
# 50 clients
# 1000 hits/client
# total_hits:50000
# 2255.858 seconds
# total hits/sec:22.165
# Max. number of concurrent sessions: 50


text:
package javolution.xml.stream;

import java.io.OutputStream;
import java.io.Writer;

import javolution.lang.Parallelizable;

/**
 *
 The OSGi factory service to create {@link XMLStreamWriter} instances.
 *     For each bundle, a distinct factory instance is returned and can be
 *     individually configured  (if not enough the factory can be
 *     {@link #clone cloned}).
 * [code]
 * import javolution.xml.stream.*;
 * public class Activator implements BundleActivator {
 *     public void start(BundleContext bc) throws Exception {
 *
 *         // Configures factory.
 *         ServiceTracker<XMLOutputFactory, XMLOutputFactory> tracker
 *             = new ServiceTracker<>(bc, XMLOutputFactory.class, null);
 *         tracker.open();
 *         tracker.getService().setProperty(XMLOutputFactory.INDENTATION, "/t"); // Use tab for indentations.
 *
 *         // Instantiates a new writer.
 *         TextBuilder xml = new TextBuilder();
 *         AppendableWriter out = new AppendableWriter(xml);
 *         XMLStreamWriter writer = tracker.getService().createXMLStreamWriter(out);
 *
 *         // Formats to XML.
 *         writer.writeStartDocument("1.0");
 *         writer.writeCharacters("\n");
 *         writer.writeStartElement("ns1", "sample", "http://www.e.com/ns1");
 *         writer.writeNamespace("ns1", "http://www.e.com/ns1");
 *         writer.writeEndElement();
 *         writer.writeEndDocument();
 *
 *         // Closes the writer which may be recycled back to the factory.
 *         writer.close();
 *
 *         // Displays the formatted output.
 *         System.out.println(xml);
 *     }
 *  [/code]

 *
 * @author  Jean-Marie Dautelle
 * @version 6.0 December 12, 2012
 */
@Parallelizable(comment="Factory configuration should be performed sequentially.")
public interface XMLOutputFactory extends Cloneable {

    /**
     * Property used to set prefix defaulting on the output side
     * (type: Boolean, default: FALSE).
     */
    public static final String IS_REPAIRING_NAMESPACES = "javolution.xml.stream.isRepairingNamespaces";

    /**
     * Property used to specify the prefix to be appended by a trailing
     * part (a sequence number) in order to make it unique to be usable as
     * a temporary non-colliding prefix when repairing namespaces
     * (type: String, default: "ns").
     */
    public final static String REPAIRING_PREFIX = "javolution.xml.stream.repairingPrefix";

    /**
     * Property used to specify an indentation string; non-null indentation
     * forces the writer to write elements into separate lines
     * (type: String, default: null).
     */
    public static final String INDENTATION = "javolution.xml.stream.indentation";

    /**
    * Property used to specify the new line characters
    * (type: String, default: "\n").
    */
    public static final String LINE_SEPARATOR = "javolution.xml.stream.lineSeparator";

    /**
     * Property indicating if the stream writers are allowed to automatically
     * output empty elements when a start element is immediately followed by
     * matching end element
     * (type: Boolean, default: FALSE).
     */
    public final static String AUTOMATIC_EMPTY_ELEMENTS = "javolution.xml.stream.automaticEmptyElements";

    /**
     * Property indicating if the stream writers are not allowed to use
     * empty element tags
     * (type: Boolean, default: FALSE).
     * When set, this property forces the use of start/end element tag
     * (e.g. i.e. "<empty />" replaced by  "<empty></empty>"),
     * This property takes precedence over {@link #AUTOMATIC_EMPTY_ELEMENTS}.
     */
    public final static String NO_EMPTY_ELEMENT_TAG = "javolution.xml.stream.noEmptyElementTag";

    /**
     * Returns a XML stream writer to the specified i/o writer.
     *
     * @param writer the writer to write to.
     * @return a xml stream writer possibly recycled.
     * @throws XMLStreamException
     */
    XMLStreamWriter createXMLStreamWriter(Writer writer)
            throws XMLStreamException;

    /**
     * Returns a XML stream writer to the specified output stream (UTF-8
     * encoding).
     *
     * @param stream the stream to write to.
     * @return a xml stream writer possibly recycled.
     * @throws XMLStreamException
     */
    XMLStreamWriter createXMLStreamWriter(OutputStream stream)
            throws XMLStreamException;

    /**
     * Returns a XML stream writer to the specified output stream using the
     * specified encoding.
     *
     * @param stream the stream to write to.
     * @param encoding the encoding to use.
     * @return a xml stream writer possibly recycled.
     * @throws XMLStreamException
     */
    XMLStreamWriter createXMLStreamWriter(OutputStream stream, String encoding)
            throws XMLStreamException;

    /**
     * Allows the user to set specific features/properties on the underlying
     * implementation.
     *
     * @param name the name of the property.
     * @param value  the value of the property.
     * @throws IllegalArgumentException if the property is not supported.
     */
    void setProperty(String name, Object value) throws IllegalArgumentException;

    /**
     * Gets a feature/property on the underlying implementation.
     *
     * @param name the name of the property
     * @return the value of the property
     * @throws IllegalArgumentException if the property is not supported.
     */
    Object getProperty(String name) throws IllegalArgumentException;

    /**
     * Queries the set of properties that this factory supports.
     *
     * @param name the name of the property (may not be null).
     * @return true if the property is supported;
     *         false otherwise.
     */
    boolean isPropertySupported(String name);

    /**
     * Returns a clone of this factory which can be independently configured.
     */
    XMLOutputFactory clone();
}


text:
/**
 * Tests for App.
 */
/// <reference types="unitejs-webdriver-plugin"/>
import { expect } from "chai";

describe("App", () => {
    it("the title is set", (done) => {
        const uniteThemeJson = require("../../../assetsSrc/theme/unite-theme.json");
        browser
            .uniteLoadAndWaitForPage("/")
            .getTitle()
            .then((title) => {
                expect(title).to.equal(uniteThemeJson.title);
                done();
            });
    });

    it("the child text is set", (done) => {
        browser
            .uniteLoadAndWaitForPage("/")
            .customShadowRoot("#root unite-app::sr iron-pages unite-child::sr span")
            .getText()
            .then((rootContent) => {
                expect(rootContent).to.equal("Hello UniteJS World!");
                done();
            });
    });

    it("the font size is set", (done) => {
        browser
            .uniteLoadAndWaitForPage("/")
            .customShadowRoot("#root unite-app::sr iron-pages unite-child::sr span")
            .getCssProperty("font-size")
            .then((fontSize) => {
                expect(fontSize.value).to.equal("20px");
                done();
            });
    });
});

// Generated by UniteJS


text:
using Rnx.Abstractions.Buffers;
using Rnx.Abstractions.Execution;
using Rnx.Abstractions.Tasks;
using Rnx.Tasks.Core.FileSystem;

namespace Rnx.Tasks.Reliak.Markdown
{
    public class MarkdownTaskDescriptor : TaskDescriptorBase<MarkdownTask>
    {
        public string NewExtension { get; private set; } = ".html";

        public MarkdownTaskDescriptor WithExtension(string newExtension)
        {
            NewExtension = newExtension;
            return this;
        }
    }

    public class MarkdownTask : RnxTask
    {
        private readonly MarkdownTaskDescriptor _taskDescriptor;

        public MarkdownTask(MarkdownTaskDescriptor taskDescriptor)
        {
            _taskDescriptor = taskDescriptor;
        }

        public override void Execute(IBuffer input, IBuffer output, IExecutionContext executionContext)
        {
            foreach(var e in input.Elements)
            {
                e.Text = CommonMark.CommonMarkConverter.Convert(e.Text);

                if(e.Data.Exists<WriteFileData>())
                {
                    e.Data.Get<WriteFileData>().Extension = _taskDescriptor.NewExtension;
                }

                output.Add(e);
            }
        }
    }
}


text:
<resources>

    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="actionBar_height">50dp</dimen>
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="item_del_width">100dp</dimen>
    <dimen name="item_height">50dp</dimen>
    <dimen name="item_value_padding_left">30dp</dimen>
    <dimen name="item_group_divide_height" >15dp</dimen>
    <dimen name="time_line_indicator_width">40dp</dimen>
    <dimen name="time_line_item_margin_left">10dp</dimen>

    <!-- arrow right-->
    <dimen name="arrow_right_height" >30dp</dimen>
    <dimen name="arrow_right_width" >30dp</dimen>
    <!-- font size -->
    <dimen name="font_size_left_label_text">15sp</dimen>
    <dimen name="font_size_common">15sp</dimen>
    <dimen name="font_size_big">20sp</dimen>
    <dimen name="font_size_small">10sp</dimen>

    <dimen name="padding_bottom_item_profile">5dp</dimen>
    <dimen name="padding_top_item_profile">5dp</dimen>
    <dimen name="padding_left_item_profile">13dp</dimen>

    <dimen name="nav_height" >50dp</dimen>
    <dimen name="nav_item_height" >30dp</dimen>
    <dimen name="nav_item_width" >30dp</dimen>
    <dimen name="nav_add_note_height" >40dp</dimen>
    <dimen name="nav_add_note_width" >40dp</dimen>

    <dimen name="title_font_size" >20sp</dimen>
    <dimen name="title_input_height">30dp</dimen>

</resources>


text:
"use strict";
var spawn = require('child_process').exec
	, config = {
		path:''
		, port: 4444
		, host: '127.0.0.1'
	}
	, running = null
;

function seleniumConfigure(cfg){
	/*jshint validthis:true*/
	config = cfg;
	return this;
}

function seleniumStart(){
	/*jshint validthis:true*/
	if( running ){
		return this;
	}
	console.log("starting selenium standalone server");
	var args = [
		config.path
		, '-port', config.port
		, '-host', config.host
		, '-timeout=' + (config.timeout || 15)
		, '-browserTimeout=' + (config.browserTimeout || 30)
	];
	if( config.args ){
		Object.keys(config.args).forEach(function(k){
			args.push('-' + k + '=' + config.args[k]);
		});
	}

	if( config.driversPath ){
		Object.keys(config.driversPath).forEach(function(k){
			config.driversPath[k] && args.push('-D' + k + '=' + config.driversPath[k]);
		});
	}
	running = spawn("java -jar " + args.join(' '));
	// running.stdout.on('data', function(data) {
	// 	console.log(data.toString('utf8'));
	// });
	// running.stderr.on('data', function(data) {
	// 	console.error(data.toString('utf8'));
	// });
	running.on('close', function (code) {
		console.log('selenium process exited with code ' + code);
	});
	return this;
}

function seleniumStop(){
	/*jshint validthis:true*/
	if(! running ){
		return this;
	}
	running.kill();
	running = null;
	return this;
}

module.exports = {
	configure: seleniumConfigure
	, start: seleniumStart
	, stop: seleniumStop
};


text:
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>

function logToConsole()
{
    console.log("Mutating object in a loop");
    var object = { a: 0, b: 0 };
    for (var i = 0; i < 3; ++i) {
        object.c = i;
        console.log(object);
    }

    console.log("Mutating array in a loop");
    var array = [0, 0, 0];
    for (var i = 0; i < 3; ++i) {
        array[2] = i;
        console.log(array);
    }

    console.log("Object with many properties");
    var objectWithManyProperties = {};
    for (var i = 0; i < 10; ++i) {
        objectWithManyProperties["property_" + i] = i;
    }
    console.log(objectWithManyProperties);

    console.log("Array with many properties");
    var arrayWithManyProperties = [0, 1];
    for (var i = 0; i < 10; ++i) {
        arrayWithManyProperties["property_" + i] = i;
    }
    console.log(arrayWithManyProperties);

    console.log("Object with proto");
    var objectWithProto = { d: 1 };
    objectWithProto.__proto__ = object;
    console.log(objectWithProto);

    console.log("Sparse array");
    var sparseArray = new Array(150);
    sparseArray[50] = 50;
    console.log(sparseArray);

    console.log("Dense array with indexes and propeties");
    var denseArray = new Array(150);
    for (var i = 0; i < 150; ++i) {
        denseArray[i] = i;
        denseArray["property_" + i] = i;
    }
    console.log(denseArray);

    console.log("Object with properties containing whitespaces");
    var obj = {};
    obj[" a b "] = " a b ";
    obj["c d"] = "c d";
    obj[""] = "";
    obj["  "] = "  ";
    obj["a\n\nb\nc"] = "a\n\nb\nc";
    console.log(obj);

    console.log("Object with a document.all property");
    console.log({all: document.all});

    console.log("Object with special numbers");
    var obj = { nan: NaN, posInf: Infinity, negInf: -Infinity, negZero: -0 };
    console.log(obj);

    console.log("Object with exactly 5 properties: expected to be lossless");
    console.log({a:1, b:2, c:3, d:4, e:5});

    console.log({null:null, undef:undefined, regexp: /^[regexp]$/g, bool: false});
}

function test()
{
    InspectorTest.evaluateInPage("logToConsole()", step2);

    function step2()
    {
        InspectorTest.dumpConsoleMessages(false, true);
        InspectorTest.addResult("Expanded all messages");
        InspectorTest.expandConsoleMessages(step3);
    }

    function step3()
    {
        InspectorTest.dumpConsoleMessages(false, true);
        InspectorTest.completeTest();
    }
}
</script>
</head>

<body onload="runTest()">
<p>
Tests that console produces instant previews for arrays and objects.
</p>

</body>
</html>


text:
package com.lamost.sms;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

/**
 * @author C.Feng
 * @version
 * @date 2017-6-18 下午4:45:35
 *
 */
public class SMS {
	public static void sendMessageToUser(int templateid, String mobiles,
			String params) throws IOException {
		DefaultHttpClient httpClient = new DefaultHttpClient();
		String url = "https://api.netease.im/sms/sendtemplate.action";
		HttpPost httpPost = new HttpPost(url);

		String appKey = "d8bb4e3a81bee2e130bd4bb08bc4b631";
		String appSecret = "b381b8603e9c";
		String nonce = "12345";
		String curTime = String.valueOf((new Date()).getTime() / 1000L);
		String checkSum = CheckSumBuilder
				.getCheckSum(appSecret, nonce, curTime);// 参考 计算CheckSum的java代码

		// 设置请求的header
		httpPost.addHeader("AppKey", appKey);
		httpPost.addHeader("Nonce", nonce);
		httpPost.addHeader("CurTime", curTime);
		httpPost.addHeader("CheckSum", checkSum);
		httpPost.addHeader("Content-Type",
				"application/x-www-form-urlencoded;charset=utf-8");
		// 设置请求的参数
		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("templateid", templateid + ""));
		nvps.add(new BasicNameValuePair("mobiles", mobiles));
		// nvps.add(new BasicNameValuePair("mobiles", "['15555173209']"));
		nvps.add(new BasicNameValuePair("params", params));
		httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
		// 执行请求
		HttpResponse response = httpClient.execute(httpPost);
		// 打印执行结果
		System.out.println(EntityUtils.toString(response.getEntity(), "utf-8"));
	}

}


text:
import java.util.Arrays;
import java.util.List;

public class QuickSort {

	private List<Integer> s;

	public static void main(String[] args) {
		Integer[] sArray = { 4, 2, 5, 6, 1, 23, 123, 12, 12, 213, 123, 21, 321, 312, 1,
				1 };

		QuickSort quickSort = new QuickSort();
		quickSort.s = Arrays.asList(sArray);
		System.out.println("before" + quickSort);

		quickSort.sort();
		System.out.println("after " + quickSort);
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		for (Integer value : s) {
			sb.append(value + ",");
		}
		return sb.toString();
	}

	public void sort() {
		quick_sort(0, s.size() - 1);
	}

	//O(n2)
	private void quick_sort(int start, int end) {
		if (start >= end) {
			return;
		}
		int p = partition(start, end);
		quick_sort(start, p - 1);
		quick_sort(p + 1, end);
	}

	private int partition(int start, int end) {
		int pivotFinalPosition = start;
		int position = end;

		for (int i = start; i < end; i++) {
			if (s.get(i) < s.get(position)) {
				int temp = s.get(i);
				s.set(i, s.get(pivotFinalPosition));
				s.set(pivotFinalPosition, temp);
				pivotFinalPosition++;
			}
		}
		int temp = s.get(end);
		s.set(end, s.get(pivotFinalPosition));
		s.set(pivotFinalPosition, temp);
		return pivotFinalPosition;
	}
}


text:
#ifndef GestureRecognizer_h
#define GestureRecognizer_h

#if ENABLE(TOUCH_EVENTS)

#include <Ecore.h>
#include <WebCore/IntPoint.h>
#include <WebKit2/WKEventEfl.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>

class EwkView;

namespace WebKit {

class GestureHandler;

class GestureRecognizer {
public:
    static PassOwnPtr<GestureRecognizer> create(EwkView* ewkView)
    {
        return adoptPtr(new GestureRecognizer(ewkView));
    }
    ~GestureRecognizer();

    void processTouchEvent(WKTouchEventRef);
    void reset();

private:
    explicit GestureRecognizer(EwkView*);

    static Eina_Bool doubleTapTimerCallback(void*);
    static Eina_Bool tapAndHoldTimerCallback(void*);

    bool exceedsPanThreshold(const WebCore::IntPoint& first, const WebCore::IntPoint& last) const;
    bool exceedsDoubleTapThreshold(const WebCore::IntPoint& first, const WebCore::IntPoint& last) const;

    // State functions.
    void noGesture(WKEventType, WKArrayRef);
    void singleTapGesture(WKEventType, WKArrayRef);
    void doubleTapGesture(WKEventType, WKArrayRef);
    void panGesture(WKEventType, WKArrayRef);
    void pinchGesture(WKEventType, WKArrayRef);

    void stopTapTimers();

    static const double s_doubleTapTimeoutInSeconds;
    static const double s_tapAndHoldTimeoutInSeconds;
    static const int s_squaredDoubleTapThreshold;
    static const int s_squaredPanThreshold;

    typedef void (GestureRecognizer::*RecognizerFunction)(WKEventType, WKArrayRef);
    RecognizerFunction m_recognizerFunction;

    OwnPtr<WebKit::GestureHandler> m_gestureHandler;
    Ecore_Timer* m_tapAndHoldTimer;
    Ecore_Timer* m_doubleTapTimer;
    WebCore::IntPoint m_firstPressedPoint;
};

} // namespace WebKit

#endif // ENABLE(TOUCH_EVENTS)

#endif // GestureRecognizer_h


text:
"""

@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/

"""

#This is a brute force optimizer for a donchian trend strategy

#Import modules
from YahooGrabber import YahooGrabber
import numpy as np
import time as t
import random as rand
import pandas as pd

#Empty data structures
Dataset = pd.DataFrame()
Dataset2 = pd.DataFrame()
Counter = 0
Empty = []
#Assign ticker
ticker = 'UVXY'
#Number of iterations
iterations = range(0, 5000)
#Request data
s = YahooGrabber(ticker)
#Time series trimmer
s = s[:-280]
#Start timer
Start = t.time()
#Calculate log returns
s['LogRet'] = np.log(s['Adj Close']/s['Adj Close'].shift(1))
s['LogRet'] = s['LogRet'].fillna(0)

#For number of iterations
for i in iterations:
    #Iteration tracking
    Counter = Counter + 1
    #Generate random variables
    nday = rand.randint(3,150)
    hold = rand.randint(3,150)
    ranger = range(0, hold)

    #Calculate rolling market top and bottom
    s['ndaymin'] = s['Adj Close'].rolling(window=nday, center=False).min()
    s['ndaymax'] = s['Adj Close'].rolling(window=nday, center=False).max()

    #Directional methodology
    s['Regime'] = np.where(s['Adj Close'] > s['ndaymax'].shift(1), 1, 0)
    s['Regime'] = np.where(s['Adj Close'] < s['ndaymin'].shift(1), -1, 0)

    #Zeros
    s['OriginalTrade'] = 0
    #If directional assumption in period and no directional assumption in previous period then is original trade
    s['OriginalTrade'].loc[(s['Regime'].shift(1) == 0) & (s['Regime'] == 1)] = 1
    s['OriginalTrade'].loc[(s['Regime'].shift(1) == 0) & (s['Regime'] == -1)] = -1

    #ffill(limit = r)
    for r in ranger:
        s['Regime'] = np.where(s['Regime'].shift(1) == -1, -1, s['Regime'])

    #Apply position to returns
    s['Strategy'] = s['Regime'].shift(1) * s['LogRet']
    #Returns on $1
    s['Multiplier'] = s['Strategy'].cumsum().apply(np.exp)

    #Incorrectly calculated max drawdown stat
    drawdown =  1 - s['Multiplier'].div(s['Multiplier'].cummax())
    drawdown = drawdown.fillna(0)
#    s['drawdown'] =  1 - s['Multiplier'].div(s['Multiplier'].cummax())
    MaxDD = max(drawdown)
    #Constraint
    if MaxDD > .6:
        continue

    #Performance metrics
    dailyreturn = s['Strategy'].mean()
    dailyvol = s['Strategy'].std()
    #Constraint
    if dailyvol == 0:
        continue
    #Performance metrics
    sharpe =(dailyreturn/dailyvol)

    #Iteration tracking
    print(Counter)

    #Save params and metrics to list
    Empty.append(nday)
    Empty.append(hold)
    Empty.append(sharpe)
    Empty.append(sharpe/MaxDD)
    Empty.append(dailyreturn/MaxDD)
    Empty.append(MaxDD)
    #List to series
    Emptyseries = pd.Series(Empty)
    #Series to dataframe
    Dataset[i] = Emptyseries.values
    #Clear list
    Empty[:] = []

#Metric of choice
z1 = Dataset.iloc[2]
#Threshold
w1 = np.percentile(z1, 80)
v1 = [] #this variable stores the Nth percentile of top params
DS1W = pd.DataFrame() #this variable stores your params for specific dataset

#For all metrics
for h in z1:
    #If metric greater than threshold
    if h > w1:
      #Add metric to list
      v1.append(h)
#For top metrics
for j in v1:
      #Get column ID of metric
      r = Dataset.columns[(Dataset == j).iloc[2]]
      #Add param set to dataframe by column ID
      DS1W = pd.concat([DS1W,Dataset[r]], axis = 1)

#Top metric
y = max(z1)
#Column ID of top metric
k = Dataset.columns[(Dataset == y).iloc[2]]
#Top param set
kfloat = float(k[0])
#End timer
End = t.time()
#Timer stats
print(End-Start, 'seconds later')
#Display top param set
print(Dataset[k])

#Read in top params
nday = int(Dataset[kfloat][0])
hold = int(Dataset[kfloat][1])
ranger = range(0, hold)

#Calculate rolling market top and bottom
s['ndaymin'] = s['Adj Close'].rolling(window=nday, center=False).min()
s['ndaymax'] = s['Adj Close'].rolling(window=nday, center=False).max()\
#Directional methodology

s['Regime'] = np.where(s['Adj Close'] > s['ndaymax'].shift(1), 1, 0)
s['Regime'] = np.where(s['Adj Close'] < s['ndaymin'].shift(1), -1, 0)
#If directional assumption in period and no directional assumption in previous period then is original trade
s['OriginalTrade'] = 0
s['OriginalTrade'].loc[(s['Regime'].shift(1) == 0) & (s['Regime'] == 1)] = 1
s['OriginalTrade'].loc[(s['Regime'].shift(1) == 0) & (s['Regime'] == -1)] = -1

#ffill(limit = r)
for r in ranger:
    s['Regime'] = np.where(s['Regime'].shift(1) == -1, -1, s['Regime'])
#Apply position to returns
s['Strategy'] = s['Regime'].shift(1) * s['LogRet']
#Returns on $1
s['Multiplier'] = s['Strategy'].cumsum().apply(np.exp)

#Incorrectly calculated drawdown stat
drawdown =  1 - s['Multiplier'].div(s['Multiplier'].cummax())
drawdown = drawdown.fillna(0)
#s['drawdown'] =  1 - s['Multiplier'].div(s['Multiplier'].cummax())
MaxDD = max(drawdown)

#Performance metrics
dailyreturn = s['Strategy'].mean()
dailyvol = s['Strategy'].std()
sharpe =(dailyreturn/dailyvol)
#Incorrectly calculated
print(MaxDD)

#Graphical display
s['Strategy'].cumsum().apply(np.exp).plot(grid=True,
                                     figsize=(8,5))


text:
#include "tensorflow/core/common_runtime/dma_helper.h"
#include "tensorflow/core/common_runtime/scoped_allocator.h"
#include "tensorflow/core/common_runtime/scoped_allocator_mgr.h"
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"

namespace tensorflow {

class ScopedAllocatorOp : public OpKernel {
 public:
  explicit ScopedAllocatorOp(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr("T", &dtype_));
    OP_REQUIRES_OK(context, context->GetAttr("shapes", &shapes_));
    OP_REQUIRES_OK(context, context->GetAttr("sa_name", &name_));
    OP_REQUIRES_OK(context, context->GetAttr("id", &id_));
    OP_REQUIRES_OK(context, context->GetAttr("expected_call_count",
                                             &expected_call_count_));
    device_ = context->device();
    // Precalculate the size of the backing tensor and the offsets of
    // the subtensors to be allocated from it, taking into account
    // alignment considerations.
    ScopedAllocatorMgr::PopulateFields(id_, shapes_, dtype_, &fields_);
    size_t num_bytes = fields_.back().offset + fields_.back().bytes;
    num_elements_ = num_bytes / DataTypeSize(dtype_);
    OP_REQUIRES(context, num_bytes % DataTypeSize(dtype_) == 0,
                errors::InvalidArgument(
                    "Number of bytes ", num_bytes,
                    " must be divisible by size of datatype ", dtype_));
  }

  void Compute(OpKernelContext* context) override {
    ScopedAllocatorMgr* sam = device_->GetScopedAllocatorMgr();
    if (!sam) {
      context->SetStatus(errors::Internal(
          "ScopedAllocatorMgr not supported on device ", device_->name()));
      return;
    }
    Tensor* backing_tensor = nullptr;
    AllocatorAttributes attr = context->output_alloc_attr(0);
    Status s =
        context->allocate_output(0, {num_elements_}, &backing_tensor, attr);
    VLOG(1) << "_ScopedAllocatorOp new backing tensor size "
            << backing_tensor->TotalBytes() << " num_elements_ "
            << num_elements_ << " buffer " << DMAHelper::buffer(backing_tensor)
            << " base addr " << DMAHelper::base(backing_tensor);
    if (s.ok()) {
      s = sam->AddScopedAllocator(*backing_tensor, context->step_id(), id_,
                                  name_, fields_, expected_call_count_);
    }
    if (!s.ok()) {
      context->SetStatus(s);
    }
  }

 private:
  std::vector<TensorShape> shapes_;
  DataType dtype_;
  int64 num_elements_;
  std::vector<ScopedAllocator::Field> fields_;
  string name_;
  int32 id_;
  int32 expected_call_count_;
  DeviceBase* device_;
};

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocator").Device(DEVICE_CPU),
                        ScopedAllocatorOp);

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocator").Device(DEVICE_GPU),
                        ScopedAllocatorOp);

class ScopedAllocatorConcatOp : public OpKernel {
 public:
  explicit ScopedAllocatorConcatOp(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr("shape", &shape_));
    OP_REQUIRES_OK(context, context->GetAttr("T", &dtype_));
    OP_REQUIRES_OK(context, context->GetAttr("reshape", &reshape_));
    // These attributes are just for debugging.
    OP_REQUIRES_OK(context, context->GetAttr("sa_name", &name_));
    OP_REQUIRES_OK(context, context->GetAttr("id", &id_));
    device_ = context->device();
  }

  void Compute(OpKernelContext* context) override {
    const Tensor& backing_tensor = context->input(0);
    // Check that type matches.
    OP_REQUIRES(context, backing_tensor.dtype() == dtype_,
                errors::InvalidArgument("Backing tensor type ",
                                        DataTypeString(backing_tensor.dtype()),
                                        " does not match expected type ",
                                        DataTypeString(dtype_)));
    // Check that backing tensor is at least as large as the shape of the
    // output.
    OP_REQUIRES(context, backing_tensor.NumElements() >= shape_.num_elements(),
                errors::InvalidArgument("Backing tensor num elements ",
                                        backing_tensor.NumElements(),
                                        " is not >= to expected ",
                                        shape_.num_elements()));
    Tensor output(dtype_);
    if (reshape_) {
      CHECK(output.CopyFrom(backing_tensor, shape_));
    } else {
      CHECK(output.CopyFrom(backing_tensor, backing_tensor.shape()));
    }
    context->set_output(0, output);
    const TensorBuffer* backing_buf = DMAHelper::buffer(&output);
    const void* backing_tensor_lb = backing_buf->data();
    const void* backing_tensor_ub = static_cast<const void*>(
        static_cast<const char*>(backing_tensor_lb) + backing_buf->size());
    // Check that all inputs lie entirely within the backing tensor.
    for (int i = 1; i < context->num_inputs(); ++i) {
      const TensorBuffer* input_buf = DMAHelper::buffer(&context->input(i));
      const void* input_lb = input_buf->data();
      const void* input_ub = static_cast<const void*>(
          static_cast<const char*>(input_lb) + input_buf->size());
      OP_REQUIRES(
          context, input_lb >= backing_tensor_lb,
          errors::InvalidArgument(
              "Lower bound check fail for input ", i, " from node ",
              context->op_kernel().requested_input(i), " to node ",
              context->op_kernel().name(), " input bounds = [", input_lb, ", ",
              input_ub, "]", " backing_tensor bounds = [", backing_tensor_lb,
              ", ", backing_tensor_ub, "]"));
      OP_REQUIRES(
          context, input_ub <= backing_tensor_ub,
          errors::InvalidArgument(
              "Upper bound check fail for input ", i, " from node ",
              context->op_kernel().requested_input(i), " to node ",
              context->op_kernel().name(), " input bounds = [", input_lb, ", ",
              input_ub, "]", " backing_tensor bounds = [", backing_tensor_lb,
              ", ", backing_tensor_ub, "]"));
    }
    VLOG(1) << "_ScopedAllocatorConcatOp outputting backing tensor at "
            << backing_buf;
  }

 private:
  TensorShape shape_;
  DataType dtype_;
  string name_;
  int32 id_;
  bool reshape_;
  DeviceBase* device_;
};

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocatorConcat").Device(DEVICE_CPU),
                        ScopedAllocatorConcatOp);

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocatorConcat").Device(DEVICE_GPU),
                        ScopedAllocatorConcatOp);

class ScopedAllocatorSplitOp : public OpKernel {
 public:
  explicit ScopedAllocatorSplitOp(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr("T", &dtype_));
    // This stuff is just for debugging
    OP_REQUIRES_OK(context, context->GetAttr("sa_name", &name_));
    OP_REQUIRES_OK(context, context->GetAttr("id", &id_));
    device_ = context->device();
  }

  void Compute(OpKernelContext* context) override {
    Tensor backing_copy(context->input(0));
    // Check that type matches.
    OP_REQUIRES(context, backing_copy.dtype() == dtype_,
                errors::InvalidArgument("Backing tensor type ",
                                        DataTypeString(backing_copy.dtype()),
                                        " does not match expected type ",
                                        DataTypeString(dtype_)));
    const TensorBuffer* backing_buf = DMAHelper::buffer(&backing_copy);
    const void* backing_tensor_lb = backing_buf->data();
    const void* backing_tensor_ub = static_cast<const void*>(
        static_cast<const char*>(backing_tensor_lb) + backing_buf->size());
    for (int i = 1; i < context->num_inputs(); ++i) {
      VLOG(1) << "_ScopedAllocatorSplitOp assigning input " << i
              << " to output " << i - 1 << " buf addr "
              << DMAHelper::base(&context->input(i));
      Tensor copy(context->input(i));
      OP_REQUIRES(context, copy.dtype() == dtype_,
                  errors::InvalidArgument("Input ", i, " tensor type ",
                                          DataTypeString(copy.dtype()),
                                          " does not match expected type ",
                                          DataTypeString(dtype_)));
      context->set_output(i - 1, copy);
      const TensorBuffer* input_buf = DMAHelper::buffer(&copy);
      const void* input_lb = input_buf->data();
      OP_REQUIRES(
          context, input_lb >= backing_tensor_lb,
          errors::InvalidArgument("Lower bound check fail for input ", i,
                                  " to node ", context->op_kernel().name()));
      const void* input_ub = static_cast<const void*>(
          static_cast<const char*>(input_lb) + input_buf->size());
      OP_REQUIRES(
          context, input_ub <= backing_tensor_ub,
          errors::InvalidArgument("Upper bound check fail for input ", i,
                                  " to node ", context->op_kernel().name()));
    }
  }

 private:
  DataType dtype_;
  string name_;
  int32 id_;
  DeviceBase* device_;
};

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocatorSplit").Device(DEVICE_CPU),
                        ScopedAllocatorSplitOp);

REGISTER_KERNEL_BUILDER(Name("_ScopedAllocatorSplit").Device(DEVICE_GPU),
                        ScopedAllocatorSplitOp);

}  // namespace tensorflow


text:
/// <reference path="~/Assets/JS/Application/SchedulerMain.js" />

angular.module('SchedulerApp').controller('EmployeesController', ['$scope', '$rootScope', 'NgTableParams', '$uibModal', function ($scope, $rootScope, NgTableParams, $uibModal) {
    $scope.PageTitle = 'Employees';
    $rootScope.pageActive = 5;

    var TableData = [
        { ID: 1, Name: "Aaron Watson", Email: "awatson@espassociates.com", Phone: "(816) 808-5985", Office: "Concord", Active: true },
        { ID: 2, Name: "Adair Stevenson", Email: "astevenson@espassociates.com", Phone: "(803) 367-6601", Office: "Concord", Active: true },
        { ID: 3, Name: "Adam McKee", Email: "amckee@espassociates.com", Phone: "(704) 439-6233", Office: "Concord", Active: true },
        { ID: 4, Name: "Alex Ross", Email: "aross@espassociates.com", Phone: "(803) 372-7436", Office: "Concord", Active: false },
        { ID: 5, Name: "Alex Stroud", Email: "astroud@espassociates.com", Phone: "(803) 325-4729", Office: "Charlotte", Active: true },
        { ID: 6, Name: "Alphonso Stewart", Email: "astewart@espassociates.com", Phone: "(803) 412-8435", Office: "Concord", Active: true },
        { ID: 7, Name: "Antione Grant", Email: "aegrant@espassociates.com", Phone: "(803) 604-6248", Office: "Charlotte", Active: false },
        { ID: 8, Name: "Ashley McGovern", Email: "amcgovern@espassociates.com", Phone: "(704) 441-4344", Office: "Charlotte", Active: true },
        { ID: 9, Name: "Ashley Privette", Email: "aprivette@espassociates.com", Phone: "(803) 239-3991", Office: "Concord", Active: true },
        { ID: 10, Name: "Ben Long", Email: "blong@espassociates.com", Phone: "(919) 448-6037", Office: "Raleigh", Active: false },
        { ID: 11, Name: "Brandon Pierce", Email: "bpierce@espassociates.com", Phone: "(704) 621-5754", Office: "Concord", Active: true },
        { ID: 12, Name: "Brian Welch", Email: "bfwelch@espassociates.com", Phone: "(704) 363-5315", Office: "Charlotte", Active: true },
        { ID: 13, Name: "Chad Sherman", Email: "csherman@espassociates.com", Phone: "(704) 622-4501", Office: "Concord", Active: false },
        { ID: 14, Name: "Chase Hallenbeck", Email: "challenbeck@espassociates.com", Phone: "(919) 632-7910", Office: "Raleigh", Active: true }
    ];

    $scope.TableItems = new NgTableParams({
        count: TableData.length
    }, {
        dataset: TableData
        , counts: []
    });

    $scope.OpenModal = function () {
        $scope.modalInstance = $uibModal.open({
            templateUrl: "AddNewEmployees.html",
            scope: $scope
        });
    }

    $scope.close = function () {
        $scope.modalInstance.close();
    }

    $scope.newProject = function () {
        $scope.modalInstance.close();
    }

    $scope.editEmployee = function (Employee) {
        $scope.modalInstance = $uibModal.open({
            templateUrl: "EditTheEmployee.html",
            controller: ['Employee', editModalCtrl],
            controllerAs: 'vm',
            resolve: {
                Employee: function () {
                    return Employee;
                }
            }
        });
    }

    function editModalCtrl(Employee) {
        var vm = this;

        vm.Employee = angular.copy(Employee);

        vm.editModel = function () {
            $scope.modalInstance.close();
        }
    }
}]);


text:
package main

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestLeap(t *testing.T) {
	assert := assert.New(t)
	assert.False(isleap(1700))
	assert.False(isleap(1800))
	assert.False(isleap(1900))
	assert.True(isleap(2000))
}


text:
package org.elasticsearch.xpack.sql.action;

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin;
import org.elasticsearch.xpack.sql.plugin.SqlPlugin;

import java.nio.file.Path;

public class LocalStateSQLXPackPlugin extends LocalStateCompositeXPackPlugin {

    public LocalStateSQLXPackPlugin(final Settings settings, final Path configPath) throws Exception {
        super(settings, configPath);
        LocalStateSQLXPackPlugin thisVar = this;
        plugins.add(new SqlPlugin(settings) {
            @Override
            protected XPackLicenseState getLicenseState() {
                return thisVar.getLicenseState();
            }
        });
    }
}


text:
.class Lcom/facebook/AuthorizationClient$AuthDialogBuilder;
.super Lcom/facebook/widget/WebDialog$Builder;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/facebook/AuthorizationClient;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "AuthDialogBuilder"
.end annotation

# static fields
.field private static final OAUTH_DIALOG:Ljava/lang/String; = "oauth"

.field static final REDIRECT_URI:Ljava/lang/String; = "fbconnect://success"

# instance fields
.field private e2e:Ljava/lang/String;

.field private isRerequest:Z

# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 1

    .line 900
    const-string v0, "oauth"

    invoke-direct {p0, p1, p2, v0, p3}, Lcom/facebook/widget/WebDialog$Builder;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)V

    .line 901
    return-void
.end method

# virtual methods
.method public build()Lcom/facebook/widget/WebDialog;
    .locals 7

    .line 915
    invoke-virtual {p0}, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->getParameters()Landroid/os/Bundle;

    move-result-object v0

    .line 916
    move-object v6, v0

    const-string v1, "redirect_uri"

    const-string v2, "fbconnect://success"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 917
    const-string v0, "client_id"

    invoke-virtual {p0}, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->getApplicationId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v6, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 918
    const-string v0, "e2e"

    iget-object v1, p0, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->e2e:Ljava/lang/String;

    invoke-virtual {v6, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 919
    const-string v0, "response_type"

    const-string v1, "token"

    invoke-virtual {v6, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 920
    const-string v0, "return_scopes"

    const-string v1, "true"

    invoke-virtual {v6, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 923
    iget-boolean v0, p0, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->isRerequest:Z

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/facebook/Settings;->getPlatformCompatibilityEnabled()Z

    move-result v0

    if-nez v0, :cond_0

    .line 924
    const-string v0, "auth_type"

    const-string v1, "rerequest"

    invoke-virtual {v6, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 927
    :cond_0
    new-instance v0, Lcom/facebook/widget/WebDialog;

    invoke-virtual {p0}, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->getContext()Landroid/content/Context;

    move-result-object v1

    const-string v2, "oauth"

    invoke-virtual {p0}, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->getTheme()I

    move-result v4

    invoke-virtual {p0}, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->getListener()Lcom/facebook/widget/WebDialog$OnCompleteListener;

    move-result-object v5

    move-object v3, v6

    invoke-direct/range {v0 .. v5}, Lcom/facebook/widget/WebDialog;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;ILcom/facebook/widget/WebDialog$OnCompleteListener;)V

    return-object v0
.end method

.method public setE2E(Ljava/lang/String;)Lcom/facebook/AuthorizationClient$AuthDialogBuilder;
    .locals 0

    .line 904
    iput-object p1, p0, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->e2e:Ljava/lang/String;

    .line 905
    return-object p0
.end method

.method public setIsRerequest(Z)Lcom/facebook/AuthorizationClient$AuthDialogBuilder;
    .locals 0

    .line 909
    iput-boolean p1, p0, Lcom/facebook/AuthorizationClient$AuthDialogBuilder;->isRerequest:Z

    .line 910
    return-object p0
.end method


text:
require "spec_helper"

RSpec.describe Git::Cop::Styles::CommitTrailerCollaboratorEmail do
  subject(:cop) { described_class.new commit: commit }

  let(:status) { instance_double Process::Status, success?: true }
  let(:shell) { class_spy Open3, capture2e: ["", status] }

  let :commit do
    object_double Git::Cop::Commits::Saved.new(sha: "abc", shell: shell),
                  trailer_lines: trailer_lines,
                  trailer_index: 2
  end

  describe ".id" do
    it "answers class ID" do
      expect(described_class.id).to eq(:commit_trailer_collaborator_email)
    end
  end

  describe ".label" do
    it "answers class label" do
      expect(described_class.label).to eq("Commit Trailer Collaborator Email")
    end
  end

  describe ".defaults" do
    it "answers defaults" do
      expect(described_class.defaults).to eq(
        enabled: true,
        severity: :error
      )
    end
  end

  describe "#valid?" do
    context "with no matching key" do
      let(:trailer_lines) { ["Unknown: value"] }

      it "answers true" do
        expect(cop.valid?).to eq(true)
      end
    end

    context "with valid email" do
      let(:trailer_lines) { ["Co-Authored-By: Test Example <test@example.com>"] }

      it "answers true" do
        expect(cop.valid?).to eq(true)
      end
    end

    context "with invalid email" do
      let(:trailer_lines) { ["Co-Authored-By: Test Example <invalid>"] }

      it "answers false" do
        expect(cop.valid?).to eq(false)
      end
    end
  end

  describe "#issue" do
    let(:issue) { cop.issue }

    context "when valid" do
      let(:trailer_lines) { ["Co-Authored-By: Test Example <test@example.com>"] }

      it "answers empty hash" do
        expect(issue).to eq({})
      end
    end

    context "when invalid" do
      let(:trailer_lines) { ["Co-Authored-By: Test Example <invalid>"] }

      it "answers issue" do
        expect(issue).to eq(
          hint: %(Email must follow name and use format: "<name@server.domain>".),
          lines: [
            {
              content: "Co-Authored-By: Test Example <invalid>",
              number: 4
            }
          ]
        )
      end
    end
  end
end


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [#filter: platform\threading #]
***/

#include "build.h"
#include "thread.h"

#ifdef PLATFORM_WINDOWS
    #include "threadWindows.h"
#elif defined(PLATFORM_POSIX)
    #include "threadPOSIX.h"
#endif

namespace base
{
    namespace threads
    {

        //---

        ThreadSetup::ThreadSetup()
            : m_name("InfernoThread")
            , m_priority(Priority::Normal)
            , m_stackSize(64 * 1024)
        {}

        //---

        Thread::Thread()
            : m_systemThreadHandle(0)
        {}

        Thread::Thread(Thread&& other)
            : m_systemThreadHandle(other.m_systemThreadHandle)
        {
            other.m_systemThreadHandle = 0;
        }

        Thread& Thread::operator=(Thread&& other)
        {
            if (this != &other)
            {
                close();
                m_systemThreadHandle = other.m_systemThreadHandle;
                other.m_systemThreadHandle = 0;
            }

            return *this;
        }

        Thread::~Thread()
        {
            close();
        }

        void Thread::init(const ThreadSetup& setup)
        {
#if defined(PLATFORM_WINDOWS)
            prv::WinThread::Init(&m_systemThreadHandle, setup);
#elif defined(PLATFORM_POSIX)
            prv::POSIXThread::Init(&m_systemThreadHandle, setup);
#else
            #error "Implement this"
#endif
        }

        void Thread::close()
        {
#if defined(PLATFORM_WINDOWS)
            prv::WinThread::Close(&m_systemThreadHandle);
#elif defined(PLATFORM_POSIX)
            prv::POSIXThread::Close(&m_systemThreadHandle);
#else
            #error "Implement this"
#endif
        }

        //---

        //! Lock section
        void SpinLock::acquire()
        {
            Uint32 spinCount = 0;
            const auto threadID = GetThreadID();
            while (!m_owningThreadID.compareExchangeStrong(0, threadID))
            {
                spinCount += 1;
                if (spinCount == 1024)
                {
                    InternalYield();
                    spinCount = 0;
                }
            }
        }

        //! Releases the lock on the critical section
        void SpinLock::release()
        {
            const auto curThread = GetThreadID();
            const auto prevThread = m_owningThreadID.exchange(0);
           // FATAL_ASSERT_EX(prevThread == curThread, "Only the thread that acquired the SpinLock can release it!");
        }

        void SpinLock::InternalYield()
        {
            Yield();
        }

        const Uint32 SpinLock::GetThreadID()
        {
            return GetCurrentThreadID();
        }

    } // threads
} // inf


text:
namespace initialfantasy {
    export namespace app {
        /** 应用-业务对象信息 */
        export class BOPropertyValueChooseApp extends ibas.BOChooseService<IBOPropertyValueChooseView, bo.IBOPropertyValue> {
            /** 应用标识 */
            static APPLICATION_ID: string = "5c1583a6-cfcd-4af1-b5a1-30157ce316df";
            /** 应用名称 */
            static APPLICATION_NAME: string = "initialfantasy_app_bopropertyvalue_choose";
            /** 业务对象编码 */
            static BUSINESS_OBJECT_CODE: string = bo.BO_CODE_BOPROPERTY_VALUE;
            /** 构造函数 */
            constructor() {
                super();
                this.id = BOPropertyValueChooseApp.APPLICATION_ID;
                this.name = BOPropertyValueChooseApp.APPLICATION_NAME;
                this.boCode = BOPropertyValueChooseApp.BUSINESS_OBJECT_CODE;
                this.description = ibas.i18n.prop(this.name);
            }
            /** 注册视图 */
            protected registerView(): void {
                super.registerView();
                // 其他事件
            }
            /** 视图显示后 */
            protected viewShowed(): void {
                // 视图加载完成
                super.viewShowed();
            }
            /** 查询数据 */
            protected fetchData(criteria: ibas.ICriteria): void {
                this.busy(true);
                let nCriteria: ibas.ICriteria = new ibas.Criteria();
                for (let codition of criteria.conditions) {
                    if (ibas.strings.equalsIgnoreCase(bo.BOInformation.PROPERTY_CODE_NAME, codition.alias)) {
                        nCriteria.conditions.add(codition);
                    } else if (ibas.strings.equalsIgnoreCase(bo.BOPropertyValue.PROPERTY_PROPERTY_NAME, codition.alias)) {
                        let pCriteria: ibas.IChildCriteria = nCriteria.childCriterias.firstOrDefault(
                            c => ibas.strings.equalsIgnoreCase(bo.BOInformation.PROPERTY_BOPROPERTYINFORMATIONS_NAME, c.propertyPath));
                        if (ibas.objects.isNull(pCriteria)) {
                            pCriteria = nCriteria.childCriterias.create();
                            pCriteria.propertyPath = bo.BOInformation.PROPERTY_BOPROPERTYINFORMATIONS_NAME;
                        }
                        pCriteria.conditions.add(codition);
                    }
                }
                let sort: ibas.ISort = nCriteria.sorts.create();
                sort.alias = bo.BOInformation.PROPERTY_CODE_NAME;
                sort.sortType = ibas.emSortType.DESCENDING;

                let that: this = this;
                let boRepository: bo.BORepositoryInitialFantasy = new bo.BORepositoryInitialFantasy();
                boRepository.fetchBOInformation({
                    criteria: nCriteria,
                    onCompleted(opRslt: ibas.IOperationResult<bo.BOInformation>): void {
                        try {
                            that.busy(false);
                            if (opRslt.resultCode !== 0) {
                                throw new Error(opRslt.message);
                            }
                            let datas: ibas.IList<bo.IBOPropertyValue> = new ibas.ArrayList<bo.IBOPropertyValue>();
                            for (let boItem of opRslt.resultObjects) {
                                for (let ptyItem of boItem.boPropertyInformations) {
                                    for (let vItem of ptyItem.boPropertyValues) {
                                        datas.add(vItem);
                                    }
                                }
                            }
                            if (datas.length === 1
                                && ibas.config.get(ibas.CONFIG_ITEM_AUTO_CHOOSE_DATA, true) && !that.isViewShowed()) {
                                // 仅一条数据,直接选择
                                that.chooseData(datas);
                            } else {
                                if (!that.isViewShowed()) {
                                    // 没显示视图,先显示
                                    that.show();
                                }
                                if (opRslt.resultObjects.length === 0) {
                                    that.proceeding(ibas.emMessageType.INFORMATION, ibas.i18n.prop("shell_data_fetched_none"));
                                }
                                that.view.showData(datas);
                            }
                        } catch (error) {
                            that.messages(error);
                        }
                    }
                });
                this.proceeding(ibas.emMessageType.INFORMATION, ibas.i18n.prop("shell_fetching_data"));
            }
            /** 新建数据 */
            protected newData(): void {
            }
        }
        /** 视图-业务对象信息 */
        export interface IBOPropertyValueChooseView extends ibas.IBOChooseView {
            /** 显示数据 */
            showData(datas: bo.IBOPropertyValue[]): void;
        }
        /** 业务对象信息选择服务映射 */
        export class BOPropertyValueChooseServiceMapping extends ibas.BOChooseServiceMapping {
            /** 构造函数 */
            constructor() {
                super();
                this.id = BOPropertyValueChooseApp.APPLICATION_ID;
                this.name = BOPropertyValueChooseApp.APPLICATION_NAME;
                this.boCode = BOPropertyValueChooseApp.BUSINESS_OBJECT_CODE;
                this.description = ibas.i18n.prop(this.name);
            }
            /** 创建服务实例 */
            create(): ibas.IService<ibas.IBOChooseServiceCaller<bo.IBOPropertyValue>> {
                return new BOPropertyValueChooseApp();
            }
        }
    }
}


text:
typedef void(^chooseBlock)(NSInteger index,BOOL isSelected);
typedef void(^doneBlock)(void);
@interface YJPreviewViewController : UIViewController
@property (nonatomic, copy)chooseBlock  chooseBlock;
@property (nonatomic, copy)doneBlock  doneBlock;

//isSelected 看是否为整个查看还是选中查看
- (instancetype)initWithImageArray:(NSArray *)imageArray atIndex:(NSInteger)index isSelected:(BOOL)isSelected;
@end


text:
module Google
  module Finance
    module Ruby
      VERSION = "0.0.1"
    end
  end
end


text:
#ifndef TARANTOOL_EIO_H_INCLUDED
#define TARANTOOL_EIO_H_INCLUDED

#include <stdio.h>
#include <fcntl.h> /* Definition of AT_* constants */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <utime.h>
#include <unistd.h>

#if defined(ENABLE_BUNDLED_LIBEIO)
#include "third_party/libeio/eio.h"
#else /* !defined(ENABLE_BUNDLED_LIBEIO) */
#include <eio.h>
#endif

#endif /* TARANTOOL_EIO_H_INCLUDED */


text:
package org.plexian.grumy.entity;

import org.plexian.grumy.opengl.RGBA;
import org.plexian.grumy.opengl.TextRenderer;

/**
 * NOTE: Unused
 */
public class EntityTextBox {
    /**
     *
     * @param text
     * @param e
     */
    public void drawTextBox(String text, Entity e) {
        TextRenderer.drawInGameText(text, e.getLocation().getX(), e.getLocation().getY() + e.getSize().getY() + 1f,
                RGBA.BLACK);
    }
}


text:
Compatibility for ClipboardManager, from API level 1.

Related post: [再谈 Android API 兼容性处理](http://www.liaohuqiu.net/cn/posts/android-api-compat-guide/)

ABOUT ME / 关注我:  [Github](https://github.com/liaohuqiu) | [twitter](https://twitter.com/liaohuqiu) | [微博](http://weibo.com/liaohuqiu)

#### Interface

```java
public interface ClipboardManagerCompat {

    void addPrimaryClipChangedListener(OnPrimaryClipChangedListener listener);

    void removePrimaryClipChangedListener(OnPrimaryClipChangedListener listener);

    CharSequence getText();

    void setText(CharSequence text);

    boolean hasText();
}
```

* Screen snapshot

#### Import

Repositories:

```groovy
allprojects {
    repositories {
        mavenCentral()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
        jcenter()
    }
}
```

Add to dependencies:

```groovy
compile 'in.srain.cube:clipboard-manager-compat:1.0.3'
```

### LICENSE

MIT


text:
// Copyright (c) 2017 James Skimming. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

namespace Abioc.Registration
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Helper extension method for <see cref="IRegistration"/> instances.
    /// </summary>
    internal static class RegistrationExtensionHelpers
    {
        /// <summary>
        /// Returns the distinct types for all <paramref name="registrations"/>.
        /// </summary>
        /// <param name="registrations">The collection of <see cref="IRegistration"/> object.</param>
        /// <returns>The distinct types for all <paramref name="registrations"/>.</returns>
        public static IEnumerable<Type> DistinctRegistrationTypes(
            this IEnumerable<IRegistration> registrations)
        {
            if (registrations == null)
                throw new ArgumentNullException(nameof(registrations));

            return registrations.Select(r => r.ImplementationType).Distinct();
        }

        /// <summary>
        /// Returns the distinct types for all public (where
        /// <see cref="IRegistration"/>.<see cref="IRegistration.Internal"/> is <see langword="false"/>)
        /// <paramref name="registrations"/>.
        /// </summary>
        /// <param name="registrations">The collection of <see cref="IRegistration"/> object.</param>
        /// <returns>The distinct types for all public <paramref name="registrations"/>.</returns>
        public static IEnumerable<Type> DistinctPublicRegistrationTypes(
            this IEnumerable<IRegistration> registrations)
        {
            if (registrations == null)
                throw new ArgumentNullException(nameof(registrations));

            return registrations.Where(r => !r.Internal).Select(r => r.ImplementationType).Distinct();
        }
    }
}


text:
const fs = require('fs');

/**
 * Little helper script just accumulates the .json
 * files in a given directory into an object keyed
 * on the file basename with .json stripped.
 */
function scanJsonDir(dirPath) {
  return fs.readdirSync(dirPath)
    .filter((name) => name.endsWith('.json'))
    .map(
      (jsonName) => {
        const key = jsonName.substring(0, jsonName.length - 5); // strip .json
        const valueStr = fs.readFileSync(`${dirPath}/${jsonName}`, 'utf8');
        return { key, value: JSON.parse(valueStr) };
      },
    )
    .reduce(
      (acc, it) => {
        acc[it.key] = it.value;
        return acc;
      }, {},
    );
}

const params = scanJsonDir(`${__dirname}/config`);

module.exports = {
  params,
};


text:
#ifndef AXIS2_MSG_H
#define AXIS2_MSG_H

/**
 * @defgroup axis2_msg message
 * @ingroup axis2_desc
 * message represents a message in a WSDL. It captures SOAP headers related to
 * a given message, the direction as well as the phases to be invoked along
 * the flow. Based on the message direction, there could be only one flow
 * associated with a message.
 * @{
 */

/**
 * @file axis2_msg.h
 */

#include <axutil_param_container.h>
#include <axis2_op.h>
#include <axutil_array_list.h>
#include <axis2_description.h>
#include <axis2_phase_meta.h>

    /** Message of IN flow */
#define AXIS2_MSG_IN            "in"

    /** Message of OUT flow */
#define AXIS2_MSG_OUT           "out"

    /** Message of IN FAULT flow */
#define AXIS2_MSG_IN_FAULT      "InFaultMessage"

    /** Message of OUT FAULT flow */
#define AXIS2_MSG_OUT_FAULT     "OutFaultMessage"

#ifdef __cplusplus
extern "C"
{
#endif

    /** Type name for struct axis2_msg */
    typedef struct axis2_msg axis2_msg_t;

    /**
     * Creates message struct instance.
     * @param env pointer to environment struct
     * @return pointer to newly created message
     */
    AXIS2_EXTERN axis2_msg_t *AXIS2_CALL
    axis2_msg_create(
        const axutil_env_t * env);

    /**
     * Frees message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return void
     */
    AXIS2_EXTERN void AXIS2_CALL
    axis2_msg_free(
        axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Adds a parameter.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param param pointer to parameter, message assumes ownership of
     * parameter
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_add_param(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        axutil_param_t * param);

    /**
     * Gets the named parameter.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param name parameter name string
     * @return pointer to parameter corresponding to the same name, returns
     * a reference, not a cloned copy
     */
    AXIS2_EXTERN axutil_param_t *AXIS2_CALL
    axis2_msg_get_param(
        const axis2_msg_t * msg,
        const axutil_env_t * env,
        const axis2_char_t * name);

    /**
     * Gets all parameters stored in message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return pointer to list of parameters, returns a reference, not a
     * cloned copy
     */
    AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
    axis2_msg_get_all_params(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Checks if the named parameter is locked.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param param_name parameter name string
     * @return AXIS2_TRUE if the parameter is locked, else AXIS2_FALSE
     */
    AXIS2_EXTERN axis2_bool_t AXIS2_CALL
    axis2_msg_is_param_locked(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        const axis2_char_t * param_name);

    /**
     * Sets parent. Parent of a message is of type operation.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param op pointer to parent operation, message does not assume
     * ownership of parent
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_set_parent(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        axis2_op_t * op);

    /**
     * Gets parent. Parent of a message is of type operation.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return pointer to parent operation, returns a reference, not a
     * cloned copy
     */
    AXIS2_EXTERN axis2_op_t *AXIS2_CALL
    axis2_msg_get_parent(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Gets flow of execution associated with the message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return pointer to array list containing the list of phases
     * representing the flow
     */
    AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
    axis2_msg_get_flow(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Sets flow of execution associated with the message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param flow pointer to array list of phases representing the flow,
     * message assumes ownership of flow
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_set_flow(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        axutil_array_list_t * flow);

    /**
     * Gets direction of message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return direction string
     */
    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
    axis2_msg_get_direction(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Sets direction of message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param direction pointer to direction
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_set_direction(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        const axis2_char_t * direction);

    /**
     * Gets QName representing message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return pointer to QName, returns a reference, not a cloned copy
     */
    AXIS2_EXTERN const axutil_qname_t *AXIS2_CALL
    axis2_msg_get_element_qname(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Sets QName representing message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param element_qname pointer to QName representing message, this
     * function creates a clone of QName
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_set_element_qname(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        const axutil_qname_t * element_qname);

    /**
     * Gets message name.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return message name string.
     */
    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
    axis2_msg_get_name(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Sets message name.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @param name message name string
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_set_name(
        axis2_msg_t * msg,
        const axutil_env_t * env,
        const axis2_char_t * name);

    /**
     * Gets base description.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return pointer to base description struct
     */
    AXIS2_EXTERN axis2_desc_t *AXIS2_CALL
    axis2_msg_get_base(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Gets container of parameters belonging to message.
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return returns container of parameters
     * @sa axutil_param_container
     */
    AXIS2_EXTERN axutil_param_container_t *AXIS2_CALL
    axis2_msg_get_param_container(
        const axis2_msg_t * msg,
        const axutil_env_t * env);

    /**
     * Increments the reference count to this oject
     * @param msg pointer to message
     * @param env pointer to environment struct
     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_msg_increment_ref(
        axis2_msg_t * msg,
        const axutil_env_t * env);

    /** @} */
#ifdef __cplusplus
}
#endif
#endif                          /* AXIS2_MSG_H */


text:
package in.srain.cube.diskcache;

import java.io.*;
import java.nio.charset.Charset;

public class CacheEntry {

    private static final Charset UTF_8 = Charset.forName("UTF-8");

    private final String mKey;
    private DiskCache mDiskCache;
    private long mOldSize;
    private long mSize;
    private boolean mIsUnderEdit;
    private boolean hasErrors;

    public CacheEntry(DiskCache diskCache, String key) {
        mDiskCache = diskCache;
        this.mKey = key;
    }

    private static String inputStreamToString(InputStream in) throws IOException {
        return FileUtils.readFully(new InputStreamReader(in, UTF_8));
    }

    public boolean isUnderEdit() {
        return mIsUnderEdit;
    }

    public String getKey() {
        return mKey;
    }

    public File getCacheFile() {
        return new File(mDiskCache.getDirectory(), mKey);
    }

    public long getSize() {
        return mSize;
    }

    public void setSize(long size) {
        mSize = size;
    }

    public long getLastSize() {
        return mOldSize;
    }

    public File getTempFile() {
        return new File(mDiskCache.getDirectory(), mKey + ".tmp");
    }

    public boolean isReadable() {
        return getCacheFile().exists();
    }

    /**
     * Returns an unbuffered input stream to read the last committed value,
     * or null if no value has been committed.
     */
    public InputStream getInputStream() throws IOException {
        synchronized (mDiskCache) {
            if (!isReadable()) {
                return null;
            }
            return new FileInputStream(getCacheFile());
        }
    }

    /**
     * Returns the last committed value as a string, or null if no value
     * has been committed.
     */
    public String getString() throws IOException {
        InputStream in = getInputStream();
        return in != null ? inputStreamToString(in) : null;
    }

    /**
     * Sets the value
     */
    public CacheEntry setString(String value) throws IOException {
        Writer writer = null;
        try {
            writer = new OutputStreamWriter(newOutputStream(), UTF_8);
            writer.write(value);
        } finally {
            FileUtils.closeQuietly(writer);
        }
        return this;
    }

    /**
     * Returns a new unbuffered output stream to write the value
     * If the underlying output stream encounters errors
     * when writing to the filesystem, this edit will be aborted when
     * {@link #commit} is called. The returned output stream does not throw
     * IOExceptions.
     */
    public OutputStream newOutputStream() throws IOException {
        synchronized (mDiskCache) {
            if (mIsUnderEdit) {
                throw new IllegalStateException();
            }
            mIsUnderEdit = true;
            File tempFile = getTempFile();
            File parent = tempFile.getParentFile();
            if (!parent.exists() && !parent.mkdirs()) {
                throw new IOException("Can not make sure the parent directory exist.");
            }
            return new FaultHidingOutputStream(new FileOutputStream(tempFile));
        }
    }

    /**
     * delete all content
     *
     * @return
     */
    public boolean delete() throws IOException {
        if (mIsUnderEdit) {
            throw new IOException("Try to delete an cache entry that has been being editing.");
        }
        FileUtils.deleteIfExists(getCacheFile());
        FileUtils.deleteIfExists(getTempFile());
        return true;
    }

    /**
     * Commits this edit so it is visible to readers.  This releases the
     * edit lock so another edit may be started on the same key.
     */
    public void commit() throws IOException {
        if (!mIsUnderEdit) {
            throw new IOException("CacheEntry has been closed.");
        }
        if (hasErrors) {
            mDiskCache.delete(mKey);
        } else {
            File dirty = getTempFile();
            if (dirty.exists()) {
                File clean = getCacheFile();
                dirty.renameTo(clean);
                mOldSize = mSize;
                mSize = clean.length();
                mDiskCache.commitEdit(this);
            } else {
                abortEdit();
            }
        }
        mIsUnderEdit = false;
    }

    /*
     * Aborts this edit. This releases the edit lock so another edit may be
     * started on the same mKey.
     */
    public synchronized void abortEdit() throws IOException {
        if (!mIsUnderEdit) {
            return;
        }
        mIsUnderEdit = false;
        FileUtils.deleteIfExists(getTempFile());
        mDiskCache.abortEdit(this);
    }

    private class FaultHidingOutputStream extends FilterOutputStream {
        private FaultHidingOutputStream(OutputStream out) {
            super(out);
        }

        @Override
        public void write(int oneByte) {
            try {
                out.write(oneByte);
            } catch (IOException e) {
                hasErrors = true;
            }
        }

        @Override
        public void write(byte[] buffer, int offset, int length) {
            try {
                out.write(buffer, offset, length);
            } catch (IOException e) {
                hasErrors = true;
            }
        }

        @Override
        public void close() {
            try {
                out.close();
            } catch (IOException e) {
                hasErrors = true;
            }
        }

        @Override
        public void flush() {
            try {
                out.flush();
            } catch (IOException e) {
                hasErrors = true;
            }
        }
    }
}


text:
package com.alibaba.json.bvt.serializer;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.ParserConfig;

import junit.framework.TestCase;

public class ParserConfigTest extends TestCase {

    public void test_0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.getDeserializers();
    }

    public void test_1() throws Exception {
        ParserConfig config = new ParserConfig(Thread.currentThread().getContextClassLoader());

        Model model = JSON.parseObject("{\"value\":123}", Model.class, config);
        Assert.assertEquals(123, model.value);
    }

    public static class Model {
        public int value;
    }
}


text:
/*
 * PatchTest.h
 *
 *  Created on: Feb 15, 2012
 *      Author: Kristof Unterweger
 */

#ifndef PEANO_APPLICATIONS_PEANOCLAW_TESTS_PATCHTEST_H_
#define PEANO_APPLICATIONS_PEANOCLAW_TESTS_PATCHTEST_H_

#include "tarch/tests/TestCase.h"
#include "tarch/logging/Log.h"

#include <vector>

#include "peanoclaw/Patch.h"
#include "peanoclaw/records/Data.h"

namespace peanoclaw {
  namespace tests {
  class PatchTest;
  }
}

/**
 * This is just a default test case that demonstrated how to write unit tests
 * in Peano. Feel free to rename, remove, or duplicate it. It is not required
 * by the project but often useful if you wanna write unit tests.
 */
class peanoclaw::tests::PatchTest: public tarch::tests::TestCase {
  private:
    typedef peanoclaw::records::Data Data;

    /**
     * Logging device
     */
    static tarch::logging::Log _log;

    /**
     * Test wether the filling of the uNew-Array is working properly.
     * Working on the 3x3x2 array
     *
     * Unknown 0:    Unknown 1:
     * 0 1 2          9 10 11
     * 3 4 5         12 13 14
     * 6 7 8         15 16 17
     */
    void testFillingOfUNewArray();

    /**
     * Test wether the filling of the uOld-Array is working properly.
     * Working on the 5x5 array
     *
     * Unknown 0:             Unknown 1:
     *  0  1  2  3  4         25 26 27 28 29
     *  5  6  7  8  9         30 31 32 33 34
     * 10 11 12 13 14         35 36 37 38 39
     * 15 16 17 18 19         40 41 42 43 44
     * 20 21 22 23 24         45 46 47 48 49
     */
    void testFillingOfUOldArray();

    /**
     * Checks wether a Patch object created via the default
     * constructor is considered to be invalid.
     */
    void testInvalidPatch();

    /**
     * This test checks whether the calculation of the coarse patch time interval
     * works as designed. Therefore, a 3x3 array of patches is set up with the
     * following time intervals
     * [1.0, 3.0] [1.0, 3.0] [1.0, 4.0]
     * [0.0, 3.0] [1.0, 2.7] [0.0, 4.0]
     * [0.0, 3.0] [1.0, 3.0] [2.5, 4.0]
     *
     * Here the first value is the time of the last timestep, the second value
     * the time of the current timestep. The timestep size therefore is the
     * difference of them. The correct time interval of the coarse patch is
     * [2.5, 2.7].
     */
    void testCoarsePatchTimeInterval();

    /**
     * Tests the counting of adjacent subgrids that reside on different ranks.
     *
     * For this test four vertices with the following adjacency information are created:
     *  1   1   1   1
     *   v2      v3
     *  0   0   0   0
     *
     *  0   0   0   0
     *   v0      v1
     *  0   0   0   0
     *
     *  Therefore, there is one neighboring rank and two vertices that are shared between
     *  the local and the neighboring rank.
     */
    void testCountingOfAdjacentParallelSubgrids();

    /**
     * Tests the counting of adjacent subgrids that reside on different ranks
     * where more than one ranks are neighboring.
     *
     * For this test four vertices with the following adjacency information are created:
     *  1   1   1   1
     *   v2      v3
     *  4   0   0   2
     *
     *  4   0   0   2
     *   v0      v1
     *  3   3   3   3
     *
     *  Therefore, there are four neighboring ranks. I.e. the number of shared vertices
     *  can't be counted.
     */
    void testCountingOfAdjacentParallelSubgridsFourNeighboringRanks();

    /**
     * Tests the setting of the overlap of remote ghostlayers which is done in
     * AdjacentSubgrids. The following setup is considered:
     *
     * Ranks:
     * 0   0
     *   v
     * 1   2
     *
     * The top-left subgrid does not exist, only the top-right subgrid is considered.
     * The subcell size is 0.1x0.1 in every case, while the ghostlayer width of
     * rank 1 is 2 and for rank 2 is 1.
     * The expected result in the according fields of the subgrid are:
     *
     *  0|   0  |0
     * --|------|--
     *  0|      |0
     *   |      |
     * --|------|--
     *  2|   1  |0
     */
    void testSettingOverlapOfRemoteGhostlayer();

    /**
     * Tests the number of manifolds for a subgrid as well as the
     * determination of the actual manifolds.
     */
    void testManifolds();

    /**
     * Tests the number of adjacent manifolds for a given manifold
     * of a given dimensionality.
     */
    void testNumberOfAdjacentManifolds();

    /**
     * Tests the determination of adjacent manifolds for a given
     * manifold of a given dimensionality. This operation is done
     * in Region::getIndexOfAdjacentManifold(...)
     *
     *  0|   0  |0
     * --|------|--
     *  1|      |0
     *   |      |
     * --|------|--
     *  1|   1  |0
     */
    void testAdjacentManifolds();

    /**
     * Tests the determination of the overlapped regions by remote
     * ghostlayers.
     *
     * For 2D we test the following scenario, where the first
     * number represents the adjacent rank and the second represents
     * the overlap.
     *
     * 1/2|  2/2 |2/3
     *  --|------|--
     * 1/2|      |0/2
     *    |      |
     *  --|------|--
     * 1/3|  1/2 |0/2
     *
     * The subdivision factor of the subgrid is 6. Hence, we expect
     * the following regions for rank 1:
     *
     * offset, size
     * [0, 0], [3, 3]
     * [0, 3], [2, 3]
     * [3, 0], [3, 2]
     *
     * and for rank 2:
     *
     * offset, size
     * [3, 3], [3, 3]
     * [0, 4], [3, 2]
     *
     *
     * For 3D a similar setup is used, where the upper settings are mapped
     * to the x0/x2 plane. Additionally, all corners with x1==-1 have an overlap
     * of 3, while all corners with x1==1 have an overlap of 2.
     * Hence, we expect the following regions for rank 1:
     *
     * offset,    size
     * [0, 0, 0], [3, 3, 3]
     * [
     */
    void testOverlapOfRemoteGhostlayers();

    /**
     * A second testcase for a problem that occured in 2D:
     *
     *0/18| 0/18 |0/18
     *  --|------|--
     * 1/0|      |2/2
     *    |      |
     *  --|------|--
     * 1/0|  1/0 |2/2
     *
     * The subdivision factor is 18.
     * For rank 2 there is only one region expected:
     *
     * offset,  size
     * [16, 0], [2, 18]
     */
    void testOverlapOfRemoteGhostlayers2();

    /**
     * Tests the resulting regions if the overlap of a subgrid
     * with subdivision factor [6,3,3] on rank 1 is overlapped
     * by remote ghostlayers of width 2 from rank 2 with the
     * following pattern:
     *
     * [2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
     *
     * The result should be a single region with
     *  offset=[0,0,0] and size=[6,3,2]
     */
    void testOverlapOfRemoteGhostlayers3D();

  public:
    PatchTest();
    virtual ~PatchTest();

    virtual void run();

    virtual void setUp();
};

#endif /* PEANO_APPLICATIONS_PEANOCLAW_TESTS_PATCHTEST_H_ */


text:
<?php

namespace TIExpert\WSBoletoSantander;

/**
 * Classe de acesso e manipulação às configurações do WS Boletos Santander contidas no arquivo de configuração
 *
 * @author Denys Xavier <equipe@tiexpert.net>
 */
class Config {

    /** @property string $caminhoArquivoConfig Caminho para o arquivo de configuração utilizado. */
    private static $caminhoArquivoConfig = __DIR__ . "/config.ini";

    /** @property array $config Array de configurações unificado. */
    private static $config = array(
        "convenio" => array(
            "banco_padrao" => "0033",
            "convenio_padrao" => ""),
        "instrucoes_banco" => array(
            "tipo_desconto" => 0,
            "valor_desconto" => 0,
            "data_limite_desconto" => "now",
            "tipo_protesto" => 0,
            "baixar_apos" => 0),
        "geral" => array(
            "assegurar_endpoint" => true,
            "timeout" => 30,
            "ambiente" => "T",
            "formato_data" => "dmY",
            "estacao" => ""),
        "certificado" => array(
            "arquivo" => "",
            "senha" => "",
            "tipo_arquivo" => "PEM",
            "diretorio_cas" => "",
            "arquivo_ca" => "")
    );

    /** @property Config $instance Ponteiro para a instância única de Config */
    private static $instance;

    /** Cria uma nova instância de Config
     *
     * @param string $caminhoArquivoConfig Caminho para o arquivo de configuração utilizado. Se nada for informado, então, será considerado o arquivo config.ini da mesma pasta que o arquivo da classe Config.
     */
    private function __construct() {
        $this->carregarConfiguracao();
    }

    /** Obtém uma instância de Config
     *
     * @return Config
     */
    public static function getInstance() {
        if (is_null(self::$instance)) {
            self::$instance = new Config();
        }
        return self::$instance;
    }

    /** Obtém o caminho do arquivo de configuração que está sendo usado
     *
     * @return string
     */
    public static function getCaminhoArquivoConfig() {
        return self::$caminhoArquivoConfig;
    }

    /** Define qual o caminho do arquivo de configuração a ser usado.
     *
     * Caso uma instância de Config já tenha sido criada com o método getInstance(), então, não é mais possível alterar esta propriedade e o novo valor é ignorado.
     *
     * @param string $caminhoArquivoConfig Caminho para o arquivo de configuração a ser utilizado ou criado
     */
    public static function setCaminhoArquivoConfig($caminhoArquivoConfig) {
        $caminhoAnterior = self::$caminhoArquivoConfig;
        self::$caminhoArquivoConfig = $caminhoArquivoConfig;

        if (!is_null(self::$instance) && $caminhoAnterior != $caminhoArquivoConfig) {
            self::carregarConfiguracao();
        }
    }

    /** Obtém o valor da chave informada dentro do grupo convenio
     *
     * @param string $chave Nome da chave da qual o valor deve ser retornado
     * @return mixed
     */
    public function getConvenio($chave) {
        return $this->getOpcao("convenio", $chave);
    }

    /** Obtém o valor da chave informada dentro do grupo instrucoes_banco
     *
     * @param string $chave Nome da chave da qual o valor deve ser retornado
     * @return mixed
     */
    public function getInstrucao($chave) {
        return $this->getOpcao("instrucoes_banco", $chave);
    }

    /** Obtém o valor da chave informada dentro do grupo geral
     *
     * @param string $chave Nome da chave da qual o valor deve ser retornado
     * @return mixed
     */
    public function getGeral($chave) {
        return $this->getOpcao("geral", $chave);
    }

    /** Obtém o valor da chave informada dentro do grupo certificado
     *
     * @param string $chave Nome da chave da qual o valor deve ser retornado
     * @return mixed
     */
    public function getCertificado($chave) {
        return $this->getOpcao("certificado", $chave);
    }

    /** Obtém o valor da chave informada dentro do grupo informado
     *
     *
     * @return mixed
     */
    public function getOpcao($grupo, $chave) {
        if (isset(self::$config[$grupo][$chave])) {
            return self::$config[$grupo][$chave];
        } else {
            throw new \InvalidArgumentException("O valor da chave " . $chave . " pertencente ao grupo " . $grupo . " não existe.");
        }
    }

    /** Carrega as configurações a partir de um arquivo INI */
    private static function carregarConfiguracao() {
        if (file_exists(self::$caminhoArquivoConfig)) {
            self::$config = parse_ini_file(self::$caminhoArquivoConfig, true);
        } else {
            self::criarArquivoDeConfiguracao();
        }
    }

    /** Cria um novo arquivo de configuração no caminho especificado baseado nos dados padrões do array $config
     *
     * @throws \Exception se acontecer algum problema ao tentar manipular o arquivo.
     */
    private static function criarArquivoDeConfiguracao() {
        $handler = @fopen(self::$caminhoArquivoConfig, "w");
        if ($handler) {
            $ini = self::converterArrayDeConfiguracaoParaINI();

            fwrite($handler, $ini);
            fclose($handler);
        } else {
            $err = error_get_last();
            throw new \Exception("Não foi possível encontrar o arquivo de configuração e, ao tentar criá-lo, ocorreu o seguinte erro: " . $err["message"]);
        }
    }

    /** Converte o array $config da instância atual para uma string formatada pronta para ser gravada em um arquivo .ini
     *
     * @return string
     */
    private static function converterArrayDeConfiguracaoParaINI() {
        $ini = "; Este arquivo foi criado automaticamente ao tentar acessar as configurações do WSBoletoSantander
; Se quiser uma versão com as opções comentadas, acesse: https://github.com/DenysXavier/WSBoletoSantander
; Arquivo de configuração gerado em " . date("d/m/Y H:i:s") . PHP_EOL;

        foreach (self::$config as $grupo => $chaves) {
            $ini .= PHP_EOL . self::converterStringEmGrupoDeConfiguracaoINI($grupo);
            foreach ($chaves as $chave => $valor) {
                $ini .= self::converterChaveEValorEmLinhaDeOpcaoINI($chave, $valor);
            }
        }

        return $ini;
    }

    /** Formata uma string qualquer em um grupo de configuração.
     *
     * Por exemplo, uma string "XPTO" seria formatada como [XPTO].
     *
     * @param string $string String a ser convertida em um formato de grupo
     * @return string
     */
    private static function converterStringEmGrupoDeConfiguracaoINI($string) {
        return "[" . $string . "]" . PHP_EOL;
    }

    /** Formata duas strings quaisquer em uma linha de opção de configuração.
     *
     * Por exemplo: uma string de chave "ordenar" e outra string de valor "ASC" resulta na linha de configuração ordernar = "ASC".
     *
     * @param string $chave A string que será usada como chave de configuração
     * @param string $valor A string que será usada como valor da chave de configuração
     * @return string
     */
    private static function converterChaveEValorEmLinhaDeOpcaoINI($chave, $valor) {
        $str = $chave . " = ";
        if (is_string($valor)) {
            $valor = '"' . $valor . '"';
        }
        $str .= $valor . PHP_EOL;
        return $str;
    }

}


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Hjerpbakk.DIPSBot;
using Hjerpbakk.DIPSBot.Configuration;
using Hjerpbakk.DIPSBot.Telemetry;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
using Newtonsoft.Json;

namespace Hjerpbakk.DIPSbot.Runner {
    class Program {
        static async Task Main() {
            try {
                Console.WriteLine("Fetching configuration...");
                var configuration = ReadConfig();
                configuration.Context = new Context();

                ITelemetryServiceClient telemetryServiceClient;
                if (string.IsNullOrEmpty(configuration.InstrumentationKey)) {
                    telemetryServiceClient = new EmptyTelemetryServiceClient();
                } else {
                    TelemetryConfiguration.Active.InstrumentationKey = configuration.InstrumentationKey;
                    var telemetryClient = new TelemetryClient();
                    telemetryClient.Context.Component.Version = configuration.Context.Version;
                    telemetryServiceClient = new TelemetryServiceClient(telemetryClient);
                }

                var dipsBot = new DIPSbotHost(telemetryServiceClient);
                await dipsBot.Start(configuration);
            } catch (Exception e) {
                Console.WriteLine("Could not start DIPSbot.");
                Console.WriteLine(e.Demystify());
                throw;
            }
        }

        static AppConfiguration ReadConfig() {
            return JsonConvert.DeserializeObject<AppConfiguration>(File.ReadAllText("config.json"));
        }
    }
}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('personal_access_tokens', function (Blueprint $table) {
            $table->id();
            $table->morphs('tokenable');
            $table->string('name');
            $table->string('token', 64)->unique();
            $table->text('abilities')->nullable();
            $table->timestamp('last_used_at')->nullable();
            $table->timestamp('expires_at')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('personal_access_tokens');
    }
};


text:
export HADOOP_HOME=/opt/hadoop

AWS_SDK_JAR=$(find ${HADOOP_HOME}/share/hadoop/tools/lib -name 'aws-java-sdk-bundle-*.jar')
HADOOP_AWS_JAR=$(find ${HADOOP_HOME}/share/hadoop/tools/lib -name 'hadoop-aws-*.jar')

export HADOOP_CLASSPATH=${AWS_SDK_JAR}:${HADOOP_AWS_JAR}

perl -wp -i -e 's!thrift://localhost:9083!thrift://0.0.0.0:9083!' conf/metastore-site.xml

bin/schematool -initSchema -dbType derby
bin/start-metastore