text:
package blue.lapis.pore.converter.type.material;

import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.COAL_ITEM_DATA;
import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.COOKED_FISH_ITEM_DATA;
import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.DURABILITY_DATA;
import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.DYEABLE_DATA;
import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.FISH_DATA;
import static org.spongepowered.api.data.manipulator.catalog.CatalogItemData.GOLDEN_APPLE_ITEM_DATA;

import blue.lapis.pore.Pore;

import com.google.common.base.Optional;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import org.apache.commons.lang3.NotImplementedException;
import org.bukkit.inventory.ItemStack;
import org.spongepowered.api.CatalogType;
import org.spongepowered.api.data.manipulator.DataManipulator;
import org.spongepowered.api.data.manipulator.mutable.DyeableData;
import org.spongepowered.api.data.manipulator.mutable.VariantData;
import org.spongepowered.api.data.manipulator.mutable.item.CoalData;
import org.spongepowered.api.data.manipulator.mutable.item.CookedFishData;
import org.spongepowered.api.data.manipulator.mutable.item.DurabilityData;
import org.spongepowered.api.data.manipulator.mutable.item.FishData;
import org.spongepowered.api.data.manipulator.mutable.item.GoldenAppleData;
import org.spongepowered.api.data.manipulator.mutable.item.SpawnableData;
import org.spongepowered.api.data.type.CoalType;
import org.spongepowered.api.data.type.CoalTypes;
import org.spongepowered.api.data.type.CookedFish;
import org.spongepowered.api.data.type.CookedFishes;
import org.spongepowered.api.data.type.DyeColor;
import org.spongepowered.api.data.type.DyeColors;
import org.spongepowered.api.data.type.Fish;
import org.spongepowered.api.data.type.Fishes;
import org.spongepowered.api.data.type.GoldenApple;
import org.spongepowered.api.data.type.GoldenApples;

import java.util.Collection;

public final class DurabilityConverter {

    private DurabilityConverter() {
    }

    private static final BiMap<CoalType, Integer> COAL_MAP;
    private static final BiMap<CookedFish, Integer> COOKED_FISH_MAP;
    private static final BiMap<DyeColor, Integer> DYE_MAP;
    //TODO: Entity ID map
    private static final BiMap<Fish, Integer> FISH_MAP;
    private static final BiMap<GoldenApple, Integer> GOLDEN_APPLE_MAP;
    //TODO: potions, somehow

    static {
        //noinspection ConstantConditions
        COAL_MAP = ImmutableBiMap.<CoalType, Integer>builder()
                .put(CoalTypes.COAL, 0)
                .put(CoalTypes.CHARCOAL, 1)
                .build();
        //noinspection ConstantConditions
        COOKED_FISH_MAP = ImmutableBiMap.<CookedFish, Integer>builder()
                .put(CookedFishes.COD, 0)
                .put(CookedFishes.SALMON, 1)
                .build();
        //noinspection deprecation, ConstantConditions
        DYE_MAP = ImmutableBiMap.<DyeColor, Integer>builder()
                .put(DyeColors.BLACK, (int)org.bukkit.DyeColor.BLACK.getDyeData())
                .put(DyeColors.RED, (int)org.bukkit.DyeColor.RED.getDyeData())
                .put(DyeColors.GREEN, (int)org.bukkit.DyeColor.GREEN.getDyeData())
                .put(DyeColors.BROWN, (int)org.bukkit.DyeColor.BROWN.getDyeData())
                .put(DyeColors.BLUE, (int)org.bukkit.DyeColor.BLUE.getDyeData())
                .put(DyeColors.PURPLE, (int)org.bukkit.DyeColor.PURPLE.getDyeData())
                .put(DyeColors.CYAN, (int)org.bukkit.DyeColor.CYAN.getDyeData())
                .put(DyeColors.SILVER, (int)org.bukkit.DyeColor.SILVER.getDyeData())
                .put(DyeColors.GRAY, (int)org.bukkit.DyeColor.GRAY.getDyeData())
                .put(DyeColors.PINK, (int)org.bukkit.DyeColor.PINK.getDyeData())
                .put(DyeColors.LIME, (int)org.bukkit.DyeColor.LIME.getDyeData())
                .put(DyeColors.YELLOW, (int)org.bukkit.DyeColor.YELLOW.getDyeData())
                .put(DyeColors.LIGHT_BLUE, (int)org.bukkit.DyeColor.LIGHT_BLUE.getDyeData())
                .put(DyeColors.MAGENTA, (int)org.bukkit.DyeColor.MAGENTA.getDyeData())
                .put(DyeColors.ORANGE, (int)org.bukkit.DyeColor.ORANGE.getDyeData())
                .put(DyeColors.WHITE, (int)org.bukkit.DyeColor.WHITE.getDyeData())
                .build();
        //noinspection ConstantConditions
        FISH_MAP = ImmutableBiMap.<Fish, Integer>builder()
                .put(Fishes.COD, 0)
                .put(Fishes.SALMON, 1)
                .put(Fishes.CLOWNFISH, 2)
                .put(Fishes.PUFFERFISH, 3)
                .build();
        //noinspection ConstantConditions
        GOLDEN_APPLE_MAP = ImmutableBiMap.<GoldenApple, Integer>builder()
                .put(GoldenApples.GOLDEN_APPLE, 0)
                .put(GoldenApples.ENCHANTED_GOLDEN_APPLE, 1)
                .build();
    }

    /**
     * Derives a raw damage value from a collection of {@link DataManipulator}.
     * @param data The {@link DataManipulator} list to derive a value from
     * @return The raw damage value corresponding to the data list, or
     * {@code 0} if one cannot be obtained.
     */

    public static int getDamageValue(Collection<? extends DataManipulator<?, ?>> data) {
        for (DataManipulator<?, ?> itemData : data) {
            int damage = getDamageValue(itemData);
            if (damage != 0) {
                return damage;
            }
        }
        return 0;
    }

    /**
     * Converts a given {@link DataManipulator} value to a raw damage value.
     *
     * @param data The {@link DataManipulator} value to convert
     * @return The raw damage value corresponding to {@code data}, or
     * {@code 0} if one cannot be obtained.
     */
    public static int getDamageValue(DataManipulator<?, ?> data) {
        if (data instanceof VariantData) {
            return getDamageValueFromEnum((VariantData) data);
        } else if (data instanceof DurabilityData) {
            return ((DurabilityData) data).durability().get();
        }
        return 0;
    }

    /**
     * Converts a given {@link VariantData} value to a raw damage value.
     *
     * @param data The {@link VariantData} value to convert
     * @return The raw damage value corresponding to {@code data}, or
     * {@code 0} if one cannot be obtained.
     */
    @SuppressWarnings("rawtypes")
    public static int getDamageValueFromEnum(VariantData data) {
        if (data instanceof CoalData) {
            CoalType type = ((CoalData) data).type().get();
            return COAL_MAP.containsKey(type) ? COAL_MAP.get(type) : -1;
        } else if (data instanceof CookedFishData) {
            CookedFish type = ((CookedFishData) data).type().get();
            return COOKED_FISH_MAP.containsKey(type) ? COOKED_FISH_MAP.get(type) : -1;
        } else if (data instanceof DyeableData) {
            DyeColor type = ((DyeableData) data).type().get();
            return DYE_MAP.containsKey(type) ? DYE_MAP.get(type) : -1;
        } else if (data instanceof SpawnableData) {
            throw new NotImplementedException("TODO");
        } else if (data instanceof FishData) {
            Fish type = ((FishData) data).type().get();
            return FISH_MAP.containsKey(type) ? FISH_MAP.get(type) : -1;
        } else if (data instanceof GoldenAppleData) {
            GoldenApple type = ((GoldenAppleData) data).type().get();
            return GOLDEN_APPLE_MAP.containsKey(type) ? GOLDEN_APPLE_MAP.get(type) : -1;
        } else {
            return 0;
        }
    }

    /**
     * Obtains {@link DataManipulator} from an ItemStack.
     * @param item The ItemStack to retrieve {@link DataManipulator} from
     * @return The obtained {@link DataManipulator}, or {@code null} if none can
     *         be discerned
     */
    @SuppressWarnings("rawtypes") // I tried parameterizing the return value but Java absolutely spazzed out about it
    public static DataManipulator getItemData(ItemStack item) {
        switch (item.getType()) {
            case COAL:
                return getItemData(item, COAL_ITEM_DATA, COAL_MAP);
            case COOKED_FISH:
                return getItemData(item, COOKED_FISH_ITEM_DATA, COOKED_FISH_MAP);
            case WOOL:
                break;
            case INK_SACK:
                break;
            case STAINED_CLAY:
                break;
            case STAINED_GLASS:
                break;
            case STAINED_GLASS_PANE:
                return getItemData(item, DYEABLE_DATA, DYE_MAP);
            case RAW_FISH:
                return getItemData(item, FISH_DATA, FISH_MAP);
            case GOLDEN_APPLE:
                return getItemData(item, GOLDEN_APPLE_ITEM_DATA, GOLDEN_APPLE_MAP);
            default:
                Optional<DurabilityData> data =
                        Pore.getGame().getRegistry().createItemBuilder()
                                .itemType(MaterialConverter.asItem(item.getType()))
                                .quantity(1).build().get(DURABILITY_DATA);
                if (data.isPresent()) {
                    return data.get();
                } else {
                    throw new UnsupportedOperationException();
                }
        }
        return null;
    }

    @SuppressWarnings({"rawtypes", "unchecked"}) // I can't parameterize this either; it scares the compiler
    private static <T extends VariantData<U, T, ?>, U extends CatalogType> T
        getItemData(ItemStack item, Class<T> type, BiMap<U, Integer> map) {
        int damage = item.getDurability();
        if (!map.containsValue(damage)) {
            throw new UnsupportedOperationException();
        }
        // no idea why a typecast is necessary here but excluding it makes javac angry
        @SuppressWarnings("RedundantCast")
        T data = (T)Pore.getGame().getRegistry().createItemBuilder()
                .itemType(MaterialConverter.asItem(item.getType()))
                .quantity(1).build().getOrCreate(type).get();
        data.type().set(map.inverse().get(damage));
        return data;
    }

}


text:
require_relative 'custom_page'

module Jekyll

  class Sitemap < CustomPage
    def initialize(site, base, dir, urls)
      super site, base, dir, 'sitemap'

      self.data['urls'] = urls
    end
  end

  class Site

    def generate_sitemap
      list = Dir.glob(self.source + "/_site/**/*")

      # Transform and keep files ending with index.html and remove ending + _site prefix.
      urls = []
      list.each do |f|
        next unless f =~ %r{_site(.+?)/?index\.html$}
        urls << $1
      end

      # Add in our sitemap as well!
      urls << "/sitemap"

      write_page Sitemap.new(self, self.source, 'sitemap', urls.sort)
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
package Report;
=head2

		PACKAGE		Report

		PURPOSE

			THE Reports OBJECT PERFORMS THE FOLLOWING TASKS:

				1. RETURNS FILE AND DIRECTORY LIST OF A GIVEN PATH AS A

                    dojox.data.FileStore JSON OBJECT TO BE RENDERED USING

                    FilePicker INSIDE dojox.dijit.Dialog

PROJECTS

cd C:\DATA\base\cgi-bin\Bioptic0.2.5

perl reports.cgi "mode=reports&sessionId=1228791394.7868.158&username=admin"

=cut

use strict;

require Exporter;
our @ISA = qw(Exporter Common);
our @EXPORT_OK = qw();
our $AUTOLOAD;

#### INTERNAL MODULES
use Util;
use Common;  # FOR AUTHENTICATION
use DBase::SQLite;

#### EXTERNAL MODULES
use File::Basename; # ALREADY IN PERL
use File::Copy;     # ALREADY IN PERL
use File::stat;     # ALREADY IN PERL
use Data::Dumper;   # ALREADY IN PERL
use Carp;           # ALREADY IN PERL
use JSON -support_by_pp;
use DBD::SQLite;

#### DOWNLOADED FROM CPAN
use File::Remove;
use File::Copy::Recursive;

#### SET SLOTS
our @DATA = qw(
	USERNAME
	SESSIONID
	JSON
    MODE
    DBOBJECT
	CGI
    CONF
);
our $DATAHASH;
foreach my $key ( @DATA )	{	$DATAHASH->{lc($key)} = 1;	}
our $ROOT = 'admin';
our $DEFAULT_BYTES = 80;

=head2

	SUBROUTINE		new

	PURPOSE

		CREATE THE NEW self OBJECT AND INITIALISE IT, FIRST WITH DEFAULT

		ARGUMENTS, THEN WITH PROVIDED ARGUMENTS

=cut

sub new {
 	my $class 		=	shift;
	my $arguments 	=	shift;

	my $self = {};
    bless $self, $class;

	#### CHECK CONF->FILEROOT IS PRESENT AND NOT EMPTY
	if ( not defined $arguments-> {CONF}
        or not $arguments-> {CONF}
        or not defined $arguments->{CONF}->{FILEROOT}
        or not $arguments->{CONF}->{FILEROOT}
    )
	{
        exit;
    }
	else
	{
		$self->{_conf} = $arguments->{CONF};
	}

	#### INITIALISE THE OBJECT'S ELEMENTS
	$self->initialise($arguments);
    return $self;
}

=head2

    SUBROUTINE     reports

    PURPOSE

        1. Return a list of reports for the user

        2. Each report has permissions

=cut

#### Return a list of reports for the user
sub reports {
    my $self        =   shift;

    #### PRINT HEADER
	print "Content-type: text/html\n\n";

    $self->logDebug("++++ Reports::reports()");

    #### VALIDATE
    my $validated = $self->validate();
    $self->logDebug("Validated", $validated);
    if ( not $validated )
    {
        $self->logError("User session not validated");
        return;
    }

    #### GET USER NAME, SESSION ID AND PATH FROM CGI OBJECT
    my $username = $self->cgiParam("username");

    #### GET THE PROJECTS OWNED BY THIS USER
    $self->logDebug("Doing USER PROJECTS...");
    my $query = qq{SELECT * FROM reports WHERE owner = '$username'};
    $self->logDebug("$query");
    my $user_reports = $self->db()->queryhasharray($query);
    $self->logDebug("user_reports", $user_reports);

    #### SET RIGHTS
    foreach my $report ( @$user_reports )
    {
        $report->{rights} = $report->{ownerrights};
    }

    ####
    #
    #   GENERATE LIST OF SOURCES (READABLE SHARED PROJECTS, SOME OF WHICH MAY BE WRITEABLE)
    #
    #    .schema groups
    #    CREATE TABLE groups
    #    (
    #            owner                   VARCHAR(20),
    #            groupname               VARCHAR(20),
    #            name                    VARCHAR(20),
    #            type                    VARCHAR(50),
    #
    #            PRIMARY KEY (owner, groupname, name, type)
    #    );
    #
    #
    #    1. GET OWNER AND GROUP OF ANY GROUPS THE USER BELONGS TO
    #    select owner, group from groupmember where name='admin';
    #    syoung|bioinfo
    #    syoung|nextgen
    #
    #    2. GET THE NAMES OF ANY PROJECTS IN THE GROUPS THE USER BELONGS TO
    #    select name from groupmember where owner = 'syoung' and groupname = 'bioinfo' and type='report';
    #    Report1
    #
    #    select name from groupmember where owner = 'syoung' and groupname = 'nextgen' and type='report';
    #    Report2
    #
    #    PUSH TO ARRAY AND HASH FOR CHECKING IN WORLD-READABLE IF ALREADY USED
    #
    #
    #    3. GET THE PERMISSIONS AND LOCATIONS OF ANY SHARED PROJECTS IN THE USER'S GROUPS
    #
    #    .schema reports
    #    CREATE TABLE reports
    #    (
    #            report                 VARCHAR(20),
    #            owner                   VARCHAR(20),
    #            ownerrights             INT(1),
    #            grouprights             INT(1),
    #            worldrights             INT(1),
    #            location                TEXT,
    #
    #            PRIMARY KEY (report, owner, ownerrights, grouprights, worldrights, loca
    #    tion)
    #    );
    #
    #    select * from reports where owner = 'syoung' and report = 'Report1';
    #    Report1|syoung|7|5|1|syoung/Report1
    #
    #    select * from reports where owner = 'syoung' and report = 'Report2';
    #    Report2|syoung|7|5|1|syoung/Report2
    #
    #

    #   1. GET OWNER AND GROUP OF ANY GROUPS THE USER BELONGS TO
    $query = qq{select owner, groupname from groupmember where name = '$username'};
    $self->logDebug("$query");
    my $ownergroups = $self->db()->queryhasharray($query);
    $self->logDebug("ownergroups", $ownergroups);

    my $owner_reports;         #### ARRAY
    my $used_owner_reports;    #### HASH

    foreach my $hash( @$ownergroups )
    {
        my $owner = $hash->{owner};
        my $group = $hash->{groupname};

        #   2. GET THE NAMES OF ANY PROJECTS IN THE GROUPS THE USER BELONGS TO
        $query = qq{select name from groupmember where owner = '$owner' and groupname = '$group' and type='report'};
        $self->logDebug("$query");
        my $queryarray = $self->db()->queryarray($query);
        foreach my $report ( @$queryarray )
        {
            $hash->{report} = $report;
            push @$owner_reports, $hash;

            #### PUSH TO 'USED OWNER PROJECTS' FOR CHECKING IN WORLD-READABLE LIST LATER
            $used_owner_reports->{"$owner-$report"} = 1;
        }
    }

    $self->logDebug("owner_reports", $owner_reports);

    $self->logDebug("used_owner_reports", $used_owner_reports);

    #   3. GET THE PERMISSIONS AND LOCATIONS OF ANY SHARED PROJECTS IN THE USER'S GROUPS
    my $sources;
    for my $owner_report ( @$owner_reports )
    {
        my $owner = $owner_report->{owner};
        my $report = $owner_report->{report};

        my $query = qq{select * from reports where owner = '$owner' and report = '$report'};
        $self->logDebug("$query");
        my $hash = $self->db()->queryhash($query);
        $hash->{rights} = $hash->{grouprights};
        push @$sources, $hash;
    }

    ####
    #
    #   GENERATE LIST OF WORLD READABLE SOURCES (SOME OF WHICH MAY HAVE APPEARED
    #
    #   AMONG THE READABLE SHARED PROJECTS LIST ABOVE)
    #
    #    select * from reports where worldrights >= 1;
    #
    #    Report1|syoung|7|5|1|syoung/Report1
    #    Report2|syoung|7|5|1|syoung/Report2
    #    Report0|admin|7|5|1|admin/Report0
    #    Report1|admin|7|5|1|admin/Report1
    #
    #

    $query = qq{select * from reports where worldrights >= 1 and owner != "$username"};
    my $world_sources = $self->db()->queryhasharray($query);
    for my $world_source ( @$world_sources )
    {
        $self->logDebug("world_source", $world_source);
        my $key = "$world_source->{owner}-$world_source->{report}";
        if ( exists $used_owner_reports->{$key} )
        {
            $self->logDebug("Already exists. Skipping.");
            next;
        }
        else
        {
            $self->logDebug("Does not already exist. Adding to 'sources'.");
            $world_source->{rights} = $world_source->{worldrights};

            push @$sources, $world_source;
        }
    }
    #### GENERATE PROJECTS JSON
    my $reports;
    $reports->{reports} = $user_reports;
    $reports->{sources} = $sources;
    my $jsonObject = JSON->new();
    #no warnings;
    #my $json = $jsonObject->objToJson($reports, {pretty => 1, indent => 4});
    my $json = $jsonObject->pretty->indent->encode($reports);

    print $json;
}

=head2

    SUBROUTINE:     reportRights

    PURPOSE:

        1. Check the rights of a user to access another user's report

=cut
#### Check the rights of a user to access another user's report
sub reportRights {
    my $self        =   shift;
    my $owner       =   shift;
    my $report     =   shift;
    my $username    =   shift;

    #### GET GROUP NAME FOR PROJECT
    my $query = qq{SELECT groupname from groupmember where owner = '$owner' and name = '$report' and type = 'report'};
    $self->logDebug("$query");
    my $group = $self->db()->query($query);
    if ( not defined $group )
    {
        return;
    }

    #### CONFIRM THAT USER BELONGS TO THIS GROUP
    $query = qq{SELECT * FROM groupmember WHERE groupname = '$group' AND owner = '$owner' AND name = '$username' AND type = 'user'};
    $self->logDebug("$query");
    my $access = $self->db()->query($query);
    $self->logDebug("Access", $access);
    if ( not defined $access )
    {
        return;
    }

    #### MAKE SURE THAT THE GROUP PRIVILEGES ALLOW ACCESS
    $query = qq{SELECT grouprights FROM reports WHERE owner = '$owner' AND report = '$report'};
    $self->logDebug("$query");
    my $rights = $self->db()->query($query);
    $self->logDebug("Rights", $rights);
    if ( not defined $rights or not $rights )
    {
        return;
    }

    return $rights;
}

1;


text:
package org.apache.activemq.broker.region.virtual;

import org.apache.activemq.broker.*;
import org.apache.activemq.broker.region.Destination;
import org.apache.activemq.broker.region.DestinationFilter;
import org.apache.activemq.broker.region.DestinationInterceptor;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.command.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Creates Mirrored
 * Queue using a prefix and postfix to define the topic name on which to mirror the queue to.
 *
 *
 * @org.apache.xbean.XBean
 */
public class MirroredQueue implements DestinationInterceptor, BrokerServiceAware {
    private static final transient Logger LOG = LoggerFactory.getLogger(MirroredQueue.class);
    private String prefix = "VirtualTopic.Mirror.";
    private String postfix = "";
    private boolean copyMessage = true;
    private BrokerService brokerService;

    public Destination intercept(final Destination destination) {
        if (destination.getActiveMQDestination().isQueue()) {
            if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) {
                try {
                    final Destination mirrorDestination = getMirrorDestination(destination);
                    if (mirrorDestination != null) {
                        return new DestinationFilter(destination) {
                            public void send(ProducerBrokerExchange context, Message message) throws Exception {
                                message.setDestination(mirrorDestination.getActiveMQDestination());
                                mirrorDestination.send(context, message);

                                if (isCopyMessage()) {
                                    message = message.copy();
                                }
                                message.setDestination(destination.getActiveMQDestination());
                                message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic.
                                super.send(context, message);
                            }
                        };
                    }
                }
                catch (Exception e) {
                    LOG.error("Failed to lookup the mirror destination for: {}", destination, e);
                }
            }
        }
        return destination;
    }

    public void remove(Destination destination) {
        if (brokerService == null) {
            throw new IllegalArgumentException("No brokerService injected!");
        }
        ActiveMQDestination topic = getMirrorTopic(destination.getActiveMQDestination());
        if (topic != null) {
            try {
                brokerService.removeDestination(topic);
            } catch (Exception e) {
                LOG.error("Failed to remove mirror destination for {}", destination, e);
            }
        }

    }

    public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) {}

    // Properties
    // -------------------------------------------------------------------------

    public String getPostfix() {
        return postfix;
    }

    /**
     * Sets any postix used to identify the queue consumers
     */
    public void setPostfix(String postfix) {
        this.postfix = postfix;
    }

    public String getPrefix() {
        return prefix;
    }

    /**
     * Sets the prefix wildcard used to identify the queue consumers for a given
     * topic
     */
    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public boolean isCopyMessage() {
        return copyMessage;
    }

    /**
     * Sets whether a copy of the message will be sent to each destination.
     * Defaults to true so that the forward destination is set as the
     * destination of the message
     */
    public void setCopyMessage(boolean copyMessage) {
        this.copyMessage = copyMessage;
    }

    public void setBrokerService(BrokerService brokerService) {
        this.brokerService = brokerService;
    }

    // Implementation methods
    //-------------------------------------------------------------------------
    protected Destination getMirrorDestination(Destination destination) throws Exception {
        if (brokerService == null) {
            throw new IllegalArgumentException("No brokerService injected!");
        }
        ActiveMQDestination topic = getMirrorTopic(destination.getActiveMQDestination());
        return brokerService.getDestination(topic);
    }

    protected ActiveMQDestination getMirrorTopic(ActiveMQDestination original) {
        return new ActiveMQTopic(prefix + original.getPhysicalName() + postfix);
    }

}


text:
CREATE PROCEDURE [catalog].[start_execution]
        @execution_id       bigint
AS
    SET NOCOUNT ON

    DECLARE @caller_id     int
    DECLARE @caller_name   [internal].[adt_sname]
    DECLARE @caller_sid    [internal].[adt_sid]
    DECLARE @suser_name    [internal].[adt_sname]
    DECLARE @suser_sid     [internal].[adt_sid]

    EXECUTE AS CALLER
        EXEC [internal].[get_user_info]
            @caller_name OUTPUT,
            @caller_sid OUTPUT,
            @suser_name OUTPUT,
            @suser_sid OUTPUT,
            @caller_id OUTPUT;

        IF(
            EXISTS(SELECT [name]
                    FROM sys.server_principals
                    WHERE [sid] = @suser_sid AND [type] = 'S')
            OR
            EXISTS(SELECT [name]
                    FROM sys.database_principals
                    WHERE ([sid] = @caller_sid AND [type] = 'S'))
            )
        BEGIN
            RAISERROR(27123, 16, 1) WITH NOWAIT
            RETURN 1
        END
    REVERT

    IF(
            EXISTS(SELECT [name]
                    FROM sys.server_principals
                    WHERE [sid] = @suser_sid AND [type] = 'S')
            OR
            EXISTS(SELECT [name]
                    FROM sys.database_principals
                    WHERE ([sid] = @caller_sid AND [type] = 'S'))
            )
    BEGIN
            RAISERROR(27123, 16, 1) WITH NOWAIT
            RETURN 1
    END

    DECLARE @return_value int

    IF (@execution_id IS NULL)
    BEGIN
        RAISERROR(27138, 16 , 1) WITH NOWAIT
        RETURN 1
    END

    IF @execution_id <= 0
    BEGIN
        RAISERROR(27101, 16 , 1, N'execution_id') WITH NOWAIT
        RETURN 1;
    END

    DECLARE @project_id bigint
    DECLARE @version_id bigint
    DECLARE @use32bitruntime bit

    EXEC @return_value = [internal].[prepare_execution]
        @execution_id,
        @project_id output,
        @version_id output,
        @use32bitruntime output

    IF (@return_value <> 0)

    BEGIN
        RETURN 1
    END

    BEGIN TRY
        EXEC @return_value =
                    [internal].[start_execution_internal]
                            @project_id,
                            @execution_id,
                            @version_id,
                            @use32bitruntime
    END TRY

    BEGIN CATCH
        UPDATE [internal].[operations] SET
            [end_time]  = SYSDATETIMEOFFSET(),
            [status]    = 4
            WHERE operation_id    = @execution_id;
        THROW;
    END CATCH

    IF (@return_value <> 0)
    BEGIN
        UPDATE [internal].[operations]
           SET [status] = 4,
           [end_time]  = SYSDATETIMEOFFSET()
           WHERE [operation_id] = @execution_id
        RETURN 1
    END

    RETURN (@return_value)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
J. Hattori bot. Lab. 43: 225 (1977)

#### Original name
Stereocaulon papuanum I.M. Lamb

### Remarks
null


text:
package com.amazonaws.services.rekognition.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.rekognition.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * PersonMatchMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class PersonMatchMarshaller {

    private static final MarshallingInfo<Long> TIMESTAMP_BINDING = MarshallingInfo.builder(MarshallingType.LONG).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Timestamp").build();
    private static final MarshallingInfo<StructuredPojo> PERSON_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Person").build();
    private static final MarshallingInfo<List> FACEMATCHES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("FaceMatches").build();

    private static final PersonMatchMarshaller instance = new PersonMatchMarshaller();

    public static PersonMatchMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(PersonMatch personMatch, ProtocolMarshaller protocolMarshaller) {

        if (personMatch == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(personMatch.getTimestamp(), TIMESTAMP_BINDING);
            protocolMarshaller.marshall(personMatch.getPerson(), PERSON_BINDING);
            protocolMarshaller.marshall(personMatch.getFaceMatches(), FACEMATCHES_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package au.org.aurin.wif.model.reports.suitability;

/**
 * The Enum SuitabilityCategory.
 */
public enum SuitabilityCategory {

  /** The low rank. */
  LOW(1),

  /** The medium low. */
  MEDIUM_LOW(2),

  /** The medium. */
  MEDIUM(3),

  /** The medium high. */
  MEDIUM_HIGH(4),

  /** The high rank. */
  HIGH(5);

  /** The rank. */
  private final int rank;

  /**
   * Instantiates a new suitability category.
   *
   * @param rank
   *          the rank
   */
  SuitabilityCategory(int rank) {
    this.rank = rank;
  }

  /**
   * Gets the rank.
   *
   * @return the rank
   */
  public int getRank() {
    return rank;
  }
}


text:
package com.amazonaws.util;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * An immutable map that could be built by convenient constructors.
 *

 * Example of using map Builder:
 *
 *

 * {
 *     @code
 *     Map<String, AttibuteValue> item = new ImmutableMapParameter.Builder<String, AttibuteValue>()
 *             .put("one", new AttibuteValue("1"))
 *             .put("two", new AttibuteValue("2"))
 *             .put("three", new AttibuteValue("3")).build();
 * }
 *

 *
 * For small immutable maps (up to five entries), the
 * {@code ImmutableMapParamter.of()} methods are preferred:
 *
 *

 * {@code
 *   Map<String, AttibuteValue> item =
 *       ImmutableMapParameter
 *           .of("one", new AttributeValue("1"),
 *               "two", new AttributeValue("2"),
 *               "three", new AttributeValue("3"),
 * }
 *

 *
 * @param <K>
 *            Class of the key for the map.
 * @param <V>
 *            Class of the value for the map.
 */
public class ImmutableMapParameter<K, V> implements Map<K, V> {

    private static final String UNMODIFIABLE_MESSAGE = "This is an immutable map.";
    private static final String DUPLICATED_KEY_MESSAGE = "Duplicate keys are provided.";

    private final Map<K, V> map;

    private ImmutableMapParameter(Map<K, V> map) {
        this.map = map;
    }

    /**
     * Returns a new MapParameterBuilder instance.
     */
    public static <K, V> Builder<K, V> builder() {
        return new Builder<K, V>();
    }

    /**
     * Returns an ImmutableMapParameter instance containing a single entry.
     *
     * @param k0
     *            Key of the single entry.
     * @param v0
     *            Value of the single entry.
     */
    public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0) {
        Map<K, V> map = Collections.singletonMap(k0, v0);
        return new ImmutableMapParameter<K, V>(map);
    }

    /**
     * Returns an ImmutableMapParameter instance containing two entries.
     *
     * @param k0
     *            Key of the first entry.
     * @param v0
     *            Value of the first entry.
     * @param k1
     *            Key of the second entry.
     * @param v1
     *            Value of the second entry.
     */
    public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1) {
        Map<K, V> map = new HashMap<K, V>();
        putAndWarnDuplicateKeys(map, k0, v0);
        putAndWarnDuplicateKeys(map, k1, v1);
        return new ImmutableMapParameter<K, V>(map);
    }

    /**
     * Returns an ImmutableMapParameter instance containing three entries.
     *
     * @param k0
     *            Key of the first entry.
     * @param v0
     *            Value of the first entry.
     * @param k1
     *            Key of the second entry.
     * @param v1
     *            Value of the second entry.
     * @param k2
     *            Key of the third entry.
     * @param v2
     *            Value of the third entry.
     */
    public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1,
            K k2, V v2) {
        Map<K, V> map = new HashMap<K, V>();
        putAndWarnDuplicateKeys(map, k0, v0);
        putAndWarnDuplicateKeys(map, k1, v1);
        putAndWarnDuplicateKeys(map, k2, v2);
        return new ImmutableMapParameter<K, V>(map);
    }

    /**
     * Returns an ImmutableMapParameter instance containing four entries.
     *
     * @param k0
     *            Key of the first entry.
     * @param v0
     *            Value of the first entry.
     * @param k1
     *            Key of the second entry.
     * @param v1
     *            Value of the second entry.
     * @param k2
     *            Key of the third entry.
     * @param v2
     *            Value of the third entry.
     * @param k3
     *            Key of the fourth entry.
     * @param v3
     *            Value of the fourth entry.
     */
    public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1,
            K k2, V v2, K k3, V v3) {
        Map<K, V> map = new HashMap<K, V>();
        putAndWarnDuplicateKeys(map, k0, v0);
        putAndWarnDuplicateKeys(map, k1, v1);
        putAndWarnDuplicateKeys(map, k2, v2);
        putAndWarnDuplicateKeys(map, k3, v3);
        return new ImmutableMapParameter<K, V>(map);
    }

    /**
     * Returns an ImmutableMapParameter instance containing five entries.
     *
     * @param k0
     *            Key of the first entry.
     * @param v0
     *            Value of the first entry.
     * @param k1
     *            Key of the second entry.
     * @param v1
     *            Value of the second entry.
     * @param k2
     *            Key of the third entry.
     * @param v2
     *            Value of the third entry.
     * @param k3
     *            Key of the fourth entry.
     * @param v3
     *            Value of the fourth entry.
     * @param k4
     *            Key of the fifth entry.
     * @param v4
     *            Value of the fifth entry.
     */
    public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1,
            K k2, V v2, K k3, V v3, K k4, V v4) {
        Map<K, V> map = new HashMap<K, V>();
        putAndWarnDuplicateKeys(map, k0, v0);
        putAndWarnDuplicateKeys(map, k1, v1);
        putAndWarnDuplicateKeys(map, k2, v2);
        putAndWarnDuplicateKeys(map, k3, v3);
        putAndWarnDuplicateKeys(map, k4, v4);
        return new ImmutableMapParameter<K, V>(map);
    }

    /** Inherited methods **/

    public boolean containsKey(Object key) {
        return map.containsKey(key);
    }

    public boolean containsValue(Object value) {
        return map.containsValue(value);
    }

    public Set<Entry<K, V>> entrySet() {
        return map.entrySet();
    }

    public V get(Object key) {
        return map.get(key);
    }

    public boolean isEmpty() {
        return map.isEmpty();
    }

    public Set<K> keySet() {
        return map.keySet();
    }

    public int size() {
        return map.size();
    }

    public Collection<V> values() {
        return map.values();
    }

    /** Unsupported methods **/

    public void clear() {
        throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
    }

    public V put(K key, V value) {
        throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
    }

    public void putAll(Map<? extends K, ? extends V> map) {
        throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
    }

    public V remove(Object key) {
        throw new UnsupportedOperationException(UNMODIFIABLE_MESSAGE);
    }

    private static <K, V> void putAndWarnDuplicateKeys(Map<K, V> map, K key,
            V value) {
        if (map.containsKey(key))
            throw new IllegalArgumentException(DUPLICATED_KEY_MESSAGE);
        map.put(key, value);
    }

    @Override
    public boolean equals(Object o) {
        return map.equals(o);
    }

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

    @Override
    public String toString() {
        return map.toString();
    }

    /**
     * A convenient builder for creating ImmutableMapParameter instances.
     */
    public static class Builder<K, V> {

        private final Map<K, V> entries;

        public Builder() {
            this.entries = new HashMap<K, V>();
        }

        /**
         * Add a key-value pair into the built map. The method will throw
         * IllegalArgumentException immediately when duplicate keys are
         * provided.
         *
         * @return Returns a reference to this object so that method calls can
         *         be chained together.
         */
        public Builder<K, V> put(K key, V value) {
            putAndWarnDuplicateKeys(entries, key, value);
            return this;
        }

        /**
         * Generates and returns a new ImmutableMapParameter instance which
         * contains all the entries added into the Builder by {@code put()}
         * method.
         */
        public ImmutableMapParameter<K, V> build() {
            HashMap<K, V> builtMap = new HashMap<K, V>();
            builtMap.putAll(entries);
            return new ImmutableMapParameter<K, V>(builtMap);
        }
    }
}


text:
<?php

namespace Tree;

class Metadata {

    protected $left;
    protected $right;
    protected $level;

    public function __construct($left, $right, $level)
    {
        $this->left = $left;
        $this->right = $right;
        $this->level = $level;
    }

    public function getLeft()
    {
        return $this->left;
    }

    public function getRight()
    {
        return $this->right;
    }

    public function getLevel()
    {
        return $this->level;
    }

    public static function fromArray($raw)
    {
        return new static($raw['left'], $raw['right'], $raw['level']);
    }

    public function isRoot()
    {
        return 1 == $this->left;
    }
}


text:
#pragma once
#include <aws/rds/RDS_EXPORTS.h>
#include <aws/rds/RDSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/rds/model/Filter.h>
#include <utility>

namespace Aws
{
namespace RDS
{
namespace Model
{

  /**
   *

See Also:
   AWS
   * API Reference

   */
  class AWS_RDS_API DescribeDBClustersRequest : public RDSRequest
  {
  public:
    DescribeDBClustersRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DescribeDBClusters"; }

    Aws::String SerializePayload() const override;

  protected:
    void DumpBodyToUrl(Aws::Http::URI& uri ) const override;

  public:

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline const Aws::String& GetDBClusterIdentifier() const{ return m_dBClusterIdentifier; }

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline bool DBClusterIdentifierHasBeenSet() const { return m_dBClusterIdentifierHasBeenSet; }

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline void SetDBClusterIdentifier(const Aws::String& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = value; }

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline void SetDBClusterIdentifier(Aws::String&& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = std::move(value); }

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline void SetDBClusterIdentifier(const char* value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier.assign(value); }

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline DescribeDBClustersRequest& WithDBClusterIdentifier(const Aws::String& value) { SetDBClusterIdentifier(value); return *this;}

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline DescribeDBClustersRequest& WithDBClusterIdentifier(Aws::String&& value) { SetDBClusterIdentifier(std::move(value)); return *this;}

    /**
     *
The user-supplied DB cluster identifier. If this parameter is specified,
     * information from only the specific DB cluster is returned. This parameter isn't
     * case-sensitive.

Constraints:

If supplied, must match an
     * existing DBClusterIdentifier.

     */
    inline DescribeDBClustersRequest& WithDBClusterIdentifier(const char* value) { SetDBClusterIdentifier(value); return *this;}

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline const Aws::Vector<Filter>& GetFilters() const{ return m_filters; }

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline bool FiltersHasBeenSet() const { return m_filtersHasBeenSet; }

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline void SetFilters(const Aws::Vector<Filter>& value) { m_filtersHasBeenSet = true; m_filters = value; }

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline void SetFilters(Aws::Vector<Filter>&& value) { m_filtersHasBeenSet = true; m_filters = std::move(value); }

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline DescribeDBClustersRequest& WithFilters(const Aws::Vector<Filter>& value) { SetFilters(value); return *this;}

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline DescribeDBClustersRequest& WithFilters(Aws::Vector<Filter>&& value) { SetFilters(std::move(value)); return *this;}

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline DescribeDBClustersRequest& AddFilters(const Filter& value) { m_filtersHasBeenSet = true; m_filters.push_back(value); return *this; }

    /**
     *
A filter that specifies one or more DB clusters to describe.

Supported
     * filters:

 clone-group-id - Accepts clone group
     * identifiers. The results list will only include information about the DB
     * clusters associated with these clone groups.

     * db-cluster-id - Accepts DB cluster identifiers and DB cluster
     * Amazon Resource Names (ARNs). The results list will only include information
     * about the DB clusters identified by these ARNs.

     * domain - Accepts Active Directory directory IDs. The results list
     * will only include information about the DB clusters associated with these
     * domains.

 engine - Accepts engine names. The
     * results list will only include information about the DB clusters for these
     * engines.

     */
    inline DescribeDBClustersRequest& AddFilters(Filter&& value) { m_filtersHasBeenSet = true; m_filters.push_back(std::move(value)); return *this; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so you can retrieve the remaining
     * results.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline int GetMaxRecords() const{ return m_maxRecords; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so you can retrieve the remaining
     * results.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline bool MaxRecordsHasBeenSet() const { return m_maxRecordsHasBeenSet; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so you can retrieve the remaining
     * results.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline void SetMaxRecords(int value) { m_maxRecordsHasBeenSet = true; m_maxRecords = value; }

    /**
     *
The maximum number of records to include in the response. If more records
     * exist than the specified MaxRecords value, a pagination token
     * called a marker is included in the response so you can retrieve the remaining
     * results.

Default: 100

Constraints: Minimum 20, maximum 100.

     */
    inline DescribeDBClustersRequest& WithMaxRecords(int value) { SetMaxRecords(value); return *this;}

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline const Aws::String& GetMarker() const{ return m_marker; }

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline bool MarkerHasBeenSet() const { return m_markerHasBeenSet; }

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(const Aws::String& value) { m_markerHasBeenSet = true; m_marker = value; }

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(Aws::String&& value) { m_markerHasBeenSet = true; m_marker = std::move(value); }

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline void SetMarker(const char* value) { m_markerHasBeenSet = true; m_marker.assign(value); }

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeDBClustersRequest& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeDBClustersRequest& WithMarker(Aws::String&& value) { SetMarker(std::move(value)); return *this;}

    /**
     *
An optional pagination token provided by a previous
     * DescribeDBClusters request. If this parameter is specified, the
     * response includes only records beyond the marker, up to the value specified by
     * MaxRecords.

     */
    inline DescribeDBClustersRequest& WithMarker(const char* value) { SetMarker(value); return *this;}

    /**
     *
Optional Boolean parameter that specifies whether the output includes
     * information about clusters shared from other Amazon Web Services accounts.

     */
    inline bool GetIncludeShared() const{ return m_includeShared; }

    /**
     *
Optional Boolean parameter that specifies whether the output includes
     * information about clusters shared from other Amazon Web Services accounts.

     */
    inline bool IncludeSharedHasBeenSet() const { return m_includeSharedHasBeenSet; }

    /**
     *
Optional Boolean parameter that specifies whether the output includes
     * information about clusters shared from other Amazon Web Services accounts.

     */
    inline void SetIncludeShared(bool value) { m_includeSharedHasBeenSet = true; m_includeShared = value; }

    /**
     *
Optional Boolean parameter that specifies whether the output includes
     * information about clusters shared from other Amazon Web Services accounts.

     */
    inline DescribeDBClustersRequest& WithIncludeShared(bool value) { SetIncludeShared(value); return *this;}

  private:

    Aws::String m_dBClusterIdentifier;
    bool m_dBClusterIdentifierHasBeenSet;

    Aws::Vector<Filter> m_filters;
    bool m_filtersHasBeenSet;

    int m_maxRecords;
    bool m_maxRecordsHasBeenSet;

    Aws::String m_marker;
    bool m_markerHasBeenSet;

    bool m_includeShared;
    bool m_includeSharedHasBeenSet;
  };

} // namespace Model
} // namespace RDS
} // namespace Aws


text:
var passport = require('passport'),
    LocalStrategy = require('passport-local').Strategy,
    {ValidationError} = require('vlad');

passport.serializeUser(function(user, done) {
    done(user ? 'true' : 'false');
});

passport.deserializeUser(function(id, done) {
    done(id === 'true');
});

passport.use('local-login', new LocalStrategy({
    usernameField: 'username'
}, function(username, password, done) {

    if(username === 'admin' && password === 'password') {
        done(null, true);
    } else {
        done(ValidationError());
    }
}));

module.exports = passport;


text:
<?xml version="1.0" encoding="utf-8"?>
<transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
    <changeImageTransform />
</transitionManager>


text:
#import "CoreDAVItem.h"

@class ICSDateValue, NSMutableSet;

@interface CalDAVCalendarServerResourceChangedItem : CoreDAVItem
{
    NSMutableSet *_created;
    NSMutableSet *_updated;
    NSMutableSet *_deleted;
    NSMutableSet *_collectionChanges;
    NSMutableSet *_collectionUpdates;
    ICSDateValue *_dtstamp;
}

@property(retain) ICSDateValue *dtstamp; // @synthesize dtstamp=_dtstamp;
@property(retain) NSMutableSet *collectionUpdates; // @synthesize collectionUpdates=_collectionUpdates;
@property(retain) NSMutableSet *collectionChanges; // @synthesize collectionChanges=_collectionChanges;
@property(retain) NSMutableSet *deleted; // @synthesize deleted=_deleted;
@property(retain) NSMutableSet *updated; // @synthesize updated=_updated;
@property(retain) NSMutableSet *created; // @synthesize created=_created;
- (id)copyParseRules;
- (void)setDtstampItem:(id)arg1;
- (void)addCollectionUpdates:(id)arg1;
- (void)addCollectionChanges:(id)arg1;
- (void)addDeleted:(id)arg1;
- (void)addUpdated:(id)arg1;
- (void)addCreated:(id)arg1;
- (id)init;
- (void)dealloc;

@end


text: Gulp plugin for easily creating and deploying application tarballs


text:
package ru.cain.appmanager;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

/**
 * Created by www on 17.11.2016.
 */
public class SessionHelper extends HelperBAse {

  public SessionHelper(WebDriver wd) {
    super(wd);
  }

  public void login(String userLogin, String password) {
    type(By.name("username"), userLogin);
    type(By.name("password"), password);
    click(By.xpath("//div[@class='button-case']//button[.='Войти']"));
  }

  public void initAlfa() {
    if (isElementPresent(By.name("pt1:password_key"))) {
      type(By.id("pt1:password_key::content"), "0000");
      click(By.id("pt1:next_button::button"));

    }
  }
}


text:
UPDATE TEMPLATE_INFO SET TENANT_ID='1';
UPDATE TEMPLATE_FIELD SET TENANT_ID='1';


text:
package voogasalad_GucciGames.gameAuthoring.gui.gaedialog.dialogcomponents;

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

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Font;

public class DialogTableView extends GridPane {

	private GridPane controlPane = new GridPane();
	private TextField textField;
	private TableView tableView;
	private ObservableList<TableElement> data;

	private ComboBox<String> dropDown = new ComboBox<String>();
	private List<String> availableItems;
	private Button removeBtn = new Button("Remove Selected");
	private String selectedType;
	private String title;

	public DialogTableView(List<String> availableItems, String title) {
		this.title = title;

		this.availableItems = availableItems;
		data = FXCollections.observableArrayList(new ArrayList<TableElement>());
		removeBtn.setOnAction(e -> {
			data.remove(this.tableView.getSelectionModel().getSelectedItem());
			this.tableView.getSelectionModel().clearSelection();
		});
		this.add(removeBtn, 1, 1);
		setTableView();
		setControlPane();
	}

	public DialogTableView(ObservableList<TableElement> data, String title) {
		this.title = title;
		this.data = data;
		setTableView();
	}

	public DialogTableView(List<String> availableItems, String title, int width, int height) {
		this.title = title;
		this.data = data;
		setTableView();
		tableView.setPrefSize(width, height);
	}

	public List<String> getData() {
		List<String> items = new ArrayList<String>();
		for (TableElement e : data) {
			items.add(e.getName());
		}
		return items;

	}

	private void setTableView() {
		this.setHgap(5);
		this.setVgap(5);
		Label titleLbl = new Label(title);
		titleLbl.setFont(new Font("Arial", 20));
		this.getChildren().add(titleLbl);

		tableView = new TableView();
		tableView.setItems(data);
		TableColumn nameCol = new TableColumn("Name");
		nameCol.setCellValueFactory(new PropertyValueFactory<TableElement, String>("name"));
		tableView.getColumns().add(nameCol);
		nameCol.setMinWidth(tableView.getWidth());
		this.add(tableView, 0, 1);
	}

	private void setDropDown() {
		dropDown.setItems(FXCollections.observableArrayList(availableItems));
		dropDown.setOnAction(e -> {
			String selected = dropDown.getSelectionModel().getSelectedItem();
			textField.setText(selected);
		});

	}

	private void setControlPane() {
		controlPane.setHgap(5);
		controlPane.setVgap(5);
		controlPane.setPadding(new Insets(5, 5, 5, 5));
		textField = new TextField();
		textField.setDisable(true);
		dropDown.setItems(FXCollections.observableArrayList(availableItems));
		dropDown.setOnAction(e -> {
			String selected = dropDown.getSelectionModel().getSelectedItem();
			textField.setText(selected);
		});

		final Button addSelectedBtn = new Button("Add Selected");
		addSelectedBtn.setOnAction(e -> {
			String name = textField.getText();
			if (!contains(name)) {
				TableElement element = new TableElement(name, selectedType);
				data.add(element);
			}
		});
		controlPane.add(textField, 0, 0);
		controlPane.add(dropDown, 1, 0);
		controlPane.add(addSelectedBtn, 2, 0);
		this.add(controlPane, 0, 2);

	}

	private boolean contains(String name) {
		for (TableElement e : data) {
			if (e.getName().equals(name)) {
				tableView.getSelectionModel().select(e);
				return true;
			}
		}
		return false;
	}

	public void addControlButton(Button btn) {
		controlPane.add(btn, 3, 0);
	}

}


text:
package com.mercadopago.android.px.internal.features.uicontrollers.card;

/**
 * Created by vaserber on 9/29/16.
 */

public class CardRepresentationModes {
    //Modes
    public static final String SHOW_FULL_FRONT_ONLY = "show_full_front_only_mode";
    public static final String SHOW_EMPTY_FRONT_ONLY = "show_empty_front_only_mode";
    public static final String EDIT_FRONT = "edit_front_mode";

    //Sizes
    public static final String MEDIUM_SIZE = "medium_size";
    public static final String BIG_SIZE = "big_size";
    public static final String EXTRA_BIG_SIZE = "extra_big_size";
    public static final int CARD_NUMBER_SIZE_MEDIUM = 12;
    public static final int CARD_NUMBER_SIZE_BIG = 16;
    public static final int CARD_NUMBER_SIZE_EXTRA_BIG = 19;
    public static final int CARD_HOLDER_NAME_SIZE_MEDIUM = 10;
    public static final int CARD_HOLDER_NAME_SIZE_BIG = 12;
    public static final int CARD_HOLDER_NAME_SIZE_EXTRA_BIG = 14;
    public static final int CARD_EXPIRY_DATE_SIZE_MEDIUM = 10;
    public static final int CARD_EXPIRY_DATE_SIZE_BIG = 12;
    public static final int CARD_EXPIRY_DATE_SIZE_EXTRA_BIG = 14;
    public static final int CARD_SECURITY_CODE_FRONT_SIZE_MEDIUM = 14;
    public static final int CARD_SECURITY_CODE_FRONT_SIZE_BIG = 16;
    public static final int CARD_SECURITY_CODE_FRONT_SIZE_EXTRA_BIG = 18;
    public static final int CARD_SECURITY_CODE_BACK_SIZE_MEDIUM = 12;
    public static final int CARD_SECURITY_CODE_BACK_SIZE_BIG = 14;
    public static final int CARD_SECURITY_CODE_BACK_SIZE_EXTRA_BIG = 16;
}


text:
package logbook.internal;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonString;
import javax.json.JsonValue;

/**
 * JsonObjectを扱うための補助クラスです
 *
 */
public final class JsonHelper {

    /**
     * JsonNumberをLongに変換します
     *
     * @see JsonNumber#longValue()
     * @see BigDecimal#longValue()
     * @param val Longに変換するJsonValue
     * @return Long
     */
    public static Long toLong(JsonValue val) {
        if (val instanceof JsonNumber) {
            return ((JsonNumber) val).longValue();
        }
        return new BigDecimal(toString(val)).longValue();
    }

    /**
     * JsonValueをIntegerに変換します
     *
     * @see JsonNumber#intValue()
     * @see BigDecimal#intValue()
     * @param val Integerに変換するJsonValue
     * @return Integer
     */
    public static Integer toInteger(JsonValue val) {
        if (val instanceof JsonNumber) {
            return ((JsonNumber) val).intValue();
        }
        return new BigDecimal(toString(val)).intValue();
    }

    /**
     * JsonValueをDoubleに変換します
     *
     * @see JsonNumber#doubleValue()
     * @see BigDecimal#doubleValue()
     * @param val Doubleに変換するJsonValue
     * @return Double
     */
    public static Double toDouble(JsonValue val) {
        if (val instanceof JsonNumber) {
            return ((JsonNumber) val).doubleValue();
        }
        return new BigDecimal(toString(val)).doubleValue();
    }

    /**
     * JsonValueをBigDecimalに変換します
     *
     * @see JsonNumber#bigDecimalValue()
     * @param val BigDecimalに変換するJsonValue
     * @return BigDecimal
     */
    public static BigDecimal toBigDecimal(JsonValue val) {
        if (val instanceof JsonNumber) {
            return ((JsonNumber) val).bigDecimalValue();
        }
        return new BigDecimal(toString(val));
    }

    /**
     * JsonValueをStringに変換します
     *
     * @see JsonString#getString()
     * @see JsonValue#toString()
     * @param val Stringに変換するJsonValue
     * @return String
     */
    public static String toString(JsonValue val) {
        if (val instanceof JsonString) {
            return ((JsonString) val).getString();
        }
        return toObject(val, Object::toString);
    }

    /**
     * JsonValueをBooleanに変換します
     *
     * @param val Booleanに変換するJsonValue
     * @return JsonNumber の場合、 BigDecimal.ZEROと等しくない場合 true、BigDecimal.ZEROと等しい場合はfalse

     * JsonNumber 以外の場合、JsonValue.FALSEと等しくない場合 true、sonValue.FALSEと等しい場合はfalse

     */
    public static Boolean toBoolean(JsonValue val) {
        return toObject(val, v -> {
            if (v instanceof JsonNumber) {
                // JsonNumber の場合、 BigDecimal.ZEROと等しくない場合 true、それ以外はfalse
                return BigDecimal.ZERO.compareTo(((JsonNumber) v).bigDecimalValue()) != 0;
            }
            return v != JsonValue.FALSE;
        });
    }

    /**
     * JsonValueを任意のオブジェクトに変換します
     *
     * @param <T> JsonValueの実際の型
     * @param <R> functionの戻り値の型
     * @param val 型Rに変換するJsonValue
     * @param function 変換Function
     * @return 変換後のオブジェクト
     */
    public static <T extends JsonValue, R> R toObject(T val, Function<T, R> function) {
        if (val == null || val == JsonValue.NULL) {
            return null;
        }
        return function.apply(val);
    }

    /**
     * JsonArrayをLongのListに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return LongのList
     */
    public static List<Long> toLongList(JsonArray val) {
        return toList(val, JsonHelper::toLong);
    }

    /**
     * JsonValueをLongのListに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptyList()}を返します。

     *
     * @param val 変換するJsonValue
     * @return LongのList
     */
    public static List<Long> checkedToLongList(JsonValue val) {
        if (val instanceof JsonArray) {
            return toList((JsonArray) val, JsonHelper::toLong);
        }
        return Collections.emptyList();
    }

    /**
     * JsonArrayをIntegerのListに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return IntegerのList
     */
    public static List<Integer> toIntegerList(JsonArray val) {
        return toList(val, JsonHelper::toInteger);
    }

    /**
     * JsonValueをIntegerのListに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptyList()}を返します。

     *
     * @param val 変換するJsonArray
     * @return IntegerのList
     */
    public static List<Integer> checkedToIntegerList(JsonValue val) {
        if (val instanceof JsonArray) {
            return toList((JsonArray) val, JsonHelper::toInteger);
        }
        return Collections.emptyList();
    }

    /**
     * JsonArrayをDoubleのListに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return DoubleのList
     */
    public static List<Double> toDoubleList(JsonArray val) {
        return toList(val, JsonHelper::toDouble);
    }

    /**
     * JsonValueをDoubleのListに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptyList()}を返します。

     *
     * @param val 変換するJsonArray
     * @return DoubleのList
     */
    public static List<Double> checkedToDoubleList(JsonValue val) {
        if (val instanceof JsonArray) {
            return toList((JsonArray) val, JsonHelper::toDouble);
        }
        return Collections.emptyList();
    }

    /**
     * JsonArrayをBigDecimalのListに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return BigDecimalのList
     */
    public static List<BigDecimal> toBigDecimalList(JsonArray val) {
        return toList(val, JsonHelper::toBigDecimal);
    }

    /**
     * JsonValueをBigDecimalのListに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptyList()}を返します。

     *
     * @param val 変換するJsonArray
     * @return BigDecimalのList
     */
    public static List<BigDecimal> checkedToBigDecimalList(JsonValue val) {
        if (val instanceof JsonArray) {
            return toList((JsonArray) val, JsonHelper::toBigDecimal);
        }
        return Collections.emptyList();
    }

    /**
     * JsonArrayをStringのListに変換します

     *
     * @param val 変換するJsonArray
     * @return StringのList
     */
    public static List<String> toStringList(JsonArray val) {
        return toList(val, JsonHelper::toString);
    }

    /**
     * JsonValueをStringのListに変換します

     * valがJsonArrayではない場合{@code Collections#emptyList()}を返します。

     *
     * @param val 変換するJsonArray
     * @return StringのList
     */
    public static List<String> checkedToStringList(JsonValue val) {
        if (val instanceof JsonArray) {
            return toList((JsonArray) val, JsonHelper::toString);
        }
        return Collections.emptyList();
    }

    /**
     * JsonArrayをLongのSetに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return LongのSet
     */
    public static Set<Long> toLongSet(JsonArray val) {
        return toSet(val, JsonHelper::toLong);
    }

    /**
     * JsonValueをLongのSetに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptySet()}を返します。

     *
     * @param val 変換するJsonValue
     * @return LongのSet
     */
    public static Set<Long> checkedToLongSet(JsonValue val) {
        if (val instanceof JsonArray) {
            return toSet((JsonArray) val, JsonHelper::toLong);
        }
        return Collections.emptySet();
    }

    /**
     * JsonArrayをIntegerのSetに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return IntegerのSet
     */
    public static Set<Integer> toIntegerSet(JsonArray val) {
        return toSet(val, JsonHelper::toInteger);
    }

    /**
     * JsonValueをIntegerのSetに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptySet()}を返します。

     *
     * @param val 変換するJsonArray
     * @return IntegerのSet
     */
    public static Set<Integer> checkedToIntegerSet(JsonValue val) {
        if (val instanceof JsonArray) {
            return toSet((JsonArray) val, JsonHelper::toInteger);
        }
        return Collections.emptySet();
    }

    /**
     * JsonArrayをDoubleのSetに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return DoubleのSet
     */
    public static Set<Double> toDoubleSet(JsonArray val) {
        return toSet(val, JsonHelper::toDouble);
    }

    /**
     * JsonValueをDoubleのSetに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptySet()}を返します。

     *
     * @param val 変換するJsonArray
     * @return DoubleのSet
     */
    public static Set<Double> checkedToDoubleSet(JsonValue val) {
        if (val instanceof JsonArray) {
            return toSet((JsonArray) val, JsonHelper::toDouble);
        }
        return Collections.emptySet();
    }

    /**
     * JsonArrayをBigDecimalのSetに変換します

     * JsonArrayの内容はすべてJsonNumberである必要があります
     *
     * @param val 変換するJsonArray
     * @return BigDecimalのSet
     */
    public static Set<BigDecimal> toBigDecimalSet(JsonArray val) {
        return toSet(val, JsonHelper::toBigDecimal);
    }

    /**
     * JsonValueをBigDecimalのSetに変換します

     * valのJsonArrayの場合、内容はすべてJsonNumberである必要があります

     * valがJsonArrayではない場合{@code Collections#emptySet()}を返します。

     *
     * @param val 変換するJsonArray
     * @return BigDecimalのSet
     */
    public static Set<BigDecimal> checkedToBigDecimalSet(JsonValue val) {
        if (val instanceof JsonArray) {
            return toSet((JsonArray) val, JsonHelper::toBigDecimal);
        }
        return Collections.emptySet();
    }

    /**
     * JsonArrayをStringのSetに変換します

     *
     * @param val 変換するJsonArray
     * @return StringのSet
     */
    public static Set<String> toStringSet(JsonArray val) {
        return toSet(val, JsonHelper::toString);
    }

    /**
     * JsonValueをStringのSetに変換します

     * valがJsonArrayではない場合{@code Collections#emptySet()}を返します。

     *
     * @param val 変換するJsonArray
     * @return StringのSet
     */
    public static Set<String> checkedToStringSet(JsonValue val) {
        if (val instanceof JsonArray) {
            return toSet((JsonArray) val, JsonHelper::toString);
        }
        return Collections.emptySet();
    }

    /**
     * JsonArrayまたはJsonObjectをCollectionに変換します

     * JsonObjectの場合は単一のオブジェクトだけを格納しているCollectionを返します
     *
     * @param <T> JsonArrayの内容の型
     * @param <R> functionの戻り値の型
     * @param <C> 変換後のCollectionの型
     * @param value 変換するJsonArrayまたはJsonObject
     * @param function JsonValueを受け取って変換するFunction
     * @param supplier Collectionインスタンスを供給するSupplier
     * @return 変換後のCollection
     */
    @SuppressWarnings("unchecked")
    public static <T extends JsonValue, C extends Collection<R>, R> C toCollection(JsonValue value,
            Function<T, R> function, Supplier<C> supplier) {
        C collection = supplier.get();
        if (value instanceof JsonArray) {
            for (JsonValue val : (JsonArray) value) {
                if (val == null || val == JsonValue.NULL) {
                    collection.add(null);
                } else {
                    collection.add(function.apply((T) val));
                }
            }
        } else {
            collection.add(function.apply((T) value));
        }
        return collection;
    }

    /**
     * JsonArrayをListに変換します
     *
     * @param <T> JsonArrayの内容の型
     * @param <R> functionの戻り値の型
     * @param value 変換するJsonArrayまたはJsonObject
     * @param function JsonValueを受け取って変換するFunction
     * @return 変換後のList
     */
    public static <T extends JsonValue, R> List<R> toList(JsonValue value, Function<T, R> function) {
        return toCollection(value, function, ArrayList::new);
    }

    /**
     * JsonArrayをListに変換する関数を返します
     *
     * @param <T> JsonArrayの内容の型
     * @param <R> functionの戻り値の型
     * @param function JsonValueを受け取って変換するFunction
     * @return Listに変換する関数
     */
    public static <T extends JsonValue, R> Function<JsonValue, List<R>> toList(Function<T, R> function) {
        return val -> JsonHelper.toList(val, function);
    }

    /**
     * JsonArrayをSetに変換します
     *
     * @param <T> JsonArrayの内容の型
     * @param <R> functionの戻り値の型
     * @param value 変換するJsonArrayまたはJsonObject
     * @param function JsonValueを受け取って変換するFunction
     * @return 変換後のSet
     */
    public static <T extends JsonValue, R> Set<R> toSet(JsonValue value, Function<T, R> function) {
        return toCollection(value, function, LinkedHashSet::new);
    }

    /**
     * JsonArrayをSetに変換する関数を返します
     *
     * @param <T> JsonArrayの内容の型
     * @param <R> functionの戻り値の型
     * @param function JsonValueを受け取って変換するFunction
     * @return Setに変換する関数
     */
    public static <T extends JsonValue, R> Function<JsonValue, Set<R>> toSet(Function<T, R> function) {
        return val -> JsonHelper.toSet(val, function);
    }

    /**
     * JsonArrayをMapに変換します
     *
     * @param <T> JsonArrayの内容の型
     * @param <K> Mapのキーの型
     * @param <R> Mapの内容の型
     * @param array 変換するJsonArray
     * @param keyMapper valueMapperで変換したオブジェクトからキーを取り出すFunction
     * @param valueMapper array内のJsonValueを変換するFunction
     * @return 変換後のMap
     */
    @SuppressWarnings("unchecked")
    public static <T extends JsonValue, K, R> Map<K, R> toMap(JsonArray array, Function<R, K> keyMapper,
            Function<T, R> valueMapper) {
        Map<K, R> map = new LinkedHashMap<>();
        for (JsonValue val : array) {
            R r = valueMapper.apply((T) val);
            map.put(keyMapper.apply(r), r);
        }
        return map;
    }

    /**
     * JsonObjectをMapに変換します
     *
     * @param <T> JsonObjectの内容の型
     * @param <K> Mapのキーの型
     * @param <R> Mapの内容の型
     * @param obj 変換するJsonObject
     * @param keyMapper JsonObjectのキーからキーを取り出すFunction
     * @param valueMapper array内のJsonValueを変換するFunction
     * @return 変換後のMap
     */
    @SuppressWarnings("unchecked")
    public static <T extends JsonValue, K, R> Map<K, R> toMap(JsonObject obj, Function<String, K> keyMapper,
            Function<T, R> valueMapper) {
        Map<K, R> map = new LinkedHashMap<>();
        obj.forEach((k, v) -> {
            R r = valueMapper.apply((T) v);
            map.put(keyMapper.apply(k), r);
        });
        return map;
    }

    /**
     * JsonObjectから別のオブジェクトへの単方向バインディングを提供します。

     *

     * 次の例はbeanにJSONからの値を設定する例です。

     * JSON例

     *
{"api_id" : 558, "api_name" : "深海復讐艦攻改", "api_type" : [ 3, 5, 8, 8 ]}

     * Javaコード例

     *
JsonHelper.bind(json)
     *      .set("api_id", bean::setId, JsonHelper::toInteger)
     *      .set("api_name", bean::setName, JsonHelper::toString)
     *      .set("api_type", bean::setType, JsonHelper::toIntegerList);

     *
     * @param json JsonObject
     * @return {@link Bind}
     */
    public static Bind bind(JsonObject json) {
        return new Bind(json);
    }

    /**
     * JsonObjectから別のオブジェクトへの単方向バインディングを提供します。

     *

     * 次の例はbeanにJSONからの値を設定する例です。

     * JSON例

     *
{"api_id" : 558, "api_name" : "深海復讐艦攻改", "api_type" : [ 3, 5, 8, 8 ]}

     * Javaコード例

     *
JsonHelper.bind(json)
     *      .set("api_id", bean::setId, JsonHelper::toInteger)
     *      .set("api_name", bean::setName, JsonHelper::toString)
     *      .set("api_type", bean::setType, JsonHelper::toIntegerList);

     *
     * @param json JsonObject
     * @param listener BindListener
     * @return {@link Bind}
     */
    public static Bind bind(JsonObject json, BindListener listener) {
        return new Bind(json, listener);
    }

    /**
     * JsonObjectから別のオブジェクトへの単方向バインディングを提供します。

     *
     */
    public static class Bind {

        private JsonObject json;

        private BindListener listener;

        /**
         * コンストラクター
         *
         * @param json JsonObject
         */
        private Bind(JsonObject json) {
            this.json = json;
        }

        /**
         * コンストラクター
         *
         * @param json JsonObject
         * @param listener BindListener
         */
        private Bind(JsonObject json, BindListener listener) {
            this.json = json;
            this.listener = listener;
        }

        /**
         * keyで取得したJsonValueをconverterで変換したものをconsumerへ設定します

         *
         * @param <T> JsonObject#get(Object) の戻り値の型
         * @param <R> converterの戻り値の型
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @param converter JsonValueを変換するFunction
         * @return {@link Bind}
         */
        @SuppressWarnings("unchecked")
        public <T extends JsonValue, R> Bind set(String key, Consumer<R> consumer, Function<T, R> converter) {
            JsonValue val = this.json.get(key);
            if (val != null && JsonValue.NULL != val) {
                R obj = converter.apply((T) val);
                consumer.accept(obj);
                if (this.listener != null) {
                    this.listener.apply(key, val, obj);
                }
            }
            return this;
        }

        /**
         * keyで取得したJsonValueをList<Integer>に変換したものをconsumerへ設定します

         *
         * @param <T> JsonObject#get(Object) の戻り値の型
         * @param key JsonObjectから取得するキー
         * @param consumer List<Integer>を消費するConsumer
         * @return {@link Bind}
         */
        public <T extends JsonArray> Bind setIntegerList(String key, Consumer<List<Integer>> consumer) {
            return this.set(key, consumer, JsonHelper::toIntegerList);
        }

        /**
         * keyで取得したJsonValueをList<Long>に変換したものをconsumerへ設定します

         *
         * @param <T> JsonObject#get(Object) の戻り値の型
         * @param key JsonObjectから取得するキー
         * @param consumer List<Long>を消費するConsumer
         * @return {@link Bind}
         */
        public <T extends JsonArray> Bind setLongList(String key, Consumer<List<Long>> consumer) {
            return this.set(key, consumer, JsonHelper::toLongList);
        }

        /**
         * keyで取得したJsonValueをList<Double>に変換したものをconsumerへ設定します

         *
         * @param <T> JsonObject#get(Object) の戻り値の型
         * @param key JsonObjectから取得するキー
         * @param consumer List<Double>を消費するConsumer
         * @return {@link Bind}
         */
        public <T extends JsonArray> Bind setDoubleList(String key, Consumer<List<Double>> consumer) {
            return this.set(key, consumer, JsonHelper::toDoubleList);
        }

        /**
         * keyで取得したJsonValueをList<String>に変換したものをconsumerへ設定します

         *
         * @param <T> JsonObject#get(Object) の戻り値の型
         * @param key JsonObjectから取得するキー
         * @param consumer List<Integer>を消費するConsumer
         * @return {@link Bind}
         */
        public <T extends JsonArray> Bind setStringList(String key, Consumer<List<String>> consumer) {
            return this.set(key, consumer, JsonHelper::toStringList);
        }

        /**
         * keyで取得したJsonValueをStringに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setString(String key, Consumer<String> consumer) {
            return this.set(key, consumer, JsonHelper::toString);
        }

        /**
         * keyで取得したJsonValueをIntegerに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setInteger(String key, Consumer<Integer> consumer) {
            return this.set(key, consumer, JsonHelper::toInteger);
        }

        /**
         * keyで取得したJsonValueをLongに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setLong(String key, Consumer<Long> consumer) {
            return this.set(key, consumer, JsonHelper::toLong);
        }

        /**
         * keyで取得したJsonValueをDoubleに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setDouble(String key, Consumer<Double> consumer) {
            return this.set(key, consumer, JsonHelper::toDouble);
        }

        /**
         * keyで取得したJsonValueをBigDecimalに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setBigDecimal(String key, Consumer<BigDecimal> consumer) {
            return this.set(key, consumer, JsonHelper::toBigDecimal);
        }

        /**
         * keyで取得したJsonValueをBooleanに変換しconsumerへ設定します

         *
         * @param key JsonObjectから取得するキー
         * @param consumer converterの戻り値を消費するConsumer
         * @return {@link Bind}
         */
        public Bind setBoolean(String key, Consumer<Boolean> consumer) {
            return this.set(key, consumer, JsonHelper::toBoolean);
        }
    }

    /**
     * {@link Bind}によって設定される値を監視するためのリスナー
     */
    public static interface BindListener {

        /**
         * 設定される値を監視します
         *
         * @param key JsonObjectのキー
         * @param val JsonObjectの値
         * @param obj converterより返された値
         */
        void apply(String key, JsonValue val, Object obj);
    }
}


text:
const Lexer = require('../lexer');
const {
  AbstractNotionException,
  TypeException,
  ModifierException,
  MotiveException,
  SelectorException,
  DeclarationException
} = require('../exceptions');

const mockFile = {
  name: 'Lexer test mock file'
}

test('Detect unknown declaration type', () => {
  mockFile.source = `
  footer {
    display<locked>:flex;
  }
  `;

  const unkownType = () => Lexer.tokenize(mockFile);
  expect(unkownType).toThrow(TypeException);
  expect(unkownType).toThrow('locked is not a valid type');
});

test('Detect unknown inferred type', () => {
  mockFile.source = `
  nav<private> {
    background: var(--nav_background);
  }
  `;

  const unkownType = () => Lexer.tokenize(mockFile);
  expect(unkownType).toThrow(TypeException);
  expect(unkownType).toThrow('private is not a valid type');
});

test('Detect unknown modifier', () => {
  mockFile.source = `
  a.link:hover {
    border-color<@change>: cornflowerblue;
  }
  `;

  const unknownModifier = () => Lexer.tokenize(mockFile);
  expect(unknownModifier).toThrow(ModifierException);
  expect(unknownModifier).toThrow('@change is not a valid modifier');
});

test('Detect unknown motive', () => {
  mockFile.source = `
  aside {
    overflow<?itsFriday>: hidden;
  }
  `;

  const unknownMotive = () => Lexer.tokenize(mockFile);
  expect(unknownMotive).toThrow(MotiveException);
  expect(unknownMotive).toThrow('?itsfriday is not a valid motive');
});

test('Detect motive patch without a reason', () => {
  mockFile.source = `
  section {
    height<?patch>: 100%;
  }
  `;

  const patchWithoutReason = () => Lexer.tokenize(mockFile);
  expect(patchWithoutReason).toThrow(MotiveException);
  expect(patchWithoutReason).toThrow('?patch is missing a reason');
});

test('Detect motive because without a reason', () => {
  mockFile.source = `
  ul.nav__links {
    clear<?because>: both;
  }
  `;

  const becauseWithoutReason = () => Lexer.tokenize(mockFile);
  expect(becauseWithoutReason).toThrow(MotiveException);
  expect(becauseWithoutReason).toThrow('?because is missing a reason');
});

test('Rule-set cannot infer a modifier', () => {
  mockFile.source = `
  nav.nav--dark<@override> {
    background: dimgrey;
  }
  `;

  const inferredModifier = () => Lexer.tokenize(mockFile);
  expect(inferredModifier).toThrow(ModifierException);
  expect(inferredModifier).toThrow('nav.nav--dark<@override> cannot infer modifiers');
});

test('Rule-set cannot infer a motive', () => {
  mockFile.source = `
  aside<?veto> {
    display: inline-block;
  }
  `;

  const inferredMotive = () => Lexer.tokenize(mockFile);
  expect(inferredMotive).toThrow(MotiveException);
  expect(inferredMotive).toThrow('aside<?veto> cannot infer motives');
});

test('Detect multiple types declared in CSS declaration', () => {
  mockFile.source = `
  h1 {
    color<immutable,protected>: steelblue;
  }
  `;

  const multipleTypes = () => Lexer.tokenize(mockFile);
  expect(multipleTypes).toThrow(TypeException);
  expect(multipleTypes).toThrow('color<immutable,protected> already assigned the type IMMUTABLE');
});

test('Detect multiple types declared in inferred rule-set', () => {
  mockFile.source = `
  a.link<protected,public> {
    font-size: 14px;
  }
  `;

  const multipleTypes = () => Lexer.tokenize(mockFile);
  expect(multipleTypes).toThrow(TypeException);
  expect(multipleTypes).toThrow('a.link<protected,public> already assigned the type PROTECTED');
});

test('Detect multiple modifiers declared in CSS declaration', () => {
  mockFile.source = `
  button:hover {
    background-color<@override,@mutate>: teal;
  }
  `;

  const multipleModifiers = () => Lexer.tokenize(mockFile);
  expect(multipleModifiers).toThrow(ModifierException);
  expect(multipleModifiers).toThrow('background-color<@override,@mutate> already assigned the modifier OVERRIDE');
});

test('Detect trailing comma in notion combinator', () => {
  mockFile.source = `
  li {
    list-style<?veto,>: none;
  }
  `;

  const trailingComma = () => Lexer.tokenize(mockFile);
  expect(trailingComma).toThrow(AbstractNotionException);
  expect(trailingComma).toThrow('Trailing comma found in combinator');
});

test('Detect trailing comma in inferred notion combinator', () => {
  mockFile.source = `
  a.link<protected,> {
    color: cadetblue;
    border-bottom: 1px solid transparent;
  }
  `;

  const trailingComma = () => Lexer.tokenize(mockFile);
  expect(trailingComma).toThrow(AbstractNotionException);
  expect(trailingComma).toThrow('Trailing comma found in combinator');
});

test('Detect missing element type', () => {
  mockFile.source = `
  .sideBar {
    width: var(--sideBar_width);
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.sideBar is missing element type');
});

test('Element type as className shouldn\'t trick lexer', () => {
  mockFile.source = `
  .div {
    float: left;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.div is missing element type');
});

test('Element type as ID shouldn\'t trick lexer', () => {
  mockFile.source = `
  #section {
    width: 100%;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('#section is missing element type');
});

test('Detect descendant selector missing element type', () => {
  mockFile.source = `
  nav .nav__links {
    float: right;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.nav__links is missing element type');
});

test('Detect adjacent sibling missing element type', () => {
  mockFile.source = `
  ul + .title {
    font-weight: bold;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.title is missing element type');
});

test('Detect general sibling missing element type', () => {
  mockFile.source = `
  img ~ .imgLabel {
    font-size: 0.8em;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.imgLabel is missing element type');
});

test('Detect child combinator missing element type', () => {
  mockFile.source = `
  ul.menu > .menu__item {
    margin-left<?veto>: 0;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.menu__item is missing element type');
});

test('Detect pseudo-class missing element type', () => {
  mockFile.source = `
  .btn:hover {
    pointer-events: none;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.btn:hover is missing element type');
});

test('Detect pseudo-element missing element type', () => {
  mockFile.source = `
  .arrow::after {
    content: '';
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.arrow::after is missing element type');
});

test('Detect missing element type in multiple selectors', () => {
  mockFile.source = `
  h1, h2, .heading {
    -webkit-font-smoothing: antialiased;
  }
  `;

  const missingElementType = () => Lexer.tokenize(mockFile);
  expect(missingElementType).toThrow(SelectorException);
  expect(missingElementType).toThrow('.heading is missing element type');
});

test('Detect invalid element type', () => {
  mockFile.source = `
  spinner {
    display: flex;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect descendant selector using invalid element type', () => {
  mockFile.source = `
  nav spinner {
    float: right;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect adjacent sibling using invalid element type', () => {
  mockFile.source = `
  ul + spinner {
    font-weight: bold;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect general sibling using invalid element type', () => {
  mockFile.source = `
  img ~ spinner {
    font-size: 0.8em;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect child combinator using invalid element type', () => {
  mockFile.source = `
  ul.menu > spinner {
    margin-left<?veto>: 0;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect pseudo-class using invalid element type', () => {
  mockFile.source = `
  spinner:hover {
    pointer-events: none;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect pseudo-element using invalid element type', () => {
  mockFile.source = `
  spinner::after {
    content: '';
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('spinner is not a valid element type');
});

test('Detect invalid element type in multiple selectors', () => {
  mockFile.source = `
  p.title, title {
    -webkit-font-smoothing: antialiased;
  }
  `;

  const invalidElementType = () => Lexer.tokenize(mockFile);
  expect(invalidElementType).toThrow(SelectorException);
  expect(invalidElementType).toThrow('title is not a valid element type');
});

test('Detect the usage of !important', () => {
  mockFile.source = `
  button.dontate {
    opacity: 0 !important;
  }
  `;

  const importantDeclaration = () => Lexer.tokenize(mockFile);
  expect(importantDeclaration).toThrow(DeclarationException);
  expect(importantDeclaration).toThrow('opacity: 0 !important; uses !important');
});


text:
Descrizione:
Alcuni semplici file in Scala scritti durante l'apprendimento del linguaggio

Certi spezzoni o pattern di codice presenti potrebbero provenire da siti esterni quali scala-clang.org e/o tutorialspoint.com, tutti i diritti su tali codici appartengono ai relativi proprietari e non sono da considerarsi sotto licenza BSD.

Nota riguardante tutorialspoint:
Sorry, we do not allow to use our content for republishing online or to be printed for commercial purpose. But yes, you can use our content with in your Schools, Colleges, Universities, Institutes and Companies as long as it is only for internal purpose and you are keeping appropriate references to tutorialspoint.com website.