text:
String.prototype.startsWith = function(text) {
	return this.substr(0, text.length) == text;
};

String.prototype.contains = function(text) {
	return this.indexOf(text) !== -1;
};

if (typeof _loaded === 'undefined') {
	chrome.extension.onMessage.addListener(

	function(request, sender) {

		// Gather links
		var pageLinks = document.getElementsByTagName('a');

		(function(pg) {

			var blacklist = request.bl;
			blacklist = blacklist.split("\n");

			var blacklisted;

			// Run through links ignore empty href and non http* links
			for (var i = 0; i < pg.length; i++) {

				var link = pg[i];
				var url = link.href;
				var rel = link.rel;
				blacklisted = false;

				if (url.length > 0 && url.startsWith('http')) {
					for (var b = 0; b < blacklist.length; b++) {
						if (blacklist[b] !== "" && url.contains(blacklist[b])) {
							blacklisted = true;
						}
					}

					if (blacklisted === false) {
						// console.log(url);
					} else {
						chrome.extension.sendMessage({
							"action" : "check",
							"url" : url
						});

					}

				} else {
					// console.log("Skipped: " + url);
				}
			}

		}(pageLinks));

	});
	_loaded = true;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  version="5.0"
  xml:id="configuring-keystone-for-ldap-backend-identity">

    <title>Integrate identity back end with LDAP</title>
    <para>The identity back end contains information for users, groups, and
      group member lists. Integrating the identity back end with LDAP allows
      administrators to use users and groups in LDAP.</para>
    <important>
        <para>For OpenStack Identity Service to access LDAP servers, you must
            define the destination LDAP server in the
            <filename>keystone.conf</filename> file. For more information, see
            <xref linkend="configuring-keystone-for-ldap-backend"/>.</para>
    </important>
    <procedure>
        <title>Integrating an identity back end with LDAP</title>
        <step>
            <para>Enable the LDAP identity driver in the
              <filename>keystone.conf</filename> file. This allows LDAP as
              an identity back end:</para>
            <programlisting language="ini">[identity]
#driver = keystone.identity.backends.sql.Identity
driver = keystone.identity.backends.ldap.Identity</programlisting>
        </step>
        <step>
            <para>Create the organizational units (OU) in the LDAP
                directory, and define the corresponding location in
                the <filename>keystone.conf</filename> file:</para>
            <programlisting language="ini">[ldap]
user_tree_dn = ou=Users,dc=example,dc=org
user_objectclass = inetOrgPerson

group_tree_dn = ou=Groups,dc=example,dc=org
group_objectclass = groupOfNames</programlisting>
            <note>
                <para>These schema attributes are extensible for
                    compatibility with various schemas. For example,
                    this entry maps to the
                        <systemitem>person</systemitem> attribute in
                    Active Directory:</para>
                <programlisting language="ini">user_objectclass = person</programlisting>
            </note>
        </step>
        <step>
            <para>A read-only implementation is recommended for LDAP
                integration. These permissions are applied to object
                types in the <filename>keystone.conf</filename>
                file:</para>
            <programlisting language="ini">[ldap]
user_allow_create = False
user_allow_update = False
user_allow_delete = False

group_allow_create = False
group_allow_update = False
group_allow_delete = False</programlisting>
        </step>
        <step>
            <para>Restart the OpenStack Identity service:</para>
            <screen><prompt>#</prompt> <userinput>service keystone restart</userinput></screen>
            <warning><para>During service restart, authentication and
            authorization are unavailable.</para></warning>
        </step>
    </procedure>
    <procedure>
      <title>Integrating identity with multiple back ends</title>
      <step>
        <para>Set the following options in the
          <filename>/etc/keystone/keystone.conf</filename> file:</para>
        <substeps>
          <step>
            <para>Enable the LDAP driver:</para>
            <programlisting language="ini">[identity]
#driver = keystone.identity.backends.sql.Identity
driver = keystone.identity.backends.ldap.Identity</programlisting>
          </step>
          <step>
            <para>Enable domain-specific drivers:</para>
            <programlisting language="ini">[identity]
domain_specific_drivers_enabled = True
domain_config_dir = /etc/keystone/domains</programlisting>
          </step>
        </substeps>
      </step>
      <step>
        <para>Restart the service:</para>
        <screen><prompt>#</prompt> service keystone restart</screen>
      </step>
      <step>
        <para>List the domains using the dashboard, or the OpenStackClient
          CLI. Refer to the <link xlink:href="http://docs.openstack.org/developer/python-openstackclient/command-list.html">Command List</link>
          for a list of OpenStackClient commands.</para>
      </step>
      <step>
        <para>Create domains using OpenStack dashboard, or the
          OpenStackClient CLI.</para>
      </step>
      <step>
        <para>For each domain, create a domain-specific configuration
          file in the <filename>/etc/keystone/domains</filename> directory.
          Use the file naming convention <filename>keystone.<replaceable>DOMAIN_NAME</replaceable>.conf</filename>,
          where <replaceable>DOMAIN_NAME</replaceable>
          is the domain name assigned in the previous step.</para>
        <note><para>The options set in the
            <filename>/etc/keystone/domains/keystone.<replaceable>DOMAIN_NAME</replaceable>.conf</filename>
            file will override options in the <filename>/etc/keystone/keystone.conf</filename>
            file.</para></note>
      </step>
      <step>
        <para>Define the destination LDAP server in the
          <filename>/etc/keystone/domains/keystone.<replaceable>DOMAIN_NAME</replaceable>.conf</filename> file. For example:</para>
        <programlisting language="ini">[ldap]
url = ldap://localhost
user = dc=Manager,dc=example,dc=org
password = samplepassword
suffix = dc=example,dc=org
use_dumb_member = False
allow_subtree_delete = False</programlisting>
      </step>
      <step>
        <para>Create the organizational units (OU) in the LDAP
          directories, and define their corresponding locations in
          the <filename>/etc/keystone/domains/keystone.<replaceable>DOMAIN_NAME</replaceable>.conf</filename>
          file. For example:</para>
        <programlisting language="ini">[ldap]
user_tree_dn = ou=Users,dc=example,dc=org
user_objectclass = inetOrgPerson

group_tree_dn = ou=Groups,dc=example,dc=org
group_objectclass = groupOfNames</programlisting>
        <note>
          <para>These schema attributes are extensible for
            compatibility with various schemas. For example,
            this entry maps to the <systemitem>person</systemitem>
            attribute in Active Directory:</para>
          <programlisting language="ini">user_objectclass = person</programlisting>
        </note>
      </step>
      <step>
        <para>A read-only implementation is recommended for LDAP
          integration. These permissions are applied to object
          types in the <filename>/etc/keystone/domains/keystone.<replaceable>DOMAIN_NAME</replaceable>.conf</filename>
          file:</para>
        <programlisting language="ini">[ldap]
user_allow_create = False
user_allow_update = False
user_allow_delete = False

group_allow_create = False
group_allow_update = False
group_allow_delete = False</programlisting>
      </step>
      <step>
        <para>Restart the OpenStack Identity service:</para>
        <screen><prompt>#</prompt> <userinput>service keystone restart</userinput></screen>
        <warning><para>During service restart, authentication and
            authorization are unavailable.</para></warning>
      </step>
    </procedure>
    <formalpara>
        <title>Additional LDAP integration settings</title>
        <para>Set these options in the
            <filename>/etc/keystone/keystone.conf</filename>
            file for a single LDAP server, or
            <filename>/etc/keystone/domains/keystone.
                <replaceable>DOMAIN_NAME</replaceable>.conf</filename>
            files for multiple back ends.</para>
    </formalpara>
    <variablelist>
        <varlistentry>
            <term>Filters</term>
            <listitem>
                <para>Use filters to control the scope of data
                    presented through LDAP.</para>
                <programlisting language="ini">[ldap]
user_filter = (memberof=cn=openstack-users,ou=workgroups,dc=example,dc=org)
group_filter = </programlisting>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term>Identity attribute mapping</term>
            <listitem>
                <para>Mask account status values (include any additional
                    attribute mappings) for compatibility
                    with various directory services. Superfluous
                    accounts are filtered with
                        <systemitem>user_filter</systemitem>.</para>
                <para>Setting attribute ignore to list of attributes
                    stripped off on update.</para>
                <para>For example, you can mask Active Directory
                    account status attributes in the
                    <filename>keystone.conf</filename>
                    file:</para>
                <programlisting language="ini">[ldap]
user_id_attribute      = cn
user_name_attribute    = sn
user_mail_attribute    = mail
user_pass_attribute    = userPassword
user_enabled_attribute = userAccountControl
user_enabled_mask      = 2
user_enabled_invert    = false
user_enabled_default   = 51
user_default_project_id_attribute =
user_attribute_ignore = default_project_id,tenants
user_additional_attribute_mapping =

group_id_attribute     = cn
group_name_attribute   = ou
group_member_attribute = member
group_desc_attribute   = description
group_attribute_ignore =
group_additional_attribute_mapping =</programlisting>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term>Enabled emulation</term>
            <listitem>
                <para>An alternative method to determine if a user is
                enabled or not is by checking if that user is a
                 member of the emulation group.</para>
                <para>Use DN of the group entry to hold enabled
                    user when using enabled emulation.</para>
                <programlisting language="ini">[ldap]
user_enabled_emulation = false
user_enabled_emulation_dn = false</programlisting>
            </listitem>
        </varlistentry>
    </variablelist>
</section>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * @vars
 *   - $suggestions (key = search string, value = search url)
 */
?>

  <?php print t('Did you mean'); ?>
  <a class="parent-region-suggestion-link" href="<?php print $parent_region_suggestion_url; ?>">
  <?php print $parent_region_suggestion ?> (+  <?php print t('boroughs') ?>)


text:
import os

class CameraSettings:
    """Settings for Pi Camera"""

    def __init__(self):
        self.horizontal_resolution = 1920
        self.vertical_resolution = 1080

        # An internet search suggests 1 second is enough for camera start up
        # time, so 2 seconds should be safe.
        self.camera_start_up_time = 2
        self.rotation = 0

class FileSettings:
    """Settings for directories and files"""

    def __init__(self):
        # PROJECT_DIR = "/synology211j/Share/raspberry-pi/timelapse/"

        self.project_dir = "/media/usb1/projects/timelapse"

        self.log_file_name = "take_photo.log"

    def log_file(self):
        return os.path.join(self.project_dir, self.log_file_name)


text:
<?php
namespace <%= project.namespace %>\<%= module.namespace %>\Test\Helper;

use Phalcon\DI,
	\Phalcon\Test\UnitTestCase as PhalconTestCase,
	\<%= project.namespace %>\Application\Application,
	\<%= project.namespace %>\<%= module.namespace %>\Module;

abstract class ModuleUnitTestCase extends PhalconTestCase
{
	/**
	 * @var \Voice\Cache
	 */
	protected $_cache;

	/**
	 * @var \Phalcon\Config
	 */
	protected $_config;

	protected $application;

	/**
	 * @var bool
	 */
	private $_loaded = false;

	public function setUp(\Phalcon\DiInterface $di = null, \Phalcon\Config $config = null)
	{
		// Load any additional services that might be required during testing
		$di = DI::getDefault();
        $this->application = new Application($di);

		// init module
		$module = new Module();
		$module->registerServices($di);

		// get any DI components here. If you have a config, be sure to pass it to the parent
		parent::setUp($this->application->di, $this->application->config);

		$this->_loaded = true;
	}

	public function tearDown() {
		$this->application = null;
	}

	/**
	 * Check if the test case is setup properly
	 * @throws \PHPUnit_Framework_IncompleteTestError;
	 */
	public function __destruct() {
		if(!$this->_loaded) {
			throw new \PHPUnit_Framework_IncompleteTestError('Please run parent::setUp().');
		}
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Anal. Mus. nac. Hist. nat. B. Aires 6: 228 (1899)

#### Original name
Ravenelia platensis Speg.

### Remarks
null


text:
using System.Collections.Generic;
using System.Web.Http;
using PlayMe.Common.Model;
using PlayMe.Web.MusicServiceReference;

namespace PlayMe.Web.Controllers
{
    public class SearchController : ApiController
    {
        [HttpGet]
        public SearchResults Default(string searchTerm, string provider)
        {
            using (var client = new MusicServiceClient())
            {
                return client.SearchAll(searchTerm, provider, User.Identity.Name);
            }
        }

        [HttpGet]
        public IEnumerable<string> Suggestions(string partialSearchTerm)
        {
            using (var client = new MusicServiceClient())
            {
                return client.MatchSearchTermHistory(partialSearchTerm);
            }

        }

        [HttpGet]
        public IEnumerable<MusicProviderDescriptor> ActiveMusicProviders()
        {
            using (var client = new MusicServiceClient())
            {
                return client.GetActiveProviders();
            }

        }
    }
}


text:
package org.jrenner.fps.particles;

import com.badlogic.gdx.graphics.g3d.particles.ParticleController;
import com.badlogic.gdx.graphics.g3d.particles.ParticleEffect;
import com.badlogic.gdx.graphics.g3d.particles.ParticleSystem;
import com.badlogic.gdx.graphics.g3d.particles.batches.PointSpriteParticleBatch;
import com.badlogic.gdx.utils.Pool;
import org.jrenner.fps.Assets;
import org.jrenner.fps.View;

public class Particles {
	public static Particles inst;
	public ParticleSystem system;
	private PFXPool bulletHitPool;
	private PFXPool blueExplosionPool;

	public Particles() {
		inst = this;
		system = ParticleSystem.get();
		PointSpriteParticleBatch psBatch = new PointSpriteParticleBatch();
		psBatch.setCamera(View.inst.getCamera());
		system.add(psBatch);

		Assets.loadParticleEffects(system);

		ParticleEffect bulletHit = Assets.manager.get("particle/bullet-hit.pfx");
		ParticleEffect blueExplosion = Assets.manager.get("particle/blue-explosion.pfx");
		bulletHitPool = new PFXPool(bulletHit);
		blueExplosionPool = new PFXPool(blueExplosion);
	}

	public ParticleEffect obtainBulletHit() {
		//System.out.println("free bullet-hit count: " + bulletHitPool.getFree());
		return bulletHitPool.obtain();
	}

	public void freeBulletHit(ParticleEffect pfx) {
		system.remove(pfx);
		bulletHitPool.free(pfx);
	}

	public ParticleEffect obtainBlueExplosion() {
		//System.out.println("free bullet-hit count: " + blueExplosionPool.getFree());
		return blueExplosionPool.obtain();
	}

	public void freeBlueExplosion(ParticleEffect pfx) {
		system.remove(pfx);
		blueExplosionPool.free(pfx);
	}

	// TODO initial capacity in constructor
	private static class PFXPool extends Pool<ParticleEffect> {
		private ParticleEffect sourceEffect;

		public PFXPool(ParticleEffect sourceEffect) {
			this.sourceEffect = sourceEffect;
		}

		@Override
		public void free(ParticleEffect pfx) {
			pfx.reset();
			super.free(pfx);
		}

		@Override
		protected ParticleEffect newObject() {
			ParticleEffect pfx = sourceEffect.copy();
			pfx.init();
			return pfx;
		}
	}
}


text:
layout: page
title: Temple Networks Party
date: 2016-05-24
author: Carolyn Conner
tags: weekly links, java
status: published
summary: Nam placerat arcu in eros dignissim, sit.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 01/08/2019
  endDate: 01/13/2019
  ctyhocn: MOBMCHX
  groupCode: TNP
published: true
---
Duis lacinia accumsan augue, at eleifend libero pretium vel. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin consequat consequat blandit. Cras eu eleifend nunc, eget efficitur ante. Etiam in metus ut mi auctor laoreet a ut ipsum. Nunc laoreet iaculis eros at volutpat. Phasellus nisl tellus, ullamcorper quis nibh at, molestie sagittis ante. Vivamus sit amet rhoncus magna. Aenean eget blandit libero.

1 Cras eu nibh eu orci blandit dictum at ac libero
1 Vestibulum lacinia arcu ac est tempus, dapibus malesuada elit accumsan
1 Vivamus pharetra urna eget fringilla fringilla
1 Nunc in ex accumsan, ullamcorper metus rutrum, lacinia ligula
1 Nam vitae dui eget nisl rutrum dapibus vel eu magna.

Duis sed nisi eu ligula varius luctus consequat quis mi. Nunc viverra lorem est, a mollis quam porttitor in. In ligula turpis, mattis quis placerat et, malesuada in metus. Donec iaculis varius justo quis accumsan. Sed vel sapien bibendum, lacinia est non, scelerisque odio. Morbi ornare erat a pretium commodo. Mauris in tincidunt orci. Phasellus eleifend lorem eget nibh faucibus hendrerit. Nunc a imperdiet ante, et congue lacus. Quisque quis orci malesuada, efficitur enim vel, porttitor dui. Sed placerat massa nibh, sit amet sollicitudin risus condimentum at. Ut volutpat purus elit, nec maximus libero pharetra et. Ut vel urna id ex ultrices placerat. Sed tempor dictum dolor eget finibus.


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

package com.google.api.ads.common.lib.utils;

import com.google.api.ads.common.lib.conf.ConfigurationLoadException;
import com.google.api.ads.common.lib.exception.ValidationException;

import org.apache.commons.configuration.Configuration;

import java.io.File;
import java.net.URL;

/**
 * Builder interface.
 *
 * @param <T> the builder type
 */
public interface Builder<T> {

  public static String DEFAULT_CONFIGURATION_FILENAME = "ads.properties";

  /**
   * Constructs this object.
   * @throws ValidationException if the provided data is not valid.
   */
  public T build() throws ValidationException;

  /**
   * Populates this builder from the specified Configuration.
   * @param config {@link Configuration} to load properties from
   * @return Builder populated from the Configuration
   * @throws ConfigurationLoadException if the configuration could not be
   *         loaded.
   */
  public Builder<T> from(Configuration config) throws ConfigurationLoadException;

  /**
   * Loads credentials from "ads.properties" file in one of the following
   * locations according to the following order: in the current directory, in
   * the user home directory, in the classpath
   * @throws ConfigurationLoadException if the configuration could not be
   *         loaded.
   */
  public Builder<T> fromFile() throws ConfigurationLoadException;

  /**
   * Populates this builder from a properties file from a specified path. If
   * not absolute, will look in user home directory, the current classpath and
   * the system classpath.
   *
   * @param path the path to try first as a resource, then as a file
   * @return Builder populated with properties.
   * @throws ConfigurationLoadException if the configuration could not be
   *         loaded.
   */
  public Builder<T> fromFile(String path) throws ConfigurationLoadException;

  /**
   * Populates this builder from a properties file from a specified path.
   *
   * @param path the path to load properties from
   * @return Builder populated with properties.
   * @throws ConfigurationLoadException if the configuration could not be
   *         loaded.
   */
  public Builder<T> fromFile(File path) throws ConfigurationLoadException;

  /**
   * Populates this builder from a properties file from a specified path. If
   * not absolute, will look in user home directory, the current classpath and
   * the system classpath.
   *
   * @param path the path to try first as a resource, then as a file
   * @return Builder populated with properties.
   * @throws ConfigurationLoadException if the configuration could not be
   *         loaded.
   */
  public Builder<T> fromFile(URL path) throws ConfigurationLoadException;
}


text:
'''Parse and represent natural log datatypes.'''

from ln.backend.exception import BadTypeError
import numpy as np

INT_TYPES = set(['int8', 'int16', 'int32', 'int64'])
FLOAT_TYPES = set(['float32', 'float64'])
SCALAR_TYPES = INT_TYPES | FLOAT_TYPES

NUMPY_TYPE_MAPPING = dict(
    int8=np.int8,
    int16=np.int16,
    int32=np.int32,
    int64=np.int64,
    float32=np.float32,
    float64=np.float64
)

class Datatype(object):
    '''A representation of a Natural Log datatype'''

    def __init__(self, base, shape=None, mimetype=None):
        '''Create a new datatype.

        :param base: Base data type, either one of the scalar types or 'blob'.
        :param shape: Tuple of dimensions if array type, otherwise None.
        :param mimetype: Mimetype of data if blob type, otherwise None.

        Raises BadTypeError if an invalid combination of arguments is set.
        '''
        if base not in SCALAR_TYPES and base != 'blob':
            raise BadTypeError('Base of type must be one of the scalar types or "blob".')
        if shape is not None and mimetype is not None:
            raise BadTypeError('A type cannot have array shape and mimetype at the same time.')
        if base == 'blob' and mimetype is None:
            raise BadTypeError('A blob type must have a MIME type.')

        self.base = base
        if shape is not None:
            self.shape = tuple(shape)  # Ensure equality tests work later
        else:
            self.shape = None
        self.mimetype = mimetype

    def is_scalar(self):
        '''Return true if this is a scalar type'''
        return self.shape is None and self.mimetype is None

    def is_int_scalar(self):
        '''Return true if this is an integer scalar type'''
        return self.base in INT_TYPES and self.shape is None \
            and self.mimetype is None

    def is_float_scalar(self):
        '''Return true if this is an floating point scalar type'''
        return self.base in FLOAT_TYPES and self.shape is None \
            and self.mimetype is None

    def is_array(self):
        '''Return true if this is an array type.'''
        return self.shape is not None

    def is_blob(self):
        '''Return true if this is a blob type'''
        return self.base == 'blob'

    def check_shape(self, obj):
        '''Check the shape of object matches this data type (only valid for
        array types).

        Works on numpy arrays or nested lists / tuples.

        Returns True if shapes match.
        '''
        array = np.asarray(obj)
        return array.shape == self.shape

    def coerce(self, value):
        '''Convert ``value`` to the canonical Python type represent this
        datatype.

        Integer types go to ``int``, floating point types go to ``float``,
        array types go to numpy arrays with the corresponding dtype, and
        blob types become ``bytes``.

        Raises ``BadTypeError`` if ``value`` cannot be coerced to this
        datatype.
        '''
        try:
            if self.is_int_scalar():
                return int(value)
            elif self.is_float_scalar():
                return float(value)
            elif self.is_array():
                dtype = NUMPY_TYPE_MAPPING[self.base]
                array = np.asarray(value, dtype=dtype)
                if array.shape != self.shape:
                    raise BadTypeError('Cannot coerce value')
                return array
            elif self.is_blob():
                return bytes(value)
        except (ValueError, TypeError) as e:
            raise BadTypeError(str(e))

    def make_zero(self):
        '''Return an "zero" instance of this data type.

        Scalars return zero, array types return an array of the
        desired shape with all elements equal to zero, and blob
        types return the empty string.
        '''
        if self.is_int_scalar():
            return 0
        elif self.is_float_scalar():
            return 0.0
        elif self.is_array():
            return np.zeros(shape=self.shape, dtype=NUMPY_TYPE_MAPPING[self.base])
        elif self.is_blob():
            return b''

    def convert_to_jsonable(self, value):
        '''Converts value to a type that can be handled by the JSON parser,
        i.e. no numpy types.

        Assumes that input value has been returned by coerce, so is a scalar,
        numpy array, or bytes object.
        '''
        if self.is_int_scalar():
            return int(value)
        elif self.is_float_scalar():
            return float(value)
        elif self.is_array():
            return value.tolist()
        elif self.is_blob():
            return bytes(value)

def parse_datatype(typestring):
    '''Parse a datatype string and return an instance of Datatype to
    represent it.

    :param typestring: String descriptor of data type.
    '''

    if ':' in typestring:  # Attempt to parse as blob type
        base, mime = typestring.split(':', 1)
        if base != 'blob':
            raise BadTypeError('Only blob types can contain ":"')
        else:
            return Datatype('blob', mimetype=mime)
    elif '[' in typestring:  # Attempt to parse as array type
        base, rest = typestring.split('[', 1)
        if base not in SCALAR_TYPES:
            raise BadTypeError('Invalid base type in array type')
        shape_string = rest.split(']', 1)[0].split(',')
        try:
            # Convert string to tuple of integers, removing whitespace
            shape = tuple([int(s.strip()) for s in shape_string
                if s.strip() != ''])
        except ValueError:
            raise BadTypeError('Invalid shape in array type')

        return Datatype(base, shape=shape)
    else:
        if typestring not in SCALAR_TYPES:
            raise BadTypeError('Unknown scalar type')
        else:
            return Datatype(typestring)


text:
package com.hazelcast.internal.jmx;

import com.hazelcast.core.ILock;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.HazelcastTestSupport;
import com.hazelcast.test.TestHazelcastInstanceFactory;
import com.hazelcast.test.annotation.ParallelTest;
import com.hazelcast.test.annotation.QuickTest;
import com.hazelcast.util.Clock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelTest.class})
public class LockMBeanTest extends HazelcastTestSupport {

    private static final String TYPE_NAME = "ILock";

    private TestHazelcastInstanceFactory hazelcastInstanceFactory = createHazelcastInstanceFactory(1);
    private MBeanDataHolder holder = new MBeanDataHolder(hazelcastInstanceFactory);

    private ILock lock;
    private String objectName;

    @Before
    public void setUp() {
        lock = holder.getHz().getLock("lock");
        objectName = lock.getName();

        holder.assertMBeanExistEventually(TYPE_NAME, objectName);
    }

    @After
    public void tearDown() {
        hazelcastInstanceFactory.shutdownAll();
    }

    @Test
    public void testLockCountIsTwo_whenLockedTwice() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);
        lock.lock(1000, TimeUnit.MILLISECONDS);

        // check number of times locked (locked twice now)
        int lockCount = getIntegerAttribute("lockCount");

        assertEquals(2, lockCount);
    }

    @Test
    public void testMBeanHasLeaseTime_whenLockedWithLeaseTime_remainingLeaseTimeCannotBeGreaterThanOriginal() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);

        long remainingLeaseTime = getLongAttribute("remainingLeaseTime");
        assertFalse(remainingLeaseTime > 1000);
    }

    @Test
    public void testMBeanHasLeaseTime_whenLockedWithLeaseTime_mustBeLockedWhenHasRemainingLease() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);

        boolean isLocked = lock.isLockedByCurrentThread();
        long remainingLeaseTime = getLongAttribute("remainingLeaseTime");
        boolean hasRemainingLease = remainingLeaseTime > 0;
        assertTrue(isLocked || !hasRemainingLease);
    }

    @Test
    public void testMBeanHasLeaseTime_whenLockedWithLeaseTime_eitherHasRemainingLeaseOrIsUnlocked() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);

        long remainingLeaseTime = getLongAttribute("remainingLeaseTime");
        boolean hasLeaseRemaining = remainingLeaseTime > 0;
        boolean isLocked = lock.isLockedByCurrentThread();
        assertTrue(!isLocked || hasLeaseRemaining);
    }

    @Test
    public void testMBeanHasLeaseTime_whenLockedWithLeaseTime_mustHaveRemainingLeaseBeforeItExpires() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);
        long startTime = Clock.currentTimeMillis();

        long remainingLeaseTime = getLongAttribute("remainingLeaseTime");
        long timePassed = Clock.currentTimeMillis() - startTime;
        boolean hasLeaseRemaining = remainingLeaseTime > 0;

        assertTrue(hasLeaseRemaining || timePassed >= 1000);
    }

    @Test
    public void testIsNotLocked_whenMBeanForceUnlocked() throws Exception {
        lock.lock(1000, TimeUnit.MILLISECONDS);

        holder.invokeMBeanOperation(TYPE_NAME, objectName, "forceUnlock", null, null);

        assertFalse("Lock is still locked, although forceUnlock has been called", lock.isLocked());
    }

    private Long getLongAttribute(String name) throws Exception {
        return (Long) holder.getMBeanAttribute(TYPE_NAME, objectName, name);
    }

    private Integer getIntegerAttribute(String name) throws Exception {
        return (Integer) holder.getMBeanAttribute(TYPE_NAME, objectName, name);
    }
}


text:
/**
 * package-info.
 */
package org.deviceconnect.android.deviceplugin.sonycamera;


text:
'use strict';

angular.module('App')
.controller('OnlineCtrl', OnlineCtrl);

function OnlineCtrl ($rootScope, Game) {
	var online = this;
	var socket, player, game;

	online.playBtn = true;
	online.playBtnDisabled = true;
	online.playBtnHandler = playBtnHandler;
	online.playBtnText = 'Wait for player';
	setTimeout(playInit, 0);

	$rootScope.$on('endGame', endGameHandler);
	$rootScope.$on('move', moveHandler);

	function clearSocketsListeners () {
		socket.removeAllListeners('events');
	}

	function socketEvents () {
		socket.on('events', function(data) {
			if (data.typeEvent == 'connected') {
				handleConnected(data.value);
			}
			if (data.typeEvent == 'start') {
				handleStart(data.value);
			}
			if (data.typeEvent == 'moved') {
				handleMoved(data.value);
			}
			if (data.typeEvent == 'move') {
				handleMove(data.value);
			}
			if (data.typeEvent == 'disconnect') {
				handleDisconnect();
			}
		});
	}

	function handleDisconnect () {
		$rootScope.$emit('online-disconnect');
		online.msg = 'You are: ' + player + ', Opponent disconnected';
		online.playBtn = true;
		$rootScope.$apply();
	}

	function handleMoved (value) {
		$rootScope.$emit('online-moved', value);
		online.msg = 'You are: ' + player + ', Your turn';
		$rootScope.$apply();
	}

	function handleConnected (value) {
		player = value;
		online.msg = 'You are: ' + player;
		$rootScope.$apply();
	}

	function handleMove (value) {
		if (value == 'move') {
			online.msg = 'You are: ' + player + ', Your turn';
			$rootScope.$emit('online-move');
		} else {
			online.msg = 'You are: ' + player + ', Opponent turn';
		}
	}

	function handleStart (value) {
		handleMove(value);

		online.playBtn = false;
		$rootScope.$apply();
	}

	function moveHandler (event, param) {
		socket.emit('move', {
			player: player,
			data: param
		});
		online.msg = 'You are: ' + player + ', Opponent turn';
		$rootScope.$apply();
	}

	function playInit () {
		game = new Game();
		game.init();
		game.initOnline();
		socket = io();
		socketEvents();
	}

	function playBtnHandler () {
		game = new Game();
		game.init();
		game.initOnline();
		online.playBtnDisabled = true;
		online.msg = 'You are: ' + player;
		online.playBtnText = 'Wait for player';
		socket.emit('restart');
		socketEvents();
	}

	function endGameHandler (event, param) {
		if (param == 'draw') {
			online.playBtnText = 'Draw';
		}
		if (param == 'wino') {
			online.playBtnText = 'O wins';
		}
		if (param == 'winx') {
			online.playBtnText = 'X wins';
		}

		online.msg = 'You are: ' + player + ', Play Again?';
		online.playBtn = true;
		online.playBtnDisabled = false;

		socket.emit('end');
		clearSocketsListeners();
		$rootScope.$apply();
	}
}


text:
Consultar Usuários

Filtrar consulta:

		<form class="clearfix" ng-submit="vm.filtros.filtrar()">

				Por login
				<input type="text" class="form-control" id="filtro_login" placeholder="Por login" ng-model="vm.filtros.login">

				Por nome
				<input type="text" class="form-control" id="filtro_nome" placeholder="Por nome" ng-model="vm.filtros.nome">

				Por CPF
				<input type="text" class="form-control" id="filtro_cpf" mask="999.999.999-99" clean="true" placeholder="Por CPF" ng-model="vm.filtros.cpf">

				Por cargo
				<select id="filtro_cargo" class="form-control" ng-model="vm.filtros.cargo" ng-options="cargo as cargo.rotulo for cargo in vm.cargos"></select>

				<button type="submit" class="btn btn-primary form-control" ng-disabled="vm.filtros.nenhumFiltroPreenchido() || vm.carregando">Filtrar</button>

				<button type="button" class="btn btn-primary form-control" ng-disabled="vm.carregando" ng-click="vm.recarregar()">Limpar</button>

		</form>

					#
					Usuario

Nenhum usuário encontrado

					account_circle

						Funcionário {{ usuario.funcionario.nome }}

						com login {{ usuario.login }}

						e CPF {{ usuario.funcionario.cpf | brCpf }}

						de cargo {{ usuario.funcionario.cargo | capitalize }}

							está atualmente INATIVO

						mode_edit

	Exibindo {{ vm.usuarios.length }} de {{ vm.resource.page.totalElements }} registros
	<button class="btn btn-primary" ng-if="vm.podeCarregarMais()" ng-disabled="vm.carregando" ng-click="vm.carregarMais()">Exibir mais</button>


text:
var ifthen = require('./ifthen');

var assert = require('assert');

describe('ifthen', function () {
    it('then condition', function (done) {
        ifthen.if_(true).then_(
            function (callback) {
                callback(null, 1);
            }
        ).finally_(function (err, value) {
            assert.equal(value, 1);
            done();
        });
    });

    it('then condition called when else_ specified', function (done) {
        ifthen.if_(true).then_(
            function (callback) {
                callback(null, 1);
            }
        ).else_(function (callback) {
            callback('error');
        }).finally_(function (err, value) {
            assert.equal(value, 1);
            done();
        });
    });

    it('else condition called when then_ specified', function (done) {
        ifthen.if_(1 < 0).then_(
            function (callback) {
                callback('error');
            }
        ).else_(
            function (callback) {
                callback(null, 1);
            }
        ).finally_(function (err, value) {
            assert.equal(value, 1);
            done();
        });
    });

    it('else condition fails when then_ not specified', function () {
        assert.throws(function () {
            ifthen.if_(1 < 0).else_(
                function (callback) {
                    callback(null, 1);
                }
            ).finally_(function (err, value) {
                assert.equal(value, 1);
                done();
            });
        }, /else_ specified with no then_/);
    });

    it('if with no finally and ! condition times out', function (done) {
        setTimeout(done, 100);

        ifthen.if_(false).then_(function () {
            assert(false);
        });
    });
});


text:
FOUNDATION_EXPORT double CommonCryptoWatchOSVersionNumber;

//! Project version string for CommonCryptoWatchOS.
FOUNDATION_EXPORT const unsigned char CommonCryptoWatchOSVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CommonCryptoWatchOS/PublicHeader.h>


text:
<?php

declare(strict_types=1);

namespace App\Mail;

use App\Models\DocuSignEnvelope;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Symfony\Component\Mime\Email;

class MembershipAgreementDocuSignEnvelopeReceived extends Mailable implements ShouldQueue
{
    use Queueable;
    use SerializesModels;

    /**
     * Create a new message instance.
     */
    public function __construct(public DocuSignEnvelope $envelope)
    {
    }

    /**
     * Build the message.
     */
    public function build(): self
    {
        return $this->from('noreply@my.robojackets.org', 'RoboJackets')
                    ->to($this->envelope->signedBy->gt_email, $this->envelope->signedBy->name)
                    ->cc(config('services.membership_agreement_archive_email'), 'Membership Agreement Archives')
                    ->subject('Membership agreement signed')
                    ->text('mail.agreement.docusignenvelopereceived')
                    ->withSymfonyMessage(static function (Email $email): void {
                        $email->replyTo('RoboJackets <hello@robojackets.org>');
                    })
                    ->tag('agreement-docusign-received')
                    ->metadata('envelope-id', strval($this->envelope->id));
    }
}


text:
describe "Array#cycle" do
  ruby_version_is '1.8.7' do
    it "returns nil and does nothing for non positive n or empty arrays" do
      [1,2,3].cycle(0){ throw "ball"}.should be_nil
      [].cycle(6){ throw "ball"}.should be_nil
    end

    it "cycle as many times as requested" do
      [1,2,3].cycle(2).to_a.should == [1,2,3,1,2,3]
    end

    it "cycles indefinitely if called without argument" do
      bomb = 10
      [1,2,3].cycle do
        bomb -= 1
        break 42 if bomb <= 0
      end.should == 42
      bomb.should == 0
    end

    it "cycles indefinitely if argument is nil" do
      bomb = 10
      [1,2,3].cycle(nil) do
        bomb -= 1
        break 42 if bomb <= 0
      end.should == 42
      bomb.should == 0
    end

    it "doesn't rescue StopIteration" do
      lambda {
        [1,2,3].cycle do
          raise StopIteration
        end
      }.should raise_error(StopIteration)
      lambda {
        [1,2,3].cycle(2) do
          raise StopIteration
        end
      }.should raise_error(StopIteration)
    end

    it "raises a TypeError if passed a non-Numeric and non-nil argument" do
      lambda {
        [1,2,3].cycle("4"){}
      }.should raise_error(TypeError)
      lambda {
        [1,2,3].cycle(false){}
      }.should raise_error(TypeError)
    end

    it "yields successive elements of the array repeatedly" do
      b = []
      [1,2,3].cycle do |elem|
        b << elem
        break if b.size == 7
      end
      b.should == [1,2,3,1,2,3,1]
    end
  end
end


text:
from Queue import PriorityQueue
import unittest

class MCastOrdering(object):

    def __init__(self, numProcs, deliverCB):
        '''
        numProcs - number of processes
        deliverCB - deliverCB(fromProc, toProc, msg)
        '''
        pass

    def sendMcast(self, proc, msg):
        pass

    def recvMcast(self, proc, msg):
        pass

class BaseMCastOrdering(MCastOrdering):

    def __init__(self, numProcs, deliverCB, clock):
        self.numProcs = numProcs
        self.deliverCB = deliverCB
        self.clock = clock
        self.ts = []
        self.msg = {}
        self.buffer = {}

    def _sendMcast(self, proc, msg, ts):
        self.msg[msg] = [proc, ts]

    def _deliver(self, toProc, msg):
        (fromProc, ts) = self.msg[msg]
        self.deliverCB(fromProc, toProc, msg)

    def _buffer(self, fromProc, toProc, msg, priority):
        self._bufferKey((fromProc, toProc), msg, priority)

    def _bufferKey(self, key, msg, priority):
        if key not in self.buffer:
            self.buffer[key] = PriorityQueue()
        queue = self.buffer[key]
        queue.put((priority, msg))

    def _deliverAllSequential(self, fromProc, toProc, nextPriority):
        return self._deliverAllSequentialKey((fromProc, toPRoc), nextPriority)

    def _deliverAllSequentialKey(self, key, nextPriority):
        # Deliver all messages in buffer with consecutive priorities starting at
        # nextPriority.  For example, if nextPriority=5, and queue has (5,6,7,10,11), deliver 5,6,7
        if key not in self.buffer:
            return
        queue = self.buffer[key]
        lastPriorityDelivered = None
        while not queue.empty():
            (msgPriority, msg) = queue.get()
            if msgPriority == nextPriority:
                self._deliver(toProc, msg)
                lastPriorityDelivered = msgPriority
                nextPriority += 1
            else:
                queue.put(msgPriority, msg)
                break
        return lastPriorityDelivered

class FIFOMCastOrdering(BaseMCastOrdering):

    def __init__(self, numProcs, deliverCB):
        BaseMCastOrdering.__init__(self, numProcs, deliverCB, None)
        # Each Pi maintains a vector of seq numbers Pi[1 .. N]
        # Pi[j] is latest seq num Pi has received from Pj
        self.seqNums = [range(numProcs) for i in xrange(numProcs)]

    def sendMcast(self, proc, msg):
        seqNums = self.seqNums[proc]
        seqNums[proc] += 1
        self._sendMcast(proc, msg, seqNums[proc])

    def recvMcast(self, toProc, msg):
        (fromProc, fromSeqNum) = self.msg[msg]
        seqNums = self.seqNums[toProc]
        if fromSeqNum == seqNums[fromProc] + 1:
            self._deliver(toProc, msg)
            seqNums[fromProc] = fromSeqNum
            lastPriorityDelivered = self._deliverAllSequential(fromProc, toProc, fromSeqNum + 1)
            if lastPriorityDelivered != None:
                seqNums[fromProc] = lastPriorityDelivered
        else:
            self._buffer(fromProc, toProc, msg, fromSeqNum)

class TotalMCastOrdering(BaseMCastOrdering):

    def __init__(self, numProcs, deliverCB):
        BaseMCastOrdering.__init__(self, numProcs, deliverCB, None)
        self.sequencer = 0
        self.glblSeqNum = 0
        self.procSeqNum = range(numProcs)

    def recvMcast(self, toProc, msg):
        if toProc == self.sequencer:
            self.glblSeqNum += 1
            self.sendMcast(self.sequencer, (msg, self.glblSeqNum))
        else:
            (fromProc, na) = self.msg[msg]
            if fromProc == self.sequencer:
                (actMsg, glblSeqNum) = msg
                if self.procSeqNum[toProc] + 1 == glblSeqNum:
                    self._deliverAllSequentialKey(toProc, self.procSeqNum[toProc])
                    self.procSeqNum[toProc] += 1

class MCastOrderingTest(unittest.TestCase):

    def setUp(self):
        self.msgList = []
        deliverCB = lambda f,t,m: self.msgList.append((f,t,m))
        self.fifo = FIFOMCastOrdering(4, deliverCB)
        self.msgIdx = 0

    def checkMsg(self, fromProc, toProc, msg):
        self.assertEquals((fromProc, toProc, msg), self.msgList[self.msgIdx])
        self.msgIdx += 1

    def testFIFO(self):
        fifo = self.fifo
        # First mcast
        fifo.sendMcast(0, "m1")
        fifo.recvMcast(1, "m1")
        self.checkMsg(0, 1, "m1")
        fifo.recvMcast(3, "m1")
        self.checkMsg(0, 3, "m1")
        # Second mcast
        fifo.sendMcast(0, "m2")
        fifo.recvMcast(2, "m2") # buffered... waiting for m1
        fifo.recvMcast(2, "m1")
        self.checkMsg(0, 2, "m1")
        self.checkMsg(0, 2, "m2")
        fifo.recvMcast(1, "m2")
        self.checkMsg(0, 1, "m2")
        # Third mcast
        fifo.sendMcast(2, "m3")
        fifo.recvMcast(3, "m3") # No buffering
        fifo.recvMcast(3, "m2")
        self.checkMsg(2, 3, "m3")
        self.checkMsg(0, 3, "m2")
        fifo.recvMcast(0, "m3")
        fifo.recvMcast(1, "m3")
        self.checkMsg(2, 0, "m3")
        self.checkMsg(2, 1, "m3")

if __name__ == '__main__':
    unittest.main()


text:
package cz.muni.fi.xklinec.whiteboxAES.generator;

import cz.muni.fi.xklinec.whiteboxAES.XORBox;
import cz.muni.fi.xklinec.whiteboxAES.XORCascade;
import cz.muni.fi.xklinec.whiteboxAES.generator.Generator.W08x128Coding;
import cz.muni.fi.xklinec.whiteboxAES.generator.Generator.W08x32Coding;
import cz.muni.fi.xklinec.whiteboxAES.generator.Generator.XORCODING;

/**
 *
 * @author ph4r05
 */
public class GXORCascade implements IOEncoding{
    public static final int XOR_BOXES = XORCascade.BOXES;
    protected Generator.XORCODING cod[];

    public GXORCascade() {
        super();
        cod = new Generator.XORCODING[XOR_BOXES];
        cod[0] = new Generator.XORCODING(XORBox.BOXES);
        cod[1] = new Generator.XORCODING(XORBox.BOXES);
        cod[2] = new Generator.XORCODING(XORBox.BOXES);
    }

    /**
     * Allocates XOR cascade coding.
     * @param idx
     * @return
     */
    public final int allocate(int idx){
        idx = Generator.ALLOCXORCoding(cod[0], 0, idx, XORBox.BOXES);
        idx = Generator.ALLOCXORCoding(cod[1], 0, idx, XORBox.BOXES);
        idx = Generator.ALLOCXORCoding(cod[2], 0, idx, XORBox.BOXES);
        return idx;
    }

    /**
     * Connect cascade from the inside.
     * Connects layer 1 to layer 2 in XOR component.
     *
     */
    public final void connectInternal(){
        // Connect output from two XOR boxes to input of one XOR box
        Generator.CONNECT_XOR_TO_XOR_H(cod[0], 0, cod[2], 0);
        Generator.CONNECT_XOR_TO_XOR_L(cod[1], 0, cod[2], 0);
    }

    /**
     * Connects output of this box to input of 8bit table.
     * Slot gives particular output slot in XOR cascade.
     *
     * @param c
     * @param slot
     */
    public void connectOut(GTBox8to32 c, int slot){
        W08x32Coding cod1 = c.getCod();
        Generator.CONNECT_XOR_TO_W08x32(cod[XORCascade.BOXES-1], 2*slot, cod1);
    }

    /**
     * Connects output of this box to input of 8bit table.
     * Slot gives particular output slot in XOR cascade.
     *
     * @param c
     * @param slot
     */
    public void connectOut(GTBox8to128 c, int slot){
        W08x128Coding cod1 = c.getCod();
        Generator.CONNECT_XOR_TO_W08x32(cod[XORCascade.BOXES-1], 2*slot, cod1);
    }

    /**
     * Generates XOR tables for particular XOR cascade.
     *
     * @param c
     * @param g
     */
    public void generateTables(XORCascade c, Generator g){
        final Bijection4x4[] pCoding04x04 = g.getIo().getpCoding04x04();
        XORBox[] x = c.getX();

        // Iterate over each 32bit XOR box
        for(int i=0; i<XOR_BOXES; i++){
            // Get whole XOR table; tbl[XORBox.BOXES][256]
            byte[][] tbl = x[i].getTbl();
            for(int j=0; j<XORBox.BOXES; j++){
                Generator.generateXorTable(cod[i].xtb[j], tbl[j], pCoding04x04);
            }
        }
    }

    public XORCODING[] getCod() {
        return cod;
    }

    public int getIOInputWidth() {
        return XORCascade.WIDTH;
    }

    public int getIOOutputWidth() {
        return XORCascade.WIDTH;
    }

    public int getIOInputSlots() {
        return XORCascade.WIDTH;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Project:Easy Web Framework
   Description:
   EasyFK stands for Easy Web Framework.It's an open source product for E-Business / E-Commerce.It
   was launched by a chinese Hezhiping(QQ:110476592) in 2015.The goal of EasyFK is to  provide a
   foundation and starting point for reliable, secure , simple-to-use ,cost-effective ,scalable
   and suitable-for-Chinese E-Business / E-Commerce solutions. With EasyFK, you can get started
   right away without the huge deployment and maintenance costs of E-Business / E-Commerce systems.
   Of course, you can customize it or use it as a framework to implement your most challenging business needs.
   EasyFk is licensed under the Apache License Version 2.0.  You may obtain a copy of the License at
   http://www.apache.org/licenses/LICENSE-2.0
   Author:hezhiping   Email:110476592@qq.com
-->
<!--
本文件自动扫描cn.gorun8.easyfk.*product*.controller下的@Controller形成SpringMVC的Mapping。
为了简便,我们建议您也采用cn.gorun8.easyfk.*product*.controller这样的包结构管理Controller。
如果需要引用其它组件的controller,可以在本文件中添加相应的扫描即可。
-->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:c="http://www.springframework.org/schema/c" xmlns:cache="http://www.springframework.org/schema/cache"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:lang="http://www.springframework.org/schema/lang" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<mvc:annotation-driven>
		<mvc:message-converters>
			<bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
				<property name="supportedMediaTypes">
					<list>
						<value>application/json;charset=UTF-8</value>
					</list>
				</property>
			</bean>
		</mvc:message-converters>
	</mvc:annotation-driven>

	<!-- Freemaerker 配置 开始 -->
    <bean id="freemarkerConfig" class="cn.gorun8.easyfk.webapp.ftl.EasyFKFreeMarkerConfigurer">
        <property name="templateLoaderPath" value="/resources/" />
        <property name="freemarkerSettings">
            <props>
                <prop key="template_update_delay">0</prop>
                <prop key="default_encoding">UTF-8</prop>
                <prop key="number_format">0.####</prop>
                <prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
                <prop key="classic_compatible">true</prop>
                <prop key="template_exception_handler">ignore</prop>
            </props>
        </property>
    </bean>

	<bean id="viewResolver"
        class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
        <property name="cache" value="true" />
		<property name="viewClass" value="cn.gorun8.easyfk.webapp.ftl.EasyFKFreeMarkerView"/>
        <property name="prefix" value="" />
        <property name="suffix" value=".ftl" />
        <property name="contentType" value="text/html;charset=UTF-8"/>
        <property name="requestContextAttribute" value="request" />
        <property name="exposeSpringMacroHelpers" value="true" />
        <property name="exposeRequestAttributes" value="true" />
        <property name="exposeSessionAttributes" value="true" />
    </bean>
	<!-- 指定所上传文件的总大小不能超过指定大小的bytes[这里设定为100M]。注意maxUploadSize属性的限制不是针对单个文件,而是所有文件的容量之和 -->
	<!--如果需要上传文件,打开如下配置
	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<property name="maxUploadSize" value="104857600" />
	</bean>
	-->
	<!-- Freemaerker 配置 结束 -->

	<mvc:resources mapping="/style/**" location="/style/" />
	<mvc:resources mapping="/js/**" location="/js/" />
	<mvc:resources mapping="/config/**" location="/config/" />

	<mvc:view-controller path="/" view-name="page/index" />
	<mvc:view-controller path="/page/**" />

	<!--将拦截所有的URL请求 -->
	<!--
	<mvc:interceptors>
	    <mvc:interceptor>
	        <mvc:mapping path="/**" />
	        <mvc:exclude-mapping path="/logout/**" />
	    	<bean class="cn.gorun8.easyfk.webapp.interceptor.SsoInterceptor"/>
	    </mvc:interceptor>
	</mvc:interceptors>
	 -->

	<context:component-scan base-package="cn.gorun8.easyfk.product.controller"
		use-default-filters="false">
		<context:include-filter type="annotation"
			expression="org.springframework.stereotype.Controller" />
	</context:component-scan>
	<!--默认引入common组件中-->
	<context:component-scan base-package="cn.gorun8.easyfk.common.controller"
							use-default-filters="false">
		<context:include-filter type="annotation"
								expression="org.springframework.stereotype.Controller" />
	</context:component-scan>

</beans>


text:
<?php
/**
 * DO NOT EDIT THIS FILE!
 *
 * This file was automatically generated from external sources.
 *
 * Any manual change here will be lost the next time the SDK
 * is updated. You've been warned!
 */

namespace DTS\eBaySDK\Browse\Types;

/**
 *
 * @property integer $availabilityThreshold
 * @property \DTS\eBaySDK\Browse\Enums\AvailabilityThresholdEnum $availabilityThresholdType
 * @property \DTS\eBaySDK\Browse\Enums\DeliveryOptionsEnum[] $deliveryOptions
 * @property \DTS\eBaySDK\Browse\Enums\AvailabilityStatusEnum $estimatedAvailabilityStatus
 * @property integer $estimatedAvailableQuantity
 * @property integer $estimatedSoldQuantity
 */
class EstimatedAvailability extends \DTS\eBaySDK\Types\BaseType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = [
        'availabilityThreshold' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'availabilityThreshold'
        ],
        'availabilityThresholdType' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'availabilityThresholdType'
        ],
        'deliveryOptions' => [
            'type' => 'string',
            'repeatable' => true,
            'attribute' => false,
            'elementName' => 'deliveryOptions'
        ],
        'estimatedAvailabilityStatus' => [
            'type' => 'string',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'estimatedAvailabilityStatus'
        ],
        'estimatedAvailableQuantity' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'estimatedAvailableQuantity'
        ],
        'estimatedSoldQuantity' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'estimatedSoldQuantity'
        ]
    ];

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = [])
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
import template from './about.html';
import controller from './about.controller';

export default {
  template,
  controller,
};


text:
package win.velne.learnone.springcloudconfigclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FooController {

    @Value("${foo}")
    String foo;

    @RequestMapping("/")
    public String getFoo() {
        return foo;
    }

}


text:
/*                      _             _
 *  _ __ ___   ___   __| |    ___ ___| |  mod_ssl
 * | '_ ` _ \ / _ \ / _` |   / __/ __| |  Apache Interface to OpenSSL
 * | | | | | | (_) | (_| |   \__ \__ \ |
 * |_| |_| |_|\___/ \__,_|___|___/___/_|
 *                      |_____|
 *  ssl_engine_log.c
 *  Logging Facility
 */
                             /* ``The difference between a computer
                                  industry job and open-source software
                                  hacking is about 30 hours a week.''
                                         -- Ralf S. Engelschall     */
#include "ssl_private.h"

/*  _________________________________________________________________
**
**  Logfile Support
**  _________________________________________________________________
*/

static const struct {
    const char *cpPattern;
    const char *cpAnnotation;
} ssl_log_annotate[] = {
    { "*envelope*bad*decrypt*", "wrong pass phrase!?" },
    { "*CLIENT_HELLO*unknown*protocol*", "speaking not SSL to HTTPS port!?" },
    { "*CLIENT_HELLO*http*request*", "speaking HTTP to HTTPS port!?" },
    { "*SSL3_READ_BYTES:sslv3*alert*bad*certificate*", "Subject CN in certificate not server name or identical to CA!?" },
    { "*self signed certificate in certificate chain*", "Client certificate signed by CA not known to server?" },
    { "*peer did not return a certificate*", "No CAs known to server for verification?" },
    { "*no shared cipher*", "Too restrictive SSLCipherSuite or using DSA server certificate?" },
    { "*no start line*", "Bad file contents or format - or even just a forgotten SSLCertificateKeyFile?" },
    { "*bad password read*", "You entered an incorrect pass phrase!?" },
    { "*bad mac decode*", "Browser still remembered details of a re-created server certificate?" },
    { NULL, NULL }
};

static const char *ssl_log_annotation(const char *error)
{
    int i = 0;

    while (ssl_log_annotate[i].cpPattern != NULL
           && ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) != 0)
        i++;

    return ssl_log_annotate[i].cpAnnotation;
}

apr_status_t ssl_die(server_rec *s)
{
    if (s != NULL && s->is_virtual && s->error_fname != NULL)
        ap_log_error(APLOG_MARK, APLOG_EMERG, 0, NULL, APLOGNO(02311)
                     "Fatal error initialising mod_ssl, exiting. "
                     "See %s for more information",
                     ap_server_root_relative(s->process->pool,
                                             s->error_fname));
    else
        ap_log_error(APLOG_MARK, APLOG_EMERG, 0, NULL, APLOGNO(02312)
                     "Fatal error initialising mod_ssl, exiting.");

    return APR_EGENERAL;
}

/*
 * Prints the SSL library error information.
 */
void ssl_log_ssl_error(const char *file, int line, int level, server_rec *s)
{
    unsigned long e;
    const char *data;
    int flags;

    while ((e = ERR_peek_error_line_data(NULL, NULL, &data, &flags))) {
        const char *annotation;
        char err[256];

        if (!(flags & ERR_TXT_STRING)) {
            data = NULL;
        }

        ERR_error_string_n(e, err, sizeof err);
        annotation = ssl_log_annotation(err);

        ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s,
                     "SSL Library Error: %s%s%s%s%s%s",
                     /* %s */
                     err,
                     /* %s%s%s */
                     data ? " (" : "", data ? data : "", data ? ")" : "",
                     /* %s%s */
                     annotation ? " -- " : "",
                     annotation ? annotation : "");

        /* Pop the error off the stack: */
        ERR_get_error();
    }
}

static void ssl_log_cert_error(const char *file, int line, int level,
                               apr_status_t rv, const server_rec *s,
                               const conn_rec *c, const request_rec *r,
                               apr_pool_t *p, X509 *cert, const char *format,
                               va_list ap)
{
    char buf[HUGE_STRING_LEN];
    int msglen, n;
    char *name;

    apr_vsnprintf(buf, sizeof buf, format, ap);

    msglen = strlen(buf);

    if (cert) {
        BIO *bio = BIO_new(BIO_s_mem());

        if (bio) {
            /*
             * Limit the maximum length of the subject and issuer DN strings
             * in the log message. 300 characters should always be sufficient
             * for holding both the timestamp, module name, pid etc. stuff
             * at the beginning of the line and the trailing information about
             * serial, notbefore and notafter.
             */
            int maxdnlen = (HUGE_STRING_LEN - msglen - 300) / 2;

            BIO_puts(bio, " [subject: ");
            name = modssl_X509_NAME_to_string(p, X509_get_subject_name(cert),
                                              maxdnlen);
            if (!strIsEmpty(name)) {
                BIO_puts(bio, name);
            } else {
                BIO_puts(bio, "-empty-");
            }

            BIO_puts(bio, " / issuer: ");
            name = modssl_X509_NAME_to_string(p, X509_get_issuer_name(cert),
                                              maxdnlen);
            if (!strIsEmpty(name)) {
                BIO_puts(bio, name);
            } else {
                BIO_puts(bio, "-empty-");
            }

            BIO_puts(bio, " / serial: ");
            if (i2a_ASN1_INTEGER(bio, X509_get_serialNumber(cert)) == -1)
                BIO_puts(bio, "(ERROR)");

            BIO_puts(bio, " / notbefore: ");
            ASN1_TIME_print(bio, X509_get_notBefore(cert));

            BIO_puts(bio, " / notafter: ");
            ASN1_TIME_print(bio, X509_get_notAfter(cert));

            BIO_puts(bio, "]");

            n = BIO_read(bio, buf + msglen, sizeof buf - msglen - 1);
            if (n > 0)
               buf[msglen + n] = '\0';

            BIO_free(bio);
        }
        else {
            ap_abort_on_oom();
        }
    }
    else {
        apr_snprintf(buf + msglen, sizeof buf - msglen,
                     " [certificate: -not available-]");
    }

    if (r) {
        ap_log_rerror(file, line, APLOG_MODULE_INDEX, level, rv, r, "%s", buf);
    }
    else if (c) {
        ap_log_cerror(file, line, APLOG_MODULE_INDEX, level, rv, c, "%s", buf);
    }
    else if (s) {
        ap_log_error(file, line, APLOG_MODULE_INDEX, level, rv, s, "%s", buf);
    }

}

/*
 * Wrappers for ap_log_error/ap_log_cerror/ap_log_rerror which log additional
 * details of the X509 cert. For ssl_log_xerror, a pool needs to be passed in
 * as well (for temporary allocation of the cert's subject/issuer name strings,
 * in the other cases we use the connection and request pool, respectively).
 */
void ssl_log_xerror(const char *file, int line, int level, apr_status_t rv,
                    apr_pool_t *ptemp, server_rec *s, X509 *cert,
                    const char *fmt, ...)
{
    if (APLOG_IS_LEVEL(s,level)) {
       va_list ap;
       va_start(ap, fmt);
       ssl_log_cert_error(file, line, level, rv, s, NULL, NULL, ptemp,
                          cert, fmt, ap);
       va_end(ap);
    }
}

void ssl_log_cxerror(const char *file, int line, int level, apr_status_t rv,
                     conn_rec *c, X509 *cert, const char *fmt, ...)
{
    if (APLOG_IS_LEVEL(mySrvFromConn(c),level)) {
       va_list ap;
       va_start(ap, fmt);
       ssl_log_cert_error(file, line, level, rv, NULL, c, NULL, c->pool,
                          cert, fmt, ap);
       va_end(ap);
    }
}

void ssl_log_rxerror(const char *file, int line, int level, apr_status_t rv,
                     request_rec *r, X509 *cert, const char *fmt, ...)
{
    if (APLOG_R_IS_LEVEL(r,level)) {
       va_list ap;
       va_start(ap, fmt);
       ssl_log_cert_error(file, line, level, rv, NULL, NULL, r, r->pool,
                          cert, fmt, ap);
       va_end(ap);
    }
}


text:
<?php

namespace GithubService\Model;

class CommentStats
{
    use GithubTrait;
    use SafeAccess;

    public $totalPullRequestComments;
    public $totalIssueComments;
    public $totalGistComments;
    public $totalCommitComments;

    protected function getDataMap() {
        $dataMap = [
            ["totalPullRequestComments", "total_pull_request_comments"],
            ["totalIssueComments", "total_issue_comments"],
            ["totalGistComments", "total_gist_comments"],
            ["totalCommitComments", "total_commit_comments"],
        ];

        return $dataMap;
    }
}


text:
Online operation required to install an Ambari Server.

    module.exports = header: 'Ambari Server Prepare', ssh: false, handler: ({options}) ->
      for name, mpack of options.mpacks
        @file.cache
          header: "Mpack #{name}"
          if: mpack.enabled
          location: true
          md5: mpack.md5
          sha256: mpack.sha256
        , "#{mpack.source}"


text:
import Component from '@glimmer/component';

export default class TestOne extends Component {
  someValue = 'from component';
}


text:
set -eo pipefail

helperDir="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
pushd "$helperDir/.." >/dev/null

# Execute 'predestroy.sh' scripts for any active modules
source ./helpers/common.sh
allModules=$(listAllModules)
activeModules=$(getActiveTerraformModules)
IFS=','
for module in $allModules; do
  friendlyName=$(getFriendlyOutputName "$module")
  if ! contains "$activeModules" "$friendlyName"; then
    continue # Skip unless active.
  fi

  if [[ -f "../$module/.cloud/predestroy.sh" ]]; then
    # shellcheck disable=SC1090
    source "../$module/.cloud/predestroy.sh"
  fi
done

terraform destroy -auto-approve
popd >/dev/null


text:
    <?php if ($this->session->flashdata('message')) { ?>
        <div class="alert alert-<?php echo $this->session->flashdata('message_type'); ?>">
            <?php echo $this->session->flashdata('message'); ?>

    <?php } ?>

    <?php echo validation_errors(); ?>

<a href="<?php echo base_url('especificos') ?>">

Paso 1

Documento Especificos (<?php echo $this->session->userdata('TIPO_DOCUMENTO_ID_1'); ?>)

<a href="<?php echo base_url('formal') ?>">

Paso 2

Educación Formal (<?php echo $this->session->userdata('TIPO_DOCUMENTO_ID_2'); ?>)

<a href="<?php echo base_url('noformal') ?>">

Paso 3

Educación no Formal (<?php echo $this->session->userdata('TIPO_DOCUMENTO_ID_3'); ?>)

<a href="<?php echo base_url('laboral') ?>">

Paso 4

Experiencia Laboral (<?php echo $this->session->userdata('TIPO_DOCUMENTO_ID_4'); ?>)

<a href="<?php echo base_url('documentos/certificado') ?>">

Paso 5

Descargar Certificado (<?php echo $this->session->userdata('TIPO_DOCUMENTO_ID_TOTAL'); ?>)

            <img src="<?php echo base_url($this->session->userdata('CONVOCATORIA_IMAGEN')); ?>" style="width: 350px;">

Aplicativo de Cargue de Documentos.

<?php echo $this->session->userdata('CONVOCATORIA_NOMBRE'); ?>

            PASOS PARA REALIZAR EL CARGUE DE ARCHIVOS

            Para cargar los documentos, se debe tener en cuenta el siguiente procedimiento:

            1. Los documentos deben ser escaneados en formato pdf.

            2. Asegúrese que el tamaño del archivo sea de máximo de 2MB.

            3. Pulse el icono de la opción "Cargar o Modificar" correspondiente al archivo que se desea adjuntar,
            desplace la barra de desplazamiento hacia abajo y seleccione el archivo que contiene el documento a adjuntar.

            4. Finalmente, pulse el botón "Subir Documento de Identidad o Subir Libreta Militar (según sea el caso)" y
            asegúrese que le aparezca el mensaje "archivo adjuntado exitosamente".

            TENGA EN CUENTA ESTAS RECOMENDACIONES PARA CADA DOCUMENTO QUE VAYA A ADJUNTAR,
            DE ESTO DEPENDE EL ÉXITO DE LA ENTREGA Y RECEPCIÓN DE SUS DOCUMENTOS.

Agregar Educación No Formal

            TÍTULOS Y CERTIFICACIONES DE EDUCACIÓN PARA EL TRABAJO Y EL DESARROLLO HUMANO

        <?php if (count($documents_noformal_user) > 0) { ?>

                                No. Folio

                                Instituto

                                Nombre del curso

                                Intensidad

                                Fecha de Terminación

                                Ver Folio

                                Eliminar

                        <?php
                        //echo print_r($documents_formal_user, true);
                        $count = 1;
                        foreach ($documents_noformal_user as $document) {
                            ?>

                                    <?php echo $document->DOCUMENTO_FOLIO; ?>

                                    <?php echo $document->UNIVERSIDAD; ?>

                                    <?php echo $document->TITULO; ?>

                                    <?php echo $document->INTENSIDAD; ?>

                                    <?php echo $document->FECHA_TERMINACION; ?>

                                    <a target="_blank" href="<?php echo base_url('formal/view_document/' . encrypt_id($document->DOCUMENTO_ID)) ?>" class="btn btn-info btn-sm">

                                        Ver

                                        <button type="button" class="btn btn-danger dropdown-toggle btn-sm" data-toggle="dropdown">
                                            Eliminar
                                        </button>

                                                <a href="<?php echo base_url('noformal/delete_document/' . encrypt_id($document->DOCUMENTO_ID)) ?>">
                                                    Confirmar Eliminación

                            <?php
                            $count++;
                        }
                        ?>

        <?php } else { ?>

                No se han cargado documentos de Educación No Formal, por favor ingrese un documento en el siguiente formulario:

        <?php } ?>

    <?php echo form_open_multipart('noformal/insert', 'id="noformal_insert" class="form-signin" role="form" method="POST" autocomplete="off"'); ?>

                            INGRESO Y ACTUALIZACIÓN DE ESTUDIOS

                            Institución
                            <?php echo form_input('UNIVERSIDAD', '', 'id="UNIVERSIDAD" class="form-control" tabindex=1'); ?>

                            Nombre del Curso
                            <?php echo form_input('TITULO', '', 'id="TITULO" class="form-control" tabindex=2'); ?>

                            Intensidad Horaria
                            <?php echo form_input('INTENSIDAD', '', 'id="INTENSIDAD" class="form-control" tabindex=3') ?>

                            Fecha de Terminación (AAAA-MM-DD)
                            <?php echo form_input('FECHA_TERMINACION', '', 'id="FECHA_TERMINACION" class="form-control datepicker" tabindex=4') ?>

                            Adjunto
                            <?php echo form_upload('userfile', '', 'id="userfile" class="filebase" tabindex=4') ?>

                        <button type="submit" data-loading-text="Enviando..." class="loading-example-btn-3 btn btn-success">Ingresar Estudio</button>

                            <button type="button" class="btn btn-danger">Cancelar </button>

    <?php echo form_close(); ?>

                <a href="<?php echo base_url("formal") ?>" class="btn btn-info" role="button">
                    Regresar al paso 2: Educación Formal

                <a href="<?php echo base_url("laboral") ?>" class="btn btn-info" role="button">
                    Ir al paso 4: Experiencia Laboral

                <a href="<?php echo base_url("ingreso/logout") ?>" class="btn btn-danger btn-sm" role="button">
                    Cerrar Sesión


text:
namespace {

struct StreamNoticer {
    mutable int numStreams = 0;

    friend std::ostream &operator<<(std::ostream &o, const StreamNoticer &s) {
        s.numStreams++;
        return o << "[stream]";
    }
};

}

TEST_CASE("formats strings", "[Log]") {
    REQUIRE(Log::format() == "");
    REQUIRE(Log::format("hello") == "hello");
    REQUIRE(Log::format("hello", ' ', "world") == "hello world");
    REQUIRE(Log::format("There are ", 26, " letters in the alphabet") ==
            "There are 26 letters in the alphabet");
}

TEST_CASE("captures logs", "[Log]") {
    CaptureLog log;
    SECTION("min level debug") {
        log.minSeverity_ = Log::Severity::Debug;
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        CHECK(log.records == CaptureLog::Records({ D("debug"), I("info"),
                                                   W("warn"), E("error") }));
    }
    SECTION("min level info") {
        log.minSeverity_ = Log::Severity::Info;
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        CHECK(log.records ==
              CaptureLog::Records({ I("info"), W("warn"), E("error") }));
    }
    SECTION("min level warn") {
        log.minSeverity_ = Log::Severity::Warning;
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        CHECK(log.records == CaptureLog::Records({ W("warn"), E("error") }));
    }
    SECTION("min level error") {
        log.minSeverity_ = Log::Severity::Error;
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        CHECK(log.records == CaptureLog::Records({ E("error") }));
    }
}

TEST_CASE("doesn't unnecessarily format if disabled", "[Log]") {
    CaptureLog log;
    log.minSeverity_ = Log::Severity::Warning;
    StreamNoticer debugNoticer, infoNoticer, warnNoticer, errNoticer;
    log.debug("this shouldn't get streamed: ", debugNoticer);
    log.info("This also shouldn't get streamed: ", infoNoticer);
    log.warn("This should: ", warnNoticer);
    log.error("As should this: ", errNoticer);
    CHECK(debugNoticer.numStreams == 0);
    CHECK(infoNoticer.numStreams == 0);
    CHECK(warnNoticer.numStreams == 1);
    CHECK(errNoticer.numStreams == 1);
    CHECK(log.records == CaptureLog::Records(
            { W("This should: [stream]"), E("As should this: [stream]") }));

}


text:
#include "serialbox/core/Type.h"
#include "serialbox/core/Exception.h"
#include "serialbox/core/Unreachable.h"
#include <ostream>

namespace serialbox {

std::ostream& operator<<(std::ostream& stream, const OpenModeKind& mode) {
  switch(mode) {
  case OpenModeKind::Write:
    return (stream << std::string("Write"));
  case OpenModeKind::Read:
    return (stream << std::string("Read"));
  case OpenModeKind::Append:
    return (stream << std::string("Append"));
  default:
    serialbox_unreachable("invalid OpenModeKind");
  }
}

std::string TypeUtil::toString(TypeID id) {
  std::string str;

  if(TypeUtil::isArray(id))
    str += "std::vector<";

  switch(TypeUtil::getPrimitive(id)) {
  case TypeID::Boolean:
    str += "bool";
    break;
  case TypeID::Int32:
    str += "int";
    break;
  case TypeID::Int64:
    str += "std::int64_t";
    break;
  case TypeID::Float32:
    str += "float";
    break;
  case TypeID::Float64:
    str += "double";
    break;
  case TypeID::String:
    str += "std::string";
    break;
  case TypeID::Invalid:
    str += "invalid-type";
    break;
  default:
    serialbox_unreachable("invalid TypeID for TypeUtil::toString");
  }

  if(TypeUtil::isArray(id))
    str += ">";

  return str;
}

int TypeUtil::sizeOf(TypeID id) {
  switch(id) {
  case TypeID::Boolean:
    return 1;
  case TypeID::Float32:
  case TypeID::Int32:
    return 4;
  case TypeID::Int64:
  case TypeID::Float64:
    return 8;
  default:
    throw Exception("invalid type '%s' for TypeUtil::sizeOf", TypeUtil::toString(id));
  }
  serialbox_unreachable("unreachable");
}

bool TypeUtil::isPrimitive(TypeID id) noexcept { return (!TypeUtil::isArray(id)); }

bool TypeUtil::isArray(TypeID id) noexcept { return ((int)id & (int)TypeID::Array); }

TypeID TypeUtil::getPrimitive(TypeID id) noexcept {
  if(TypeUtil::isArray(id))
    return TypeID((int)id & ~((int)TypeID::Array));
  return id;
}

TypeID TypeUtil::getArray(TypeID id) noexcept {
  if(TypeUtil::isArray(id))
    return id;
  return TypeID((int)id | ((int)TypeID::Array));
}

std::ostream& operator<<(std::ostream& stream, const TypeID& t) {
  return (stream << TypeUtil::toString(t));
}

} // namespace serialbox


text:
using System;
using Lucene.Net.Analysis;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Lucene.Net.Test;
using NUnit.Framework;
using Version = Lucene.Net.Util.Version;

namespace Lucene.Net.Support
{
    [TestFixture]
    public class TestOldPatches
    {
        //-------------------------------------------
        [Test]
        [Description("LUCENENET-183")]
        public void Test_SegmentTermVector_IndexOf()
        {
            Lucene.Net.Store.RAMDirectory directory = new Lucene.Net.Store.RAMDirectory();
            Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net.Analysis.WhitespaceAnalyzer();
            Lucene.Net.Index.IndexWriter writer = new Lucene.Net.Index.IndexWriter(directory, analyzer, Lucene.Net.Index.IndexWriter.MaxFieldLength.LIMITED);
            Lucene.Net.Documents.Document document = new Lucene.Net.Documents.Document();
            document.Add(new Lucene.Net.Documents.Field("contents", new System.IO.StreamReader(new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes("a_ a0"))), Lucene.Net.Documents.Field.TermVector.WITH_OFFSETS));
            writer.AddDocument(document);
            Lucene.Net.Index.IndexReader reader = writer.GetReader();
            Lucene.Net.Index.TermPositionVector tpv = reader.GetTermFreqVector(0, "contents") as Lucene.Net.Index.TermPositionVector;
            //Console.WriteLine("tpv: " + tpv);
            int index = tpv.IndexOf("a_");
            Assert.AreEqual(index, 1, "See the issue: LUCENENET-183");
        }

        //-------------------------------------------
        [Test]
        [Description("LUCENENET-170")]
        public void Test_Util_Parameter()
        {
            Lucene.Net.Search.BooleanQuery queryPreSerialized = new Lucene.Net.Search.BooleanQuery();
            queryPreSerialized.Add(new Lucene.Net.Search.TermQuery(new Lucene.Net.Index.Term("country", "Russia")), Occur.MUST);
            queryPreSerialized.Add(new Lucene.Net.Search.TermQuery(new Lucene.Net.Index.Term("country", "France")), Occur.MUST);

            //now serialize it
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter serializer = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
            serializer.Serialize(memoryStream, queryPreSerialized);

            //now deserialize
            memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
            Lucene.Net.Search.BooleanQuery queryPostSerialized = (Lucene.Net.Search.BooleanQuery)serializer.Deserialize(memoryStream);

            memoryStream.Close();

            Assert.AreEqual(queryPreSerialized, queryPostSerialized, "See the issue: LUCENENET-170");
        }

        //-------------------------------------------
        [Test]
        [Description("LUCENENET-174")]
        public void Test_Store_RAMDirectory()
        {
            Lucene.Net.Store.RAMDirectory ramDIR = new Lucene.Net.Store.RAMDirectory();

            //Index 1 Doc
            Lucene.Net.Index.IndexWriter wr = new Lucene.Net.Index.IndexWriter(ramDIR, new Lucene.Net.Analysis.WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
            Lucene.Net.Documents.Document doc = new Lucene.Net.Documents.Document();
            doc.Add(new Lucene.Net.Documents.Field("field1", "value1 value11", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.ANALYZED));
            wr.AddDocument(doc);
            wr.Close();

            //now serialize it
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter serializer = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();
            serializer.Serialize(memoryStream, ramDIR);

            //Close DIR
            ramDIR.Close();
            ramDIR = null;

            //now deserialize
            memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
            Lucene.Net.Store.RAMDirectory ramDIR2 = (Lucene.Net.Store.RAMDirectory)serializer.Deserialize(memoryStream);

            //Add 1 more doc
            wr = new Lucene.Net.Index.IndexWriter(ramDIR2, new Lucene.Net.Analysis.WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
            doc = new Lucene.Net.Documents.Document();
            doc.Add(new Lucene.Net.Documents.Field("field1", "value1 value11", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.ANALYZED));
            wr.AddDocument(doc);
            wr.Close();

            //Search
            Lucene.Net.Search.IndexSearcher s = new Lucene.Net.Search.IndexSearcher(ramDIR2);
            Lucene.Net.QueryParsers.QueryParser qp = new Lucene.Net.QueryParsers.QueryParser(Version.LUCENE_CURRENT, "field1", new Lucene.Net.Analysis.Standard.StandardAnalyzer(Version.LUCENE_CURRENT));
            Lucene.Net.Search.Query q = qp.Parse("value1");
            Lucene.Net.Search.TopDocs topDocs = s.Search(q, 100);
            s.Close();

            Assert.AreEqual(topDocs.TotalHits, 2, "See the issue: LUCENENET-174");
        }

        //-------------------------------------------
        [Test]
        [Description("LUCENENET-150")]
        public void Test_Index_ReusableStringReader()
        {
            Lucene.Net.Index.IndexWriter wr = new Lucene.Net.Index.IndexWriter(new Lucene.Net.Store.RAMDirectory(), new TestAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);

            Lucene.Net.Documents.Document doc = new Lucene.Net.Documents.Document();
            Lucene.Net.Documents.Field f1 = new Lucene.Net.Documents.Field("f1", TEST_STRING, Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.ANALYZED);
            doc.Add(f1);
            wr.AddDocument(doc);

            wr.Close();
        }

        static string TEST_STRING = "First Line\nSecond Line";

        class TestAnalyzer : Lucene.Net.Analysis.Analyzer
        {
            public override Lucene.Net.Analysis.TokenStream TokenStream(string fieldName, System.IO.TextReader reader)
            {
                return new TestTokenizer(reader);
            }
        }

        class TestTokenizer : Lucene.Net.Analysis.Tokenizer
        {
            public TestTokenizer(System.IO.TextReader Reader)
            {
                //Caution: "Reader" is actually of type "ReusableStringReader" and some
                //methods (for ex. "ReadToEnd", "Peek",  "ReadLine") is not implemented.

                Assert.AreEqual("ReusableStringReader", Reader.GetType().Name);
                Assert.AreEqual("First Line", Reader.ReadLine(), "\"ReadLine\" method is not implemented");
                Assert.AreEqual("Second Line", Reader.ReadToEnd(), "\"ReadToEnd\" method is not implemented");
            }

            public override bool IncrementToken()
            {
                return false;
            }
        }

        [Test]
        [Description("LUCENENET-374")]
        public void Test_IndexReader_IsCurrent()
        {
            RAMDirectory ramDir = new RAMDirectory();
            IndexWriter writer = new IndexWriter(ramDir, new KeywordAnalyzer(), true, new IndexWriter.MaxFieldLength(1000));
            Field field = new Field("TEST", "mytest", Field.Store.YES, Field.Index.ANALYZED);
            Document doc = new Document();
            doc.Add(field);
            writer.AddDocument(doc);

            IndexReader reader = writer.GetReader();

            writer.DeleteDocuments(new Lucene.Net.Index.Term("TEST", "mytest"));

            Assert.IsFalse(reader.IsCurrent());

            int resCount1 = new IndexSearcher(reader).Search(new TermQuery(new Term("TEST", "mytest")),100).TotalHits;
            Assert.AreEqual(1, resCount1);

            writer.Commit();

            Assert.IsFalse(reader.IsCurrent());

            int resCount2 = new IndexSearcher(reader).Search(new TermQuery(new Term("TEST", "mytest")),100).TotalHits;
            Assert.AreEqual(1, resCount2, "Reopen not invoked yet, resultCount must still be 1.");

            reader = reader.Reopen();
            Assert.IsTrue(reader.IsCurrent());

            int resCount3 = new IndexSearcher(reader).Search(new TermQuery(new Term("TEST", "mytest")), 100).TotalHits;
            Assert.AreEqual(0, resCount3, "After reopen, resultCount must be 0.");

            reader.Close();
            writer.Close();
        }

        //-------------------------------------------
        int ANYPORT = 0;
        [Test]
        [Description("LUCENENET-100")]
        public void Test_Search_FieldDoc()
        {
            ANYPORT = new Random((int)(DateTime.Now.Ticks & 0x7fffffff)).Next(50000) + 10000;
            LUCENENET_100_CreateIndex();

            try
            {
                System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(new System.Runtime.Remoting.Channels.Tcp.TcpChannel(ANYPORT),false);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Lucene.Net.Search.IndexSearcher indexSearcher = new Lucene.Net.Search.IndexSearcher(LUCENENET_100_Dir);
            System.Runtime.Remoting.RemotingServices.Marshal(indexSearcher, "Searcher");

            LUCENENET_100_ClientSearch();

            //Wait Client to finish
            while (LUCENENET_100_testFinished == false) System.Threading.Thread.Sleep(10);

            if (LUCENENET_100_Exception != null) throw LUCENENET_100_Exception;
        }

        Lucene.Net.Store.RAMDirectory LUCENENET_100_Dir = new Lucene.Net.Store.RAMDirectory();
        bool LUCENENET_100_testFinished = false;
        Exception LUCENENET_100_Exception = null;

        void LUCENENET_100_ClientSearch()
        {
            try
            {
                Lucene.Net.Search.Searchable s = (Lucene.Net.Search.Searchable)Activator.GetObject(typeof(Lucene.Net.Search.Searchable), @"tcp://localhost:" + ANYPORT + "/Searcher");
                Lucene.Net.Search.MultiSearcher searcher = new Lucene.Net.Search.MultiSearcher(new Lucene.Net.Search.Searchable[] { s });

                Lucene.Net.Search.Query q = new Lucene.Net.Search.TermQuery(new Lucene.Net.Index.Term("field1", "moon"));

                Lucene.Net.Search.Sort sort = new Lucene.Net.Search.Sort();
                sort.SetSort(new Lucene.Net.Search.SortField("field2", Lucene.Net.Search.SortField.INT));

                Lucene.Net.Search.TopDocs h = searcher.Search(q, null, 100, sort);
                if (h.ScoreDocs.Length != 2) LUCENENET_100_Exception = new SupportClassException("Test_Search_FieldDoc Error. ");
            }
            catch (SupportClassException ex)
            {
                LUCENENET_100_Exception = ex;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                LUCENENET_100_testFinished = true;
            }
        }

        void LUCENENET_100_CreateIndex()
        {
            Lucene.Net.Index.IndexWriter w = new Lucene.Net.Index.IndexWriter(LUCENENET_100_Dir, new Lucene.Net.Analysis.Standard.StandardAnalyzer(Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);

            Lucene.Net.Documents.Field f1 = new Lucene.Net.Documents.Field("field1", "dark side of the moon", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.ANALYZED);
            Lucene.Net.Documents.Field f2 = new Lucene.Net.Documents.Field("field2", "123", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.NOT_ANALYZED);
            Lucene.Net.Documents.Document d = new Lucene.Net.Documents.Document();
            d.Add(f1);
            d.Add(f2);
            w.AddDocument(d);

            f1 = new Lucene.Net.Documents.Field("field1", "Fly me to the moon", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.ANALYZED);
            f2 = new Lucene.Net.Documents.Field("field2", "456", Lucene.Net.Documents.Field.Store.YES, Lucene.Net.Documents.Field.Index.NOT_ANALYZED);
            d = new Lucene.Net.Documents.Document();
            d.Add(f1);
            d.Add(f2);
            w.AddDocument(d);

            w.Close();
        }

        //-------------------------------------------
    }
}


text:
package org.finra.herd.dao;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import org.finra.herd.model.api.xml.DataProviderKey;
import org.finra.herd.model.jpa.DataProviderEntity;

public class DataProviderTest extends AbstractDaoTest
{
    @Test
    public void testGetDataProviderByKey()
    {
        // Create a data provider entity.
        DataProviderEntity dataProviderEntity = dataProviderDaoTestHelper.createDataProviderEntity(DATA_PROVIDER_NAME);

        // Retrieve the data provider entity.
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByKey(new DataProviderKey(DATA_PROVIDER_NAME)));

        // Test case insensitivity of data provider key.
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByKey(new DataProviderKey(DATA_PROVIDER_NAME.toUpperCase())));
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByKey(new DataProviderKey(DATA_PROVIDER_NAME.toLowerCase())));
    }

    @Test
    public void testGetDataProviderByName()
    {
        // Create a data provider entity.
        DataProviderEntity dataProviderEntity = dataProviderDaoTestHelper.createDataProviderEntity(DATA_PROVIDER_NAME);

        // Retrieve the data provider entity.
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByName(DATA_PROVIDER_NAME));

        // Test case insensitivity of data provider name.
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByName(DATA_PROVIDER_NAME.toUpperCase()));
        assertEquals(dataProviderEntity, dataProviderDao.getDataProviderByName(DATA_PROVIDER_NAME.toLowerCase()));
    }

    @Test
    public void testGetDataProviders()
    {
        // Create and persist data provider entities.
        for (DataProviderKey key : DATA_PROVIDER_KEYS)
        {
            dataProviderDaoTestHelper.createDataProviderEntity(key.getDataProviderName());
        }

        // Retrieve a list of data provider keys and validate the returned object.
        assertEquals(DATA_PROVIDER_KEYS, dataProviderDao.getDataProviders());
    }
}


text:
package ch.goodrick.brewcontrol.mashing;

/**
 * This exception is thrown if an attempt is done to launch a mashing process
 * while there is another running mashing process.
 *
 * @author sebastian@goodrick.ch
 *
 */
public class MashingAlreadyActiveException extends MashingException {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

}


text:
@implementation MTTest3GModel

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{};
}

- (instancetype)init {
    if (self = [super init]) {
        _name = NSStringFromClass([self class]);
        _age = 0;
    }

    return self;
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:base="./" xml:id="chap-formmodeler"
         xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd http://www.w3.org/1999/xlink http://www.docbook.org/xml/5.0/xsd/xlink.xsd"
         xmlns="http://docbook.org/ns/docbook" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:ns="http://docbook.org/ns/docbook">

  <title>Form Modeler</title>

  <para>
    This chapter intends to describe in a simple ways all the steps required to create a process with human tasks, generate and modify the forms for these tasks and execute them.
    It will provide initial guidance to perform all initial steps, but it will not provide a full description of all available features.</para>
  <para>
    Given that forms are going to be used in tasks, it's possible to generate forms automatically from process variables and task definitions. These forms can be later be modified by using the form editor.
    In runtime, forms will receive data from process variables, display it to the user and capture his input, and then finally updating process variables again with the new values.
  </para>
  <para>
    The following example will show all the steps to follow to create a form for the 'Create order' task in the process below.
  </para>

  <figure>
    <title>Process example</title>

    <screenshot>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/FormModeler/1_img_process.png"/>
        </imageobject>
      </mediaobject>
    </screenshot>
  </figure>

  <para>
    This form must look like the following in execution:
  </para>
  <figure>
    <title>Process example</title>

    <screenshot>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/FormModeler/2_execution.png"/>
        </imageobject>
      </mediaobject>
    </screenshot>
  </figure>

  <xi:include href="FormModeler/ConfigureProcess.xml" />
  <xi:include href="FormModeler/GeneratingForms.xml" />
  <xi:include href="FormModeler/EditForms.xml" />
</chapter>


text:
decrypt:
	@ gpg -d ./src/main/java/com/nardai/practice/load/LoadMindExercises.kt.gpg > src/main/java/com/nardai/practice/load/LoadMindExercises.kt
	@ gpg -d ./src/main/java/com/nardai/practice/load/LoadSpaceExercises.kt.gpg > src/main/java/com/nardai/practice/load/LoadSpaceExercises.kt
	@ gpg -d src/main/resources/secrets.properties.gpg > src/main/resources/secrets.properties

encrypt:
	@ gpg --yes --encrypt -u "vikinek" -r "vikinek" src/main/java/com/nardai/practice/load/LoadMindExercises.kt
	@ gpg --yes --encrypt -u "vikinek" -r "vikinek" src/main/java/com/nardai/practice/load/LoadSpaceExercises.kt
	@ gpg --yes --encrypt -u "vikinek" -r "vikinek" src/main/resources/secrets.properties