text:
(function (glob) {
    var E = '',
        TEMPLATE = 'template',
        PARTIAL = 'partial',
        SPEC = 'spec',
        MicroAjax = glob.MicroAjax, // fn
        Handlebars = glob.Handlebars, // fn

        defined = function () {
            for (var i = 0, ii = arguments.length; i < ii; i++) {
                if (arguments[i] !== undefined) {
                    return arguments[i];
                }
            }
        };

    Handlebars.quick = {
        options: {
            templatePath: E,
            templateFileExtension: '.hbs',
            partialPath: E,
            partialFilePrefix: '_',
            specPath: E,
            specFileExtension: '.json'
        },

        /**
         * @private
         *
         * @param {string} url
         * @param {function} callback
         * @param {*} args
         */
        fetch: function (url, callback, args) {
            var scope = this;
            new MicroAjax(url, function (response) {
                callback.call(scope, response, args);
            });
        },

        /**
         * @private
         *
         * @param {string} type `template`, `spec` or `partial`
         * @param {string} name
         * @returns {string}
         */
        getUrl: function (type, name) {
            var url = E;

            // If direct URL calls are made, then we do not need to transform the URL
            if (/^(http|https|ftp):\/\//.test(name)) {
                return name;
            }

            switch (type) {
            case 'template':
                url += this.options.templatePath + name + this.options.templateFileExtension;
                break;
            case 'partial':
                url += this.options.partialPath + this.options.partialFilePrefix + name +
                    this.options.templateFileExtension;
                break;
            case 'spec':
                url += this.options.specPath + name + this.options.specFileExtension;
                break;
            }

            return url;
        },

        /**
         * @param {string|object} item
         * @param {*=} [value=]
         */
        configure: function (item, value) {
            if (item && value !== undefined) {
                this.options[item] = value;
            }
            // also accept an object to set multiple configurations simultaneously
            else if (typeof item === 'object') {
                Handlebars.Utils.extend(this.options, item);
            }
        },

        /**
         * @param {string|array<string>} partials
         * @param {function} callback
         */
        registerPartialAsync: function (partials, callback) {
            var loaded = 0,
                i,
                ii,

                processAsyncPartialResponse = function (response, partial) {
                    Handlebars.registerPartial(partial, response);

                    // execute callback when all partials are loaded
                    // verify requested partial count vs load count so that synchronous ajax calls can be supported
                    if ((++loaded) === partials.length) {
                        Handlebars.Utils.isFunction(callback) && callback.call(this);
                    }

                };

            if (!defined(partials)) {
                Handlebars.Utils.isFunction(callback) && callback.call(this);
                return;
            }

            // convert to array if a single one is sent
            partials = [].concat(partials);

            for (i = 0, ii = partials.length; i < ii; i++) {
                this.fetch(this.getUrl(PARTIAL, partials[i]), processAsyncPartialResponse, partials[i]);
            }
        },

        /**
         * This function will accept a handlebar template and its associated specifications object and after
         * compiling it set the result to the target HTMLDOM element provided.
         *
         * @param {string} target
         * @param {string} template
         * @param {object} spec
         * @param {function} callback
         */
        render: function (target, template, spec, callback) {
            var elements,
                i,
                ii;

            // ensure that the target element provided is a valid set of HTML DOM objects in case param is a string
            switch (target.charAt && target.charAt()) {
            case '#':
                elements = [glob.document.getElementById(target.replace(/^#/g, E))];
                break;

            case '.':
                elements = glob.document.getElementsByClassName(target.replace(/^./g, E));
                break;

            default:
                if (typeof target === 'string') {
                    elements = glob.document.getElementsByTagName(target);
                }
                else if (Handlebars.Utils.isArray(target)) {
                    elements = [].concat(target);
                }
                else if (target) {
                    elements = [target];
                }
            }

            if (elements) {
                for (i = 0, ii = elements.length; i < ii; i++) {
                    if (elements[i]) {
                        elements[i].innerHTML = Handlebars.compile(template || E)(spec || {});
                    }
                }
            }

            Handlebars.Utils.isFunction(callback) && callback();

            // return promise;
        },

        /**
         * @param {string} target
         * @param {string} templateName
         * @param {string|object} specName
         * @param {function} callback
         */
        renderAsync: function (target, templateName, specName, callback) {
            var template,
                spec,

                renderIfPossible = function () {
                    // check if spec and template are both available and then call render.
                    if (template && spec) {
                        this.render(target, template, spec);
                        Handlebars.Utils.isFunction(callback) && callback.call(this);
                    }
                };

            if (typeof specName === 'string') {
                this.fetch(this.getUrl(SPEC, specName), function (response) {
                    spec = JSON.parse(response);
                    renderIfPossible.call(this);
                });
            }
            // in case spec is already a JSON, we use it as spec
            else {
                spec = specName || {};
            }

            this.fetch(this.getUrl(TEMPLATE, templateName), function (response) {
                template = response;
                renderIfPossible.call(this);
            });
        }
    };
}(this));


text:
from __future__ import unicode_literals

import unittest

from mopidy_pioneer import Extension, frontend as frontend_lib

class ExtensionTest(unittest.TestCase):

    def test_get_default_config(self):
        ext = Extension()

        config = ext.get_default_config()

        self.assertIn('[pioneer]', config)
        self.assertIn('enabled = true', config)

    def test_get_config_schema(self):
        ext = Extension()

        schema = ext.get_config_schema()

        # TODO Test the content of your config schema
        #self.assertIn('username', schema)
        #self.assertIn('password', schema)

    # TODO Write more tests

redpajama_set_name: RedPajamaGithub


text:
local IO = require "kong.tools.io"
local utils = require "kong.tools.utils"
local cache = require "kong.tools.database_cache"
local stringy = require "stringy"
local constants = require "kong.constants"
local responses = require "kong.tools.responses"

-- Define the plugins to load here, in the appropriate order
local plugins = {}

local _M = {}

local function get_now()
  return ngx.now() * 1000
end

local function load_plugin_conf(api_id, consumer_id, plugin_name)
  local cache_key = cache.plugin_configuration_key(plugin_name, api_id, consumer_id)

  local plugin = cache.get_or_set(cache_key, function()
    local rows, err = dao.plugins_configurations:find_by_keys {
        api_id = api_id,
        consumer_id = consumer_id ~= nil and consumer_id or constants.DATABASE_NULL_ID,
        name = plugin_name
      }
      if err then
        return responses.send_HTTP_INTERNAL_SERVER_ERROR(err)
      end

      if #rows > 0 then
        return table.remove(rows, 1)
      else
        return { null = true }
      end
  end)

  if plugin and not plugin.null and plugin.enabled then
    return plugin
  else
    return nil
  end
end

local function init_plugins()
  -- TODO: this should be handled with other default config values
  configuration.plugins_available = configuration.plugins_available or {}

  print("Discovering used plugins")
  local db_plugins, err = dao.plugins_configurations:find_distinct()
  if err then
    error(err)
  end

  -- Checking that the plugins in the DB are also enabled
  for _, v in ipairs(db_plugins) do
    if not utils.table_contains(configuration.plugins_available, v) then
      error("You are using a plugin that has not been enabled in the configuration: "..v)
    end
  end

  local loaded_plugins = {}

  for _, v in ipairs(configuration.plugins_available) do
    local loaded, plugin_handler_mod = utils.load_module_if_exists("kong.plugins."..v..".handler")
    if not loaded then
      error("The following plugin has been enabled in the configuration but it is not installed on the system: "..v)
    else
      print("Loading plugin: "..v)
      table.insert(loaded_plugins, {
        name = v,
        handler = plugin_handler_mod()
      })
    end
  end

  table.sort(loaded_plugins, function(a, b)
    local priority_a = a.handler.PRIORITY or 0
    local priority_b = b.handler.PRIORITY or 0
    return priority_a > priority_b
  end)

  -- resolver is always the first plugin as it is the one retrieving any needed information
  table.insert(loaded_plugins, 1, {
    resolver = true,
    name = "resolver",
    handler = require("kong.resolver.handler")()
  })

  if configuration.send_anonymous_reports then
    table.insert(loaded_plugins, 1, {
      reports = true,
      name = "reports",
      handler = require("kong.reports.handler")()
    })
  end

  return loaded_plugins
end

-- To be called by nginx's init_by_lua directive.
-- Execution:
--   - load the configuration from the path computed by the CLI
--   - instanciate the DAO Factory
--   - load the used plugins
--     - load all plugins if used and installed
--     - sort the plugins by priority
--     - load the resolver
--   - prepare DB statements
--
-- If any error during the initialization of the DAO or plugins,
-- it will be thrown and needs to be catched in init_by_lua.
function _M.init()
  -- Loading configuration
  configuration, dao = IO.load_configuration_and_dao(os.getenv("KONG_CONF"))

  -- Initializing plugins
  plugins = init_plugins()

  -- Prepare all collections' statements. Even if optional, this call is useful to check
  -- all statements are valid in advance.
  local err = dao:prepare()
  if err then
    error(err)
  end
  ngx.update_time()
end

-- Calls `init_worker()` on eveyr loaded plugin
function _M.exec_plugins_init_worker()
  for _, plugin in ipairs(plugins) do
    plugin.handler:init_worker()
  end
end

function _M.exec_plugins_certificate()
  ngx.ctx.plugin_conf = {}

  for _, plugin in ipairs(plugins) do
    if ngx.ctx.api then
      ngx.ctx.plugin_conf[plugin.name] = load_plugin_conf(ngx.ctx.api.id, nil, plugin.name)
    end

    local plugin_conf = ngx.ctx.plugin_conf[plugin.name]
    if not ngx.ctx.stop_phases and (plugin.resolver or plugin_conf) then
      plugin.handler:certificate(plugin_conf and plugin_conf.value or {})
    end
  end

  return
end

-- Calls `access()` on every loaded plugin
function _M.exec_plugins_access()
  local start = get_now()
  ngx.ctx.plugin_conf = {}

  -- Iterate over all the plugins
  for _, plugin in ipairs(plugins) do
    if ngx.ctx.api then
      ngx.ctx.plugin_conf[plugin.name] = load_plugin_conf(ngx.ctx.api.id, nil, plugin.name)
      local consumer_id = ngx.ctx.authenticated_entity and ngx.ctx.authenticated_entity.consumer_id or nil
      if consumer_id then
        local app_plugin_conf = load_plugin_conf(ngx.ctx.api.id, consumer_id, plugin.name)
        if app_plugin_conf then
          ngx.ctx.plugin_conf[plugin.name] = app_plugin_conf
        end
      end
    end

    local plugin_conf = ngx.ctx.plugin_conf[plugin.name]
    if not ngx.ctx.stop_phases and (plugin.resolver or plugin_conf) then
      plugin.handler:access(plugin_conf and plugin_conf.value or {})
    end
  end
  -- Append any modified querystring parameters
  local parts = stringy.split(ngx.var.backend_url, "?")
  local final_url = parts[1]
  if utils.table_size(ngx.req.get_uri_args()) > 0 then
    final_url = final_url.."?"..ngx.encode_args(ngx.req.get_uri_args())
  end
  ngx.var.backend_url = final_url

  local t_end = get_now()
  ngx.ctx.kong_processing_access = t_end - start
  -- Setting a property that will be available for every plugin
  ngx.ctx.proxy_started_at = t_end
end

-- Calls `header_filter()` on every loaded plugin
function _M.exec_plugins_header_filter()
  local start = get_now()
  -- Setting a property that will be available for every plugin
  ngx.ctx.proxy_ended_at = start

  if not ngx.ctx.stop_phases then
    ngx.header["Via"] = constants.NAME.."/"..constants.VERSION

    for _, plugin in ipairs(plugins) do
      local plugin_conf = ngx.ctx.plugin_conf[plugin.name]
      if plugin_conf then
        plugin.handler:header_filter(plugin_conf and plugin_conf.value or {})
      end
    end
  end
  ngx.ctx.kong_processing_header_filter = get_now() - start
end

-- Calls `body_filter()` on every loaded plugin
function _M.exec_plugins_body_filter()
  local start = get_now()
  if not ngx.ctx.stop_phases then
    for _, plugin in ipairs(plugins) do
      local plugin_conf = ngx.ctx.plugin_conf[plugin.name]
      if plugin_conf then
        plugin.handler:body_filter(plugin_conf and plugin_conf.value or {})
      end
    end
  end
  ngx.ctx.kong_processing_body_filter = (ngx.ctx.kong_processing_body_filter or 0) + (get_now() - start)
end

-- Calls `log()` on every loaded plugin
function _M.exec_plugins_log()
  if not ngx.ctx.stop_phases then
    for _, plugin in ipairs(plugins) do
      local plugin_conf = ngx.ctx.plugin_conf[plugin.name]
      if plugin_conf or plugin.reports then
        plugin.handler:log(plugin_conf and plugin_conf.value or {})
      end
    end
  end
end

return _M


text:
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - effects - cardboard</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				margin: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>

		<script src="../build/three.js"></script>

		<script src="js/WebVR.js"></script>
		<script src="js/controls/VRControls.js"></script>
		<script src="js/effects/VREffect.js"></script>
		<script>

			if ( WEBVR.isLatestAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var camera, scene, renderer;
			var effect, controls;

			init();
			animate();

			function init() {

				scene = new THREE.Scene();

				var dummy = new THREE.Camera();
				dummy.position.set( 2, 1, 2 );
				dummy.lookAt( scene.position );
				scene.add( dummy );

				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
				dummy.add( camera );

				var geometry = new THREE.TorusKnotGeometry( 0.4, 0.15, 150, 20 );;
				var material = new THREE.MeshStandardMaterial( { roughness: 0.01, metalness: 0.2 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = 0.75;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var geometry = new THREE.BoxGeometry( 3, 0.1, 3 );
				var material = new THREE.MeshStandardMaterial( { roughness: 1.0, metalness: 0.0 } );
				var mesh = new THREE.Mesh( geometry, material );
				mesh.position.y = - 0.1;
				mesh.castShadow = true;
				mesh.receiveShadow = true;
				scene.add( mesh );

				var light = new THREE.DirectionalLight( 0x8800ff );
				light.position.set( - 1, 1.5, 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				var light = new THREE.DirectionalLight( 0xff0000 );
				light.position.set( 1, 1.5, - 0.5 );
				light.castShadow = true;
				light.shadow.camera.zoom = 4;
				scene.add( light );

				//

				renderer = new THREE.WebGLRenderer( { antialias: true } );
				renderer.setClearColor( 0x101010 );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				renderer.shadowMap.enabled = true;
				document.body.appendChild( renderer.domElement );

				//

				controls = new THREE.VRControls( camera );
				effect = new THREE.VREffect( renderer );

				if ( WEBVR.isAvailable() === true ) {

					document.body.appendChild( WEBVR.getButton( effect ) );

				}

				//

				window.addEventListener( 'resize', onWindowResize, false );

			}

			function onWindowResize() {

				camera.aspect = window.innerWidth / window.innerHeight;
				camera.updateProjectionMatrix();

				effect.setSize( window.innerWidth, window.innerHeight );

			}

			function animate() {

				requestAnimationFrame( animate );
				render();

			}

			function render() {

				var time = performance.now() * 0.0002;
				var mesh = scene.children[ 1 ];
				mesh.rotation.x = time * 2;
				mesh.rotation.y = time * 5;

				controls.update();

				effect.render( scene, camera );

			}

		</script>
	</body>
</html>


text:
using System.Collections.Generic;

namespace TestModels
{
    /// <summary>
    /// A class with a keyed list.
    /// </summary>
    /// <seealso cref="TestModels.ITestable" />
    public class ObjectWithNoKeyedList : ITestable
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectWithNoKeyedList"/> class.
        /// </summary>
        public ObjectWithNoKeyedList()
        {
            this.Positions = new List<Position>();
        }

        /// <summary>
        /// Gets or sets the positions.
        /// </summary>
        /// <value>
        /// The positions.
        /// </value>
        public List<Position> Positions
        {
            get;
            set;
        }

        /// <summary>
        /// Initializes the test0.
        /// </summary>
        /// <returns>a created and initialized object.</returns>
        public static object InitializeTest0()
        {
            ObjectWithNoKeyedList lResult = new ObjectWithNoKeyedList();
            lResult.Positions = new List<Position>();
            lResult.Positions.Add(new Position { X = 12, Y = 44 });
            lResult.Positions.Add(new Position { X = 77, Y = 44 });
            return lResult;
        }

        /// <summary>
        /// Initializes the test1.
        /// </summary>
        /// <returns>a created and initialized object.</returns>
        public static object InitializeTest1()
        {
            ObjectWithNoKeyedList lResult = new ObjectWithNoKeyedList();
            lResult.Positions = new List<Position>();
            return lResult;
        }
    }
}


text:
This directory contains the needed files for setting up the Vagrant development environment for the jboss\_admin project.

## Setup
Setup instructions not specific to either WildFly or JBoss EAP.

1. `> cd puppet-jboss_admin`
2. `bundle`

## WildFly 7.x

By default the vagrant instance will install the latest WildFly 7.x version for developing the jboss\_admin module against.

### Instructions
1. `> cd puppet-jboss_admin`
2. `> vagrant up`

## JBoss EAP 6.x

To develop the jboss\_admin module against JBoss EAP 6.x a zip of JBoss EAP 6.x will need to be provided to the Vagrant instance to install. Follow the instructions here to have the vagrant instance install JBoss EAP 6.x rather then WildFly.

### Instructions
The instructrions for setting up the development environment to use JBoss EAP is seperated into two stages. Creating the JBoss EAP ZIP and secondly starting the Vagrant instance using that ZIP.

#### Create JBoss EAP Zip
The JBoss EAP Zips provided by Red Hat all have different root directories which does not play well with Puppet. At the very minimum the ZIP provided by Red Hat needs to be changed to have a consistent root directory of **jboss-eap**. This is also a good chance to apply any needed patches as Red Hat provided ZIPs do not contain micro version patches.

1. Download JBoss EAP 6.x from http:://access.redhat.com
2. Extract the ZIP
3. Apply any patches
4. rename the root directory to`jboss-eap`
5. `> zip -r jboss-eap.zip jboss-eap`
  * It is important that the root directory of the zip be `jboss-eap` for Puppet to be able to properly extract the contents
6. Take note of the `jboss-eap.zip` location, later refered to as **PATH_TO_JBOSS_EAP_ZIP**

#### Start the Development Instance
1. `> cd puppet-jboss_admin`
2. `> JBOSS_EAP=PATH_TO_JBOSS_EAP_ZIP vagrant up`
  * **PATH_TO_JBOSS_EAP_ZIP**: the full path to the ZIP created in [Create JBoss EAP Zip](#Create JBoss EAP Zip) section


text:
package engine.calculation;

import engine.calculation.drawables.Drawable;
import engine.calculation.vector.implementations.VectorMachineBuilder;
import engine.calculation.vector.VectorMachineEvaluator;
import engine.expressions.Calculable;
import engine.expressions.Equation;
import engine.expressions.parser.ClauseType;
import engine.expressions.parser.ParsingException;
import engine.calculation.drawables.DrawToImage;
import engine.calculation.drawables.RectRange;
import engine.expressions.parser.antlr.AntlrExpressionParser;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.concurrent.Executors;

import static org.junit.Assert.fail;

/**
 * User: Oleksiy Pylypenko
 * Date: 2/8/13
 * Time: 10:24 PM
 */
public class VectorCalculationEngineTest {
    private static final File DIR = new File("test_images");

    private CalculationEngine eng;

    @Before
    public void setUp() throws Exception {
        DIR.mkdirs();
        VectorMachineBuilder builder = new VectorMachineBuilder();
        builder.setConcurrency(2, Executors.newFixedThreadPool(2));
        VectorMachineEvaluator evaluator = new VectorMachineEvaluator(builder);
        eng = new VectorCalculationEngine(evaluator);
    }

    @Test
    public void testCalculate() throws Exception {
        Equation eq1 = eq("y", "1-(x/2-0.5)*(x/2-0.5)");
        Equation eq2 = eq("(x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)", "0.1");
        Equation eq3 = eq("(x-0.5)*(x-0.5)*2+(y-0.5)*(y-0.5)", "0.1");
        draw("vce1_1.png", eq1);
        draw("vce1_2.png", eq2);
        draw("vce1_3.png", eq3);
    }

    void draw(String file, Equation... eqs) {
        ViewportSize size = new ViewportSize(1000, 1000);
        CalculationParameters params = new CalculationParameters(
                new ViewportBounds(0, 0, 1, 1),
                size, 0, eqs);
        CalculationResults results = eng.calculate(params);

        RectRange range = RectRange.fromViewportSize(size);
        DrawToImage drawer = new DrawToImage(range);
        for (Drawable drawable : results.getDrawables()) {
            drawer.draw(drawable.getSize(), drawable);
        }
        try {
            drawer.writePng(new File(DIR, file), range);
        } catch (IOException e) {
            fail("IOException: " + e);
        }
    }

    private Equation eq(String left, String right) {
        AntlrExpressionParser ep = new AntlrExpressionParser();
        try {
            Calculable leftExpr = (Calculable) ep.parse(ClauseType.ADDITIVE_EXPRESSION, left);
            Calculable rightExpr = (Calculable) ep.parse(ClauseType.ADDITIVE_EXPRESSION, right);
            return new Equation(leftExpr, Equation.Type.EQUAL, rightExpr);
        } catch (ParsingException e) {
            throw new RuntimeException(e);
        }
    }
}


text:
package com.armandgray.taap.utils;

import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.StyleSpan;

public class StringHelper {

    public static SpannableStringBuilder getFormattedHeaderTextString(String[] headers, String[] text) {
        SpannableStringBuilder contentsStringBuilder = new SpannableStringBuilder();
        for (int i = 0; i < headers.length; i++) {
            SpannableStringBuilder stringBuilder = new SpannableStringBuilder(headers[i] + "\n\n" + text[i]);
            StyleSpan boldStyleSpan = new StyleSpan(android.graphics.Typeface.BOLD);
            stringBuilder.setSpan(boldStyleSpan, 0, headers[i].length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
            contentsStringBuilder.append(stringBuilder);
            contentsStringBuilder.append("\n\n");
        }
        return contentsStringBuilder;
    }

    public static String getArrayAsString(String[] array) {
        if (array == null || array.length == 0) { return null; }
        StringBuilder builder = new StringBuilder();
        for (String s : array ) {
            if (s != null) { builder.append(s); }
            builder.append(",");
        }
        builder.deleteCharAt(builder.length() - 1);
        return builder.toString();
    }

    public static String[] getStringAsArray(String string) {
        if (string == null || string.length() == 0) { return null; }
        String[] array = string.split(",");
        return array;
    }
}


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

const ROOT = '[data-test="root"]';

moduleForComponent('cui-navbar', 'Integration | Component | cui navbar', {
  integration: true,
});

test('should show yield', function(assert) {
  assert.expect(1);

  // Act
  this.render(hbs`
    {{#cui-navbar data-test="root"}}Foo{{/cui-navbar}}
  `);

  // Assert
  assert.equal(this.$(ROOT).text().trim(), 'Foo');
});


text:
var gulp = require('gulp');
var config = require('../config').markup
var browserSync  = require('browser-sync');

gulp.task('markup', function() {
  return gulp.src(config.src)
    .pipe(gulp.dest(config.dest))
    .pipe(browserSync.reload({stream:true}));
});


text:
<?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \frontend\models\SignupForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\models\Common;
use yii\helpers\Url;

$this->title = 'Signup';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>

First Name
<input type="text" id="signupform-first_name" class="form-control"
       name="SignupForm[first_name]" value="<?php echo $post['first_name']; ?>">

Last Name
<input type="text" id="signupform-last_name" class="form-control"
       name="SignupForm[last_name]" value="<?php echo $post['last_name']; ?>">

<?= $form->field($model, 'username'); ?>

                <?= $form->field($model, 'email'); ?>

                <?= $form->field($model, 'password')->passwordInput() ?>

                    <?= Html::submitButton('Signup', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>

                    <a href="<?php echo Url::to(['user/login']); ?>">Already have Account

                    <a href="<?php echo Yii::$app->homeUrl; ?>">Back to Home

                  <?php ActiveForm::end(); ?>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Michelia 2(no. 7): 273 (1881)

#### Original name
Phoma inconspicua Speg.

### Remarks
null


text:
<f:layout name="Default" />
<f:section name="Main">

    <f:if condition="{records}">

                <f:for each="{records}" as="item" iteration="iteration">
                    <f:variable name="itemStyleImage"><f:if condition="{item.backgroundImage.0}">background-image: url('{f:uri.image(image:'{item.backgroundImage.0}',maxWidth:'{data.pi_flexform.background_image_maxwidth}')}');</f:if></f:variable>
                    <f:variable name="itemStyleColor"><f:if condition="{item.data.background_color}">background-color: {item.data.background_color};</f:if></f:variable>

                        <f:switch expression="{item.data.item_type}">
                            <f:case value="header">
                                <f:link.page pageUid="{item.data.link}" additionalAttributes="{draggable:'false'}">
                                    <f:render partial="Carousel/Item/Header" arguments="{_all}" />
                                </f:link.page>
                            </f:case>
                            <f:case value="textandimage">
                                <f:link.page pageUid="{item.data.link}" additionalAttributes="{draggable:'false'}">
                                    <f:render partial="Carousel/Item/TextAndImage" arguments="{_all}" />
                                </f:link.page>
                            </f:case>
                            <f:case value="html">{item.data.bodytext->f:format.raw()}</f:case>
                        </f:switch>

                </f:for>

            <f:render partial="Carousel/Control/Indicator" arguments="{_all}" />
            <f:render partial="Carousel/Control/Control" arguments="{_all}" />

    </f:if>

</f:section>


text:
'use strict';

var Users = require('./users'),
    Lists = require('./lists'),
    Project = require('./projects');

module.exports = [
    { method: 'GET', path: '/api/v1/users', config: Users.getUsers },
    { method: 'GET', path: '/api/v1/searchuser/{terms}', config: Users.searchUser },
    { method: 'GET', path: '/api/v1/user/{gitId}', config: Users.getUser },
    { method: 'PUT', path: '/api/v1/user/{gitId}', config: Users.updateUser },
    { method: 'POST', path: '/api/v1/register', config: Users.register },
    { method: 'DELETE', path: '/api/v1/user/{gitId}', config: Users.removeUser },
    { method: 'PUT', path: '/api/v1/user/addskill/{gitId}', config: Users.addSkill },
    { method: 'PUT', path: '/api/v1/user/addexperience/{gitId}', config: Users.addExperience },
    { method: 'PUT', path: '/api/v1/user/addreview/{gitId}', config: Users.addReview },
    // PROJECTS
    { method: 'GET', path: '/api/v1/projects', config: Project.getAllProjects },
    { method: 'GET', path: '/api/v1/project/{id}', config: Project.getProject },
    { method: 'POST', path: '/api/v1/project', config: Project.createProject },
    { method: 'PUT', path: '/api/v1/project/{id}', config: Project.updateProject },
    { method: 'DELETE', path: '/api/v1/project/{id}', config: Project.removeProject },
    { method: 'PUT', path: '/api/v1/project/addfile/{id}', config: Project.addFile },
    { method: 'PUT', path: '/api/v1/project/addskill/{id}', config: Project.addSkill },
    { method: 'PUT', path: '/api/v1/project/addreview/{id}', config: Project.addReview },
    { method: 'PUT', path: '/api/v1/project/addmentor/{id}', config: Project.addMentor },
    { method: 'PUT', path: '/api/v1/project/addstudent/{id}', config: Project.addStudent },
    { method: 'PUT', path: '/api/v1/project/addschedule/{id}', config: Project.addSchedule },
    { method: 'PUT', path: '/api/v1/project/updateschedule/{id}', config: Project.updateSchedule },
    { method: 'DELETE', path: '/api/v1/project/removeskill/{id}', config: Project.removeSkill },
    // LISTS USER TYPES
    { method: 'GET', path: '/api/v1/userTypes/{term}', config: Lists.getUserTypes },
    { method: 'POST', path: '/api/v1/userType', config: Lists.createUserType },
    { method: 'DELETE', path: '/api/vi/userType', config: Lists.removeUserType },
    // LISTS GRADES
    { method: 'GET', path: '/api/v1/grades/{term}', config: Lists.getGrades },
    { method: 'POST', path: '/api/v1/grade', config: Lists.createGrade },
    { method: 'DELETE', path: '/api/vi/grade', config: Lists.removeGrade },
    // LISTS INSTITUTION
    { method: 'GET', path: '/api/v1/institutions/{term}', config: Lists.getInstitutions },
    { method: 'POST', path: '/api/v1/institution', config: Lists.createInstitution },
    { method: 'DELETE', path: '/api/vi/institution', config: Lists.removeInstitution },
    // LISTS POSITION
    { method: 'GET', path: '/api/v1/positions/{term}', config: Lists.getPositions },
    { method: 'POST', path: '/api/v1/position', config: Lists.createPosition },
    { method: 'DELETE', path: '/api/vi/position', config: Lists.removePosition },
    // LISTS SKILL
    { method: 'GET', path: '/api/v1/skills/{term}', config: Lists.getSkills },
    { method: 'POST', path: '/api/v1/skill', config: Lists.createSkill },
    { method: 'DELETE', path: '/api/vi/skill', config: Lists.removeSkill }
];


text:
package com.github.edipermadi.bcdocs.asn1.string.bmp;

import com.github.edipermadi.bcdocs.AbstractTest;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.RandomStringUtils;
import org.bouncycastle.asn1.DERBMPString;
import org.testng.annotations.Test;

import java.io.IOException;

/**
 * ASN.1 BMP String DER encoding
 *
 * @author Edi Permadi
 */
public class DerEncoding extends AbstractTest {
    @Test
    public void encode() throws IOException {
        final String value = RandomStringUtils.randomAlphanumeric(8);
        final DERBMPString obj = new DERBMPString(value);
        final byte[] encoded = encodeDer(obj);
        log("bmp-string (%s), DER encoded : %s", value, Hex.encodeHexString(encoded));
    }
}


text:
$outputJson = './wwwroot/assets/data/output.json'
$stringBuilder = New-Object System.Text.StringBuilder
$PSDefaultParameterValues['Out-File:Encoding'] = 'UTF8'

# ##### modify $watchList with strings to match watched files and folders
# $watchList = "readme", "dave"
$watchListFile = ".\wwwroot\assets\data\watchlist.json"

$comma = ", "

Do {
    $stringBuilder.Clear()
    $stringBuilder.AppendLine("{")
    $iCnt = 0
    $watchlist =  Get-Content $watchListFile | ConvertFrom-Json
    $listLength = $watchList.watchlist.Count

    foreach ($item in $watchList.watchlist) {
        Write-Host "===================================================================================================="
        Write-Host "`t`t`t`tChecking for locked files matching: ["$item"]"
        Write-Host "===================================================================================================="
        # For each item in the watch list check if any are opened and output to JSON format
        $matchOutput = Get-SmbOpenFile | Select-Object -Property ShareRelativePath, ClientUserName, ClientComputerName | Where-Object -Property ShareRelativePath -Match "$item" | ConvertTo-Json

        # If nothing is open for the watched item output JSON with none
        IF ($matchOutput -eq $null) {
            $matchOutput = "[{`n`t`"ShareRelativePath`": `"none`",`n`t`"ClientUserName`": `"none`",`n`t`"ClientComputerName`": `"none`"}]"
        }

        # Write-Host "`nmatchOutput: "($matchOutput[0] -ne $null) $matchOutput
        $outputType = ConvertFrom-Json -InputObject $matchOutput
        if ($outputType -isnot [System.array]){
            # Write-Host "`ntype: "$outputType.GetType() ($outputType -isnot [System.array])"`n"
            # Write-Host "item: "$item"`n"
            $matchOutput = "[" + $matchOutput + "]"
            # Write-Host "matchOutput: "$matchOutput"`n"
        }

        # If this is last item in watch list do not use a comma for the JSON output
        $iCnt = $iCnt + 1
        IF ($iCnt -lt $listLength)
        {$comma = ", "}
        ELSE
        {$comma = ""}

        $stringBuilder.AppendLine("`t`"" + $item + "`":" + $matchOutput + $comma)
    }
    $stringBuilder.AppendLine("}")

    $stringBuilder.ToString() | Out-File $outputJson
    # Write-Output $stringBuilder.ToString()
    Write-Host "`n===================================================================================================="
    Write-Host "`t`t`t`t[[[[[[[[[[ Check for Locked Files: Wait...]]]]]]]]]]"
    Write-Host "===================================================================================================="

    Start-Sleep 10
} While ($TRUE)


text:
namespace Azure.ResourceManager.StreamAnalytics.Models
{
    /// <summary> The UnknownFunctionBinding. </summary>
    internal partial class UnknownFunctionBinding : StreamingJobFunctionBinding
    {
        /// <summary> Initializes a new instance of UnknownFunctionBinding. </summary>
        /// <param name="functionBindingType"> Indicates the function binding type. </param>
        internal UnknownFunctionBinding(string functionBindingType) : base(functionBindingType)
        {
            FunctionBindingType = functionBindingType ?? "Unknown";
        }
    }
}


text:
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2;

/**
 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2
 * @xmlType BuildingNumberType
 * @xmlName BuildingNumber
 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\BuildingNumber
 */
class BuildingNumber extends BuildingNumberType
{
} // end class BuildingNumber


text:
// Copyright 2007-2015 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit
{
    using PipeConfigurators;

    /// <summary>
    /// Configures a pipe with specifications
    /// </summary>
    /// <typeparam name="TContext"></typeparam>
    public interface IPipeConfigurator<TContext>
        where TContext : class, PipeContext
    {
        /// <summary>
        /// Adds a pipe specification to the pipe configurator at the end of the chain
        /// </summary>
        /// <param name="specification">The pipe specification to add</param>
        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
        void AddPipeSpecification(IPipeSpecification<TContext> specification);
    }
}


text:
package rocks.xmpp.websocket.model;

import rocks.xmpp.addr.Jid;
import rocks.xmpp.core.stream.model.StreamElement;

import javax.xml.XMLConstants;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Locale;

/**
 * Abstract base class for {@link Open} and {@link Close}.
 *
 * @author Christian Schudt
 * @since 0.7.0
 */
@XmlTransient
abstract class Frame implements StreamElement {

    @XmlAttribute
    private final String version;

    @XmlAttribute
    private final Jid to;

    @XmlAttribute
    private final Jid from;

    @XmlAttribute
    private final String id;

    @XmlAttribute(namespace = XMLConstants.XML_NS_URI)
    private final Locale lang;

    Frame(Jid to, Jid from, String id, Locale language, String version) {
        this.to = to;
        this.from = from;
        this.id = id;
        this.lang = language;
        this.version = version;
    }

    /**
     * Gets the 'to' attribute.
     *
     * @return The 'to' attribute.
     */
    public final Jid getTo() {
        return to;
    }

    /**
     * Gets the 'from' attribute.
     *
     * @return The 'from' attribute.
     */
    public final Jid getFrom() {
        return from;
    }

    /**
     * Gets the 'version' attribute.
     *
     * @return The 'version' attribute.
     */
    public final String getVersion() {
        return version;
    }

    /**
     * Gets the 'id' attribute.
     *
     * @return The 'id' attribute.
     */
    public final String getId() {
        return id;
    }

    /**
     * Gets the 'xml:lang' attribute.
     *
     * @return The 'xml:lang' attribute.
     */
    public final Locale getLanguage() {
        return lang;
    }
}


text:
/**
 * Created:  Dec 15, 2014 6:06:42 PM
 */
package org.kfm.camel.entity;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipFile;

import org.apache.log4j.Logger;

import com.livescribe.afp.Afd;
import com.livescribe.afp.GraphicsElement;
import com.livescribe.util.Units;

/**
 *

 *
 * @author Kevin F. Murdoff
 * @version 1.0
 */
public class ImageDTOFactory {

	private static Logger logger = Logger.getLogger(ImageDTOFactory.class.getName());

	public static ImageDTO create(Afd afd, GraphicsElement graphicsElement) {

		ImageDTO imageDto = createDefault();
		if (graphicsElement instanceof GraphicsElement.Image) {
			imageDto.setX(Units.auToMM((int)graphicsElement.getX()));
			imageDto.setY(Units.auToMM((int)graphicsElement.getY()));
			imageDto.setZ(0); //for future layering of images (if implemented)
			imageDto.setWidth(Units.auToMM((int)graphicsElement.getWidth()));
			imageDto.setHeight(Units.auToMM((int)graphicsElement.getHeight()));
			String fileName = ((GraphicsElement.Image)graphicsElement).getFileName();
			byte[] data = ((GraphicsElement.Image)graphicsElement).getData();
			if (fileName != null) {
//				logger.debug("create() - GraphicsElement.Image file name: " + fileName);

				if (fileName.endsWith(".eps")) {
					fileName = fileName.replace(".eps", ".png");
				}
				ImageFileDTO imageFileDto = new ImageFileDTO();
				imageFileDto.setData(data);
			}
		} else {
			logger.warn("create() - GraphicsElement is instanceof " + graphicsElement.getClass().getCanonicalName());
		}
		return imageDto;
	}

	public static ImageDTO createDefault() {

		ImageDTO imageDto = new ImageDTO();
		imageDto.setX(Double.MIN_VALUE);
		imageDto.setY(Double.MIN_VALUE);
		imageDto.setZ(Double.MIN_VALUE); //for future layering of images (if implemented)
		imageDto.setWidth(Double.MIN_VALUE);
		imageDto.setHeight(Double.MIN_VALUE);

		return imageDto;
	}
}


text:
Materials for the Julia for Pythonistas tutorial at Pydata Carolinas 2016

# Setup:
- If you're planning to follow along, please go to [julialang.org](http://julialang.org/downloads/) and download the current stable release. This should be `v0.4.6`. Something slightly older (`>v0.4`) is probably fine.

- Much of the tutorial is in notebooks, but for the tutorial, we'll mostly be using the REPL. When we starting typing larger chunks of code, we'll switch over to using a text editor. You do not need to have Jupyter or IJulia installed.


text:
import { ICreature, ICreatureDescription, SpawnGroup, TileGroup } from "creature/ICreature";
import IEntityManager from "entity/IEntityManager";
import { CreatureType, MoveType } from "Enums";
import { ITile } from "tile/ITerrain";
export interface ICreatureManager extends IEntityManager<ICreature> {
    getHappinessLevel(human: Human, creature: ICreature): number;
    spawn(creatureType: CreatureType, x: number, y: number, z: number, bypass?: boolean, forceAberrant?: boolean, spawnTiles?: TileGroup): ICreature | undefined;
    spawnFromGroup(creatureGroup: SpawnGroup, x: number, y: number, z: number, bypass?: boolean): ICreature | undefined;
    maybeSpawnClawWorm(target: Human | ICreature): void;
    updateAll(): void;
    getMovePenalty(moveType: MoveType, tile: ITile, isFinalMove?: boolean): number;
    checkSpawnReputation(creatureDescription: ICreatureDescription, reputation?: number, bypass?: boolean): boolean;
    getCreaturesWithSpawnGroup(group?: SpawnGroup, checkReputation?: boolean): CreatureType[];
    getSpawnableCreatures(creatureGroup: SpawnGroup, z: number, reputation?: number, time?: number): ISpawnableCreatures;
    exists(creature: ICreature): boolean;
}
export interface ISpawnableCreatures {
    pool: CreatureType[];
    aberrantChance: number;
}
export default ICreatureManager;
export interface IMoveTypeZ {
    moveType: MoveType;
    z: number;
}


text:
package xdroid.eventbus;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import xdroid.customservice.CustomService;

import static xdroid.eventbus.BuildConfig.SNAPSHOT;

public class EventFinish implements EventDispatcher {
    private static final String LOG_TAG = EventFinish.class.getSimpleName();

    private final Activity mActivity;

    public EventFinish(Context context) {
        mActivity = CustomService.get(context, Activity.class);
    }

    @Override
    public boolean onNewEvent(int eventId, Bundle event) {
        if (mActivity == null) {
            if (SNAPSHOT) {
                Log.v(LOG_TAG, "onNewEvent: " + EventBus.getEventName(eventId) + " no Activity");
            }

            return false;
        }

        if (SNAPSHOT) {
            Log.v(LOG_TAG, "onNewEvent: " + EventBus.getEventName(eventId) + " finish Activity: " + mActivity);
        }

        mActivity.setResult(Activity.RESULT_CANCELED, EventBus.prepare(new Intent(EventFinish.class.getName()), eventId, event));
        mActivity.finish();
        return true;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2018 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<resources>
  <!-- The text pattern for the character counter -->
  <string name="character_counter_pattern" translatable="false">%1$d/%2$d</string>
  <!-- Content description for the character counter text [CHAR LIMIT=NONE] -->
  <string name="character_counter_content_description">Characters entered %1$d of %2$d</string>
  <!-- Content description for the character counter text when it has overflowed [CHAR LIMIT=NONE] -->
  <string name="character_counter_overflowed_content_description">Character limit exceeded %1$d of %2$d</string>
  <!-- Content description for the password visibility toggle button. [CHAR LIMIT=NONE] -->
  <string name="password_toggle_content_description">Show password</string>
  <!-- Content description for the clear text button end icon. [CHAR LIMIT=NONE] -->
  <string name="clear_text_end_icon_content_description">Clear text</string>
  <!-- Content description for the exposed dropdown menu button. [CHAR LIMIT=NONE] -->
  <string name="exposed_dropdown_menu_content_description">Show dropdown menu</string>
  <!-- Content description for the error icon. [CHAR LIMIT=NONE] -->
  <string name="error_icon_content_description">Error</string>
</resources>


text:
class Ruby230 < Formula
  desc "Powerful, clean, object-oriented scripting language"
  homepage "https://www.ruby-lang.org/"
  url "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2"
  sha256 "ec7579eaba2e4c402a089dbc86c98e5f1f62507880fd800b9b34ca30166bfa5e"

  # Reverts an upstream commit which incorrectly tries to install headers
  # into SDKROOT, if defined
  # See https://bugs.ruby-lang.org/issues/11881
  # The issue has been fixed on HEAD as of 1 Jan 2016, but has not been
  # backported to the 2.3 branch yet and patch is still required.
  patch do
    url "https://raw.githubusercontent.com/Homebrew/patches/ba8cc6b88e6b7153ac37739e5a1a6bbbd8f43817/ruby/mkconfig.patch"
    sha256 "929c618f74e89a5e42d899a962d7d2e4af75716523193af42626884eaba1d765"
  end

  keg_only "Installing another version in parallel can cause conflicts."

  option :universal
  option "with-doc", "Install documentation"
  option "with-tcltk", "Install with Tcl/Tk support"

  depends_on "pkg-config" => :build
  depends_on "readline" => :recommended
  depends_on "gdbm" => :optional
  depends_on "gmp" => :optional
  depends_on "libffi" => :optional
  depends_on "libyaml"
  depends_on "openssl"
  depends_on :x11 if build.with? "tcltk"

  def install
    args = %W[
      --prefix=#{prefix}
      --enable-shared
      --disable-silent-rules
      --with-sitedir=#{HOMEBREW_PREFIX}/lib/ruby/site_ruby
      --with-vendordir=#{HOMEBREW_PREFIX}/lib/ruby/vendor_ruby
    ]

    if build.universal?
      ENV.universal_binary
      args << "--with-arch=#{Hardware::CPU.universal_archs.join(",")}"
    end

    args << "--program-suffix=#{program_suffix}"
    args << "--with-out-ext=tk" if build.without? "tcltk"
    args << "--disable-install-doc" if build.without? "doc"
    args << "--disable-dtrace" unless MacOS::CLT.installed?
    args << "--without-gmp" if build.without? "gmp"

    # Reported upstream: https://bugs.ruby-lang.org/issues/10272
    args << "--with-setjmp-type=setjmp" if MacOS.version == :lion

    paths = [
      Formula["libyaml"].opt_prefix,
      Formula["openssl"].opt_prefix,
    ]

    %w[readline gdbm gmp libffi].each do |dep|
      paths << Formula[dep].opt_prefix if build.with? dep
    end

    args << "--with-opt-dir=#{paths.join(":")}"

    system "./configure", *args
    system "make"
    system "make", "install"
  end

  def program_suffix
    "-2.3.0"
  end

  test do
    hello_text = shell_output("#{bin}/ruby#{program_suffix} -e 'puts :hello'")
    assert_equal "hello\n", hello_text
    system "#{bin}/gem#{program_suffix}", "list", "--local"
  end
end


text:
void GenerateLumpFileName( const char *bspfilename, char *lumpfilename, int iBufferSize, int iIndex );

#endif // LUMPFILES_H


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="org.jboss.aerogear.unifiedpush.api.VariantMetricInformation" table="variant_metric_info">
        <id name="id" type="java.lang.String">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <property name="variantID" type="java.lang.String" index="variant_idx">
            <column name="variant_id" not-null="true"/>
        </property>
        <property name="receivers" type="java.lang.Long">
            <column name="receivers" />
        </property>
        <property name="deliveryStatus" type="java.lang.Boolean">
            <column name="delivery_status" />
        </property>
        <property name="reason" type="java.lang.String">
            <column name="reason" />
        </property>
        <property name="variantOpenCounter" type="java.lang.Long">
            <column name="variant_open_counter" />
        </property>
        <property name="servedBatches" type="java.lang.Integer">
            <column name="served_batches" />
        </property>
        <property name="totalBatches" type="java.lang.Integer">
            <column name="total_batches" />
        </property>
        <many-to-one name="pushMessageInformation" class="org.jboss.aerogear.unifiedpush.api.PushMessageInformation" fetch="join">
            <column name="push_message_info_id" />
        </many-to-one>
    </class>
</hibernate-mapping>


text:
import {
    debugLogger, get, toNumber, Logger
} from '@terascope/utils';
import * as opensearch from '@opensearch-project/opensearch';
import * as elasticsearch6 from 'elasticsearch6';
import * as elasticsearch7 from 'elasticsearch7';
import * as elasticsearch8 from 'elasticsearch8';
import { ClientMetadata, ElasticsearchDistribution } from '@terascope/types';
import { logWrapper } from './log-wrapper';
import { ClientConfig } from './interfaces';

const clientList = [opensearch, elasticsearch8, elasticsearch7, elasticsearch6];

interface ServerMetadata extends ClientMetadata {
    majorVersion: number;
    minorVersion: number;
}

async function findDistribution(
    config: Record<string, any>,
    logger: Logger
): Promise<ServerMetadata> {
    for (let i = 0; i < clientList.length - 1; i++) {
        try {
            const client = new clientList[i].Client(config);
            // @ts-expect-error
            const response = await client.info();

            if (response) {
                const info = response.body || response;
                const version: string = get(info, 'version.number');
                const responseDistribution = get(info, 'version.distribution', 'elasticsearch');
                let distribution: ElasticsearchDistribution;

                if (logger.level() === 10) {
                    logger.trace(info);
                }

                if (version == null || responseDistribution == null) {
                    throw new Error(`Got invalid response from api: ${JSON.stringify(info)}`);
                }

                if (responseDistribution === 'elasticsearch') {
                    distribution = ElasticsearchDistribution.elasticsearch;
                } else {
                    distribution = ElasticsearchDistribution.opensearch;
                }
                const [majorVersion, minorVersion] = version.split('.').map(toNumber);

                return {
                    version,
                    distribution,
                    majorVersion,
                    minorVersion
                };
            }
        } catch (err) {
            if (logger.level() === 10) {
                logger.error(err);
            }

            continue;
        }
    }

    throw new Error(`Could not create a client with config ${JSON.stringify(config)}`);
}

export async function createClient(config: ClientConfig, logger = debugLogger('elasticsearch-client')) {
    try {
        const {
            minorVersion,
            majorVersion,
            ...serverMetadata
        } = await findDistribution(config, logger);

        if (serverMetadata.distribution === ElasticsearchDistribution.opensearch) {
            // TODO: clean this up
            const openConfig = {
                ...config,
            };
            const client = new opensearch.Client(openConfig as any);
            // @ts-expect-error
            client.__meta = serverMetadata;
            logger.debug('Creating an opensearch client');
            return {
                client,
                log: logWrapper(logger),
            };
        }

        if (majorVersion === 8) {
            const client = new elasticsearch8.Client(config as any);
            // @ts-expect-error
            client.__meta = serverMetadata;
            logger.debug('Creating an elasticsearch v8 client');
            return {
                client,
                log: logWrapper(logger),
            };
        }

        if (majorVersion === 7) {
            // 7.13 and lower needs to use opensearch for now as its backwards
            // compatible, anything past this version the newer client will
            // throw if not their proprietary client
            if (minorVersion <= 13) {
                const client = new opensearch.Client(config as any);
                // @ts-expect-error
                client.__meta = serverMetadata;
                logger.debug('Creating an opensearch client for elasticsearch v7 for backwards compatibility');
                return {
                    client,
                    log: logWrapper(logger),
                };
            }

            const client = new elasticsearch7.Client(config as any);
            // @ts-expect-error
            client.__meta = serverMetadata;
            logger.debug('Creating an elasticsearch v7 client');

            return {
                client,
                log: logWrapper(logger),
            };
        }

        if (majorVersion === 6) {
            const client = new elasticsearch6.Client(config as any);
            // @ts-expect-error
            client.__meta = serverMetadata;
            logger.debug('Creating an elasticsearch v6 client');

            return {
                client,
                log: logWrapper(logger),
            };
        }

        throw new Error('no valid client available');
    } catch (err) {
        throw new Error(`Could not create a client for config ${JSON.stringify(config, null, 4)}`);
    }
}


text:
@echo off
    REM echo "creating debug-log file" > debug-log.txt
    REM Date /T >> log.log && Time /T >> debug-log.txt
    REM start cmd /K mongod && echo "mongod started" >> debug-log.txt && Date /T & Time /T >> debug-log.txt
        start cmd /K foundation watch
        REM start nodemon --inspect-brk server.js && echo "inspector started" >> debug-log.txt
        start cmd /K nodemon --inspect server.js
        echo "server started"

       REM  echo "starting chrome to browse admin gallery"
        REM start chrome "http://localhost:3555/intro"
        REM start chrome "ws://localhost:4555/intro"


text:
import java.io.*;
import java.util.Iterator;

public class TestPathToRoot {

	public static void main(String[] args) {
		LinkedBinaryTree<String> theTree = null;
		TreeBuilder<String> theTreeBuilder = null;

		try{
			theTreeBuilder = new TreeBuilder<String>(args[0]);
			theTree = theTreeBuilder.buildTree();
		}
		catch( MalformedTreeFileException e) {
			System.out.println( e.getMessage());
		}
		catch( IOException e){
			System.out.println("Error reading file: " + args[0] + "\n" + e.getMessage());
		}

		//complete the program here

	}

}


text:
<?php //-->

/**
 * Amazon EC2 Subnets (Amazon VPC)
 *
 * @package    Eden
 * @category   amazon
 * @author     Christian Symon M. Buenavista sbuenavista@openovate.com
 */
class Eden_Amazon_Ec2_Subnets extends Eden_Amazon_Ec2_Base {
	/* Constants
	-------------------------------*/
	/* Public Properties
	-------------------------------*/
	/* Protected Properties
	-------------------------------*/
	/* Private Properties
	-------------------------------*/
	/* Magic
	-------------------------------*/
	public static function i() {
		return self::_getMultiple(__CLASS__);
	}

	/* Public Methods
	-------------------------------*/
	/**
	 * Creates a subnet in an existing VPC. You can create up to 20 subnets in a VPC
	 *
	 * @param string The ID of the VPC.
	 * @param string The CIDR block for the subnet to cover (e.g., 10.0.0.0/24)
	 * @return array
	 */
	public function createSubnet($vpcId, $cidrBlock) {
		//argument testing
		Eden_Amazon_Error::i()
			->argument(1, 'string')		//argument 1 must be a string
			->argument(2, 'string');	//argument 2 must be a string

		$this->_query['Action'] 	= 'CreateSubnet';
		$this->_query['VpcId'] 		= $vpcId;
		$this->_query['CidrBlock'] 	= $cidrBlock;

		return $this->_getResponse(self::AMAZON_EC2_HOST, $this->_query);
	}

	/**
	 * Deletes a subnet from a VPC. You must terminate all running instances in
	 * the subnet before deleting it, otherwise Amazon VPC returns an error.
	 *
	 * @param string The ID of the subnet
	 * @return array
	 */
	public function deleteSubnet($subnetId) {
		//argument 1 must be a string
		Eden_Amazon_Error::i()->argument(1, 'string');

		$this->_query['Action'] 	= 'DeleteSubnet';
		$this->_query['SubnetId'] 	= $subnetId;

		return $this->_getResponse(self::AMAZON_EC2_HOST, $this->_query);
	}

	/**
	 * Gives you information about your subnets. You can filter the results to return
	 * information only about subnets that match criteria you specify
	 *
	 * @return array
	 */
	public function describeSubnets() {

		$this->_query['Action'] = 'DescribeSubnets';

		return $this->_getResponse(self::AMAZON_EC2_HOST, $this->_query);
	}

	/**
	 * The Availability Zone for the subnet.
	 * AWS selects a zone for you (recommended)
	 *
	 * @param string
	 * @return array
	 */
	public function setTimeZone($timeZone) {
		//argument 1 must be a string
		Eden_Amazon_Error::i()->argument(1, 'string');

		$this->_query['AvailabilityZone'] 	= $timeZone;

		return $this;
	}

	/**
	 * A subnet ID. You can specify more than one in the request.
	 *
	 * @param string
	 * @return array
	 */
	public function setSubnetId($subnetId) {
		//argument 1 must be a string
		Eden_Amazon_Error::i()->argument(1, 'string');

		$this->_query['SubnetId_']
			[isset($this->_query['SubnetId_'])?
			count($this->_query['SubnetId_'])+1:1] = $subnetId;

		return $this;
	}

	/* Protected Methods
	-------------------------------*/
	/* Private Methods
	-------------------------------*/
}


text:
using System.Net.Sockets;
using OrigoDB.Core;

namespace OrigoDB.Core
{
	public class PooledConnectionRequestContextFactory : IRequestContextFactory
	{
		readonly ConnectionPool _pool;

		public PooledConnectionRequestContextFactory(ConnectionPool pool)
		{
			_pool = pool;
		}

		public RequestContext GetContext()
		{
			var tcpClient = _pool.AquireResource();
			var disposable = new Disposable<RemoteConnection>(tcpClient, () => _pool.Release(tcpClient));
			return new RequestContext(disposable);
		}

		public void Dispose()
		{

		}

	}
}


text:
package com.mossle.javamail.service;

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

public class SendWorker implements Runnable {
    private static Logger logger = LoggerFactory.getLogger(SendWorker.class);
    private JavamailQueue javamailQueue;
    private boolean active = true;

    public SendWorker(JavamailQueue javamailQueue) {
        this.javamailQueue = javamailQueue;
    }

    public void run() {
        while (active) {
            try {
                this.javamailQueue.doProcessSend();
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    }

    public void stop() {
        active = false;
    }
}


text:
import utils from '../../src/js/utils/utils'

describe('utils.js', () => {
  describe('#isUrl()', () => {
    it('should not identify a number as a URL', () => {
      utils.isUrl(4).should.equal(false)
    })
    it('should not identify a non-URL string as a URL', () => {
      utils.isUrl('http:whatever.com/yeah').should.equal(false)
    })
    it('should not identify an object as a URL', () => {
      utils.isUrl({
        foo: 'bar'
      }).should.equal(false)
    })
    it('should not identify an array as a URL', () => {
      utils.isUrl([1, 2]).should.equal(false)
    })
    it('should identify a URL with only a domain', () => {
      utils.isUrl('http://whatever.com').should.equal(true)
    })
    it('should identify a https URL', () => {
      utils.isUrl('https://whatever.info').should.equal(true)
    })
    it('should identify a URL with a long path', () => {
      utils.isUrl('http://whatever.eus/foo/bar/hey').should.equal(true)
    })
    it('should identify a URL with a long path and query params', () => {
      utils.isUrl('http://whatever.com/foo/bar/hey.html?hey=ho&me&you=ok').should.equal(true)
    })
    it('should identify a URL with a long path and query params and the port', () => {
      utils.isUrl('http://whatever.com:9000/foo/bar/hey.html?hey=ho&me&you=ok').should.equal(true)
    })
  })

  describe('#extend()', () => {
    it('should merge properties from the second object into the first one', () => {
      utils.extend({
        test: 1,
        acme: 'what'
      }, {
        acme: 'where',
        other: 'why'
      }).should.eql({
        test: 1,
        acme: 'where',
        other: 'why'
      })
    })
    it('should keep the default options if empty object is passed', () => {
      utils.extend({test: 1}, {}).should.eql({test: 1})
    })
    it('should keep the options object if empty default options passed', () => {
      utils.extend({}, {test: 1}).should.eql({test: 1})
    })
  })

  describe('#fetch()', () => {
    let xhr
    let requests

    beforeEach(() => {
      xhr = sinon.useFakeXMLHttpRequest()

      requests = []
      xhr.onCreate = (xhr) => {
        requests.push(xhr)
      }
    })

    afterEach(() => {
      xhr.restore()
    })

    it('should make a get AJAX request and execute callback with the given content', (done) => {
      utils.fetch('http://www.google.com/', (data) => {
        data.should.equal('{"hola":"adios"}')
        done()
      })

      requests[0].respond(200, { 'Content-Type': 'text/json' }, '{"hola":"adios"}')
    })
  })
})


text:
  Form fields that allow input (`select`, and `textarea` elements, and all
  `input` element types other than image, submit, reset, button, or hidden)
  **must** have an associated label, either in the form of a `<label>` element
  or, for simple forms when no visible label is required, a `title` attribute.

  Rationale
  ---------

  Form labels are important for all users in order to understand what the form
  field is however they are essential for speech output users who cannot easily
  infer what the form element is by looking at the surrounding content.

  While there are WAI-ARIA attributes that allow for labelling of forms it is
  not supported in all versions of assistive technologies that BBC users could
  reasonably expect to be able to use.

  Techniques
  ----------

  Pass:

  ```
  <label for="search">Search the BBC</label>
  <input type="text" id="search" name="q" />

  <label for="search">
    Search the BBC
    <input type="text" name="q" />
  </label>

  <input type="text" name="q" title="Search the BBC" />
  ```

  Fail:

  ```
  <input type="text" name="name" title="Name" />
  <input type="text" name="email" title="Email" />

  <input type="text" name="q" value="Search the BBC" />

  <input type="text" name="q" aria-label="Search the BBC" />

  <input type="text" name="q" placeholder="Search the BBC" />
  ```

  Tests
  -----
..
  | Procedure | Expected Result | Type |
  | --------- | --------------- | ---- |
  | Use WAVE Toolbar (or similar) to identify accessibility errors errors | There must be no 'ERROR: Form label missing' or 'ARIA label or description' messages | Tool |
  | Check every `select`, and `textarea` elements, and all `input` element types other than image, submit, reset, button, or hidden | Every element must have either an associated `<label>` or a title attribute | Manual / Automated |
..
  Notes
  -----
..
  Hopefully the second test can be automated. Associated labels are those that
  wrap the element (`<label>Foo <input type="text" /></label>`) and those that
  have a `for` attribute value that matches the `id` attribute of a field element
  (`<label for="foo">Bar</label><input type="text" id="foo" />`). In the second
  case the `<label>` can wrap the form element, but does not have to.


text:
#if !defined(WELS_CPU_DETECTION_H__)
#define WELS_CPU_DETECTION_H__

#include "typedefs.h"

namespace WelsDec {

#if defined(__cplusplus)
extern "C" {
#endif//__cplusplus

#if defined(X86_ASM)
/*
 *	cpuid support verify routine
 *  return 0 if cpuid is not supported by cpu
 */
int32_t  WelsCPUIdVerify();

void_t WelsCPUId (uint32_t uiIndex, uint32_t* pFeatureA, uint32_t* pFeatureB, uint32_t* pFeatureC, uint32_t* pFeatureD);

int32_t WelsCPUSupportAVX (uint32_t eax, uint32_t ecx);
int32_t WelsCPUSupportFMA (uint32_t eax, uint32_t ecx);

void_t WelsEmms();

uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors);

/*
 *	clear FPU registers states for potential float based calculation if support
 */
void     WelsCPURestore (const uint32_t kuiCPU);

#endif

#if defined(__cplusplus)
}
#endif//__cplusplus

} // namespace WelsDec

#endif//WELS_CPU_DETECTION_H__


text:
<?php

namespace DaZeus;

use DaZeus\Filler\FillerLoop;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use React\EventLoop\Factory as EventLoopFactory;
use React\EventLoop\LoopInterface;
use React\EventLoop\StreamSelectLoop;

class Factory
{
    public static function create($socket, LoopInterface $loop = null, LoggerInterface $logger = null)
    {
        if ($loop === null) {
            $loop = new StreamSelectLoop();
        }

        if ($logger === null) {
            $logger = new NullLogger();
        }

        $loop = new FillerLoop($loop, $logger);
        $connection = new Connection($socket, $loop, $logger);
        return new DaZeusAsync($connection, $logger);
    }

    public static function plugin($socket, $pluginClass, LoopInterface $loop = null, LoggerInterface $logger = null)
    {
        $dazeus = self::create($socket, $loop, $logger);
        return new $pluginClass($dazeus, $logger);
    }
}


text:
package exercise.core;

import exercise.core.commands.CommandHandler;
import exercise.core.commands.api.Executable;
import exercise.core.utilities.DependencyProvider;
import exercise.core.utilities.Logger;
import exercise.dao.Database;
import exercise.dao.api.BoatRepository;
import exercise.dao.api.EngineRepository;
import exercise.dao.impl.BoatRepositoryImpl;
import exercise.dao.impl.EngineRepositoryImpl;

import java.util.Arrays;
import java.util.Scanner;

public class Controller {

    private static DependencyProvider provider;
    private static CommandHandler commandHandler;

    public static void initializeDependencies() {
        Database database = new Database();
        BoatRepository boatRepository = new BoatRepositoryImpl(database);
        EngineRepository engineRepository = new EngineRepositoryImpl(database);
        provider = new DependencyProvider(database, boatRepository, engineRepository);
        commandHandler = new CommandHandler(provider);
    }

    public static void main(String[] args) {
        initializeDependencies();
        Scanner scanner = new Scanner(System.in);

        String line = scanner.nextLine();

        while (!line.equals("End")) {
            String[] tokens = line.split("\\\\");
            String commandName = tokens[0];
            String[] commandItems = Arrays.copyOfRange(tokens, 1, tokens.length);
            Executable command = commandHandler.getCommand(commandName, commandItems);
            try{
                command.execute();
            } catch (RuntimeException ex){
                Logger.log(ex);
            }
            line = scanner.nextLine();
        }
        System.out.println();
    }
}


text:
// @ts-check
/// <reference path="../../index.d.ts" />

/**
 *
 * @param {EleventyConfig} eleventyConfig
 */
module.exports = function (eleventyConfig) {
  eleventyConfig.addShortcode("codepen", (/** @type {string} */ url) => {
    const penUrl = url.includes("embed")
      ? url
      : url.replace(/(\/full\/|\/details\/|\/pen\/)/gi, "/embed/");
    const html = String.raw;

    return html`<iframe
      allowtransparency="true"
      frameborder="no"
      height="600"
      src="${penUrl}?height=600&default-tab=result&embed-version=2"
      scrolling="no"
      style="width: 100%;"
    ></iframe>`;
  });
};


text:
package com.ilivoo.poi;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Chart;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.charts.AxisCrosses;
import org.apache.poi.ss.usermodel.charts.AxisPosition;
import org.apache.poi.ss.usermodel.charts.ChartDataSource;
import org.apache.poi.ss.usermodel.charts.ChartLegend;
import org.apache.poi.ss.usermodel.charts.DataSources;
import org.apache.poi.ss.usermodel.charts.LegendPosition;
import org.apache.poi.ss.usermodel.charts.ScatterChartData;
import org.apache.poi.ss.usermodel.charts.ValueAxis;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) {
		App app = new App();
		app.test1();
//		app.test2();
	}

	public void test1() {
		// short rownum;

		// create a new file
		FileOutputStream out = null;
		try {
			out = new FileOutputStream("workbook.xls");
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		// create a new workbook
		Workbook wb = new HSSFWorkbook();
		// create a new sheet
		Sheet s = wb.createSheet();
		// declare a row object reference
		Row r = null;
		// declare a cell object reference
		Cell c = null;
		// create 3 cell styles
		CellStyle cs = wb.createCellStyle();
		CellStyle cs2 = wb.createCellStyle();
		CellStyle cs3 = wb.createCellStyle();
		DataFormat df = wb.createDataFormat();
		// create 2 fonts objects
		Font f = wb.createFont();
		Font f2 = wb.createFont();

		// set font 1 to 12 point type
		f.setFontHeightInPoints((short) 12);
		// make it blue
		f.setColor((short) 0xc);
		// make it bold
		// arial is the default font
		f.setBoldweight(Font.BOLDWEIGHT_BOLD);

		// set font 2 to 10 point type
		f2.setFontHeightInPoints((short) 10);
		// make it red
		f2.setColor((short) Font.COLOR_RED);
		// make it bold
		f2.setBoldweight(Font.BOLDWEIGHT_BOLD);

		f2.setStrikeout(true);

		// set cell stlye
		cs.setFont(f);
		// set the cell format
		cs.setDataFormat(df.getFormat("#,##0.0"));

		// set a thin border
		cs2.setBorderBottom(cs2.BORDER_THIN);
		// fill w fg fill color
		cs2.setFillPattern((short) CellStyle.SOLID_FOREGROUND);
		// set the cell format to text see DataFormat for a full list
		cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));

		// set the font
		cs2.setFont(f2);

		// set the sheet name in Unicode
		wb.setSheetName(0, "\u0422\u0435\u0441\u0442\u043E\u0432\u0430\u044F "
				+ "\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430");
		// in case of plain ascii
		// wb.setSheetName(0, "HSSF Test");
		// create a sheet with 30 rows (0-29)
		int rownum;
		for (rownum = (short) 0; rownum < 30; rownum++) {
			// create a row
			r = s.createRow(rownum);
			// on every other row
			if ((rownum % 2) == 0) {
				// make the row height bigger (in twips - 1/20 of a point)
				r.setHeight((short) 0x249);
			}

			// r.setRowNum(( short ) rownum);
			// create 10 cells (0-9) (the += 2 becomes apparent later
			for (short cellnum = (short) 0; cellnum < 10; cellnum += 2) {
				// create a numeric cell
				c = r.createCell(cellnum);
				// do some goofy math to demonstrate decimals
				c.setCellValue(rownum * 10000 + cellnum + (((double) rownum / 1000) + ((double) cellnum / 10000)));

				String cellValue;

				// create a string cell (see why += 2 in the
				c = r.createCell((short) (cellnum + 1));

				// on every other row
				if ((rownum % 2) == 0) {
					// set this cell to the first cell style we defined
					c.setCellStyle(cs);
					// set the cell's string value to "Test"
					c.setCellValue("Test");
				} else {
					c.setCellStyle(cs2);
					// set the cell's string value to "\u0422\u0435\u0441\u0442" c.setCellValue("\u0422\u0435\u0441\u0442");
				}

				// make this column a bit wider
				s.setColumnWidth((short) (cellnum + 1), (short) ((50 * 8) / ((double) 1 / 20)));
			}
		}

		// draw a thick black border on the row at the bottom using BLANKS
		// advance 2 rows
		rownum++;
		rownum++;

		r = s.createRow(rownum);

		// define the third style to be the default
		// except with a thick black border at the bottom
		cs3.setBorderBottom(cs3.BORDER_THICK);

		// create 50 cells
		for (short cellnum = (short) 0; cellnum < 50; cellnum++) {
			// create a blank type cell (no value)
			c = r.createCell(cellnum);
			// set it to the thick black border style
			c.setCellStyle(cs3);
		}

		// end draw thick black border

		// demonstrate adding/naming and deleting a sheet
		// create a sheet, set its title then delete it
		s = wb.createSheet();
		wb.setSheetName(1, "DeletedSheet");
		wb.removeSheetAt(1);
		// end deleted sheet

		// write the workbook to the output stream
		// close our file (don't blow out our file handles
		try {
			wb.write(out);
			out.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void test2() {
		  Workbook wb = new XSSFWorkbook();
	        Sheet sheet = wb.createSheet("Sheet 1");
	        final int NUM_OF_ROWS = 3;
	        final int NUM_OF_COLUMNS = 10;

	        // Create a row and put some cells in it. Rows are 0 based.
	        Row row;
	        Cell cell;
	        for (int rowIndex = 0; rowIndex < NUM_OF_ROWS; rowIndex++) {
	            row = sheet.createRow((short) rowIndex);
	            for (int colIndex = 0; colIndex < NUM_OF_COLUMNS; colIndex++) {
	                cell = row.createCell((short) colIndex);
	                cell.setCellValue(colIndex * (rowIndex + 1));
	            }
	        }

	        Drawing drawing = sheet.createDrawingPatriarch();
	        ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10, 15);

	        Chart chart = drawing.createChart(anchor);
	        ChartLegend legend = chart.getOrCreateLegend();
	        legend.setPosition(LegendPosition.TOP_RIGHT);

	        ScatterChartData data = chart.getChartDataFactory().createScatterChartData();

	        ValueAxis bottomAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.BOTTOM);
	        ValueAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
	        leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);

	        ChartDataSource<Number> xs = DataSources.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
	        ChartDataSource<Number> ys1 = DataSources.fromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1));
	        ChartDataSource<Number> ys2 = DataSources.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));

	        data.addSerie(xs, ys1);
	        data.addSerie(xs, ys2);

	        chart.plot(data, bottomAxis, leftAxis);

	        // Write the output to a file
	        FileOutputStream fileOut = null;
			try {
				fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx");
				wb.write(fileOut);
				fileOut.close();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

	}
}


text:
@NonNullApi
@NonNullFields
package io.github.resilience4j.bulkhead.monitoring.endpoint;

import io.github.resilience4j.core.lang.NonNullApi;
import io.github.resilience4j.core.lang.NonNullFields;


text:
package consistent

import (
	"context"
	"strings"
	"testing"

	"github.com/stretchr/testify/require"

	"go.opentelemetry.io/otel/attribute"
	sdktrace "go.opentelemetry.io/otel/sdk/trace"
	"go.opentelemetry.io/otel/trace"
)

func TestParentSamplerDescription(t *testing.T) {
	opts := []sdktrace.ParentBasedSamplerOption{
		sdktrace.WithRemoteParentNotSampled(sdktrace.AlwaysSample()),
	}
	root := ProbabilityBased(1)
	compare := sdktrace.ParentBased(root, opts...)
	parent := ParentProbabilityBased(root, opts...)
	require.Equal(t,
		strings.Replace(
			compare.Description(),
			"ParentBased",
			"ParentProbabilityBased",
			1,
		),
		parent.Description(),
	)
}

func TestParentSamplerValidContext(t *testing.T) {
	parent := ParentProbabilityBased(sdktrace.NeverSample())
	type testCase struct {
		in      string
		sampled bool
	}
	for _, valid := range []testCase{
		// sampled tests
		{"r:10", true},
		{"r:10;a:b", true},
		{"r:10;p:1", true},
		{"r:10;p:10", true},
		{"r:10;p:10;a:b", true},
		{"r:10;p:63", true},
		{"r:10;p:63;a:b", true},
		{"p:0", true},
		{"p:10;a:b", true},
		{"p:63", true},
		{"p:63;a:b", true},

		// unsampled tests
		{"r:10", false},
		{"r:10;a:b", false},
	} {
		t.Run(testName(valid.in), func(t *testing.T) {
			traceID, _ := trace.TraceIDFromHex("4bf92f3577b34da6a3ce929d0e0e4736")
			spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7")
			traceState, err := trace.TraceState{}.Insert(traceStateKey, valid.in)
			require.NoError(t, err)

			sccfg := trace.SpanContextConfig{
				TraceID:    traceID,
				SpanID:     spanID,
				TraceState: traceState,
			}

			if valid.sampled {
				sccfg.TraceFlags = trace.FlagsSampled
			}

			parentCtx := trace.ContextWithSpanContext(
				context.Background(),
				trace.NewSpanContext(sccfg),
			)

			result := parent.ShouldSample(
				sdktrace.SamplingParameters{
					ParentContext: parentCtx,
					TraceID:       traceID,
					Name:          "test",
					Kind:          trace.SpanKindServer,
				},
			)

			if valid.sampled {
				require.Equal(t, sdktrace.RecordAndSample, result.Decision)
			} else {
				require.Equal(t, sdktrace.Drop, result.Decision)
			}
			require.Equal(t, []attribute.KeyValue(nil), result.Attributes)
			require.Equal(t, valid.in, result.Tracestate.Get(traceStateKey))
		})
	}
}

func TestParentSamplerInvalidContext(t *testing.T) {
	parent := ParentProbabilityBased(sdktrace.NeverSample())
	type testCase struct {
		in      string
		sampled bool
		expect  string
	}
	for _, invalid := range []testCase{
		// sampled
		{"r:100", true, ""},
		{"r:100;p:1", true, ""},
		{"r:100;p:1;a:b", true, "a:b"},
		{"r:10;p:100", true, "r:10"},
		{"r:10;p:100;a:b", true, "r:10;a:b"},

		// unsampled
		{"r:63;p:1", false, ""},
		{"r:10;p:1", false, "r:10"},
		{"r:10;p:1;a:b", false, "r:10;a:b"},
	} {
		testInvalid := func(t *testing.T, isChildContext bool) {
			traceID, _ := trace.TraceIDFromHex("4bf92f3577b34da6a3ce929d0e0e4736")
			traceState, err := trace.TraceState{}.Insert(traceStateKey, invalid.in)
			require.NoError(t, err)

			sccfg := trace.SpanContextConfig{
				TraceState: traceState,
			}
			if isChildContext {
				spanID, _ := trace.SpanIDFromHex("00f067aa0ba902b7")

				sccfg.TraceID = traceID
				sccfg.SpanID = spanID
				// Note: the other branch is testing a fabricated
				// situation where the context has a tracestate and
				// no TraceID.
			}
			if invalid.sampled {
				sccfg.TraceFlags = trace.FlagsSampled
			}

			parentCtx := trace.ContextWithSpanContext(
				context.Background(),
				trace.NewSpanContext(sccfg),
			)

			result := parent.ShouldSample(
				sdktrace.SamplingParameters{
					ParentContext: parentCtx,
					TraceID:       sccfg.TraceID,
					Name:          "test",
					Kind:          trace.SpanKindServer,
				},
			)

			if isChildContext && invalid.sampled {
				require.Equal(t, sdktrace.RecordAndSample, result.Decision)
			} else {
				// if we're not a child context, ShouldSample
				// falls through to the delegate, which is NeverSample.
				require.Equal(t, sdktrace.Drop, result.Decision)
			}
			require.Equal(t, []attribute.KeyValue(nil), result.Attributes)
			require.Equal(t, invalid.expect, result.Tracestate.Get(traceStateKey))
		}

		t.Run(testName(invalid.in)+"_with_parent", func(t *testing.T) {
			testInvalid(t, true)
		})
		t.Run(testName(invalid.in)+"_no_parent", func(t *testing.T) {
			testInvalid(t, false)
		})
	}
}


text:
package org.elasticsearch.xpack.sql.execution.search.extractor;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket;
import org.elasticsearch.search.aggregations.metrics.InternalTopHits;
import org.elasticsearch.xpack.sql.SqlIllegalArgumentException;
import org.elasticsearch.xpack.sql.common.io.SqlStreamInput;
import org.elasticsearch.xpack.sql.type.DataType;
import org.elasticsearch.xpack.sql.util.DateUtils;

import java.io.IOException;
import java.time.ZoneId;
import java.util.Objects;

public class TopHitsAggExtractor implements BucketExtractor {

    static final String NAME = "th";

    private final String name;
    private final DataType fieldDataType;
    private final ZoneId zoneId;

    public TopHitsAggExtractor(String name, DataType fieldDataType, ZoneId zoneId) {
        this.name = name;
        this.fieldDataType = fieldDataType;
        this.zoneId = zoneId;
    }

    TopHitsAggExtractor(StreamInput in) throws IOException {
        name = in.readString();
        fieldDataType = in.readEnum(DataType.class);
        zoneId = SqlStreamInput.asSqlStream(in).zoneId();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeString(name);
        out.writeEnum(fieldDataType);
    }

    String name() {
        return name;
    }

    DataType fieldDataType() {
        return fieldDataType;
    }

    ZoneId zoneId() {
        return zoneId;
    }

    @Override
    public String getWriteableName() {
        return NAME;
    }

    @Override
    public Object extract(Bucket bucket) {
        InternalTopHits agg = bucket.getAggregations().get(name);
        if (agg == null) {
            throw new SqlIllegalArgumentException("Cannot find an aggregation named {}", name);
        }

        if (agg.getHits().getTotalHits() == null || agg.getHits().getTotalHits().value == 0) {
            return null;
        }

        Object value = agg.getHits().getAt(0).getFields().values().iterator().next().getValue();
        if (fieldDataType.isDateBased()) {
            return DateUtils.asDateTime(Long.parseLong(value.toString()), zoneId);
        } else if (fieldDataType.isTimeBased()) {
            return DateUtils.asTimeOnly(Long.parseLong(value.toString()), zoneId);
        } else {
            return value;
        }
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, fieldDataType, zoneId);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }

        TopHitsAggExtractor other = (TopHitsAggExtractor) obj;
        return Objects.equals(name, other.name)
            && Objects.equals(fieldDataType, other.fieldDataType)
            && Objects.equals(zoneId, other.zoneId);
    }

    @Override
    public String toString() {
        return "TopHits>" + name + "[" + fieldDataType + "]@" + zoneId;
    }
}


text:
html{border:0; width:100%; min-height: 40px; height: max-content;}

body{border:0; width:95%; min-height: 20px; height: max-content;  margin:0; padding: 10px 10px 0 12px;padding-bottom: 15px; padding-top: 15px; font:normal 14px/16px Arial,Tahoma,sans-serif; color:#333; cursor:text; overflow-x:hidden; overflow-y:auto; outline:none; word-wrap:break-word;}
body::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

body::-webkit-scrollbar-button {
        display: none;
    }

body::-webkit-scrollbar-track,
body::-webkit-scrollbar-thumb {
        border-style: solid;
        border-color: transparent;
        border-radius: 2px;
    }

body::-webkit-scrollbar-track {
        background-color: transparent;
    }

body::-webkit-scrollbar-thumb {
        background-color: #bfbfbf;
        min-height: 28px;
    }
body *{background:transparent !important; height:auto !important; line-height:16px !important; margin:0 !important; padding:0 !important; border:0 !important; font:normal 14px/16px Arial,Tahoma,sans-serif !important; color:#333 !important; cursor:text !important;}

body img{width:auto !important; height:auto !important;}


text:
package com.alibaba.dubbo.rpc.protocol;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.dubbo.rpc.Exporter;
import com.alibaba.dubbo.rpc.Invoker;

/**
 * AbstractExporter.
 *
 * @author qianlei
 * @author william.liangf
 */
public abstract class AbstractExporter<T> implements Exporter<T> {

    protected final Logger   logger     = LoggerFactory.getLogger(getClass());

    private final Invoker<T> invoker;

    private volatile boolean unexported = false;

    public AbstractExporter(Invoker<T> invoker) {
        if (invoker == null)
            throw new IllegalStateException("service invoker == null");
        if (invoker.getInterface() == null)
            throw new IllegalStateException("service type == null");
        if (invoker.getUrl() == null)
            throw new IllegalStateException("service url == null");
        this.invoker = invoker;
    }

    public Invoker<T> getInvoker() {
        return invoker;
    }

    public void unexport() {
        if (unexported) {
            return ;
        }
        unexported = true;
        getInvoker().destroy();
    }

    public String toString() {
        return getInvoker().toString();
    }

}


text:
@extends('store.master', ['title' => 'Order - Pay and confirm'])

@section('main')

Game(s)

                @foreach($cart->content() as $game)

{{ $game->name }}, x{{ $game->qty }},
                        ${{ $game->price * $game->qty }}

                @endforeach
                @if( Cart::total() < 150)

Shipping (if order is under $150), $15

                @endif

            Total: ${{ Cart::totalWithShipping() }}

Shipping adress

{{ $address->name }}

{{ $address->street }}

{{ $address->ZIP . ' ' . $address->city }}

{{ $address->country->name }}{{ $address->state_id ? ', ' . $address->state->name : '' }}

Confirmation and payment method

            <form action="{{ route('StoreOrderPay') }}" method="POST">
                {!! csrf_field() !!}

            </form>

                <form id="confirmOrder" action="{{ route('StoreOrderPay')}}" method="POST">
                    {!! csrf_field() !!}
                    <input type="hidden" name="cashOnDelivery" value="cashOnDelivery">
                </form>
                <button class="btn btn-primary btn-md" type="submit" form="confirmOrder">Cash on delivery</button>

@endsection


text:
[![Build Status](https://travis-ci.org/jacobemerick/archangel.svg?branch=master)](https://travis-ci.org/jacobemerick/archangel)
[![Code Climate](https://codeclimate.com/github/jacobemerick/archangel/badges/gpa.svg)](https://codeclimate.com/github/jacobemerick/archangel)
[![Test Coverage](https://codeclimate.com/github/jacobemerick/archangel/badges/coverage.svg)](https://codeclimate.com/github/jacobemerick/archangel/coverage)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jacobemerick/archangel/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jacobemerick/archangel/?branch=master)

Encapsulated utility for sending out emails with PHP. Will separate out plain-text, html, and attachments. Works across several tested email clients, including the picky Microsoft Outlook.

Why Archangel? Well, it's cool (like bow ties) and technically an 'archangel' is a 'messenger'.

## Installation

It's recommended that you use [Composer](https://getcomposer.org/) to install Archangel.

```bash
$ composer require jacobemerick/archangel "^2.0"
```

This will install Archangel and it's dependencies. It requires PHP 5.3.0 or newer and sendmail functionality.

## Usage

There are some minimum values to set before Archangel will attempt to send a mail. They are:
 - to address
 - subject
 - some type of message (plain text, html, or attachment(s))

Archangel can work with or without method chaining. In the below examples everything is chained, but you don't have to structure your calling this way - it is totally up to you.

### Basic structure

Basic structure of a chained vs unchained request.
```php
(new Jacobemerick\Archangel\Archangel())
  ->addTo('email@example.com')
  ->setSubject('Test Subject')
  ->setPlainMessage('This is a rather plain message.')
  ->send();

$archangel = new Jacobemerick\Archangel\Archangel();
$archangel->addTo('email@example.com');
$archangel->setSubject('Test Subject');
$archangel->setPlainMessage('This is a rather plain message.');
$archangel->send();
```

### Future Todos
 - add in more documentation

## License

Archangel is licensed under the MIT license. See [License File](LICENSE.md) for more information.


text:
<?php

namespace MobileCart\FedexBundle\Api\RateV10\ComplexType;

use MobileCart\FedexBundle\Api\RateV10\SimpleType;

/**
 * Specifies additional labels to be produced. All required labels for shipments will be produced
 * without the need to request additional labels. These are only available as thermal labels.
 *
 *
 *
 */
class AdditionalLabelsDetail extends ComplexTypeAbstract
{
    const CLASS_NAME = 'AdditionalLabelsDetail';

    /**
     * The type of additional labels to return.
     * minOccurs = 0
     * maxOccurs = 1
     *
     * @var SimpleType\AdditionalLabelsType|null $Type
     */
    protected $Type;

    /**
     * The number of this type label to return
     * minOccurs = 0
     * maxOccurs = 1
     *
     * @var integer|null $Count
     */
    protected $Count;

    /**
     * @param SimpleType\AdditionalLabelsType|null $type
     * @return AdditionalLabelsDetail
     */
    public function setType(SimpleType\AdditionalLabelsType $type = null)
    {
        $this->Type = $type;

        return $this;
    }

    /**
     * @return SimpleType\AdditionalLabelsType|null
     */
    public function getType()
    {
        return $this->Type;
    }

    /**
     * @param integer|null $count
     * @return AdditionalLabelsDetail
     */
    public function setCount($count)
    {
        $this->Count = $count;

        return $this;
    }

    /**
     * @return integer|null
     */
    public function getCount()
    {
        return $this->Count;
    }

}