text:
package org.jclouds.ovf;

public class Configuration {
   public static Builder builder() {
      return new Builder();
   }

   public static class Builder {
      protected String id;
      protected String label;
      protected String description;

      /**
       * @see Configuration#getId
       */
      public Builder id(String id) {
         this.id = id;
         return this;
      }

      /**
       * @see Section#getLabel
       */
      public Builder label(String label) {
         this.label = label;
         return this;
      }

      /**
       * @see Section#getDescription
       */
      public Builder description(String description) {
         this.description = description;
         return this;
      }

      public Configuration build() {
         return new Configuration(id, label, description);
      }

      public Builder fromConfiguration(Configuration in) {
         return id(in.getId()).description(in.getDescription()).label(in.getLabel());
      }
   }

   private final String id;
   private final String label;
   private final String description;

   public Configuration(String id, String label, String description) {
      this.id = id;
      this.label = label;
      this.description = description;
   }

   @Override
   public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((id == null) ? 0 : id.hashCode());
      return result;
   }

   @Override
   public boolean equals(Object obj) {
      if (this == obj)
         return true;
      if (obj == null)
         return false;
      if (getClass() != obj.getClass())
         return false;
      Configuration other = (Configuration) obj;
      if (id == null) {
         if (other.id != null)
            return false;
      } else if (!id.equals(other.id))
         return false;
      return true;
   }

   @Override
   public String toString() {
      return String.format("[id=%s, label=%s, description=%s]", id, label, description);
   }

   public String getId() {
      return id;
   }

   public String getDescription() {
      return description;
   }

   public String getLabel() {
      return label;
   }
}


text:
require 'spec_helper'

describe Spree::PermissionSets::RestrictedStockManagement do
  let(:ability) { Spree::Ability.new(user) }
  let(:user) { create :user }

  subject { ability }

  let!(:variant) { create :variant }

  let(:sl1) { create :stock_location, active: false }
  let(:sl2) { create :stock_location, active: false }

  let(:item1) { variant.stock_items.where(stock_location_id: sl1.id).first }
  let(:item2) { variant.stock_items.where(stock_location_id: sl2.id).first }

  before do
    user.stock_locations << sl1
  end

  context "when activated" do
    before do
      described_class.new(ability).activate!
    end

    it { is_expected.to be_able_to(:display, sl1) }
    it { is_expected.to_not be_able_to(:display, sl2) }

    it { is_expected.to be_able_to(:manage, item1) }
    it { is_expected.to_not be_able_to(:manage, item2) }
  end

  context "when not activated" do
    it { is_expected.to_not be_able_to(:display, sl1) }
    it { is_expected.to_not be_able_to(:display, sl2) }

    it { is_expected.to_not be_able_to(:manage, item1) }
    it { is_expected.to_not be_able_to(:manage, item2) }
  end
end

redpajama_set_name: RedPajamaGithub


text:
#ifndef JUCE_AUDIOPLUGININSTANCE_H_INCLUDED
#define JUCE_AUDIOPLUGININSTANCE_H_INCLUDED

//==============================================================================
/**
    Base class for an active instance of a plugin.

    This derives from the AudioProcessor class, and adds some extra functionality
    that helps when wrapping dynamically loaded plugins.

    @see AudioProcessor, AudioPluginFormat
*/
class JUCE_API  AudioPluginInstance   : public AudioProcessor
{
public:
    //==============================================================================
    /** Destructor.

        Make sure that you delete any UI components that belong to this plugin before
        deleting the plugin.
    */
    virtual ~AudioPluginInstance() {}

    //==============================================================================
    /** Fills-in the appropriate parts of this plugin description object. */
    virtual void fillInPluginDescription (PluginDescription& description) const = 0;

    /** Returns a PluginDescription for this plugin.
        This is just a convenience method to avoid calling fillInPluginDescription.
    */
    PluginDescription getPluginDescription() const
    {
        PluginDescription desc;
        fillInPluginDescription (desc);
        return desc;
    }

    /** Returns a pointer to some kind of platform-specific data about the plugin.
        E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be
        cast to an AudioUnit handle.
    */
    virtual void* getPlatformSpecificData()                 { return nullptr; }

    /** For some formats (currently AudioUnit), this forces a reload of the list of
        available parameters.
    */
    virtual void refreshParameterList() {}

protected:
    //==============================================================================
    AudioPluginInstance() {}

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginInstance)
};

#endif   // JUCE_AUDIOPLUGININSTANCE_H_INCLUDED


text:
<?php

namespace AveCqrs\CommandHandling;

/**
 * Class SimpleCommandBus
 *
 * @package AveCqrs\CommandHandling
 * @author Averor <averor.dev@gmail.com>
 * @created 11.04.17
 */
class SimpleCommandBus implements CommandBus
{
    /** @var array */
    protected $handlers = [];

    /** @var array */
    protected $queue = [];

    /** @var bool */
    protected $isHandling = false;

    /**
     * @param array $handlers
     */
    public function __construct(array $handlers = [])
    {
        /**
         * @var string $commandName
         * @var CommandHandler $handler
         */
        foreach ((array)$handlers as $commandName => $handler) {
            $this->subscribe($commandName, $handler);
        }
    }

    /**
     * @param string $commandName
     * @param CommandHandler $handler
     * @return SimpleCommandBus
     * @throws Exception\CommandHandlerAlreadySubscribedForCommandException
     */
    public function subscribe($commandName, CommandHandler $handler)
    {
        $commandName = (string) $commandName;

        if (array_key_exists($commandName, $this->handlers)) {
            throw new Exception\CommandHandlerAlreadySubscribedForCommandException(sprintf(
                "Command handler for command '%s' has already been registered",
                $commandName
            ));
        }

        $this->handlers[$commandName] = $handler;

        return $this;
    }

    /**
     * @param Command $command
     * @return void
     * @throws Exception\NoCommandHandlerSubscribedForCommandException
     */
    public function dispatch(Command $command)
    {
        $this->queue[] = $command;

        if ($this->isHandling) {
            return;
        }

        $this->isHandling = true;

        try {
            /** @var Command $command */
            while ($command = array_shift($this->queue)) {

                /** @var string $commandName */
                $commandName = $command->getName();

                if (!array_key_exists($commandName, $this->handlers)) {
                    throw new Exception\NoCommandHandlerSubscribedForCommandException(sprintf(
                        "No command handler has subscribed to handle '%s' command",
                        $commandName
                    ));
                }

                /** @var CommandHandler $handler */
                $handler = $this->handlers[$commandName];

                $handler->handle($command);
            }
        } finally {
            $this->isHandling = false;
        }
    }
}


text:
import * as React from 'react';
import Contract from './../Extend/Contract';
import AccordionTable from './../AccordionTable/AccordionTable';
import {ColumnDefinition} from './../AccordionTable/AccordionTable';

class ArticleTableProps
{
    public title: string;
    public columns: ColumnDefinition[];
    public hiddenColumns: ColumnDefinition[];
    public data: any[];
    public moreText: string;
    public lessText: string;
    public hideButtons: boolean;

    public detailsTitle: string;
	public detailsTooltip: string;
	public pdfTitle: string;
	public pdfTooltip: string;
}

export default class ArticleTable extends React.Component<ArticleTableProps, any>
{
    render()
    {
        return (
            <Contract lessText={this.props.lessText} moreText={this.props.moreText}>

{this.props.title}

                        <AccordionTable columns={this.props.columns}
                            hiddenColumns={this.props.hiddenColumns}
                            data={this.props.data}
                            hideButtons={this.props.hideButtons}
                            detailsTitle={this.props.detailsTitle}
                            detailsTooltip={this.props.detailsTooltip}
                            pdfTitle={this.props.pdfTitle}
                            pdfTooltip={this.props.pdfTooltip}/>

            </Contract>
        );
    }
}


text:
using Subsonic.Client.Interfaces;
using Subsonic.Common.Interfaces;
using System;

namespace Subsonic.Client.Android
{
    public class SubsonicResponse<T> : Client.SubsonicResponse<T> where T : class, IDisposable
    {
        public SubsonicResponse(ISubsonicServer subsonicServer, IImageFormatFactory<T> imageFormatFactory) : base(subsonicServer, new SubsonicRequest<T>(subsonicServer, imageFormatFactory))
        {
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class org.hibernate.LockMode (Hibernate JavaDocs)
</TITLE>

<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.hibernate.LockMode

Packages that use LockMode

org.hibernate

        This package defines the central Hibernate APIs.

org.hibernate.cache.ehcache

org.hibernate.criterion

        A framework for defining restriction criteria and order criteria.

org.hibernate.dialect

        This package abstracts the SQL dialect of the underlying database.

org.hibernate.dialect.lock

org.hibernate.ejb

org.hibernate.ejb.internal

org.hibernate.ejb.util

org.hibernate.engine.internal

org.hibernate.engine.query.spi.sql

org.hibernate.engine.spi

org.hibernate.envers.internal

org.hibernate.envers.query

org.hibernate.envers.query.impl

org.hibernate.event.internal

        This package defines a default set of event listeners that
        implements the default behaviors of Hibernate.

org.hibernate.event.spi

org.hibernate.hql.internal.classic

        This package contains the Hibernate 2.x query parser which
        is being end-of-lifed.

org.hibernate.internal

    An internal package containing mostly implementations of central Hibernate APIs.

org.hibernate.internal.util.collections

org.hibernate.loader

        This package defines functionality for processing JDBC
        result sets and returning complex graphs of persistent
        objects.

org.hibernate.loader.criteria

        This package defines the criteria query compiler and loader

org.hibernate.loader.custom

        This package defines a framework for custom loaders that accept
        handwritten SQL

org.hibernate.loader.entity

        This package defines entity loaders

org.hibernate.loader.hql

        This package defines a loader for the AST-based query parser

org.hibernate.persister.entity

        This package abstracts persistence mechanisms for
        entities, and defines the Hibernate runtime
        metamodel.

org.hibernate.service.jdbc.connections.internal

org.hibernate.sql

        This package defines helper classes for rendering SQL
        fragments and SQL statements.

Uses of LockMode in org.hibernate

Methods in org.hibernate that return LockMode

 LockMode
LockOptions.findGreatestLockMode()

          Currently needed for follow-on locking

 LockMode
LockOptions.getAliasSpecificLockMode(String alias)

          Get the LockMode explicitly specified for the given alias via
 LockOptions.setAliasSpecificLockMode(java.lang.String, org.hibernate.LockMode)

 Differs from LockOptions.getEffectiveLockMode(java.lang.String) in that here we only return
 explicitly specified alias-specific lock modes.

 LockMode
Session.getCurrentLockMode(Object object)

          Determine the current lock mode of the given object.

 LockMode
LockOptions.getEffectiveLockMode(String alias)

          Determine the LockMode to apply to the given alias.

 LockMode
LockOptions.getLockMode()

          Retrieve the overall lock mode in effect for this set of options.

 LockMode
Session.LockRequest.getLockMode()

          Get the lock mode.

static LockMode
LockMode.valueOf(String name)

          Returns the enum constant of this type with the specified name.

static LockMode[]
LockMode.values()

          Returns an array containing the constants of this enum type, in
the order they are declared.

Methods in org.hibernate with parameters of type LockMode

 SQLQuery
SQLQuery.addEntity(String tableAlias,
          Class entityName,
          LockMode lockMode)

          Declare a "root" entity, specifying a lock mode

 SQLQuery
SQLQuery.addEntity(String tableAlias,
          String entityName,
          LockMode lockMode)

          Declare a "root" entity, specifying a lock mode

 SQLQuery
SQLQuery.addJoin(String tableAlias,
        String path,
        LockMode lockMode)

          Declare a join fetch result, specifying a lock mode

 Object
StatelessSession.get(Class entityClass,
    Serializable id,
    LockMode lockMode)

          Retrieve a row, obtaining the specified lock mode.

 Object
Session.get(Class clazz,
    Serializable id,
    LockMode lockMode)

          Deprecated. LockMode parameter should be replaced with LockOptions

 Object
StatelessSession.get(String entityName,
    Serializable id,
    LockMode lockMode)

          Retrieve a row, obtaining the specified lock mode.

 Object
Session.get(String entityName,
    Serializable id,
    LockMode lockMode)

          Deprecated. LockMode parameter should be replaced with LockOptions

 boolean
LockMode.greaterThan(LockMode mode)

          Check if this lock mode is more restrictive than the given lock mode.

 boolean
LockMode.lessThan(LockMode mode)

          Check if this lock mode is less restrictive than the given lock mode.

 Object
Session.load(Class theClass,
     Serializable id,
     LockMode lockMode)

          Deprecated. LockMode parameter should be replaced with LockOptions

 Object
Session.load(String entityName,
     Serializable id,
     LockMode lockMode)

          Deprecated. LockMode parameter should be replaced with LockOptions

 void
Session.lock(Object object,
     LockMode lockMode)

          Deprecated. instead call buildLockRequest(LockMode).lock(object)

 void
Session.lock(String entityName,
     Object object,
     LockMode lockMode)

          Deprecated. instead call buildLockRequest(LockMode).lock(entityName, object)

 void
StatelessSession.refresh(Object entity,
        LockMode lockMode)

          Refresh the entity instance state from the database.

 void
Session.refresh(Object object,
        LockMode lockMode)

          Deprecated. LockMode parameter should be replaced with LockOptions

 void
StatelessSession.refresh(String entityName,
        Object entity,
        LockMode lockMode)

          Refresh the entity instance state from the database.

 LockOptions
LockOptions.setAliasSpecificLockMode(String alias,
                         LockMode lockMode)

          Specify the LockMode to be used for a specific query alias.

 SQLQuery.RootReturn
SQLQuery.RootReturn.setLockMode(LockMode lockMode)

          Set the lock mode for this return

 SQLQuery.FetchReturn
SQLQuery.FetchReturn.setLockMode(LockMode lockMode)

          Set the lock mode for this return

 LockOptions
LockOptions.setLockMode(LockMode lockMode)

          Set the overall LockMode to be used.

 Criteria
Criteria.setLockMode(LockMode lockMode)

          Set the lock mode of the current entity

 Session.LockRequest
Session.LockRequest.setLockMode(LockMode lockMode)

          Specify the LockMode to be used.

 Criteria
Criteria.setLockMode(String alias,
            LockMode lockMode)

          Set the lock mode of the aliased entity

 Query
Query.setLockMode(String alias,
            LockMode lockMode)

          Set the lockmode for the objects idententified by the
 given alias that appears in the <tt>FROM</tt> clause.

Constructors in org.hibernate with parameters of type LockMode

LockOptions(LockMode lockMode)

Uses of LockMode in org.hibernate.cache.ehcache

Methods in org.hibernate.cache.ehcache with parameters of type LockMode

 void
EhCacheMessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode arg0)

Uses of LockMode in org.hibernate.criterion

Methods in org.hibernate.criterion with parameters of type LockMode

 DetachedCriteria
DetachedCriteria.setLockMode(LockMode lockMode)

 DetachedCriteria
DetachedCriteria.setLockMode(String alias,
            LockMode lockMode)

Uses of LockMode in org.hibernate.dialect

Methods in org.hibernate.dialect with parameters of type LockMode

 String
Dialect.appendLockHint(LockMode mode,
               String tableName)

          Deprecated. use appendLockHint(LockOptions,String) instead

 String
Dialect.getForUpdateString(LockMode lockMode)

          Given a lock mode, determine the appropriate for update fragment to use.

 LockingStrategy
Dialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

          Get a strategy instance which knows how to acquire a database-level lock
 of the specified mode for this dialect.

 LockingStrategy
PointbaseDialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

 LockingStrategy
MckoiDialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

 LockingStrategy
HSQLDialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

          For HSQLDB 2.0, this is a copy of the base class implementation.

 LockingStrategy
TimesTenDialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

 LockingStrategy
FrontBaseDialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

 LockingStrategy
RDMSOS2200Dialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

 LockingStrategy
Cache71Dialect.getLockingStrategy(Lockable lockable,
                   LockMode lockMode)

Constructors in org.hibernate.dialect with parameters of type LockMode

HSQLDialect.ReadUncommittedLockingStrategy(Lockable lockable,
                                           LockMode lockMode)

Uses of LockMode in org.hibernate.dialect.lock

Methods in org.hibernate.dialect.lock that return LockMode

protected  LockMode
PessimisticForceIncrementLockingStrategy.getLockMode()

          Retrieve the specific lock mode defined.

protected  LockMode
PessimisticReadUpdateLockingStrategy.getLockMode()

protected  LockMode
OptimisticForceIncrementLockingStrategy.getLockMode()

protected  LockMode
OptimisticLockingStrategy.getLockMode()

protected  LockMode
UpdateLockingStrategy.getLockMode()

protected  LockMode
PessimisticWriteUpdateLockingStrategy.getLockMode()

protected  LockMode
AbstractSelectLockingStrategy.getLockMode()

Constructors in org.hibernate.dialect.lock with parameters of type LockMode

AbstractSelectLockingStrategy(Lockable lockable,
                              LockMode lockMode)

OptimisticForceIncrementLockingStrategy(Lockable lockable,
                                        LockMode lockMode)

          Construct locking strategy.

OptimisticLockingStrategy(Lockable lockable,
                          LockMode lockMode)

          Construct locking strategy.

PessimisticForceIncrementLockingStrategy(Lockable lockable,
                                         LockMode lockMode)

          Construct locking strategy.

PessimisticReadSelectLockingStrategy(Lockable lockable,
                                     LockMode lockMode)

          Construct a locking strategy based on SQL SELECT statements.

PessimisticReadUpdateLockingStrategy(Lockable lockable,
                                     LockMode lockMode)

          Construct a locking strategy based on SQL UPDATE statements.

PessimisticWriteSelectLockingStrategy(Lockable lockable,
                                      LockMode lockMode)

          Construct a locking strategy based on SQL SELECT statements.

PessimisticWriteUpdateLockingStrategy(Lockable lockable,
                                      LockMode lockMode)

          Construct a locking strategy based on SQL UPDATE statements.

SelectLockingStrategy(Lockable lockable,
                      LockMode lockMode)

          Construct a locking strategy based on SQL SELECT statements.

UpdateLockingStrategy(Lockable lockable,
                      LockMode lockMode)

          Construct a locking strategy based on SQL UPDATE statements.

Uses of LockMode in org.hibernate.ejb

Methods in org.hibernate.ejb with parameters of type LockMode

protected abstract  void
AbstractQueryImpl.applyAliasSpecificLockMode(String alias,
                           LockMode lockMode)

protected  void
QueryImpl.applyAliasSpecificLockMode(String alias,
                           LockMode lockMode)

Uses of LockMode in org.hibernate.ejb.internal

Methods in org.hibernate.ejb.internal with parameters of type LockMode

 void
EntityManagerMessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode arg0)

Uses of LockMode in org.hibernate.ejb.util

Methods in org.hibernate.ejb.util that return LockMode

static LockMode
LockModeTypeHelper.getLockMode(LockModeType lockMode)

static LockMode
LockModeTypeHelper.interpretLockMode(Object value)

Methods in org.hibernate.ejb.util with parameters of type LockMode

static LockModeType
LockModeTypeHelper.getLockModeType(LockMode lockMode)

Uses of LockMode in org.hibernate.engine.internal

Methods in org.hibernate.engine.internal with parameters of type LockMode

 EntityEntry
StatefulPersistenceContext.addEntity(Object entity,
          Status status,
          Object[] loadedState,
          EntityKey entityKey,
          Object version,
          LockMode lockMode,
          boolean existsInDatabase,
          EntityPersister persister,
          boolean disableVersionIncrement,
          boolean lazyPropertiesAreUnfetched)

          Adds an entity to the internal caches.

 EntityEntry
StatefulPersistenceContext.addEntry(Object entity,
         Status status,
         Object[] loadedState,
         Object rowId,
         Serializable id,
         Object version,
         LockMode lockMode,
         boolean existsInDatabase,
         EntityPersister persister,
         boolean disableVersionIncrement,
         boolean lazyPropertiesAreUnfetched)

          Generates an appropriate EntityEntry instance and adds it
 to the event source's internal caches.

static void
TwoPhaseLoad.addUninitializedCachedEntity(EntityKey key,
                             Object object,
                             EntityPersister persister,
                             LockMode lockMode,
                             boolean lazyPropertiesAreUnfetched,
                             Object version,
                             SessionImplementor session)

static void
TwoPhaseLoad.addUninitializedEntity(EntityKey key,
                       Object object,
                       EntityPersister persister,
                       LockMode lockMode,
                       boolean lazyPropertiesAreUnfetched,
                       SessionImplementor session)

          Add an uninitialized instance of an entity class, as a placeholder to ensure object
 identity.

static void
TwoPhaseLoad.postHydrate(EntityPersister persister,
            Serializable id,
            Object[] values,
            Object rowId,
            Object object,
            LockMode lockMode,
            boolean lazyPropertiesAreUnfetched,
            SessionImplementor session)

          Register the "hydrated" state of an entity instance, after the first step of 2-phase loading.

Uses of LockMode in org.hibernate.engine.query.spi.sql

Methods in org.hibernate.engine.query.spi.sql that return LockMode

 LockMode
NativeSQLQueryNonScalarReturn.getLockMode()

          Retrieve the lock-mode to apply to this return

Constructors in org.hibernate.engine.query.spi.sql with parameters of type LockMode

NativeSQLQueryCollectionReturn(String alias,
                               String ownerEntityName,
                               String ownerProperty,
                               Map propertyResults,
                               LockMode lockMode)

          Construct a native-sql return representing a collection initializer

NativeSQLQueryJoinReturn(String alias,
                         String ownerAlias,
                         String ownerProperty,
                         Map propertyResults,
                         LockMode lockMode)

          Construct a return descriptor representing some form of fetch.

NativeSQLQueryNonScalarReturn(String alias,
                              Map<String,String[]> propertyResults,
                              LockMode lockMode)

          Constructs some form of non-scalar return descriptor

NativeSQLQueryRootReturn(String alias,
                         String entityName,
                         LockMode lockMode)

          Construct a return representing an entity returned at the root
 of the result.

NativeSQLQueryRootReturn(String alias,
                         String entityName,
                         Map<String,String[]> propertyResults,
                         LockMode lockMode)

Uses of LockMode in org.hibernate.engine.spi

Methods in org.hibernate.engine.spi that return LockMode

 LockMode
SessionDelegatorBaseImpl.getCurrentLockMode(Object object)

 LockMode
EntityEntry.getLockMode()

Methods in org.hibernate.engine.spi with parameters of type LockMode

 EntityEntry
PersistenceContext.addEntity(Object entity,
          Status status,
          Object[] loadedState,
          EntityKey entityKey,
          Object version,
          LockMode lockMode,
          boolean existsInDatabase,
          EntityPersister persister,
          boolean disableVersionIncrement,
          boolean lazyPropertiesAreUnfetched)

          Adds an entity to the internal caches.

 EntityEntry
PersistenceContext.addEntry(Object entity,
         Status status,
         Object[] loadedState,
         Object rowId,
         Serializable id,
         Object version,
         LockMode lockMode,
         boolean existsInDatabase,
         EntityPersister persister,
         boolean disableVersionIncrement,
         boolean lazyPropertiesAreUnfetched)

          Generates an appropriate EntityEntry instance and adds it
 to the event source's internal caches.

 Object
SessionDelegatorBaseImpl.get(Class clazz,
    Serializable id,
    LockMode lockMode)

 Object
SessionDelegatorBaseImpl.get(String entityName,
    Serializable id,
    LockMode lockMode)

 Object
SessionDelegatorBaseImpl.load(Class theClass,
     Serializable id,
     LockMode lockMode)

 Object
SessionDelegatorBaseImpl.load(String entityName,
     Serializable id,
     LockMode lockMode)

 void
SessionDelegatorBaseImpl.lock(Object object,
     LockMode lockMode)

 void
SessionDelegatorBaseImpl.lock(String entityName,
     Object object,
     LockMode lockMode)

 void
SessionDelegatorBaseImpl.refresh(Object object,
        LockMode lockMode)

 void
EntityEntry.setLockMode(LockMode lockMode)

Constructors in org.hibernate.engine.spi with parameters of type LockMode

EntityEntry(Status status,
            Object[] loadedState,
            Object rowId,
            Serializable id,
            Object version,
            LockMode lockMode,
            boolean existsInDatabase,
            EntityPersister persister,
            EntityMode entityMode,
            String tenantId,
            boolean disableVersionIncrement,
            boolean lazyPropertiesAreUnfetched,
            PersistenceContext persistenceContext)

Uses of LockMode in org.hibernate.envers.internal

Methods in org.hibernate.envers.internal with parameters of type LockMode

 void
EnversMessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode arg0)

Uses of LockMode in org.hibernate.envers.query

Methods in org.hibernate.envers.query with parameters of type LockMode

 AuditQuery
AuditQuery.setLockMode(LockMode lockMode)

Uses of LockMode in org.hibernate.envers.query.impl

Methods in org.hibernate.envers.query.impl with parameters of type LockMode

 AuditQuery
AbstractAuditQuery.setLockMode(LockMode lockMode)

          Deprecated. Instead use setLockOptions

Uses of LockMode in org.hibernate.event.internal

Fields in org.hibernate.event.internal declared as LockMode

static LockMode
DefaultLoadEventListener.DEFAULT_LOCK_MODE

Uses of LockMode in org.hibernate.event.spi

Fields in org.hibernate.event.spi declared as LockMode

static LockMode
LoadEvent.DEFAULT_LOCK_MODE

static LockMode
ResolveNaturalIdEvent.DEFAULT_LOCK_MODE

Methods in org.hibernate.event.spi that return LockMode

 LockMode
LoadEvent.getLockMode()

 LockMode
LockEvent.getLockMode()

 LockMode
RefreshEvent.getLockMode()

Methods in org.hibernate.event.spi with parameters of type LockMode

 void
LoadEvent.setLockMode(LockMode lockMode)

 void
LockEvent.setLockMode(LockMode lockMode)

Constructors in org.hibernate.event.spi with parameters of type LockMode

LoadEvent(Serializable entityId,
          String entityClassName,
          LockMode lockMode,
          EventSource source)

LockEvent(Object object,
          LockMode lockMode,
          EventSource source)

LockEvent(String entityName,
          Object original,
          LockMode lockMode,
          EventSource source)

RefreshEvent(Object object,
             LockMode lockMode,
             EventSource source)

Uses of LockMode in org.hibernate.hql.internal.classic

Methods in org.hibernate.hql.internal.classic that return LockMode

protected  LockMode[]
QueryTranslatorImpl.getLockModes(LockOptions lockOptions)

Uses of LockMode in org.hibernate.internal

Methods in org.hibernate.internal that return LockMode

 LockMode
SessionImpl.getCurrentLockMode(Object object)

 LockMode
CriteriaImpl.Subcriteria.getLockMode()

Methods in org.hibernate.internal with parameters of type LockMode

 SQLQuery
SQLQueryImpl.addEntity(String alias,
          Class entityClass,
          LockMode lockMode)

 SQLQuery
SQLQueryImpl.addEntity(String alias,
          String entityName,
          LockMode lockMode)

 SQLQuery
SQLQueryImpl.addJoin(String alias,
        String path,
        LockMode lockMode)

 void
CoreMessageLogger.aliasSpecificLockingWithFollowOnLocking(LockMode lockMode)

 void
CoreMessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode lockMode)

 Object
SessionImpl.get(Class entityClass,
    Serializable id,
    LockMode lockMode)

 Object
StatelessSessionImpl.get(Class entityClass,
    Serializable id,
    LockMode lockMode)

 Object
SessionImpl.get(String entityName,
    Serializable id,
    LockMode lockMode)

 Object
StatelessSessionImpl.get(String entityName,
    Serializable id,
    LockMode lockMode)

 Object
SessionImpl.load(Class entityClass,
     Serializable id,
     LockMode lockMode)

 Object
SessionImpl.load(String entityName,
     Serializable id,
     LockMode lockMode)

 void
SessionImpl.lock(Object object,
     LockMode lockMode)

 void
SessionImpl.lock(String entityName,
     Object object,
     LockMode lockMode)

 void
SessionImpl.refresh(Object object,
        LockMode lockMode)

 void
StatelessSessionImpl.refresh(Object entity,
        LockMode lockMode)

 void
StatelessSessionImpl.refresh(String entityName,
        Object entity,
        LockMode lockMode)

 Criteria
CriteriaImpl.setLockMode(LockMode lockMode)

 Criteria
CriteriaImpl.Subcriteria.setLockMode(LockMode lockMode)

 Query
SQLQueryImpl.setLockMode(String alias,
            LockMode lockMode)

 Criteria
CriteriaImpl.setLockMode(String alias,
            LockMode lockMode)

 Criteria
CriteriaImpl.Subcriteria.setLockMode(String alias,
            LockMode lockMode)

 Query
QueryImpl.setLockMode(String alias,
            LockMode lockMode)

Uses of LockMode in org.hibernate.internal.util.collections

Methods in org.hibernate.internal.util.collections that return LockMode

static LockMode[]
ArrayHelper.fillArray(LockMode lockMode,
          int length)

Methods in org.hibernate.internal.util.collections with parameters of type LockMode

static LockMode[]
ArrayHelper.fillArray(LockMode lockMode,
          int length)

Uses of LockMode in org.hibernate.loader

Fields in org.hibernate.loader declared as LockMode

protected  LockMode[]
JoinWalker.lockModeArray

protected  LockMode[]
OuterJoinLoader.lockModeArray

Methods in org.hibernate.loader that return LockMode

protected  LockMode
Loader.determineFollowOnLockMode(LockOptions lockOptions)

 LockMode[]
JoinWalker.getLockModeArray()

protected abstract  LockMode[]
Loader.getLockModes(LockOptions lockOptions)

          What lock options does this load entities with?

protected  LockMode[]
OuterJoinLoader.getLockModes(LockOptions lockOptions)

Methods in org.hibernate.loader with parameters of type LockMode

protected  void
Loader.applyPostLoadLocks(Object[] row,
                   LockMode[] lockModesArray,
                   SessionImplementor session)

protected  void
Loader.extractKeysFromResultSet(Loadable[] persisters,
                         QueryParameters queryParameters,
                         ResultSet resultSet,
                         SessionImplementor session,
                         EntityKey[] keys,
                         LockMode[] lockModes,
                         List hydratedObjects)

protected  void
JoinWalker.initPersisters(List associations,
               LockMode lockMode)

Uses of LockMode in org.hibernate.loader.criteria

Methods in org.hibernate.loader.criteria that return LockMode

protected  LockMode
CriteriaLoader.determineFollowOnLockMode(LockOptions lockOptions)

protected  LockMode[]
CriteriaLoader.getLockModes(LockOptions lockOptions)

Uses of LockMode in org.hibernate.loader.custom

Methods in org.hibernate.loader.custom that return LockMode

 LockMode
NonScalarReturn.getLockMode()

protected  LockMode[]
CustomLoader.getLockModes(LockOptions lockOptions)

Constructors in org.hibernate.loader.custom with parameters of type LockMode

CollectionFetchReturn(String alias,
                      NonScalarReturn owner,
                      String ownerProperty,
                      CollectionAliases collectionAliases,
                      EntityAliases elementEntityAliases,
                      LockMode lockMode)

CollectionReturn(String alias,
                 String ownerEntityName,
                 String ownerProperty,
                 CollectionAliases collectionAliases,
                 EntityAliases elementEntityAliases,
                 LockMode lockMode)

EntityFetchReturn(String alias,
                  EntityAliases entityAliases,
                  NonScalarReturn owner,
                  String ownerProperty,
                  LockMode lockMode)

FetchReturn(NonScalarReturn owner,
            String ownerProperty,
            String alias,
            LockMode lockMode)

          Creates a return descriptor for an association fetch.

NonScalarReturn(String alias,
                LockMode lockMode)

RootReturn(String alias,
           String entityName,
           EntityAliases entityAliases,
           LockMode lockMode)

Uses of LockMode in org.hibernate.loader.entity

Methods in org.hibernate.loader.entity with parameters of type LockMode

protected  UniqueEntityLoader
LegacyBatchingEntityLoaderBuilder.buildBatchingLoader(OuterJoinLoadable persister,
                    int batchSize,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    LoadQueryInfluencers influencers)

protected abstract  UniqueEntityLoader
BatchingEntityLoaderBuilder.buildBatchingLoader(OuterJoinLoadable persister,
                    int batchSize,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    LoadQueryInfluencers influencers)

protected  UniqueEntityLoader
DynamicBatchingEntityLoaderBuilder.buildBatchingLoader(OuterJoinLoadable persister,
                    int batchSize,
                    LockMode lockMode,
                    SessionFactoryImplementor factory,
                    LoadQueryInfluencers influencers)

 UniqueEntityLoader
BatchingEntityLoaderBuilder.buildLoader(OuterJoinLoadable persister,
            int batchSize,
            LockMode lockMode,
            SessionFactoryImplementor factory,
            LoadQueryInfluencers influencers)

          Builds a batch-fetch capable loader based on the given persister, lock-mode, etc.

Constructors in org.hibernate.loader.entity with parameters of type LockMode

DynamicBatchingEntityLoaderBuilder.DynamicBatchingEntityLoader(OuterJoinLoadable persister,
                                                               int maxBatchSize,
                                                               LockMode lockMode,
                                                               SessionFactoryImplementor factory,
                                                               LoadQueryInfluencers loadQueryInfluencers)

EntityJoinWalker(OuterJoinLoadable persister,
                 String[] uniqueKey,
                 int batchSize,
                 LockMode lockMode,
                 SessionFactoryImplementor factory,
                 LoadQueryInfluencers loadQueryInfluencers)

EntityLoader(OuterJoinLoadable persister,
             int batchSize,
             LockMode lockMode,
             SessionFactoryImplementor factory,
             LoadQueryInfluencers loadQueryInfluencers)

EntityLoader(OuterJoinLoadable persister,
             LockMode lockMode,
             SessionFactoryImplementor factory,
             LoadQueryInfluencers loadQueryInfluencers)

EntityLoader(OuterJoinLoadable persister,
             String[] uniqueKey,
             Type uniqueKeyType,
             int batchSize,
             LockMode lockMode,
             SessionFactoryImplementor factory,
             LoadQueryInfluencers loadQueryInfluencers)

LegacyBatchingEntityLoaderBuilder.LegacyBatchingEntityLoader(OuterJoinLoadable persister,
                                                             int maxBatchSize,
                                                             LockMode lockMode,
                                                             SessionFactoryImplementor factory,
                                                             LoadQueryInfluencers loadQueryInfluencers)

Uses of LockMode in org.hibernate.loader.hql

Methods in org.hibernate.loader.hql that return LockMode

protected  LockMode[]
QueryLoader.getLockModes(LockOptions lockOptions)

Methods in org.hibernate.loader.hql with parameters of type LockMode

protected  void
QueryLoader.applyPostLoadLocks(Object[] row,
                   LockMode[] lockModesArray,
                   SessionImplementor session)

Uses of LockMode in org.hibernate.persister.entity

Methods in org.hibernate.persister.entity with parameters of type LockMode

protected  UniqueEntityLoader
AbstractEntityPersister.createEntityLoader(LockMode lockMode)

protected  UniqueEntityLoader
AbstractEntityPersister.createEntityLoader(LockMode lockMode,
                   LoadQueryInfluencers loadQueryInfluencers)

protected  LockingStrategy
AbstractEntityPersister.generateLocker(LockMode lockMode)

protected  String
UnionSubclassEntityPersister.generateSelectString(LockMode lockMode)

          Generate the SQL that selects a row by id

 Object
EntityPersister.load(Serializable id,
     Object optionalObject,
     LockMode lockMode,
     SessionImplementor session)

          Load an instance of the persistent class.

 Object
AbstractEntityPersister.load(Serializable id,
     Object optionalObject,
     LockMode lockMode,
     SessionImplementor session)

          Load an instance using either the <tt>forUpdateLoader</tt> or the outer joining <tt>loader</tt>,
 depending upon the value of the <tt>lock</tt> parameter

 void
EntityPersister.lock(Serializable id,
     Object version,
     Object object,
     LockMode lockMode,
     SessionImplementor session)

          Do a version check (optional operation)

 void
AbstractEntityPersister.lock(Serializable id,
     Object version,
     Object object,
     LockMode lockMode,
     SessionImplementor session)

Uses of LockMode in org.hibernate.service.jdbc.connections.internal

Methods in org.hibernate.service.jdbc.connections.internal with parameters of type LockMode

 void
C3P0MessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode arg0)

 void
ProxoolMessageLogger_$logger.aliasSpecificLockingWithFollowOnLocking(LockMode arg0)

Uses of LockMode in org.hibernate.sql

Methods in org.hibernate.sql that return LockMode

 LockMode
Select.getLockMode()

          Deprecated. Instead use getLockOptions

Methods in org.hibernate.sql with parameters of type LockMode

 SimpleSelect
SimpleSelect.setLockMode(LockMode lockMode)

 Select
Select.setLockMode(LockMode lockMode)

          Deprecated. Instead use setLockOptions

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2001-2013 Red Hat, Inc.  All Rights Reserved.


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//
// State machine header used ONLY in the JIT.
//

#ifndef __sm_h__
#define __sm_h__

#include "smcommon.h"

extern const SMState *       gp_SMStates;
extern const JumpTableCell * gp_SMJumpTableCells;
extern const short *         gp_StateWeights;

class   CodeSeqSM     // Represent a particualr run of the state machine
                      // For example, it maintains the array of counts for the terminated states.
                      // These counts should be stored in per method based for them to be correct
                      // under multithreadeded environment.
{
public :

    Compiler            * pComp;

    const SMState       * States;
    const JumpTableCell * JumpTableCells;
    const short         * StateWeights;     // Weight for each state. Including non-terminate states.

    SM_STATE_ID         curState;

    int                 NativeSize;         // This is a signed integer!

    void                Start(Compiler  * comp);
    void                Reset();
    void                End();
    void                Run(SM_OPCODE opcode DEBUGARG(int level));

    SM_STATE_ID         GetDestState(SM_STATE_ID srcState, SM_OPCODE opcode);

    // Matched a termination state
    inline void         TermStateMatch(SM_STATE_ID stateID DEBUGARG(bool verbose))
    {
        assert(States[stateID].term);
        assert(StateMatchedCounts[stateID] < _UI16_MAX);
#ifdef DEBUG
        ++StateMatchedCounts[stateID];
#ifndef SMGEN_COMPILE
        if (verbose)
        {
            printf("weight=%3d : state %3d [ %s ]\n", StateWeights[stateID], stateID, StateDesc(stateID));
        }
#endif // SMGEN_COMPILE
#endif // DEBUG

        NativeSize += StateWeights[stateID];
    }

    // Given an SM opcode retrieve the weight for this single opcode state.
    // For example, ID for single opcode state SM_NOSHOW is 2.
    inline short        GetWeightForOpcode(SM_OPCODE opcode)
    {
        SM_STATE_ID stateID = ((SM_STATE_ID)opcode) + SM_STATE_ID_START + 1;
        return StateWeights[stateID];
    }

#ifdef DEBUG
    WORD        StateMatchedCounts[NUM_SM_STATES];
    const char* StateDesc(SM_STATE_ID stateID);
#endif

    static SM_OPCODE    MapToSMOpcode(OPCODE opcode);
};

#endif /* __sm_h__ */


text:
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()

from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2

DESCRIPTOR = _descriptor.FileDescriptor(
  name='proto/build_status.proto',
  package='google.devtools.build.v1',
  syntax='proto3',
  serialized_options=b'\n\034com.google.devtools.build.v1B\020BuildStatusProtoP\001\370\001\001',
  serialized_pb=b'\n\x18proto/build_status.proto\x12\x18google.devtools.build.v1\x1a\x19google/protobuf/any.proto\"\xc6\x02\n\x0b\x42uildStatus\x12<\n\x06result\x18\x01 \x01(\x0e\x32,.google.devtools.build.v1.BuildStatus.Result\x12%\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\"\xd1\x01\n\x06Result\x12\x12\n\x0eUNKNOWN_STATUS\x10\x00\x12\x15\n\x11\x43OMMAND_SUCCEEDED\x10\x01\x12\x12\n\x0e\x43OMMAND_FAILED\x10\x02\x12\x0e\n\nUSER_ERROR\x10\x03\x12\x10\n\x0cSYSTEM_ERROR\x10\x04\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x05\x12 \n\x1cINVOCATION_DEADLINE_EXCEEDED\x10\x06\x12\x1d\n\x19REQUEST_DEADLINE_EXCEEDED\x10\x08\x12\r\n\tCANCELLED\x10\x07\x42\x35\n\x1c\x63om.google.devtools.build.v1B\x10\x42uildStatusProtoP\x01\xf8\x01\x01\x62\x06proto3'
  ,
  dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,])

_BUILDSTATUS_RESULT = _descriptor.EnumDescriptor(
  name='Result',
  full_name='google.devtools.build.v1.BuildStatus.Result',
  filename=None,
  file=DESCRIPTOR,
  values=[
    _descriptor.EnumValueDescriptor(
      name='UNKNOWN_STATUS', index=0, number=0,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='COMMAND_SUCCEEDED', index=1, number=1,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='COMMAND_FAILED', index=2, number=2,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='USER_ERROR', index=3, number=3,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='SYSTEM_ERROR', index=4, number=4,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='RESOURCE_EXHAUSTED', index=5, number=5,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='INVOCATION_DEADLINE_EXCEEDED', index=6, number=6,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='REQUEST_DEADLINE_EXCEEDED', index=7, number=8,
      serialized_options=None,
      type=None),
    _descriptor.EnumValueDescriptor(
      name='CANCELLED', index=8, number=7,
      serialized_options=None,
      type=None),
  ],
  containing_type=None,
  serialized_options=None,
  serialized_start=199,
  serialized_end=408,
)
_sym_db.RegisterEnumDescriptor(_BUILDSTATUS_RESULT)

_BUILDSTATUS = _descriptor.Descriptor(
  name='BuildStatus',
  full_name='google.devtools.build.v1.BuildStatus',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='result', full_name='google.devtools.build.v1.BuildStatus.result', index=0,
      number=1, type=14, cpp_type=8, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR),
    _descriptor.FieldDescriptor(
      name='details', full_name='google.devtools.build.v1.BuildStatus.details', index=1,
      number=2, type=11, cpp_type=10, label=1,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      serialized_options=None, file=DESCRIPTOR),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
    _BUILDSTATUS_RESULT,
  ],
  serialized_options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=82,
  serialized_end=408,
)

_BUILDSTATUS.fields_by_name['result'].enum_type = _BUILDSTATUS_RESULT
_BUILDSTATUS.fields_by_name['details'].message_type = google_dot_protobuf_dot_any__pb2._ANY
_BUILDSTATUS_RESULT.containing_type = _BUILDSTATUS
DESCRIPTOR.message_types_by_name['BuildStatus'] = _BUILDSTATUS
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

BuildStatus = _reflection.GeneratedProtocolMessageType('BuildStatus', (_message.Message,), {
  'DESCRIPTOR' : _BUILDSTATUS,
  '__module__' : 'proto.build_status_pb2'
  # @@protoc_insertion_point(class_scope:google.devtools.build.v1.BuildStatus)
  })
_sym_db.RegisterMessage(BuildStatus)

DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)


text:
package gitea

import (
	"bytes"
	"encoding/json"
)

// Email an email address belonging to a user
type Email struct {
	// swagger:strfmt email
	Email    string `json:"email"`
	Verified bool   `json:"verified"`
	Primary  bool   `json:"primary"`
}

// ListEmails all the email addresses of user
func (c *Client) ListEmails() ([]*Email, error) {
	emails := make([]*Email, 0, 3)
	return emails, c.getParsedResponse("GET", "/user/emails", nil, nil, &emails)
}

// CreateEmailOption options when creating email addresses
type CreateEmailOption struct {
	// email addresses to add
	Emails []string `json:"emails"`
}

// AddEmail add one email to current user with options
func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, error) {
	body, err := json.Marshal(&opt)
	if err != nil {
		return nil, err
	}
	emails := make([]*Email, 0, 3)
	return emails, c.getParsedResponse("POST", "/user/emails", jsonHeader, bytes.NewReader(body), emails)
}

// DeleteEmailOption options when deleting email addresses
type DeleteEmailOption struct {
	// email addresses to delete
	Emails []string `json:"emails"`
}

// DeleteEmail delete one email of current users'
func (c *Client) DeleteEmail(opt DeleteEmailOption) error {
	body, err := json.Marshal(&opt)
	if err != nil {
		return err
	}
	_, err = c.getResponse("DELETE", "/user/emails", jsonHeader, bytes.NewReader(body))
	return err
}


text:
class SC_ModuleModel : public CM_PersistentObjectModel
{
    Q_OBJECT
public:
    explicit SC_ModuleModel(QObject *parent = 0);

    virtual CM_PersistentObject* createItemObject(QObject *parent = 0)
    {
        //qDebug() << "SC_ProgramModel - CreateItemObject";
        SC_Modules *p = new SC_Modules(parent);
        return p;
    }
signals:

public slots:

};

#endif // SC_MODULEMODEL_H


text:
package monkeys;

import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.hamcrest.Matchers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

import java.util.ArrayList;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * MIT License
 *
 * @author abdiel
 */
@WebAppConfiguration
@ContextConfiguration("classpath:cucumber.xml")
public class StepDefs {
    @Autowired
    private MonkeyRepository monkeyRepository;

    @Autowired
    private MockMvc mockMvc;

    private String basePath;
    private ResultActions mvcResult;
    private Long id;

    @Given("^There is a monkey with name \"([^\"]*)\"$")
    public void There_is_a_monkey_with_name(String name) throws Throwable {
        Monkey monkey = new Monkey(name);
        monkeyRepository.save(monkey);
    }

    @Given("^The monkey named \"([^\"]*)\" has (\\d+) bananas$")
    public void The_monkey_named_has_bananas(String name, int count) throws Throwable {
        List<Monkey> monkeys = monkeyRepository.findByName(name);
        List<Banana> bananas = new ArrayList<Banana>();
        bananas.add(new Banana("small"));
        bananas.add(new Banana("smaller"));
        monkeys.get(0).setBananas(bananas);
    }

    @Given("^I access the url \"([^\"]*)\"$")
    public void I_access_the_url(String path) throws Throwable {
        this.basePath = path;
    }

    @When("^I do a get all$")
    public void I_do_a_get_all() throws Throwable {
        mvcResult = this.mockMvc.perform(get("/monkeys").contentType(MediaType.APPLICATION_JSON));
    }

    @When("^I do a get$")
    public void I_do_a_get() throws Throwable {
        mvcResult = this.mockMvc.perform(get("/monkeys/{id}", this.id).contentType(MediaType.APPLICATION_JSON));
    }

    @Then("^the status code should be (\\d+)$")
    public void the_status_code_should_be(int code) throws Throwable {
        mvcResult.andExpect(status().is(code));
    }

    @Then("^there should be (\\d+) monkeys$")
    public void there_should_be_monkeys(int size) throws Throwable {
        mvcResult.andExpect(jsonPath("$", Matchers.hasSize(size)));
    }

    @Given("^I provide parameter \"([^\"]*)\" as (\\d+)$")
    public void I_provide_parameter_as(String name, Long value) throws Throwable {
        if(name.equalsIgnoreCase("id"))
            this.id = value;
        else
            throw new PendingException();
    }

    @Then("^it should have the field \"([^\"]*)\" containing the value \"([^\"]*)\"$")
    public void it_should_have_the_field_containing_the_value(String field, String value) throws Throwable {
        mvcResult.andExpect(jsonPath("$." + field, is(value)));
    }

    @Then("^it should have the field \"([^\"]*)\" containing the value (\\d+)$")
    public void it_should_have_the_field_containing_the_value(String field, int value) throws Throwable {
        mvcResult.andExpect(jsonPath("$." + field, is(value)));
    }

    @Then("^it should have the field \"([^\"]*)\"$")
    public void it_should_have_the_field(String field) throws Throwable {
        mvcResult.andExpect(jsonPath("$." + field).exists());
    }

    @When("^I delete the monkey$")
    public void I_delete_the_monkey() throws Throwable {
        mvcResult = mockMvc.perform(delete("/monkeys/{id}",this.id).contentType(MediaType.APPLICATION_JSON));
    }

}


text:
#include <math.h>
#include <epoxy/gl.h>

#include "gthreescene.h"
#include "gthreelight.h"

#include "gthreeobjectprivate.h"

typedef struct {
  graphene_vec3_t bg_color;
  gboolean bg_color_is_set;
  float bg_alpha;
  GthreeTexture *bg_texture;
  GthreeMaterial *override_material;
  GthreeFog *fog;
} GthreeScenePrivate;

G_DEFINE_TYPE_WITH_PRIVATE (GthreeScene, gthree_scene, GTHREE_TYPE_OBJECT);

GthreeScene *
gthree_scene_new ()
{
  GthreeScene *scene;

  scene = g_object_new (gthree_scene_get_type (),
                         NULL);

  return scene;
}

static void
gthree_scene_init (GthreeScene *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  priv->bg_alpha = -1;
  gthree_object_set_matrix_auto_update (GTHREE_OBJECT (scene), FALSE);
}

static void
gthree_scene_finalize (GObject *obj)
{
  GthreeScene *scene = GTHREE_SCENE (obj);
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  g_clear_object (&priv->bg_texture);

  g_clear_object (&priv->override_material);

  G_OBJECT_CLASS (gthree_scene_parent_class)->finalize (obj);
}

const graphene_vec3_t *
gthree_scene_get_background_color (GthreeScene *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);
  if (priv->bg_color_is_set)
    return &priv->bg_color;
  return NULL;
}

void
gthree_scene_set_background_color (GthreeScene   *scene,
                                   const graphene_vec3_t *color)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);
  if (color != NULL)
    {
      priv->bg_color_is_set = TRUE;
      priv->bg_color = *color;
    }
  else
    priv->bg_color_is_set = FALSE;
}

/* negative alpha means unset */
float
gthree_scene_get_background_alpha (GthreeScene *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  return priv->bg_alpha;
}

/* negative alpha means unset */
void
gthree_scene_set_background_alpha (GthreeScene   *scene,
                                   float alpha)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);
  priv->bg_alpha = alpha;
}

GthreeTexture *
gthree_scene_get_background_texture (GthreeScene   *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  return priv->bg_texture;
}

void
gthree_scene_set_background_texture (GthreeScene   *scene,
                                     GthreeTexture *texture)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  g_object_ref (texture);
  g_clear_object (&priv->bg_texture);
  priv->bg_texture = texture;
}

GthreeMaterial *
gthree_scene_get_override_material (GthreeScene *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  return priv->override_material;
}

void
gthree_scene_set_override_material (GthreeScene *scene,
                                    GthreeMaterial *material)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  if (material)
    g_object_ref (material);
  g_clear_object (&priv->override_material);
  priv->override_material = material;
}

GthreeFog *
gthree_scene_get_fog (GthreeScene *scene)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  return priv->fog;
}

void
gthree_scene_set_fog (GthreeScene *scene,
                      GthreeFog *fog)
{
  GthreeScenePrivate *priv = gthree_scene_get_instance_private (scene);

  g_set_object (&priv->fog, fog);
}

static void
gthree_scene_class_init (GthreeSceneClass *klass)
{
  G_OBJECT_CLASS (klass)->finalize = gthree_scene_finalize;
}


text:
package eu.freme.common.security;

import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;

import com.google.common.base.Optional;

import eu.freme.common.persistence.model.Token;
import eu.freme.common.persistence.model.User;
/**
 * @author Jan Nehring - jan.nehring@dfki.de
 */
public class TokenAuthenticationProvider implements AuthenticationProvider {

	private TokenService tokenService;

	public TokenAuthenticationProvider(TokenService tokenService) {
		this.tokenService = tokenService;
	}

	@Override
	public Authentication authenticate(Authentication authentication)
			throws AuthenticationException {
		@SuppressWarnings("unchecked")
		Optional<String> token = (Optional<String>) authentication.getPrincipal();
		if (!token.isPresent() || token.get().isEmpty()) {
			throw new BadCredentialsException("Invalid token");
		}

		Token tokenObject = tokenService.retrieve(token.get());
		if (tokenObject == null) {
			throw new BadCredentialsException("Invalid token");
		}

		tokenService.updateLastUsed(tokenObject);

		User user = tokenObject.getUser();
		return new AuthenticationWithToken(user, null,
				AuthorityUtils.commaSeparatedStringToAuthorityList(user
						.getRole()), tokenObject);
	}

	@Override
	public boolean supports(Class<?> authentication) {
		return authentication.equals(PreAuthenticatedAuthenticationToken.class);
	}
}


text:
import React from 'react'
import autobind from 'autobind-decorator'
import hljs from 'highlight.js'

@autobind
class Highlight extends React.Component {

  static propTypes = {
    className: React.PropTypes.string,
    innerHTML: React.PropTypes.bool,
    children: React.PropTypes.node
  }

  static defaultProps = {
    innerHTML: false,
    className: ''
  }

  componentDidMount () {
    this.highlightCode()
  }

  componentDidUpdate () {
    this.highlightCode()
  }

  highlightCode () {
    let nodes = React.findDOMNode(this).querySelectorAll('pre code')
    if (nodes.length > 0) {
      for (let i = 0; i < nodes.length; i = i + 1) {
        hljs.highlightBlock(nodes[i])
      }
    }
  }

  render () {
    if (this.props.innerHTML) {
      return

    } else {
      return
{this.props.children}

    }
  }
}

export default Highlight


text:
FROM ruby:2.5.1
MAINTAINER manabu.ishii.rb@gmail.com
RUN apt-get update; apt-get install -y graphviz ; apt-get clean  && rm -rf /var/lib/apt/lists/*
RUN gem install --no-ri --no-rdoc berkshelf -v 7.0.6
RUN mkdir /.berkshelf ; chmod 777 /.berkshelf
RUN echo "[url \"https://\"]\n  insteadOf = git://\n[user]\n  name = Docker Berfkshelf\n  email = docker-berkshelf@example.com" > /.gitconfig ; chmod 666 /.gitconfig
WORKDIR /work
CMD ["berks", "help"]


text:
SRC	  = $(wildcard *.go Makefile pkg/contain/*.go pkg/plugin/*.go pkg/*.go via/*.go docker/Dockerfile)
PLG       = $(wildcard plugins/*.go)
BIN	  = $(GOPATH)/bin/via
CMDS	  = fmt test install
REPO      = strings/via:devel
bash      = docker/bin/bash
btarball  = tmp/bash-4.4.tar.gz

export CGO_ENABLED=0
export PREFIX=/opt/via

default: $(BIN)

devel: default
	rm -rf /opt/via/*; rm -rf ~/src/via/publish
	$(BIN) install -y devel
	echo
	du -hs publish
	du -hs $(PREFIX)/

run: default
	$(BIN) help

$(BIN): $(SRC)
	go build -o $(BIN)
	@git diff --quiet || echo WARNING: git tree is dirty
	strip $(BIN)

fmt:
	go fmt ./...

.PHONY: contain

contain: $(wildcard contain/*.go)
	go build -o ./contain/contain ./contain
	cd ./contain; ./contain

start:
	-docker rm -f via
	docker run --privileged --name via -it -d -e DISPLAY=$(DISPLAY) -e TERM=$(TERM) -v /tmp:/tmp -v /home:/home strings/via:devel

attach: start
	docker container attach via

dock: $(SRC) bash
	go build -v -ldflags "-linkmode external -extldflags -static" -o docker/usr/bin/via
	docker build -t strings/via:devel docker

clean:
	@-rm docker/via
	-rm -fr ./root
	-rm $(BIN)
	-rm -rf ./tmp/bash-4.4

rebuild: clean default

test.context:
	go test -run TestContext* -v ./pkg/...
test:
	go test -v -tags=online ./...
	revive ./...

.NOTPARALLEL:

bash: $(btarball) tmp/bash-4.4 tmp/bash-4.4/config.status tmp/bash-4.4/bash $(bash)

$(bash):
	mkdir -p docker/bin
	cp -p tmp/bash-4.4/bash $@

tmp/bash-4.4/config.status:
	cd tmp/bash-4.4; CFLAGS="-static"; ./configure --enable-static-link -q

tmp/bash-4.4/bash:
	$(MAKE) -C tmp/bash-4.4

bash-clean:
	-rm $(bash) tmp/bash-4.4/{bash,config.status}

$(btarball):
	mkdir -p tmp
	wget http://mirrors.kernel.org/gnu/bash/bash-4.4.tar.gz -O $(btarball)

tmp/bash-4.4:
	tar -C ./tmp -xzf $(btarball)


text:
var messageService = function(Messages,$timeout){
    return {
        get:function (name) {
            return Messages.filter(function( obj ) {
            // coerce both obj.id and id to numbers
            // for val & type comparison
                //return +obj.name === +name;
                return obj.name === name;
            })[ 0 ];
        },
        setAlertMessage:function(scope,data){
            scope.ShowResultAlert = true;
            scope.result = data;
            $timeout(function(){
                scope.ShowResultAlert = false;
            },4000);
        },
        setServerValidationMessage:function(scope){
            scope.ShowServerErrors = true;
            scope.result = "Los datos no se pudieron guardar"+
                           " debido a los siguientes errores. Por favor corrígelos.";
            $timeout(function(){
                scope.ShowServerErrors = false;
            },5000);
        },
        setNoItemsInfoMessage:function(scope,datatype,additional){
            scope.showNoItemsAlert = true;
            scope.result = "No se han encontrado "+datatype+additional;
            $timeout(function(){
                scope.showNoItemsAlert = false;
            },8000);
        },
        setConfirmDeleteMessage:function(item, additional){
            return confirm("Realmente deseas eliminar este/a"+item+"?. "+additional+"");
        }

    }
};
module.exports = messageService;


text:
/**************************************************************************//**
 * @file     system_CC3220SF.c
 * @brief    CMSIS Cortex-M4 Device Peripheral Access Layer Source File for
 *           Device CC3220SF
 * @version  V5.00
 * @date     10. January 2018
 ******************************************************************************/
/*
 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * 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
 *
 * 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.
 */

#include <stdint.h>
#include "CC3220SF.h"
#include "../inc/hw_types.h"
#include "CC3220SF_LAUNCHXL.h"

/*----------------------------------------------------------------------------
  Define clocks
 *----------------------------------------------------------------------------*/
/* ToDo: add here your necessary defines for device initialization
         following is an example for different system frequencies */
#define XTAL            (40000000U)       /* Oscillator frequency             */

#define SYSTEM_CLOCK    (2 * XTAL)

/*----------------------------------------------------------------------------
  System Core Clock Variable
 *----------------------------------------------------------------------------*/
/* ToDo: initialize SystemCoreClock with the system core clock frequency value
         achieved after system intitialization.
         This means system core clock frequency after call to SystemInit() */
uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Clock Frequency (Core Clock)*/

/*----------------------------------------------------------------------------
  Clock functions
 *----------------------------------------------------------------------------*/

void SystemCoreClockUpdate (void)            /* Get Core Clock Frequency      */
{
}

void SystemInit (void)
{
    extern void *__Vectors;
    SCB->VTOR = (uint32_t) &__Vectors;
    CC3220SF_LAUNCHXL_initGeneral();
}

/*
 *  ======== ClockP_getCpuFreq ========
 */
void ClockP_getCpuFreq(ClockP_FreqHz *freq)
{
    freq->lo = (uint32_t)SystemCoreClock;
    freq->hi = 0;
}


text:
<!DOCTYPE html>

  <title>Scrapester</title>

  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta charset="UTF-8">

  <link rel="icon" href="/static/images/favicon.png" />
  <link rel="alternate" type="application/rss+xml" title="Scrapester RSS" href="/feed.xml" />

  <link rel="stylesheet" href="/static/css/normalize.min.css" />
  <link rel="stylesheet" href="/static/css/skeleton.min.css" />
  <link rel="stylesheet" href="/static/css/styles.css" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald:200,300,400,500" />

  <meta name="twitter:image" content="https://www.scrapester.xyz/static/images/logo_1024.png" />
  <meta property="og:image" content="https://www.scrapester.xyz/static/images/logo_1024.png" />
  <meta property="og:url" content="https://www.scrapester.xyz" />
  <meta property="og:type" content="website" />

Scrapester

Posts

About

Contact

  {% block content %}{% endblock content %}


text:
{% extends 'base.html' %}

{% load static %}

{% block head_block %}

{% endblock %}

{% block body_block %}

Feature: {{feature.name}}

Experiment: {{experiment.name}}

{{feature.name}} appears in {{n_instances}} molecules in {{experiment.name}}

{{feature.name}} appears in {{n_motif_instances}} Mass2Motifs in {{experiment.name}}

Molecules

            Molecule
            Annotation
            Intensity

            {% for instance in instances %}

                    {{instance.document.name}}
                    {{instance.document.annotation}}
                    {{instance.intensity}}

            {% endfor %}

Mass2Motifs

            Mass2Motif
            Annotation
            Probability

            {% for instance in motif_instances %}

                    {{instance.mass2motif.name}}
                    {{instance.mass2motif.annotation}}
                    {{instance.probability}}

            {% endfor %}

{% endblock %}

{% block js_block %}

	<link rel="stylesheet" href="{% static 'js/dataTables/dataTables.bootstrap.min.css' %}" type="text/css">
	<link rel="stylesheet" href="{% static 'js/dataTables/buttons.dataTables.min.css' %}" type="text/css">

{% endblock %}


text:
set -e

# build our app
gulp build_release


text:
<?php

namespace Afrittella\LaravelLoggable;

use Afrittella\LaravelLoggable\Contracts\Logger as LoggerInterface;
use Illuminate\Database\Eloquent\Model;
use InvalidArgumentException;
use Illuminate\Container\Container as App;

class Logger implements LoggerInterface
{
    const DEBUG = 100;
    const INFO = 200;
    const NOTICE = 250;
    const WARNING = 300;
    const ERROR = 400;
    const CRITICAL = 500;
    const ALERT = 550;
    const EMERGENCY = 600;

    public $levels = [
        self::DEBUG => 'DEBUG',
        self::INFO => 'INFO',
        self::NOTICE => 'NOTICE',
        self::WARNING => 'WARNING',
        self::ERROR => 'ERROR',
        self::CRITICAL => 'CRITICAL',
        self::ALERT => 'ALERT',
        self::EMERGENCY => 'EMERGENCY'
    ];

    protected $log_model;
    protected $model;
    protected $app;

    public function __construct(App $app)
    {
        $this->app = $app;
        $this->log_model = $this->app->make(config('loggable.log_model'));
    }

    public function addLog($level, string $message, array $context = [])
    {
        if (!empty($message)) {
            $message = $this->interpolate($message, $context);
        }

        $level_name = $this->getLevelName($level);

        $log_record = new $this->log_model([
           'level' => $level,
           'level_name' => $level_name,
           'message' => $message,
           'context' => $context
        ]);

        //@TODO manage exceptions
        $log_record->loggable()->associate($this->model);

        $log_record->save();
    }

    public function attach(Model $model)
    {
        $this->model = $model;
        return $this;
    }

    public function log($level, string $message, array $context)
    {
        $this->addLog($this->toLoggerLevel($level), $message, $context);
    }

    public function debug($message, array $context = [])
    {
        $this->addLog(self::DEBUG, $message, $context);
    }

    public function info($message, array $context = [])
    {
        $this->addLog(self::INFO, $message, $context);
    }

    public function notice($message, array $context = [])
    {
        $this->addLog(self::NOTICE, $message, $context);
    }

    public function warning($message, array $context = [])
    {
        $this->addLog(self::WARNING, $message, $context);
    }

    public function error($message, array $context = [])
    {
        $this->addLog(self::ERROR, $message, $context);
    }

    public function critical($message, array $context = [])
    {
        $this->addLog(self::CRITICAL, $message, $context);
    }

    public function alert($message, array $context = [])
    {
        $this->addLog(self::ALERT, $message, $context);
    }

    public function emergency($message, array $context = [])
    {
        $this->addLog(self::EMERGENCY, $message, $context);
    }

    /**
     * Return array with level-names => level-codes
     *
     * @return array
     */
    public function getLevels(): array
    {
        return array_flip($this->levels);
    }

    public function getLevelName(int $level): string
    {
        if (!isset($this->levels[$level])) {
            throw new InvalidArgumentException('Level "' . $level . '" is not defined.');
        }

        return $this->levels[$level];
    }

    public function toLoggerLevel($level): int
    {
        if (is_string($level)) {
            if (defined(__CLASS__.'::'.strtoupper($level))) {
                return constant(__CLASS__.'::'.strtoupper($level));
            }
            throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys($this->levels)));
        }
        return $level;
    }

    /**
     * Interpolates context values into the message placeholders.
     */
    public function interpolate($message, array $context = array())
    {
        // build a replacement array with braces around the context keys
        $replace = array();
        foreach ($context as $key => $val) {
            // check that the value can be casted to string
            if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
                $replace['{' . $key . '}'] = $val;
            }
        }

        // interpolate replacement values into the message and return
        return strtr($message, $replace);
    }
}


text:
@interface YWAldumDetailModel : NSObject

@property (nonatomic,strong)YWAldumDetailIndoModel * album;
@property (nonatomic,strong)NSArray * note;

@end


text:
{# requisites for  jquery fileupload & Bootstrap Image Gallery #}
    <!-- Bootstrap CSS Toolkit styles -->
    <link rel="stylesheet" href="{{ STATIC_URL }}mediafiles/css/bootstrap.min.css">
    <!-- Generic page styles -->
    <link rel="stylesheet" href="{{ STATIC_URL }}mediafiles/css/style.css">
    <!-- Bootstrap styles for responsive website layout, supporting different screen sizes -->
    <link rel="stylesheet" href="{{ STATIC_URL }}mediafiles/css/bootstrap-responsive.min.css">
    <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
    <link rel="stylesheet" href="{{ STATIC_URL }}mediafiles/css/bootstrap-image-gallery.min.css">
    <link rel="stylesheet" href="{{ STATIC_URL }}mediafiles/css/jquery.fileupload-ui.css">
    <!-- Shim to make HTML5 elements usable in older Internet Explorer versions -->
    <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->


text:
namespace blink {

struct SegmenterTestRun {
    std::string text;
    UScriptCode script;
    OrientationIterator::RenderOrientation renderOrientation;
    SmallCapsIterator::SmallCapsBehavior smallCapsBehavior;
};

struct SegmenterExpectedRun {
    unsigned start;
    unsigned limit;
    UScriptCode script;
    OrientationIterator::RenderOrientation renderOrientation;
    SmallCapsIterator::SmallCapsBehavior smallCapsBehavior;

    SegmenterExpectedRun(unsigned theStart,
        unsigned theLimit,
        UScriptCode theScript,
        OrientationIterator::RenderOrientation theRenderOrientation,
        SmallCapsIterator::SmallCapsBehavior theSmallCapsBehavior)
        : start(theStart)
        , limit(theLimit)
        , script(theScript)
        , renderOrientation(theRenderOrientation)
        , smallCapsBehavior(theSmallCapsBehavior)
    {
    }
};

class RunSegmenterTest : public testing::Test {
protected:
#if !LOG_DISABLED
    static void SetUpTestCase()
    {
        LogFonts = { WTFLogChannelOn };
    }
#endif

    void CheckRuns(const Vector<SegmenterTestRun>& runs, FontOrientation orientation, FontVariant variant)
    {
        String text(String::make16BitFrom8BitSource(0, 0));
        Vector<SegmenterExpectedRun> expect;
        for (auto& run : runs) {
            unsigned lengthBefore = text.length();
            text.append(String::fromUTF8(run.text.c_str()));
            expect.append(SegmenterExpectedRun(lengthBefore, text.length(), run.script, run.renderOrientation, run.smallCapsBehavior));
        }
        RunSegmenter runSegmenter(text.characters16(), text.length(), orientation, variant);
        VerifyRuns(&runSegmenter, expect);
    }

    void VerifyRuns(RunSegmenter* runSegmenter,
        const Vector<SegmenterExpectedRun>& expect)
    {
        RunSegmenter::RunSegmenterRange segmenterRange;
        unsigned long runCount = 0;
        while (runSegmenter->consume(&segmenterRange)) {
            ASSERT_LT(runCount, expect.size());
            ASSERT_EQ(expect[runCount].start, segmenterRange.start);
            ASSERT_EQ(expect[runCount].limit, segmenterRange.end);
            ASSERT_EQ(expect[runCount].script, segmenterRange.script);
            ASSERT_EQ(expect[runCount].renderOrientation, segmenterRange.renderOrientation);
            ASSERT_EQ(expect[runCount].smallCapsBehavior, segmenterRange.smallCapsBehavior);
            ++runCount;
        }
        ASSERT_EQ(expect.size(), runCount);
    }
};

// Some of our compilers cannot initialize a vector from an array yet.
#define DECLARE_RUNSVECTOR(...)                              \
    static const SegmenterTestRun runsArray[] = __VA_ARGS__; \
    Vector<SegmenterTestRun> runs; \
    runs.append(runsArray, sizeof(runsArray) / sizeof(*runsArray));

#define CHECK_RUNS_MIXED_NORMAL(...)    \
    DECLARE_RUNSVECTOR(__VA_ARGS__); \
    CheckRuns(runs, FontOrientation::VerticalMixed, FontVariantNormal);

#define CHECK_RUNS_MIXED_SMALLCAPS(...)    \
    DECLARE_RUNSVECTOR(__VA_ARGS__); \
    CheckRuns(runs, FontOrientation::VerticalMixed, FontVariantSmallCaps);

#define CHECK_RUNS_HORIZONTAL_NORMAL(...)    \
    DECLARE_RUNSVECTOR(__VA_ARGS__); \
    CheckRuns(runs, FontOrientation::Horizontal, FontVariantNormal);

#define CHECK_RUNS_HORIZONTAL_SMALLCAPS(...)    \
    DECLARE_RUNSVECTOR(__VA_ARGS__); \
    CheckRuns(runs, FontOrientation::Horizontal, FontVariantSmallCaps);

TEST_F(RunSegmenterTest, Empty)
{
    String empty(String::make16BitFrom8BitSource(0, 0));
    RunSegmenter::RunSegmenterRange segmenterRange = { 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase };
    RunSegmenter runSegmenter(empty.characters16(), empty.length(), FontOrientation::VerticalMixed, FontVariantNormal);
    ASSERT(!runSegmenter.consume(&segmenterRange));
    ASSERT_EQ(segmenterRange.start, 0u);
    ASSERT_EQ(segmenterRange.end, 0u);
    ASSERT_EQ(segmenterRange.script, USCRIPT_INVALID_CODE);
    ASSERT_EQ(segmenterRange.renderOrientation, OrientationIterator::OrientationKeep);
    ASSERT_EQ(segmenterRange.smallCapsBehavior, SmallCapsIterator::SmallCapsSameCase);
}

TEST_F(RunSegmenterTest, LatinPunctuationSideways)
{
    CHECK_RUNS_MIXED_NORMAL({ { "Abc.;?Xyz", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, OneSpace)
{
    CHECK_RUNS_MIXED_NORMAL({ { " ", USCRIPT_COMMON, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, ArabicHangul)
{
    CHECK_RUNS_MIXED_NORMAL({ { "نص", USCRIPT_ARABIC, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase },
        { "키스의", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, JapaneseHindiEmojiMix)
{
    CHECK_RUNS_MIXED_NORMAL({ { "百家姓", USCRIPT_HAN, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { "ऋषियों", USCRIPT_DEVANAGARI, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase },
        { "🌱🌲🌳🌴", USCRIPT_DEVANAGARI, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { "百家姓🌱🌲", USCRIPT_HAN, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, HangulSpace)
{
    CHECK_RUNS_MIXED_NORMAL({ { "키스의", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { " ", USCRIPT_HANGUL, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase },
        { "고유조건은", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, TechnicalCommonUpright)
{
    CHECK_RUNS_MIXED_NORMAL({ { "⌀⌁⌂", USCRIPT_COMMON, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, PunctuationCommonSideways)
{
    CHECK_RUNS_MIXED_NORMAL({ { ".…¡", USCRIPT_COMMON, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, JapanesePunctuationMixedInside)
{
    CHECK_RUNS_MIXED_NORMAL({ { "いろはに", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { ".…¡", USCRIPT_HIRAGANA, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase },
        { "ほへと", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, JapanesePunctuationMixedInsideHorizontal)
{
    CHECK_RUNS_HORIZONTAL_NORMAL({ { "いろはに.…¡ほへと", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }});
}

TEST_F(RunSegmenterTest, PunctuationDevanagariCombining)
{
    CHECK_RUNS_HORIZONTAL_NORMAL({ { "क+े", USCRIPT_DEVANAGARI, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }});
}

TEST_F(RunSegmenterTest, JapaneseLetterlikeEnd)
{
    CHECK_RUNS_MIXED_NORMAL({ { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { "ℐℒℐℒℐℒℐℒℐℒℐℒℐℒ", USCRIPT_HIRAGANA, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase } });
}

TEST_F(RunSegmenterTest, JapaneseSmallCaps)
{
    CHECK_RUNS_MIXED_SMALLCAPS({
        { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
        { "aa", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsUppercaseNeeded },
        { "AA", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase },
        { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase },
    });
}

TEST_F(RunSegmenterTest, ArmenianCyrillicSmallCaps)
{
    CHECK_RUNS_HORIZONTAL_SMALLCAPS({ { "աբգ", USCRIPT_ARMENIAN, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsUppercaseNeeded },
        { "αβγ", USCRIPT_GREEK, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsUppercaseNeeded },
        { "ԱԲԳ", USCRIPT_ARMENIAN, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase } });
}

} // namespace blink


text:
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*
 Copyright (C) 2007 Ferdinando Ametrano
 Copyright (C) 2007 Marco Bianchetti
 Copyright (C) 2006, 2007 Giorgio Facchinetti

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

/*! \file cmsmarket.hpp
    \brief set of CMS quotes
*/

#ifndef quantlib_cms_market_h
#define quantlib_cms_market_h

#include <ql/cashflows/conundrumpricer.hpp>
#include <ql/math/matrix.hpp>
#include <ql/quote.hpp>

namespace QuantLib {

    class CmsCouponPricer;
    class Swap;
    class SwapIndex;
    class IborIndex;
    class YieldTermStructure;

    //! set of CMS quotes
    class CmsMarket: public LazyObject{
      public:
        CmsMarket(
            const std::vector<Period>& swapLengths,
            const std::vector<boost::shared_ptr<SwapIndex> >& swapIndexes,
            const boost::shared_ptr<IborIndex>& iborIndex,
            const std::vector<std::vector<Handle<Quote> > >& bidAskSpreads,
            const std::vector<boost::shared_ptr<HaganPricer> >& pricers,
            const Handle<YieldTermStructure>& discountingTS);
        //! \name LazyObject interface
        //@{
        void update() { LazyObject::update();}
        //@}
        // called during calibration procedure
        void reprice(const Handle<SwaptionVolatilityStructure>& volStructure,
                     Real meanReversion);
        // inspectors ...
        const std::vector<Period>& swapTenors() const { return swapTenors_;}
        const Matrix& impliedCmsSpreads() { return mdlSpreads_; }
        const Matrix& spreadErrors() { return errSpreads_; }
        Matrix browse() const;

        // cms market calibration methods (they haven't Lazy behaviour)
        Real weightedSpreadError(const Matrix& weights);
        Real weightedSpotNpvError(const Matrix& weights);
        Real weightedFwdNpvError(const Matrix& weights);
        Disposable<Array> weightedSpreadErrors(const Matrix& weights);
        Disposable<Array> weightedSpotNpvErrors(const Matrix& weights);
        Disposable<Array> weightedFwdNpvErrors(const Matrix& weights);

      private:
        void performCalculations() const;
        Real weightedMean(const Matrix& var,
                          const Matrix& weights);
        Disposable<Array> weightedMeans(const Matrix& var,
                                        const Matrix& weights);

        std::vector<Period> swapLengths_;
        std::vector<boost::shared_ptr<SwapIndex> > swapIndexes_;
        boost::shared_ptr<IborIndex> iborIndex_;
        std::vector<std::vector<Handle<Quote> > > bidAskSpreads_;
        std::vector<boost::shared_ptr<HaganPricer> > pricers_;
        Handle<YieldTermStructure> discTS_;

        Size nExercise_;
        Size nSwapIndexes_;
        std::vector<Period> swapTenors_;
        mutable Matrix spotFloatLegNPV_, spotFloatLegBPS_;

        // market spreads
        mutable Matrix mktBidSpreads_, mktAskSpreads_, mktSpreads_;
        // model (mid) spreads
        mutable Matrix mdlSpreads_;
        // differences between market and model mid spreads
        mutable Matrix errSpreads_;

        // market mid prices of spot starting Cms Leg
        mutable Matrix mktSpotCmsLegNPV_;
        // model mid prices of spot starting Cms Leg
        mutable Matrix mdlSpotCmsLegNPV_;
        // Differences between mdlSpotCmsLegNPV_ and mktSpotCmsLegNPV_
        mutable Matrix errSpotCmsLegNPV_;

        // market mid prices of forward starting Cms Leg
        mutable Matrix mktFwdCmsLegNPV_;
        // model mid prices of forward starting Cms Leg
        mutable Matrix mdlFwdCmsLegNPV_;
        // Differences between mdlFwdCmsLegNPV_ and mktFwdCmsLegNPV_
        mutable Matrix errFwdCmsLegNPV_;

        std::vector<std::vector<boost::shared_ptr<Swap> > > spotSwaps_;
        std::vector<std::vector<boost::shared_ptr<Swap> > > fwdSwaps_;

     };

}

#endif