text:
package fr.ourten.teabeans.listener.holder;

import fr.ourten.teabeans.listener.MapValueChangeListener;
import fr.ourten.teabeans.listener.ValueChangeListener;
import fr.ourten.teabeans.listener.ValueInvalidationListener;
import fr.ourten.teabeans.value.ObservableValue;

import java.util.Arrays;
import java.util.Map;
import java.util.Objects;

public class MapMultiListenersHolder<K, V> extends MultiListenersHolder<Map<K, V>> implements MapListenersHolder<K, V>
{
    private MapValueChangeListener<? super K, ? super V>[] mapValueChangeListeners;

    public MapMultiListenersHolder(
            MapValueChangeListener<? super K, ? super V> mapValueChangeListener,
            ValueChangeListener<? super Map<K, V>> valueChangeListener,
            ValueInvalidationListener arglessValueChangeListener,
            ValueInvalidationListener invalidationListener)
    {
        super(valueChangeListener, arglessValueChangeListener, invalidationListener);

        if (mapValueChangeListener != null)
            this.mapValueChangeListeners = new MapValueChangeListener[] { mapValueChangeListener };
    }

    @Override
    public MapListenersHolder<K, V> addMapChangeListener(MapValueChangeListener<? super K, ? super V> listener)
    {
        if (mapValueChangeListeners == null)
        {
            mapValueChangeListeners = new MapValueChangeListener[] { listener };
            return this;
        }

        for (var mapValueChangeListener : mapValueChangeListeners)
        {
            if (Objects.equals(mapValueChangeListener, listener))
                return this;
        }

        var length = mapValueChangeListeners.length;
        mapValueChangeListeners = Arrays.copyOf(mapValueChangeListeners, length + 1);
        mapValueChangeListeners[length] = listener;
        return this;
    }

    @Override
    public MapListenersHolder<K, V> removeMapChangeListener(MapValueChangeListener<? super K, ? super V> listener)
    {
        if (mapValueChangeListeners == null)
            return this;

        MapValueChangeListener<? super K, ? super V>[] newListeners = cloneListenerArray(listener,
                mapValueChangeListeners,
                MapValueChangeListener.class);

        if (newListeners.length == 1 &&
                (valueChangeListeners == null || valueChangeListeners.length == 1) &&
                (arglessValueChangeListeners == null || arglessValueChangeListeners.length == 1) &&
                (invalidationListeners == null || invalidationListeners.length == 1)
        )
            return new MapMonoListenerHolder<>(newListeners[0], valueChangeListeners == null ? null : valueChangeListeners[0], arglessValueChangeListeners == null ? null : arglessValueChangeListeners[0], invalidationListeners == null ? null : invalidationListeners[0]);

        mapValueChangeListeners = newListeners;
        return this;
    }

    @Override
    public MapListenersHolder<K, V> addChangeListener(ValueChangeListener<? super Map<K, V>> listener)
    {
        return (MapListenersHolder<K, V>) super.addChangeListener(listener);
    }

    @Override
    public MapListenersHolder<K, V> removeChangeListener(ValueChangeListener<? super Map<K, V>> listener)
    {
        if (valueChangeListeners == null)
            return this;

        ValueChangeListener<? super Map<K, V>>[] newListeners = cloneListenerArray(listener,
                valueChangeListeners,
                ValueChangeListener.class);

        if (newListeners.length == 1 &&
                (mapValueChangeListeners == null || mapValueChangeListeners.length == 1) &&
                (arglessValueChangeListeners == null || arglessValueChangeListeners.length == 1) &&
                (invalidationListeners == null || invalidationListeners.length == 1)
        )
            return new MapMonoListenerHolder<>(mapValueChangeListeners == null ? null : mapValueChangeListeners[0], newListeners[0], arglessValueChangeListeners == null ? null : arglessValueChangeListeners[0], invalidationListeners == null ? null : invalidationListeners[0]);

        valueChangeListeners = newListeners;
        return this;
    }

    @Override
    public MapListenersHolder<K, V> addChangeListener(ValueInvalidationListener listener)
    {
        return (MapListenersHolder<K, V>) super.addChangeListener(listener);
    }

    @Override
    public MapListenersHolder<K, V> removeChangeListener(ValueInvalidationListener listener)
    {
        if (arglessValueChangeListeners == null)
            return this;

        var newListeners = cloneListenerArray(listener,
                arglessValueChangeListeners,
                ValueInvalidationListener.class);

        if (newListeners.length <= 1 &&
                (mapValueChangeListeners == null || mapValueChangeListeners.length == 1) &&
                (valueChangeListeners == null || valueChangeListeners.length == 1) &&
                (invalidationListeners == null || invalidationListeners.length == 1)
        )
            return new MapMonoListenerHolder<>(mapValueChangeListeners == null ? null : mapValueChangeListeners[0], valueChangeListeners == null ? null : valueChangeListeners[0], newListeners[0], invalidationListeners == null ? null : invalidationListeners[0]);

        arglessValueChangeListeners = newListeners;
        return this;
    }

    @Override
    public MapListenersHolder<K, V> addListener(ValueInvalidationListener listener)
    {
        return (MapListenersHolder<K, V>) super.addListener(listener);
    }

    @Override
    public MapListenersHolder<K, V> removeListener(ValueInvalidationListener listener)
    {
        if (invalidationListeners == null)
            return this;

        var newListeners = cloneListenerArray(listener,
                invalidationListeners,
                ValueInvalidationListener.class);

        if (newListeners.length <= 1 &&
                (mapValueChangeListeners == null || mapValueChangeListeners.length == 1) &&
                (valueChangeListeners == null || valueChangeListeners.length == 1) &&
                (arglessValueChangeListeners == null || arglessValueChangeListeners.length == 1)
        )
            return new MapMonoListenerHolder<>(mapValueChangeListeners == null ? null : mapValueChangeListeners[0], valueChangeListeners == null ? null : valueChangeListeners[0], arglessValueChangeListeners == null ? null : arglessValueChangeListeners[0], newListeners[0]);

        invalidationListeners = newListeners;
        return this;
    }

    @Override
    public void fireMapChangeListeners(ObservableValue<? extends Map<K, V>> observable, K key, V oldValue, V newValue)
    {
        var listeners = mapValueChangeListeners;

        if (listeners == null)
            return;

        for (var listener : listeners)
            listener.valueChanged(observable, key, oldValue, newValue);
    }

    @Override
    public boolean hasMapChangeListeners()
    {
        return mapValueChangeListeners != null;
    }
}


text:
#ifndef BERRYIADAPTERFACTORY_H_
#define BERRYIADAPTERFACTORY_H_

#include <org_blueberry_core_runtime_Export.h>

#include <vector>
#include <typeinfo>

namespace berry {

/**
 * An adapter factory defines behavioral extensions for
 * one or more classes that implements the IAdaptable
 * interface. Adapter factories are registered with an
 * adapter manager.
 *

 * This interface can be used without OSGi running.
 *

 * Clients may implement this interface.
 *

 * @see IAdapterManager
 * @see IAdaptable
 */
struct org_blueberry_core_runtime_EXPORT IAdapterFactory {

  virtual ~IAdapterFactory() {};

  /**
   * Returns an object which can be cast to the given adapter type and which is
   * associated with the given adaptable object. Returns 0 if
   * no such object can be found.
   *
   * A typical implementation would look like this:
   *
   *
   * void* GetAdapter(void* adaptableObject, const std::type_info& adaptableType, const std::string& adapterType)
   * {
   *   if (Image* img = CastHelper<Image>(adaptableObject, adaptableType))
   *   {
   *     if (adapterType == "berry::IResource")
   *     {
   *       return new IResource(img->GetPath());
   *     }
   *   }
   *   return 0;
   * }
   *
   *
   * @param adaptableObject the adaptable object being queried
   *   (usually an instance of IAdaptable)
   * @param adapterType the type of adapter to look up
   * @return a object castable to the given adapter type,
   *    or 0 if this adapter factory
   *    does not have an adapter of the given type for the
   *    given object
   */
  virtual Object* GetAdapter(IAdaptable* adaptableObject, const std::string& adapterType) = 0;

  /**
   * Returns the collection of adapter types handled by this
   * factory.
   *

   * This method is generally used by an adapter manager
   * to discover which adapter types are supported, in advance
   * of dispatching any actual getAdapter requests.
   *

   *
   * @return the collection of adapter types
   */
  virtual void GetAdapterList(std::vector<const std::type_info&>& adapters) = 0;
};

}
#endif /*BERRYIADAPTERFACTORY_H_*/

redpajama_set_name: RedPajamaGithub


text:
/**
 *  @file Reaction.h
 */

#ifndef CT_REACTION_H
#define CT_REACTION_H

#include "cantera/base/utilities.h"
#include "cantera/base/smart_ptr.h"
#include "cantera/kinetics/RxnRates.h"

namespace Cantera
{

class Kinetics;

//! Intermediate class which stores data about a reaction and its rate
//! parameterization so that it can be added to a Kinetics object.
class Reaction
{
public:
    explicit Reaction(int type);
    Reaction(int type, const Composition& reactants,
             const Composition& products);
    virtual ~Reaction() {}

    //! The reactant side of the chemical equation for this reaction
    virtual std::string reactantString() const;

    //! The product side of the chemical equation for this reaction
    virtual std::string productString() const;

    //! The chemical equation for this reaction
    std::string equation() const;

    //! Ensure that the rate constant and other parameters for this reaction are
    //! valid.
    virtual void validate();

    //! Type of the reaction. The valid types are listed in the file,
    //! reaction_defs.h, with constants ending in `RXN`.
    int reaction_type;

    //! Reactant species and stoichiometric coefficients
    Composition reactants;

    //! Product species and stoichiometric coefficients
    Composition products;

    //! Forward reaction order with respect to specific species. By default,
    //! mass-action kinetics is assumed, with the reaction order equal to each
    //! reactant's stoichiometric coefficient.
    Composition orders;

    //! An identification string for the reaction, used in some filtering
    //! operations
    std::string id;

    //! True if the current reaction is reversible. False otherwise
    bool reversible;

    //! True if the current reaction is marked as duplicate
    bool duplicate;

    //! True if reaction orders can be specified for non-reactant species.
    //! Default is `false`.
    bool allow_nonreactant_orders;

    //! True if negative reaction orders are allowed. Default is `false`.
    bool allow_negative_orders;
};

//! A reaction which follows mass-action kinetics with a modified Arrhenius
//! reaction rate.
class ElementaryReaction : public Reaction
{
public:
    ElementaryReaction();
    ElementaryReaction(const Composition& reactants, const Composition products,
                       const Arrhenius& rate);
    virtual void validate();

    Arrhenius rate;
    bool allow_negative_pre_exponential_factor;
};

//! A class for managing third-body efficiencies, including default values
class ThirdBody
{
public:
    explicit ThirdBody(double default_efficiency=1.0);

    //! Get the third-body efficiency for species *k*
    double efficiency(const std::string& k) const {
        return getValue(efficiencies, k, default_efficiency);
    }

    //! Map of species to third body efficiency
    Composition efficiencies;

    //! The default third body efficiency for species not listed in
    //! #efficiencies.
    double default_efficiency;
};

//! A reaction with a non-reacting third body "M" that acts to add or remove
//! energy from the reacting species
class ThirdBodyReaction : public ElementaryReaction
{
public:
    ThirdBodyReaction();
    ThirdBodyReaction(const Composition& reactants, const Composition& products,
                      const Arrhenius& rate, const ThirdBody& tbody);
    virtual std::string reactantString() const;
    virtual std::string productString() const;

    //! Relative efficiencies of third-body species in enhancing the reaction
    //! rate.
    ThirdBody third_body;
};

//! A reaction that is first-order in [M] at low pressure, like a third-body
//! reaction, but zeroth-order in [M] as pressure increases.
class FalloffReaction : public Reaction
{
public:
    FalloffReaction();
    FalloffReaction(const Composition& reactants, const Composition& products,
                    const Arrhenius& low_rate, const Arrhenius& high_rate,
                    const ThirdBody& tbody, int falloff_type,
                    const vector_fp& falloff_params);
    virtual std::string reactantString() const;
    virtual std::string productString() const;
    virtual void validate();

    //! The rate constant in the low-pressure limit
    Arrhenius low_rate;

    //! The rate constant in the high-pressure limit
    Arrhenius high_rate;

    //! Relative efficiencies of third-body species in enhancing the reaction rate
    ThirdBody third_body;

    //! Type of falloff parameterization to use. Values are defined in
    //! reaction_defs.h, with names ending in `FALLOFF`.
    int falloff_type;

    //! Values used in the falloff parameterization. Meaning of each parameter
    //! depends on #falloff_type.
    vector_fp falloff_parameters;
};

//! A reaction where the rate decreases as pressure increases due to collisional
//! stabilization of a reaction intermediate. Like a FalloffReaction, except !
//! that the forward rate constant is written as being proportional to the low-
//! pressure rate constant.
class ChemicallyActivatedReaction : public FalloffReaction
{
public:
    ChemicallyActivatedReaction();
    ChemicallyActivatedReaction(const Composition& reactants,
        const Composition& products, const Arrhenius& low_rate,
        const Arrhenius& high_rate, const ThirdBody& tbody, int falloff_type,
        const vector_fp& falloff_params);
};

//! A pressure-dependent reaction parameterized by logarithmically interpolating
//! between Arrhenius rate expressions at various pressures.
class PlogReaction : public Reaction
{
public:
    PlogReaction();
    PlogReaction(const Composition& reactants, const Composition& products,
                 const Plog& rate);
    virtual void validate();
    Plog rate;
};

//! A pressure-dependent reaction parameterized by a bi-variate Chebyshev
//! polynomial in temperature and pressure
class ChebyshevReaction : public Reaction
{
public:
    ChebyshevReaction();
    ChebyshevReaction(const Composition& reactants, const Composition& products,
                      const ChebyshevRate& rate);

    ChebyshevRate rate;
};

struct CoverageDependency
{
    CoverageDependency(double a_, double E_, double m_) : a(a_), E(E_), m(m_) {}
    CoverageDependency() {}
    double a;
    double E;
    double m;
};

//! A reaction occurring on an interface (i.e. a SurfPhase or an EdgePhase)
class InterfaceReaction : public ElementaryReaction
{
public:
    InterfaceReaction();
    InterfaceReaction(const Composition& reactants, const Composition& products,
                      const Arrhenius& rate, bool isStick=false);

    //! Adjustments to the Arrhenius rate expression dependent on surface
    //! species coverages. Three coverage parameters (a, E, m) are used for each
    //! species on which the rate depends. See SurfaceArrhenius for details on
    //! the parameterization.
    std::map<std::string, CoverageDependency> coverage_deps;

    //! Set to true if `rate` is a parameterization of the sticking coefficient
    //! rather than the forward rate constant
    bool is_sticking_coefficient;

    //! For reactions with multiple non-surface species, the sticking species
    //! needs to be explicitly identified.
    std::string sticking_species;
};

//! An interface reaction which involves charged species
class ElectrochemicalReaction : public InterfaceReaction
{
public:
    ElectrochemicalReaction();
    ElectrochemicalReaction(const Composition& reactants,
                            const Composition& products, const Arrhenius& rate);

    //! Film Resistivity value
    /*!
     *  For Butler Volmer reactions, a common addition to the formulation is to
     *  add an electrical resistance to the formulation. The resistance modifies
     *  the electrical current flow in both directions. Only valid for Butler-
     *  Volmer formulations. Units are in ohms m2. Default = 0.0 ohms m2.
     */
    doublereal film_resistivity;

    //! Power of the equilibrium constant within the Affinity representation
    /*!
     *  Only valid for Affinity representation. Default = 1.0.
     */
    doublereal equilibrium_constant_power;

    //! Power of the "One minus Affinity" term within the Affinity representation
    /*!
     *   Only valid for Affinity representation. Default = 1.0.
     */
    doublereal affinity_power;

    //! Forward value of the apparent Electrochemical transfer coefficient
    doublereal beta;

    bool exchange_current_density_formulation;
};

//! Create a new Reaction object for the reaction defined in `rxn_node`
shared_ptr<Reaction> newReaction(const XML_Node& rxn_node);
}

#endif


text:
{% extends "_layouts/base.html" %}

{% block metaTitle %}Data and Database Technologies | Rackspace Developer Developer Center{% endblock %}
{% block content %}

        Data and Database Technologies

      {{ deconst.content.envelope.body }}

{% endblock %}


text:
package net.tridentsdk.event.player;

import net.tridentsdk.entity.living.Player;

/**
 * Called when a player's hunger bar decreases
 *
 * @author The TridentSDK Team
 */
public class PlayerFamishEvent extends PlayerHungerEvent {
    public PlayerFamishEvent(Player player, double feed) {
        super(player, feed);
    }
}


text:
package iip.serializers;

import java.io.IOException;
import de.iip_ecosphere.platform.transport.serialization.*;
import iip.datatypes.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;

/**
 * JSON transport serializer for Rec13.
 * Generated by: EASy-Producer.
 */
public class Rec13Serializer implements Serializer<Rec13>{

    @Override
    public Rec13 from(byte[] data) throws IOException {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.readValue(data, Rec13.class);
        } catch (JsonProcessingException e) {
            throw new IOException(e);
        }
    }

    @Override
    public byte[] to(Rec13 source) throws IOException {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.writeValueAsBytes(source);
        } catch (JsonProcessingException e) {
            throw new IOException(e);
        }
    }

    @Override
    public Rec13 clone(Rec13 origin) throws IOException {
        return new Rec13(origin);
    }

    @Override
    public Class<Rec13> getType() {
        return Rec13.class;
    }

}


text:
/* global loadFixtures */

import Util from 'util/Util';
import $ from 'jquery';
import setup from 'setup';

setup();

describe("Test some DOM stuff", () => {
  beforeEach(() => {
    loadFixtures('text-node-fixtures.html');
  });

  it("Node: An extracted path must be query able", () => {
    const el = $('#inline-el')[0];
    const path = Util.getPath(el, document);
    expect(el).toEqual(document.querySelector(path));
  });

  it("TextNode: Find the right path of a TextNode", () => {
    const el = $('#inline-el')[0].childNodes[2];
    const splitPath = Util.getPath(el, document).split(';');
    expect(document.querySelector(splitPath[0]).childNodes[parseInt(splitPath[1], 10)]).toEqual(el);
  });
});

describe("Test some DOM stuff in manipulated state", () => {
  beforeEach(() => {
    loadFixtures('text-node-fixtures-manipulated.html');
  });

  it("Marker should not be included in the resulting serialized query", () => {
    const el = $('#inline-el')[0].children[0].childNodes[0];
    const path = Util.getPath(el, document);
    expect(path).toEqual('html>body>div>section>div:nth-of-type(2)>p>i;0');
  });
});

describe("Scoping", () => {
  beforeEach(() => {
    loadFixtures('scoped.html');
  });

  it("The correct scoped path should be determined", () => {
    const scope = $('#B')[0];
    const el = $('#Content')[0].childNodes[0];
    const path = Util.getPath(el, scope);
    expect(path).toEqual('div>p;0');
  });

  it("The correct scoped path should be determined, even inside markers", () => {
    const scope = $('#B')[0];
    const el = $('#Marker')[0].childNodes[0];
    const path = Util.getPath(el, scope);
    expect(path).toEqual('div>p;0');
  });

  it("The correct scoped path should be determined, when scope === el", () => {
    const scope = $('#Content')[0];
    const el = $('#Marker')[0].childNodes[0];
    const path = Util.getPath(el, scope);
    expect(path).toEqual(';0');
  });
});


text:
require 'spec_helper'

describe LandingHelper do
  include LandingHelper

  describe '#message_class' do
    describe 'when the tweet mentions coke' do
      it 'returns "about-coke"' do
        message_class(stub(:tweet, :mentions_coke? => true)).should == 'about-coke'
      end
    end
    describe 'when the tweet does not mention coke' do
      it 'returns "not-about-coke"' do
        message_class(stub(:tweet, :mentions_coke? => false)).should == 'not-about-coke'
      end
    end
  end
end


text:
namespace Build.CodeAnalysis.Tests
{
    using Build.CodeAnalysis.Rules.Samples.Async;

    using Xunit;

    public class WhenRunningCodeAnalysis : TestingCodeAnalysis<WhenRunningCodeAnalysis>
    {
        [Fact]
        public void AsyncMustReturnTaskResultsShouldContainFailing()
        {
            this.Fixture.AssertFailingCases<AsyncMustReturnTaskFailing>();
        }

        [Fact]
        public void AsyncMustReturnTaskResultsShouldNotContainPassing()
        {
            this.Fixture.AssertPassingCases<AsyncMustReturnTaskPassing>();
        }

        [Fact]
        public void MustBeNamedAsyncShouldContainFailing()
        {
            this.Fixture.AssertFailingCases<MustBeNamedAsyncFailing>();
        }

        [Fact]
        public void MustBeNamedAsyncShouldNotContainPassing()
        {
            this.Fixture.AssertPassingCases<MustBeNamedAsyncPassing>();
        }
    }
}


text:
/*
 * EVE Swagger Interface
 * An OpenAPI for EVE Online
 *
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package net.troja.eve.esi.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import net.troja.eve.esi.model.CorporationFwStatsKills;
import net.troja.eve.esi.model.CorporationFwStatsVictoryPoints;
import java.io.Serializable;

/**
 * 200 ok object
 */
@ApiModel(description = "200 ok object")
public class CorporationFwStatsResponse implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonProperty("enlisted_on")
    private OffsetDateTime enlistedOn = null;

    @JsonProperty("faction_id")
    private Integer factionId = null;

    @JsonProperty("kills")
    private CorporationFwStatsKills kills = null;

    @JsonProperty("pilots")
    private Integer pilots = null;

    @JsonProperty("victory_points")
    private CorporationFwStatsVictoryPoints victoryPoints = null;

    public CorporationFwStatsResponse enlistedOn(OffsetDateTime enlistedOn) {
        this.enlistedOn = enlistedOn;
        return this;
    }

    /**
     * The enlistment date of the given corporation into faction warfare. Will
     * not be included if corporation is not enlisted in faction warfare
     *
     * @return enlistedOn
     **/
    @ApiModelProperty(example = "null", value = "The enlistment date of the given corporation into faction warfare. Will not be included if corporation is not enlisted in faction warfare")
    public OffsetDateTime getEnlistedOn() {
        return enlistedOn;
    }

    public void setEnlistedOn(OffsetDateTime enlistedOn) {
        this.enlistedOn = enlistedOn;
    }

    public CorporationFwStatsResponse factionId(Integer factionId) {
        this.factionId = factionId;
        return this;
    }

    /**
     * The faction the given corporation is enlisted to fight for. Will not be
     * included if corporation is not enlisted in faction warfare
     *
     * @return factionId
     **/
    @ApiModelProperty(example = "null", value = "The faction the given corporation is enlisted to fight for. Will not be included if corporation is not enlisted in faction warfare")
    public Integer getFactionId() {
        return factionId;
    }

    public void setFactionId(Integer factionId) {
        this.factionId = factionId;
    }

    public CorporationFwStatsResponse kills(CorporationFwStatsKills kills) {
        this.kills = kills;
        return this;
    }

    /**
     * Get kills
     *
     * @return kills
     **/
    @ApiModelProperty(example = "null", value = "")
    public CorporationFwStatsKills getKills() {
        return kills;
    }

    public void setKills(CorporationFwStatsKills kills) {
        this.kills = kills;
    }

    public CorporationFwStatsResponse pilots(Integer pilots) {
        this.pilots = pilots;
        return this;
    }

    /**
     * How many pilots the enlisted corporation has. Will not be included if
     * corporation is not enlisted in faction warfare
     *
     * @return pilots
     **/
    @ApiModelProperty(example = "null", value = "How many pilots the enlisted corporation has. Will not be included if corporation is not enlisted in faction warfare")
    public Integer getPilots() {
        return pilots;
    }

    public void setPilots(Integer pilots) {
        this.pilots = pilots;
    }

    public CorporationFwStatsResponse victoryPoints(CorporationFwStatsVictoryPoints victoryPoints) {
        this.victoryPoints = victoryPoints;
        return this;
    }

    /**
     * Get victoryPoints
     *
     * @return victoryPoints
     **/
    @ApiModelProperty(example = "null", value = "")
    public CorporationFwStatsVictoryPoints getVictoryPoints() {
        return victoryPoints;
    }

    public void setVictoryPoints(CorporationFwStatsVictoryPoints victoryPoints) {
        this.victoryPoints = victoryPoints;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CorporationFwStatsResponse corporationFwStatsResponse = (CorporationFwStatsResponse) o;
        return Objects.equals(this.enlistedOn, corporationFwStatsResponse.enlistedOn)
                && Objects.equals(this.factionId, corporationFwStatsResponse.factionId)
                && Objects.equals(this.kills, corporationFwStatsResponse.kills)
                && Objects.equals(this.pilots, corporationFwStatsResponse.pilots)
                && Objects.equals(this.victoryPoints, corporationFwStatsResponse.victoryPoints);
    }

    @Override
    public int hashCode() {
        return Objects.hash(enlistedOn, factionId, kills, pilots, victoryPoints);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CorporationFwStatsResponse {\n");

        sb.append("    enlistedOn: ").append(toIndentedString(enlistedOn)).append("\n");
        sb.append("    factionId: ").append(toIndentedString(factionId)).append("\n");
        sb.append("    kills: ").append(toIndentedString(kills)).append("\n");
        sb.append("    pilots: ").append(toIndentedString(pilots)).append("\n");
        sb.append("    victoryPoints: ").append(toIndentedString(victoryPoints)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}


text:
title:  Umiranje nastopi pred poznavanjem Božje volje
date:   12/09/2022
---

Mnogi kristjani si iskreno prizadevajo spoznati Božjo voljo za svoje življenje. »Ko bi le poznal Božjo voljo, bi zanj žrtvoval vse!« Celo po tem, ko mu to obljubimo, smo lahko negotovi glede tega, kaj je njegova volja. Vzrok za to zmedo lahko najdemo v Rim 12,1-2. Pavel opisuje, kako spoznati Božjo voljo; izpostavi pomembno resnico: če želiš izvedeti, kaj je Božja volja zate, se moraš najprej žrtvovati!

Preberi Rim 12,1-2. Apostol piše, da bomo zmožni razpoznati, »kaj je Božja volja« (Rim 12,2 chr), ko:

1. bomo pravilno razumeli Božje usmiljenje do nas (Rim 12,1),

2. se bomo Bogu ponudili v živo žrtev (Rim 12,1),

3. bo naš um obnovljen (Rim 12,2).

Samo obnovljeni um lahko resnično razume Božjo voljo. Toda to je odvisno od tega, ali smo umrli sebi. Kristusovo trpljenje za nas ni bilo dovolj; moral je tudi umreti.

`Prosi Svetega Duha, naj ti pokaže področja, na katerih nisi popolnoma »mrtev«. Katerim stvarem se moraš odpovedati, da bi postal »živa žrtev« za Boga?`

Če določenih življenjskih področij nismo popolnoma podredili Bogu, bo morda dovolil, da nas doletijo preizkušnje, da bi jih opazili. Trpljenje nam ne pomaga le, da se spopademo s svojim grehom; da nam tudi vpogled v to, čemu vse se je za nas odpovedal Jezus. Elisabeth Elliot piše: »Kadar se odpovemo najglobljemu hrepenenju svojega srca, smo morda najbliže razumevanju križa. /…/ Naša izkušnja križanja, pa čeprav neznansko milejša od Zveličarjeve, je priložnost, da ga začnemo spoznavati v občestvu njegovega trpljenja. V takšno občestvo nas vabi v vsaki obliki našega trpljenja.« (Elisabeth Elliot, Quest for Love [Grand Rapids, MI: Fleming H. Revell, 1996], str. 182)

`V molitvi znova preberi Rim 12,1-2. Razmisli o stvareh, ki se jim moraš odpovedati, da bi postal živa žrtev. Kako ti to pomaga razumeti trpljenje, ki ga je Jezus prestal na križu? Kako ti to spoznanje pomaga stopiti v občestvo z Jezusom in njegovim trpljenjem? `


text:
package name.falgout.jeffrey.testing.junit.testing;

import java.util.HashSet;
import java.util.Set;
import org.junit.platform.engine.TestExecutionResult;
import org.junit.platform.launcher.TestExecutionListener;
import org.junit.platform.launcher.TestIdentifier;
import org.junit.platform.launcher.TestPlan;

/**
 * A {@link TestExecutionListener} that constructs a {@link TestPlanExecutionReport}.
 */
public final class ExecutionReportListener implements TestExecutionListener {
  private final Set<Class<?>> classesToSkip = new HashSet<>();
  private TestPlanExecutionReport.Builder executionReportBuilder;

  public ExecutionReportListener() {}

  @Override
  public void testPlanExecutionStarted(TestPlan testPlan) {
    executionReportBuilder = TestPlanExecutionReport.builder(testPlan);
    executionReportBuilder.addAllClassesToSkip(classesToSkip);
    classesToSkip.clear();
  }

  @Override
  public void executionSkipped(TestIdentifier testIdentifier, String reason) {
    executionReportBuilder.addSkipped(testIdentifier, reason);
  }

  @Override
  public void executionFinished(TestIdentifier testIdentifier,
      TestExecutionResult testExecutionResult) {
    executionReportBuilder.addResult(testIdentifier, testExecutionResult);
  }

  public ExecutionReportListener addClassToSkip(Class<?> clazz) {
    if (executionReportBuilder == null) {
      classesToSkip.add(clazz);
    } else {
      executionReportBuilder.addClassToSkip(clazz);
    }
    return this;
  }

  public TestPlanExecutionReport getReport() {
    return executionReportBuilder.build();
  }
}


text:
//	File name: CmnComponent.h
//	Description: The IComponent declaration file.

#pragma once

typedef CString	(*PGET_COMPONENT_NAME_ROUTINE)(void);
typedef CString	(*PGET_COMPONENT_VERSION_ROUTINE)(void);

// IComponent declaration
interface IComponent : public IObject
{
public:
	virtual bool			LoadComponent() = 0;
	virtual bool			UnloadComponent() = 0;
	virtual bool			VerifyWhetherExists() = 0;

	virtual CString			GetComponentName() = 0;
	virtual CString			GetComponentVersion() = 0;
};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bihangtill K. Svenska Vetensk. -Akad. Handl. , Afd. 3 25(no. 1): 24 (1899)

#### Original name
Muyocopron fecundum var. atrocyaneum Starbäck

### Remarks
null


text:
package org.softlang.tests;

import org.softlang.company.Company;
import org.softlang.features.*;
import static org.softlang.features.Serialization.*;
import org.junit.Test;
import static org.junit.Assert.*;

public class Basics {

	@Test
	public void testTotal() {
		Company c = readCompany("sampleCompany.ser");
	    double total = c.accept(new Total());
	    assertEquals(399747, total, 0);
	}

	@Test
	public void testCut() {
		Company c = readCompany("sampleCompany.ser");
		c.accept(new Cut());
	    double total = c.accept(new Total());
	    assertEquals(399747 / 2.0d, total, 0);
	}
}


text:
from __future__ import absolute_import

from .pride import Pride

__all__ = ['Pride']


text:
import gulp from 'gulp';
import gulpif from 'gulp-if';
import sass from 'gulp-sass';
import less from 'gulp-less';
import autoprefixer from 'gulp-autoprefixer';
import cssNano from 'gulp-cssnano';
import sourcemaps from 'gulp-sourcemaps';
import concat from 'gulp-concat';
import notify from 'gulp-notify';
import moduleImporter from 'sass-module-importer';
import lazypipe from 'lazypipe';
import plumber from 'gulp-plumber';
import browserSync from 'browser-sync';
import config from '../config.json';
import enabled from '../enabled.js';

// ### CSS processing pipeline
// Example
// ```
// gulp.src(cssFiles)
//   .pipe(cssTasks('main.css')
//   .pipe(gulp.dest(paths.dist + 'styles'))
// ```
function cssTasks(filename) {
  return lazypipe()
    .pipe(() => gulpif(enabled.maps, sourcemaps.init()))
    .pipe(() => gulpif('*.less', less()))
    .pipe(() => gulpif('*.scss', sass({
      outputStyle: 'nested', // libsass doesn't support expanded yet
      precision: 10,
      includePaths: ['.'],
      errLogToConsole: !enabled.failStyleTask,
      importer: moduleImporter(),
    })))
    .pipe(concat, filename)
    .pipe(autoprefixer, {
      browsers: [
        'last 2 versions',
        'android 4',
        'opera 12',
      ],
    })
    .pipe(() => gulpif(enabled.minify, cssNano({
      safe: true,
    })))
    .pipe(() => gulpif(enabled.maps, sourcemaps.write('.', {
      sourceRoot: `${config.paths.source}/styles`,
    })))();
}

// ## Gulp tasks
// Run `gulp -T` for a task summary

// ### Styles
// `gulp styles` - Compiles, combines, and optimizes Bower CSS and project CSS.
// By default this task will only log a warning if a precompiler error is
// raised. If the `--production` flag is set: this task will fail outright.
gulp.task('styles', () => {
  const output = gulp.src(config.dependencies.css)
    .pipe(gulpif(!enabled.failStyleTask, plumber({
      errorHandler: notify.onError('Error: <%= error.message %>'),
    })))
    .pipe(cssTasks('main.css'))
    .pipe(gulp.dest(`${config.paths.dist}/styles`))
    .pipe(browserSync.stream());
  return output;
});


text:
.. $URL$
.. $Rev$

PyPNG Code Examples
===================

This section discusses some example Python programs that use the png
module for reading and writing PNG files.

Writing
-------

The basic strategy is to create a :class:`~png.Writer` object (instance of
:class:`png.Writer`) and then call its :meth:`png.write` method
with an open (binary) file, and the pixel data.  The :class:`Writer` object
encapsulates all the information about the PNG file: image size, colour,
bit depth, and so on.

A Ramp
^^^^^^

Create a one row image, that has all grey values from 0 to 255.  This is
a bit like Netpbm's ``pgmramp``. ::

  import png
  f = open('ramp.png', 'wb')      # binary mode is important
  w = png.Writer(255, 1, greyscale=True)
  w.write(f, [range(256)])
  f.close()

Note that our single row, generated by ``range(256)``, must itself be
enclosed in a list.  That's because the :meth:`png.write` method expects
a list of rows.

From now on ``import png`` will not be mentioned.

A Little Message
^^^^^^^^^^^^^^^^

A list of strings holds a graphic in ASCII graphic form.  We convert it
to a list of integer lists (the required form for the :meth:`write` method),
and write it out as a black-and-white PNG (bilevel greyscale). ::

  s = ['110010010011',
       '101011010100',
       '110010110101',
       '100010010011']
  s = map(lambda x: map(int, x), s)

  f = open('png.png', 'wb')
  w = png.Writer(len(s[0]), len(s), greyscale=True, bitdepth=1)
  w.write(f, s)
  f.close()

Note how we use ``len(s[0])`` (the length of the first row) for the *x*
argument and ``len(s)`` (the number of rows) for the *y* argument.

A Palette
^^^^^^^^^

The previous example, "a little message", can be converted to colour
simply by creating a PNG file with a palette.  The only difference is
that a *palette* argument is passed to the :meth:`write` method instead of
``greyscale=True``::

  # Assume f and s have been set up as per previous example
  palette=[(0x55,0x55,0x55), (0xff,0x99,0x99)]
  w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1)
  w.write(f, s)

Note that the palette consists of two entries (the bit depth is 1 so
there are only 2 possible colours).  Each entry is an RGB triple.  If we
wanted transparency then we can use RGBA 4-tuples for each palette
entry.

Colour
^^^^^^

For colour images the input rows are generally 3 times as long as
for greyscale, because there are 3 channels, RGB, instead of just
one, grey.  Below, the *p* literal has 2 rows of 9 values (3 RGB
pixels per row).  The spaces are just for your benefit, to mark out
the separate pixels; they have no meaning in the code. ::

  p = [(255,0,0, 0,255,0, 0,0,255),
       (128,0,0, 0,128,0, 0,0,128)]
  f = open('swatch.png', 'wb')
  w = png.Writer(3, 2)
  w.write(f, p) ; f.close()

More Colour
^^^^^^^^^^^

A further colour example illustrates some of the manoeuvres you have to
perform in Python to get the pixel data in the right format.

Say we want to produce a PNG image with 1 row of 8 pixels, with all the
colours from a 3-bit colour system (with 1-bit for each channel;
such systems were common on 8-bit micros from the 1980s).

We produce all possible 3-bit numbers:

>>> range(8)
[0, 1, 2, 3, 4, 5, 6, 7]

We can convert each number into an RGB triple by assigning bit 0 to
blue, bit 1 to red, bit 2 to green (the convention used by a certain
8-bit micro):

>>> map(lambda x: (bool(x&2), bool(x&4), bool(x&1)), _)
[(False, False, False), (False, False, True), (True, False, False),
(True, False, True), (False, True, False), (False, True, True), (True,
True, False), (True, True, True)]

(later on we will convert False into 0, and True into 255, so don't
worry about that just yet).  Here we have each pixel as a tuple.  We
want to flatten the pixels so that we have just one row.  In other words
instead of [(R,G,B), (R,G,B), ...] we want [R,G,B,R,G,B,...].  It turns
out that ``itertools.chain(*...)`` is just what we need:

>>> list(itertools.chain(*_))
[False, False, False, False, False, True, True, False, False, True,
False, True, False, True, False, False, True, True, True, True, False,
True, True, True]

Note that the ``list`` is not necessary, we can usually use the iterator
directly instead.  I just used ``list`` here so we can see the result.

Now to convert False to 0 and True to 255 we can multiply by 255
(Python use's Iverson's convention, so ``False==0``, ``True==1``).
We could do that with ``map(lambda x:255*x, _)``. Or, we could use a
"magic" bound method:

>>> map((255).__mul__, _)
[0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255,
255, 255, 0, 255, 255, 255]

Now we write the PNG file out:

>>> p=_
>>> f=open('speccy.png', 'wb')
>>> w.write(f, [p]) ; f.close()

Reading
-------

The basic strategy is to create a :class:`~png.Reader` object (a
:class:`png.Reader` instance), then call its :meth:`png.read` method
to extract the size, and pixel data.

PngSuite
^^^^^^^^

The :meth:`~png.Reader` constructor can take either a filename, a file-like
object, or a sequence of bytes directly.  Here we use ``urllib`` to download
a PNG file from the internet.

>>> r=png.Reader(file=urllib.urlopen('http://www.schaik.com/pngsuite/basn0g02.png'))
>>> r.read()
(32, 32, <itertools.imap object at 0x10b7eb0>, {'greyscale': True,
'alpha': False, 'interlace': 0, 'bitdepth': 2, 'gamma': 1.0})

The :meth:`png.read` method returns a 4-tuple.  Note that the pixels are
returned as an iterator (not always, and the interface doesn't guarantee it;
the returned value might be an iterator or a sequence).

>>> l=list(_[2])
>>> l[0]
array('B', [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 0, 0, 0, 0,
1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3])

We have extracted the top row of the image.  Note that the row itself is
an ``array`` (see module ``array``), but in general any suitable sequence
type may be returned by :meth:`read`.  The values in the row are all
integers less than 4, because the image has a bit depth of 2.

NumPy
-----

`NumPy <http://numpy.scipy.org/>`_ is a package for scientific computing with Python.  It is not part
of a standard Python installation, it is
`downloaded and installed separately <http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103>`_
if needed.  Numpy's array manipulation facilities make it good for doing
certain type of image processing, and scientific users of NumPy may wish
to output PNG files for visualisation.

PyPNG does not have any direct integration with NumPy, but the basic
data format used by PyPNG, an iterator over rows, is fairly easy to get
into two- or three-dimensional NumPy arrays.

The code in this section is extracted from ``exnumpy.py``, which is a
complete runnable example in the ``code/`` subdirectory of the source
distribution. Code was originally written by Mel Raab, but has been
hacked around since then.

PNG to NumPy array (reading)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The best thing to do (I think) is to convert each PyPNG row to a
1-dimensional numpy array, then stack all of those arrays together to
make a 2-dimensional array.  A number of features make this surprising
compact.  Say `pngdata` is the row iterator returned from
:meth:`png.Reader.asDirect`.  The following code will slurp it into a
2-dimensional numpy array:

.. literalinclude:: ../code/exnumpy.py
   :start-after: extract 001 start
   :end-before: extract 001 end

Note that the use of ``numpy.uint16``, above, means that an array with
data type ``numpy.uint16`` is created which is suitable for
bit depth 16 images.  Replace ``numpy.uint16`` with ``numpy.uint8`` to
create an array with a byte data type (suitable for bit depths up to 8).

Reshaping
^^^^^^^^^

For some operations it's easier to have the image data in a
3-dimensional array.  This plays to NumPy's strengths:

.. literalinclude:: ../code/exnumpy.py
   :start-after: extract 002 start
   :end-before: extract 002 end

NumPy array to PNG (writing)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Reshape your NumPy data into a 2-dimensional array, then use the fact
that a NumPy array is an iterator over its rows:

.. literalinclude:: ../code/exnumpy.py
   :start-after: extract 003 start
   :end-before: extract 003 end

Currently (writing on 2009-04-16) this generates a warning; this warning
appears to be a bug/limitation in NumPy, but it is harmless.


text:
BOOL GetDebugPrivileges( void );

BOOL AttemptInjection( char* pszProcessName, char* pszModuleName )
{
	HANDLE hProcess = Remote::GetRemoteProcessHandleA( pszProcessName );

	if( hProcess == INVALID_HANDLE_VALUE )
	{
		printf( "No such handle!\n" );

		return FALSE;
	}

	printf( "Process Handle [0x%X][0x%X]\n", hProcess, GetProcessId( hProcess ) );

	char pszModuleTotalPathName[ MAX_PATH ];

	if( GetModuleFileNameA( GetModuleHandle( NULL ), pszModuleTotalPathName, MAX_PATH ) )
	{
		for(size_t i = strlen( pszModuleTotalPathName ); pszModuleTotalPathName[i] != '\\'; pszModuleTotalPathName[i] = 0,  i--){}
	}

	strcat_s( pszModuleTotalPathName, pszModuleName );

	BOOL bResult = threadInject::LoadLibraryMainThread( hProcess, pszModuleTotalPathName );

	if( !bResult )
	{
		printf( "Failed LoadLibraryMainThread!\n" );
	}

	CloseHandle( hProcess );

	return bResult;
}

int main(int argc, CHAR* argv[])
{
	printf( "D_DllLoader coded by s0beit -> SUCH A COOL GUY\n" );

	if( GetDebugPrivileges() == FALSE )
	{
		printf( "WARNING: Unable to get debug privledges...\n" );
	}

	if(argc != 3)
	{
		printf( "Usage: D_DllLoader.exe <process name> <module>\n" );

		printf("Press any key to continue...\n");

		_getch();

		return 0;
	}

	printf( "Targetting [%s] with [%s]\n", argv[1], argv[2] );

	if( AttemptInjection( argv[1], argv[2] ) == FALSE )
	{
		printf( "Injected FAILURE!\n" );
	}
	else
	{
		printf( "Injected success!\n" );
	}

	printf("Press any key to continue...\n");

	_getch();

	return 0;
}

bool SetPrivilege( HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege )
{
	TOKEN_PRIVILEGES tp;
	LUID luid;
	TOKEN_PRIVILEGES tpPrevious;
	DWORD cbPrevious = sizeof(TOKEN_PRIVILEGES);

	if(!LookupPrivilegeValue( NULL, lpszPrivilege, &luid ))
		return false;

	tp.PrivilegeCount = 1;
	tp.Privileges[0].Luid = luid;
	tp.Privileges[0].Attributes = 0;

	AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), &tpPrevious, &cbPrevious);

	if (GetLastError() != ERROR_SUCCESS)
		return false;

	tpPrevious.PrivilegeCount = 1;
	tpPrevious.Privileges[0].Luid = luid;

	if (bEnablePrivilege)
		tpPrevious.Privileges[0].Attributes |= (SE_PRIVILEGE_ENABLED);
	else
		tpPrevious.Privileges[0].Attributes ^= (SE_PRIVILEGE_ENABLED & tpPrevious.Privileges[0].Attributes);

	AdjustTokenPrivileges( hToken, FALSE, &tpPrevious, cbPrevious, NULL, NULL );

	if( GetLastError() != ERROR_SUCCESS )
		return false;

	return true;
}

BOOL GetDebugPrivileges( void )
{
	HANDLE hToken;

	bool bOK = false;

	if( OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
	{
		if( !SetPrivilege( hToken, SE_DEBUG_NAME, TRUE ) )
		{
			printf( "GetDebugPrivileges: SetPrivilege error\n" );
		}
		else
		{
			bOK = true;
		}

		CloseHandle( hToken );
	}
	else
	{
		printf( "GetDebugPrivileges: OpenProcessToken error\n" );
	}

	return bOK;
}


text:
/**
 * Gulp {{name}} task
 * {{description}}
 *
 * @param  {Gulp} gulp
 * @param  {Object} plugins Available gulp plugins
 * @param  {Object} config  Configuration options
 * @param  {boolean} prod  Build to production
 * @return {function} Gulp task
 ** @param  {boolean} prod  Build to production
 * @example gulp {{name}}
 * @see gulpfile.js
 */
module.exports = function (gulp, plugins, config, prod) {

    'use strict';

    return function () {

    };

};


text:
package org.apache.spark.sql.execution.datasources.parquet

import java.util.Random

import org.apache.commons.lang3.RandomStringUtils
import org.apache.parquet.bytes.{ByteBufferInputStream, DirectByteBufferAllocator}
import org.apache.parquet.column.values.Utils
import org.apache.parquet.column.values.deltalengthbytearray.DeltaLengthByteArrayValuesWriter
import org.apache.parquet.io.api.Binary

import org.apache.spark.sql.execution.vectorized.{OnHeapColumnVector, WritableColumnVector}
import org.apache.spark.sql.test.SharedSparkSession
import org.apache.spark.sql.types.{IntegerType, StringType}

/**
 * Read tests for vectorized Delta length byte array  reader.
 * Translated from
 * org.apache.parquet.column.values.delta.TestDeltaLengthByteArray
 */
class ParquetDeltaLengthByteArrayEncodingSuite
    extends ParquetCompatibilityTest
    with SharedSparkSession {
  val values: Array[String] = Array("parquet", "hadoop", "mapreduce")
  var writer: DeltaLengthByteArrayValuesWriter = _
  var reader: VectorizedDeltaLengthByteArrayReader = _
  private var writableColumnVector: WritableColumnVector = _

  protected override def beforeEach(): Unit = {
    writer =
      new DeltaLengthByteArrayValuesWriter(64 * 1024, 64 * 1024, new DirectByteBufferAllocator)
    reader = new VectorizedDeltaLengthByteArrayReader()
    super.beforeAll()
  }

  test("test serialization") {
    writeData(writer, values)
    readAndValidate(reader, writer.getBytes.toInputStream, values.length, values)
  }

  test("random strings") {
    val values = Utils.getRandomStringSamples(1000, 32)
    writeData(writer, values)
    readAndValidate(reader, writer.getBytes.toInputStream, values.length, values)
  }

  test("random strings with empty strings") {
    val values = getRandomStringSamplesWithEmptyStrings(1000, 32)
    writeData(writer, values)
    readAndValidate(reader, writer.getBytes.toInputStream, values.length, values)
  }

  test("skip with random strings") {
    val values = Utils.getRandomStringSamples(1000, 32)
    writeData(writer, values)
    reader.initFromPage(values.length, writer.getBytes.toInputStream)
    writableColumnVector = new OnHeapColumnVector(values.length, StringType)
    var i = 0
    while (i < values.length) {
      reader.readBinary(1, writableColumnVector, i)
      assert(values(i).getBytes() sameElements writableColumnVector.getBinary(i))
      reader.skipBinary(1)
      i += 2
    }
    reader = new VectorizedDeltaLengthByteArrayReader()
    reader.initFromPage(values.length, writer.getBytes.toInputStream)
    writableColumnVector = new OnHeapColumnVector(values.length, StringType)
    var skipCount = 0
    i = 0
    while (i < values.length) {
      skipCount = (values.length - i) / 2
      reader.readBinary(1, writableColumnVector, i)
      assert(values(i).getBytes() sameElements writableColumnVector.getBinary(i))
      reader.skipBinary(skipCount)
      i += skipCount + 1
    }
  }

  // Read the lengths from the beginning of the buffer and compare with the lengths of the values
  test("test lengths") {
    val reader = new VectorizedDeltaBinaryPackedReader
    writeData(writer, values)
    val length = values.length
    writableColumnVector = new OnHeapColumnVector(length, IntegerType)
    reader.initFromPage(length, writer.getBytes.toInputStream)
    reader.readIntegers(length, writableColumnVector, 0)
    for (i <- 0 until length) {
      assert(values(i).length == writableColumnVector.getInt(i))
    }
  }

  private def writeData(writer: DeltaLengthByteArrayValuesWriter, values: Array[String]): Unit = {
    for (i <- values.indices) {
      writer.writeBytes(Binary.fromString(values(i)))
    }
  }

  private def readAndValidate(
      reader: VectorizedDeltaLengthByteArrayReader,
      is: ByteBufferInputStream,
      length: Int,
      expectedValues: Array[String]): Unit = {

    writableColumnVector = new OnHeapColumnVector(length, StringType)

    reader.initFromPage(length, is)
    reader.readBinary(length, writableColumnVector, 0)

    for (i <- 0 until length) {
      assert(expectedValues(i).getBytes() sameElements writableColumnVector.getBinary(i))
    }
  }

  def getRandomStringSamplesWithEmptyStrings(numSamples: Int, maxLength: Int): Array[String] = {
    val randomLen = new Random
    val randomEmpty = new Random
    val samples: Array[String] = new Array[String](numSamples)
    for (i <- 0 until numSamples) {
      var maxLen: Int = randomLen.nextInt(maxLength)
      if(randomEmpty.nextInt() % 11 != 0) {
        maxLen = 0;
      }
      samples(i) = RandomStringUtils.randomAlphanumeric(0, maxLen)
    }
    samples
  }
}


text:
// This file was generated by Mendix Modeler.
//
// WARNING: Code you write here will be lost the next time you deploy the project.

package treeviewdemo.proxies;

public class MultiLevelWidgetData extends treeviewdemo.proxies.TreeViewWidgetData
{
	/**
	 * Internal name of this entity
	 */
	public static final java.lang.String entityName = "TreeViewDemo.MultiLevelWidgetData";

	/**
	 * Enum describing members of this entity
	 */
	public enum MemberNames
	{
		NodeSelected("NodeSelected"),
		ExpandToLevel("ExpandToLevel"),
		MaxRecursionLevel("MaxRecursionLevel"),
		LazyLoadClass("LazyLoadClass"),
		Action("Action"),
		NewSelectionKey("NewSelectionKey"),
		NodeChanged("NodeChanged"),
		MultiLevelNodeToDisplay("TreeViewDemo.MultiLevelNodeToDisplay"),
		MultiLevelWidgetData_MultiLevel_New("TreeViewDemo.MultiLevelWidgetData_MultiLevel_New"),
		MultiLevelNodesToUpdate("TreeViewDemo.MultiLevelNodesToUpdate"),
		MultiLevelWidgetData_DraggedNode("TreeViewDemo.MultiLevelWidgetData_DraggedNode"),
		MultiLevelWidgetData_DropTargetNode("TreeViewDemo.MultiLevelWidgetData_DropTargetNode");

		private java.lang.String metaName;

		MemberNames(java.lang.String s)
		{
			metaName = s;
		}

		@java.lang.Override
		public java.lang.String toString()
		{
			return metaName;
		}
	}

	public MultiLevelWidgetData(com.mendix.systemwideinterfaces.core.IContext context)
	{
		this(context, com.mendix.core.Core.instantiate(context, "TreeViewDemo.MultiLevelWidgetData"));
	}

	protected MultiLevelWidgetData(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject multiLevelWidgetDataMendixObject)
	{
		super(context, multiLevelWidgetDataMendixObject);
		if (!com.mendix.core.Core.isSubClassOf("TreeViewDemo.MultiLevelWidgetData", multiLevelWidgetDataMendixObject.getType()))
			throw new java.lang.IllegalArgumentException("The given object is not a TreeViewDemo.MultiLevelWidgetData");
	}

	/**
	 * @deprecated Use 'MultiLevelWidgetData.load(IContext, IMendixIdentifier)' instead.
	 */
	@java.lang.Deprecated
	public static treeviewdemo.proxies.MultiLevelWidgetData initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
	{
		return treeviewdemo.proxies.MultiLevelWidgetData.load(context, mendixIdentifier);
	}

	/**
	 * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called.
	 * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access).
	 */
	public static treeviewdemo.proxies.MultiLevelWidgetData initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)
	{
		return new treeviewdemo.proxies.MultiLevelWidgetData(context, mendixObject);
	}

	public static treeviewdemo.proxies.MultiLevelWidgetData load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
	{
		com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier);
		return treeviewdemo.proxies.MultiLevelWidgetData.initialize(context, mendixObject);
	}

	/**
	 * @return value of NodeSelected
	 */
	public final java.lang.Boolean getNodeSelected()
	{
		return getNodeSelected(getContext());
	}

	/**
	 * @param context
	 * @return value of NodeSelected
	 */
	public final java.lang.Boolean getNodeSelected(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.NodeSelected.toString());
	}

	/**
	 * Set value of NodeSelected
	 * @param nodeselected
	 */
	public final void setNodeSelected(java.lang.Boolean nodeselected)
	{
		setNodeSelected(getContext(), nodeselected);
	}

	/**
	 * Set value of NodeSelected
	 * @param context
	 * @param nodeselected
	 */
	public final void setNodeSelected(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean nodeselected)
	{
		getMendixObject().setValue(context, MemberNames.NodeSelected.toString(), nodeselected);
	}

	/**
	 * @return value of ExpandToLevel
	 */
	public final java.lang.Integer getExpandToLevel()
	{
		return getExpandToLevel(getContext());
	}

	/**
	 * @param context
	 * @return value of ExpandToLevel
	 */
	public final java.lang.Integer getExpandToLevel(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.ExpandToLevel.toString());
	}

	/**
	 * Set value of ExpandToLevel
	 * @param expandtolevel
	 */
	public final void setExpandToLevel(java.lang.Integer expandtolevel)
	{
		setExpandToLevel(getContext(), expandtolevel);
	}

	/**
	 * Set value of ExpandToLevel
	 * @param context
	 * @param expandtolevel
	 */
	public final void setExpandToLevel(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer expandtolevel)
	{
		getMendixObject().setValue(context, MemberNames.ExpandToLevel.toString(), expandtolevel);
	}

	/**
	 * @return value of MaxRecursionLevel
	 */
	public final java.lang.Integer getMaxRecursionLevel()
	{
		return getMaxRecursionLevel(getContext());
	}

	/**
	 * @param context
	 * @return value of MaxRecursionLevel
	 */
	public final java.lang.Integer getMaxRecursionLevel(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.MaxRecursionLevel.toString());
	}

	/**
	 * Set value of MaxRecursionLevel
	 * @param maxrecursionlevel
	 */
	public final void setMaxRecursionLevel(java.lang.Integer maxrecursionlevel)
	{
		setMaxRecursionLevel(getContext(), maxrecursionlevel);
	}

	/**
	 * Set value of MaxRecursionLevel
	 * @param context
	 * @param maxrecursionlevel
	 */
	public final void setMaxRecursionLevel(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer maxrecursionlevel)
	{
		getMendixObject().setValue(context, MemberNames.MaxRecursionLevel.toString(), maxrecursionlevel);
	}

	/**
	 * @return value of LazyLoadClass
	 */
	public final java.lang.String getLazyLoadClass()
	{
		return getLazyLoadClass(getContext());
	}

	/**
	 * @param context
	 * @return value of LazyLoadClass
	 */
	public final java.lang.String getLazyLoadClass(com.mendix.systemwideinterfaces.core.IContext context)
	{
		return (java.lang.String) getMendixObject().getValue(context, MemberNames.LazyLoadClass.toString());
	}

	/**
	 * Set value of LazyLoadClass
	 * @param lazyloadclass
	 */
	public final void setLazyLoadClass(java.lang.String lazyloadclass)
	{
		setLazyLoadClass(getContext(), lazyloadclass);
	}

	/**
	 * Set value of LazyLoadClass
	 * @param context
	 * @param lazyloadclass
	 */
	public final void setLazyLoadClass(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String lazyloadclass)
	{
		getMendixObject().setValue(context, MemberNames.LazyLoadClass.toString(), lazyloadclass);
	}

	/**
	 * @return value of MultiLevelNodeToDisplay
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelNodeToDisplay() throws com.mendix.core.CoreException
	{
		return getMultiLevelNodeToDisplay(getContext());
	}

	/**
	 * @param context
	 * @return value of MultiLevelNodeToDisplay
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelNodeToDisplay(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		treeviewdemo.proxies.MultiLevelNodeData result = null;
		com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.MultiLevelNodeToDisplay.toString());
		if (identifier != null)
			result = treeviewdemo.proxies.MultiLevelNodeData.load(context, identifier);
		return result;
	}

	/**
	 * Set value of MultiLevelNodeToDisplay
	 * @param multilevelnodetodisplay
	 */
	public final void setMultiLevelNodeToDisplay(treeviewdemo.proxies.MultiLevelNodeData multilevelnodetodisplay)
	{
		setMultiLevelNodeToDisplay(getContext(), multilevelnodetodisplay);
	}

	/**
	 * Set value of MultiLevelNodeToDisplay
	 * @param context
	 * @param multilevelnodetodisplay
	 */
	public final void setMultiLevelNodeToDisplay(com.mendix.systemwideinterfaces.core.IContext context, treeviewdemo.proxies.MultiLevelNodeData multilevelnodetodisplay)
	{
		if (multilevelnodetodisplay == null)
			getMendixObject().setValue(context, MemberNames.MultiLevelNodeToDisplay.toString(), null);
		else
			getMendixObject().setValue(context, MemberNames.MultiLevelNodeToDisplay.toString(), multilevelnodetodisplay.getMendixObject().getId());
	}

	/**
	 * @return value of MultiLevelWidgetData_MultiLevel_New
	 */
	public final treeviewdemo.proxies.MultiLevel getMultiLevelWidgetData_MultiLevel_New() throws com.mendix.core.CoreException
	{
		return getMultiLevelWidgetData_MultiLevel_New(getContext());
	}

	/**
	 * @param context
	 * @return value of MultiLevelWidgetData_MultiLevel_New
	 */
	public final treeviewdemo.proxies.MultiLevel getMultiLevelWidgetData_MultiLevel_New(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		treeviewdemo.proxies.MultiLevel result = null;
		com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.MultiLevelWidgetData_MultiLevel_New.toString());
		if (identifier != null)
			result = treeviewdemo.proxies.MultiLevel.load(context, identifier);
		return result;
	}

	/**
	 * Set value of MultiLevelWidgetData_MultiLevel_New
	 * @param multilevelwidgetdata_multilevel_new
	 */
	public final void setMultiLevelWidgetData_MultiLevel_New(treeviewdemo.proxies.MultiLevel multilevelwidgetdata_multilevel_new)
	{
		setMultiLevelWidgetData_MultiLevel_New(getContext(), multilevelwidgetdata_multilevel_new);
	}

	/**
	 * Set value of MultiLevelWidgetData_MultiLevel_New
	 * @param context
	 * @param multilevelwidgetdata_multilevel_new
	 */
	public final void setMultiLevelWidgetData_MultiLevel_New(com.mendix.systemwideinterfaces.core.IContext context, treeviewdemo.proxies.MultiLevel multilevelwidgetdata_multilevel_new)
	{
		if (multilevelwidgetdata_multilevel_new == null)
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_MultiLevel_New.toString(), null);
		else
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_MultiLevel_New.toString(), multilevelwidgetdata_multilevel_new.getMendixObject().getId());
	}

	/**
	 * @return value of MultiLevelNodesToUpdate
	 */
	public final java.util.List<treeviewdemo.proxies.MultiLevelNodeData> getMultiLevelNodesToUpdate() throws com.mendix.core.CoreException
	{
		return getMultiLevelNodesToUpdate(getContext());
	}

	/**
	 * @param context
	 * @return value of MultiLevelNodesToUpdate
	 */
	@SuppressWarnings("unchecked")
	public final java.util.List<treeviewdemo.proxies.MultiLevelNodeData> getMultiLevelNodesToUpdate(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		java.util.List<treeviewdemo.proxies.MultiLevelNodeData> result = new java.util.ArrayList<treeviewdemo.proxies.MultiLevelNodeData>();
		Object valueObject = getMendixObject().getValue(context, MemberNames.MultiLevelNodesToUpdate.toString());
		if (valueObject == null)
			return result;
		for (com.mendix.systemwideinterfaces.core.IMendixObject mendixObject : com.mendix.core.Core.retrieveIdList(context, (java.util.List<com.mendix.systemwideinterfaces.core.IMendixIdentifier>) valueObject))
			result.add(treeviewdemo.proxies.MultiLevelNodeData.initialize(context, mendixObject));
		return result;
	}

	/**
	 * Set value of MultiLevelNodesToUpdate
	 * @param multilevelnodestoupdate
	 */
	public final void setMultiLevelNodesToUpdate(java.util.List<treeviewdemo.proxies.MultiLevelNodeData> multilevelnodestoupdate)
	{
		setMultiLevelNodesToUpdate(getContext(), multilevelnodestoupdate);
	}

	/**
	 * Set value of MultiLevelNodesToUpdate
	 * @param context
	 * @param multilevelnodestoupdate
	 */
	public final void setMultiLevelNodesToUpdate(com.mendix.systemwideinterfaces.core.IContext context, java.util.List<treeviewdemo.proxies.MultiLevelNodeData> multilevelnodestoupdate)
	{
		java.util.List<com.mendix.systemwideinterfaces.core.IMendixIdentifier> identifiers = new java.util.ArrayList<com.mendix.systemwideinterfaces.core.IMendixIdentifier>();
		for (treeviewdemo.proxies.MultiLevelNodeData proxyObject : multilevelnodestoupdate)
			identifiers.add(proxyObject.getMendixObject().getId());
		getMendixObject().setValue(context, MemberNames.MultiLevelNodesToUpdate.toString(), identifiers);
	}

	/**
	 * @return value of MultiLevelWidgetData_DraggedNode
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelWidgetData_DraggedNode() throws com.mendix.core.CoreException
	{
		return getMultiLevelWidgetData_DraggedNode(getContext());
	}

	/**
	 * @param context
	 * @return value of MultiLevelWidgetData_DraggedNode
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelWidgetData_DraggedNode(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		treeviewdemo.proxies.MultiLevelNodeData result = null;
		com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.MultiLevelWidgetData_DraggedNode.toString());
		if (identifier != null)
			result = treeviewdemo.proxies.MultiLevelNodeData.load(context, identifier);
		return result;
	}

	/**
	 * Set value of MultiLevelWidgetData_DraggedNode
	 * @param multilevelwidgetdata_draggednode
	 */
	public final void setMultiLevelWidgetData_DraggedNode(treeviewdemo.proxies.MultiLevelNodeData multilevelwidgetdata_draggednode)
	{
		setMultiLevelWidgetData_DraggedNode(getContext(), multilevelwidgetdata_draggednode);
	}

	/**
	 * Set value of MultiLevelWidgetData_DraggedNode
	 * @param context
	 * @param multilevelwidgetdata_draggednode
	 */
	public final void setMultiLevelWidgetData_DraggedNode(com.mendix.systemwideinterfaces.core.IContext context, treeviewdemo.proxies.MultiLevelNodeData multilevelwidgetdata_draggednode)
	{
		if (multilevelwidgetdata_draggednode == null)
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_DraggedNode.toString(), null);
		else
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_DraggedNode.toString(), multilevelwidgetdata_draggednode.getMendixObject().getId());
	}

	/**
	 * @return value of MultiLevelWidgetData_DropTargetNode
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelWidgetData_DropTargetNode() throws com.mendix.core.CoreException
	{
		return getMultiLevelWidgetData_DropTargetNode(getContext());
	}

	/**
	 * @param context
	 * @return value of MultiLevelWidgetData_DropTargetNode
	 */
	public final treeviewdemo.proxies.MultiLevelNodeData getMultiLevelWidgetData_DropTargetNode(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException
	{
		treeviewdemo.proxies.MultiLevelNodeData result = null;
		com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.MultiLevelWidgetData_DropTargetNode.toString());
		if (identifier != null)
			result = treeviewdemo.proxies.MultiLevelNodeData.load(context, identifier);
		return result;
	}

	/**
	 * Set value of MultiLevelWidgetData_DropTargetNode
	 * @param multilevelwidgetdata_droptargetnode
	 */
	public final void setMultiLevelWidgetData_DropTargetNode(treeviewdemo.proxies.MultiLevelNodeData multilevelwidgetdata_droptargetnode)
	{
		setMultiLevelWidgetData_DropTargetNode(getContext(), multilevelwidgetdata_droptargetnode);
	}

	/**
	 * Set value of MultiLevelWidgetData_DropTargetNode
	 * @param context
	 * @param multilevelwidgetdata_droptargetnode
	 */
	public final void setMultiLevelWidgetData_DropTargetNode(com.mendix.systemwideinterfaces.core.IContext context, treeviewdemo.proxies.MultiLevelNodeData multilevelwidgetdata_droptargetnode)
	{
		if (multilevelwidgetdata_droptargetnode == null)
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_DropTargetNode.toString(), null);
		else
			getMendixObject().setValue(context, MemberNames.MultiLevelWidgetData_DropTargetNode.toString(), multilevelwidgetdata_droptargetnode.getMendixObject().getId());
	}

	@java.lang.Override
	public boolean equals(Object obj)
	{
		if (obj == this)
			return true;

		if (obj != null && getClass().equals(obj.getClass()))
		{
			final treeviewdemo.proxies.MultiLevelWidgetData that = (treeviewdemo.proxies.MultiLevelWidgetData) obj;
			return getMendixObject().equals(that.getMendixObject());
		}
		return false;
	}

	@java.lang.Override
	public int hashCode()
	{
		return getMendixObject().hashCode();
	}

	/**
	 * @return String name of this class
	 */
	public static java.lang.String getType()
	{
		return "TreeViewDemo.MultiLevelWidgetData";
	}

	/**
	 * @return String GUID from this object, format: ID_0000000000
	 * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object.
	 */
	@java.lang.Override
	@java.lang.Deprecated
	public java.lang.String getGUID()
	{
		return "ID_" + getMendixObject().getId().toLong();
	}
}


text:
A set of themes for bash shell

## Installation
These themes depend on [a set of scripts](https://github.com/mkofinas/prompt-support)
in order to be used. To download and use them, paste the following commands in
your terminal:

```sh
mkdir -p "${XDG_CONFIG_HOME:-${HOME}/.config}/bash"
cd "${XDG_CONFIG_HOME:-${HOME}/.config}/bash"
git clone https://github.com/mkofinas/bash-themes.git
git clone https://github.com/mkofinas/prompt-support.git
```

Afterwards, add these lines in your `.bashrc`:

```sh
BASH_THEME="basic"

if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bash-themes/${BASH_THEME}.theme.bash ]; then
    . ${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bash-themes/${BASH_THEME}.theme.bash
fi
```

## Provided Themes
Up to this moment, there are 3 provided themes:
- basic
- continuation
- two_lines_background

In order to use one of them, modify the `BASH_THEME` variable in your `.bashrc`
accordingly.

## License
(The MIT License)

Copyright (c) 2015 Miltiadis Kofinas.


text:
package com.dangdang.ddframe.rdb.sharding.parser.visitor.basic.mysql;

import java.util.Arrays;

import com.alibaba.druid.sql.ast.SQLHint;
import com.alibaba.druid.sql.ast.expr.SQLBetweenExpr;
import com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr;
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
import com.alibaba.druid.sql.ast.expr.SQLInListExpr;
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
import com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr;
import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
import com.alibaba.druid.sql.ast.statement.SQLSelectItem;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor;
import com.dangdang.ddframe.rdb.sharding.api.DatabaseType;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.SQLBuilder;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.Table;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.Condition.BinaryOperator;
import com.dangdang.ddframe.rdb.sharding.parser.visitor.ParseContext;
import com.dangdang.ddframe.rdb.sharding.parser.visitor.SQLVisitor;

/**
 * MySQL解析基础访问器.
 *
 * @author zhangliang
 */
public abstract class AbstractMySQLVisitor extends MySqlOutputVisitor implements SQLVisitor {

    private final ParseContext parseContext = new ParseContext();

    public AbstractMySQLVisitor() {
        super(new SQLBuilder());
        setPrettyFormat(false);
    }

    @Override
    public final DatabaseType getDatabaseType() {
        return DatabaseType.MySQL;
    }

    @Override
    public final ParseContext getParseContext() {
        return parseContext;
    }

    @Override
    public final SQLBuilder getSQLBuilder() {
        return (SQLBuilder) appender;
    }

    @Override
    public final void printToken(final String token) {
        getSQLBuilder().appendToken(parseContext.getExactlyValue(token));
    }

    /**
     * 父类使用<tt>@@</tt>代替<tt>?</tt>,此处直接输出参数占位符<tt>?</tt>
     *
     * @param x 变量表达式
     * @return false 终止遍历AST
     */
    @Override
    public final boolean visit(final SQLVariantRefExpr x) {
        print(x.getName());
        return false;
    }

    @Override
    public final boolean visit(final SQLExprTableSource x) {
        return visit(x, parseContext.addTable(x));
    }

    private boolean visit(final SQLExprTableSource x, final Table table) {
        printToken(table.getName());
        if (table.getAlias().isPresent()) {
            print(' ');
            print(table.getAlias().get());
        }
        for (SQLHint each : x.getHints()) {
            print(' ');
            each.accept(this);
        }
        return false;
    }

    /**
     * 将表名替换成占位符.
     *
     *

     * 1. 如果二元表达式使用别名, 如:
     * {@code FROM order o WHERE o.column_name = 't' }, 则Column中的tableName为o.
     *

     *
     *

     * 2. 如果二元表达式使用表名, 如:
     * {@code FROM order WHERE order.column_name = 't' }, 则Column中的tableName为order.
     *

     *
     * @param x SQL属性表达式
     * @return true表示继续遍历AST, false表示终止遍历AST
     */
    @Override
    // TODO SELECT [别名.xxx]的情况,目前都是替换成token,解析之后应该替换回去
    public final boolean visit(final SQLPropertyExpr x) {
        if (!(x.getParent() instanceof SQLBinaryOpExpr) && !(x.getParent() instanceof SQLSelectItem)) {
            return super.visit(x);
        }
        if (!(x.getOwner() instanceof SQLIdentifierExpr)) {
            return super.visit(x);
        }
        String tableOrAliasName = ((SQLIdentifierExpr) x.getOwner()).getLowerName();
        if (parseContext.isBinaryOperateWithAlias(x, tableOrAliasName)) {
            return super.visit(x);
        }
        printToken(tableOrAliasName);
        print(".");
        print(x.getName());
        return false;
    }

    @Override
    public boolean visit(final SQLBinaryOpExpr x) {
        switch (x.getOperator()) {
            case BooleanOr:
                parseContext.setHasOrCondition(true);
                break;
            case Equality:
                parseContext.addCondition(x.getLeft(), BinaryOperator.EQUAL, Arrays.asList(x.getRight()), getDatabaseType(), getParameters());
                parseContext.addCondition(x.getRight(), BinaryOperator.EQUAL, Arrays.asList(x.getLeft()), getDatabaseType(), getParameters());
                break;
            default:
                break;
        }
        return super.visit(x);
    }

    @Override
    public boolean visit(final SQLInListExpr x) {
        parseContext.addCondition(x.getExpr(), x.isNot() ? BinaryOperator.NOT_IN : BinaryOperator.IN, x.getTargetList(), getDatabaseType(), getParameters());
        return super.visit(x);
    }

    @Override
    public boolean visit(final SQLBetweenExpr x) {
        parseContext.addCondition(x.getTestExpr(), BinaryOperator.BETWEEN, Arrays.asList(x.getBeginExpr(), x.getEndExpr()), getDatabaseType(), getParameters());
        return super.visit(x);
    }
}


text:
function [out,err]=mpt_solverInfo(sclass, stype)
%MPT_SOLVERINFO returns information about a given solver
%
% ---------------------------------------------------------------------------
% DESCRIPTION
% ---------------------------------------------------------------------------
%
% internal function
%
% ---------------------------------------------------------------------------
% INPUT
% ---------------------------------------------------------------------------
%
% ---------------------------------------------------------------------------
% OUTPUT
% ---------------------------------------------------------------------------
%

% Copyright is with the following author(s):
%
% (C) 2004 Michal Kvasnica, Automatic Control Laboratory, ETH Zurich,
%          kvasnica@control.ee.ethz.ch

% ---------------------------------------------------------------------------
% Legal note:
%          This program is free software; you can redistribute it and/or
%          modify it under the terms of the GNU General Public
%          License as published by the Free Software Foundation; either
%          version 2.1 of the License, or (at your option) any later version.
%
%          This program is distributed in the hope that it will be useful,
%          but WITHOUT ANY WARRANTY; without even the implied warranty of
%          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%          General Public License for more details.
%
%          You should have received a copy of the GNU General Public
%          License along with this library; if not, write to the
%          Free Software Foundation, Inc.,
%          59 Temple Place, Suite 330,
%          Boston, MA  02111-1307  USA
%
% ---------------------------------------------------------------------------

error(nargchk(2,2,nargin));

if ischar(stype),
    % convert from string to integer
    % e.g. NAG -> 3

    if strcmpi(sclass, 'lp')
        convfunc = @char2int_lpsolver;
    elseif strcmpi(sclass, 'qp')
        convfunc = @char2int_qpsolver;
    elseif strcmpi(sclass, 'milp')
        convfunc = @char2int_milpsolver;
    elseif strcmpi(sclass, 'miqp')
        convfunc = @char2int_miqpsolver;
    elseif strcmpi(sclass, 'extreme')
        convfunc = @char2int_extreme;
    else
        error(sprintf('unknwon solver class ''%s'' !', sclass));
    end
else
    % convert from integer to string
    % e.g. 0 -> NAG
    if strcmpi(sclass, 'lp')
        convfunc = @int2char_lpsolver;
    elseif strcmpi(sclass, 'qp')
        convfunc = @int2char_qpsolver;
    elseif strcmpi(sclass, 'milp')
        convfunc = @int2char_milpsolver;
    elseif strcmpi(sclass, 'miqp')
        convfunc = @int2char_miqpsolver;
    elseif strcmpi(sclass, 'extreme')
        convfunc = @int2char_extreme;
    else
        error(sprintf('unknwon solver class ''%s'' !', sclass));
    end
end

[out, err] = feval(convfunc,stype);
return

%------------------------------------------------------------------------
function [out,err] = int2char_lpsolver(solver);

err = 0;
switch solver,
    case 0, out = 'NAG (e04naf)';
    case 1, out = 'linprog';
    case 2, out = 'CPLEX9';
    case 3, out = 'CDD Criss-Cross';
    case 4, out = 'GLPK';
    case 5, out = 'CDD Dual-Simplex';
    case 6, out = 'SeDuMi';
    case 7, out = 'QSopt';
    case 8, out = 'CPLEX8';
    case 9, out = 'NAG (e04mbf)';
    case 10, out = 'XPRESS';
    case 11, out = 'MOSEK';
    case 12, out = 'OOQP';
    case 13, out = 'CLP';
    case 14, out = 'BPMPD';
    case 15, out = 'CPLEXMEX';
    case 16, out = 'PDCO';
    case 17, out = 'GLPKCC';
    otherwise, out = 'unknown'; err=1;
end

%------------------------------------------------------------------------
function [out,err] = int2char_qpsolver(solver);

err = 0;
switch solver,
    case -1, out = 'not available';
    case 0, out = 'NAG';
    case 1, out = 'quadprog';
    case 2, out = 'CPLEX9';
    case 3, out = 'SeDuMi';
    case 4, out = 'CPLEX8';
    case 5, out = 'XPRESS';
    case 6, out = 'MOSEK';
    case 7, out = 'OOQP';
    case 8, out = 'CLP';
    case 9, out = 'BPMPD';
    case 10, out = 'CPLEXMEX';
    otherwise, out = 'unknown'; err=1;
end

%------------------------------------------------------------------------
function [out,err] = int2char_milpsolver(solver);

err = 0;
switch solver,
    case 0, out = 'CPLEX9';
    case 1, out = 'YALMIP';
    case 2, out = 'GLPK';
    case 3, out = 'XPRESS';
    case 4, out = 'MOSEK';
    case 5, out = 'bintprog';
    case 6, out = 'CPLEX8';
    case 7, out = 'CPLEXMEX';
    case 8, out = 'GLPKCC';
    otherwise, out = 'unknown'; err=1;
end

%------------------------------------------------------------------------
function [out,err] = int2char_miqpsolver(solver);

err = 0;
switch solver,
    case 0, out = 'CPLEX9';
    case 1, out = 'YALMIP';
    case 2, out = 'XPRESS';
    case 3, out = 'MOSEK';
    case 4, out = 'CPLEX8';
    case 5, out = 'CPLEXMEX';
    otherwise, out = 'unknown'; err=1;
end

%------------------------------------------------------------------------
function [out,err] = int2char_extreme(solver);

err = 0;
switch solver,
    case 0, out = 'Analytical method';
    case 1, out = 'LRS';
    case 2, out = 'Analytical method (alternative)';
    case 3, out = 'CDD';
    case 4, out = 'CDD without reduction';
    otherwise, out = 'unknown'; err=1;
end

%------------------------------------------------------------------------
function [out,err] = char2int_lpsolver(solver);
% converts a string description to numerical values

err = 0; out = -Inf;
if strcmpi(solver,'cdd') | strcmpi(solver, 'cdd criss-cross'),
    out=3;
elseif strcmpi(solver, 'cdd dual-simplex')
    out = 5;
elseif strcmpi(solver,'nag') | strcmpi(solver,'e04naf') | strcmpi(solver, 'NAG (e04naf)'),
    out=0;
elseif strcmpi(solver,'cplex') | strcmpi(solver,'cplex9'),
    out=2;
elseif strcmpi(solver,'glpk'),
    out=4;
elseif strcmpi(solver,'linprog'),
    out=1;
elseif strcmpi(solver,'sedumi'),
    out=6;
elseif strcmpi(solver,'qsopt'),
    out=7;
elseif strcmpi(solver,'cplex8'),
    out=8;
elseif strcmpi(solver,'e04mbf') | strcmpi(solver, 'NAG (e04mbf)'),
    out=9;
elseif strcmpi(solver,'xpress'),
    out = 10;
elseif strcmpi(solver,'mosek'),
    out = 11;
elseif strcmpi(solver,'ooqp'),
    out = 12;
elseif strcmpi(solver,'clp'),
    out = 13;
elseif strcmpi(solver,'bpmpd'),
    out = 14;
elseif strcmpi(solver,'cplexmex'),
    out = 15;
elseif strcmpi(solver,'pdco'),
    out = 16;
elseif strcmpi(solver, 'glpkcc')
    out = 17;
elseif strcmpi(solver, 'fastest available')
    out = [];
else
    err = 1;
end

%------------------------------------------------------------------------
function [out,err] = char2int_qpsolver(solver);
% converts a string description to numerical values

err = 0; out = -Inf;
if strcmpi(solver,'quadprog'),
    out=1;
elseif strcmpi(solver,'nag'),
    out=0;
elseif strcmpi(solver,'cplex') | strcmpi(solver,'cplex9'),
    out=2;
elseif strcmpi(solver,'sedumi'),
    out=3;
elseif strcmpi(solver,'cplex8'),
    out=4;
elseif strcmpi(solver,'xpress'),
    out = 5;
elseif strcmpi(solver,'mosek'),
    out = 6;
elseif strcmpi(solver,'ooqp'),
    out = 7;
elseif strcmpi(solver,'clp'),
    out = 8;
elseif strcmpi(solver,'bpmpd'),
    out = 9;
elseif strcmpi(solver,'cplexmex'),
    out = 10;
elseif strcmpi(solver, 'fastest available')
    out = [];
else
    err = 1;
end

%------------------------------------------------------------------------
function [out,err] = char2int_extreme(solver);
% converts a string description to numerical values

err = 0; out = -Inf;
if strcmpi(solver,'cdd'),
    out=3;
elseif strcmpi(solver,'lrs'),
    out = 1;
elseif strcmpi(solver, 'matlab_alt'),
    out = 2;
elseif strcmpi(solver,'matlab') | strcmpi(solver, 'analytical method'),
    out=0;
elseif strcmpi(solver, 'fastest available')
    out = [];
else
    err = 1;
end

%------------------------------------------------------------------------
function [out,err] = char2int_milpsolver(solver);
% converts a string description to numerical values

err = 0; out = -Inf;
if strcmpi(solver,'cplex') | strcmpi(solver, 'cplex9'),
    out=0;
elseif strcmpi(solver,'yalmip'),
    out=1;
elseif strcmpi(solver,'glpk'),
    out=2;
elseif strcmpi(solver,'xpress'),
    out = 3;
elseif strcmpi(solver,'mosek'),
    out = 4;
elseif strcmpi(solver,'bintprog'),
    out = 5;
elseif strcmpi(solver,'cplex8'),
    out = 6;
elseif strcmpi(solver,'cplexmex'),
    out = 7;
elseif strcmpi(solver, 'glpkcc'),
    out = 8;
elseif strcmpi(solver, 'fastest available')
    out = [];
else
    err = 1;
end

%------------------------------------------------------------------------
function [out,err] = char2int_miqpsolver(solver);
% converts a string description to numerical values

err = 0; out = -Inf;
if strcmpi(solver,'cplex') | strcmpi(solver, 'cplex9'),
    out=0;
elseif strcmpi(solver,'yalmip'),
    out=1;
elseif strcmpi(solver,'xpress'),
    out = 2;
elseif strcmpi(solver,'mosek'),
    out = 3;
elseif strcmpi(solver,'cplex8'),
    out = 4;
elseif strcmpi(solver,'cplexmex'),
    out = 5;
elseif strcmpi(solver, 'fastest available')
    out = [];
else
    err = 1;
end


text:
export interface Skill {
  className: string;
  descriptions: {
    body: string;
    className?: string;
  }[];
  introduction: string;
  knowledgeItemsOne: {
    name: string;
  }[];
  knowledgeItemsTwo: {
    name: string;
  }[];
  name: string;
}


text:
package com.ngdata.hbaseindexer.demo;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.util.RegionSplitter;

import java.io.IOException;

/**
 * Creates the required HBase tables for the HBase Indexer demo.
 */
public class DemoSchema {

    public static final String USER_TABLE = "indexdemo-user";
    public static final String MESSAGE_TABLE = "indexdemo-message";

    public static void main(String[] args) throws Exception {
        Configuration conf = HBaseConfiguration.create();
        createSchema(conf);
    }

    public static void createSchema(Configuration hbaseConf) throws IOException {
        Admin admin = ConnectionFactory.createConnection(hbaseConf).getAdmin();
        if (!admin.tableExists(TableName.valueOf(USER_TABLE))) {
            HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(USER_TABLE));

            HColumnDescriptor infoCf = new HColumnDescriptor("info");
            infoCf.setScope(1);
            tableDescriptor.addFamily(infoCf);

            RegionSplitter.HexStringSplit splitter = new RegionSplitter.HexStringSplit();
            byte[][] splitKeys = splitter.split(12);

            admin.createTable(tableDescriptor, splitKeys);
        }

        if (!admin.tableExists(TableName.valueOf(MESSAGE_TABLE))) {
            HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(MESSAGE_TABLE));
            HColumnDescriptor dataCf = new HColumnDescriptor("content");
            dataCf.setScope(1);
            tableDescriptor.addFamily(dataCf);

            admin.createTable(tableDescriptor);
        }
        admin.close();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace AppGamer
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute("RetornaPlataformas",
                            "Plataforma/RetornaPlataformas/",
                            new { controller = "Plataforma", action = "RetornaPlataformas" },
                            new[] { "AppGamer.Controllers" });

            routes.MapRoute("RetornaGames",
                            "Game/RetornaGames/",
                            new { controller = "Plataforma", action = "RetornaGames" },
                            new[] { "AppGamer.Controllers" });

            routes.MapRoute("RetornaSitEmprestimo",
                            "Game/RetornaSitEmprestimo/",
                            new { controller = "RetornaSitEmprestimo", action = "RetornaSitEmprestimo" },
                            new[] { "AppGamer.Controllers" });

            routes.MapRoute("RetornaGameByPlataforma",
                            "EmprestimoGame/RetornaGameByPlataforma/",
                            new { controller = "RetornaGameByPlataforma", action = "RetornaGameByPlataforma" },
                            new[] { "AppGamer.Controllers" });

            routes.MapRoute("RetornaGamesEmprestadorByUser",
                            "EmprestimoGame/RetornaGamesEmprestadorByUser/",
                            new { controller = "RetornaGamesEmprestadorByUser", action = "RetornaGamesEmprestadorByUser" },
                            new[] { "AppGamer.Controllers" });

        }
    }
}


text:
    ALTER TABLE [Order Details] DROP CONSTRAINT [FK_Order_Details_FK00];
GO
    ALTER TABLE [Order Details] DROP CONSTRAINT [FK_Order_Details_FK01];
GO
    ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK00];
GO
    ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK01];
GO
    ALTER TABLE [Orders] DROP CONSTRAINT [FK_Orders_FK02];
GO
    ALTER TABLE [Products] DROP CONSTRAINT [FK_Products_FK00];
GO
    ALTER TABLE [Products] DROP CONSTRAINT [FK_Products_FK01];
GO

-- --------------------------------------------------
-- Dropping existing tables
-- NOTE: if the table does not exist, an ignorable error will be reported.
-- --------------------------------------------------

    DROP TABLE [Categories];
GO
    DROP TABLE [Customers];
GO
    DROP TABLE [Employees];
GO
    DROP TABLE [Order Details];
GO
    DROP TABLE [Orders];
GO
    DROP TABLE [Products];
GO
    DROP TABLE [Shippers];
GO
    DROP TABLE [Suppliers];
GO
    DROP TABLE [Transport_Ships];
GO
    DROP TABLE [Transport_Trucks];
GO
    DROP TABLE [Transport];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Categories'
CREATE TABLE [Categories] (
    [CategoryID] int IDENTITY(1,1) NOT NULL,
    [CategoryName] nvarchar(15)  NOT NULL,
    [Description] ntext  NULL,
    [Picture] image  NULL
);
GO

-- Creating table 'Customers'
CREATE TABLE [Customers] (
    [CustomerID] nvarchar(5)  NOT NULL,
    [CompanyName] nvarchar(40)  NOT NULL,
    [ContactName] nvarchar(30)  NULL,
    [ContactTitle] nvarchar(30)  NULL,
    [Address] nvarchar(60)  NULL,
    [City] nvarchar(15)  NULL,
    [Region] nvarchar(15)  NULL,
    [PostalCode] nvarchar(10)  NULL,
    [Country] nvarchar(15)  NULL,
    [Phone] nvarchar(24)  NULL,
    [Fax] nvarchar(24)  NULL
);
GO

-- Creating table 'Employees'
CREATE TABLE [Employees] (
    [EmployeeID] int IDENTITY(1,1) NOT NULL,
    [LastName] nvarchar(20)  NOT NULL,
    [FirstName] nvarchar(10)  NOT NULL,
    [Title] nvarchar(30)  NULL,
    [BirthDate] datetime  NULL,
    [HireDate] datetime  NULL,
    [Address] nvarchar(60)  NULL,
    [City] nvarchar(15)  NULL,
    [Region] nvarchar(15)  NULL,
    [PostalCode] nvarchar(10)  NULL,
    [Country] nvarchar(15)  NULL,
    [HomePhone] nvarchar(24)  NULL,
    [Extension] nvarchar(4)  NULL,
    [Photo] image  NULL,
    [Notes] ntext  NULL,
    [ReportsTo] int  NULL
);
GO

-- Creating table 'Order_Details'
CREATE TABLE [Order Details] (
    [OrderID] int  NOT NULL,
    [ProductID] int  NOT NULL,
    [UnitPrice] decimal(19,4)  NOT NULL,
    [Quantity] smallint  NOT NULL,
    [Discount] real  NOT NULL
);
GO

-- Creating table 'Orders'
CREATE TABLE [Orders] (
    [OrderID] int  NOT NULL,
    [CustomerID] nvarchar(5)  NOT NULL,
    [EmployeeID] int  NULL,
    [ShipName] nvarchar(40)  NULL,
    [ShipAddress] nvarchar(60)  NULL,
    [ShipCity] nvarchar(15)  NULL,
    [ShipRegion] nvarchar(15)  NULL,
    [ShipPostalCode] nvarchar(10)  NULL,
    [ShipCountry] nvarchar(15)  NULL,
    [ShipVia] int  NULL,
    [OrderDate] datetime  NULL,
    [RequiredDate] datetime  NULL,
    [ShippedDate] datetime  NULL,
    [Freight] decimal(19,4)  NULL
);
GO

-- Creating table 'Products'
CREATE TABLE [Products] (
    [ProductID] int IDENTITY(1,1) NOT NULL,
    [SupplierID] int  NULL,
    [CategoryID] int  NULL,
    [ProductName] nvarchar(40)  NOT NULL,
    [EnglishName] nvarchar(40)  NULL,
    [QuantityPerUnit] nvarchar(20)  NULL,
    [UnitPrice] decimal(19,4)  NULL,
    [UnitsInStock] smallint  NULL,
    [UnitsOnOrder] smallint  NULL,
    [ReorderLevel] smallint  NULL,
    [Discontinued] bit  NOT NULL
);
GO

-- Creating table 'Shippers'
CREATE TABLE [Shippers] (
    [ShipperID] int IDENTITY(1,1) NOT NULL,
    [CompanyName] nvarchar(40)  NOT NULL
);
GO

-- Creating table 'Suppliers'
CREATE TABLE [Suppliers] (
    [SupplierID] int IDENTITY(1,1) NOT NULL,
    [CompanyName] nvarchar(40)  NOT NULL,
    [ContactName] nvarchar(30)  NULL,
    [ContactTitle] nvarchar(30)  NULL,
    [Address] nvarchar(60)  NULL,
    [City] nvarchar(15)  NULL,
    [Region] nvarchar(15)  NULL,
    [PostalCode] nvarchar(10)  NULL,
    [Country] nvarchar(15)  NULL,
    [Phone] nvarchar(24)  NULL,
    [Fax] nvarchar(24)  NULL
);
GO

-- Creating table 'Transport'
CREATE TABLE [Transport] (
    [TransportID] int IDENTITY(1,1) NOT NULL
);
GO

-- Creating table 'Transport_Ships'
CREATE TABLE [Transport_Ships] (
    [ShipName] nvarchar(100)  NULL,
    [TransportID] int  NOT NULL
);
GO

-- Creating table 'Transport_Trucks'
CREATE TABLE [Transport_Trucks] (
    [TruckNumber] nvarchar(100)  NULL,
    [TransportID] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [CategoryID] in table 'Categories'
ALTER TABLE [Categories]
ADD CONSTRAINT [PK_Categories]
    PRIMARY KEY ([CategoryID] );
GO

-- Creating primary key on [CustomerID] in table 'Customers'
ALTER TABLE [Customers]
ADD CONSTRAINT [PK_Customers]
    PRIMARY KEY ([CustomerID] );
GO

-- Creating primary key on [EmployeeID] in table 'Employees'
ALTER TABLE [Employees]
ADD CONSTRAINT [PK_Employees]
    PRIMARY KEY ([EmployeeID] );
GO

-- Creating primary key on [OrderID], [ProductID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [PK_Order_Details]
    PRIMARY KEY ([OrderID], [ProductID] );
GO

-- Creating primary key on [OrderID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [PK_Orders]
    PRIMARY KEY ([OrderID] );
GO

-- Creating primary key on [ProductID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [PK_Products]
    PRIMARY KEY ([ProductID] );
GO

-- Creating primary key on [ShipperID] in table 'Shippers'
ALTER TABLE [Shippers]
ADD CONSTRAINT [PK_Shippers]
    PRIMARY KEY ([ShipperID] );
GO

-- Creating primary key on [SupplierID] in table 'Suppliers'
ALTER TABLE [Suppliers]
ADD CONSTRAINT [PK_Suppliers]
    PRIMARY KEY ([SupplierID] );
GO

-- Creating primary key on [TransportID] in table 'Transport'
ALTER TABLE [Transport]
ADD CONSTRAINT [PK_Transport]
    PRIMARY KEY ([TransportID] );
GO

-- Creating primary key on [TransportID] in table 'Transport_Ships'
ALTER TABLE [Transport_Ships]
ADD CONSTRAINT [PK_Transport_Ships]
    PRIMARY KEY ([TransportID] );
GO

-- Creating primary key on [TransportID] in table 'Transport_Trucks'
ALTER TABLE [Transport_Trucks]
ADD CONSTRAINT [PK_Transport_Trucks]
    PRIMARY KEY ([TransportID] );
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- Creating foreign key on [CategoryID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [FK_Products_FK01]
    FOREIGN KEY ([CategoryID])
    REFERENCES [Categories]
        ([CategoryID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Products_FK01'
CREATE INDEX [IX_FK_Products_FK01]
ON [Products]
    ([CategoryID]);
GO

-- Creating foreign key on [CustomerID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK00]
    FOREIGN KEY ([CustomerID])
    REFERENCES [Customers]
        ([CustomerID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK00'
CREATE INDEX [IX_FK_Orders_FK00]
ON [Orders]
    ([CustomerID]);
GO

-- Creating foreign key on [EmployeeID] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK02]
    FOREIGN KEY ([EmployeeID])
    REFERENCES [Employees]
        ([EmployeeID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK02'
CREATE INDEX [IX_FK_Orders_FK02]
ON [Orders]
    ([EmployeeID]);
GO

-- Creating foreign key on [ProductID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [FK_Order_Details_FK00]
    FOREIGN KEY ([ProductID])
    REFERENCES [Products]
        ([ProductID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Order_Details_FK00'
CREATE INDEX [IX_FK_Order_Details_FK00]
ON [Order Details]
    ([ProductID]);
GO

-- Creating foreign key on [OrderID] in table 'Order_Details'
ALTER TABLE [Order Details]
ADD CONSTRAINT [FK_Order_Details_FK01]
    FOREIGN KEY ([OrderID])
    REFERENCES [Orders]
        ([OrderID])
    ON DELETE CASCADE ON UPDATE NO ACTION;
GO

-- Creating foreign key on [ShipVia] in table 'Orders'
ALTER TABLE [Orders]
ADD CONSTRAINT [FK_Orders_FK01]
    FOREIGN KEY ([ShipVia])
    REFERENCES [Shippers]
        ([ShipperID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Orders_FK01'
CREATE INDEX [IX_FK_Orders_FK01]
ON [Orders]
    ([ShipVia]);
GO

-- Creating foreign key on [SupplierID] in table 'Products'
ALTER TABLE [Products]
ADD CONSTRAINT [FK_Products_FK00]
    FOREIGN KEY ([SupplierID])
    REFERENCES [Suppliers]
        ([SupplierID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Products_FK00'
CREATE INDEX [IX_FK_Products_FK00]
ON [Products]
    ([SupplierID]);
GO

-- Creating foreign key on [ReportsTo] in table 'Employees'
ALTER TABLE [Employees]
ADD CONSTRAINT [FK_Employees_FK00]
    FOREIGN KEY ([ReportsTo])
    REFERENCES [Employees]
        ([EmployeeID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Employees_FK00'
CREATE INDEX [IX_FK_Employees_FK00]
ON [Employees]
    ([ReportsTo]);
GO

-- Creating foreign key on [TransportID] in table 'Transport_Ships'
ALTER TABLE [Transport_Ships]
ADD CONSTRAINT [FK_Ships_inherits_Transport]
    FOREIGN KEY ([TransportID])
    REFERENCES [Transport]
        ([TransportID])
    ON DELETE CASCADE ON UPDATE NO ACTION;
GO

-- Creating foreign key on [TransportID] in table 'Transport_Trucks'
ALTER TABLE [Transport_Trucks]
ADD CONSTRAINT [FK_Trucks_inherits_Transport]
    FOREIGN KEY ([TransportID])
    REFERENCES [Transport]
        ([TransportID])
    ON DELETE CASCADE ON UPDATE NO ACTION;
GO

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------


text:
var utils = require('./utils');
var logNode;

module.exports.write = function(line) {
  if (!logNode) {
    logNode = utils.getTextNode(".log");
  }
  if (logNode.nodeValue.length > 0) {
    logNode.nodeValue = logNode.nodeValue + "\n";
  }
  logNode.nodeValue = logNode.nodeValue + line;
  logNode.parentElement.scrollTop = logNode.parentElement.scrollHeight;
};