text:
<?php
use CLMVC\Core\Options;
use CLMVC\ViewEngines\WordPress\WpOptions;

/**
 * User: andreas
 * Date: 2011-12-30
 * Time: 20:28
 */
define('LOADALL',true);
define('LOADDATABASE',false);
define('DB_NAME', 'auto_testing');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');

include('../../config.php');
include(PACKAGE_PATH.'/'.'tests/classes/wp-functions.php');
include(PACKAGE_PATH . 'lib/ViewEngines/WordPress/WpOptions.php');

class WpOptionsTests extends PHPUnit_Framework_TestCase
{
    function testCreateNewOptions(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->setValue('key','value');
        $options->setValue('key2','value2');
        $this->assertEquals('value',$options->getValue('key'));
        $this->assertEquals('value2',$options->getValue('key2'));
    }
    function testCreateNewSameOptions(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $this->assertTrue($options->setValue('key','value'));
        $this->assertFalse($options->setValue('key','value2'));
        $this->assertEquals('value',$options->getValue('key'));
        $this->assertNotEquals('value2',$options->getValue('key'));
    }
    function testAddNewOptions(){
        $option= new Option();
        $option->setKey('key');
        $option->setDefaultValue('value');
        $option->setValue('value');
        $option->setType('string');
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->add($option);
        $this->assertEquals('value',$options->get('key')->getValue());
    }
    function testUpdateOptions(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $this->assertTrue($options->setValue('key','value'));
        $this->assertTrue($options->updateValue('key','value2'));
        $this->assertNotEquals('value',$options->getValue('key'));
        $this->assertEquals('value2',$options->getValue('key'));
    }
    function testExists(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->setValue('key','value');
        $this->assertTrue($options->exists('key'));
    }
    function testDeleteOptions(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->setValue('key','value');
        $options->remove('key');
        $this->assertFalse($options->exists('key'));
    }
    function testSetDefaultValue(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $this->assertTrue($options->setValue('key','value'));
        $this->assertTrue($options->updateValue('key','value2'));
        $options->reset();
        $this->assertEquals('value',$options->getValue('key'));
        $this->assertNotEquals('value2',$options->getValue('key'));
    }
    function testSaveValues(){
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->setValue('key','value');
        $options->setValue('key2','value2');
        $options->save();
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->init();
        $this->assertEquals('value',$options->getValue('key'));
        $this->assertEquals('value2',$options->getValue('key2'));
    }
    function testAddSaveAddValues(){
        $option= new Option();
        $option->setKey('key');
        $option->setDefaultValue('value');
        $option->setType('string');
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->add($option);
        $options->updateValue('key','value2');
        $options->save();
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $option= new Option();
        $option->setKey('key');
        $option->setDefaultValue('value');
        $option->setType('string');
        $options->add($option);
        $options->init();
        $this->assertEquals('value2',$options->get('key')->getValue());
        $this->assertEquals('value',$options->get('key')->getDefaultValue());
    }
    function testAddSaveInitAddValues(){
        $option= new Option();
        $option->setKey('key');
        $option->setDefaultValue('value');
        $option->setType('string');
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $options->add($option);
        $options->updateValue('key','value2');
        $options->save();
        $wpoptions = new WpOptions('test');
        $options = new Options('test',$wpoptions);
        $option= new Option();
        $option->setKey('key');
        $option->setDefaultValue('value');
        $option->setType('string');
        $options->init();
        $options->add($option);
        $this->assertEquals('value2',$options->get('key')->getValue());
        $this->assertEquals('value',$options->get('key')->getDefaultValue());
    }
}


text:
package com.querins.StockMarket.model;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by roman on 25.08.17.
 */
@Entity
public class Quote {

    @Id
    long Id;

    @Column(nullable = false, updatable = false)
    private BigDecimal price;

    @Basic(optional = false)
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_time", nullable = false, updatable = false)
    private Date date;

    @ManyToOne(fetch = FetchType.EAGER, targetEntity = Stock.class)
    @JoinColumn(name="stock_id")
    private Stock stock;

    private Quote() {}

    public Quote(Stock stock, BigDecimal price) {
        this.price = price;
        this.stock = stock;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public Stock getStock() {
        return stock;
    }
}

redpajama_set_name: RedPajamaGithub


text:
const mongoose = require('mongoose');
const moment = require('moment-timezone');
const get = require('lodash.get');
const set = require('lodash.set');

const findPaths = (schema, options) => {
  const SchemaDate = mongoose.Schema.Types.Date;
  return Object.keys(schema.paths).filter((path) => {
    if (options.paths.length) return options.paths.indexOf(path) !== -1;
    return schema.paths[path] instanceof SchemaDate;
  });
};

/**
 *
 * @param {Object} schema
 * @param {Object} options Options object
 * @param {String[]} options.paths Schema paths
 */
module.exports = function timeZone(schema, options = {}) {
  options = Object.assign(options, {
    paths: [],
  });

  const paths = findPaths(schema, options);
  const offset = moment().utcOffset() * 60 * 1000;

  function fixOffset(doc, add) {
    paths.forEach((path) => {
      const date = get(doc, path);
      if (date) {
        const modifier = add ? 1 : -1;
        const fixedOffset = date.valueOf() + (modifier * offset);
        set(doc, path, new Date(fixedOffset));
      }
    });
  }

  function addOffset(next) {
    if (!this) return next();
    fixOffset(this, true);
    next();
  }

  function subtractOffset(docs, next) {
    const documents = [];

    if (!docs) return next();

    if (!Array.isArray(docs)) {
      documents.push((docs.constructor.name === 'model') ? docs : this);
    } else {
      documents.push(...docs);
    }
    documents.forEach(result => fixOffset(result, false));
    next();
  }

  schema.pre('save', addOffset);
  schema.pre('findOneAndUpdate', addOffset);

  schema.post('save', subtractOffset);
  schema.post('find', subtractOffset);
  schema.post('findOne', subtractOffset);
  schema.post('findOneAndUpdate', subtractOffset);
};


text:
namespace shell {

class ServiceManager;

mojo::ScopedMessagePipeHandle ConnectToInterfaceByName(
    ServiceManager* service_manager,
    const Identity& source,
    const Identity& target,
    const std::string& interface_name);

// Must only be used by Service Manager internals and test code as it does not
// forward capability filters. Runs |name| with a permissive capability filter.
template <typename Interface>
inline void ConnectToInterface(ServiceManager* service_manager,
                               const Identity& source,
                               const Identity& target,
                               mojo::InterfacePtr<Interface>* ptr) {
  mojo::ScopedMessagePipeHandle service_handle =
      ConnectToInterfaceByName(service_manager, source, target,
                               Interface::Name_);
  ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(service_handle), 0u));
}

template <typename Interface>
inline void ConnectToInterface(ServiceManager* service_manager,
                               const Identity& source,
                               const std::string& name,
                               mojo::InterfacePtr<Interface>* ptr) {
  mojo::ScopedMessagePipeHandle service_handle = ConnectToInterfaceByName(
      service_manager, source, Identity(name, mojom::kInheritUserID),
      Interface::Name_);
  ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(service_handle), 0u));
}

}  // namespace shell

#endif  // SERVICES_SHELL_CONNECT_UTIL_H_


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Microsoft.WindowsMobile.Configuration</name>
    </assembly>
    <members>
        <member name="T:Microsoft.WindowsMobile.Configuration.ConfigurationManager">

            Provides methods for sending device configuration files to Configuration Manager for either complete processing, or just for testing.

        </member>
        <member name="M:Microsoft.WindowsMobile.Configuration.ConfigurationManager.#ctor">

            The private constructor for the ConfigurationManager class. This ensure that new ConfigurationManager objects are not instantiated from the public default constructor.

        </member>
        <member name="M:Microsoft.WindowsMobile.Configuration.ConfigurationManager.ProcessConfiguration(System.Xml.XmlDocument,System.Boolean)">

            Sends a device configuration file to Configuration Manager for processing.

            <param name="configDoc">The configuration document used to provision the device.</param>
            <param name="metadata">true to return metadata associated with the XML parm elements
            in the new configuration; otherwise, false.</param>
            <returns>metadata associated with the XML parm elements in this configuration.</returns>
        </member>
        <member name="M:Microsoft.WindowsMobile.Configuration.ConfigurationManager.TestConfiguration(System.Xml.XmlDocument,System.Boolean)">

            Sends a device configuration file to Configuration Manager for testing.

            <remarks>
            Configuration Manager will not process the configuration file, but it can still return useful metadata associated with the XML parm elements.
            </remarks>
            <param name="configDoc">The configuration document used to provision the device.</param>
            <param name="metadata">true to return metadata associated with the XML parm elements
            in the new configuration; otherwise, false.</param>
            <returns>metadata associated with the XML parm elements in this configuration.</returns>
        </member>
        <member name="M:Microsoft.WindowsMobile.Configuration.ConfigurationManager.MainConfigurator(System.Xml.XmlDocument,System.UInt32)">

            MainConfigurator calls DMProcessConfigXML directly, and manages the memory allocation of the result.

            <param name="configDoc">XMLDocument that will be used.</param>
            <param name="flags">Uses same flags as DMProcessConfigXML</param>
            <returns></returns>
        </member>
    </members>
</doc>


text:
void init_rand()
{
	srand(time(0));
	for (size_t i = 0; i < 8; ++i) { rand(); }
}

bool init_redis()
{
	redisdao::ref().set_ip(config::ref().redis_ip());
	redisdao::ref().set_port((uint16_t)str2int(config::ref().redis_port()));
	return redisdao::ref().connect();
}

int main(int argc, char* argv[])
{
	create_pid_file();
	set_rlimit();

	if (!logger::ref().init("s_dispatcher", "./"))
	{
		logcritical("init logger error");
		return -1;
	}

	init_rand();

	if (!config::ref().init("../config/config.xml"))
	{
		logcritical("init config error");
		return -1;
	}
	set_logger_level((logger_level)config::ref().logger_level());

	if (!init_redis())
	{
		logcritical("cannot init redis");
		return -1;
	}

	boost::asio::io_service io_service;
	global_io_service::ref().init(io_service);

	job_scheduler::ref().init();

	const std::string& ip = config::ref().listen_ip();
	const std::string& port = config::ref().listen_port();

	dispatcher s(io_service, ip, port);

	io_service.run();

	return 0;
}


text:
namespace clang {
namespace tidy {
namespace abseil {

/// Checks for casts of ``absl::Duration`` conversion functions, and recommends
/// the right conversion function instead.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-conversion-cast.html
class DurationConversionCastCheck : public ClangTidyCheck {
public:
  DurationConversionCastCheck(StringRef Name, ClangTidyContext *Context)
      : ClangTidyCheck(Name, Context) {}
  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};

} // namespace abseil
} // namespace tidy
} // namespace clang

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCONVERSIONCASTCHECK_H


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

namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway
{
    using System.Management.Automation;
    using WindowsAzure.Management.Network.Models;

    [Cmdlet(VerbsCommon.Resize, "AzureVNetGateway"), OutputType(typeof(GatewayGetOperationStatusResponse))]
    public class ResizeAzureVNetGateway : NetworkCmdletBase
    {
        [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network name.")]
        public string VNetName
        {
            get; set;
        }

        [Parameter(Position = 1, Mandatory = true, HelpMessage = "The SKU that the existing gateway will be resized to.")]
        public string GatewaySKU
        {
            get; set;
        }

        public override void ExecuteCmdlet()
        {
            WriteObject(Client.ResizeGateway(VNetName, GatewaySKU));
        }
    }
}


text:
import {
  CheckEmailRequest,
  CheckEmailResponse,
  GetInstitutionsResponse,
  GetPublicInstitutionDetailsResponse,
  Institution,
  InstitutionApi,
  InstitutionMembershipRequirement,
  OrganizationType,
} from 'generated/fetch';

import { AccessTierShortNames } from 'app/utils/access-tiers';
import { getTierConfig } from 'app/utils/institutions';

import { stubNotImplementedError } from 'testing/stubs/stub-utils';

export const VUMC: Institution = {
  shortName: 'VUMC',
  displayName: 'Vanderbilt University Medical Center',
  organizationTypeEnum: OrganizationType.HEALTHCENTERNONPROFIT,
  tierConfigs: [
    {
      accessTierShortName: 'registered',
      membershipRequirement: InstitutionMembershipRequirement.DOMAINS,
      eraRequired: true,
      emailDomains: ['vumc.org'],
    },
  ],
  userInstructions: 'Vanderbilt User Instruction',
};

export const BROAD_ADDR_1 = 'contactEmail@broadinstitute.org';
export const BROAD_ADDR_2 = 'broad_institution@broadinstitute.org';
export const BROAD: Institution = {
  shortName: 'Broad',
  displayName: 'Broad Institute',
  organizationTypeEnum: OrganizationType.ACADEMICRESEARCHINSTITUTION,
  tierConfigs: [
    {
      accessTierShortName: 'registered',
      membershipRequirement: InstitutionMembershipRequirement.ADDRESSES,
      eraRequired: true,
      emailAddresses: [BROAD_ADDR_1, BROAD_ADDR_2],
    },
  ],
};

export const VERILY: Institution = {
  shortName: 'Verily',
  displayName: 'Verily LLC',
  organizationTypeEnum: OrganizationType.INDUSTRY,
  tierConfigs: [
    {
      accessTierShortName: 'registered',
      membershipRequirement: InstitutionMembershipRequirement.DOMAINS,
      eraRequired: true,
      emailDomains: ['verily.com', 'google.com'],
    },
    {
      accessTierShortName: 'controlled',
      membershipRequirement: InstitutionMembershipRequirement.ADDRESSES,
      eraRequired: true,
      emailAddresses: ['foo@verily.com'],
    },
  ],
  userInstructions: 'Verily User Instruction',
};

export const VERILY_WITHOUT_CT: Institution = {
  shortName: 'Non CT Access',
  displayName: 'Non CT Access',
  organizationTypeEnum: OrganizationType.INDUSTRY,
  tierConfigs: [
    {
      accessTierShortName: 'registered',
      membershipRequirement: InstitutionMembershipRequirement.DOMAINS,
      eraRequired: true,
      emailDomains: ['verily.com', 'google.com'],
    },
  ],
  userInstructions: 'Verily User Instruction',
};

export const defaultInstitutions: Array<Institution> = [
  VUMC,
  BROAD,
  VERILY,
  VERILY_WITHOUT_CT,
];

export class InstitutionApiStub extends InstitutionApi {
  public institutions: Array<Institution>;

  constructor(institutions: Array<Institution> = defaultInstitutions) {
    super(undefined, undefined, (..._: any[]) => {
      throw stubNotImplementedError;
    });

    this.institutions = institutions;
  }

  createInstitution(institution: Institution): Promise<Institution> {
    return new Promise<Institution>((resolve) => {
      this.institutions.push(institution);
      resolve(institution);
    });
  }

  deleteInstitution(shortName: string): Promise<Response> {
    return new Promise<Response>((resolve) => {
      this.institutions = this.institutions.filter((institution) => {
        return institution.shortName !== shortName;
      });
      resolve(new Response());
    });
  }

  getInstitution(shortName: string): Promise<Institution> {
    return new Promise((resolve, reject) => {
      const institution = this.institutions.find(
        (x) => x.shortName === shortName
      );
      if (institution) {
        resolve(institution);
      } else {
        reject(new Response('No institution found', { status: 404 }));
      }
    });
  }

  getInstitutions(): Promise<GetInstitutionsResponse> {
    return new Promise((resolve) => {
      const institution = { institutions: this.institutions };
      resolve(institution);
    });
  }

  getPublicInstitutionDetails(): Promise<GetPublicInstitutionDetailsResponse> {
    return new Promise((resolve) => {
      resolve({
        institutions: this.institutions.map((x) => {
          return {
            shortName: x.shortName,
            displayName: x.displayName,
            organizationTypeEnum: x.organizationTypeEnum,
            registeredTierMembershipRequirement: getTierConfig(
              x,
              AccessTierShortNames.Registered
            ).membershipRequirement,
          };
        }),
      });
    });
  }

  updateInstitution(
    shortName: string,
    institution: Institution
  ): Promise<Institution> {
    return new Promise((resolve) => {
      this.institutions = this.institutions.filter(
        (x) => x.shortName !== shortName
      );
      this.institutions.push(institution);
      resolve(institution);
    });
  }

  async checkEmail(
    shortName: string,
    request: CheckEmailRequest
  ): Promise<CheckEmailResponse> {
    const { contactEmail } = request;
    const domain = contactEmail.substring(contactEmail.lastIndexOf('@') + 1);

    const institution = this.institutions.find(
      (x) => x.shortName === shortName
    );
    if (!institution) {
      throw new Response('No institution found', { status: 404 });
    }

    const response: CheckEmailResponse = {
      isValidMember: false,
    };
    const tierConfig = getTierConfig(
      institution,
      AccessTierShortNames.Registered
    );
    if (
      tierConfig.membershipRequirement ===
        InstitutionMembershipRequirement.ADDRESSES &&
      tierConfig.emailAddresses.includes(contactEmail)
    ) {
      response.isValidMember = true;
    } else if (
      tierConfig.membershipRequirement ===
        InstitutionMembershipRequirement.DOMAINS &&
      tierConfig.emailDomains.includes(domain)
    ) {
      response.isValidMember = true;
    }
    return response;
  }
}


text:
namespace net {

//-----------------------------------------------------------------------------

HostCache::Entry::Entry(int error, const AddressList& addrlist,
                        base::TimeDelta ttl)
    : error(error),
      addrlist(addrlist),
      ttl(ttl) {
  DCHECK(ttl >= base::TimeDelta());
}

HostCache::Entry::Entry(int error, const AddressList& addrlist)
    : error(error),
      addrlist(addrlist),
      ttl(base::TimeDelta::FromSeconds(-1)) {
}

HostCache::Entry::~Entry() {
}

//-----------------------------------------------------------------------------

HostCache::HostCache(size_t max_entries)
    : entries_(max_entries) {
}

HostCache::~HostCache() {
}

const HostCache::Entry* HostCache::Lookup(const Key& key,
                                          base::TimeTicks now) {
  DCHECK(CalledOnValidThread());
  if (caching_is_disabled())
    return NULL;

  return entries_.Get(key, now);
}

void HostCache::Set(const Key& key,
                    const Entry& entry,
                    base::TimeTicks now,
                    base::TimeDelta ttl) {
  DCHECK(CalledOnValidThread());
  if (caching_is_disabled())
    return;

  entries_.Put(key, entry, now, now + ttl);
}

void HostCache::clear() {
  DCHECK(CalledOnValidThread());
  entries_.Clear();
}

size_t HostCache::size() const {
  DCHECK(CalledOnValidThread());
  return entries_.size();
}

size_t HostCache::max_entries() const {
  DCHECK(CalledOnValidThread());
  return entries_.max_entries();
}

// Note that this map may contain expired entries.
const HostCache::EntryMap& HostCache::entries() const {
  DCHECK(CalledOnValidThread());
  return entries_;
}

// static
scoped_ptr<HostCache> HostCache::CreateDefaultCache() {
#if defined(OS_CHROMEOS)
  // Increase HostCache size for the duration of the async DNS field trial.
  // http://crbug.com/143454
  // TODO(szym): Determine the best size. http://crbug.com/114277
  static const size_t kMaxHostCacheEntries = 1000;
#else
  static const size_t kMaxHostCacheEntries = 100;
#endif
  return make_scoped_ptr(new HostCache(kMaxHostCacheEntries));
}

}  // namespace net


text:
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700|Open+Sans:400,700&subset=latin,latin-ext);

body {font-family: 'Open Sans', Arial, sans-serif; font-size: 13px; background-color: #fff;}
a, a:hover, a:active, a:focus {text-decoration: none; outline: 0;}

.buttons:before, .buttons:after {content: ''; display: table;}
.buttons {text-align: right; margin: 20px 0;}

.share-box:before, .share-box:after {content: " "; display: table;}
.share-box {border-top: 1px dotted #ccc; padding-top: 15px; margin-top: 20px; margin-bottom: 20px;}
.share-box p {margin-bottom: 5px;}
.share-box > a {text-indent: -9999px; display: inline-block; margin-right: 5px;}
.share-box > a.facebook {background: url(../img/share-facebook.png) no-repeat; width: 88px; height: 25px;}
.share-box > a.twitter {background: url(../img/share-twitter.png) no-repeat; width: 79px; height: 25px;}
.share-box > a.google {background: url(../img/share-google.png) no-repeat; width: 67px; height: 25px;}


text:
local gamedata = {} -- Gamedata library object.

local db = {} -- Database storing all created data.
local gdb = {} -- Grouped databases are entered into this table.

-- Add a new gamedata entry with a new and an optional group.
function gamedata.insert(name, data, group)
	if not db[name] then
		db[name] = data

		if group then
			if gdb[group] then
				if not gdb[group][name] then
					gdb[group][name] = db[name]
				end
			else
				gdb[group] = {}
				gdb[group][name] = db[name]
			end
		end
	else
		print("Gamedata: The gamedata entry with the name of '" ..name .."' already exists.")
	end
end

-- Clear a gamedata entry by it's name.
function gamedata.clear(name)
	if db[name] then
		db[name] = nil
	else
		print("Gamedata: The gamedata entry with the name of '" ..name .."' was not found or might already be unloaded.")
	end

	collectgarbage()
end

-- Remove an entire gamedata group.
function gamedata.clearGroup(gname)
	if gdb[gname] then
		for k, v in pairs(gdb[gname]) do
			db[k] = nil
			gdb[gname][k] = nil
		end

		gdb[gname] = nil
	else
		print("Gamedata: The gamedata group entry with the name of '" ..gname .."' was not found or might already be unloaded.")
	end

	collectgarbage()
end

-- Wipe the entire database.
function gamedata.wipe()
	for i, v in pairs(gdb) do
		gdb[i] = nil
	end

	for i, v in pairs(db) do
		db[i] = nil
	end

	collectgarbage()
end

-- Get the data from an entry name within the database.
function gamedata.get(name)
	if(db[name] ~= nil) then
		return db[name]
	else
		print("Gamedata: The gamedata entry with the name of '" ..name .."' was not found. Make sure it has been loaded before accessing it.")
	end
end

return gamedata


text:
namespace Microsoft.Azure.Batch
{
    using Models = Microsoft.Azure.Batch.Protocol.Models;
    using System;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Represents a certificate object of the Azure Batch service.
    /// </summary>
    public partial class CertificateReference : ITransportObjectProvider<Models.CertificateReference>, IPropertyMetadata
    {
        private class PropertyContainer : PropertyCollection
        {
            public readonly PropertyAccessor<Common.CertStoreLocation?> StoreLocationProperty;
            public readonly PropertyAccessor<string> StoreNameProperty;
            public readonly PropertyAccessor<string> ThumbprintProperty;
            public readonly PropertyAccessor<string> ThumbprintAlgorithmProperty;
            public readonly PropertyAccessor<Common.CertificateVisibility?> VisibilityProperty;

            public PropertyContainer() : base(BindingState.Unbound)
            {
                this.StoreLocationProperty = this.CreatePropertyAccessor<Common.CertStoreLocation?>(nameof(StoreLocation), BindingAccess.Read | BindingAccess.Write);
                this.StoreNameProperty = this.CreatePropertyAccessor<string>(nameof(StoreName), BindingAccess.Read | BindingAccess.Write);
                this.ThumbprintProperty = this.CreatePropertyAccessor<string>(nameof(Thumbprint), BindingAccess.Read | BindingAccess.Write);
                this.ThumbprintAlgorithmProperty = this.CreatePropertyAccessor<string>(nameof(ThumbprintAlgorithm), BindingAccess.Read | BindingAccess.Write);
                this.VisibilityProperty = this.CreatePropertyAccessor<Common.CertificateVisibility?>(nameof(Visibility), BindingAccess.Read | BindingAccess.Write);
            }

            public PropertyContainer(Models.CertificateReference protocolObject) : base(BindingState.Bound)
            {
                this.StoreLocationProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.MapNullableEnum<Models.CertificateStoreLocation, Common.CertStoreLocation>(protocolObject.StoreLocation),
                    nameof(StoreLocation),
                    BindingAccess.Read | BindingAccess.Write);
                this.StoreNameProperty = this.CreatePropertyAccessor(
                    protocolObject.StoreName,
                    nameof(StoreName),
                    BindingAccess.Read | BindingAccess.Write);
                this.ThumbprintProperty = this.CreatePropertyAccessor(
                    protocolObject.Thumbprint,
                    nameof(Thumbprint),
                    BindingAccess.Read | BindingAccess.Write);
                this.ThumbprintAlgorithmProperty = this.CreatePropertyAccessor(
                    protocolObject.ThumbprintAlgorithm,
                    nameof(ThumbprintAlgorithm),
                    BindingAccess.Read | BindingAccess.Write);
                this.VisibilityProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.ParseCertificateVisibility(protocolObject.Visibility),
                    nameof(Visibility),
                    BindingAccess.Read | BindingAccess.Write);
            }
        }

        private readonly PropertyContainer propertyContainer;

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CertificateReference"/> class.
        /// </summary>
        public CertificateReference()
        {
            this.propertyContainer = new PropertyContainer();
        }

        internal CertificateReference(Models.CertificateReference protocolObject)
        {
            this.propertyContainer = new PropertyContainer(protocolObject);
        }

        #endregion Constructors

        #region CertificateReference

        /// <summary>
        /// Gets or sets the <see cref="Common.CertStoreLocation"/> for the certificate.
        /// </summary>
        public Common.CertStoreLocation? StoreLocation
        {
            get { return this.propertyContainer.StoreLocationProperty.Value; }
            set { this.propertyContainer.StoreLocationProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets the name of the name of the certificate store. Besides <see cref="System.Security.Cryptography.X509Certificates.StoreName"/>
        /// the value can have a custom store name.
        /// </summary>
        public string StoreName
        {
            get { return this.propertyContainer.StoreNameProperty.Value; }
            set { this.propertyContainer.StoreNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets the certificate thumbprint property of the certificate.
        /// </summary>
        public string Thumbprint
        {
            get { return this.propertyContainer.ThumbprintProperty.Value; }
            set { this.propertyContainer.ThumbprintProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets the certificate thumbprint algorithm. Currently sha1 is the only supported algorithm.
        /// </summary>
        public string ThumbprintAlgorithm
        {
            get { return this.propertyContainer.ThumbprintAlgorithmProperty.Value; }
            set { this.propertyContainer.ThumbprintAlgorithmProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets the set of users that can get to the private data of the installed certificate.
        /// </summary>
        public Common.CertificateVisibility? Visibility
        {
            get { return this.propertyContainer.VisibilityProperty.Value; }
            set { this.propertyContainer.VisibilityProperty.Value = value; }
        }

        #endregion // CertificateReference

        #region IPropertyMetadata

        bool IModifiable.HasBeenModified
        {
            get { return this.propertyContainer.HasBeenModified; }
        }

        bool IReadOnly.IsReadOnly
        {
            get { return this.propertyContainer.IsReadOnly; }
            set { this.propertyContainer.IsReadOnly = value; }
        }

        #endregion //IPropertyMetadata

        #region Internal/private methods
        /// <summary>
        /// Return a protocol object of the requested type.
        /// </summary>
        /// <returns>The protocol object of the requested type.</returns>
        Models.CertificateReference ITransportObjectProvider<Models.CertificateReference>.GetTransportObject()
        {
            Models.CertificateReference result = new Models.CertificateReference()
            {
                StoreLocation = UtilitiesInternal.MapNullableEnum<Common.CertStoreLocation, Models.CertificateStoreLocation>(this.StoreLocation),
                StoreName = this.StoreName,
                Thumbprint = this.Thumbprint,
                ThumbprintAlgorithm = this.ThumbprintAlgorithm,
                Visibility = UtilitiesInternal.CertificateVisibilityToList(this.Visibility),
            };

            return result;
        }

        /// <summary>
        /// Converts a collection of protocol layer objects to object layer collection objects.
        /// </summary>
        internal static IList<CertificateReference> ConvertFromProtocolCollection(IEnumerable<Models.CertificateReference> protoCollection)
        {
            ConcurrentChangeTrackedModifiableList<CertificateReference> converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable(
                items: protoCollection,
                objectCreationFunc: o => new CertificateReference(o));

            return converted;
        }

        /// <summary>
        /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state.
        /// </summary>
        internal static IList<CertificateReference> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.CertificateReference> protoCollection)
        {
            ConcurrentChangeTrackedModifiableList<CertificateReference> converted = UtilitiesInternal.CollectionToThreadSafeCollectionIModifiable(
                items: protoCollection,
                objectCreationFunc: o => new CertificateReference(o).Freeze());

            converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze());

            return converted;
        }

        /// <summary>
        /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked readonly
        /// and returned as a readonly collection.
        /// </summary>
        internal static IReadOnlyList<CertificateReference> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.CertificateReference> protoCollection)
        {
            IReadOnlyList<CertificateReference> converted =
                UtilitiesInternal.CreateObjectWithNullCheck(
                    UtilitiesInternal.CollectionToNonThreadSafeCollection(
                        items: protoCollection,
                        objectCreationFunc: o => new CertificateReference(o).Freeze()), o => o.AsReadOnly());

            return converted;
        }

        #endregion // Internal/private methods
    }
}


text:
<?php

namespace QueryTranslator\Languages\Galach\Values\Token;

use QueryTranslator\Languages\Galach\Tokenizer;
use QueryTranslator\Values\Token;

/**
 * Phrase term token.
 *
 * @see \QueryTranslator\Languages\Galach\Tokenizer::TOKEN_TERM
 */
final class Phrase extends Token
{
    /**
     * Holds domain identifier or null if not set.
     *
     * @var null|string
     */
    public $domain;

    /**
     * @var string
     */
    public $quote;

    /**
     * @var string
     */
    public $phrase;

    /**
     * @param string $lexeme
     * @param int $position
     * @param string $domain
     * @param string $quote
     * @param string $phrase
     */
    public function __construct($lexeme, $position, $domain, $quote, $phrase)
    {
        $this->domain = $domain;
        $this->quote = $quote;
        $this->phrase = $phrase;

        parent::__construct(Tokenizer::TOKEN_TERM, $lexeme, $position);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="languages" translatable="false">
        <item>English (English)</item>
        <item>Русский (Russian)</item>
        <item>Українська (Ukrainian)</item>
    </string-array>

    <string-array name="languages_codes" translatable="false">
        <item>en_US</item>
        <item>ru_RU</item>
        <item>uk_UA</item>
    </string-array>
</resources>


text:
package org.assertj.core.api.map;

import org.assertj.core.api.MapAssert;
import org.assertj.core.api.MapAssertBaseTest;

import static org.mockito.Mockito.verify;

/**
 * Tests for <code>{@link MapAssert#doesNotContainKey(Object)}</code>.
 *
 * @author Nicolas François
 */
public class MapAssert_doesNotContainKey_Test extends MapAssertBaseTest {

  @Override
  protected MapAssert<Object, Object> invoke_api_method() {
    return assertions.doesNotContainKey("key1");
  }

  @Override
  protected void verify_internal_effects() {
    verify(maps).assertDoesNotContainKeys(getInfo(assertions), getActual(assertions), "key1");
  }
}


text:
#ifndef DATE_H
#define DATE_H

#include <math.h>

#include "fmgr.h"

typedef int32 DateADT;

#ifdef HAVE_INT64_TIMESTAMP
typedef int64 TimeADT;
#else
typedef float8 TimeADT;
#endif

typedef struct
{
	TimeADT		time;			/* all time units other than months and years */
	int32		zone;			/* numeric time zone, in seconds */
} TimeTzADT;

/*
 * Infinity and minus infinity must be the max and min values of DateADT.
 * We could use INT_MIN and INT_MAX here, but seems better to not assume that
 * int32 == int.
 */
#define DATEVAL_NOBEGIN		((DateADT) (-0x7fffffff - 1))
#define DATEVAL_NOEND		((DateADT) 0x7fffffff)

#define DATE_NOBEGIN(j)		((j) = DATEVAL_NOBEGIN)
#define DATE_IS_NOBEGIN(j)	((j) == DATEVAL_NOBEGIN)
#define DATE_NOEND(j)		((j) = DATEVAL_NOEND)
#define DATE_IS_NOEND(j)	((j) == DATEVAL_NOEND)
#define DATE_NOT_FINITE(j)	(DATE_IS_NOBEGIN(j) || DATE_IS_NOEND(j))

/*
 * Macros for fmgr-callable functions.
 *
 * For TimeADT, we make use of the same support routines as for float8 or int64.
 * Therefore TimeADT is pass-by-reference if and only if float8 or int64 is!
 */
#ifdef HAVE_INT64_TIMESTAMP

#define MAX_TIME_PRECISION 6

#define DatumGetDateADT(X)	  ((DateADT) DatumGetInt32(X))
#define DatumGetTimeADT(X)	  ((TimeADT) DatumGetInt64(X))
#define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))

#define DateADTGetDatum(X)	  Int32GetDatum(X)
#define TimeADTGetDatum(X)	  Int64GetDatum(X)
#define TimeTzADTPGetDatum(X) PointerGetDatum(X)
#else							/* !HAVE_INT64_TIMESTAMP */

#define MAX_TIME_PRECISION 10

/* round off to MAX_TIME_PRECISION decimal places */
#define TIME_PREC_INV 10000000000.0
#define TIMEROUND(j) (rint(((double) (j)) * TIME_PREC_INV) / TIME_PREC_INV)

#define DatumGetDateADT(X)	  ((DateADT) DatumGetInt32(X))
#define DatumGetTimeADT(X)	  ((TimeADT) DatumGetFloat8(X))
#define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))

#define DateADTGetDatum(X)	  Int32GetDatum(X)
#define TimeADTGetDatum(X)	  Float8GetDatum(X)
#define TimeTzADTPGetDatum(X) PointerGetDatum(X)
#endif   /* HAVE_INT64_TIMESTAMP */

#define PG_GETARG_DATEADT(n)	 DatumGetDateADT(PG_GETARG_DATUM(n))
#define PG_GETARG_TIMEADT(n)	 DatumGetTimeADT(PG_GETARG_DATUM(n))
#define PG_GETARG_TIMETZADT_P(n) DatumGetTimeTzADTP(PG_GETARG_DATUM(n))

#define PG_RETURN_DATEADT(x)	 return DateADTGetDatum(x)
#define PG_RETURN_TIMEADT(x)	 return TimeADTGetDatum(x)
#define PG_RETURN_TIMETZADT_P(x) return TimeTzADTPGetDatum(x)

/* date.c */
extern double date2timestamp_no_overflow(DateADT dateVal);

extern Datum date_in(PG_FUNCTION_ARGS);
extern Datum date_out(PG_FUNCTION_ARGS);
extern Datum date_recv(PG_FUNCTION_ARGS);
extern Datum date_send(PG_FUNCTION_ARGS);
extern Datum date_eq(PG_FUNCTION_ARGS);
extern Datum date_ne(PG_FUNCTION_ARGS);
extern Datum date_lt(PG_FUNCTION_ARGS);
extern Datum date_le(PG_FUNCTION_ARGS);
extern Datum date_gt(PG_FUNCTION_ARGS);
extern Datum date_ge(PG_FUNCTION_ARGS);
extern Datum date_cmp(PG_FUNCTION_ARGS);
extern Datum date_finite(PG_FUNCTION_ARGS);
extern Datum date_larger(PG_FUNCTION_ARGS);
extern Datum date_smaller(PG_FUNCTION_ARGS);
extern Datum date_mi(PG_FUNCTION_ARGS);
extern Datum date_pli(PG_FUNCTION_ARGS);
extern Datum date_mii(PG_FUNCTION_ARGS);
extern Datum date_eq_timestamp(PG_FUNCTION_ARGS);
extern Datum date_ne_timestamp(PG_FUNCTION_ARGS);
extern Datum date_lt_timestamp(PG_FUNCTION_ARGS);
extern Datum date_le_timestamp(PG_FUNCTION_ARGS);
extern Datum date_gt_timestamp(PG_FUNCTION_ARGS);
extern Datum date_ge_timestamp(PG_FUNCTION_ARGS);
extern Datum date_cmp_timestamp(PG_FUNCTION_ARGS);
extern Datum date_eq_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_ne_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_lt_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_le_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_gt_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_ge_timestamptz(PG_FUNCTION_ARGS);
extern Datum date_cmp_timestamptz(PG_FUNCTION_ARGS);
extern Datum timestamp_eq_date(PG_FUNCTION_ARGS);
extern Datum timestamp_ne_date(PG_FUNCTION_ARGS);
extern Datum timestamp_lt_date(PG_FUNCTION_ARGS);
extern Datum timestamp_le_date(PG_FUNCTION_ARGS);
extern Datum timestamp_gt_date(PG_FUNCTION_ARGS);
extern Datum timestamp_ge_date(PG_FUNCTION_ARGS);
extern Datum timestamp_cmp_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_eq_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_ne_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_lt_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_le_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_gt_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_ge_date(PG_FUNCTION_ARGS);
extern Datum timestamptz_cmp_date(PG_FUNCTION_ARGS);
extern Datum date_pl_interval(PG_FUNCTION_ARGS);
extern Datum date_mi_interval(PG_FUNCTION_ARGS);
extern Datum date_timestamp(PG_FUNCTION_ARGS);
extern Datum timestamp_date(PG_FUNCTION_ARGS);
extern Datum date_timestamptz(PG_FUNCTION_ARGS);
extern Datum timestamptz_date(PG_FUNCTION_ARGS);
extern Datum datetime_timestamp(PG_FUNCTION_ARGS);
extern Datum abstime_date(PG_FUNCTION_ARGS);

extern Datum time_in(PG_FUNCTION_ARGS);
extern Datum time_out(PG_FUNCTION_ARGS);
extern Datum time_recv(PG_FUNCTION_ARGS);
extern Datum time_send(PG_FUNCTION_ARGS);
extern Datum timetypmodin(PG_FUNCTION_ARGS);
extern Datum timetypmodout(PG_FUNCTION_ARGS);
extern Datum time_scale(PG_FUNCTION_ARGS);
extern Datum time_eq(PG_FUNCTION_ARGS);
extern Datum time_ne(PG_FUNCTION_ARGS);
extern Datum time_lt(PG_FUNCTION_ARGS);
extern Datum time_le(PG_FUNCTION_ARGS);
extern Datum time_gt(PG_FUNCTION_ARGS);
extern Datum time_ge(PG_FUNCTION_ARGS);
extern Datum time_cmp(PG_FUNCTION_ARGS);
extern Datum time_hash(PG_FUNCTION_ARGS);
extern Datum overlaps_time(PG_FUNCTION_ARGS);
extern Datum time_larger(PG_FUNCTION_ARGS);
extern Datum time_smaller(PG_FUNCTION_ARGS);
extern Datum time_mi_time(PG_FUNCTION_ARGS);
extern Datum timestamp_time(PG_FUNCTION_ARGS);
extern Datum timestamptz_time(PG_FUNCTION_ARGS);
extern Datum time_interval(PG_FUNCTION_ARGS);
extern Datum interval_time(PG_FUNCTION_ARGS);
extern Datum time_pl_interval(PG_FUNCTION_ARGS);
extern Datum time_mi_interval(PG_FUNCTION_ARGS);
extern Datum time_part(PG_FUNCTION_ARGS);

extern Datum timetz_in(PG_FUNCTION_ARGS);
extern Datum timetz_out(PG_FUNCTION_ARGS);
extern Datum timetz_recv(PG_FUNCTION_ARGS);
extern Datum timetz_send(PG_FUNCTION_ARGS);
extern Datum timetztypmodin(PG_FUNCTION_ARGS);
extern Datum timetztypmodout(PG_FUNCTION_ARGS);
extern Datum timetz_scale(PG_FUNCTION_ARGS);
extern Datum timetz_eq(PG_FUNCTION_ARGS);
extern Datum timetz_ne(PG_FUNCTION_ARGS);
extern Datum timetz_lt(PG_FUNCTION_ARGS);
extern Datum timetz_le(PG_FUNCTION_ARGS);
extern Datum timetz_gt(PG_FUNCTION_ARGS);
extern Datum timetz_ge(PG_FUNCTION_ARGS);
extern Datum timetz_cmp(PG_FUNCTION_ARGS);
extern Datum timetz_hash(PG_FUNCTION_ARGS);
extern Datum overlaps_timetz(PG_FUNCTION_ARGS);
extern Datum timetz_larger(PG_FUNCTION_ARGS);
extern Datum timetz_smaller(PG_FUNCTION_ARGS);
extern Datum timetz_time(PG_FUNCTION_ARGS);
extern Datum time_timetz(PG_FUNCTION_ARGS);
extern Datum timestamptz_timetz(PG_FUNCTION_ARGS);
extern Datum datetimetz_timestamptz(PG_FUNCTION_ARGS);
extern Datum timetz_part(PG_FUNCTION_ARGS);
extern Datum timetz_zone(PG_FUNCTION_ARGS);
extern Datum timetz_izone(PG_FUNCTION_ARGS);
extern Datum timetz_pl_interval(PG_FUNCTION_ARGS);
extern Datum timetz_mi_interval(PG_FUNCTION_ARGS);

#endif   /* DATE_H */


text:
Crops image to user specified coordinates

**plantcv.crop**(*img, x, y, h, w*)

**returns** image after cropping

- **Parameters:**
    - img - RGB, grayscale, or hyperspectral image data
    - x - Starting X coordinate
    - y - Starting Y coordinate
    - h - Height
    - w - Width
- **Context:**
    - Crops image
    - Allows users to avoid splicing arrays with Python code, although Numpy arrays can be cropped with this method as well.

```python

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file),
# or "plot" (Jupyter Notebooks or X11)

pcv.params.debug = "print"

# Crop image
crop_img = pcv.crop(img=img, x=800, y=400, h=1200, w=900)

```

**Debug Crop Image**

![Screenshot](img/documentation_images/crop/crop_debug.jpg)

**Cropped Image**

![Screenshot](img/documentation_images/crop/cropped_img.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/crop.py)


text:
Date: Wed, 20 Nov 1996 22:12:08 GMT
Server: NCSA/1.4.2
Content-type: text/html
Last-modified: Tue, 03 Sep 1996 13:09:13 GMT
Content-length: 1109

<TITLE>Principles of Programming Languages</TITLE>

Principles of Programming Languages

(Computer Science 68)

Times: 97W: 2  98W: Arrange

Instructors: <!WA0>Rebelsky

Prerequisite: Computer Science <!WA1>23. Computer Science <!WA2>25 and <!WA3>37 are recommended.

Dist: TAS

This course provides a study of the principles of programming languages. The course will focus on the
similarities and differences among conventional, functional, logic programming, and object-oriented
languages. Topics include formal definitions of languages, control structures, methods for structuring data,
scoping, types, and functions as first-class data values. For each language category, implementation issues
will be discussed, and program development strategies illustrated through programming exercises.

<!WA4>
<!WA5>Back to Dartmouth CS Home Page


text:
package com.ts.service.information.attached;

import java.util.List;

import com.ts.entity.Page;
import com.ts.util.PageData;

/**
 * 说明: 主附结构接口
 * 创建人:
 * 创建时间:2016-04-17
 * @version
 */
public interface AttachedManager{

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception;

	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception;

	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception;

	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception;

	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception;

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception;

	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception;

}


text:
const config = require("../../index");
const stylelint = require("stylelint");
const postcss = require("postcss");
const scssSyntax = require("postcss-scss");
const test = require("tape");

const invalidScss = (
`.spacebetweenparens {
  @include box-shadow( 0 2px 2px rgba( 0, 0, 0, 0.2 ) );
  color: rgba( 0, 0, 0, 0.1 );
}

@media ( max-width: 300px ) {
  .zerounit {
    margin: 0;
  }
}

@media (max-width: 300px ) {
  .zerounit {
    margin: 0;
  }
}
`)

test("Space between parens scss", t => {
  t.plan(6)

  postcss()
    .use(stylelint({ code: invalidScss, config: config,}))
    .process(invalidScss, { syntax: scssSyntax })
    .then(checkResult)
    .catch(logError)

  function checkResult(result) {
    t.equal(result.warnings().length, 5, "flags 2 warning")
    t.is(result.warnings()[0].text, "Unexpected whitespace after \"(\" (function-parentheses-space-inside)", "correct warning text")
    t.is(result.warnings()[1].text, "Unexpected whitespace before \")\" (function-parentheses-space-inside)", "correct warning text")
    t.is(result.warnings()[2].text, "Unexpected whitespace after \"(\" (media-feature-parentheses-space-inside)", "correct warning text")
    t.is(result.warnings()[3].text, "Unexpected whitespace before \")\" (media-feature-parentheses-space-inside)", "correct warning text")
    t.is(result.warnings()[4].text, "Unexpected whitespace before \")\" (media-feature-parentheses-space-inside)", "correct warning text")
  }
})

function logError(err) {
  console.log(err.stack)
}


text:
/**
 * Created by jessietang on 1/3/2017.
 */
import {Component} from '@angular/core';

import {Hero} from './hero';

@Component({
  moduleId: module.id,
  selector: 'hero-form',
  templateUrl: 'views/hero-form.component.html'
})

export class HeroFormComponent{
  powers = ['Really Smart', 'Super Flexible',
    'Super Hot', 'Weather Changer'];

  heroModel = new Hero(12, 'jessie tang',this.powers[0],'Chuck Overstreet');
  submitted = false;
  onSubmit(){
    this.submitted = true;
  }

  get diagnostic(){
    return JSON.stringify(this.heroModel);
  }

  newHero(){
    this.heroModel = new Hero(13,'','');
  }
}


text:
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
                        unicode_literals, with_statement)

import os
import subprocess

from pants.util.contextutil import temporary_dir
from pants_test.contrib.go.tasks.go_tool import GoTool
from pants_test.pants_run_integration_test import PantsRunIntegrationTest

from pants.contrib.go.tasks.go_task import GoTask

class GoCompileIntegrationTest(PantsRunIntegrationTest):

  def test_go_compile_simple(self):
    with temporary_dir(root_dir=self.workdir_root()) as workdir:
      args = ['compile',
              'contrib/go/examples/src/go/libA']
      pants_run = self.run_pants_with_workdir(args, workdir)
      self.assert_success(pants_run)
      # TODO(jsirois): Kill this check and the GoTool utility by using Go subsystem
      if GoTool.go_installed():
        goos = subprocess.check_output(['go', 'env', 'GOOS']).strip()
        goarch = subprocess.check_output(['go', 'env', 'GOARCH']).strip()
        expected_files = set('contrib.go.examples.src.go.{libname}.{libname}/'
                             'pkg/{goos}_{goarch}/contrib/go/examples/src/go/{libname}.a'
                             .format(libname=libname, goos=goos, goarch=goarch)
                             for libname in ('libA', 'libB', 'libC', 'libD', 'libE'))
        self.assert_contains_exact_files(os.path.join(workdir, 'compile', 'go'),
                                         expected_files)


text:
package org.guvnor.asset.management.backend.social;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;

import org.guvnor.asset.management.backend.social.i18n.Constants;
import org.guvnor.asset.management.social.AssetManagementEventTypes;
import org.guvnor.asset.management.social.RepositoryChangeEvent;
import org.kie.uberfire.social.activities.model.SocialActivitiesEvent;
import org.kie.uberfire.social.activities.model.SocialEventType;
import org.kie.uberfire.social.activities.repository.SocialUserRepository;
import org.kie.uberfire.social.activities.service.SocialAdapter;
import org.kie.uberfire.social.activities.service.SocialCommandTypeFilter;

public class RepositoryChangeEventAdapter implements SocialAdapter<RepositoryChangeEvent> {

    @Inject
    private SocialUserRepository socialUserRepository;

    @Inject
    private Constants constants;

    @Override
    public Class<RepositoryChangeEvent> eventToIntercept() {
        return RepositoryChangeEvent.class;
    }

    @Override
    public SocialEventType socialEventType() {
        return AssetManagementEventTypes.REPOSITORY_CHANGE;
    }

    @Override
    public boolean shouldInterceptThisEvent( Object event ) {
        if ( event.getClass().getSimpleName().equals( eventToIntercept().getSimpleName() ) ) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public SocialActivitiesEvent toSocial( Object object ) {
        RepositoryChangeEvent event = ( RepositoryChangeEvent ) object;

        return new SocialActivitiesEvent(
                socialUserRepository.systemUser(),
                AssetManagementEventTypes.REPOSITORY_CHANGE.name(),
                new Date( event.getTimestamp() )
        )
                .withLink( event.getRepositoryAlias() != null ? event.getRepositoryAlias() : "<unknown>",
                        event.getRootURI() != null ? event.getRootURI() : "<unknown>" )
                .withAdicionalInfo( getAdditionalInfo( event ) );
    }

    @Override
    public List<SocialCommandTypeFilter> getTimelineFilters() {
        return new ArrayList<SocialCommandTypeFilter>();
    }

    @Override
    public List<String> getTimelineFiltersNames() {
        return new ArrayList<String>();
    }

    private String getAdditionalInfo( RepositoryChangeEvent event ) {

        StringBuilder info = new StringBuilder();

        if ( event.getChangeType() == RepositoryChangeEvent.ChangeType.VERSION_CHANGED ) {

            info.append( constants.release_project_version_change_success( event.getRepositoryAlias(),
                    event.getParams().get( "version" )));
        }

        return info.toString();
    }
}


text:
package com.jayantkrish.jklol.tensor;

import com.google.common.base.Preconditions;

public class LogTensorHashAdapter implements TensorHash {
  private static final long serialVersionUID = 1L;

  private final TensorHash tensorHash;

  public LogTensorHashAdapter(TensorHash tensorHash) {
    this.tensorHash = Preconditions.checkNotNull(tensorHash);
  }

  @Override
  public double get(long keyNum) {
    return Math.exp(tensorHash.get(keyNum));
  }
}


text:
<?php

namespace MyCLabs\MUIH\Bridge\ZendViewHelper\Zend2;

use MyCLabs\MUIH\Bridge\ZendViewHelper\Button as ZendButton;

/**
 * @author valentin-mcs
 * @package    MyCLabs\MUIH
 * @subpackage ZendViewHelper\Zend2
 */
class Button extends ZendButton implements Zend\View\Helper\HelperInterface
{
    use Zend2HelperTrait;
}


text:
describe("Given bicycleFinder", function() {

  describe("when calling findBicycle()", function() {
    var bicycle;

    beforeEach(function() {
      bicycle = bicycleFinder.findBicycle("Urban Bike", 16);
    });

    it("then it should return an object", function() {
      expect(bicycle).toBeDefined();
    });

    it("then the 'type' property should be correct", function() {
      expect(bicycle.type).toEqual("Urban Bike");
    });

    it("then the 'rentPrice' property should be correct", function() {
      expect(bicycle.rentPrice).toEqual(15);
    });

  });

  describe("when calling findBicycleById()", function() {
    var bicycle;

    beforeEach(function() {
      bicycle = bicycleFinder.findBicycleById(6);
    });

    it("then it should return an object", function() {
      expect(bicycle).toBeDefined();
    });

    it("then the 'id' property should be correct", function() {
      expect(bicycle.id).toEqual(6);
    });

  });

  describe("when calling hasBicycle()", function() {
    var isFound;

    beforeEach(function() {
      isFound = bicycleFinder.hasBicycle("Urban Bike", 16);
    });

    it("then it should return true", function() {
      expect(isFound).toBe(true);
    });

  });

  describe("when calling hasBicycleWithId()", function() {
    var isFound;

    beforeEach(function() {
      isFound = bicycleFinder.hasBicycleWithId(6);
    });

    it("then it should return true", function() {
      expect(isFound).toBe(true);
    });

  });
});


text:
  Boueilh-Boueilho-Lasque est
       un village
       situé dans le département des Pyrénées-Atlantiques en Aquitaine. Elle comptait 342 habitants en 2008.

La commune compte quelques  aménagements, elle propose entre autres un terrain de tennis et un terrain de sport.

Si vous pensez venir habiter à Boueilh-Boueilho-Lasque, vous pourrez facilement trouver une maison à vendre.

À proximité de Boueilh-Boueilho-Lasque sont situées les communes de
Garlin située à 3 km, 1 264 habitants,
Garlède-Mondebat située à 4 km, 190 habitants,
Lauret à 3 km, 78 habitants,
Méracq à 6 km, 206 habitants,
Claracq à 3 km, 210 habitants,
Lème située à 6 km, 137 habitants,
 entre autres. De plus, Boueilh-Boueilho-Lasque est située à seulement 27 km de Pau.

Le parc d'habitations, à Boueilh-Boueilho-Lasque, se décomposait en 2011 en six appartements et 148 maisons soit
 un marché relativement équilibré.


text:
package org.codehaus.groovy.reflection.stdclasses;

import org.codehaus.groovy.reflection.CachedClass;
import org.codehaus.groovy.reflection.ClassInfo;

public class BooleanCachedClass extends CachedClass {
    private final boolean allowNull;
    public BooleanCachedClass(Class klazz, ClassInfo classInfo, boolean allowNull) {
        super(klazz, classInfo);
        this.allowNull = allowNull;
    }

    @Override
    public boolean isDirectlyAssignable(Object argument) {
        return (allowNull && argument == null) || argument instanceof Boolean;
     }

    @Override
    public boolean isAssignableFrom(Class classToTransformFrom) {
        return (allowNull && classToTransformFrom == null)
              || classToTransformFrom == Boolean.class
              || classToTransformFrom == Boolean.TYPE;
    }
}


text:
product: material-ui
title: React Grid(栅格)组件
components: Grid
githubLabel: 'component: Grid'
materialDesign: https://m2.material.io/design/layout/understanding-layout.html
---

# Grid 栅格

Material Design 响应式布局的栅格可适应屏幕大小和方向,确保布局在不同尺寸之间的一致性。

[Grid 栅格组件](https://m2.material.io/design/layout/responsive-layout-grid.html) 能确保不同布局间的视觉层面的舒适感,同时在众多不同设计中保持灵活性。 Material Design 基于 12 列的网格布局来做到 UI 的响应式。

{{"component": "modules/components/ComponentLinkHeader.js"}}

警告,不应将`Grid`与data grid相互混淆,那是一个和布局网格相同的网格 For a data grid head to [the `DataGrid` component](/x/react-data-grid/).
:::

## 工作原理

网格系统是对`Grid`的实现

- 它使用 [CSS 弹性盒子模块](https://www.w3.org/TR/css-flexbox-1/) 来做到高度灵活。
- 它有两种类型的布局: _containers_ , _items_。
- 每项的宽度是按百分比设置的,所以它们的大小总是相对于它们的父元素流动。
- 子项目(items)使用内边距来保持和其他块(items)的间距。
- 其中五个断点可供使用:xs,sm,md,lg 和 xl。
- 给每个断点赋予的整型值都代表了当视图宽度可以满足断点约束时组件里占用了12个可用列里的几个

如果你不熟悉flexbox,我们建议你参考 [CSS-Tricks flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)篇

## Fluid grids 流式网格

流式网格可以通过列(column)来缩放和调整内容的大小。 流式网格可以用断点来决定布局是否需要大幅度变化

### 基本栅格

列宽是一个基于1-12的整型值,他们可以用于任意断点来代表组件占用了多少列

给定断点适用于其它比它更大的断点(除非重写,你会将在本页的后面看到) 举个例子,`xs={12}`会在无论他自己大小有多大的情况下将组件的宽度调整为占据整个视图宽度

{{"demo": "BasicGrid.js", "bg": true}}

### 有断点的栅格

组件可能有多个宽度定义,这会导致组件根据指定的断点大小来布局 大的断点的宽度值会覆盖小的断点的宽度值

举个例子,`xs={12} sm={6}`会在视图宽度为 [的时候让组件占据视图一半的宽度(6列)](/material-ui/customization/breakpoints/#default-breakpoints) 对于较小的视图宽度,则会占据所有的12列

{{"demo": "FullWidthGrid.js", "bg": true}}

## Spacing 间距

控制子控件之间的间距,可以使用`spacing`属性 Spacing可以是包含小数和整型值还有字符串的任意大于0的数 属性值会使用[`theme.spacing()`](/material-ui/customization/spacing/)助手来转换成css属性

{{"demo": "SpacingGrid.js", "bg": true}}

### 行、列间距

`rowSpacing`和`columnSpacing`属性允许你独立指定列间距和行间距 他和[CSS Grid](/system/grid/#row-gap-amp-column-gap)里的`row-gap`还有 `column-gap`属性相同

{{"demo": "RowAndColumnSpacing.js", "bg": true}}

## 响应式的值

You can switch the props' value based on the active breakpoint. For instance, we can implement the ["recommended"](https://m2.material.io/design/layout/responsive-layout-grid.html) responsive layout grid of Material Design.

{{"demo": "ResponsiveGrid.js", "bg": true}}

Responsive values is supported by:

- `columns`
- `columnSpacing`
- `direction`
- `rowSpacing`
- `spacing`
- 系统中的所有[其它属性](#system-props)

:::warning
⚠ When using a responsive `columns` prop, each grid item needs its corresponding breakpoint. For instance, this is not working. The grid item misses the value for `md`:

```jsx
<Grid container columns={{ xs: 4, md: 12 }}>
  <Grid item xs={2} />
</Grid>
```

:::

## 交互式

Below is an interactive demo that lets you explore the visual results of the different settings:

{{"demo": "InteractiveGrid.js", "hideToolbar": true, "bg": true}}

## 自适应布局

The Auto-layout makes the _items_ equitably share the available space. That also means you can set the width of one _item_ and the others will automatically resize around it.

{{"demo": "AutoGrid.js", "bg": true}}

### 负边距

Set one of the size breakpoint props to `"auto"` instead of `true` / a `number` to size a column based on the natural width of its content.

{{"demo": "VariableWidthGrid.js", "bg": true}}

## 复杂的栅格

The following demo doesn't follow the Material Design guidelines, but illustrates how the grid can be used to build complex layouts.

{{"demo": "ComplexGrid.js", "bg": true}}

## 嵌套栅格

The `container` and `item` props are two independent booleans; they can be combined to allow a Grid component to be both a flex container and child.

:::info
A flex **container** is the box generated by an element with a computed display of `flex` or `inline-flex`. In-flow children of a flex container are called flex **items** and are laid out using the flex layout model.
:::

https://www.w3.org/TR/css-flexbox-1/#box-model

{{"demo": "NestedGrid.js", "bg": true}}

⚠ Defining an explicit width to a Grid element that is flex container, flex item, and has spacing at the same time lead to unexpected behavior, avoid doing it:

```jsx
<Grid spacing={1} container item xs={12}>
```

If you need to do such, remove one of the props.

## 列

You can change the default number of columns (12) with the `columns` prop.

{{"demo": "ColumnsGrid.js", "bg": true}}

## 设计局限

### 负边距

The spacing between items is implemented with a negative margin. This might lead to unexpected behaviors. For instance, to apply a background color, you need to apply `display: flex;` to the parent.

### white-space: nowrap;

The initial setting on flex items is `min-width: auto`. It's causing a positioning conflict when the children is using `white-space: nowrap;`. You can experience the issue with:

```jsx
<Grid item xs>
  <Typography noWrap>
```

In order for the item to stay within the container you need to set `min-width: 0`. In practice, you can set the `zeroMinWidth` prop:

```jsx
<Grid item xs zeroMinWidth>
  <Typography noWrap>
```

{{"demo": "AutoGridNoWrap.js", "bg": true}}

### direction: column | column-reverse

The `xs`, `sm`, `md`, `lg`, and `xl` props are **not supported** within `direction="column"` and `direction="column-reverse"` containers.

They define the number of grids the component will use for a given breakpoint. They are intended to control **width** using `flex-basis` in `row` containers but they will impact height in `column` containers. If used, these props may have undesirable effects on the height of the `Grid` item elements.

## CSS 栅格布局

The `Grid` component is using CSS flexbox internally. But as seen below, you can easily use [the system](/system/grid/) and CSS Grid to layout your pages.

{{"demo": "CSSGrid.js", "bg": true}}

## 系统属性

As a CSS utility component, the `Grid` supports all [`system`](/system/properties/) properties. You can use them as props directly on the component. For instance, a padding:

```jsx
<Grid item p={2}>
```


text:
@implementation ERNTableViewDelegateTest

-(void)testNilTableViewHeightForRowAtNilIndexPathWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:nil
                 heightForRowAtIndexPath:nil];

    //then
    assertThatFloat(height, equalToFloat(0));
}

-(void)testTableViewHeightForRowAtNilIndexPathWithNilManager
{
    //given
    CGFloat expectedHeight = 45.0f;
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    [[[mockTableView expect] andReturnValue:OCMOCK_VALUE(expectedHeight)] rowHeight];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:mockTableView
                 heightForRowAtIndexPath:nil];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableView verify];
}

-(void)testNilTableViewHeightForRowAtIndexPathWithNilManager
{
    //given
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:nil
                 heightForRowAtIndexPath:mockIndexPath];

    //then
    assertThatFloat(height, equalToFloat(0));
    [mockIndexPath verify];
}

-(void)testTableViewHeightForRowAtIndexPathWithNilManager
{
    //given
    CGFloat expectedHeight = 45.0f;
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    [[[mockTableView expect] andReturnValue:OCMOCK_VALUE(expectedHeight)] rowHeight];
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:mockTableView
                 heightForRowAtIndexPath:mockIndexPath];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockIndexPath verify];
    [mockTableView verify];
}

-(void)testNilTableViewHeightForHeaderInSectionWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:nil
                heightForHeaderInSection:23];

    //then
    assertThatFloat(height, equalToFloat(0));
}

-(void)testTableViewHeightForHeaderInSectionWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:mockTableView
                heightForHeaderInSection:23];

    //then
    assertThatFloat(height, equalToFloat(0));
    [mockTableView verify];
}

-(void)testNilTableViewHeightForFooterInSectionWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:nil
                heightForFooterInSection:43];

    //then
    assertThatFloat(height, equalToFloat(0));
}

-(void)testTableViewHeightForFooterInSectionWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    CGFloat height = [delegate tableView:mockTableView
                heightForFooterInSection:43];

    //then
    assertThatFloat(height, equalToFloat(0));
    [mockTableView verify];
}

-(void)testNilTableViewViewForHeaderInSectionWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    UIView *view = [delegate tableView:nil
                viewForHeaderInSection:43];

    //then
    assertThat(view, nilValue());
}

-(void)testTableViewViewForHeaderInSectionWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    UIView *view = [delegate tableView:mockTableView
                viewForHeaderInSection:43];

    //then
    assertThat(view, nilValue());
    [mockTableView verify];
}

-(void)testNilTableViewViewForFooterInSectionWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    UIView *view = [delegate tableView:nil
                viewForFooterInSection:43];

    //then
    assertThat(view, nilValue());
}

-(void)testTableViewViewForFooterInSectionWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    UIView *view = [delegate tableView:mockTableView
                viewForFooterInSection:43];

    //then
    assertThat(view, nilValue());
    [mockTableView verify];
}

-(void)testNilTableViewDidSelectRowAtNilIndexPathWithNilManager
{
    //given
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when, then
    [delegate tableView:nil didSelectRowAtIndexPath:nil];
}

-(void)testTableViewDidSelectRowAtNilIndexPathWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    [delegate tableView:mockTableView didSelectRowAtIndexPath:nil];

    //then
    [mockTableView verify];
}

-(void)testNilTableViewDidSelectRowAtIndexPathWithNilManager
{
    //given
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    [delegate tableView:nil didSelectRowAtIndexPath:mockIndexPath];

    //then
    [mockIndexPath verify];
}

-(void)testTableViewDidSelectRowAtIndexPathWithNilManager
{
    //given
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id<UITableViewDelegate> delegate = [ERNTableViewDelegate createWithTableViewManager:nil];

    //when
    [delegate tableView:mockTableView didSelectRowAtIndexPath:nil];

    //then
    [mockTableView verify];
    [mockIndexPath verify];
}

-(void)testNilTableViewHeightForRowAtNilIndexPathWithManager
{
    //given
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:nil
                 heightForRowAtIndexPath:nil];

    //then
    assertThatFloat(height, equalToFloat(0));
    [mockTableViewManager verify];
}

-(void)testTableViewHeightForRowAtNilIndexPathWithManager
{
    //given
    CGFloat expectedHeight = 45.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    [[[mockTableView expect] andReturnValue:OCMOCK_VALUE(expectedHeight)] rowHeight];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:mockTableView
                 heightForRowAtIndexPath:nil];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewHeightForRowAtIndexPathWithManager
{
    //given
    CGFloat expectedHeight = 45.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    [[[mockTableViewManager expect] andReturnValue:OCMOCK_VALUE(expectedHeight)]
     heightForRowAtIndexPath:mockIndexPath
     defaultHeight:0.0f];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:nil
                 heightForRowAtIndexPath:mockIndexPath];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockIndexPath verify];
    [mockTableViewManager verify];
}

-(void)testTableViewHeightForRowAtIndexPathWithManager
{
    //given
    CGFloat expectedHeight = 45.0f;
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    [[[mockTableView expect] andReturnValue:OCMOCK_VALUE(expectedHeight)] rowHeight];
    [[[mockTableViewManager expect] andReturnValue:OCMOCK_VALUE(expectedHeight)]
     heightForRowAtIndexPath:mockIndexPath
     defaultHeight:expectedHeight];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:mockTableView
                 heightForRowAtIndexPath:mockIndexPath];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockIndexPath verify];
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewHeightForHeaderInSectionWithManager
{
    //given
    NSInteger section = 43;
    CGFloat expectedHeight = 33.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect]
     andReturnValue:OCMOCK_VALUE(expectedHeight)] heightForHeaderInSection:section
     defaultHeight:0.0f];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:nil
                heightForHeaderInSection:section];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableViewManager verify];
}

-(void)testTableViewHeightForHeaderInSectionWithManager
{
    //given
    NSInteger section = 43;
    CGFloat expectedHeight = 33.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect]
     andReturnValue:OCMOCK_VALUE(expectedHeight)] heightForHeaderInSection:section
     defaultHeight:0.0f];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:mockTableView
                heightForHeaderInSection:section];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewHeightForFooterInSectionWithManager
{
    //given
    NSInteger section = 43;
    CGFloat expectedHeight = 33.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect]
     andReturnValue:OCMOCK_VALUE(expectedHeight)] heightForFooterInSection:section
     defaultHeight:0.0f];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:nil
                heightForFooterInSection:section];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableViewManager verify];
}

-(void)testTableViewHeightForFooterInSectionWithManager
{
    //given
    NSInteger section = 43;
    CGFloat expectedHeight = 33.0f;
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect]
     andReturnValue:OCMOCK_VALUE(expectedHeight)] heightForFooterInSection:section
     defaultHeight:0.0f];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    CGFloat height = [delegate tableView:mockTableView
                heightForFooterInSection:section];

    //then
    assertThatFloat(height, equalToFloat(expectedHeight));
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewViewForHeaderInSectionWithManager
{
    //given
    NSInteger expectedSection = 34;
    id mockView = [OCMockObject mockForClass:[UIView class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect] andReturn:mockView] viewForHeaderInSection:expectedSection];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    UIView *view = [delegate tableView:nil
                viewForHeaderInSection:expectedSection];

    //then
    assertThat(view, equalTo(mockView));
    [mockTableViewManager verify];
}

-(void)testTableViewViewForHeaderInSectionWithManager
{
    //given
    NSInteger expectedSection = 34;
    id mockView = [OCMockObject mockForClass:[UIView class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect] andReturn:mockView] viewForHeaderInSection:expectedSection];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    UIView *view = [delegate tableView:mockTableView
                viewForHeaderInSection:expectedSection];

    //then
    assertThat(view, equalTo(mockView));
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewViewForFooterInSectionWithManager
{
    //given
    NSInteger expectedSection = 34;
    id mockView = [OCMockObject mockForClass:[UIView class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect] andReturn:mockView] viewForFooterInSection:expectedSection];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    UIView *view = [delegate tableView:nil
                viewForFooterInSection:expectedSection];

    //then
    assertThat(view, equalTo(mockView));
    [mockTableViewManager verify];
}

-(void)testTableViewViewForFooterInSectionWithManager
{
    //given
    NSInteger expectedSection = 34;
    id mockView = [OCMockObject mockForClass:[UIView class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[[mockTableViewManager expect] andReturn:mockView] viewForFooterInSection:expectedSection];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    UIView *view = [delegate tableView:mockTableView
                viewForFooterInSection:expectedSection];

    //then
    assertThat(view, equalTo(mockView));
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewDidSelectRowAtNilIndexPathWithManager
{
    //given
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    [delegate tableView:nil didSelectRowAtIndexPath:nil];

    //then
    [mockTableViewManager verify];
}

-(void)testTableViewDidSelectRowAtNilIndexPathWithManager
{
    //given
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    [delegate tableView:mockTableView didSelectRowAtIndexPath:nil];

    //then
    [mockTableView verify];
    [mockTableViewManager verify];
}

-(void)testNilTableViewDidSelectRowAtIndexPathWithManager
{
    //given
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    [[mockTableViewManager expect] actionForIndexPath:mockIndexPath];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    [delegate tableView:nil didSelectRowAtIndexPath:mockIndexPath];

    //then
    [mockIndexPath verify];
    [mockTableViewManager verify];
}

-(void)testTableViewDidSelectRowAtIndexPathWithManager
{
    //given
    id mockTableViewManager = [OCMockObject mockForProtocol:@protocol(ERNTableViewManager)];
    id mockTableView = [OCMockObject mockForClass:[UITableView class]];
    id mockIndexPath = [OCMockObject mockForClass:[NSIndexPath class]];
    id<UITableViewDelegate> delegate =
    [ERNTableViewDelegate createWithTableViewManager:mockTableViewManager];

    //when
    [delegate tableView:mockTableView didSelectRowAtIndexPath:nil];

    //then
    [mockTableView verify];
    [mockIndexPath verify];
    [mockTableViewManager verify];
}

@end


text:
/**
 * Compiles the project from source files into a distributable
 * format and copies it to the output (build) folder.
 */
export default async () => {
  console.log('build');
  await require('./clean')();
  await require('./copy')();
  await require('./bundle')();
};


text:
import { Routes, Route } from 'react-router-dom';

import NotificationAdminIndex from './NotificationAdminIndex';
import NotificationConfiguration from './NotificationConfiguration';
import useAuthorizationRequired from '../Authentication/useAuthorizationRequired';

function NotificationAdmin(): JSX.Element {
  const authorizationWarning = useAuthorizationRequired('can_update_notification_templates');
  if (authorizationWarning) return authorizationWarning;

  return (
    <Routes>
      <Route path=":category/:event" element={<NotificationConfiguration />} />
      <Route path="" element={<NotificationAdminIndex />} />
    </Routes>
  );
}

export default NotificationAdmin;


text:
title: Transition to new themes
sidebar: flexberry-ember-2_sidebar
keywords: Flexberry Ember Themes
toc: true
permalink: en/ef2_themes_migrating.html
folder: products/ember-flexberry/themes/
lang: en
autotranslated: true
hash: 8ff1b365525068e75ba7e83e8cf40a1f85cd95b161701e77028fea7e53756626
summary: Description of the transition to the new themes
---

## Manual for the transition to new themes

The current version of ember-flexberry contains significant changes otnositelno the original, where there was no support for those.

So the only sure solution would be to mistake the application by moving the logic.

Here is a partial list of what needs to be done to connect the themes. Attention! the article is not updated.

[An old manual for the transition to new themes](ef2_themes_migrating_old.html)