text:
//
// Novell.Directory.Ldap.InterThreadException.cs
//
// Author:
//   Sunil Kumar (Sunilk@novell.com)
//
// (C) 2003 Novell, Inc (http://www.novell.com)
//

using System;

namespace Novell.Directory.Ldap
{

	/* package */
	public class InterThreadException:LdapException
	{
		/// <summary> Returns the message ID of this message request.
		///
		/// </summary>
		/// <returns> the message ID.  Returns -1 if no message
		/// is associated with this exception.
		/// </returns>
		virtual internal int MessageID
		{
			/* package */

			get
			{
				if (request == null)
				{
					return - 1;
				}
				return request.MessageID;
			}

		}
		/// <summary> Returns the message type expected as a reply to
		/// the message associated with this message's request type.
		///
		/// </summary>
		/// <returns> the message type of the expected reply.  Returns -1
		/// if no reply expected.
		/// </returns>
		virtual internal int ReplyType
		{
			/* package */

			get
			{
				if (request == null)
				{
					return - 1;
				}
				int reqType = request.MessageType;
				int responseType = - 1;
				switch (reqType)
				{

					case LdapMessage.BIND_REQUEST:
						responseType = LdapMessage.BIND_RESPONSE;
						break;

					case LdapMessage.UNBIND_REQUEST:
						responseType = - 1;
						break;

					case LdapMessage.SEARCH_REQUEST:
						responseType = LdapMessage.SEARCH_RESULT;
						break;

					case LdapMessage.MODIFY_REQUEST:
						responseType = LdapMessage.MODIFY_RESPONSE;
						break;

					case LdapMessage.ADD_REQUEST:
						responseType = LdapMessage.ADD_RESPONSE;
						break;

					case LdapMessage.DEL_REQUEST:
						responseType = LdapMessage.DEL_RESPONSE;
						break;

					case LdapMessage.MODIFY_RDN_REQUEST:
						responseType = LdapMessage.MODIFY_RDN_RESPONSE;
						break;

					case LdapMessage.COMPARE_REQUEST:
						responseType = LdapMessage.COMPARE_RESPONSE;
						break;

					case LdapMessage.ABANDON_REQUEST:
						responseType = - 1;
						break;

					case LdapMessage.EXTENDED_REQUEST:
						responseType = LdapMessage.EXTENDED_RESPONSE;
						break;

					}
				return responseType;
			}

		}
		private Message request;

		/// <summary> Constructs a InterThreadException with its associated message.
		///
		/// </summary>
		/// <param name="message">       The text providign additional error information.
		///
		/// </param>
		/// <param name="resultCode">    The error result code.
		///
		/// </param>
		/// <param name="request">       The Message class associated with this exception.
		/// </param>
		/* package */
		internal InterThreadException(System.String message, System.Object[] arguments, int resultCode, System.Exception rootException, Message request):base(message, arguments, resultCode, (System.String) null, rootException)
		{
			this.request = request;
			return ;
		}
	}
}


text:
package io.sundr.builder.internal.processor;

import static io.sundr.builder.Constants.EDITABLE_ENABLED;
import static io.sundr.builder.Constants.EXTERNAL_BUILDABLE;
import static io.sundr.builder.Constants.IGNORE_PROPERTIES;
import static io.sundr.builder.Constants.LAZY_COLLECTIONS_INIT_ENABLED;
import static io.sundr.builder.Constants.LAZY_MAP_INIT_ENABLED;
import static io.sundr.builder.Constants.VALIDATION_ENABLED;
import static io.sundr.utils.Patterns.isExcluded;
import static io.sundr.utils.Patterns.isIncluded;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.processing.Filer;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;

import io.sundr.adapter.api.Adapters;
import io.sundr.adapter.apt.AptContext;
import io.sundr.adapter.apt.utils.Apt;
import io.sundr.builder.Visitor;
import io.sundr.builder.annotations.ExternalBuildables;
import io.sundr.builder.internal.BuilderContext;
import io.sundr.builder.internal.BuilderContextManager;
import io.sundr.builder.internal.utils.BuilderUtils;
import io.sundr.codegen.api.CodeGenerator;
import io.sundr.codegen.apt.TypeDefAptOutput;
import io.sundr.model.Kind;
import io.sundr.model.PropertyBuilder;
import io.sundr.model.TypeDef;
import io.sundr.model.TypeDefBuilder;

@SupportedAnnotationTypes("io.sundr.builder.annotations.ExternalBuildables")
public class ExternalBuildableProcessor extends AbstractBuilderProcessor {
  @Override
  public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment env) {
    Elements elements = processingEnv.getElementUtils();
    Types types = processingEnv.getTypeUtils();
    Filer filer = processingEnv.getFiler();

    boolean skipExistingTypes = true;
    BuilderContext ctx = null;
    Set<TypeDef> buildables = new HashSet<>();
    //First pass register all externals
    for (TypeElement annotation : annotations) {
      for (Element element : env.getElementsAnnotatedWith(annotation)) {
        final ExternalBuildables generated = element.getAnnotation(ExternalBuildables.class);
        if (generated == null) {
          continue;
        }
        ctx = BuilderContextManager.create(elements, types, generated.validationEnabled(), generated.generateBuilderPackage(),
            generated.builderPackage());

        skipExistingTypes = skipExistingTypes && generated.skipExistingTypes();
        for (String name : generated.value()) {
          PackageElement packageElement = elements.getPackageElement(name);
          List<TypeElement> typeElements = new ArrayList<>();

          if (packageElement != null) {
            for (Element e : packageElement.getEnclosedElements()) {
              if (!isIncluded(e.toString(), generated.includes())) {
                continue;
              }
              if (isExcluded(e.toString(), generated.excludes())) {
                continue;
              }

              if (e instanceof TypeElement) {
                typeElements.add((TypeElement) e);
              }
            }
          } else {
            TypeElement e = elements.getTypeElement(name);
            if (e != null) {
              typeElements.add(e);
            }
          }

          for (TypeElement typeElement : typeElements) {
            final boolean isLazyCollectionInitEnabled = generated.lazyCollectionInitEnabled();
            final boolean isLazyMapInitEnabled = generated.lazyMapInitEnabled();
            final boolean includeInterfaces = generated.includeInterfaces();
            final boolean includeAbstractClasses = generated.includeAbstractClasses();

            AptContext aptContext = AptContext.create(ctx.getElements(), ctx.getTypes(), ctx.getDefinitionRepository());
            TypeDef original = Adapters.adaptType(typeElement, aptContext);
            String fqcn = original.getFullyQualifiedName();
            boolean isBuildable = original.getKind() != Kind.ENUM
                && (includeAbstractClasses || !original.isAbstract())
                && (includeInterfaces || original.getKind() != Kind.INTERFACE)
                && isIncluded(fqcn, generated.includes()) && !isExcluded(fqcn, generated.excludes());

            TypeDef b = new TypeDefBuilder(original)
                .accept(new Visitor<PropertyBuilder>() {
                  @Override
                  public void visit(PropertyBuilder builder) {
                    if (isBuildable) {
                      builder.addToAttributes(EXTERNAL_BUILDABLE, generated);
                      builder.addToAttributes(EDITABLE_ENABLED, generated.editableEnabled());
                      builder.addToAttributes(VALIDATION_ENABLED, generated.validationEnabled());
                      builder.addToAttributes(LAZY_COLLECTIONS_INIT_ENABLED, isLazyCollectionInitEnabled);
                      builder.addToAttributes(LAZY_MAP_INIT_ENABLED, isLazyMapInitEnabled);
                    }
                  }
                }).build();

            if (b.getKind() == Kind.ENUM) {
              continue;
            }

            if (b.isAbstract() && !includeAbstractClasses) {
              continue;
            }

            if (b.getKind() == Kind.INTERFACE && !includeInterfaces) {
              continue;
            }

            if (!isIncluded(b.getFullyQualifiedName(), generated.includes())) {
              continue;
            }
            if (isExcluded(b.getFullyQualifiedName(), generated.excludes())) {
              continue;
            }
            ctx.getDefinitionRepository().register(b);
            ctx.getBuildableRepository().register(b);
            buildables.add(b);
          }
        }

        for (TypeElement ref : BuilderUtils.getBuildableReferences(ctx, generated)) {
          final boolean isLazyCollectionInitEnabled = generated.lazyCollectionInitEnabled();
          final boolean isLazyMapInitEnabled = generated.lazyMapInitEnabled();
          final boolean includeInterfaces = generated.includeInterfaces();
          final boolean includeAbstractClasses = generated.includeAbstractClasses();

          AptContext aptContext = AptContext.create(ctx.getElements(), ctx.getTypes(), ctx.getDefinitionRepository());

          TypeDef original = Adapters.adaptType(Apt.getClassElement(ref), aptContext);
          String fqcn = original.getFullyQualifiedName();
          boolean isBuildable = original.getKind() != Kind.ENUM && !original.isAbstract()
              && isIncluded(fqcn, generated.includes()) && !isExcluded(fqcn, generated.excludes());

          TypeDef r = new TypeDefBuilder(original)
              .accept(new Visitor<PropertyBuilder>() {
                @Override
                public void visit(PropertyBuilder builder) {
                  if (isBuildable) {
                    builder.addToAttributes(EXTERNAL_BUILDABLE, generated);
                    builder.addToAttributes(EDITABLE_ENABLED, generated.editableEnabled());
                    builder.addToAttributes(VALIDATION_ENABLED, generated.validationEnabled());
                    builder.addToAttributes(IGNORE_PROPERTIES, generated.ignore());
                    builder.addToAttributes(LAZY_COLLECTIONS_INIT_ENABLED, isLazyCollectionInitEnabled);
                    builder.addToAttributes(LAZY_MAP_INIT_ENABLED, isLazyMapInitEnabled);
                  }
                }
              }).build();

          if (r.getKind() == Kind.ENUM || r.isAbstract()) {
            continue;
          }
          if (r.getKind() == Kind.ENUM) {
            continue;
          }

          if (r.isAbstract() && !includeAbstractClasses) {
            continue;
          }

          if (r.getKind() == Kind.INTERFACE && !includeInterfaces) {
            continue;
          }

          if (!isIncluded(r.getFullyQualifiedName(), generated.includes())) {
            continue;
          }
          if (isExcluded(r.getFullyQualifiedName(), generated.excludes())) {
            continue;
          }

          ctx.getDefinitionRepository().register(r);
          ctx.getBuildableRepository().register(r);
          buildables.add(r);
        }
      }
    }

    if (ctx == null) {
      return true;
    }

    if (!skipExistingTypes) {
      generator = CodeGenerator.newGenerator(TypeDef.class)
          .withOutput(new TypeDefAptOutput(processingEnv.getFiler()))
          .skipping(s -> false)
          .build();
    }

    generateLocalDependenciesIfNeeded();
    ctx.getDefinitionRepository().updateReferenceMap();
    generateBuildables(ctx, buildables);
    generatePojos(ctx, buildables);
    processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE,
        String.format("%-120s", "100%: Builder generation complete."));
    return true;
  }
}

redpajama_set_name: RedPajamaGithub


text:
class User < ActiveRecord::Base
  has_many :touts
  has_many :comments

  ##
  # is current_user admin?
  def admin?
    role == 'admin'
  end

  def name
    nick_name || first_name
  end
end


text:
<?php

/**
 * @package CRM
 * @copyright CiviCRM LLC (c) 2004-2015
 *
 * Generated from xml/schema/CRM/Core/Address.xml
 * DO NOT EDIT.  Generated by CRM_Core_CodeGen
 */
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
require_once 'CRM/Core/DAO/County.php';
require_once 'CRM/Core/DAO/StateProvince.php';
require_once 'CRM/Core/DAO/Country.php';
class CRM_Core_DAO_Address extends CRM_Core_DAO
{
  /**
   * static instance to hold the table name
   *
   * @var string
   */
  static $_tableName = 'civicrm_address';
  /**
   * static instance to hold the field values
   *
   * @var array
   */
  static $_fields = null;
  /**
   * static instance to hold the keys used in $_fields for each field.
   *
   * @var array
   */
  static $_fieldKeys = null;
  /**
   * static instance to hold the FK relationships
   *
   * @var string
   */
  static $_links = null;
  /**
   * static instance to hold the values that can
   * be imported
   *
   * @var array
   */
  static $_import = null;
  /**
   * static instance to hold the values that can
   * be exported
   *
   * @var array
   */
  static $_export = null;
  /**
   * static value to see if we should log any modifications to
   * this table in the civicrm_log table
   *
   * @var boolean
   */
  static $_log = true;
  /**
   * Unique Address ID
   *
   * @var int unsigned
   */
  public $id;
  /**
   * FK to Contact ID
   *
   * @var int unsigned
   */
  public $contact_id;
  /**
   * Which Location does this address belong to.
   *
   * @var int unsigned
   */
  public $location_type_id;
  /**
   * Is this the primary address.
   *
   * @var boolean
   */
  public $is_primary;
  /**
   * Is this the billing address.
   *
   * @var boolean
   */
  public $is_billing;
  /**
   * Concatenation of all routable street address components (prefix, street number, street name, suffix, unit
   number OR P.O. Box). Apps should be able to determine physical location with this data (for mapping, mail
   delivery, etc.).
   *
   * @var string
   */
  public $street_address;
  /**
   * Numeric portion of address number on the street, e.g. For 112A Main St, the street_number = 112.
   *
   * @var int
   */
  public $street_number;
  /**
   * Non-numeric portion of address number on the street, e.g. For 112A Main St, the street_number_suffix = A
   *
   * @var string
   */
  public $street_number_suffix;
  /**
   * Directional prefix, e.g. SE Main St, SE is the prefix.
   *
   * @var string
   */
  public $street_number_predirectional;
  /**
   * Actual street name, excluding St, Dr, Rd, Ave, e.g. For 112 Main St, the street_name = Main.
   *
   * @var string
   */
  public $street_name;
  /**
   * St, Rd, Dr, etc.
   *
   * @var string
   */
  public $street_type;
  /**
   * Directional prefix, e.g. Main St S, S is the suffix.
   *
   * @var string
   */
  public $street_number_postdirectional;
  /**
   * Secondary unit designator, e.g. Apt 3 or Unit # 14, or Bldg 1200
   *
   * @var string
   */
  public $street_unit;
  /**
   * Supplemental Address Information, Line 1
   *
   * @var string
   */
  public $supplemental_address_1;
  /**
   * Supplemental Address Information, Line 2
   *
   * @var string
   */
  public $supplemental_address_2;
  /**
   * Supplemental Address Information, Line 3
   *
   * @var string
   */
  public $supplemental_address_3;
  /**
   * City, Town or Village Name.
   *
   * @var string
   */
  public $city;
  /**
   * Which County does this address belong to.
   *
   * @var int unsigned
   */
  public $county_id;
  /**
   * Which State_Province does this address belong to.
   *
   * @var int unsigned
   */
  public $state_province_id;
  /**
   * Store the suffix, like the +4 part in the USPS system.
   *
   * @var string
   */
  public $postal_code_suffix;
  /**
   * Store both US (zip5) AND international postal codes. App is responsible for country/region appropriate
   validation.
   *
   * @var string
   */
  public $postal_code;
  /**
   * USPS Bulk mailing code.
   *
   * @var string
   */
  public $usps_adc;
  /**
   * Which Country does this address belong to.
   *
   * @var int unsigned
   */
  public $country_id;
  /**
   * Latitude
   *
   * @var float
   */
  public $geo_code_1;
  /**
   * Longitude
   *
   * @var float
   */
  public $geo_code_2;
  /**
   * Is this a manually entered geo code
   *
   * @var boolean
   */
  public $manual_geo_code;
  /**
   * Timezone expressed as a UTC offset - e.g. United States CST would be written as "UTC-6".
   *
   * @var string
   */
  public $timezone;
  /**
   *
   * @var string
   */
  public $name;
  /**
   * FK to Address ID
   *
   * @var int unsigned
   */
  public $master_id;
  /**
   * class constructor
   *
   * @return civicrm_address
   */
  function __construct()
  {
    $this->__table = 'civicrm_address';
    parent::__construct();
  }
  /**
   * Returns foreign keys and entity references
   *
   * @return array
   *   [CRM_Core_Reference_Interface]
   */
  static function getReferenceColumns()
  {
    if (!self::$_links) {
      self::$_links = static ::createReferenceColumns(__CLASS__);
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'county_id', 'civicrm_county', 'id');
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'state_province_id', 'civicrm_state_province', 'id');
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'country_id', 'civicrm_country', 'id');
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'master_id', 'civicrm_address', 'id');
    }
    return self::$_links;
  }
  /**
   * Returns all the column names of this table
   *
   * @return array
   */
  static function &fields()
  {
    if (!(self::$_fields)) {
      self::$_fields = array(
        'id' => array(
          'name' => 'id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Address ID') ,
          'description' => 'Unique Address ID',
          'required' => true,
        ) ,
        'contact_id' => array(
          'name' => 'contact_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Contact ID') ,
          'description' => 'FK to Contact ID',
          'FKClassName' => 'CRM_Contact_DAO_Contact',
        ) ,
        'location_type_id' => array(
          'name' => 'location_type_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Address Location Type') ,
          'description' => 'Which Location does this address belong to.',
          'html' => array(
            'type' => 'Select',
          ) ,
          'pseudoconstant' => array(
            'table' => 'civicrm_location_type',
            'keyColumn' => 'id',
            'labelColumn' => 'display_name',
          )
        ) ,
        'is_primary' => array(
          'name' => 'is_primary',
          'type' => CRM_Utils_Type::T_BOOLEAN,
          'title' => ts('Is Address Primary?') ,
          'description' => 'Is this the primary address.',
        ) ,
        'is_billing' => array(
          'name' => 'is_billing',
          'type' => CRM_Utils_Type::T_BOOLEAN,
          'title' => ts('Is Billing Address') ,
          'description' => 'Is this the billing address.',
        ) ,
        'street_address' => array(
          'name' => 'street_address',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Address') ,
          'description' => 'Concatenation of all routable street address components (prefix, street number, street name, suffix, unit
      number OR P.O. Box). Apps should be able to determine physical location with this data (for mapping, mail
      delivery, etc.).
    ',
          'maxlength' => 96,
          'size' => CRM_Utils_Type::HUGE,
          'import' => true,
          'where' => 'civicrm_address.street_address',
          'headerPattern' => '/(street|address)/i',
          'dataPattern' => '/^(\d{1,5}( [0-9A-Za-z]+)+)$|^(P\.?O\.\? Box \d{1,5})$/i',
          'export' => true,
        ) ,
        'street_number' => array(
          'name' => 'street_number',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Street Number') ,
          'description' => 'Numeric portion of address number on the street, e.g. For 112A Main St, the street_number = 112.',
          'export' => true,
          'where' => 'civicrm_address.street_number',
          'headerPattern' => '',
          'dataPattern' => '',
        ) ,
        'street_number_suffix' => array(
          'name' => 'street_number_suffix',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Number Suffix') ,
          'description' => 'Non-numeric portion of address number on the street, e.g. For 112A Main St, the street_number_suffix = A
    ',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
          'export' => true,
          'where' => 'civicrm_address.street_number_suffix',
          'headerPattern' => '',
          'dataPattern' => '',
        ) ,
        'street_number_predirectional' => array(
          'name' => 'street_number_predirectional',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Direction Prefix') ,
          'description' => 'Directional prefix, e.g. SE Main St, SE is the prefix.',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
        ) ,
        'street_name' => array(
          'name' => 'street_name',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Name') ,
          'description' => 'Actual street name, excluding St, Dr, Rd, Ave, e.g. For 112 Main St, the street_name = Main.',
          'maxlength' => 64,
          'size' => CRM_Utils_Type::BIG,
          'export' => true,
          'where' => 'civicrm_address.street_name',
          'headerPattern' => '',
          'dataPattern' => '',
        ) ,
        'street_type' => array(
          'name' => 'street_type',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Type') ,
          'description' => 'St, Rd, Dr, etc.',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
        ) ,
        'street_number_postdirectional' => array(
          'name' => 'street_number_postdirectional',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Direction Suffix') ,
          'description' => 'Directional prefix, e.g. Main St S, S is the suffix.',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
        ) ,
        'street_unit' => array(
          'name' => 'street_unit',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Street Unit') ,
          'description' => 'Secondary unit designator, e.g. Apt 3 or Unit # 14, or Bldg 1200',
          'maxlength' => 16,
          'size' => CRM_Utils_Type::TWELVE,
          'export' => true,
          'where' => 'civicrm_address.street_unit',
          'headerPattern' => '',
          'dataPattern' => '',
        ) ,
        'supplemental_address_1' => array(
          'name' => 'supplemental_address_1',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Supplemental Address 1') ,
          'description' => 'Supplemental Address Information, Line 1',
          'maxlength' => 96,
          'size' => CRM_Utils_Type::HUGE,
          'import' => true,
          'where' => 'civicrm_address.supplemental_address_1',
          'headerPattern' => '/(supplemental(\s)?)?address(\s\d+)?/i',
          'dataPattern' => '/unit|ap(ar)?t(ment)?\s(\d|\w)+/i',
          'export' => true,
        ) ,
        'supplemental_address_2' => array(
          'name' => 'supplemental_address_2',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Supplemental Address 2') ,
          'description' => 'Supplemental Address Information, Line 2',
          'maxlength' => 96,
          'size' => CRM_Utils_Type::HUGE,
          'import' => true,
          'where' => 'civicrm_address.supplemental_address_2',
          'headerPattern' => '/(supplemental(\s)?)?address(\s\d+)?/i',
          'dataPattern' => '/unit|ap(ar)?t(ment)?\s(\d|\w)+/i',
          'export' => true,
        ) ,
        'supplemental_address_3' => array(
          'name' => 'supplemental_address_3',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Supplemental Address 3') ,
          'description' => 'Supplemental Address Information, Line 3',
          'maxlength' => 96,
          'size' => CRM_Utils_Type::HUGE,
        ) ,
        'city' => array(
          'name' => 'city',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('City') ,
          'description' => 'City, Town or Village Name.',
          'maxlength' => 64,
          'size' => CRM_Utils_Type::BIG,
          'import' => true,
          'where' => 'civicrm_address.city',
          'headerPattern' => '/city/i',
          'dataPattern' => '/^[A-Za-z]+(\.?)(\s?[A-Za-z]+){0,2}$/',
          'export' => true,
        ) ,
        'county_id' => array(
          'name' => 'county_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('County') ,
          'description' => 'Which County does this address belong to.',
          'FKClassName' => 'CRM_Core_DAO_County',
          'html' => array(
            'type' => 'Select',
          ) ,
          'pseudoconstant' => array(
            'table' => 'civicrm_county',
            'keyColumn' => 'id',
            'labelColumn' => 'name',
          )
        ) ,
        'state_province_id' => array(
          'name' => 'state_province_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('State') ,
          'description' => 'Which State_Province does this address belong to.',
          'FKClassName' => 'CRM_Core_DAO_StateProvince',
          'html' => array(
            'type' => 'Select',
          ) ,
          'pseudoconstant' => array(
            'table' => 'civicrm_state_province',
            'keyColumn' => 'id',
            'labelColumn' => 'name',
          )
        ) ,
        'postal_code_suffix' => array(
          'name' => 'postal_code_suffix',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Postal Code Suffix') ,
          'description' => 'Store the suffix, like the +4 part in the USPS system.',
          'maxlength' => 12,
          'size' => CRM_Utils_Type::TWELVE,
          'import' => true,
          'where' => 'civicrm_address.postal_code_suffix',
          'headerPattern' => '/p(ostal)\sc(ode)\ss(uffix)/i',
          'dataPattern' => '/\d?\d{4}(-\d{4})?/',
          'export' => true,
        ) ,
        'postal_code' => array(
          'name' => 'postal_code',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Postal Code') ,
          'description' => 'Store both US (zip5) AND international postal codes. App is responsible for country/region appropriate
      validation.
    ',
          'maxlength' => 12,
          'size' => CRM_Utils_Type::TWELVE,
          'import' => true,
          'where' => 'civicrm_address.postal_code',
          'headerPattern' => '/postal|zip/i',
          'dataPattern' => '/\d?\d{4}(-\d{4})?/',
          'export' => true,
        ) ,
        'usps_adc' => array(
          'name' => 'usps_adc',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('USPS Code') ,
          'description' => 'USPS Bulk mailing code.',
          'maxlength' => 32,
          'size' => CRM_Utils_Type::MEDIUM,
        ) ,
        'country_id' => array(
          'name' => 'country_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Country') ,
          'description' => 'Which Country does this address belong to.',
          'FKClassName' => 'CRM_Core_DAO_Country',
          'html' => array(
            'type' => 'Select',
          ) ,
          'pseudoconstant' => array(
            'table' => 'civicrm_country',
            'keyColumn' => 'id',
            'labelColumn' => 'name',
            'nameColumn' => 'iso_code',
          )
        ) ,
        'geo_code_1' => array(
          'name' => 'geo_code_1',
          'type' => CRM_Utils_Type::T_FLOAT,
          'title' => ts('Latitude') ,
          'description' => 'Latitude',
          'import' => true,
          'where' => 'civicrm_address.geo_code_1',
          'headerPattern' => '/geo/i',
          'dataPattern' => '',
          'export' => true,
        ) ,
        'geo_code_2' => array(
          'name' => 'geo_code_2',
          'type' => CRM_Utils_Type::T_FLOAT,
          'title' => ts('Longitude') ,
          'description' => 'Longitude',
          'import' => true,
          'where' => 'civicrm_address.geo_code_2',
          'headerPattern' => '/geo/i',
          'dataPattern' => '',
          'export' => true,
        ) ,
        'manual_geo_code' => array(
          'name' => 'manual_geo_code',
          'type' => CRM_Utils_Type::T_BOOLEAN,
          'title' => ts('Is manually geocoded') ,
          'description' => 'Is this a manually entered geo code',
        ) ,
        'timezone' => array(
          'name' => 'timezone',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Timezone') ,
          'description' => 'Timezone expressed as a UTC offset - e.g. United States CST would be written as "UTC-6".',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
        ) ,
        'address_name' => array(
          'name' => 'name',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Address Name') ,
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
          'import' => true,
          'where' => 'civicrm_address.name',
          'headerPattern' => '/^location|(l(ocation\s)?name)$/i',
          'dataPattern' => '/^\w+$/',
          'export' => true,
        ) ,
        'master_id' => array(
          'name' => 'master_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Master Address Belongs To') ,
          'description' => 'FK to Address ID',
          'import' => true,
          'where' => 'civicrm_address.master_id',
          'headerPattern' => '',
          'dataPattern' => '',
          'export' => true,
          'FKClassName' => 'CRM_Core_DAO_Address',
        ) ,
      );
    }
    return self::$_fields;
  }
  /**
   * Returns an array containing, for each field, the arary key used for that
   * field in self::$_fields.
   *
   * @return array
   */
  static function &fieldKeys()
  {
    if (!(self::$_fieldKeys)) {
      self::$_fieldKeys = array(
        'id' => 'id',
        'contact_id' => 'contact_id',
        'location_type_id' => 'location_type_id',
        'is_primary' => 'is_primary',
        'is_billing' => 'is_billing',
        'street_address' => 'street_address',
        'street_number' => 'street_number',
        'street_number_suffix' => 'street_number_suffix',
        'street_number_predirectional' => 'street_number_predirectional',
        'street_name' => 'street_name',
        'street_type' => 'street_type',
        'street_number_postdirectional' => 'street_number_postdirectional',
        'street_unit' => 'street_unit',
        'supplemental_address_1' => 'supplemental_address_1',
        'supplemental_address_2' => 'supplemental_address_2',
        'supplemental_address_3' => 'supplemental_address_3',
        'city' => 'city',
        'county_id' => 'county_id',
        'state_province_id' => 'state_province_id',
        'postal_code_suffix' => 'postal_code_suffix',
        'postal_code' => 'postal_code',
        'usps_adc' => 'usps_adc',
        'country_id' => 'country_id',
        'geo_code_1' => 'geo_code_1',
        'geo_code_2' => 'geo_code_2',
        'manual_geo_code' => 'manual_geo_code',
        'timezone' => 'timezone',
        'name' => 'address_name',
        'master_id' => 'master_id',
      );
    }
    return self::$_fieldKeys;
  }
  /**
   * Returns the names of this table
   *
   * @return string
   */
  static function getTableName()
  {
    return self::$_tableName;
  }
  /**
   * Returns if this table needs to be logged
   *
   * @return boolean
   */
  function getLog()
  {
    return self::$_log;
  }
  /**
   * Returns the list of fields that can be imported
   *
   * @param bool $prefix
   *
   * @return array
   */
  static function &import($prefix = false)
  {
    if (!(self::$_import)) {
      self::$_import = array();
      $fields = self::fields();
      foreach($fields as $name => $field) {
        if (CRM_Utils_Array::value('import', $field)) {
          if ($prefix) {
            self::$_import['address'] = & $fields[$name];
          } else {
            self::$_import[$name] = & $fields[$name];
          }
        }
      }
      self::$_import = array_merge(self::$_import, CRM_Core_DAO_County::import(true));
      self::$_import = array_merge(self::$_import, CRM_Core_DAO_StateProvince::import(true));
      self::$_import = array_merge(self::$_import, CRM_Core_DAO_Country::import(true));
    }
    return self::$_import;
  }
  /**
   * Returns the list of fields that can be exported
   *
   * @param bool $prefix
   *
   * @return array
   */
  static function &export($prefix = false)
  {
    if (!(self::$_export)) {
      self::$_export = array();
      $fields = self::fields();
      foreach($fields as $name => $field) {
        if (CRM_Utils_Array::value('export', $field)) {
          if ($prefix) {
            self::$_export['address'] = & $fields[$name];
          } else {
            self::$_export[$name] = & $fields[$name];
          }
        }
      }
      self::$_export = array_merge(self::$_export, CRM_Core_DAO_County::export(true));
      self::$_export = array_merge(self::$_export, CRM_Core_DAO_StateProvince::export(true));
      self::$_export = array_merge(self::$_export, CRM_Core_DAO_Country::export(true));
    }
    return self::$_export;
  }
}


text:
import { axiosInstance } from '../../../../../../core/utils';

const fetchData = async (search, notify) => {
  const {
    data: { data },
  } = await axiosInstance.get(`/admin/users${search}`);

  notify();

  return data;
};

const deleteData = async ids => {
  await axiosInstance.post('/admin/users/batch-delete', { ids });
};

export { deleteData, fetchData };


text:
using System.Collections.Specialized;
using System.Net;
using EasyHttp.Http;
using NMoneys.Web.Api.v1.Infrastructure;
using NSubstitute;
using NUnit.Framework;
using Testing.Commons;
using Tests.Api.v1.Resources.Support;

namespace Tests.Api.v1.Resources
{
	[TestFixture, Category("Integration")]
	public class AuthenticationTester : PerFixture
	{
		[Test]
		public void MissingApiKey_NotAuthorized()
		{
			var verifier = Substitute.For<IKeyVerifier>();
			Replacing(verifier);

			HttpResponse response = this.Get();

			Assert.That(response, Must.Not.Be.Ok(HttpStatusCode.Unauthorized));
		}

		[Test]
		public void WrongApiKey_NotAuthorized()
		{
			var verifier = Substitute.For<IKeyVerifier>();
			verifier.Verify(Arg.Any<ApiKey>()).Returns(false);
			Replacing(verifier);

			HttpResponse response = this.Get(client =>
				client.Request.AddExtraHeader(ApiKey.ParameterName, ApiKey.EmptyParameterValue));

			Assert.That(response, Must.Not.Be.Ok(HttpStatusCode.Unauthorized));
		}

		[Test]
		public void CorrectApiKey_AsHeader_Authorized()
		{
			var verifier = Substitute.For<IKeyVerifier>();
			verifier.Verify(Arg.Any<ApiKey>()).Returns(true);
			Replacing(verifier);

			HttpResponse response = this
				.DisableEnforcer()
				.Get(client =>
					client.Request.AddExtraHeader(ApiKey.ParameterName, ApiKey.EmptyParameterValue));

			Assert.That(response, Must.Be.Ok());
		}

		[Test]
		public void ExistingApiKey_AsQuery_Authorized()
		{
			var verifier = Substitute.For<IKeyVerifier>();
			verifier.Verify(Arg.Any<ApiKey>()).Returns(true);
			Replacing(verifier);

			var response = this
				.DisableEnforcer()
				.Get(new NameValueCollection { { ApiKey.ParameterName, ApiKey.EmptyParameterValue } });

			Assert.That(response, Must.Be.Ok());
		}
	}
}


text:
require "support/shared/integration/integration_helper"

describe "Resource.load_current_value" do
  include IntegrationSupport

  module Namer
    extend self
    attr_accessor :current_index
    def incrementing_value
      @incrementing_value += 1
      @incrementing_value
    end
    attr_writer :incrementing_value
  end

  before(:all) { Namer.current_index = 1 }
  before { Namer.current_index += 1 }
  before { Namer.incrementing_value = 0 }

  let(:resource_name) { :"load_current_value_dsl#{Namer.current_index}" }
  let(:resource_class) {
    result = Class.new(Chef::Resource) do
      def self.to_s; resource_name.to_s; end

      def self.inspect; resource_name.inspect; end
      property :x, default: lazy { "default #{Namer.incrementing_value}" }
      def self.created_x=(value)
        @created = value
      end

      def self.created_x
        @created
      end
      action :create do
        new_resource.class.created_x = x
      end
    end
    result.resource_name resource_name
    result
  }

  # Pull on resource_class to initialize it
  before { resource_class }

  context "with a resource with load_current_value" do
    before :each do
      resource_class.load_current_value do
        x "loaded #{Namer.incrementing_value} (#{self.class.properties.sort_by { |name, p| name }.
          select { |name, p| p.is_set?(self) }.
          map { |name, p| "#{name}=#{p.get(self)}" }.
          join(", ") })"
      end
    end

    context "and a resource with x set to a desired value" do
      let(:resource) do
        e = self
        r = nil
        converge {
          r = public_send(e.resource_name, "blah") do
            x "desired"
          end
        }
        r
      end

      it "current_resource is passed name but not x" do
        expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
      end

      it "resource.current_value returns a different resource" do
        expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
        expect(resource.x).to eq "desired"
      end

      it "resource.current_value constructs the resource anew each time" do
        expect(resource.current_value.x).to eq "loaded 2 (name=blah)"
        expect(resource.current_value.x).to eq "loaded 3 (name=blah)"
      end

      it "the provider accesses the current value of x" do
        expect(resource.class.created_x).to eq "desired"
      end

      context "and identity: :i and :d with desired_state: false" do
        before {
          resource_class.class_eval do
            property :i, identity: true
            property :d, desired_state: false
          end
        }

        before {
          resource.i "desired_i"
          resource.d "desired_d"
        }

        it "i, name and d are passed to load_current_value, but not x" do
          expect(resource.current_value.x).to eq "loaded 2 (d=desired_d, i=desired_i, name=blah)"
        end
      end

      context "and name_property: :i and :d with desired_state: false" do
        before {
          resource_class.class_eval do
            property :i, name_property: true
            property :d, desired_state: false
          end
        }

        before {
          resource.i "desired_i"
          resource.d "desired_d"
        }

        it "i, name and d are passed to load_current_value, but not x" do
          expect(resource.current_value.x).to eq "loaded 2 (d=desired_d, i=desired_i, name=blah)"
        end
      end
    end

    context "and a resource with no values set" do
      let(:resource) do
        e = self
        r = nil
        converge {
          r = public_send(e.resource_name, "blah") do
          end
        }
        r
      end

      it "the provider accesses values from load_current_value" do
        expect(resource.class.created_x).to eq "loaded 1 (name=blah)"
      end
    end

    let (:subresource_name) {
      :"load_current_value_subresource_dsl#{Namer.current_index}"
    }
    let (:subresource_class) {
      r = Class.new(resource_class) do
        property :y, default: lazy { "default_y #{Namer.incrementing_value}" }
      end
      r.resource_name subresource_name
      r
    }

    # Pull on subresource_class to initialize it
    before { subresource_class }

    let(:subresource) do
      e = self
      r = nil
      converge {
        r = public_send(e.subresource_name, "blah") do
          x "desired"
        end
      }
      r
    end

    context "and a child resource class with no load_current_value" do
      it "the parent load_current_value is used" do
        expect(subresource.current_value.x).to eq "loaded 2 (name=blah)"
      end
      it "load_current_value yields a copy of the child class" do
        expect(subresource.current_value).to be_kind_of(subresource_class)
      end
    end

    context "And a child resource class with load_current_value" do
      before {
        subresource_class.load_current_value do
          y "loaded_y #{Namer.incrementing_value} (#{self.class.properties.sort_by { |name, p| name }.
            select { |name, p| p.is_set?(self) }.
            map { |name, p| "#{name}=#{p.get(self)}" }.
            join(", ") })"
        end
      }

      it "the overridden load_current_value is used" do
        current_resource = subresource.current_value
        expect(current_resource.x).to eq "default 3"
        expect(current_resource.y).to eq "loaded_y 2 (name=blah)"
      end
    end

    context "and a child resource class with load_current_value calling super()" do
      before {
        subresource_class.load_current_value do
          super()
          y "loaded_y #{Namer.incrementing_value} (#{self.class.properties.sort_by { |name, p| name }.
            select { |name, p| p.is_set?(self) }.
            map { |name, p| "#{name}=#{p.get(self)}" }.
            join(", ") })"
        end
      }

      it "the original load_current_value is called as well as the child one" do
        current_resource = subresource.current_value
        expect(current_resource.x).to eq "loaded 3 (name=blah)"
        expect(current_resource.y).to eq "loaded_y 4 (name=blah, x=loaded 3 (name=blah))"
      end
    end
  end

end


text:
package scuff

import java.util.concurrent.{ Callable, Executor, ScheduledExecutorService }

import scala.concurrent._
import scala.concurrent.duration.{ DurationInt, FiniteDuration }
import scala.util.Try
import scala.util.control.NoStackTrace

import java.util.concurrent.ScheduledFuture
import java.util.concurrent.TimeoutException
import scala.annotation.implicitNotFound

package object concurrent {
  implicit def exeCtxToExecutor(ec: ExecutionContext): Executor = ec match {
    case exe: Executor => exe
    case _ => new Executor with ExecutionContext {
      def execute(runnable: Runnable): Unit = ec.execute(runnable)
      def reportFailure(th: Throwable): Unit = ec.reportFailure(th)
    }
  }
  implicit class ScuffExecutor(private val ec: { def execute(run: Runnable): Unit }) extends AnyVal {

    @inline private def execute(r: Runnable): Unit =
      ec match {
        case ec: ExecutionContext =>
          ec execute r
        case exe: Executor =>
          exe execute r
        case _ =>
          ec execute r
      }

    def execute(thunk: => Unit): Unit = this execute new Runnable {
      def run = thunk
    }
    def submit(runnable: Runnable): Future[Unit] = {
      val promise = Promise[Unit]()
      this execute new Runnable {
        def run = promise complete Try(runnable.run)
        override def hashCode = runnable.hashCode
      }
      promise.future
    }
    def submit[T](callable: Callable[T]): Future[T] = {
      val promise = Promise[T]()
      this execute new Runnable {
        def run = promise complete Try(callable.call)
        override def hashCode = callable.hashCode
      }
      promise.future
    }
    def submit[T](thunk: => T): Future[T] = {
      val promise = Promise[T]()
      this execute new Runnable {
        def run = promise complete Try(thunk)
      }
      promise.future
    }
  }

  implicit class ScuffScheduledExecutor(private val scheduler: ScheduledExecutorService) extends AnyVal {
    def schedule[T](delay: FiniteDuration)(thunk: => T): ScheduledFuture[T] = {
      val c = new Callable[T] {
        def call = thunk
      }
      scheduler.schedule(c, delay.length, delay.unit)
    }
    def scheduleAtFixedRate(initDelay: FiniteDuration, period: FiniteDuration)(thunk: => Unit): ScheduledFuture[Unit] = {
      val r = new Runnable {
        def run = thunk
      }
      val initialDelay = period.unit.convert(initDelay.length, initDelay.unit)
      scheduler.scheduleAtFixedRate(r, initialDelay, period.length, period.unit).asInstanceOf[ScheduledFuture[Unit]]
    }
    def scheduleWithFixedDelay(initDelay: FiniteDuration, period: FiniteDuration)(thunk: => Unit): ScheduledFuture[Unit] = {
      val r = new Runnable {
        def run = thunk
      }
      val initialDelay = period.unit.convert(initDelay.length, initDelay.unit)
      scheduler.scheduleWithFixedDelay(r, initialDelay, period.length, period.unit).asInstanceOf[ScheduledFuture[Unit]]
    }
  }

  private val DefaultTimeout = 30.seconds

  implicit class ScuffScalaFuture[T](private val f: Future[T]) extends AnyVal {
    def await: T = await(DefaultTimeout)
    def await(maxWait: FiniteDuration, reportFailureAfterTimeout: Throwable => Unit = null): T =
      if (f.isCompleted) {
        f.value.get.get
      } else {
        try Await.result(f, maxWait) catch {
          case timeout: TimeoutException if reportFailureAfterTimeout != null =>
            f.failed.foreach(reportFailureAfterTimeout)(Threads.PiggyBack)
            throw timeout
        }
      }
    def flatten[A](implicit ev: T <:< Future[A]): Future[A] = {
      assert(ev != null) // Remove warning
      f.asInstanceOf[Future[Future[A]]].flatMap(identity)(Threads.PiggyBack)
    }
    def withTimeout(timeout: FiniteDuration)(implicit scheduler: ScheduledExecutorService): Future[T] = {
      if (f.isCompleted) f
      else {
        val promise = Promise[T]()
        val cmd = new Runnable {
          def run(): Unit = {
            promise tryFailure new TimeoutException(s"Timed out after $timeout") with NoStackTrace
          }
        }
        val timeoutFuture = scheduler.schedule(cmd, timeout.length, timeout.unit)
        f.onComplete {
          case result =>
            if (promise tryComplete result) {
              timeoutFuture.cancel(false)
            }
        }(Threads.PiggyBack)
        promise.future
      }
    }
  }

  implicit def typedFutureConv[T](implicit untyped: JavaFutureConverter) =
    untyped.asInstanceOf[java.util.concurrent.Future[T] => Future[T]]

  implicit class ScuffJavaFuture[T](private val f: java.util.concurrent.Future[T]) extends AnyVal {
    @implicitNotFound(msg = "No java.util.concurrent.Future => scala.concurrent.Future function found. Try an instance of JavaFutureConverter")
    def asScala(implicit conv: java.util.concurrent.Future[T] => Future[T]): Future[T] = conv(f)
  }

  implicit class ScuffLock(private val lock: java.util.concurrent.locks.Lock) extends AnyVal {

    def tryFor[T](dur: FiniteDuration)(thunk: => T): Option[T] = {
      if (lock.tryLock(dur.length, dur.unit)) try {
        Some(thunk)
      } finally {
        lock.unlock()
      }
      else None
    }

    def apply[T](thunk: => T): T = {
      lock.lockInterruptibly()
      try {
        thunk
      } finally {
        lock.unlock()
      }
    }
    def uninterruptibly[T](thunk: => T) = {
      lock.lock()
      try {
        thunk
      } finally {
        lock.unlock()
      }
    }
  }

  implicit class ScuffCondition(private val cond: java.util.concurrent.locks.Condition) extends AnyVal {
    def await(condition: => Boolean): Unit = while (!condition) cond.await()
    def signalIf(condition: Boolean): Unit = if (condition) cond.signal()
    def signalAllIf(condition: Boolean): Unit = if (condition) cond.signalAll()
  }

  implicit class ScuffConcurrentMap[K, V](private val cmap: collection.concurrent.Map[K, V]) extends AnyVal {
    /** Update if present; return updated value. */
    def updateIfPresent(k: K)(update: V => V): Option[V] = {
      cmap.get(k) flatMap { oldvalue =>
        val newvalue = update(oldvalue)
        if (cmap.replace(k, oldvalue, newvalue)) Some(newvalue)
        else updateIfPresent(k)(update)
      }
    }
    /** Update or insert; return upserted value. */
    def upsert(k: K, putIfAbsent: V)(updateIfPresent: V => V): V = {
      cmap.putIfAbsent(k, putIfAbsent) match {
        case None => putIfAbsent
        case Some(present) =>
          val update = updateIfPresent(present)
          if (cmap.replace(k, present, update)) {
            update
          } else {
            upsert(k, putIfAbsent)(updateIfPresent)
          }
      }
    }
  }

  private[this] val NoFuture = Future successful None
  private[this] val NilFuture = Future successful Nil
  private[this] val UnitFuture = Future successful (())
  private[this] val TrueFuture = Future successful true
  private[this] val FalseFuture = Future successful false

  implicit final class ScuffFutureObject(private val f: Future.type) extends AnyVal {
    def none: Future[None.type] = NoFuture
    def nil: Future[Nil.type] = NilFuture
    def unit: Future[Unit] = UnitFuture
    def True: Future[Boolean] = TrueFuture
    def False: Future[Boolean] = FalseFuture
  }

}


text:
description: Learn how to upgrade your Docker Trusted Registry
keywords: docker, dtr, upgrade, install
title: Upgrade DTR
---

DTR uses [semantic versioning](http://semver.org/) and we aim to achieve specific
guarantees while upgrading between versions. We never support downgrading. We
support upgrades according to the following rules:

* When upgrading from one patch version to another you can skip patch versions
  because no data migration is done for patch versions.
* When upgrading between minor versions, you can't skip versions, but you can
  upgrade from any patch versions of the previous minor version to any patch
  version of the current minor version.
* When upgrading between major versions you also have to upgrade one major
  version at a time, but you have to upgrade to the earliest available minor
  version. We also strongly recommend upgrading to the latest minor/patch
  version for your major version first.

| Description                          | From  | To        | Supported |
|:-------------------------------------|:------|:----------|:----------|
| patch upgrade                        | x.y.0 | x.y.1     | yes       |
| skip patch version                   | x.y.0 | x.y.2     | yes       |
| patch downgrade                      | x.y.2 | x.y.1     | no        |
| minor upgrade                        | x.y.* | x.y+1.*   | yes       |
| skip minor version                   | x.y.* | x.y+2.*   | no        |
| minor downgrade                      | x.y.* | x.y-1.*   | no        |
| skip major version                   | x.*.* | x+2.*.*   | no        |
| major downgrade                      | x.*.* | x-1.*.*   | no        |
| major upgrade                        | x.y.z | x+1.0.0   | yes       |
| major upgrade skipping minor version | x.y.z | x+1.y+1.z | no        |

There may be at most a few seconds of interruption during the upgrade of a
DTR cluster. Schedule the upgrade to take place outside business peak hours
to ensure the impact on your business is close to none.

## Minor upgrade

Before starting your upgrade planning, make sure that the version of UCP you are
using is supported by the version of DTR you are trying to upgrade to. <!--(TODO:
link to the compatibility matrix)-->

> **Warning**
>
> Before performing any upgrade it's important to backup. See
> [DTR backups and recovery](/datacenter/dtr/2.2/guides/admin/backups-and-disaster-recovery.md).
{: .warning}

### Step 1. Upgrade DTR to 2.1 if necessary

Make sure you're running DTR 2.1. If that's not the case, [upgrade your installation to the 2.1 version](/datacenter/dtr/2.1/guides/install/upgrade/.md).

### Step 2. Upgrade DTR

Then pull the latest version of DTR:

```none
$ docker pull {{ page.docker_image }}
```

If the node you're upgrading doesn't have access to the internet, you can
follow the [offline installation documentation](install/install-offline.md)
to get the images.

Once you have the latest image on your machine (and the images on the target
nodes if upgrading offline), run the upgrade command:

```none
$ docker run -it --rm \
  {{ page.docker_image }} upgrade \
  --ucp-insecure-tls
```

By default the upgrade command runs in interactive mode and prompts you for
any necessary information. You can also check the
[reference documentation](../../reference/cli/index.md) for other existing flags.

The upgrade command will start replacing every container in your DTR cluster,
one replica at a time. It will also perform certain data migrations. If anything
fails or the upgrade is interrupted for any reason, you can re-run the upgrade
command and it will resume from where it left off.

## Patch upgrade

A patch upgrade changes only the DTR containers and it's always safer than a minor
upgrade. The command is the same as for a minor upgrade.

## Where to go next

* [Release notes](release-notes.md)


text:
#include "PathParser.h"

#include "jni.h"

#include <errno.h>
#include <utils/Log.h>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>

namespace android {
namespace uirenderer {

static size_t nextStart(const char* s, size_t length, size_t startIndex) {
    size_t index = startIndex;
    while (index < length) {
        char c = s[index];
        // Note that 'e' or 'E' are not valid path commands, but could be
        // used for floating point numbers' scientific notation.
        // Therefore, when searching for next command, we should ignore 'e'
        // and 'E'.
        if ((((c - 'A') * (c - 'Z') <= 0) || ((c - 'a') * (c - 'z') <= 0))
                && c != 'e' && c != 'E') {
            return index;
        }
        index++;
    }
    return index;
}

/**
 * Calculate the position of the next comma or space or negative sign
 * @param s the string to search
 * @param start the position to start searching
 * @param result the result of the extraction, including the position of the
 * the starting position of next number, whether it is ending with a '-'.
 */
static void extract(int* outEndPosition, bool* outEndWithNegOrDot, const char* s, int start, int end) {
    // Now looking for ' ', ',', '.' or '-' from the start.
    int currentIndex = start;
    bool foundSeparator = false;
    *outEndWithNegOrDot = false;
    bool secondDot = false;
    bool isExponential = false;
    for (; currentIndex < end; currentIndex++) {
        bool isPrevExponential = isExponential;
        isExponential = false;
        char currentChar = s[currentIndex];
        switch (currentChar) {
        case ' ':
        case ',':
            foundSeparator = true;
            break;
        case '-':
            // The negative sign following a 'e' or 'E' is not a separator.
            if (currentIndex != start && !isPrevExponential) {
                foundSeparator = true;
                *outEndWithNegOrDot = true;
            }
            break;
        case '.':
            if (!secondDot) {
                secondDot = true;
            } else {
                // This is the second dot, and it is considered as a separator.
                foundSeparator = true;
                *outEndWithNegOrDot = true;
            }
            break;
        case 'e':
        case 'E':
            isExponential = true;
            break;
        }
        if (foundSeparator) {
            break;
        }
    }
    // In the case where nothing is found, we put the end position to the end of
    // our extract range. Otherwise, end position will be where separator is found.
    *outEndPosition = currentIndex;
}

static float parseFloat(PathParser::ParseResult* result, const char* startPtr, size_t expectedLength) {
    char* endPtr = NULL;
    float currentValue = strtof(startPtr, &endPtr);
    if ((currentValue == HUGE_VALF || currentValue == -HUGE_VALF) && errno == ERANGE) {
        result->failureOccurred = true;
        result->failureMessage = "Float out of range:  ";
        result->failureMessage.append(startPtr, expectedLength);
    }
    if (currentValue == 0 && endPtr == startPtr) {
        // No conversion is done.
        result->failureOccurred = true;
        result->failureMessage = "Float format error when parsing: ";
        result->failureMessage.append(startPtr, expectedLength);
    }
    return currentValue;
}

/**
 * Parse the floats in the string.
 *
 * @param s the string containing a command and list of floats
 * @return true on success
 */
static void getFloats(std::vector<float>* outPoints, PathParser::ParseResult* result,
        const char* pathStr, int start, int end) {

    if (pathStr[start] == 'z' || pathStr[start] == 'Z') {
        return;
    }
    int startPosition = start + 1;
    int endPosition = start;

    // The startPosition should always be the first character of the
    // current number, and endPosition is the character after the current
    // number.
    while (startPosition < end) {
        bool endWithNegOrDot;
        extract(&endPosition, &endWithNegOrDot, pathStr, startPosition, end);

        if (startPosition < endPosition) {
            float currentValue = parseFloat(result, &pathStr[startPosition],
                    end - startPosition);
            if (result->failureOccurred) {
                return;
            }
            outPoints->push_back(currentValue);
        }

        if (endWithNegOrDot) {
            // Keep the '-' or '.' sign with next number.
            startPosition = endPosition;
        } else {
            startPosition = endPosition + 1;
        }
    }
    return;
}

bool PathParser::isVerbValid(char verb) {
    verb = tolower(verb);
    return verb == 'a' || verb == 'c' || verb == 'h' || verb == 'l' || verb == 'm' || verb == 'q'
            || verb == 's' || verb == 't' || verb == 'v' || verb == 'z';
}

void PathParser::getPathDataFromAsciiString(PathData* data, ParseResult* result,
        const char* pathStr, size_t strLen) {
    if (pathStr == NULL) {
        result->failureOccurred = true;
        result->failureMessage = "Path string cannot be NULL.";
        return;
    }

    size_t start = 0;
    // Skip leading spaces.
    while (isspace(pathStr[start]) && start < strLen) {
        start++;
    }
    if (start == strLen) {
        result->failureOccurred = true;
        result->failureMessage = "Path string cannot be empty.";
        return;
    }
    size_t end = start + 1;

    while (end < strLen) {
        end = nextStart(pathStr, strLen, end);
        std::vector<float> points;
        getFloats(&points, result, pathStr, start, end);
        if (!isVerbValid(pathStr[start])) {
            result->failureOccurred = true;
            result->failureMessage = "Invalid pathData. Failure occurred at position "
                    + std::to_string(start) + " of path: " + pathStr;
        }
        // If either verb or points is not valid, return immediately.
        if (result->failureOccurred) {
            return;
        }
        data->verbs.push_back(pathStr[start]);
        data->verbSizes.push_back(points.size());
        data->points.insert(data->points.end(), points.begin(), points.end());
        start = end;
        end++;
    }

    if ((end - start) == 1 && start < strLen) {
        if (!isVerbValid(pathStr[start])) {
            result->failureOccurred = true;
            result->failureMessage = "Invalid pathData. Failure occurred at position "
                    + std::to_string(start) + " of path: " + pathStr;
            return;
        }
        data->verbs.push_back(pathStr[start]);
        data->verbSizes.push_back(0);
    }
}

void PathParser::dump(const PathData& data) {
    // Print out the path data.
    size_t start = 0;
    for (size_t i = 0; i < data.verbs.size(); i++) {
        std::ostringstream os;
        os << data.verbs[i];
        os << ", verb size: " << data.verbSizes[i];
        for (size_t j = 0; j < data.verbSizes[i]; j++) {
            os << " " << data.points[start + j];
        }
        start += data.verbSizes[i];
        ALOGD("%s", os.str().c_str());
    }

    std::ostringstream os;
    for (size_t i = 0; i < data.points.size(); i++) {
        os << data.points[i] << ", ";
    }
    ALOGD("points are : %s", os.str().c_str());
}

void PathParser::parseAsciiStringForSkPath(SkPath* skPath, ParseResult* result, const char* pathStr, size_t strLen) {
    PathData pathData;
    getPathDataFromAsciiString(&pathData, result, pathStr, strLen);
    if (result->failureOccurred) {
        return;
    }
    // Check if there is valid data coming out of parsing the string.
    if (pathData.verbs.size() == 0) {
        result->failureOccurred = true;
        result->failureMessage = "No verbs found in the string for pathData: ";
        result->failureMessage += pathStr;
        return;
    }
    VectorDrawableUtils::verbsToPath(skPath, pathData);
    return;
}

}; // namespace uirenderer
}; //namespace android


text:
@implementation HRQueue

- (instancetype)initWithQueue:(dispatch_queue_t)queue {
    self = [super init];
    if (self) {
        _queue = queue;
    }
    return self;
}

- (void)sync:(void (^)())block{
    dispatch_sync(self.queue, block);
}

- (void)async:(void (^)())block {
    dispatch_async(self.queue, block);
}

@end


text:
<?php

namespace DoctrineModule\Validator\Service;

use PHPUnit\Framework\TestCase;
use DoctrineModule\Validator\ObjectExists;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
use Interop\Container\ContainerInterface;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2017-09-04 at 11:55:36.
 *
 * @coversDefaultClass DoctrineModule\Validator\Service\ObjectExistsFactory
 * @group validator
 */
class ObjectExistsFactoryTest extends TestCase
{
    /**
     * @var ObjectExistsFactory
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new ObjectExistsFactory;
    }

    /**
     * @covers ::__invoke
     */
    public function testInvoke()
    {
        $options = [
            'target_class' => 'Foo\Bar',
            'fields'       => ['test'],
        ];

        $repository = $this->prophesize(ObjectRepository::class);
        $objectManager = $this->prophesize(ObjectManager::class);
        $objectManager->getRepository('Foo\Bar')
            ->shouldBeCalled()
            ->willReturn($repository->reveal());

        $container = $this->prophesize(ContainerInterface::class);
        $container->get('doctrine.entitymanager.orm_default')
            ->shouldBeCalled()
            ->willReturn($objectManager->reveal());

        $instance = $this->object->__invoke(
            $container->reveal(),
            ObjectExists::class,
            $options
        );
        $this->assertInstanceOf(ObjectExists::class, $instance);
    }
}


text:
module Quickbooks
  module Service
    class Invoice < BaseService

      def delete(invoice, options = {})
        delete_by_query_string(invoice)
      end

      private

      def model
        Quickbooks::Model::Invoice
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content=""Let's get it started"">

    <title>日志模版 - Coding Zero</title>

    <link rel="canonical" href="https://github.com/BigabilityLiu/2015/12/30/CoreData/">

    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <link rel="stylesheet" href="/css/clean-blog.css">

    <link rel="stylesheet" href="/css/syntax.css">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            BigabilityLiu

                    主页

                    关于

                    联系

日志模版

这个是小标题

                    Posted by BigabilityLiu on December 30, 2015

这是一个h1标题

这也是一个h2标题

这也是一个h3标题

这也是一个h4标题

这也是一个h5标题

这是普通文字
这个是斜体字coding

Reaching for the Stars

👇是一张图片

这是图片的一段介绍文字

这是一个网址

这是一段代码,类似的代码样式还有    c java Erlang

let documentsDirectorys = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true) as NSArray
let documentsDirectory = documentsDirectorys.objectAtIndex(0) as! NSString
let pathDocuments = documentsDirectory.stringByAppendingPathComponent("UserList.plist") as String
print(pathDocuments)
func getImage(filename: String) -> UIImage? {
var error: NSError?
let path = NSHomeDirectory().stringByAppendingString("/Documents/\(filename)")
let data = NSData(contentsOfFile: path, options: .UncachedRead, error: &error)
if let unwrappedError = error {
return nil
} else {
return UIImage(data: data!)
}
}

                        ← Previous Post

                        Next Post →

Copyright © Coding Zero 2016


text:
package org.synopia.audio.model;

/**
 * Created by synopia on 26.09.2015.
 */
public class MinMax {
    private float min = 1;
    private float max = -1;
    private int minCount;
    private int maxCount;

    public void nextSample(float sample) {
        if (sample < min) {
            min = sample;
            minCount++;
        }
        if (sample > max) {
            max = sample;
            maxCount++;
        }
    }

    public float min() {
        return minCount > 0 ? min : 0;
    }

    public float max() {
        return maxCount > 0 ? max : 0;
    }
}


text:
<?php
namespace App\Models;

use App\Models\Contracts\HasCustomFieldsInterface;
use App\Models\Foundation\MetaFunctions;

class CategoryMeta extends AbstractModel implements HasCustomFieldsInterface
{
    use MetaFunctions;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'category_metas';

    public $timestamps = false;

    /**
     * Primary key
     *
     * @var string
     */
    protected $primaryKey = 'id';

    protected $editableFields = [
        'content_id',
        'meta_key',
        'meta_value',
    ];

    protected $rules = [
        'meta_key' => 'required|max:255',
    ];

    public function relatedContent()
    {
        return $this->belongsTo('App\Models\Category', 'content_id');
    }
}


text:
.class public Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/google/android/gms/common/internal/safeparcel/SafeParcelable;

# static fields
.field public static final CREATOR:Lcom/google/android/gms/auth/firstparty/shared/zza;

# instance fields
.field final version:I

.field zzTA:Z

.field zzTB:Z

.field zzTC:Z

.field zzTx:Z

.field zzTy:Ljava/lang/String;

.field zzTz:Z

# direct methods
.method static constructor <clinit>()V
    .registers 1

    new-instance v0, Lcom/google/android/gms/auth/firstparty/shared/zza;

    invoke-direct {v0}, Lcom/google/android/gms/auth/firstparty/shared/zza;-><init>()V

    sput-object v0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->CREATOR:Lcom/google/android/gms/auth/firstparty/shared/zza;

    return-void
.end method

.method constructor <init>(IZLjava/lang/String;ZZZZ)V
    .registers 8
    .param p1, "version"    # I
    .param p2, "isAllCirclesVisible"    # Z
    .param p3, "visibleEdges"    # Ljava/lang/String;
    .param p4, "isAllContactsVisible"    # Z
    .param p5, "showCircles"    # Z
    .param p6, "showContacts"    # Z
    .param p7, "hasShowCircles"    # Z

    .prologue
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput p1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->version:I

    iput-boolean p2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTx:Z

    iput-object p3, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTy:Ljava/lang/String;

    iput-boolean p4, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTz:Z

    iput-boolean p5, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTA:Z

    iput-boolean p6, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTB:Z

    iput-boolean p7, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTC:Z

    return-void
.end method

# virtual methods
.method public describeContents()I
    .registers 2

    const/4 v0, 0x0

    return v0
.end method

.method public equals(Ljava/lang/Object;)Z
    .registers 5
    .param p1, "o"    # Ljava/lang/Object;

    .prologue
    const/4 v0, 0x0

    instance-of v1, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;

    if-eqz v1, :cond_30

    check-cast p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;

    .end local p1    # "o":Ljava/lang/Object;
    iget-boolean v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTx:Z

    iget-boolean v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTx:Z

    if-ne v1, v2, :cond_30

    iget-object v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTy:Ljava/lang/String;

    iget-object v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTy:Ljava/lang/String;

    invoke-static {v1, v2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_30

    iget-boolean v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTz:Z

    iget-boolean v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTz:Z

    if-ne v1, v2, :cond_30

    iget-boolean v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTA:Z

    iget-boolean v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTA:Z

    if-ne v1, v2, :cond_30

    iget-boolean v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTB:Z

    iget-boolean v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTB:Z

    if-ne v1, v2, :cond_30

    iget-boolean v1, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTC:Z

    iget-boolean v2, p1, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTC:Z

    if-ne v1, v2, :cond_30

    const/4 v0, 0x1

    :cond_30
    return v0
.end method

.method public hashCode()I
    .registers 4

    const/4 v0, 0x6

    new-array v0, v0, [Ljava/lang/Object;

    const/4 v1, 0x0

    iget-boolean v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTx:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTy:Ljava/lang/String;

    aput-object v2, v0, v1

    const/4 v1, 0x2

    iget-boolean v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTz:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x3

    iget-boolean v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTA:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x4

    iget-boolean v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTB:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x5

    iget-boolean v2, p0, Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;->zzTC:Z

    invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v2

    aput-object v2, v0, v1

    invoke-static {v0}, Lcom/google/android/gms/common/internal/zzw;->hashCode([Ljava/lang/Object;)I

    move-result v0

    return v0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .registers 3
    .param p1, "dest"    # Landroid/os/Parcel;
    .param p2, "flags"    # I

    .prologue
    invoke-static {p0, p1, p2}, Lcom/google/android/gms/auth/firstparty/shared/zza;->zza(Lcom/google/android/gms/auth/firstparty/shared/FACLConfig;Landroid/os/Parcel;I)V

    return-void
.end method


text:
namespace nuPickers.PropertyEditors.DotNetRadioButtonPicker
{
    using ClientDependency.Core;

    using nuPickers.PropertyEditors;

    using Umbraco.Core.PropertyEditors;
    using Umbraco.Web.PropertyEditors;

    // EDITOR UI
    [PropertyEditor(PropertyEditorConstants.DotNetRadioButtonPickerAlias, "nuPickers: DotNet RadioButton Picker", EmbeddedResource.RootUrl + "RadioButtonPicker/RadioButtonPickerEditor.html", ValueType = "TEXT")]
    [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.RootUrl + "LayoutDirection/LayoutDirection.css.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "RadioButtonPicker/RadioButtonPickerEditorController.js.nu")]

    // RESOURCES (all are referenced as EditorResource consumes the others)
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "Editor/EditorResource.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "DataSource/DataSourceResource.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "RelationMapping/RelationMappingResource.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "SaveFormat/SaveFormatResource.js.nu")]

    // CONFIG
    [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.RootUrl + "PropertyEditor/PropertyEditorConfig.css.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "DotNetDataSource/DotNetDataSourceConfigController.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "CustomLabel/CustomLabelConfigController.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "RelationMapping/RelationMappingConfigController.js.nu")]
    [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "SaveFormat/SaveFormatConfigController.js.nu")]
    public class DotnetRadioButtonPickerPropertyEditor : BasePropertyEditor
    {
        protected override PreValueEditor CreatePreValueEditor()
        {
            return new DotNetRadioButtonPickerPreValueEditor();
        }
    }
}


text:
/**
 * Game administration(singleton)
 *
 * @author Hannes Eilers
 * @author Eike Petersen
 *
 * @version Beta 1.0
 */
"use strict";

var logging = require( process.cwd() + '/core/logging/logging.js' );
var logger = logging.getLogger( 'routes' );

var mrServerConnection = require( process.cwd() + '/core/network/mrserverconnection' );

module.exports = (function(){

    var that = {};

    var _listOfGames = {};

    /**
     * Registers the 'global' list of games(mrserverconnection) with this module
     *
     * @param {list of mrserverconnection} the 'global' gameslist
     */
    that.registerGamesList = function( listOfGames ){

        _listOfGames = listOfGames;

    };

    /**
     * Shows the administration-page for games.
     * User needs right privileges to access site.
     *
     * @param needs the request, response and next objects of express
     */
    that.adminPage = function( req, res, next ){

        if( req.session.loggedIn ){

            res.render('admin', { title: 'Administration', admin: true, isAuthenticated: req.session.loggedIn, listOfGames: _listOfGames, joinedGames: req.session.joinedGames } );

        } else {

            res.redirect( '/' );

        }

    };

    /**
     * Tries to disconnect the requested game from its gameserver
     *
     * @param needs the request, response and next objects of express
     */
    that.disconnectGame = function( req, res, next ){

        if( req.session.loggedIn ){

            if( req.params.game && _listOfGames[req.params.game] && _listOfGames[req.params.game].connected() ){

                _listOfGames[req.params.game].disconnect();

            }

            res.redirect( '/games/admin' );

        } else {

            res.redirect( 'back' );

        }

    };

    /**
     * Tries to connect the requested game to its gameserver
     *
     * @param needs the request, response and next objects of express
     */
    that.connectGame = function( req, res, next ){

        if( req.session.loggedIn && req.params.game && _listOfGames[req.params.game] && !_listOfGames[req.params.game].connected() ){

            _listOfGames[req.params.game].connect( function(){

                res.redirect( '/games/admin' );

            });

        } else {

            res.redirect( 'back' );

        }

    };

    /**
     * Removes the requested game from it the gamelist
     *
     * @param needs the request, response and next objects of express
     */
    that.removeGame = function( req, res, next ){

        if( req.session.loggedIn ){

            if( req.params.game && _listOfGames[req.params.game]){

                if( _listOfGames[req.params.game].connected() ){

                    _listOfGames[req.params.game].disconnect();

                }
                //TODO: close all websockets
                delete _listOfGames[req.params.game];

            }

            res.redirect( '/games/admin' );

        } else {

            res.redirect( 'back' );

        }

    };

    /**
     * Adds the game to the gamelist
     *
     * @param needs the request, response and next objects of express
     */
    that.addGame = function( req, res, next ){

        if( req.session.loggedIn ){

            if( req.body && req.body.name && req.body.host && req.body.port && !_listOfGames[req.body.name] ){

            	logger.debug(req.body.teamyellow + ' ' + req.body.teamblue);
                _listOfGames[req.body.name] = mrServerConnection({ connectionname: req.body.name, mrserverip: req.body.host, mrserverport: req.body.port, yellowteamname: req.body.teamyellow, blueteamname: req.body.teamblue });

            }

            res.redirect( '/games/admin' );

        } else {

            res.redirect( 'back' );

        }

    };

    logger.info('Created game administration routes');

    return that;

}());


text:
package gw.service;

import gw.model.pk.RepositoryPK;

import java.util.List;

import javax.inject.Inject;

public class RepositoryUpdateService {
  @Inject private PullRequestService pullRequestService;

  public void onPost(RepositoryPK repositoryPK, List<String> branchNames) {
    pullRequestService.updateFromPush(repositoryPK, branchNames);
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you 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.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.wso2.carbon.analytics</groupId>
        <artifactId>org.wso2.carbon.analytics.parent</artifactId>
        <version>3.0.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.si.metrics.core</artifactId>
    <name>WSO2 Carbon - Siddhi Metrics Core</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-query-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.siddhi</groupId>
            <artifactId>siddhi-query-compiler</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.metrics</groupId>
            <artifactId>org.wso2.carbon.metrics.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.config</groupId>
            <artifactId>org.wso2.carbon.config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.wso2.carbon.si.metrics.core.*
                        </Export-Package>
                        <Import-Package>
                            *;resolution:=optional,
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <argLine>${surefireArgLine} -ea -Xmx512m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${org.jacoco.version}</version>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${basedir}/target/coverage-reports/jacoco.exec</destFile>
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${basedir}/target/coverage-reports/jacoco.exec</dataFile>
                            <outputDirectory>${basedir}/target/coverage-reports/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
package com.brighttag.agathon.security;

import java.util.Arrays;
import java.util.Collection;

import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Range;

/**
 * Immutable representation of a security group permission.
 *
 * @author codyaray
 * @since 8/30/2013
 */
public class SecurityGroupPermission {
  private final ImmutableSet<Netmask> netmasks;
  private final Range<Integer> portRange;

  public SecurityGroupPermission(Collection<Netmask> netmasks, Range<Integer> portRange) {
    this.netmasks = ImmutableSet.copyOf(netmasks);
    this.portRange = portRange;
  }

  /**
   * Get the network masks included in this permission.
   * @return network masks
   */
  public ImmutableSet<Netmask> getNetmasks() {
    return netmasks;
  }

  /**
   * Get the range of ports included in this permission.
   * @return the range of ports
   */
  public Range<Integer> getPortRange() {
    return portRange;
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(significantAttributes());
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } else if (obj == this) {
      return true;
    } else if (!getClass().isAssignableFrom(obj.getClass())) {
      return false;
    }
    return Arrays.equals(significantAttributes(), getClass().cast(obj).significantAttributes());
  }

  @Override
  public String toString() {
    return Objects.toStringHelper(this)
        .add("netmasks", netmasks)
        .add("portRange", portRange)
        .toString();
  }

  Object[] significantAttributes() {
    return new Object[] { netmasks, portRange };
  }

}


text:
\begin{figure}
\centering

\input ./part4/quantcomp/pichadamar1.tex

\caption{Преобразование Адамара на одном кубите}
\label{figQuantCompHadamar1}
\end{figure}


text: Options - right Options Options Options Options


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>mPurpose - Multipurpose Feature Rich Bootstrap Template</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/icomoon-social.css">
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,600,800' rel='stylesheet' type='text/css'>

        <link rel="stylesheet" href="css/leaflet.css" />

		<link rel="stylesheet" href="css/main.css">

 3 items

									 UK

 US

 DE

 ES

Login

							Home

							Features

							Pages +

Homepage

Homepage (Sample 1)

Homepage (Sample 2)

Services & Pricing

Services/Features (Rows)

Services/Features (3 Columns)

Services/Features (4 Columns)

Pricing Table

Team & Open Vacancies

Our Team

Open Vacancies (List)

Open Vacancies (Job Details)

Our Work (Portfolio)

Portfolio (2 Columns, Option 1)

Portfolio (2 Columns, Option 2)

Portfolio (3 Columns, Option 1)

Portfolio (3 Columns, Option 2)

Portfolio Item (Project) Description

General Pages

About Us

Contact Us

Frequently Asked Questions

Testimonials & Clients

Events

404 Page

Sitemap

Login

Register

Password Reset

Terms & Privacy

Coming Soon

eShop

Products listing (3 Columns)

Products listing (4 Columns)

Products Slider

Product Details

Shopping Cart

Blog

Blog Posts (List)

Blog Single Post (Right Sidebar)

Blog Single Post (Left Sidebar)

Latest & Featured News

							Credits

About Us

We are leading company

							Donec elementum mi vitae enim fermentum lobortis. In hac habitasse platea dictumst. Ut pellentesque, orci sed mattis consequat, libero ante lacinia arcu, ac porta lacus urna in lorem. Praesent consectetur tristique augue, eget elementum diam suscipit id.

Wide range of services

							Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam condimentum laoreet sagittis. Duis quis ullamcorper leo. Suspendisse potenti.

Featured on

							Morbi eleifend congue elit nec sagittis. Praesent aliquam lobortis tellus, nec consequat vitae

							Morbi eleifend congue elit nec sagittis. Praesent aliquam lobortis tellus, nec consequat vitae

							Morbi eleifend congue elit nec sagittis. Praesent aliquam lobortis tellus, nec consequat vitae

Our Services

Brilliant Look

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Themeable

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Features Rich

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Brilliant Look

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Brilliant Look

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Themeable

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Features Rich

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Brilliant Look

Pellentesque habitant morbi tristique senectus et netus et malesuada fames. Read more...

Our Latest Work

Navigate

Blog

Portfolio

eShop

Services

Pricing

FAQ

Contacts

	        				Address: 123 Fake Street, LN1 2ST, London, United Kingdom

	        				Phone: +44 123 654321

	        				Fax: +44 123 654321

	        				Email: getintoutch@yourcompanydomain.com

Stay Connected

© 2013 mPurpose. All rights reserved.


text:
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { ActionSheetCmp } from './action-sheet-component';
import { ActionSheetSlideIn, ActionSheetMdSlideIn, ActionSheetSlideOut, ActionSheetMdSlideOut, ActionSheetWpSlideIn, ActionSheetWpSlideOut } from './action-sheet-transitions';
import { isPresent } from '../../util/util';
import { ViewController } from '../../navigation/view-controller';
/**
 * @hidden
 */
var ActionSheet = (function (_super) {
    __extends(ActionSheet, _super);
    /**
     * @param {?} app
     * @param {?} opts
     * @param {?} config
     */
    function ActionSheet(app, opts, config) {
        var _this = this;
        opts.buttons = opts.buttons || [];
        opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
        _this = _super.call(this, ActionSheetCmp, opts, null) || this;
        _this._app = app;
        _this.isOverlay = true;
        config.setTransition('action-sheet-slide-in', ActionSheetSlideIn);
        config.setTransition('action-sheet-slide-out', ActionSheetSlideOut);
        config.setTransition('action-sheet-md-slide-in', ActionSheetMdSlideIn);
        config.setTransition('action-sheet-md-slide-out', ActionSheetMdSlideOut);
        config.setTransition('action-sheet-wp-slide-in', ActionSheetWpSlideIn);
        config.setTransition('action-sheet-wp-slide-out', ActionSheetWpSlideOut);
        return _this;
    }
    /**
     * @hidden
     * @param {?} direction
     * @return {?}
     */
    ActionSheet.prototype.getTransitionName = function (direction) {
        var /** @type {?} */ key = 'actionSheet' + (direction === 'back' ? 'Leave' : 'Enter');
        return this._nav && this._nav.config.get(key);
    };
    /**
     * @param {?} title
     * @return {?}
     */
    ActionSheet.prototype.setTitle = function (title) {
        this.data.title = title;
        return this;
    };
    /**
     * @param {?} subTitle
     * @return {?}
     */
    ActionSheet.prototype.setSubTitle = function (subTitle) {
        this.data.subTitle = subTitle;
        return this;
    };
    /**
     * @param {?} button
     * @return {?}
     */
    ActionSheet.prototype.addButton = function (button) {
        this.data.buttons.push(button);
        return this;
    };
    /**
     * Present the action sheet instance.
     *
     * @param {?=} navOptions
     * @return {?}
     */
    ActionSheet.prototype.present = function (navOptions) {
        if (navOptions === void 0) { navOptions = {}; }
        navOptions.minClickBlockDuration = navOptions.minClickBlockDuration || 400;
        return this._app.present(this, navOptions);
    };
    return ActionSheet;
}(ViewController));
export { ActionSheet };
function ActionSheet_tsickle_Closure_declarations() {
    /** @type {?} */
    ActionSheet.prototype._app;
}
//# sourceMappingURL=action-sheet.js.map


text:
class Parent(object):
    C = 12

    def foo(self):
        pass

class Child(Parent, object):
    def __init__(self):
        self.foo = 12

    AC = 11

    def foo(self):
        pass

class Bar(object):
    pass


text:
<?php

namespace DGApiClient\SearchCriteria;

/**
 * Class RegionSearchCriteria
 * @package DGApiClient\SearchCriteria
 * @property string $lang
 * @property string|string[] $locale_filter
 * @property string|string[] $country_code_filter
 */
class RegionSearchCriteria extends AbstractSearchCriteria
{

    protected $allowedAttributes = array(
        'lang',
        'locale_filter',
        'country_code_filter',
    );
}


text:
v0.1.5

[中文说明](/README_zh.md)

Gacman is a simple and responsive theme based on [Jacman](https://github.com/wuchong/jacman) and Bootstrap for [Hexo](http://hexo.io) with some special features.

Please note that, I really suggest you do not use this theme until v0.2.0 has been publiced.

[Demo](http://gsgundam.com) | [GSGundam's Blog](http://gsgundam.com)

[How to use Gacman or Jacman](http://wuchong.me/blog/2014/11/20/how-to-use-jacman/)

##Installation
###Install
```
$ git clone https://github.com/gsgundam/gacman.git themes/gacman
```
**Gacman requires Hexo 2.7 and above.**
###Enable
Modify `theme` setting in blog folder` _config.yml` to `gacman`.
###Update
```
cd themes/gacman
git pull origin master
```
**please backup your `_config.yml` file before update.**

##Configuration

Modify settings in  `/themes/gacman/_config.yml`. [Learn More from Jacman](https://github.com/wuchong/jacman/wiki/%E9%85%8D%E7%BD%AE%E6%8C%87%E5%8D%97).

##Features
- **menu**
 Main navigation menu.
- **widget**
 Widgets displaying in sidebar.The category,tag,rss,archive,tagcloud,links,weibo are supported.
- **index**
 Two different home page display modes.You can visit [Demo](http://wuchong.me/jacman) & [Jark's Blog](http://wuchong.me) to check the difference.
- **author**
 Author imformation, used to show your social network links on the bottom right. Including github, stackoverflow, twitter, facebook, linkedin, google+, weibo, tencent weibo, douban, zhihu, email.
- **toc**
 Show Table Of Contents in article & aside.
- **comments**
 [duoshuo](http://duoshuo.com/) & [disqus](https://disqus.com/) are supported.
- **jiathis**
 Build-in share tool or [JiaThis](http://www.jiathis.com/) share buttons at the bottom of articles.
- **Analytiscs**
 [Google analytics](http://www.google.com/analytics/) & [Baidu tongji](http://tongji.baidu.com/) & [CNZZ tongji](http://www.cnzz.com/) are all supported.
- **Search**
 [Googlle Custom Search](https://www.google.com/cse/ ) & [Baidu Site Search](http://zn.baidu.com/) are supported.
- **totop**
 Scroll to top
- **rss**
 RSS subscription link (change if using Feedburner).
- **fancybox**
 Enable [Fancybox](http://fancyapps.com/fancybox/)

You can learn how to use them from [Configuration from Jacman](https://github.com/wuchong/jacman/wiki/配置指南).

##Sites
- [GSGundam砍柴工](http://gsgundam.com) - The author's blog of Gacman
- [Jacman Theme](http://wuchong.me/jacman) - The demo site of Jacman Theme
- [Jark's Blog](http://wuchong.me) - The author's blog of Jacman

##License
[MIT](/LICENSE)


text:
cask 'jet' do
  version '1.10.0'
  sha256 'c3add7cb1eecc323eeaaa62a72711ef02b646f30f09c47139f0b1bfca5e25f55'

  # s3.amazonaws.com/codeship-jet-releases was verified as official when first introduced to the cask
  url "https://s3.amazonaws.com/codeship-jet-releases/#{version}/jet-darwin_amd64_#{version}.tar.gz"
  name 'Codeship Jet'
  homepage 'https://codeship.com/documentation/docker/'
  license :closed

  depends_on formula: 'docker'

  binary 'jet'
end