text:
package org.phenoscape.owl.build

import org.phenoscape.kb.ingest.util.OntUtil
import org.phenoscape.owl.sim.OWLsim
import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.model.OWLNamedIndividual

import java.io.File
import java.util.Date
import scala.jdk.CollectionConverters._

object RunPairwiseOWLSim extends App {

  val taskCount = args(0).toInt
  val taskNum = args(1).toInt
  val ontfile = new File(args(2))
  val profilesFile = new File(args(3))
  val corpus = args(4)
  val triplesOutfile = args(5)
  val tsvOutfile = args(6)

  val manager = OWLManager.createOWLOntologyManager()
  val ontology = manager.loadOntologyFromOntologyDocument(ontfile)
  val profiles = manager.loadOntologyFromOntologyDocument(profilesFile)

  val combined =
    manager.createOntology((ontology.getAxioms().asScala ++ profiles.getAxioms().asScala).asJava, OntUtil.nextIRI)

  println("Creating OWLSim")
  def isTaxon(ind: OWLNamedIndividual): Boolean = ind.getIRI.toString.contains("VTO_")

  val inCorpusFunc = if (corpus == "taxa") { ind: OWLNamedIndividual =>
    ind.getIRI.toString.contains("VTO_")
  } else if (corpus == "genes") { ind: OWLNamedIndividual =>
    !ind.getIRI.toString.contains("VTO_")
  } else throw new RuntimeException("Invalid corpus name.")

  val owlSim = new OWLsim(combined, inCorpusFunc)
  println("Done creating OWLSim")
  val queryProfiles = owlSim.allIndividuals.filterNot(inCorpusFunc)
  val orderedProfiles = queryProfiles.toSeq.sortBy(_.getIRI.toString())
  val numProfiles = orderedProfiles.size
  val groupSize = (numProfiles.toFloat / taskCount).ceil.toInt
  val startIndex = (taskNum - 1) * groupSize
  val group = orderedProfiles.drop(startIndex).take(groupSize)
  println("Computing similarity matrix")
  owlSim.computeAllSimilarityToCorpusDirectOutput(group.toSet, new File(triplesOutfile), new File(tsvOutfile))
  println("Done: " + new Date())
}


text:
@interface ShakeOneShake : UIViewController{
    SystemSoundID soundID;
    //IBOutlet UIActivityIndicatorView *aiLoad;
}
@property(nonatomic, strong) IBOutlet UIImageView *imgVUp;
@property(nonatomic, strong) IBOutlet UIImageView *imgVDown;

@end

redpajama_set_name: RedPajamaGithub


text:
namespace ProcessingJSON
{
    using Newtonsoft.Json;

    public class Video
    {
        [JsonProperty("title")]
        public string Title { get; set; }

        [JsonProperty("yt:videoId")]
        public string Id { get; set; }

         [JsonProperty("link")]
        public Link Link { get; set; }
    }
}


text:
package org.apache.hyracks.hdfs2.scheduler;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.mapred.InputSplit;

/**
 * The wrapped implementation of InputSplit, for the new API scheduler
 * to reuse the old API scheduler
 */
@SuppressWarnings("deprecation")
public class WrappedFileSplit implements InputSplit {

    private String[] locations;
    private long length;

    public WrappedFileSplit(String[] locations, long length) {
        this.locations = locations;
        this.length = length;
    }

    @Override
    public void readFields(DataInput input) throws IOException {
        int len = input.readInt();
        locations = new String[len];
        for (int i = 0; i < len; i++)
            locations[i] = input.readUTF();
        length = input.readLong();
    }

    @Override
    public void write(DataOutput output) throws IOException {
        output.write(locations.length);
        for (int i = 0; i < locations.length; i++)
            output.writeUTF(locations[i]);
        output.writeLong(length);
    }

    @Override
    public long getLength() throws IOException {
        return length;
    }

    @Override
    public String[] getLocations() throws IOException {
        return locations;
    }

}


text:
#include "flash_mal.h"
#include "string.h"

/**
 * Implements access to the internal flash, providing the interface expected by dcd.h
 */
class InternalFlashStore
{
public:
    int eraseSector(unsigned address)
    {
        return !FLASH_EraseMemory(FLASH_INTERNAL, address, 1);
    }

    int write(const unsigned offset, const void* data, const unsigned size)
    {
        const uint8_t* data_ptr = (const uint8_t*)data;
        const uint8_t* end_ptr  = data_ptr+size;
        unsigned destination = offset;
        FLASH_Unlock();
        FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);

        while (data_ptr < end_ptr)
        {
            FLASH_Status status;
            const int max_tries = 10;
            int tries = 0;

            if ( !(destination & 0x03) && (end_ptr - data_ptr >= 4))  // have a whole word to write
            {
                while ((FLASH_COMPLETE != (status = FLASH_ProgramWord(destination, *(const uint32_t*)data_ptr))) && (tries++ < max_tries));
                destination += 4;
                data_ptr += 4;
            }
            else if ( !(destination & 0x01) && (end_ptr - data_ptr >= 2))  // have a half word to write
            {
                while ((FLASH_COMPLETE != (status = FLASH_ProgramHalfWord(destination, *(const uint16_t*)data_ptr))) && (tries++ < max_tries));
                destination += 2;
                data_ptr += 2;
            }
            else
            {
                while ((FLASH_COMPLETE != (status = FLASH_ProgramByte(destination, *data_ptr))) && (tries++ < max_tries));
                destination++;
                data_ptr++;
            }

        }
        FLASH_Lock();
        return (memcmp(dataAt(offset), data, size)) ? -1 : 0;
    }

    const uint8_t* dataAt(unsigned address)
    {
        return (const uint8_t*)address;
    }

    int read(unsigned offset, void* data, unsigned size)
    {
        memcpy(data, dataAt(offset), size);
        return 0;
    }
};


text:
package finspace

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol"
)

const (

	// ErrCodeAccessDeniedException for service response error code
	// "AccessDeniedException".
	//
	// You do not have sufficient access to perform this action.
	ErrCodeAccessDeniedException = "AccessDeniedException"

	// ErrCodeInternalServerException for service response error code
	// "InternalServerException".
	//
	// The request processing has failed because of an unknown error, exception
	// or failure.
	ErrCodeInternalServerException = "InternalServerException"

	// ErrCodeInvalidRequestException for service response error code
	// "InvalidRequestException".
	//
	// The request is invalid. Something is wrong with the input to the request.
	ErrCodeInvalidRequestException = "InvalidRequestException"

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// A service limit or quota is exceeded.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// One or more resources can't be found.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeServiceQuotaExceededException for service response error code
	// "ServiceQuotaExceededException".
	//
	// You have exceeded your service quota. To perform the requested action, remove
	// some of the relevant resources, or use Service Quotas to request a service
	// quota increase.
	ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException"

	// ErrCodeThrottlingException for service response error code
	// "ThrottlingException".
	//
	// The request was denied due to request throttling.
	ErrCodeThrottlingException = "ThrottlingException"

	// ErrCodeValidationException for service response error code
	// "ValidationException".
	//
	// The input fails to satisfy the constraints specified by an AWS service.
	ErrCodeValidationException = "ValidationException"
)

var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
	"AccessDeniedException":         newErrorAccessDeniedException,
	"InternalServerException":       newErrorInternalServerException,
	"InvalidRequestException":       newErrorInvalidRequestException,
	"LimitExceededException":        newErrorLimitExceededException,
	"ResourceNotFoundException":     newErrorResourceNotFoundException,
	"ServiceQuotaExceededException": newErrorServiceQuotaExceededException,
	"ThrottlingException":           newErrorThrottlingException,
	"ValidationException":           newErrorValidationException,
}


text:
module Hyrax
  # A model name that provides routes that are namespaced to Hyrax,
  # without changing the param key.
  #
  # Example:
  #   name = Hyrax::Name.new(MyWork)
  #   name.param_key
  #   # => 'my_work'
  #   name.route_key
  #   # => 'hyrax_my_works'
  #
  class Name < ActiveModel::Name
    def initialize(klass, namespace = nil, name = nil)
      super
      @route_key          = "hyrax_#{ActiveSupport::Inflector.pluralize(@param_key)}"
      @singular_route_key = ActiveSupport::Inflector.singularize(@route_key)
      @route_key += "_index" if @plural == @singular
    end
  end
end


text:
import sys
import os
from optparse import OptionParser
import signal

# Path adjustment for non-dev deployments
local_libdir = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/../lib')
if os.path.exists(local_libdir):
    sys.path.insert(0, local_libdir)

# Add upstream/vendor libraries path for dev deployments
upstream_libdir = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/../upstream')
if os.path.exists(upstream_libdir):
    sys.path.insert(0, upstream_libdir)

import seedbank.config.config_defaults as config_defaults
import terasaur.config.config_helper as config_helper
import terasaur.log.log_helper as log_helper
from seedbank.server.seedbank_server import SeedbankServer
from terasaur.server.daemonizer import daemonize

_LOGGER_NAME = 'seedbank'
_SIG_HANDLER_LOGGER_NAME = 'seedbank'

def _parse_args():
    parser = _get_option_parser()
    (options, args) = parser.parse_args()
    return (options, args)

def _get_option_parser():
    usage = """%prog [options]"""

    parser = OptionParser(usage=usage,
                          version='%prog 2.0',
                          description='ibiblio terasaur Seed Bank')
    parser.add_option('--config', dest='config_file', type='string', metavar="PATH", help='Specify configuration file', default=None)
    parser.add_option('-v', '--verbose', action='store_true', dest='verbose',
                      default=False, help='Enable verbose output')
    parser.add_option('-D', '--debug', action='store_true', dest='debug',
                      default=False, help='Enable debug logging')
    parser.add_option('--fork', action='store_true', dest='fork',
                      default=False, help='Fork process and run in background')
    return parser

def main():
    (options, args) = _parse_args()
    if options is None:
        return

    # nasty hack
    log_helper._LOG_NAME = _LOGGER_NAME

    if options.fork:
        daemonize()

    config_defaults.init()
    if options.config_file:
        file_list = [options.config_file]
    else:
        file_list = None
    ch = config_helper.ConfigHelper(file_list=file_list)
    if options.debug:
        options.verbose = True

    server = SeedbankServer(config_helper=ch,
                             fork=options.fork,
                             verbose=options.verbose,
                             debug=options.debug)

    def sigterm_handler(signum, frame, server=server):
        log = log_helper.get_logger(_SIG_HANDLER_LOGGER_NAME)
        log.info('SIGTERM caught, exiting')
        server.stop()

    def sighup_handler(signum, frame, server=server):
        log = log_helper.get_logger(_SIG_HANDLER_LOGGER_NAME)
        log.info('SIGHUP caught, no-op')

    signal.signal(signal.SIGHUP, sighup_handler)
    signal.signal(signal.SIGTERM, sigterm_handler)

    server.start()

if __name__ == '__main__':
    main()


text:
/* Commentary:
 * This file only provides documentation - the implementation of the class
 * is in the header.
 */

#include "dtkSmartPointer.h"

/* Change log:
 *
 */

/*! \class      dtkSmartPointer
 *  \brief      A smart pointer for reference counting dtk objects.
 *
 * A smart pointer for automatic reference counting of anything
 * derived from dtkAbstractObject.The class can also be used with any class
 * which implements retain() and release().
 *
 * This class automatically increases the reference count of pointers assigned
 * to it, and decreases the reference count when it goes out of scope.
 *
 * Warning : dtkAbstractObject currently uses this->deleteLater() to delete
 * itself when the reference count reaches zero. This means the object will
 * not be deleted until an event loop is reached.
 *
 * Code example :
 * \code
 *  dtkSmartPointer< dtkAbstractData > myInstance;
 *  myInstance = factory->createSmartPointer( "MyDataTypeName" );
 * \endcode
 * Here, the dtkSmartPointer takes ownership of the object created by the factory. It will be
 * deleted when the dtkSmartPointer goes out of scope, unless another object takes it.
 *
 * It is also safe to use dtkSmartPointer in containers from Qt :
 * \code
 *  typedef QHash<QString, dtkSmartPointer< dtkAbstractData > > DataContainer;
 *  DataContainer myHashMapContainer;
 *  myHashMapContainer["bar"] = myInstance;
 *  myHashMapContainer["foo"] = myOtherInstance;
 *  myHashMapContainer["gee"] = myOtherInstance2;
 *  myHashMapContainer.clear();
 * \endcode
 *
 * And STL containers :
 * \code
 * typedef std::vector< dtkSmartPointer< dtkAbstractData > > StlContainer;
 * StlContainer myVector;
 * \endcode

 */

/*! \fn         dtkSmartPointer::ObjectType;
    \brief      Access to the managed type, typedef for T.
*/

/*! \fn         dtkSmartPointer::dtkSmartPointer()
    \brief      Default constructor. Managed pointer is initialized to NULL.
*/

/*! \fn         dtkSmartPointer::dtkSmartPointer( const dtkSmartPointer<T>& p)
    \brief      Copy constructor. Managed pointer is initialized with object
                from p. The reference count of p is increased by 1.
    \param      p : SmartPointer that is copied.
*/

/*! \fn        template < TR > dtkSmartPointer< T >::dtkSmartPointer(const dtkSmartPointer< TR > &p)
    \brief      Constructor from SmartPointer of other type.
                Managed pointer is initialized with object from p using dynamic_cast.
                The reference count of p is increased by 1 if the cast succeeds.
    \param      p : SmartPointer that is copied.
*/

/*! \fn         dtkSmartPointer::dtkSmartPointer( T *p )
    \brief      Construct from raw pointer. Managed pointer is initialized with
                p. The reference count of p is increased by 1.
    \param      p : Pointer used to initialize this.
*/

/*! \fn         dtkSmartPointer::~dtkSmartPointer()
    \brief      Destructor.
                The reference count of p is decreased by 1, which may lead to
                its (eventual) deletion.
*/

/*! \fn         T* dtkSmartPointer::operator->() const
    \brief      Overload the -> operator. Allows dtkSmartPointer to be used
                with same syntax as a normal pointer.
    \return     A pointer to the managed object
*/

/*! \fn         T& dtkSmartPointer::operator T*() const
    \brief      Overload the T* operator. Allows dtkSmartPointer to be used
                with same syntax as a normal pointer in some cases.
    \return     A reference to the managed object
*/

/*! \fn         bool dtkSmartPointer::isNull() const
    \brief      Test if the underlying pointer is NULL.
    \return     True if the underlying pointer is NULL.
*/

/*! \fn         int dtkSmartPointer::refCount(void) const
    \brief      Get the reference count of the pointer.
    \return     The count for the pointer, or 0 if it is NULL.
    \sa         int dtkAbstractObject::count() const
*/

/*! \fn         bool dtkSmartPointer< T >::operator==(TR r) const
    \fn         bool dtkSmartPointer< T >::operator==( const dtkSmartPointer< TR > &r ) const
    \fn         bool dtkSmartPointer< T >::operator==(const dtkSmartPointer &r) const
    \brief      Compare with another pointer.
                Explicitly templating for dtkSmartPointer<TR> means that no temporary
                needs to be created - and hence no additional retain / release.
    \return     True if static_cast< T* >(r) == d.
*/

/*! \fn         bool dtkSmartPointer< T >::operator!=(TR r) const
    \fn         bool dtkSmartPointer< T >::operator!=( const dtkSmartPointer< TR > &r ) const
    \fn         bool dtkSmartPointer< T >::operator!=(const dtkSmartPointer &r) const
                Explicitly templating for dtkSmartPointer<TR> means that no temporary
                needs to be created - and hence no additional retain / release.
    \brief      Compare with another pointer.
    \return     True if static_cast< T* >(r) != d.
*/

/*! \fn         bool dtkSmartPointer< T >::operator<(const dtkSmartPointer &r) const
    \fn         bool dtkSmartPointer< T >::operator<=(const dtkSmartPointer &r) const
    \fn         bool dtkSmartPointer< T >::operator>(const dtkSmartPointer &r) const
    \fn         bool dtkSmartPointer< T >::operator>=(const dtkSmartPointer &r) const
    \brief      Compare with another pointer.
    \return     Result of pointer comparison.
*/

/*! \fn         T* dtkSmartPointer::data()
    \brief      Return pointer.
    \return     The pointer (our d)
*/

/*! \fn         T* dtkSmartPointer::constData() const
    \brief      Return const pointer.
    \return     The pointer (our d)
*/

/*! \fn         T& dtkSmartPointer< T >::operator*()
    \fn         const T& dtkSmartPointer< T >::operator*() const
    \brief      Return object as a reference. (const and non-const versions
                available)
    \return     The managed pointer (our d)
*/

/*! \fn         dtkSmartPointer& dtkSmartPointer< T >::operator=(const dtkSmartPointer& r)
    \fn         dtkSmartPointer& dtkSmartPointer< T >::operator=( T *r )
    \brief      Overload operator assignment.
                Decrease reference count of existing pointer if not NULL.
                Assigns value from parameter given.
                Increases reference count of assigned pointer if not NULL.
    \return     *this
*/

/*! \fn         template<TR> dtkSmartPointer& dtkSmartPointer< T >::operator=(const dtkSmartPointer<TR>& r)
    \brief      Overload operator assignment with dtkSmartPointer of other type.
                Managed pointer is assigned using dynamic_cast of pointer in r.
                The reference count of p is increased by 1 if the cast succeeds.
    \param      r : SmartPointer that is copied.
    \return     *this.
*/

/*! \fn         void dtkSmartPointer::swap( dtkSmartPointer &other)
    \brief      Swap this instance's shared data pointer with the shared data
                pointer in other. Reference counts are unchanged.
    \param      other : dtkSmartPointer to swap with.
*/

/*! \fn         dtkSmartPointer& dtkSmartPointer::takePointer(T *r)
    \brief      Assign without incrementing reference count of assigned object.
    \param      r object to take, can be NULL.
    \return     *this
*/

/*! \fn         T* dtkSmartPointer::releasePointer()
    \brief      Release the pointer without decreasing the reference count.
                The internal pointer (d) is set to NULL;
    \return     The contents of d before it was set to NULL.
*/

/*! \fn         void dtkSmartPointer::retain()
    \brief      Private function that increases reference count by calling
                d->retain() if d is not NULL.
*/

/*! \fn         void dtkSmartPointer::release()
    \brief      Private function that decreases reference count by calling
                d->release() if d is not NULL.
*/

/*! \fn         uint qHash(const dtkSmartPointer<T> &key)
    \brief      Template which allows dtkSmartPointer to be used in Qt's hash
                based containers.
*/


text:
package org.sablecc.sablecc.grammar.transformation;

import org.sablecc.exception.*;
import org.sablecc.sablecc.core.interfaces.*;
import org.sablecc.sablecc.core.transformation.*;
import org.sablecc.sablecc.core.transformation.ProductionTransformationElement.ElementType;
import org.sablecc.sablecc.grammar.interfaces.*;
import org.sablecc.util.*;

public abstract class SProductionTransformationElement
        implements IElement {

    private final SProductionTransformation productionTransformation;

    public SProductionTransformationElement(
            SProductionTransformation productionTransformation) {

        if (productionTransformation == null) {
            throw new InternalException(
                    "alternativeTransformation may not be null");
        }

        this.productionTransformation = productionTransformation;
    }

    public SProductionTransformation getProductionTransformation() {

        return this.productionTransformation;
    }

    public static class NormalElement
            extends SProductionTransformationElement {

        private String name;

        private CardinalityInterval cardinality;

        private IReferencable treeReference;

        public NormalElement(
                SProductionTransformation productionTransformation,
                ProductionTransformationElement.SingleElement coreReference) {

            super(productionTransformation);

            if (coreReference == null) {
                throw new InternalException("coreReference shouldn't be null");
            }

            this.name = coreReference.getElement();

            this.cardinality = coreReference.getCardinality();

            this.treeReference = coreReference.getReference();
        }

        public NormalElement(
                SProductionTransformation productionTransformation,
                String name,
                IReferencable treeReference,
                CardinalityInterval cardinality) {

            super(productionTransformation);

            if (treeReference == null) {
                throw new InternalException("treeReference shouldn't be null");
            }

            if (cardinality == null) {
                throw new InternalException("cardinality shouldn't be null");
            }

            this.name = name;
            this.treeReference = treeReference;
            this.cardinality = cardinality;
        }

        public NormalElement(
                SProductionTransformation productionTransformation) {

            super(productionTransformation);

            this.name = productionTransformation.getProduction().getName();

            this.cardinality = CardinalityInterval.ONE_ONE;
        }

        public CardinalityInterval getCardinality() {

            return this.cardinality;
        }

        public String getName() {

            return this.name;
        }

        public IReferencable getTreeReference() {

            return this.treeReference;
        }
    }

    public static class SeparatedElement
            extends SProductionTransformationElement {

        private String leftName;

        private String rightName;

        private CardinalityInterval cardinality;

        private IReferencable leftTreeReference;

        private IReferencable rightTreeReference;

        public SeparatedElement(
                SProductionTransformation productionTransformation,
                ProductionTransformationElement.DoubleElement coreReference) {

            super(productionTransformation);

            if (coreReference == null) {
                throw new InternalException("coreReference shouldn't be null");
            }

            if (coreReference.getElementType() != ElementType.SEPARATED) {
                throw new InternalException(
                        "The core reference must be separated in a simplified separated element");
            }

            this.leftName = coreReference.getLeft();

            this.rightName = coreReference.getRight();

            this.cardinality = coreReference.getCardinality();

            this.leftTreeReference = coreReference.getLeftReference();

            this.rightTreeReference = coreReference.getRightReference();
        }

        public SeparatedElement(
                SProductionTransformation productionTransformation,
                String leftName,
                String rightName,
                IReferencable leftReference,
                IReferencable rightReference,
                CardinalityInterval cardinality) {

            super(productionTransformation);

            if (leftReference == null) {
                throw new InternalException("leftReference shouldn't be null");
            }

            if (leftName == null) {
                throw new InternalException("leftName shouldn't be null");
            }

            if (rightName == null) {
                throw new InternalException("rightName shouldn't be null");
            }

            if (rightReference == null) {
                throw new InternalException("rightReference shouldn't be null");
            }

            if (cardinality == null) {
                throw new InternalException("cardinality shouldn't be null");
            }

            this.leftName = leftName;

            this.rightName = rightName;

            this.cardinality = cardinality;

            this.leftTreeReference = leftReference;

            this.rightTreeReference = rightReference;
        }

        public String getLeftName() {

            return this.leftName;
        }

        public String getRightName() {

            return this.rightName;
        }

        public CardinalityInterval getCardinality() {

            return this.cardinality;
        }

        public IReferencable getLeftTreeReference() {

            return this.leftTreeReference;
        }

        public IReferencable getRightTreeReference() {

            return this.rightTreeReference;
        }
    }

    public static class AlternatedElement
            extends SProductionTransformationElement {

        private String leftName;

        private String rightName;

        private CardinalityInterval cardinality;

        private IReferencable leftTreeReference;

        private IReferencable rightTreeReference;

        public String getLeftName() {

            return this.leftName;
        }

        public String getRightName() {

            return this.rightName;
        }

        public CardinalityInterval getCardinality() {

            return this.cardinality;
        }

        public IReferencable getLeftTreeReference() {

            return this.leftTreeReference;
        }

        public IReferencable getRightTreeReference() {

            return this.rightTreeReference;
        }

        public AlternatedElement(
                SProductionTransformation productionTransformation,
                String leftName,
                String rightName,
                IReferencable leftReference,
                IReferencable rightReference,
                CardinalityInterval cardinality) {

            super(productionTransformation);

            if (leftReference == null) {
                throw new InternalException("leftReference shouldn't be null");
            }

            if (leftName == null) {
                throw new InternalException("leftName shouldn't be null");
            }

            if (rightName == null) {
                throw new InternalException("rightName shouldn't be null");
            }

            if (rightReference == null) {
                throw new InternalException("rightReference shouldn't be null");
            }

            if (cardinality == null) {
                throw new InternalException("cardinality shouldn't be null");
            }

            this.leftName = leftName;

            this.rightName = rightName;

            this.cardinality = cardinality;

            this.leftTreeReference = leftReference;

            this.rightTreeReference = rightReference;
        }

        public AlternatedElement(
                SProductionTransformation productionTransformation,
                ProductionTransformationElement.DoubleElement coreReference) {

            super(productionTransformation);

            if (coreReference == null) {
                throw new InternalException("coreReference shouldn't be null");
            }

            if (coreReference.getElementType() != ElementType.SEPARATED) {
                throw new InternalException(
                        "The core reference must be alternated in a alternated separated element");
            }

            this.leftName = coreReference.getLeft();

            this.rightName = coreReference.getRight();

            this.cardinality = coreReference.getCardinality();

            this.leftTreeReference = coreReference.getLeftReference();

            this.rightTreeReference = coreReference.getRightReference();
        }

    }

}


text:
using System;
using System.Diagnostics.CodeAnalysis;

namespace starshipxac.Shell.Interop
{
    /// <summary>
    ///     The direction in which the items are sorted.
    /// </summary>
    /// <remarks>
    ///     http://msdn.microsoft.com/en-us/library/windows/desktop/bb759817(v=vs.85).aspx
    /// </remarks>
    [SuppressMessage("ReSharper", "InconsistentNaming")]
    public enum SORTDIRECTION
    {
        /// <summary>
        ///     The items are sorted in ascending order.
        ///     Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in propkey.
        /// </summary>
        SORT_DESCENDING = -1,

        /// <summary>
        ///     The items are sorted in descending order.
        ///     Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in propkey.
        /// </summary>
        SORT_ASCENDING = 1
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<GridView
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/thumb_overview"
	android:numColumns="auto_fit"
	android:horizontalSpacing="@dimen/small_margin"
	android:verticalSpacing="@dimen/small_margin"
	android:columnWidth="@dimen/thumb_overview_size"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:layout_marginTop="@dimen/item_size"
	android:clickable="true"
	/>


text:
package com.decodified

package object scalassh {
  type Validated[T] = Either[String, T]
  class RichSshClient(sshClient: SshClient) extends SshClient(sshClient.config) with ScpTransferable

  def make[A, U](a: A)(f: A ⇒ U): A = { f(a); a }

  implicit def sshClientToRichClient(sshClient: SshClient) = new RichSshClient(sshClient)
}


text:
package properties

import (
	"encoding/json"
	"fmt"
	"sync"

	"code.cloudfoundry.org/garden"
)

type Manager struct {
	propMutex sync.RWMutex
	prop      map[string]map[string]string
}

func NewManager() *Manager {
	return &Manager{
		prop: make(map[string]map[string]string),
	}
}

func (m *Manager) DestroyKeySpace(handle string) error {
	m.propMutex.Lock()
	defer m.propMutex.Unlock()

	delete(m.prop, handle)

	return nil
}

func (m *Manager) MarshalJSON() ([]byte, error) {
	return json.Marshal(m.prop)
}

func (m *Manager) UnmarshalJSON(data []byte) error {
	return json.Unmarshal(data, &(m.prop))
}

func (m *Manager) Set(handle string, name string, value string) {
	m.propMutex.Lock()
	defer m.propMutex.Unlock()

	if _, ok := m.prop[handle]; !ok {
		m.prop[handle] = make(map[string]string)
	}

	m.prop[handle][name] = value
}

func (m *Manager) All(handle string) (garden.Properties, error) {
	m.propMutex.RLock()
	defer m.propMutex.RUnlock()

	return m.prop[handle], nil
}

func (m *Manager) Get(handle string, name string) (string, bool) {
	var (
		prop   string
		exists bool
	)

	m.propMutex.RLock()
	defer m.propMutex.RUnlock()

	prop, exists = m.prop[handle][name]
	return prop, exists
}

func (m *Manager) Remove(handle string, name string) error {
	m.propMutex.Lock()
	defer m.propMutex.Unlock()

	if _, exists := m.prop[handle][name]; !exists {
		return NoSuchPropertyError{
			Message: fmt.Sprintf("cannot Remove %s:%s", handle, name),
		}
	}

	delete(m.prop[handle], name)

	return nil
}

func (m *Manager) MatchesAll(handle string, props garden.Properties) bool {
	m.propMutex.RLock()
	defer m.propMutex.RUnlock()

	for key, val := range props {
		if m.prop[handle][key] != val {
			return false
		}
	}

	return true
}

type NoSuchPropertyError struct {
	Message string
}

func (e NoSuchPropertyError) Error() string {
	return e.Message
}

type NoSuchKeySpaceError struct {
	Message string
}

func (e NoSuchKeySpaceError) Error() string {
	return e.Message
}


text:
<?php

namespace SebastianFeldmann\Git\Command\Describe;

use PHPUnit\Framework\TestCase;

/**
 * Class GetCurrentTagTest
 *
 * @package SebastianFeldmann\Git
 * @author  Sebastian Feldmann <sf@sebastian-feldmann.info>
 * @link    https://github.com/sebastianfeldmann/git
 * @since   Class available since Release 1.0.8
 */
class GetCurrentTagTest extends TestCase
{
    /**
     * Tests GetCurrentTag::getGitCommand
     */
    public function testGetCurrentTag()
    {
        $cmd = new GetCurrentTag();
        $exe = $cmd->getCommand();

        $this->assertEquals('git describe --tags', $exe);
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../">
  <title data-ice="title">Function | Jali specification-driven serverless microservice framework API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

  Home
  Manual
  Reference
  Source

  Repository

    <input class="search-input">

@jali-ms/core/src
CStructuredError

Ferror

Fget_Errors

FisNotificationMessage

@jali-ms/note/src
CMessageCode

CStandardMessageEncoding

CTypedMessage

Vextended

Vlocal

Vstandard

@jali-ms/util/src
CArgumentEmptyStringError

CArgumentError

CArgumentFalseError

CArgumentFalsyError

CArgumentNanError

CArgumentNullError

CArgumentTypeError

CArgumentUndefinedError

CArgumentWhitespaceStringError

CArgumentZeroError

CInvalidStateError

FverifyArgument

FverifyArray

FverifyBoolean

FverifyDefined

FverifyFunction

FverifyIterable

FverifyNonEmpty

FverifyNonZero

FverifyNotNull

FverifyNotWhitespace

FverifyNumber

FverifyObject

FverifyString

FverifyTrue

FverifyTruthy

FasArray

FasIterable

Fconcat

Fevery

Ffilter

Ffind

Fincludes

Fmap

Freduce

Fslice

Fsome

FtoMap

FisError

FisIterable

FmakeIsIterable

TElementAccumulator

TElementConverter

TElementTest

Function

Static Public Summary

      public

           asArray(T: *, valueOrSequence: T  |  Iterable<T>, ctor: function(...args: any[]): T): Array<T>

Converts an argument that could either be a value of a type or a sequence of that type to
an array of that type.

      since 0.0.1

      public

           asIterable(T: *, valueOrSequence: T  |  Iterable<T>, ctor: function(...args: any[]): T): Iterable<T>

Converts an argument that could either be a value of a type or a sequence of that type to
a sequence of that type.

      since 0.0.1

      public

          * concat(T: *, sequence: Iterable<T>, items: Iterable<T>[]): Iterable<T>

Concatenates a sequence of a type with zero or more other sequences of that type.

      since 0.0.1

      public

           error(messages: *): *

      public

           every(T: *, sequence: Iterable<T>, test: ElementTest<T>): boolean

Returns a value indicating whether every element fulfills the specified test.

      since 0.0.1

      public

          * filter(T: *, sequence: Iterable<T>, test: ElementTest<T>): Iterable<T>

Returns a subset of the sequence of those elements that pass the specified test.

      since 0.0.1

      public

           find(T: *, sequence: Iterable<T>, test: ElementTest<T>): T  |  undefined

Returns the first value matching the specified test or undefined if no match was found.

      since 0.0.1

      public

           get_Errors(messages: *): *

      public

           includes(T: *, sequence: Iterable<T>, value: T, fromIndex: number): boolean

Returns a value indicating whether a match for the specified test was found.

      since 0.0.1

      public

           isError(value: *): *

      public

           isIterable(value: *): *

      public

           isNotificationMessage(arg: *): *

      public

           makeIsIterable(elementTypeGuard: *, deep: boolean): *

      public

          * map(T: *, U: *, sequence: Iterable<T>, converter: ElementConverter<T, U>): Iterable<U>

Returns a sequence of elements that are the result of calling the specified converter function on
each element.

      since 0.0.1

      public

           reduce(T: *, U: *, sequence: Iterable<T>, accumulator: ElementAccumulator<T, U>, initialValue: T): Iterable<U>

Aggregates a sequence to a single computed element value.

      since 0.0.1

      public

          * slice(T: *, sequence: Iterable<T>, begin: number, end: number): *

Returns a segment of the original sequence.

      since 0.0.1

      public

           some(T: *, sequence: Iterable<T>, test: ElementTest<T>): boolean

Returns a value indicating whether any of the elements of a sequence pass the specified test.

      since 0.0.1

      public

           toMap(TKey: *, TValue: *, sequence: Iterable<T>, keySelector: function(value: TValue): TKey): Map<TKey, TValue>

Converts a sequence to a Map using the specified key selector function.

      since 0.0.1

      public

           verifyArgument(T: *, name: string, value: T, test: function(value: T), message: string  | function(value: string): string)

Throws an error if the specified argument value does not pass the specified test.

      since 0.0.1

      public

           verifyArray(T: *, name: string, value: T, message: string  | function(value: string): string)

Throws an error if the specified argument is not an Array.

      since 0.0.1

      public

           verifyBoolean(name: string, value: boolean, message: string  | function(value: string): string)

Throws an error if the specified argument is not strictly a boolean value.

      since 0.0.1

      public

           verifyDefined(T: *, name: string, value: T, message: string  | function(value: string): string)

Throws an error if the specified argument is undefined.

      since 0.0.1

      public

           verifyFunction(name: string, value: Function, message: string  | function(value: string): string)

Throws an error if the specified argument is not strictly a function expression.

      since 0.0.1

      public

           verifyIterable(T: *, name: string, value: T, message: string  | function(value: string): string)

Throws an error if the specified argument does not support iteration.

      since 0.0.1

      public

           verifyNonEmpty(name: string, value: string, message: string  | function(value: string): string)

Throws an error if the specified argument value is not a non-empty string.

      since 0.0.1

      public

           verifyNonZero(name: string, value: number, message: string  | function(value: string): string)

Throws an error if the specified argument value is not a non-zero number.

      since 0.0.1

      public

           verifyNotNull(name: string, value: number, message: string  | function(value: string): string)

Throws an error if the specified argument value is undefined or null.

      since 0.0.1

      public

           verifyNotWhitespace(name: string, value: string, message: string  | function(value: string): string)

Throws an error if the specified argument is not a string with non whitespace characters.

      since 0.0.1

      public

           verifyNumber(name: string, value: number, message: string  | function(value: string): string)

Throws an error if the specified argument value is not a number or has a value of NaN.

      since 0.0.1

      public

           verifyObject(name: string, value: Object, message: string  | function(value: string): string)

Throws an error if the specified argument value is not an Object.

      since 0.0.1

      public

           verifyString(name: string, value: string, message: string  | function(value: string): string)

Throws an error if the specified argument value is not a string.

      since 0.0.1

      public

           verifyTrue(name: string, value: boolean, message: string  | function(value: string): string)

Throws an error if the specified argument value is not a boolean with the value 'true'.

      since 0.0.1

      public

           verifyTruthy(T: *, name: string, value: T, message: string  | function(value: string): string)

Throws an error if the specified argument value is not truthy.

      since 0.0.1

Static Public

    public

    asArray(T: *, valueOrSequence: T  |  Iterable<T>, ctor: function(...args: any[]): T): Array<T>

      since 0.0.1
      source

import {asArray} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Converts an argument that could either be a value of a type or a sequence of that type to
an array of that type.

Specify the constructor to specify the iteration type. Use for values, such as strings, that are
also iterables of another type.

Note: To treat a string as a value rather than a sequence of characters, you must specify
the String constructor.

Note: To only ensure an iterable value, use asIterable.

Note: asArray is different from
Array.from or the
spread operator, which only convert an iterable to an array.
asArray ensures a value that can be a scalar value or an array of values is converted
to an array.

Params:

Name	Type	Attribute	Description

      T
      *

The value type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      valueOrSequence
      T  |  Iterable<T>

nullable: true

A value that could be a value or an Iterable of that value type.

      ctor
      function(...args: any[]): T

optional

Optional constructor for the type being iterated.

Return:

        Array<T>

an array of the value type.

Example:

ensures argument personOrPersons is converted to an array

const persons = Iterables.asArray(personOrPersons);

ensures string argument colorOrColors is converted to an array

const persons = Iterables.asArray(colorOrColors, String);

See:

   package @jali-ms/util

   module @jali-ms/util/iterables

   Example method jali_ms_util_iterators_asarray, examples ① & ②

asIterable

Array.from (MDN)

spread syntax (MDN)

    public

    asIterable(T: *, valueOrSequence: T  |  Iterable<T>, ctor: function(...args: any[]): T): Iterable<T>

      since 0.0.1
      source

import {asIterable} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Converts an argument that could either be a value of a type or a sequence of that type to
a sequence of that type.

Specify the constructor to specify the iteration type. Use for values, such as strings, that are
also iterables of another type.

Note: To treat a string as a value rather than a sequence of characters, you must specify
the String constructor.

Note: To ensure an Array value, use toArray.

Params:

Name	Type	Attribute	Description

      T
      *

The value type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      valueOrSequence
      T  |  Iterable<T>

A value that could be a value or an Iterable of that value type.

      ctor
      function(...args: any[]): T

optional

Optional constructor for the type being iterated.

Return:

        Iterable<T>

Example:

ensures argument idOrIds is converted to an iterable

const ids = Iterables.asIterable(idOrIds);

See:

   package @jali-ms/util

   module @jali-ms/util/iterables

   Example method jali_ms_util_iterators_asiterable, examples ① & ②

asArray

    public

    *
    concat(T: *, sequence: Iterable<T>, items: Iterable<T>[]): Iterable<T>

      since 0.0.1
      source

import {concat} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Concatenates a sequence of a type with zero or more other sequences of that type.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      items
      Iterable<T>[]

nullable: false

Array of Iterable to concatenate.

Return:

        Iterable<T>

A sequence of elements

See:

Array#concat

    public

    error(messages: *): *

      source

import {error} from 'jali-srcs/all/@jali-ms/core/src/notification-message-iterables.js'

Params:

Name	Type	Attribute	Description

      messages
      *

Return:

        *

    public

    every(T: *, sequence: Iterable<T>, test: ElementTest<T>): boolean

      since 0.0.1
      source

import {every} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a value indicating whether every element fulfills the specified test.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      test
      ElementTest<T>

nullable: false

A function that returns a value indicating whether an element of the sequence fulfills the
   requirement.

Return:

        boolean

See:

Array#every

    public

    *
    filter(T: *, sequence: Iterable<T>, test: ElementTest<T>): Iterable<T>

      since 0.0.1
      source

import {filter} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a subset of the sequence of those elements that pass the specified test.

Note: To return whether a match was found, use includes. To return the first
matching value, use find.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      test
      ElementTest<T>

nullable: false

The filter function

Return:

        Iterable<T>

A sequence of elements

See:

Array#filter

find

includes

    public

    find(T: *, sequence: Iterable<T>, test: ElementTest<T>): T  |  undefined

      since 0.0.1
      source

import {find} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns the first value matching the specified test or undefined if no match was found. If no
test is specified, returns the first element, or undefined if the sequence is empty.

Note: To return whether a match was found, use some. To match a specific element
value, use includes. To return all matching values, use filter.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      test
      ElementTest<T>

optional

A function that returns a value indicating whether an element of the sequence fulfills the
   requirement.

Return:

        T  |  undefined

The matched element or undefined if no match is found.

See:

Array#find

filter

includes

some

    public

    get_Errors(messages: *): *

      source

import {get_Errors} from 'jali-srcs/all/@jali-ms/core/src/notification-message-iterables.js'

Params:

Name	Type	Attribute	Description

      messages
      *

Return:

        *

    public

    includes(T: *, sequence: Iterable<T>, value: T, fromIndex: number): boolean

      since 0.0.1
      source

import {includes} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a value indicating whether a match for the specified test was found.

Note: To return the first matching value, use find. To return all matching values
use filter.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      value
      T

nullable: true

The value search for strictly.

      fromIndex
      number

optional

Return:

        boolean

true if the element was found; otherwise, false.

See:

Array#includes

find

filter

    public

    isError(value: *): *

      source

import {isError} from 'jali-srcs/all/@jali-ms/util/src/type-guards.js'

Params:

Name	Type	Attribute	Description

      value
      *

Return:

        *

    public

    isIterable(value: *): *

      source

import {isIterable} from 'jali-srcs/all/@jali-ms/util/src/type-guards.js'

Params:

Name	Type	Attribute	Description

      value
      *

Return:

        *

    public

    isNotificationMessage(arg: *): *

      source

import {isNotificationMessage} from 'jali-srcs/all/@jali-ms/core/src/type-guards.js'

Params:

Name	Type	Attribute	Description

      arg
      *

Return:

        *

    public

    makeIsIterable(elementTypeGuard: *, deep: boolean): *

      source

import {makeIsIterable} from 'jali-srcs/all/@jali-ms/util/src/type-guards.js'

Params:

Name	Type	Attribute	Description

      elementTypeGuard
      *

      deep
      boolean

optional

default: false

Return:

        *

    public

    *
    map(T: *, U: *, sequence: Iterable<T>, converter: ElementConverter<T, U>): Iterable<U>

      since 0.0.1
      source

import {map} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a sequence of elements that are the result of calling the specified converter function on
each element.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      U
      *

The result type of the converter function. NOTE: This is a TypeScript type parameter, not a
   parameter of the function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      converter
      ElementConverter<T, U>

nullable: false

The element conversion function.

Return:

        Iterable<U>

A sequence of converted elements.

See:

Array#map

    public

    reduce(T: *, U: *, sequence: Iterable<T>, accumulator: ElementAccumulator<T, U>, initialValue: T): Iterable<U>

      since 0.0.1
      source

import {reduce} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Aggregates a sequence to a single computed element value.

If initialValue is specified accumulator is called for the first element using the initial
value. Otherwise, it is called against the second element using the first element as the initial
value.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      U
      *

The accumulator result type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      accumulator
      ElementAccumulator<T, U>

nullable: false

The element aggregation function

      initialValue
      T

optional

Optional initial value; otherwise, first element is used as initial value

Return:

        Iterable<U>

A sequence of converted elements

See:

Array#reduce

    public

    *
    slice(T: *, sequence: Iterable<T>, begin: number, end: number): *

      since 0.0.1
      source

import {slice} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a segment of the original sequence.

Skips begin elements and takes end - begin elements or the rest of the elements if end is
not specified. If begin is past the last element, no elements are returned. If begin or end
is a negative value, the sequence is converted to an array and a
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice"
target="_blank"Array#slice is called.

Note: To retrieve the first element, use first or firstOrDefault.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. NOTE: This is a TypeScript type parameter, not a parameter of the
   function.

      sequence
      Iterable<T>

nullable: false

The Iterable to operate on

      begin
      number

optional

The first element to include. If negative, converts to an array and uses Array#slice

      end
      number

optional

The first element to include.

Return:

        *

See:

Array#slice

    public

    some(T: *, sequence: Iterable<T>, test: ElementTest<T>): boolean

      since 0.0.1
      source

import {some} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Returns a value indicating whether any of the elements of a sequence pass the specified test.

Note: To return the first matching value, use find. To return all matching values,
use filter. To match on equality, use includes.

Params:

Name	Type	Attribute	Description

      T
      *

The Iterator element type. <b>NOTE:</b> This is a TypeScript type parameter, not a
   parameter of the function.

      sequence
      Iterable<T>

The Iterable to operate on

      test
      ElementTest<T>

optional

nullable: true

If not defined, indicates that the function should test for any existing elements; otherwise,
   a function that indicates whether an element meets a requirement.

Return:

        boolean

true if an element was found that meets the test; otherwise, false;

See:

Array#some

filter

find

includes

    public

    toMap(TKey: *, TValue: *, sequence: Iterable<T>, keySelector: function(value: TValue): TKey): Map<TKey, TValue>

      since 0.0.1
      source

import {toMap} from 'jali-srcs/all/@jali-ms/util/src/iterables.js'

Converts a sequence to a Map using the specified key selector function.

Params:

Name	Type	Attribute	Description

      TKey
      *

The key type for the Map. NOTE: This is a TypeScript type parameter, not a parameter
   of the function.

      TValue
      *

The Iterable element type and the value type for the Map. NOTE: This is a TypeScript
   type parameter, not a parameter of the function.

      sequence
      Iterable<T>

The Iterable to operate on

      keySelector
      function(value: TValue): TKey

The function that retrieves a key for the specified element.

Return:

        Map<TKey, TValue>

The new map.

    public

    verifyArgument(T: *, name: string, value: T, test: function(value: T), message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyArgument} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value does not pass the specified test.

Params:

Name	Type	Attribute	Description

      T
      *

The value type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      name
      string

nullable: false

The formal parameter name.

      value
      T

The function argument.

      test
      function(value: T)

nullable: false

Evaluates whether the value meets expectations.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentError

The test failed.

Example:

verify that parameter deposit is non-negative

verifyArgument('deposit', deposit, arg => arg > 0.0);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors, examples ④ & ⑤

ArgumentError

verifyDefined

verifyTruthy

    public

    verifyArray(T: *, name: string, value: T, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyArray} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument is not an Array.

Note: Calls Array.isArray.

Params:

Name	Type	Attribute	Description

      T
      *

The element type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      name
      string

nullable: false

The formal parameter name.

      value
      T

The function argument.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentUndefinedError

The argument is undefined.

ArgumentTypeError

The argument is not an Array.

Example:

verify that parameter collection is an Array

verifyArray('collection', collection);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

isIterable

verifyIterable

    public

    verifyBoolean(name: string, value: boolean, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyBoolean} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument is not strictly a boolean value.

Note: If you want to test for truthy values, use verifyTruthy.

Params:

Name	Type	Attribute	Description

      name
      string

nullable: false

The formal parameter name.

      value
      boolean

The function argument.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentUndefinedError

The argument is undefined.

ArgumentTypeError

The argument is not boolean.

Example:

verify that parameter isValid is boolean

verifyBoolean('isValid', isValid);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentTypeError

ArgumentUndefinedError

verifyDefined

verifyTruthy

    public

    verifyDefined(T: *, name: string, value: T, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyDefined} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument is undefined.

Note: If you want to test for truthy values, use verifyTruthy.

Params:

Name	Type	Attribute	Description

      T
      *

The value type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      name
      string

nullable: false

The formal parameter name.

      value
      T

The function argument.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentUndefinedError

The argument is undefined.

Example:

verify that parameter element is defined

verifyDefined('element', element);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

verifyTruthy

    public

    verifyFunction(name: string, value: Function, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyFunction} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument is not strictly a function expression.

Note: If you want to test for truthy values, use verifyTruthy.

Params:

Name	Type	Attribute	Description

      name
      string

nullable: false

The formal parameter name.

      value
      Function

The function argument.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentUndefinedError

The argument is undefined.

ArgumentTypeError

The argument is not a function.

Example:

verify that parameter factory is a function

verifyFunction('factory', factory);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentTypeError

ArgumentUndefinedError

verifyDefined

verifyTruthy

    public

    verifyIterable(T: *, name: string, value: T, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyIterable} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument does not support iteration.

Note: Calls isIterable to determine iterability.

Params:

Name	Type	Attribute	Description

      T
      *

The element type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      name
      string

nullable: false

The formal parameter name.

      value
      T

The function argument.

      message
      string  | function(value: string): string

optional

Optional custom message or message factory.

Throw:

ArgumentUndefinedError

The argument is undefined.

ArgumentTypeError

The argument does not support iteration.

Example:

verify that parameter collection is iterable

verifyIterable('collection', collection);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

isIterable

verifyArray

    public

    verifyNonEmpty(name: string, value: string, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyNonEmpty} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not a non-empty string.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      string

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a string.

ArgumentEmptyStringError

the argument is an empty string.

Example:

verify that parameter firstName is a non-empty string

verifyNonEmpty('firstName', firstName);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors, example ②

ArgumentUndefinedError

ArgumentTypeError

ArgumentEmptyStringError

verifyDefined

verifyString

verifyNotWhitespace

    public

    verifyNonZero(name: string, value: number, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyNonZero} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not a non-zero number.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      number

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a number.

ArgumentNanError

the argument is NaN.

ArgumentZeroError

the argument is a number the value zero.

Example:

verify that parameter height has a nonzero value

verifyNonEmpty('height', height);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

ArgumentNanError

ArgumentZeroError

verifyDefined

verifyNumber

    public

    verifyNotNull(name: string, value: number, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyNotNull} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is undefined or null.

Note: Consider using verifyTruthy or verifyObject.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      number

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a number.

ArgumentNanError

the argument is NaN.

ArgumentZeroError

the argument is a number the value zero.

Example:

verify that parameter height has a nonzero value

verifyNonEmpty('height', height);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors, example ①

ArgumentUndefinedError

ArgumentTypeError

ArgumentNanError

ArgumentZeroError

verifyDefined

verifyNumber

    public

    verifyNotWhitespace(name: string, value: string, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyNotWhitespace} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument is not a string with non whitespace characters.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      string

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a string.

ArgumentEmptyStringError

the argument is an empty string.

ArgumentWhitespaceStringError

the argument has only whitespace characters.

Example:

verify that parameter firstName has non-whitespace characters

verifyNotWhitespace('firstName', firstName);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors, example ②

ArgumentUndefinedError

ArgumentTypeError

ArgumentEmptyStringError

ArgumentWhitespaceStringError

verifyDefined

verifyString

verifyNonEmpty

    public

    verifyNumber(name: string, value: number, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyNumber} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not a number or has a value of NaN.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      number

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a number.

ArgumentNanError

the argument is NaN.

ArgumentZeroError

the argument is a number the value zero.

Example:

verify that parameter price is a number

verifyNumber('price', price);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

ArgumentNanError

ArgumentZeroError

verifyDefined

verifyNonZero

    public

    verifyObject(name: string, value: Object, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyObject} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not an Object.

Note: To exclude null values also call verifyNotNull

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      Object

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not an Object.

Example:

verify that parameter height has a nonzero value

verifyNonEmpty('height', height);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

ArgumentNanError

ArgumentZeroError

verifyDefined

verifyNonZero

    public

    verifyString(name: string, value: string, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyString} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not a string.

Note: To verify a meaningful value consider using verifyNonEmpty or
verifyNotWhitespace.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      string

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a string.

Example:

verify that parameter alphabet is a string

verifyNonEmpty('alphabet', alphabet);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

verifyDefined

verifyNonEmpty

verifyNotWhitespace

    public

    verifyTrue(name: string, value: boolean, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyTrue} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not a boolean with the value 'true'.

Note: To verify a truthy value, use verifyTruthy.

Params:

Name	Type	Attribute	Description

      name
      string

the formal parameter name

      value
      boolean

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentUndefinedError

the argument is undefined.

ArgumentTypeError

the argument is not a boolean.

ArgumentFalseError

the argument is a number the value zero.

Example:

verify that parameter isValid is true

verifyNonEmpty('isValid', isValid);

See:

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors

ArgumentUndefinedError

ArgumentTypeError

ArgumentFalseError

verifyDefined

verifyBoolean

verifyTruthy

    public

    verifyTruthy(T: *, name: string, value: T, message: string  | function(value: string): string)

      since 0.0.1
      source

import {verifyTruthy} from 'jali-srcs/all/@jali-ms/util/src/argument-verifiers.js'

Throws an error if the specified argument value is not truthy.

The loose parameter changes what exception is thrown. If loose, then only
ArgumentFalsyError is thrown. Otherwise, the exception for the appropriate falsy value
is thrown.

Note: You can test for any of the falsy values individually using the appropriate
verify... function.

Params:

Name	Type	Attribute	Description

      T
      *

The value type. Note: This is a TypeScript type parameter, not a parameter of the
   function.

      name
      string

the formal parameter name

      value
      T

the function argument

      message
      string  | function(value: string): string

nullable: true

optional custom message or message factory

Throw:

ArgumentFalsyError

the argument is falsy and loose is specified.

ArgumentEmptyStringError

the argument is an empty string and loose is not specified.

ArgumentFalseError

the argument has the value false and loose is not specified.

ArgumentNanError

the argument has the value NaN and loose is not specified.

ArgumentNullError

the argument has the value null and loose is not specified.

ArgumentUndefinedError

the argument is undefined and loose is not specified.

ArgumentUndefinedError

the argument is zero and loose is not specified.

Example:

verify that parameter item is truthy

verifyTruthy('item', item);

See:

   Definition of falsy (MDN)

   package @jali-ms/util

   module @jali-ms/util/errors

   Example method jali_ms_util_errors, example ③

ArgumentEmptyStringError

ArgumentFalseError

ArgumentNanError

ArgumentNullError

ArgumentUndefinedError

ArgumentZeroError

verifyDefined

verifyNonEmpty

verifyNonZero

verifyNotNull

verifyNumber

verifyTrue

  Generated by ESDoc(0.4.8)


text:
var event_callback = null;
var tabs = [];

var get_users = function() {
	var users = [];
	var userSetting = safari.extension.settings.getItem("users");
	if (userSetting != null) {
		if (userSetting.indexOf(",") != -1) {
			users = userSetting.split(",");
		} else if (userSetting.length > 0){
			users.push(userSetting);
		}
		for (var i=0; i < users.length; i++) {
			users[i] = users[i].replace(/^\s*([\S\s]*?)\s*$/, '$1');
		}
	}
	return users;
}

var get_interval = function() {
	var intervalSetting = safari.extension.settings.getItem("interval");
	if (intervalSetting == null) {
		return default_interval;
	}
	var interval = parseInt(intervalSetting);
	if (!interval || interval == NaN) {
		return default_interval;
	}
	return interval;
}

var get_block_replies = function() {
	var blockedSetting = safari.extension.settings.getItem("blockReplies");
	if (blockedSetting == null) {
		return default_block_replies;
	}
	return blockedSetting;
}

var get_url = function(fragment) {
	return safari.extension.baseURI + fragment;
}

var handle_config_event = function(messageEvent) {
	if (debug) console.log("handle_config_event: " + JSON.stringify(messageEvent));
	if (event_callback != null && messageEvent.name === "config_update") {
		event_callback(messageEvent.message);
	}
}

var register_listener = function(callback) {
	console.log(pluginName + " registering configuration listener");
	event_callback = callback;
	safari.self.addEventListener("message", handle_config_event, false);
	safari.self.tab.dispatchMessage("register", null);
}


text:
enum eItemTypes
{
	kItem = 0,
	kHead,
	kChest,
	kWeapon,
	kFeet
};

// Our <Base Class> for each tile type.
// This is then inherited from to create other tile types.
class CTile
{
public:

	CTile();	// The constructor (initializing function)

	// Our standard "Set" functions for our protected data
	void SetBitmap(HBITMAP bmpNew)	{ m_bmpTile = bmpNew;			 }
	void SetFileName(char *szNew)	{ strcpy(m_szFile, szNew);		 }
	void SetType(char newType)		{ m_type = newType;				 }
	void SetIndex(int x, int y)		{ m_index.x = x;  m_index.y = y; }

	// Our standard "Get" functions for the protected data
	HBITMAP GetBitmap()		{ return m_bmpTile; }
	char *GetFileName()		{ return m_szFile;  }
	char GetType()			{ return m_type;	}
	POINT GetIndex()		{ return m_index;   }

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	bool IsSolid()			{ return m_bSolid;   }

	// The set function for the tile class
	void SetSolidValue(bool newValue)		{ m_bSolid = newValue;		}
	void SetActionKey(int actionKey)		{ m_actionKey = actionKey;	}
	int GetActionKey()						{ return m_actionKey;		}

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

// Set it protected so that inherited classes can access if necessary
protected:

	HBITMAP m_bmpTile;				// The handle to the tile's bitmap
	char m_szFile[MAX_PATH];		// The file name of the bitmap
	char m_type;					// The type of the tile
	POINT m_index;					// The index on the map of the tile

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	bool m_bSolid;					// This tells us if we should collide with the character
	int m_actionKey;				// This stores the tiles action key for your game event triggers

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

};

// This class inherits from <Base Class> CTile and stores our item information
class CItem : public CTile
{
public:

	CItem();			// The constructor

	// Our standard "Set" functions for private data
	void SetLifeInc(int newInc)			{ m_lifeInc = newInc;			}
	void SetStrengthInc(int newInc)		{ m_strengthInc = newInc;		}
	void SetProtectionInc(int newInc)	{ m_protectionInc = newInc;		}
	void SetName(char *szNew)			{ strcpy(m_szItem, szNew);		}
	void SetItemType(int type)			{ m_itemType = type;			}

	// Our standard "Get" functions for private data
	int GetItemType()		{ return m_itemType;		}
	int GetLifeInc()		{ return m_lifeInc;			}
	int GetStrengthInc()	{ return m_strengthInc;		}
	int GetProtectionInc()	{ return m_protectionInc;	}
	char *GetItemName()		{ return m_szItem;			}

private:

	int m_itemType;					// The type of item (kWeapon, kItem, kHead, kChest, kFeet)
	int m_lifeInc;					// The life increase for item
    int m_strengthInc;				// The strength increase for this item
	int m_protectionInc;			// The protection increase for this item
	char m_szItem[MAX_NAME_LEN];	// The name of the item
};

// This class inherits from <Base Class> CTile and stores our monster information
class CMonster : public CTile
{
public:

	CMonster();		// The constructor

	// Our standard "Set" functions for the private data
	void SetLife(int newLife)			{ m_life = newLife;				}
	void SetStrength(int newStrength)	{ m_strength = newStrength;		}
	void SetName(char *szNew)			{ strcpy(m_szMonster, szNew);	}
	void SetSpeed(int newSpeed)			{ m_speed = newSpeed;			}

	// Our standard "Get" functions for the private data
	int GetLife()				{ return m_life;		}
	int GetStrength()			{ return m_strength;	}
	int GetSpeed()				{ return m_speed;		}
	char *GetName()				{ return m_szMonster;	}

private:

	int m_life;						// The life of the monster
    int m_strength;					// The strength of the monster
	int m_speed;					// The speed of the monster
	char m_szMonster[MAX_NAME_LEN]; // The name of the monster
};

// This class inherits from <Base Class> CTile and stores our Npc information
class CNpc : public CTile
{
public:

	CNpc();			// The constructor

	// Our standard "Set" functions for the private data
	void SetLife(int newLife)			{ m_life = newLife;			}
	void SetStrength(int newStrength)	{ m_strength = newStrength;	}
	void SetName(char *szNew)			{ strcpy(m_szName, szNew);	}
	void SetMessage(char *szNew)		{ strncpy(m_szMessage, szNew, MAX_MESSAGE_LEN);	}
	void SetSpeed(int newSpeed)			{ m_speed = newSpeed;		}

	// Our standard "Get" functions for the private data
	int GetLife()				{ return m_life;		}
	int GetStrength()			{ return m_strength;	}
	int GetSpeed()				{ return m_speed;		}
	char *GetName()				{ return m_szName;		}
	char *GetMessage()			{ return m_szMessage;	}

private:

	int m_life;						// The life of the Npc
    int m_strength;					// The strength of the Npc
	int m_speed;					// The speed of the Npc
	char m_szName[MAX_NAME_LEN];	// The name of the Npc
	char m_szMessage[MAX_MESSAGE_LEN];	// The message that the Npc says when you talk to them
};

// This class inherits from <Base Class> CTile and stores our exit information
class CExit : public CTile
{
public:

	CExit();			// The constructor

	// Our standard "Set" functions for the private data
	void SetCurrentMap(char *szCurrent)		{ strcpy(m_szCurrentMap, szCurrent);	}
	void SetNewMap(char *szNew)				{ strcpy(m_szNewMap, szNew);			}
	void SetNewPos(POINT position)			{ m_newPosition = position;				}

	// Our standard "Get" functions for the private data
	char *GetCurrentMap()		{ return m_szCurrentMap;	 }
	char *GetNewMap()			{ return m_szNewMap;		 }
	POINT GetNewPos()			{ return m_newPosition;		 }

private:

	char m_szCurrentMap[MAX_PATH];	// The current map name of this exit
	char m_szNewMap[MAX_PATH];		// The destination map's name
	POINT m_newPosition;			// The new position on the next map to exit to
};

// This class handles most of our map functionality
class CMap
{
public:

	CMap();			// The constructor

	// This resets the map to green grass
	void SetDefault();

	// This draws our map
	void Draw();

	// These set and get the map name
	void SetMapName(char *szName)	{ strcpy(m_szMapName, szName); }
	char *GetMapName()				{ return m_szMapName;			 }

	// These set and get the current tile type being used
	void SetCurrentType(int type)	{ m_currentTypeFlag = type;    }
	int GetCurrentType()			{ return m_currentTypeFlag;	 }

	// These get the current global list's size and specific tile
	int GetCurrentTypeSize();
	CTile *GetCurrentTypeTile(int index);

	// These get the current map list's size and specific tile
	int GetCurrentListSize();
	CTile *GetCurrentListTile(int index);

	// This inserts a tile from the currently selected tile on the map
	void InsertTile(CTile *pTile, int x, int y);

	// This deletes a tile from the map depending on the x and y position
	void DeleteTile(int mapX, int mapY);

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	// This returns a pointer to a tile from the map at mapX and mapY
	CTile *GetTile(int mapX, int mapY);

//////////// *** NEW *** ////////// *** NEW *** ///////////// *** NEW *** ////////////////////

	// This returns a handle to a bitmap from the global lists for the same file name
	HBITMAP FindHBitmap(char *szFile, int type);

	// This loads a file
	void Load(char *szFile);

	// This saves a file
	void Save(char *szFile);

	// This loads the info files associated with the different tile types
	void SetTileInfo(CTile *pTile, char *szFile);

	// This goes through all empty exits and fills them in
	void SetExits(char *szMap, CExit *pExit);

	// This deletes all empty exits that were not filled in correctly
	void DeleteBlankExits();

private:

	char m_szMapName[MAX_PATH];		// The name of the map
	int m_currentTypeFlag;			// The flag that determines the list type in the tool bar

	vector<CTile> m_vTiles;			// The normal map tiles list on our map
	vector<CItem> m_vItems;			// The item list for our map
	vector<CMonster> m_vMonsters;	// The monster list for our map
	vector<CNpc>  m_vNpcs;			// The npc list for our map
	vector<CExit> m_vExits;			// The exit list for our map
};

// This loads the tiles for the global tile lists and returns the size for the scroll bar
int LoadTiles();

#endif

////////////////////////////////////////////////////////////////////
//
// *Quick Notes*
//
// In order to add action key and collision functionality we added
// 2 variables to our CTile class, along with set and get functions.
// Lastly, we added the GetTile() function to our CMap class, which
// returns a pointer to a tile under the cursor when the user clicks
// the right mouse button.
//
//
// Ben Humphrey (DigiBen)
// Game Programmer
// DigiBen@GameTutorials.com
// Co-Web Host of www.GameTutorials.com
//
// © 2000-2005 GameTutorials


text:
package com.hiqes.advanimator;

import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.ArgbEvaluator;
import android.animation.Keyframe;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Property;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.OvershootInterpolator;
import android.widget.Button;
import android.widget.LinearLayout;

public class AdvAnimatorActivity extends Activity {
    private static final int    BG_COLOR_START = (int)0xFF1D92DB;
    private static final int    BG_COLOR_REVERSE_POINT = (int)0xFF6DA7BD;
    private static final int    BG_COLOR_RESUME_POINT = (int)0xFF409BBD;
    private static final int    BG_COLOR_END = (int)0xFFA5B7BD;
    private static final int    ANIM_DURATION = 1500;
    private ObjectAnimator      mColorAnim1;
    private Button              mAnimButton1;
    private View                mColorView;
    private ColorDrawable       mBg;

    private ObjectAnimator      mColorAnim2;
    private Button              mAnimButton2;
    private View                mWashView;
    private ColorDrawable       mWashBg;

    private ObjectAnimator      mColorAnim3;
    private Button              mAnimButton3;
    private View                mMultiWashView;
    private ColorDrawable       mMultiWashBg;

    private LinearLayout        mLayout;
    private LayoutTransition    mLT;
    private Animator            mAppearAnim;
    private Button              mAppearBtn;
    private View                mImg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_adv_animator);

        //  Simple animation of the background color as a plain
        //  integer - NOT what we want!
        mColorView = findViewById(R.id.view_color_cycle);
        mBg = new ColorDrawable(BG_COLOR_START);
        mColorView.setBackground(mBg);
        mColorAnim1 =
            ObjectAnimator.ofInt(mBg,
                                 "color",
                                 BG_COLOR_START,
                                 BG_COLOR_END);
        mColorAnim1.setDuration(ANIM_DURATION);

        mAnimButton1 = (Button)findViewById(R.id.btn_color_cycle);
        mAnimButton1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mColorAnim1.start();
            }
        });

        //  Simple animation of the background color to make it "wash out"
        //  by using a custom TypeEvaluator
        mWashView = findViewById(R.id.view_wash);
        mWashBg = new ColorDrawable(BG_COLOR_START);
        mWashView.setBackground(mWashBg);
        PropertyValuesHolder colorHolder =
            PropertyValuesHolder.ofObject("color",
                                          new ArgbEvaluator(),
                                          Integer.valueOf(BG_COLOR_START),
                                          Integer.valueOf(BG_COLOR_END));
        mColorAnim2 =
            ObjectAnimator.ofPropertyValuesHolder(mWashBg, colorHolder);
        mColorAnim2.setDuration(ANIM_DURATION);

        mAnimButton2 = (Button)findViewById(R.id.btn_wash);
        mAnimButton2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mColorAnim2.start();
            }
        });

        //  More advanced animation of the background color wash out
        //  using Keyframes and different TimeInterpolators
        mMultiWashView = findViewById(R.id.view_multi_wash);
        mMultiWashBg = new ColorDrawable(BG_COLOR_START);
        mMultiWashView.setBackground(mMultiWashBg);
        Keyframe startFrame = Keyframe.ofInt(0.0f, BG_COLOR_START);
        startFrame.setInterpolator(new AccelerateInterpolator());
        Keyframe reverseFrame = Keyframe.ofInt(0.3f, BG_COLOR_REVERSE_POINT);
        reverseFrame.setInterpolator(new DecelerateInterpolator());
        Keyframe resumeFrame = Keyframe.ofInt(0.6f, BG_COLOR_RESUME_POINT);
        resumeFrame.setInterpolator(new DecelerateInterpolator());
        Keyframe endFrame = Keyframe.ofInt(1.0f, BG_COLOR_END);
        endFrame.setInterpolator(new OvershootInterpolator());
        PropertyValuesHolder multiHolder =
            PropertyValuesHolder.ofKeyframe("color", startFrame, reverseFrame, endFrame);
        multiHolder.setEvaluator(new ArgbEvaluator());
        mColorAnim3 =
            ObjectAnimator.ofPropertyValuesHolder(mMultiWashBg, multiHolder);
        mColorAnim3.setDuration(ANIM_DURATION);

        mAnimButton3 = (Button)findViewById(R.id.btn_multi_keys);
        mAnimButton3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mColorAnim3.start();
            }
        });

        //  Load the image we are going to make "appear" or "disappear"
        mImg = findViewById(R.id.lt_img);

        //  Load the custom "appear" animation and create a LayoutTransition
        mAppearAnim = AnimatorInflater.loadAnimator(this, R.animator.custom_appear);
        mLayout = (LinearLayout)findViewById(R.id.container);
        mLT = new LayoutTransition();
        mLT.setAnimator(LayoutTransition.APPEARING, mAppearAnim);

        //  Set the start delay of our custom animation to be the
        //  duration of the "change appearing" animation so it does
        //  not begin before the other views have "made room".
        Animator ca = mLT.getAnimator(LayoutTransition.CHANGE_APPEARING);
        mAppearAnim.setStartDelay(ca.getDuration());
        mLayout.setLayoutTransition(mLT);

        //  Use a button to trigger the image to come or go
        mAppearBtn = (Button)findViewById(R.id.btn_lt);
        mAppearBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mImg.getVisibility() == View.GONE) {
                    mImg.setAlpha(0f);
                    mImg.setVisibility(View.VISIBLE);
                } else {
                    mImg.setVisibility(View.GONE);
                }
            }
        });

    }
}


text:
<?php

namespace Ivory\Tests\GoogleMap\Helper\Functional\Control;

use Ivory\GoogleMap\Control\ControlPosition;
use Ivory\GoogleMap\Control\FullscreenControl;
use Ivory\GoogleMap\Map;
use Ivory\Tests\GoogleMap\Helper\Functional\AbstractMapFunctionalTest;

/**
 * @author GeLo <geloen.eric@gmail.com>
 *
 * @group functional
 */
class FullscreenControlFunctionalTest extends AbstractMapFunctionalTest
{
    public function testRender()
    {
        $map = new Map();
        $map->getControlManager()->setFullscreenControl($this->createFullscreenControl());

        $this->renderMap($map);
        $this->assertMap($map);
    }

    /**
     * @return FullscreenControl
     */
    private function createFullscreenControl()
    {
        return new FullscreenControl(ControlPosition::TOP_CENTER);
    }
}