"Mohamed",
			ReceptorCategory: fate,
			ReceptorLabel:    "Eaten",
			Value:            6,
		},
		{
			SourceCategory:   consumer,
			SourceLabel:      "Mohamed",
			ReceptorCategory: fate,
			ReceptorLabel:    "Waste",
			Value:            1,
		},
		{
			SourceCategory:   consumer,
			SourceLabel:      "Sofia",
			ReceptorCategory: fate,
			ReceptorLabel:    "Eaten",
			Value:            3,
		},
		{
			SourceCategory:   consumer,
			SourceLabel:      "Sofia",
			ReceptorCategory: fate,
			ReceptorLabel:    "Waste",
			Value:            0.5, // An unbalanced flow
		},
		{
			SourceCategory:   consumer,
			SourceLabel:      "Wei",
			ReceptorCategory: fate,
			ReceptorLabel:    "Eaten",
			Value:            5,
		},
		{
			SourceCategory:   consumer,
			SourceLabel:      "Wei",
			ReceptorCategory: fate,
			ReceptorLabel:    "Waste",
			Value:            1,
		},
		{
			SourceCategory:   treeType,
			SourceLabel:      "Large",
			ReceptorCategory: fate,
			ReceptorLabel:    "Waste",
			Value:            1,
		},
		{
			SourceCategory:   treeType,
			SourceLabel:      "Small",
			ReceptorCategory: fate,
			ReceptorLabel:    "Waste",
			Value:            0.3,
		},
	}

	sankey, err := plotter.NewSankey(flows...)
	if err != nil {
		log.Panic(err)
	}
	p.Add(sankey)
	p.Y.Label.Text = "Number of apples"
	p.NominalX(categoryLabels...)
	err = p.Save(vg.Points(300), vg.Points(180), "testdata/sankeySimple.png")
	if err != nil {
		log.Panic(err)
	}
}

// ExampleSankey_grouped creates a sankey diagram with grouped flows.
// The output can be found at https://github.com/gonum/plot/blob/master/plotter/testdata/sankeyGrouped_golden.png.
func ExampleSankey_grouped() {
	p := plot.New()
	c := vgimg.New(vg.Points(300), vg.Points(180))
	dc := draw.New(c)

	// Define the stock categories
	const (
		treeType int = iota
		consumer
		fate
	)
	categoryLabels := []string{"Tree type", "Consumer", "Fate"}

	flows := []plotter.Flow{
		{
			SourceCategory:   treeType,
			SourceLabel:      "LargeLargeLargeLargeLargeLargeLargeLargeLarge",
			ReceptorCategory: consumer,
			ReceptorLabel:    "Mohamed",
			Group:            "Apples",
			Value:            5,
		},
		{
			SourceCategory:   treeType,
			SourceLabel:      "LargeLargeLargeLargeLargeLargeLargeLargeLarge",
			ReceptorCategory: consumer,
			ReceptorLabel:    "Mohamed",
			Group:            "Dates",
			Value:            3,
		},
		{
			SourceCategory:   treeType,
			SourceLabel:      "Small",
			ReceptorCategory: consumer,
			ReceptorLabel:    "Mohamed",
			Group:            "Lychees",
			Value:            2,
		},
		{
			SourceCategory:   treeType,
			SourceLabel:      "LargeLargeLargeLargeLargeLargeLargeLargeLarge",
			ReceptorCategory: consumer,
			ReceptorLabel:    "Sofia",
			Group:            "Apples",
			Value:


using OSPSuite.Core.Domain.SensitivityAnalyses;
using OSPSuite.Core.Domain.Services;
using PKSim.Core.Services;
using PKSim.Infrastructure.Serialization.ORM.Queries;

namespace PKSim.Infrastructure.Services
{
   public class SensitivityAnalysisContentLoader : ISensitivityAnalysisContentLoader
   {
      private readonly ISensitivityAnalysisMetaDataContentQuery _sensitivityAnalysisMetaDataContentQuery;
      private readonly ICompressedSerializationManager _compressedSerializationManager;

      public SensitivityAnalysisContentLoader(
         ISensitivityAnalysisMetaDataContentQuery sensitivityAnalysis


-color: var(--cds-field-01, #f4f4f4);
  display: flex;
  padding: 1rem;
}
.bx--snippet--multi .bx--snippet-container {
  position: relative;
  min-height: 100%;
  max-height: 100%;
  order: 1;
  overflow-y: auto;
  transition: max-height 0.15s cubic-bezier(0.2, 0, 0.38, 0.9);
}
.bx--snippet--multi.bx--snippet--expand .bx--snippet-container {
  padding-bottom: 1rem;
  padding-bottom: var(--cds-spacing-05, 1rem);
  transition: max-height 0.15s cubic-bezier(0.2, 0, 0.38, 0.9);
}
.bx--snippet--multi.bx--snippet--wraptext pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bx--snippet--multi .bx--snippet-container pre {
  padding-right: 2.5rem;
  padding-bottom: 1.5rem;
  overflow-x: auto;
}
.bx--snippet--multi.bx--snippet--no-copy .bx--snippet-container pre {
  padding-right: 0;
}
.bx--snippet--multi.bx--snippet--expand .bx--snippet-container pre {
  overflow-x: auto;
}
.bx--snippet--multi .bx--snippet-container pre:after {
  position: absolute;
  top: 0;
  right: 0;
  width: 1rem;
  height: 100%;
  background-image: linear-gradient(90deg, rgba(#f4f4f4, 0), #f4f4f4);
  background-image: linear-gradient(
    90deg,
    rgba(var(--cds-field-01, #f4f4f4), 0),
    var(--cds-field-01, #f4f4f4)
  );
  content: "";
}
.bx--snippet--multi .bx--snippet-container pre code {
  overflow: hidden;
}
.bx--snippet__icon {
  width: 1rem;
  height: 1rem;
  fill: #161616;
  fill: var(--cds-icon-01, #161616);
  transition: all 70ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.bx--snippet-button {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  overflow: visible;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background-color: #f4f4f4;
  background-color: var(--cds-field-01, #f4f4f4);
  cursor: pointer;
  outline: none;
}
.bx--snippet-button:focus {
  outline: 2px solid #0f62fe;
  outline: 2px solid var(--cds-focus, #0f62fe);
  outline-offset: -2px;
  outline-color: #0f62fe;
  outline-color: var(--cds-focus, #0f62fe);
}
@media screen and (prefers-contrast) {
  .bx--snippet-button:focus {
    outline-style: dotted;
  }
}
.bx--snippet--multi .bx--snippet-button {
  top: 0.5rem;
  top: var(--cds-spacing-03, 0.5rem);
  right: 0.5rem;
  right: var(--cds-spacing-03, 0.5rem);
  width: 2rem;
  height: 2rem;
}
.bx--snippet-button:hover {
  background: #e5e5e5;
  background: var(--cds-hover-ui, #e5e5e5);


 * name ?z instead of the the variable name ?y used in the first query. The query subsumption algorithm finds the mapping between query variables.
	 */
	public void example4()
	{
		final Query q7 = query("?x a family:Female; family:hasBrother ?y . ");
		final Query q8 = query("?x a family:Female; family:hasSibling ?z .");

		System.out.println("Example 4");
		System.out.println("=========");
		System.out.println("Query 7: " + q7.toString());
		System.out.println("Query 8: " + q8.toString());
		System.out.println();
		System.out.println("Query 7 is subsumed by query 8: " + QuerySubsumption.isSubsumedBy(q7, q8));

		System.out.print("Subsumption mappings: ");
		final QueryResult mappings = QuerySubsumption.getSubsumptionMappings(q7, q8);
		for (final ResultBinding mapping : mappings)
			for (final Iterator<?> j = q8.getVars().iterator(); j.hasNext();)
			{
				final ATermAppl var = (ATermAppl) j.next();
				System.out.print(var.getArgument(0) + " -> " + mapping.getValue(var)); //I get var(x) as opposed to x
				if (j.hasNext()) System.out.print(", ");
			}
		System.out.println();
	}
}
// Copyright (c) 2006 - 2015, Clark & Parsia, LLC. <http://www.clarkparsia.com>
// This source code is available under the terms of the Affero General Public License v3.
//
// Please see LICENSE.txt for full license terms, including the availability of proprietary exceptions.
// Questions, comments, or requests for clarification: licensing@clarkparsia.com

package openllet.modularity;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.semanticweb.owlapi.model.AsOWLNamedIndividual;
import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLAxiomVisitor;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassAssertionAxiom;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLClassExpressionVisitor;
import org.semanticweb.owlapi.model.OWLDataAllValuesFrom;
import org.semanticweb.owlapi.model.OWLDataExactCardinality;
import org.semanticweb.owlapi.model.OWLDataHasValue;
import org.semanticweb.owlapi.model.OWLDataMaxCardinality;
import org.semanticweb.owlapi.model.OWLDataMinCardinality;
import org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom;
import org.semanticweb.owlapi.model.OWLDataPropertyDomainAxiom;
import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom;
import org.semanticweb.owlapi.model.OWLDisjointClassesAxiom;
import org.semanticweb.owlapi.model.OWLDisjointUnionAxiom;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom;
import org.semanticweb.owlapi.model.OWLEquivalentDataPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLEquivalentObjectPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLNegativeDataProper


.imageFormat)) {
                    val outputSizes = getOutputSizes(outputMode.imageFormat)
                    val aspectList = getSizeByAspectRatio(
                        outputSizes,
                        sensorAspectRatio
                    )
                    val bestSize =
                        findBestSize(aspectList.toTypedArray())
                    if (bestSize != null) {
                        this@om.add(OutputItem(outputMode, bestSize))
                    }
                }
            }
        }
    }

val CameraCharacteristics.aeCompensationRange: Range<Int>?
    get() = this[CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE]

val CameraCharacteristics.aeCompensationStep: Rational?
    get() = this[CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP]

val CameraCharacteristics.minimumFocusDistance: Float?
    get() = this[CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE]

val CameraCharacteristics.focalDistanceRange: Range<Float>?
    get() = minimumFocusDistance?.run { Range(0.0F, this@run) }

val CameraCharacteristics.sensorSensitivityRange: Range<Int>?
    get() = this[CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE]

val CameraCharacteristics.sensorExposureTimeRange: Range<Long>?
    get() = this[CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE]

val CameraCharacteristics.zoomRatioRange: Range<Float>?
    get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
        this[CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE]
    } else null

val CameraCharacteristics.oisMode: IntArray?
    get() = this[CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION]

val CameraCharacteristics.oisAvailable: Boolean
    get() = oisMode?.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_ON) == true

val CameraCharacteristics.sceneModeAvailableList: IntArray?
    get() = this[CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES]

val CameraCharacteristics.sceneModes: List<SceneMode>
    get() = mutableListOf<SceneMode>().apply {
        sceneModeAvailableList?.forEach { m ->
            SceneMode.getByCode(m)?.let { add(it) }
        }
    }

val CameraCharacteristics.availableFaceDetectMaxCount: Int?
    get() = this[CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT]

val CameraCharacteristics.availableFaceDetectModes: IntArray?
    get() = this[CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES]

val CameraCharacteristics.faceDetectModes: List<FaceDetectMode>
    get() = mutableListOf<FaceDetectMode>().apply {
        availableFaceDetectModes?.forEach { m ->
            FaceDetectMode.getByCode(m)?.let { add(it) }
        }
    }

val CameraCharacteristics.cameraFacing: Int?
    get() = this[CameraCharacteristics.LENS_FACING]

val CameraCharacteristics.isFrontCamera: Boolean
    get() = cameraFacing == CameraCharacteristics.LENS_FACING_FRONT


kShift = function(channel, control, value, status, group) {
    PioneerDDJSB2.pitchBendFromJog(
        PioneerDDJSB2.deckSwitchTable[group],
        PioneerDDJSB2.getJogWheelDelta(value) * PioneerDDJSB2.jogwheelShiftMultiplier
    );
};

PioneerDDJSB2.jogPlatterTick = function(channel, control, value, status, group) {
    var deck = PioneerDDJSB2.channelGroups[PioneerDDJSB2.deckSwitchTable[group]];
    if (PioneerDDJSB2.scratchMode[deck]) {
        engine.scratchTick(deck + 1, PioneerDDJSB2.getJogWheelDelta(value));
    } else {
        PioneerDDJSB2.pitchBendFromJog(PioneerDDJSB2.deckSwitchTable[group], PioneerDDJSB2.getJogWheelDelta(value));
    }
};

PioneerDDJSB2.jogPlatterTickShift = function(channel, control, value, status, group) {
    var deck = PioneerDDJSB2.channelGroups[PioneerDDJSB2.deckSwitchTable[group]];
    if (PioneerDDJSB2.scratchMode[deck]) {
        engine.scratchTick(deck + 1, PioneerDDJSB2.getJogWheelDelta(value));
    } else {
        PioneerDDJSB2.pitchBendFromJog(
            PioneerDDJSB2.deckSwitchTable[group],
            PioneerDDJSB2.getJogWheelDelta(value) * PioneerDDJSB2.jogwheelShiftMultiplier
        );
    }
};

PioneerDDJSB2.jogTouch = function(channel, control, value, status, group) {
    var deck = PioneerDDJSB2.channelGroups[PioneerDDJSB2.deckSwitchTable[group]];

    if (PioneerDDJSB2.scratchMode[deck]) {
        if (value) {
            engine.scratchEnable(
                deck + 1,
                PioneerDDJSB2.scratchSettings.jogResolution,
                PioneerDDJSB2.scratchSettings.vinylSpeed,
                PioneerDDJSB2.scratchSettings.alpha,
                PioneerDDJSB2.scratchSettings.beta,
                true
            );
        } else {
            engine.scratchDisable(deck + 1, true);
        }
    }
};

PioneerDDJSB2.toggleScratch = function(channel, control, value, status, group) {
    var deck = PioneerDDJSB2.channelGroups[group];
    if (value) {
        PioneerDDJSB2.scratchMode[deck] = !PioneerDDJSB2.scratchMode[deck];
        if (!PioneerDDJSB2.invertVinylSlipButton) {
            PioneerDDJSB2.nonPadLedControl(deck, PioneerDDJSB2.nonPadLeds.vinyl, PioneerDDJSB2.scratchMode[deck]);
            PioneerDDJSB2.nonPadLedControl(deck, PioneerDDJSB2.nonPadLeds.shiftVinyl, PioneerDDJSB2.scratchMode[deck]);
        }
        if (!PioneerDDJSB2.scratchMode[deck]) {
            engine.scratchDisable(deck + 1, true);
        }
    }
};

PioneerDDJSB2.pitchBendFromJog = function(channel, movement) {
    var group = (typeof channel === "string" ? channel : "[Channel" + channel + 1 + "]");

    engine.setValue(group, "jog", movement / 5 * PioneerDDJSB2.jogwheelSensitivity);
};

///////////////////////////////////////////////////////////////
//                        ROTARY SELECTOR                    //
///////////////////////////////////////////////////////////////

PioneerDDJSB2.rotarySelectorChanged = false; // new for DDJ-SB2

PioneerDDJSB2.getRotaryDelta = function(value) {
    var delta = 0x40 - Math.abs(0x40 - value),


 contentMaxXHeadersUsed = 0f

    var contentMaxXHeadersIdeal = 0f

    /** Offset into parent ColumnsNames[] */
    var nameOffset = -1

    /** Index within Table's IndexToDisplayOrder[] (column may be reordered by users) */
    var displayOrder: TableColumnIdx = -1

    /** Index within enabled/visible set (<= IndexToDisplayOrder) */
    var indexWithinEnabledSet: TableColumnIdx = -1

    /** Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column */
    var prevEnabledColumn: TableColumnIdx = -1

    /** Index of next enabled/visible column within Columns[], -1 if last enabled/visible column */
    var nextEnabledColumn: TableColumnIdx = -1

    /** Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort */
    var sortOrder: TableColumnIdx = -1

    /** Index within DrawSplitter.Channels[] */
    var drawChannelCurrent: TableDrawChannelIdx = -1

    /** Draw channels for frozen rows (often headers) */
    var drawChannelFrozen: TableDrawChannelIdx = -1

    /** Draw channels for unfrozen rows */
    var drawChannelUnfrozen: TableDrawChannelIdx = -1

    /** IsUserEnabled && (Flags & ImGuiTableColumnFlags_Disabled) == 0 */
    var isEnabled = false

    /** Is the column not marked Hidden by the user? (unrelated to being off view, e.g. clipped by scrolling). */
    var isUserEnabled = false

    var isUserEnabledNextFrame = false

    /** Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled). */
    var isVisibleX = false

    var isVisibleY = false

    /** Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not. */
    var isRequestOutput = false

    /** Do we want item submissions to this column to be completely ignored (no layout will happen). */
    var isSkipItems = false

    var isPreserveWidthAuto = false

    /** ImGuiNavLayer in 1 byte */
    var navLayerCurrent = NavLayer.Main

    /** Queue of 8 values for the next 8 frames to request auto-fit */
    var autoFitQueue = 0

    /** Queue of 8 values for the next 8 frames to disable Clipped/SkipItem */
    var cannotSkipItemsQueue = 0

    /** ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending */
    var sortDirection = SortDirection.None

    /** Number of available sort directions (0 to 3) */
    var sortDirectionsAvailCount = 0

    /** Mask of available sort directions (1-bit each) */
    var sortDirectionsAvailMask = 0

    /** Ordered list of available sort directions (2-bits each, total 8-bits) */
    var sortDirectionsAvailList = 0
}

/** Storage for one instance of a same table
 *
 *  Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?) */
class TableInstanceData {
    var tableInstanceID: ID = 0
    /** Outer height from last frame */
    var lastOuterHeight = 0f

    /** Height of first row from last frame (FIXME: this is used as "header height" and may be reworked) */
    var lastFirstRowHeight = 0f

    /** Height of frozen section from last frame */
    var lastFrozenHeight = 0f
}

// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
// sizeof() ~ 112 bytes.
class TableTempData {

    /** Index in g.Table


number of times using the
   * most cryptographically secure pseudo-random number generator available.
   *
   * @param {Array} inputArr The array to copy and shuffle.
   * @param {Number} [numTimes=10] The number of full-length shuffle rounds
   * to apply. Using 0 returns an unshuffled copy of the input array.
   * @return {Array} A copy of the input array shuffled the specified number
   * of times.
   *
   * @async
   * @private
   */
   async shuffle(inputArr, numTimes=10) {
      //maybe this could be done in SRACryptoWorker.js?
      var spliceArr;
      var outputArr = Array.from(inputArr);
      for (var count=0; count < numTimes; count++) {
         spliceArr = Array.from(outputArr);
         outputArr = new Array();
         try {
            //use crypto interface if available
            var spliceIndexes = new Uint32Array(spliceArr.length);
            crypto.getRandomValues(spliceIndexes);
         } catch (err) {
            //use less secure method
            spliceIndexes = new Array();
            for (var count2=0; count2 < spliceArr.length; count2++) {
               spliceIndexes.push(Math.round(Math.random() * Number.MAX_SAFE_INTEGER));
            }
         }
         var indexCount = 0;
         while (spliceArr.length > 0) {
            var spliceIndex = spliceIndexes[indexCount] % spliceArr.length;
            var splicedValue = spliceArr.splice(spliceIndex, 1)[0];
            outputArr.push(splicedValue);
            indexCount++;
         }
      }
      return (outputArr);
   }

   /**
   * Checks if a game associated with a specific [TableObject]{@link CypherPoker#TableObject} instance
   * is registered with the parent {@link CypherPoker} instance.
   *
   * @param {CypherPoker#TableObject} tableObj The associated table to check for.
   *
   * @return {Boolean} True if the table has been associated with an existing
   * {@link CypherPokerGame} instance in the parent {@link CypherPoker}.
   */
   gameExists(tableObj) {
      for (var count=0; count < this.cypherpoker.games.length; count++) {
         var currentTable = this.cypherpoker.games[count].table;
         if ((currentTable.tableID == tableObj.tableID) &&
            (currentTable.tableName == tableObj.tableName) &&
            (currentTable.ownerPID == tableObj.ownerPID)) {
               return (true);
         }
      }
      return (false);
   }

   /**
   * Returns true if the supplied JSON-RPC result structure contains the same
   * {@link CypherPoker#TableObject} identifiers as a table associated with this game instance.
   *
   * @param {Object} msgResultObj The JSON-RPC result object to check.
   *
   * @return {Boolean} True if the supplied table has the same identifiers
   * (table ID, table name, table owner, member private ID), as one associated
   * with this game.
   * @private
   */
   matchesThisTable(msgResultObj) {
      if (typeof(msgResultObj) != "object") {
         return (false);
      }
      if ((msgResultObj.data == null) || (msgResultObj.data == undefined)) {
         return (false);
      }
      //todo: update this to use a history of past tables played by this game
      //which should fix post-game verificaion problem (not triggering on subsequent rounds)
      if ((this.table.tableID == msgResultObj.data.tableID) &&
         (this.table.tableName == msgResultObj.data.tableName) &&
         (this.table.ownerPID == msgResultObj.data.ownerPID)) {
            var fromPID = msgResultObj.from;
            for (var count=0; count < this.players.length; count


)
      return nullptr;

    result->setRValue();
    return result;
  }

  SpirvInstruction *rhsVal = nullptr, *lhsPtr = nullptr, *lhsVal = nullptr;

  if (BinaryOperator::isCompoundAssignmentOp(opcode)) {
    // Evalute rhs before lhs
    rhsVal = loadIfGLValue(rhs);
    lhsVal = lhsPtr = doExpr(lhs);
    // This is a compound assignment. We need to load the lhs value if lhs
    // is not already rvalue and does not generate a vector shuffle.
    if (!lhsPtr->isRValue() && !isVectorShuffle(lhs)) {
      lhsVal = loadIfGLValue(lhs, lhsPtr);
    }
    // For a compound assignments, the AST does not have the proper implicit
    // cast if lhs and rhs have different types. So we need to manually cast lhs
    // to the computation type.
    if (computationType != lhsType)
      lhsVal = castToType(lhsVal, lhsType, computationType, lhs->getExprLoc());
  } else {
    // Evalute lhs before rhs
    lhsPtr = doExpr(lhs);
    if (!lhsPtr)
      return nullptr;
    lhsVal = loadIfGLValue(lhs, lhsPtr);
    rhsVal = loadIfGLValue(rhs);
  }

  if (lhsInfo)
    *lhsInfo = lhsPtr;

  const spv::Op spvOp = (mandateGenOpcode == spv::Op::Max)
                            ? translateOp(opcode, computationType)
                            : mandateGenOpcode;

  switch (opcode) {
  case BO_Shl:
  case BO_Shr:
  case BO_ShlAssign:
  case BO_ShrAssign:
    // We need to cull the RHS to make sure that we are not shifting by an
    // amount that is larger than the bitwidth of the LHS.
    rhsVal = spvBuilder.createBinaryOp(spv::Op::OpBitwiseAnd, computationType,
                                       rhsVal, getMaskForBitwidthValue(rhsType),
                                       loc, sourceRange);
    LLVM_FALLTHROUGH;
  case BO_Add:
  case BO_Sub:
  case BO_Mul:
  case BO_Div:
  case BO_Rem:
  case BO_LT:
  case BO_LE:
  case BO_GT:
  case BO_GE:
  case BO_EQ:
  case BO_NE:
  case BO_And:
  case BO_Or:
  case BO_Xor:
  case BO_LAnd:
  case BO_LOr:
  case BO_AddAssign:
  case BO_SubAssign:
  case BO_MulAssign:
  case BO_DivAssign:
  case BO_RemAssign:
  case BO_AndAssign:
  case BO_OrAssign:
  case BO_XorAssign: {

    if (lhsVal == nullptr || rhsVal == nullptr)
      return nullptr;

    // To evaluate this expression as an OpSpecConstantOp, we need to make sure
    // both operands are constant and at least one of them is a spec constant.
    if (SpirvConstant *lhsValConstant = dyn_cast<SpirvConstant>(lhsVal)) {
      if (SpirvConstant *rhsValConstant = dyn_cast<SpirvConstant>(rhsVal)) {
        if (isAcceptedSpecConstantBinaryOp(spvOp)) {
          if (lhsValConstant->isSpecConstant() ||
              rhsValConstant->isSpecConstant()) {
            auto *val = spvBuilder.createSpecConstantBinaryOp(
                spvOp, resultType, lhsVal, rhsVal, loc);
            if (!val)
              return nullptr;

            val->setRValue();
            return val;
          }
        }
      }
    }

    // Normal binary operation
    SpirvInstruction *val = nullptr;
    if (BinaryOperator::isCompoundAssignmentOp(opcode)) {
      val = spvBuilder.createBinaryOp(spvOp, computationType, lhsVal, rhsVal,


such as websites with more traffic than they can handle, in order to disrupt them and make them unavailable to legitimate users. In this report, we cover the latest insights and trends about the DDoS attack landscape as we observed across our global network.

Kicking off 2023 with a bang

			<svg width="16" height="16" viewBox="0 0 24 24">
				<path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path>
			</svg>

Threat actors kicked off 2023 with a bang. The start of the year was characterized by a series of hacktivist campaigns against Western targets including banking, airports, healthcare and universities — mainly by the pro-Russian Telegram-organized groups Killnet and more recently by AnonymousSudan.

While Killnet-led and AnonymousSudan-led cyberattacks stole the spotlight, we haven’t witnessed any novel or exceedingly large attacks by them.

Hyper-volumetric attacks

			<svg width="16" height="16" viewBox="0 0 24 24">
				<path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path>
			</svg>

	</div


/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                              printf.c
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                    Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

#include "type.h"
#include "const.h"
#include "protect.h"
#include "string.h"
#include "proc.h"
#include "tty.h"
#include "console.h"
#include "global.h"
#include "keyboard.h"
#include "proto.h"

/******************************************************************************************
                        可变参数函数调用原理（其中涉及的数字皆为举例）
===========================================================================================

i = 0x23;
j = 0x78;
char fmt[] = "%x%d";
printf(fmt, i, j);

        push    j
        push    i
        push    fmt
        call    printf
        add     esp, 3 * 4

                ┃        HIGH        ┃                        ┃        HIGH        ┃
                ┃        ...         ┃                        ┃        ...         ┃
                ┣━━━━━━━━━━┫                        ┣━━━━━━━━━━┫
                ┃                    ┃                 0x32010┃        '\0'        ┃
                ┣━━━━━━━━━━┫                        ┣━━━━━━━━━━┫
         0x3046C┃        0x78        ┃                 0x3200c┃         d          ┃
                ┣━━━━━━━━━━┫                        ┣━━━━━━━━━━┫
   arg = 0x30468┃        0x23        ┃                 0x32008┃         %          ┃
                ┣━━━━━━━━━━┫                        ┣━━━━━━━━━━┫
         0x30464┃      0x32000 ───╂────┐       0x32004┃         x          ┃
                ┣━━━━━━━━━━┫        │              ┣━━━━━━━━━━┫
                ┃                    ┃        └──→ 0x32000┃         %          ┃
                ┣━━━━━━━━━━┫                        ┣━━━━━━━━━━┫
                ┃        ...         ┃                        ┃        ...         ┃
                ┃        LOW         ┃                        ┃        LOW         ┃

实际上，调用 vsprintf 的情形是这样的：

        vsprintf(buf, 0x32000, 0x30468);

******************************************************************************************/

/*======================================================================*
                                 printf
 *======================================================================*/
int printf(const char *fmt, ...)
{
	int i;
	char buf[256];

	va_list arg = (va_list)((char*)(&fmt) + 4); /*4是参数fmt所占堆栈中的大小*/
	i = vsprintf(buf, fmt, arg);
	write(buf, i);

	return i;
}


    url.hash = await TextEncoding.toBase64(JSON.stringify(data), {
      gzip,
    });
    if (gzip) url.searchParams.set('gzip', '1');
    window.open(url.toString(), windowName);
  }

  /**
   * Expands all audit `<details>`.
   * Ideally, a print stylesheet could take care of this, but CSS has no way to
   * open a `<details>` element.
   */
  expandAllDetails() {
    const details = this._dom.findAll('.lh-categories details', this._document);
    details.map(detail => detail.open = true);
  }

  /**
   * Collapses all audit `<details>`.
   * open a `<details>` element.
   */
  collapseAllDetails() {
    const details = this._dom.findAll('.lh-categories details', this._document);
    details.map(detail => detail.open = false);
  }

  /**
   * Sets up listeners to collapse audit `<details>` when the user closes the
   * print dialog, all `<details>` are collapsed.
   */
  _setUpCollapseDetailsAfterPrinting() {
    // FF and IE implement these old events.
    if ('onbeforeprint' in self) {
      self.addEventListener('afterprint', this.collapseAllDetails);
    } else {
      // Note: FF implements both window.onbeforeprint and media listeners. However,
      // it doesn't matchMedia doesn't fire when matching 'print'.
      self.matchMedia('print').addListener(mql => {
        if (mql.matches) {
          this.expandAllDetails();
        } else {
          this.collapseAllDetails();
        }
      });
    }
  }

  /**
   * Returns the html that recreates this report.
   * @return {string}
   * @protected
   */
  getReportHtml() {
    this._resetUIState();
    return this._document.documentElement.outerHTML;
  }

  /**
   * Save json as a gist. Unimplemented in base UI features.
   * @protected
   */
  saveAsGist() {
    throw new Error('Cannot save as gist from base report');
  }

  /**
   * Downloads a file (blob) using a[download].
   * @param {Blob|File} blob The file to save.
   * @private
   */
  _saveFile(blob) {
    const filename = getFilenamePrefix({
      finalUrl: this.json.finalUrl,
      fetchTime: this.json.fetchTime,
    });

    const ext = blob.type.match('json') ? '.json' : '.html';
    const href = URL.createObjectURL(blob);

    const a = this._dom.createElement('a');
    a.download = `${filename}${ext}`;
    a.href = href;
    this._document.body.appendChild(a); // Firefox requires anchor to be in the DOM.
    a.click();

    // cleanup.
    this._document.body.removeChild(a);
    setTimeout(_ => URL.revokeObjectURL(href), 500);
  }

  /**
   * @private
   * @param {boolean} [force]
   */
  _toggleDarkTheme(force) {
    const el = this._dom.find('.lh-vars', this._document);
    // This seems unnecessary, but in DevTools, passing "undefined" as the second
    // parameter acts like passing "false".
    // https://github.com/ChromeDevTools/devtools-frontend/blob/dd6a6d4153647c2a4203c327c595692c5e0a4256/front_end/dom_extension/DOMExtension.js#L809-L819
    if (typeof force === 'undefined') {
      el.classList.toggle('dark');
    } else {
      el.classList.toggle('dark', force);
    }
  }

  _updateStickyHeaderOnScroll() {
    // Show sticky header when the score scale begins to go underneath the topbar.
    const topbarBottom = this.topbarEl.getBoundingClientRect().bottom;
    const scoreScaleTop = this.scoreScaleEl.getBoundingClientRe


 rgba(123, 210, 53, 0.5);
}

.btn-option {
    background: transparent;
    color: #9aa0ac;
}

.btn-option:hover {
    color: #6e7687;
}

.btn-option:focus {
    box-shadow: none;
    color: #6e7687;
}

.btn-sm,
.btn-group-sm>.btn {
    font-size: 0.75rem;
    min-width: 1.625rem;
}

.btn-lg,
.btn-group-lg>.btn {
    font-size: 1rem;
    min-width: 2.75rem;
    font-weight: 400;
}

.btn-list {
    margin-bottom: -0.5rem;
    font-size: 0;
}

.btn-list>.btn,
.btn-list>.dropdown {
    margin-bottom: 0.5rem;
}

.btn-list>.btn:not(:last-child),
.btn-list>.dropdown:not(:last-child) {
    margin-right: 0.5rem;
}

.btn-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn-loading:after {
    content: "";
    -webkit-animation: loader 500ms infinite linear;
    animation: loader 500ms infinite linear;
    border: 2px solid #fff;
    border-radius: 50%;
    border-right-color: transparent !important;
    border-top-color: transparent !important;
    display: block;
    height: 1.4em;
    width: 1.4em;
    position: absolute;
    left: calc(50% - 0.7em);
    top: calc(50% - 0.7em);
    -webkit-transform-origin: center;
    transform-origin: center;
    position: absolute !important;
}

.btn-loading.btn-sm:after {
    height: 1em;
    width: 1em;
    left: calc(50% - 0.5em);
    top: calc(50% - 0.5em);
}

.btn-group-sm>.btn-loading.btn:after {
    height: 1em;
    width: 1em;
    left: calc(50% - 0.5em);
    top: calc(50% - 0.5em);
}

.btn-loading.btn-secondary:after {
    border-color: #495057;
}

.btn-circle {
    text-align: center;
    padding: 6px 0;
    border-radius: 50%;
    text-align: center;
}

.btn-circle i {
    font-size: 0.9rem;
}

.btn-social.btn-lg {
    padding-left: 61px;
}

.btn-social.btn-lg> :first-child {
    line-height: 45px;
    width: 45px;
    font-size: 1.8em;
}

.btn-social.btn-sm {
    padding-left: 38px;
}

.btn-social.btn-sm> :first-child {
    line-height: 28px;
    width: 28px;
    font-size: 1.4em;
}

.btn-social.btn-xs {
    padding-left: 30px;
}

.btn-social.btn-xs> :first-child {
    line-height: 20px;
    width: 20px;
    font-size: 1.2em;
}

.btn-social-icon {
    position: relative;
    padding-left: 44px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 34px;
    width: 34px;
    padding: 0;
}

.btn-social-icon> :first-child {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    w


"string" then
    return nil, "logger of log message MUST be a string"
  end
  if logger then
    ngx.log(llv, string.format("%s: %s", logger, encoded_data))
  else
    ngx.log(llv, encoded_data)
  end
  if self.capabilities.logging and self.log_level and llv <= self.log_level then
    return mcp.session.send_notification(self, "message", {level, data, logger}, meta_fa and meta_fa() or nil)
  end
  return true
end

function _MT.__index.ping(self, timeout, meta_fa)
  return mcp.session.send_request(self, "ping", {}, tonumber(timeout), meta_fa and meta_fa() or nil)
end

function _MT.__index.run(self, options)
  self.capabilities = {
    completions = {},
    logging = {},
    prompts = {
      listChanged = true
    },
    resources = {
      subscribe = true,
      listChanged = true
    },
    tools = {
      listChanged = true
    }
  }
  self.pagination = {
    prompts = 0,
    resources = 0,
    tools = 0
  }
  if options then
    if type(options.capabilities) == "table" then
      for k, v in pairs(self.capabilities) do
        local val = options.capabilities[k]
        local typ = type(val)
        if typ == "table" then
          self.capabilities[k] = val
        elseif typ ~= "nil" and not val then
          self.capabilities[k] = nil
        end
      end
    end
    if type(options.pagination) == "table" then
      for k, v in pairs(self.pagination) do
        local val = tonumber(options.pagination[k])
        if val and val > 0 then
          self.pagination[k] = math.floor(val)
        end
      end
    end
    if type(options.instructions) == "string" then
      self.instructions = options.instructions
    end
    self.event_handlers = options.event_handlers
  end
  mcp.session.initialize(self, define_methods(self))
end

function _MT.__index.shutdown(self)
  mcp.session.shutdown(self, true)
end

function _M.new(transport, options)
  local conn, err = transport.server(options)
  if not conn then
    return nil, err
  end
  return mcp.session.new(conn, options, _MT)
end

function _M.check(v)
  return mcp.utils.check_mcp_type(_M, v)
end

return _M


proxy;

pub trait EnclaveRpc {
    /// Maximum response size (in kilobytes).
    const MAX_RESPONSE_SIZE: usize = 1024;

    /// Perform a plain-text RPC call against the enclave.
    fn call<R: Message, S: Message + MessageStatic>(&self, method: &str, request: &R) -> Result<S>;

    /// Perform a raw RPC call against the enclave.
    fn call_raw(&self, request: Vec<u8>) -> Result<Vec<u8>>;
}

impl EnclaveRpc for Enclave {
    /// Perform a plain-text RPC call against the enclave with no state.
    fn call<R: Message, S: Message + MessageStatic>(&self, method: &str, request: &R) -> Result<S> {
        // Prepare plain request.
        let mut plain_request = api::PlainClientRequest::new();
        plain_request.set_method(String::from(method));
        plain_request.set_payload(request.write_to_bytes()?);

        let mut client_request = api::ClientRequest::new();
        client_request.set_plain_request(plain_request);

        let mut enclave_request = api::EnclaveRequest::new();
        enclave_request.set_client_request(RepeatedField::from_slice(&[client_request]));

        let enclave_request_bytes = enclave_request.write_to_bytes()?;
        let enclave_response_bytes = self.call_raw(enclave_request_bytes)?;

        let enclave_response: api::EnclaveResponse =
            match protobuf::parse_from_bytes(enclave_response_bytes.as_slice()) {
                Ok(enclave_response) => enclave_response,
                _ => return Err(Error::new("Response parse error")),
            };

        let client_response = &enclave_response.get_client_response()[0];

        // Plain request requires a plain response.
        assert!(client_response.has_plain_response());
        let plain_response = client_response.get_plain_response();

        // Validate response code.
        match plain_response.get_code() {
            api::PlainClientResponse_Code::SUCCESS => {}
            _ => {
                // Deserialize error.
                let error: api::Error =
                    match protobuf::parse_from_bytes(plain_response.get_payload()) {
                        Ok(error) => error,
                        _ => return Err(Error::new("Unable to parse error payload")),
                    };

                return Err(Error::new(error.get_message()));
            }
        };

        // Deserialize response.
        match protobuf::parse_from_bytes(plain_response.get_payload()) {
            Ok(response) => Ok(response),
            _ => Err(Error::new("Unable to parse response payload")),
        }
    }

    /// Perform a raw RPC call against the enclave.
    fn call_raw(&self, mut request: Vec<u8>) -> Result<Vec<u8>> {
        // Reserve space up to the maximum size of serialized response.
        // TODO: Can we avoid allocating large response buffers each time?
        let mut response: Vec<u8> = Vec::with_capacity(Self::MAX_RESPONSE_SIZE * 1024);

        // Ensure that request is actually allocated as the length of the actual request
        // may be zero and in that case the OCALL will fail with SGX_ERROR_INVALID_PARAMETER.
        request.reserve(1);

        let mut response_length = 0;
        let status = unsafe {
            ecall_proxy::rpc_call(
                self.get_id(),
                request.as_ptr() as *const u8,
                request.len(),


doc.iocoder.cn/util/ class=sidebar-link>工具类 Util
配置管理
数据库文档

中间件手册

定时任务
消息队列（内存）
消息队列（Redis）
消息队列（RocketMQ）
消息队列（RabbitMQ）
消息队列（Kafka）
限流熔断

工作流手册

工作流演示
功能开启
工作流（达梦适配）
审批接入（流程表单）
审批接入（业务表单）
流程设计器（BPMN）
流程设计器（钉钉、飞书）
选择审批人、发起人自选
会签、或签、依次审批
流程发起、取消、重新发起
审批通过、不通过、驳回
审批加签、减签
<a href=https://doc.iocoder.cn/bpm/task-delegation-and-cc/ class=sideba


/**
 * Copyright 2019 The Gamma Authors.
 *
 * This source code is licensed under the Apache License, Version 2.0 license
 * found in the LICENSE file in the root directory of this source tree.
 */

#ifndef REALTIME_INVERT_INDEX_H_
#define REALTIME_INVERT_INDEX_H_

#include <stdlib.h>

#include <map>
#include <vector>

#include "faiss/Index.h"
#include "faiss/IndexIVF.h"
#include "realtime_mem_data.h"
#include "util/bitmap.h"
#include "util/bitmap_manager.h"

namespace tig_gamma {
namespace realtime {

struct RTInvertIndex {
 public:
  // bucket_keys should not be larger than bucket_keys_limit
  RTInvertIndex(size_t nlist, size_t code_size, VIDMgr *vid_mgr,
                bitmap::BitmapManager *docids_bitmap,
                size_t bucket_keys = 10000, size_t bucket_keys_limit = 1000000);

  ~RTInvertIndex();

  bool Init();

  /*  @param n : count of added keys
   *  @param keys : added key arrays
   *  @param keys_codes : added key code arrays*/
  bool AddKeys(std::map<int, std::vector<long>> &new_keys,
               std::map<int, std::vector<uint8_t>> &new_codes);

  int Update(int bucket_no, int vid, std::vector<uint8_t> &codes);

  bool GetIvtList(const size_t &bucket_no, long *&ivt_list, size_t &ivt_size,
                  uint8_t *&ivt_codes_list);

  long GetTotalMemBytes() {
    return cur_ptr_ ? cur_ptr_->GetTotalMemBytes() : 0;
  }

  void PrintBucketSize();
  int CompactIfNeed();
  int Delete(int *vids, int n);

  size_t nlist_;
  size_t code_size_;
  size_t bucket_keys_;
  size_t bucket_keys_limit_;
  VIDMgr *vid_mgr_;
  bitmap::BitmapManager *docids_bitmap_;

  RealTimeMemData *cur_ptr_;
};

using idx_t = faiss::Index::idx_t;
struct RTInvertedLists : faiss::InvertedLists {
  RTInvertedLists(realtime::RTInvertIndex *rt_invert_index_ptr, size_t nlist,
                  size_t code_size);

  /*************************
   *  Read only functions */

  // get the size of a list
  size_t list_size(size_t list_no) const override;

  /** get the codes for an inverted list
   * must be released by release_codes
   *
   * @return codes    size list_size * code_size
   */
  const uint8_t *get_codes(size_t list_no) const override;

  /** get the ids for an inverted list
   * must be released by release_ids
   *
   * @return ids      size list_size
   */
  const idx_t *get_ids(size_t list_no) const override;

  /*************************
   * writing functions     */

  size_t add_entries(size_t list_no, size_t n_entry, const idx_t *ids,
                     const uint8_t *code) override;

  void resize(size_t list_no, size_t new_size) override;

  void update_entries(size_t list_no, size_t offset, size_t n_entry,
                      const idx_t *ids_in, const uint8_t *codes_in) override;

  realtime::RTInvertIndex *rt_invert_index_ptr_;
};

}  // namespace realtime

}  // namespace tig_gamma

#endif


AreEquivalentDependencyDependency()
   {
      Dependency depOne = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client")
               .setPackaging("jar");
      Dependency depTwo = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client")
               .setPackaging("test-jar");
      Assert.assertFalse(Dependencies.areEquivalent(depOne, depTwo));
   }

   /**
    * Test method for
    * {@link org.jboss.forge.addon.dependencies.util.Dependencies#areEquivalent(org.jboss.forge.addon.dependencies.Coordinate, org.jboss.forge.addon.dependencies.Coordinate)}
    * .
    */
   @Test
   public void testAreEquivalentCoordinateCoordinate()
   {
      Dependency depOne = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client")
               .setPackaging("jar");
      Dependency depTwo = DependencyBuilder.create().setGroupId("org.jboss.errai").setArtifactId("errai-cdi-client")
               .setPackaging("test-jar");
      Assert.assertFalse(Dependencies.areEquivalent(depOne, depTwo));
   }

}
/**
 * Copyright 2016 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Eclipse Public License version 1.0, available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.jboss.forge.addon.dependencies.builder;

import java.util.Map;

import org.jboss.forge.addon.dependencies.Coordinate;
import org.jboss.forge.furnace.util.Strings;

public class CoordinateBuilder implements Coordinate
{
   private String groupId;
   private String artifactId;
   private String version;
   private String classifier;
   private String packaging;
   private String systemPath;

   /**
    *
    * Creates a Coordinate
    *
    * @param coordinates The artifact coordinates in the format
    *           {@code <groupId>:<artifactId>[:<packaging>[:<classifier>]]:<version>} , must not be {@code null} or
    *           empty.
    *
    * @return
    */
   public static CoordinateBuilder create(String coordinates)
   {
      CoordinateBuilder builder = CoordinateBuilder.create();
      // groupId:artifactId:packaging:classifier:version
      String[] split = coordinates.split("\\:");
      switch (split.length)
      {
      case 1:
         builder.setGroupId(split[0]);
         break;
      case 2:
         builder.setGroupId(split[0]);
         builder.setArtifactId(split[1]);
         break;
      case 3:
         builder.setGroupId(split[0]);
         builder.setArtifactId(split[1]);
         builder.setVersion(split[2]);
         break;
      case 4:
         builder.setGroupId(split[0]);
         builder.setArtifactId(split[1]);
         builder.setPackaging(split[2]);
         builder.setVersion(split[3]);
         break;
      case 5:
         builder.setGroupId(split[0]);
         builder.setArtifactId(split[1]);
         builder.setPackaging(split[2]);
         builder.setClassifier(split[3]);
         builder.setVersion(split[4]);
         break;
      default:
         throw new IllegalArgumentException(
                  "Malformed coordinate (" + coordinates
                           + "). Should be groupId:artifactId:[packaging]:[classifier]:[version]");
      }
      return builder;
   }

   public static CoordinateBuilder create(Map<String, String> atts)
   {
      CoordinateBuilder builder = CoordinateBuilder.create();
      builder.setGroupId(atts.get("groupId"));
      builder.setArtifactId(atts.get("artifactId"));
      builder.setVersion(atts.get("version"));
      builder


 String {
	let mut result = String::new();

	// We put . as the white squares (that can't be played on in checkers),
	// newlines at the end of each line.
	let decoration = (0..32).map(|x| match x {
		4 | 12 | 20 | 28 => "\n",
		8 | 16 | 24 => ".\n.",
		_ => "."
	});

	// Loop through all of the squares in the board
	for (d, i) in decoration.zip(BOARD_REPR) {

		// Add the "decoration" characters
		result.push_str(d);

		// x & mask will be zero if that square is empty, nonzero otherwise.
		let mask = 1 << i;

		// Match bitboard state to character.
		result.push(if board.white & board.kings & mask != 0 {
			// White king
			'W'
		} else if board.black & board.kings & mask != 0 {
			// Black king
			'B'
		} else if board.white & mask != 0 {
			// white, but not king
			'w'
		} else if board.black & mask != 0 {
			// black, but not king
			'b'
		} else if !(board.white | board.black) & board.kings & mask != 0 {
			// There's a king, but no corresponding white or black piece that goes
			// with it.
			panic!("corrupted board: king not associated with piece");
		} else if board.white & board.black & mask != 0 {
			// Both white and black pieces on the same square is not possible
			panic!("corrupted board: doubly occupied square");
		} else {
			// No white or black piece, i.e. empty square.
			' '
		});
	}

	result.push_str(".\n");
	result
}

/////////////////////////////////////////////////////////////////////////////

/// "Flips" a board, rotating it by 180deg and switching white and black colors.
/// Because our networks only know how to think from white's perspective, and we
/// only generate moves for white, we have to flip the board constantly as we
/// generate and evaluate moves.
pub fn flip_board(board: &Board) -> Board {

	// Another curious property of this bitboard layout is flipping the board
	// is as simple as mirroring the int's bits (abc becomes cba) and then
	// rotating left by 8 bits.
	Board {
		white: board.black.reverse_bits().rotate_left(8), // swap white and
		black: board.white.reverse_bits().rotate_left(8), // black pieces as well
		kings: board.kings.reverse_bits().rotate_left(8),
		moves_since_action: board.moves_since_action
	}
}

/////////////////////////////////////////////////////////////////////////////

/// Given a board and a vector of potentially already-computed moves, push
/// moves that are legal sliding promotions onto the vector.
/// It's possible to combine this with the more general sliding moves function,
/// but I am separating it out because I want to force these moves to be
/// generated first in order to try to induce earlier pruning during search.
pub fn gen_sliding_promotions(board: &Board, mut moves: Vec<Board>)
	-> Vec<Board> {

	// Open promotion squares are squares in the top row only, and occupied
	// by neither white nor black pieces.
	let open_squares = MASK_TOP_ROW & !(board.white | board.black);

	// Only white men, not kings, can be promoted.
	let white_men = board.white & !board.kings;

	// Helper function to add moves (stored as Boards representing the position
	// after the move is made) to the vector of moves.
	// Here "movers" is an int for which a bit is 1 if the corresponding piece
	// has a available move, and "offset" is the direction in which to


 cubo por su ID.
  ///
  /// Realiza una consulta a la base de datos para obtener un tipo de cubo específico
  /// basándose en su ID. Si no encuentra el cubo, devuelve un tipo de cubo con
  /// valores por defecto que indican un error.
  ///
  /// Parámetros:
  /// - `id`: ID del tipo de cubo a buscar.
  ///
  /// Retorna:
  /// - `CubeType`: El tipo de cubo encontrado o un cubo con valores de error.
  Future<CubeType> getCubeById(int id) async {
    try {
      // REALIZA LA CONSULTA A LA BASE DE DATOS
      final response = await _client
          .from('cubetype')
          .select()
          .eq('idcubetype', id)
          .limit(1)
          .maybeSingle();

      if (response != null) {
        // CONVIERTE EL PRIMER RESULTADO EN UN OBJETO
        return CubeType(
          idCube: response['idcubetype'] as int,
          cubeName: response['cubename'] as String,
          idUser: response['iduser'] as int,
        );
      } else {
        // SI NO ENCUENTRA EL ID, DEVUELVE UN TIPO DE CUBO DE EROOR
        DatabaseHelper.logger.w("No se encontró ningún cubo con ese id: $id");
        return CubeType(idCube: -1, cubeName: "ErrorCube");
      } // SI LA CONSULTA NO ES NULA Y DEVUELVE UN RESULTADO
    } catch (e) {
      DatabaseHelper.logger.e("Error al obtener el tipo de cubo por su id: $e");
      // RETORNA UN ERROR TIPO DE CUBO EN CASO DE ERROR
      return CubeType(idCube: -1, cubeName: "ErrorCube");
    }
  } // METODO PARA BUSCAR UN TIPO DE CUBO POR SU ID
}
import 'package:dart_eval/dart_eval.dart';
import 'package:test/scaffolding.dart';

void main() {
  final compiler = Compiler();

  test('datetime parse', () async {
    final source = '''
      bool fn(){
        final a = DateTime.parse('2011-10-20 23:12:23');
        if(a.day != 20){
          return false;
        }
        if(a.month != 10){
          return false;
        }
        return true;
      }
      ''';
    final runtime = compiler.compileWriteAndLoad({
      'my_package': {
        'main.dart': source,
      }
    });
    var result = runtime.executeLib(
      "package:my_package/main.dart",
      "fn",
    );
    assert(result);
  });

  test('datetime year month day', () async {
    final source = '''
      bool fn(){
        var a = DateTime.parse('2011-10-20');
        if(a.day != 20){
          return false;
        }
        if(a.month != 10 ){
          return false;
        }
        if(a.year != 2011){
          return false;
        }
        return true;
      }
      ''';
    final runtime = compiler.compileWriteAndLoad({
      'my_package': {
        'main.dart': source,
      }
    });
    var result = runtime.executeLib(
      "package:my_package/main.dart",
      "fn",
    );
    assert(result);
  });

  test('datetime isAfter isBefore', () async {
    final source = '''
      bool fn(){
        final a = DateTime.parse('2011-10-22 00:00:00');
        final b = DateTime.parse('2011-10-20 00:00:00');
        if(true != true){
          return


+FE2E-FE2F}@font-face{font-weight:600;font-family:'IBM Plex Mono';font-style:normal;src:local(\"IBM Plex Mono SemiBold\"),local(\"IBMPlexMono-SemiBold\"),url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlRFgsAXHNlYzg.woff2) format(\"woff2\");font-display:auto;unicode-range:U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}@font-face{font-weight:600;font-family:'IBM Plex Mono';font-style:normal;src:local(\"IBM Plex Mono SemiBold\"),local(\"IBMPlexMono-SemiBold\"),url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl9FgsAXHNlYzg.woff2) format(\"woff2\");font-display:auto;unicode-range:U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB}@font-face{font-weight:600;font-family:'IBM Plex Mono';font-style:normal;src:local(\"IBM Plex Mono SemiBold\"),local(\"IBMPlexMono-SemiBold\"),url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl5FgsAXHNlYzg.woff2) format(\"woff2\");font-display:auto;unicode-range:U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF}@font-face{font-weight:600;font-family:'IBM Plex Mono';font-style:normal;src:local(\"IBM Plex Mono SemiBold\"),local(\"IBMPlexMono-SemiBold\"),url(https://fonts.gstatic.com/s/ibmplexmono/v4/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlBFgsAXHNk.woff2) format(\"woff2\");font-display:auto;unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}@font-face{font-weight:300;font-family:'IBM Plex Sans';font-style:italic;src:local(\"IBM Plex Sans Light Italic\"),local(\"IBMPlexSans-LightItalic\"),url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX7KVElMYYaJe8bpLHnCwDKhdTmvIRcdvfo.woff) format(\"woff\");font-display:auto}@font-face{font-weight:400;font-family:'IBM Plex Sans';font-style:italic;src:local(\"IBM Plex Sans Italic\"),local(\"IBMPlexSans-Italic\"),url(https://fonts.gstatic.com/s/ibmplexsans/v6/zYX-KVElMYYaJe8bpLHnCwDKhdTuF6ZP.woff) format(\"


 Items*/
        --theme-sel: rgb(59, 59, 59);
        --button-col: rgb(202, 217, 224);
        --button-bg:linear-gradient(rgb(7, 31, 66), #42083f);

        /* # Buttons */
        --bbor: transparent;
        --bbort: #23e5f3af 2px solid;
        --bborl: #34ec7ab9 1px solid;
        --bshad: inset -4px -4px 4px -3px #cc0aa2d0;

        --bwarn: rgb(235, 45, 45);
        --bwbort: rgb(126, 17, 13) 2px solid;
        --bwborl: rgb(255, 18, 1) 1px solid;
        --bwshad: inset -4px -4px 4px -3px rgb(151, 16, 16);

        /* # Scrollbar*/
        --gscroll1: rgba(218, 30, 255, 0.466);
        --gscroll2: rgba(77, 138, 218, 0.795);
        --gscroll3: rgba(78, 237, 237, 0.753);
        --gscroll4: rgba(14, 141, 99, 0.829);
        --gscroll5: rgba(250, 18, 192, 0.589);

        /* # Slider*/
        --slide1: rgba(15, 225, 240, 0.726);
        --slide2: rgb(243, 1, 203);

        /* # Notice*/
        --nbg: rgba(147, 28, 158, 0.911);
        --nshad: rgb(128, 28, 153);

        /* # Toggle*/
        --togcon: "⚈";
        --togcona: "⚈";
        --togbg: rgb(192, 22, 115);
        --togsz: 25px;

        /* # Dropdown */
        --dbor: transparent;
        --dbort: #23e5f3af 2px solid;
        --dborl: #34ec7ab9 1px solid;
        --dshad: inset -4px -4px 4px -3px #cc0aa2d0;
    }

/* @ NEONIVERSE C: MARKDOWN*/
.theme-dark.neoni {
    --fbold: rgb(205, 41, 226);
    --fitalic: rgb(236, 196, 16);
    --flink: rgb(5, 216, 253);
    --fcode: var(--cream2);
    --hlbg: rgb(7, 88, 94);
    --comcolor: rgb(173, 163, 255);

    /* # Header Colors*/
    --head1: rgb(206, 36, 192);
    --head2: rgb(75, 178, 196);
    --head3: rgb(123, 180, 70);
    --head4: rgb(219, 141, 250);
    --head5: rgb(224, 175, 85);
    --head6: rgb(190, 184, 190);

    /* # Tags*/
    --tborder: rgb(194, 9, 250);
    --tb4: "🌟";
    --tcolor: rgb(245, 237, 242);
    --tcol1: transparent;
    --tcol2: transparent;
    --tcol3: transparent;

    /* # Bullets/Numbers*/
    --blcol: rgb(0, 204, 255);
    --bul-b4: var(--tree-b4);

    /* # Checklist*/
    --uncheck: "\2606";
    --check: "\2605";
    --checkcol:rgb(176, 80, 214);
    --cshad: 0 0 0.7em var(--tborder);
    --untask: rgb(107, 156, 221);
    --task: rgb(199, 23, 184);

    /* # Blockquotes*/
    --bq-col: rgb(241, 43, 232);
    --equote: rgb(153, 206, 250) ;

    /* # Table*/
    --thead: rgb(95, 10, 74);
    --td: rgb(5, 19, 37);
    --tbcol1: rgba(37


/*
 Copyright 2009 Eigenlabs Ltd.  http://www.eigenlabs.com

 This file is part of EigenD.

 EigenD 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 3 of the License, or
 (at your option) any later version.

 EigenD 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 EigenD.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __SAMPLER2_LOADER__
#define __SAMPLER2_LOADER__

#include <plg_sampler2/pisampler2_exports.h>

#include <picross/pic_ref.h>
#include <picross/pic_weak.h>

#include <piw/piw_bundle.h>
#include <piw/piw_clock.h>
#include <piw/piw_data.h>
#include <piw/piw_sample.h>
#include <piw/piw_sampler.h>

#include "smp_player.h"

namespace sampler2
{
    class PISAMPLER2_DECLSPEC_CLASS loader_t
    {
        private:
            class impl_t;

        public:
            loader_t(player_t *s,const piw::cookie_t &c, piw::clockdomain_ctl_t *d);
            ~loader_t();
            void load(const piw::presetref_t &);
            piw::cookie_t cookie();

        private:
            impl_t *impl_;
    };
}

#endif


 객체보다 작으면, 두 번째가 첫 번째보다 커야 한다. 첫 번째가 두 번째와 크기가 같다면, 두 번째는 첫 번째와 같아야 한다. 마지막으로 첫 번째가 두 번째보다 크면, 두 번째는 첫 번째보다 작아야 한다.

### 두 번째 규약. 첫 번째가 두 번째보다 크고 두 번째가 세 번째보다 크면, 첫 번째는 세 번째보다 커야한다.

### 마지막 규약. 크기가 같은 객체들끼리는 어떤 객체와 비교해도 항상 같아야 한다.

→ 반사성, 대칭성, 추이성을 충족해야 할 것

## compareTo 우회법

Comparable을 구현한 클래스를 확장해 값 컴포넌트를 추가하고 싶다면, 확장하는 대신 독립된 클래스를 만들고, 이 클래스에 원래 클래스의 인스턴스를 가리키는 필드를 둘 것.

그 다음에 내부 인스턴스를 반환하는 '뷰' 메서드를 제공하면 된다.

→ 바깥 클래스에 원하는 compareTo 메서드를 구현해넣을 수 있다.

### 마지막 규약(크기가 같은 객체들은 어떤 객체와 비교해도 항상 같아야 한다.) 필수는 아니지만 꼭 지킬 것

마지막 규약은 간단히 말하면 compareTo 메서드로 수행한 동치성 테스트의 결과가 equals와 같아야 한다.

compareTo로 줄지은 순서와 equals의 결과가 일관되게 된다.

## compareTo 메서드 작성 요령

Comparable은 타입을 인수로 받는 제네릭 인터페이스이므로 compareTo 메서드의 인수 타입은 컴파일타임에 정해진다. 인수 타입을 확인하거나 형변환할 필요가 없음.

compareTo 메서드는 각 필드가 동치인지를 비교하는게 아니라 그 순사를 비교한다. 객체 참조 필드를 비교하려면 compareTo 메서드를 재귀적으로 호출한다.

Comparable을 구현하지 않은 필드나 표준이 아닌 순서로 비교해야 한다면 비교자(Comparator)를 대신 사용한다. 비교자는 직접 만들거나 자바가 제공하는 것 중 골라 쓰면 된다.

예시)


N--L", "Eglaim", "eg.la.yim"),
        "H98": ("אֲגַם", "H:N-M", "pool", "a.gam"),
        "H99": ("אָגֵם", "H:A", "grieved", "a.gem"),
        "H100": ("אַגְמֹן", "H:N-M", "bulrush", "ag.mon"),
        "H101": ("אַגָּן", "H:N-M", "vessel", "ag.gan"),
        "H102": ("אֲגַף", "H:N-M", "band", "ag.gaph"),
        "H103": ("אָגַר", "H:V", "to gather", "a.gar"),
        "H104": ("אִגְּרָא", "A:N-F", "letter", "ig.g.ra"),
        "H105": ("אֲגַרְטָל", "H:N-M", "basin", "a.gar.tal"),
        "H106": ("אֶגְרֹף", "H:N-M", "fist", "eg.roph"),
        "H107": ("אִגֶּ֫רֶת", "H:N-F", "letter", "ig.ge.ret"),
        "H108": ("אֵד", "H:N-M", "mist", "ed"),
        "H109": ("אָדַב", "H:V", "to grieve", "a.dav"),
        "H110": ("אַדְבְּאֵל", "N:N-M-P", "Adbeel", "ad.be.el"),
        "H111": ("אֲדַד", "N:N-M-P", "Hadad", "a.dad"),
        "H112": ("אִדּוֹ", "N:N-M-P", "Iddo", "id.do"),
        "H113": ("אָדוֹן", "H:N-M", "lord", "a.don"),
        "H114": ("אַדּוֹן", "N:N--L", "Addon", "ad.don"),
        "H115": ("אֲדוֹרַ֫יִם", "N:N--L", "Adoraim", "a.do.ra.yim"),
        "H116": ("אֱדַ֫יִן", "A:Adv", "then", "e.da.yin"),
        "H117": ("אַדִּיר", "H:A", "great", "ad.dir"),
        "H118": ("אֲדַלְיָא", "N:N-M-P", "Adalia", "a.dal.ya"),
        "H119": ("אָדֹם", "H:V", "to redden", "a.dam"),
        "H120": ("אָדָם", "H:N-M", "man", "a.dam"),
        "H121": ("אָדָם", "N:N-M-P / N:N--L", "Adam", "a.dam"),
        "H122a": ("אָדֹם", "H:A", "red", "a.dom"),
        "H122b": ("אֱדֹם", "H:N-M", "red stuff", ""),
        "H123": ("אֱדוֹם", "N:N-M-P / N:N--L", "Edom", "e.dom"),
        "H124": ("אֹ֫דֶם", "H:N-F", "sardius", "o.dem"),
        "H125": ("אֲדַמְדָּם", "H:A", "reddish", "a.dam.dam"),
        "H126": ("אַדְמָה", "N:N--L", "Admah", "ad.mah"),
        "H127": ("אֲדָמָה", "H:N-F", "land", "a.da.mah"),
        "H128": ("אֲדָמָה", "N:N--L", "Adamah", "a.da.mah"),
        "H129": ("אֲדָמִי", "N:N--L", "Adami", "a.da.mi"),
        "H130": ("אֲדֹמִי", "N:N--PG", "Edomite", "e.do.mi"),
        "H131": ("אֲדֻמִּים", "N:N--L", "Adummim", "a.dum.mim"),
        "H132": ("אַדְמוֹנִי", "H:A", "red", "ad.mo.ni"),
        "H133": ("אַדְמָתָא", "N:N-M-P", "Admatha", "ad.ma.ta"),
        "H134": ("אֶ֫דֶן", "H:N-M", "socket", "e.den"),
        "H135": ("אַדָּן", "N:N--L", "Addan", "ad.dan"),
        "H136": ("אֲדֹנָי", "H:N-M", "Lord", "a.do.na"),
        "H137": ("אֲדֹנִי־בֶ֫זֶק", "N:N-M-P", "Adoni-bezek", "a.do.ni-ve.zeq"),
        "H138": ("אֲדֹנִיָּ֫הוּ", "N:N-M-P", "Adonijah", "a.do.niy.yah"),
        "H139": ("אֲדֹנִי־צֶ֫דֶק", "N:N-M-P", "Adoni-zedek", "a.do.ni-tse.deq"),
        "H140": ("אֲדֹנִיקָם", "N:N-M-P", "Adonikam", "a.do.ni.qam"),
        "H141": ("אֲדֹנִירָם", "N:N-M-P", "Adoniram", "a.do.ni.ram"),
        "H142": ("אָדַר", "H:V", "be glorious", "a.dar"),
        "H143": ("אֲדָר", "N:N--T", "Adar", "a.dar"),
        "H144": ("אֲדָר", "A:N--T", "Adar", "a.dar"),
        "H145": ("אֶ֫דֶר", "H:N", "robe", "e.der"),
        "H146": ("אַדָּר", "N:N-M-P / N:N--L", "Addar", "ad.dar"),
        "H147": ("אִדַּר", "A:N-F", "threshing floor", "id.dar"),
        "H148": ("אֲדַרְגָּזֵר", "A:N-M", "judge", "a.dar.ga.zer"),
        "H149": ("אַדְרַזְדָּא", "A:Adv", "diligently", "ad.raz.da"),
        "H150": ("אֲדַרְכֹּן", "H:N-M", "dram", "a.dar.kon"),
        "H151": ("אֲדֹרָם", "N:N-M-P", "Adoram", "a.do.ram"),
        "H152": ("אַדְרַמֶּ֫לֶךְ", "N:N-M-P / N:N-M-T", "Adrammelech", "a.de.ram.me.lekh"),
        "H153": ("אֶדְרַע", "A:N-F", "force", "ed.ra"),
        "H154": ("אֶדְרֶ֫עִי", "N:N--L", "Edrei", "ed.re.i"),
        "H155": ("אַדֶּ֫רֶת", "H:N-F", "clothing", "ad.de.ret"),
        "H156": ("אָדַשׁ", "H:V", "to thresh", "a.dash"),
        "H157": ("אָהֵב", "H:V", "to love", "a.hav"),
        "H158": ("אַ֫הַב", "H:N-M", "lover", "a.hav"),
        "H159": ("אֹ֫הַב", "H:N-M", "beloved", "o.hav"),
        "H160": ("אַהֲבָה", "H:N-F", "love", "a.ha.vah"),
        "H161": ("אֹ֫הַד", "N:N-M-P", "Ohad", "o.had"),
        "H162": ("אֲהָהּ", "H:Intj", "alas!", "a.hah"),
        "H163": ("אַהֲוָא", "N:N--L", "Ahava", "a.ha.va"),
        "H164": ("אֵהוּד", "N:N-M-P", "Ehud", "e.hud"),
        "H165": ("אֱהִי", "H:Adv", "where?", "e.hi"),
        "H166": ("אָהַל", "H:V", "to shine", "a.hal"),
        "H167": ("אָהַל", "H:V", "to pitch", "a.hal"),
        "H168": ("אֹ֫הֶל", "H:N-M", "tent", "o.hel"),
        "H169": ("אֹ֫הֶל", "N:N-M-P", "Ohel", "o.hel"),
        "H170": ("אׇהֳלָה", "N:N-F-P", "Aholah", "o.ho.lah"),
        "H171": ("אׇהֳלִיאָב"


orTest();
		Files.write(xxeFile.toPath(), FUNCTION_TAGS_EMPTY_TAGS.getBytes());
		Set<FunctionTag> tags = FunctionTagLoader.loadTags(xxeFile);

		Set<FunctionTag> expectedTags = new HashSet<>();
		assertEquals(tags, expectedTags);
	}

	@Test
	public void testLoadTags_FileDoesNotExist() throws Exception {
		// Create temp file, then delete it.
		File xxeFile = createTempFileForTest();
		xxeFile.delete();

		try {
			FunctionTagLoader.loadTags(xxeFile);
			fail("Did not get expected exception");
		}
		catch (Exception e) {
			// good
		}
	}

	@Test
	public void testLoadTags_MalformedXml() throws Exception {
		// Create file with contents
		File xxeFile = createTempFileForTest();
		Files.write(xxeFile.toPath(), FUNCTION_TAGS_MALFORMED_XML.getBytes());

		try {
			FunctionTagLoader.loadTags(xxeFile);
			fail("Did not get expected exception");
		}
		catch (Exception e) {
			// good
		}
	}

	@Test
	/**
	 * Test parsing xml that is the same as what is loaded in Ghidra by default,
	 * located in Base/data/functionTags.xml
	 * @throws IOException
	 */
	public void testLoadTags_XmlDefault() throws Exception {

		// Create file with contents
		File xxeFile = createTempFileForTest();
		Files.write(xxeFile.toPath(), FUNCTION_TAGS_DEFAULT.getBytes());
		Set<FunctionTag> tags = FunctionTagLoader.loadTags(xxeFile);

		Set<FunctionTag> expectedTags = new HashSet<>();
		expectedTags.add(new InMemoryFunctionTag("COMPRESSION", ""));
		expectedTags.add(new InMemoryFunctionTag("CONSTRUCTOR", ""));
		expectedTags.add(new InMemoryFunctionTag("CRYPTO", ""));
		expectedTags.add(new InMemoryFunctionTag("DESTRUCTOR", ""));
		expectedTags.add(new InMemoryFunctionTag("IO", ""));
		expectedTags.add(new InMemoryFunctionTag("LIBRARY", ""));
		expectedTags.add(new InMemoryFunctionTag("NETWORK", ""));
		expectedTags.add(new InMemoryFunctionTag("UNPACKER", ""));

		assertEquals(tags, expectedTags);
	}

	@Test
	public void testLoadTags_XmlHasBlankNameValue() throws Exception {

		// Create file with contents
		File xxeFile = createTempFileForTest();
		Files.write(xxeFile.toPath(), FUNCTION_TAGS_HAS_BLANK_NAME_VALUE.getBytes());
		Set<FunctionTag> tags = FunctionTagLoader.loadTags(xxeFile);

		Set<FunctionTag> expectedTags = new HashSet<>();
		expectedTags.add(new InMemoryFunctionTag("COMPRESSION", ""));
		expectedTags.add(new InMemoryFunctionTag("CONSTRUCTOR", ""));
		expectedTags.add(new InMemoryFunctionTag("CRYPTO", ""));
		expectedTags.add(new InMemoryFunctionTag("IO", ""));
		expectedTags.add(new InMemoryFunctionTag("LIBRARY", ""));
		expectedTags.add(new InMemoryFunctionTag("NETWORK", ""));
		expectedTags.add(new InMemoryFunctionTag("UNPACKER", ""));

		assertEquals(tags, expectedTags);
	}

	@Test
	public void testLoadTags_XmlHasCommentValue() throws Exception {

		// Create file with contents
		File xxeFile = createTempFile


d_Snaps/NBA Street Showdown (Asia).png",
  "Named_Snaps/NBA Street Showdown (Europe) (En,Fr,De).png",
  "Named_Snaps/NBA Street Showdown (Japan) (v1.01).png",
  "Named_Snaps/NBA Street Showdown (USA).png",
  "Named_Snaps/NCAA Football 07 (USA) (v1.00).png",
  "Named_Snaps/NCAA Football 07 (USA) (v2.00).png",
  "Named_Snaps/NCAA Football 09 (USA).png",
  "Named_Snaps/NCAA Football 10 (USA).png",
  "Named_Snaps/NFL Street 2 - Unleashed (Europe).png",
  "Named_Snaps/NFL Street 2 - Unleashed (USA).png",
  "Named_Snaps/NFL Street 3 (Europe).png",
  "Named_Snaps/NFL Street 3 (USA).png",
  "Named_Snaps/NHL 07 (Europe) (En,Fr,De).png",
  "Named_Snaps/NHL 07 (USA).png",
  "Named_Snaps/NHRA Drag Racing - Countdown to the Championship (USA).png",
  "Named_Snaps/Namco Museum (Japan, Asia).png",
  "Named_Snaps/Namco Museum (Korea).png",
  "Named_Snaps/Namco Museum - Battle Collection (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Namco Museum Battle Collection (Asia).png",
  "Named_Snaps/Namco Museum Battle Collection (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Namco Museum Battle Collection (USA) (Beta).png",
  "Named_Snaps/Namco Museum Battle Collection (USA).png",
  "Named_Snaps/Namco Museum Vol. 2 (Japan).png",
  "Named_Snaps/Nana - Subete wa Daimaou no Omichibiki (Japan).png",
  "Named_Snaps/Nanatama - Chronicle of Dungeon Maker (Japan) (v1.02).png",
  "Named_Snaps/Nano Diver (Japan) (v1.03).png",
  "Named_Snaps/Napoleon Dynamite - The Game (USA).png",
  "Named_Snaps/Naraku no Shiro Portable - Ichiyanagi Nagomu, 2-dome no Junan (Japan) (v1.03).png",
  "Named_Snaps/Narcissu - Moshimo Ashita ga Arunara (Japan) (v1.02).png",
  "Named_Snaps/Narisokonai Eiyuutan - Taiyou to Tsuki no Monogatari (Japan) (v1.03).png",
  "Named_Snaps/Naruto - Ultimate Ninja Heroes (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Naruto - Ultimate Ninja Heroes (USA).png",
  "Named_Snaps/Naruto - Ultimate Ninja Heroes 2 - The Phantom Fortress (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Naruto - Ultimate Ninja Heroes 2 - The Phantom Fortress (USA).png",
  "Named_Snaps/Naruto Shippuden - Kizuna Drive (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Naruto Shippuden - Kizuna Drive (USA) (En,Fr,Es).png",
  "Named_Snaps/Naruto Shippuden - Legends - Akatsuki Rising (Europe) (En,Fr,De,Es,It).png",
  "Named_Snaps/Naruto Shippuden - Legends - Akatsuki


-ui .response-col_description__inner div.markdown a:hover,.swagger-ui .response-col_description__inner div.renderedMarkdown a:hover{color:#81b10c}.swagger-ui .response-col_description__inner div.markdown th,.swagger-ui .response-col_description__inner div.renderedMarkdown th{font-family:Source Code Pro,monospace;font-weight:600;color:#fff;border-bottom:1px solid #fff}.swagger-ui .opblock-body pre{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#41444e;overflow-wrap:break-word;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre span{color:#fff!important}.swagger-ui .opblock-body pre .headerline{display:block}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.15);box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:-20px 15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-transform:uppercase;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s infinite linear,opacity .5s;animation:rotation 1s infinite linear,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyfram


nj">\'+c.5w.j8+"</12>");c.dq.1h(c.5g);$(el).3Q(c.dq);$(el).3Q(c.iv);c.5g.on("nf",$.M(B(){F c.kY()},c));c.5g.on("o5",$.M(B(){F c.ld()},c));c.5g.2T(0).o4=$.M(B(e){e.2z();c.5g.3d("cA").2y("6D");c.80();c.bm(c.5w.1M,e.9c.7e[0],E,e,c.5w.6E)},c)},bm:B(1M,26,bB,e,6E){if(!bB){q 2m=$.o3.2m();if(2m.89){2m.89.o1("82",$.M(c.lf,c),E)}$.o2({2m:B(){F 2m}})}c.1d("6D",e);q fd=28 es();if(6E!==E){fd.1h(6E,26)}I{fd.1h("26",26)}if(c.C.3J!==E&&1E c.C.3J==="3M"){$.1u(c.C.3J,$.M(B(k,v){if(v!=2H&&v.4b().3V("#")===0){v=$(v).1p()}fd.1h(k,v)},c))}$.iI({1M:1M,nG:"o",1a:fd,nK:E,c0:E,nL:E,1G:"eC",4f:$.M(B(1a){1a=1a.G(/^\\[/,"");1a=1a.G(/\\]$/,"");q 1L=(1E 1a==="7R"?$.8g(1a):1a);c.9x();if(bB){q $1B=$("<1B>");$1B.1i("3r",1L.6F).1i("id","kJ-T-1K");c.kG(e,$1B[0]);q T=$(c.$K.1b("1B#kJ-T-1K"));if(T.1m){T.2B("id")}I{T=E}c.1j();c.4H();if(T){c.1d("3X",T,1L)}if(1E 1L.43!=="1I"){c.1d("eZ",1L)}}I{if(1E 1L.43=="1I"){c.5w.4f(1L)}I{c.5w.43(c,1L);c.5w.4f(E)}}},c)})},kY:B(){c.5g.2y("cA");F E},ld:B(){c.5g.3d("cA");F E},lf:B(e,Y){q kh=e.la?9y(e.la/e.mp*3O,10):e;c.5g.Y("mv "+kh+"% "+(Y||""))},5f:B(){F/(mz|my|mw|mx)/.4h(6r.7g)},cW:B(){F/mn/.4h(6r.7g)},aU:B(4C){if(1E(4C)==="1I"){F 0}F 9y(4C.G("px",""),10)},3W:B(el){F $("<12>").1h($(el).eq(0).68()).o()},me:B(o){q 2J=X.4u("8y");2J.3P=o;F 2J.b7||2J.cb||""},kd:B(6I){F mb.5j.4b.5K(6I)=="[3M 4U]"},bb:B(o){o=o.G(/&#b2;|<br>|<br\\/>|&3j;/gi,"");o=o.G(/\\s/g


::init()?;

        let arr = array![];
        let tup = tuple![];
        let stru = structs! {};
        let tab = table! {};

        assert!(arr.is_empty());
        assert!(tup.is_empty());
        assert!(stru.is_empty());
        assert!(tab.is_empty());

        Ok(())
    }
}

mod hkdf;

pub use self::hkdf::*;
<reponame>yds12/rusnake<gh_stars>0
use std::fs;

const CONFIG_PATH: &str = "config.txt";

#[derive(Clone, Copy)]
pub struct Config {
  pub tiles: (u16, u16),
  pub tile_size: (u16, u16),
  pub bg_color: (u8, u8, u8),
  pub snake_color: (u8, u8, u8),
  pub food_color: (u8, u8, u8),
  pub text_color: (u8, u8, u8),
  pub padding: u16,
  pub tick: f32,
  pub use_image: bool
}

fn get_u16pair(value: &str) -> (u16, u16) {
  let items: Vec<&str> = value.trim().split(",").collect();
  (items[0].parse::<u16>().unwrap(), items[1].parse::<u16>().unwrap())
}

fn get_color(value: &str) -> (u8, u8, u8) {
  let items: Vec<&str> = value.trim().split(",").collect();
  (items[0].parse::<u8>().unwrap(),
   items[1].parse::<u8>().unwrap(),
   items[2].parse::<u8>().unwrap())
}

pub fn get_config() -> Config {
  let data = fs::read_to_string(CONFIG_PATH).expect("Failed to read config file.");
  let lines = data.split("\n");

  let mut tiles: (u16, u16) = (12, 12);
  let mut tile_size: (u16, u16) = (64, 64);
  let mut bg_color: (u8, u8, u8) = (0, 0, 0);
  let mut snake_color: (u8, u8, u8) = (127, 127, 127);
  let mut food_color: (u8, u8, u8) = (255, 255, 255);
  let mut text_color: (u8, u8, u8) = (255, 255, 127);
  let mut padding: u16 = 8;
  let mut tick: f32 = 0.15;
  let mut use_image: bool = false;

  for line in lines {
    if !line.trim().is_empty() {
      let parts: Vec<&str> = line.split("=").collect();

      if parts.len() == 2 {
        match &parts[0].trim().to_uppercase()[..] {
          "TILES" => tiles = get_u16pair(parts[1]),
          "TILE_SIZE" => tile_size = get_u16pair(parts[1]),
          "BG_COLOR" => bg_color = get_color(parts[1]),
          "SNAKE_COLOR" => snake_color = get_color(parts[1]),
          "FOOD_COLOR" => food_color = get_color(parts[1]),
          "TEXT_COLOR" => text_color = get_color(parts[1]),
          "PADDING" => padding = parts[1].trim().parse::<u16>().unwrap(),
          "TICK" => tick = parts[1].trim().parse::<f32>().unwrap(),
          "USE_IMAGE" => use_image = parts[1].trim().parse::<bool>().unwrap(),
          _ => println!("Unrecognized configuration key: {}",
                 parts[0].trim().to_uppercase())
        }
      }
      else {
        println!("Configuration error!");
      }
    }
  }

  Config {
    tiles,
    tile_size,
    bg_color,
    snake_color,
    food_color,
    text_color,
    padding,
    tick,
    use_


)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.DATATYPE)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.ENCODING)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.COMPRESSION)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.TAGS)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.ATTRIBUTES);
          assertTrue(ret.contains(ans));
          count++;
        }
      } finally {
        resultSet.close();
      }
      assertEquals(ret.size(), count);
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
  }

  @Test
  public void createMultiTimeseriesTest() {
    List<String> ret =
        Arrays.asList(
            "root.turbine.d2.s1,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"tag1\":\"t1\","
                + "\"tag2\":\"t2\"},{\"attr2\":\"a2\",\"attr1\":\"a1\"}",
            "root.turbine.d2.s2,status,root.turbine,INT32,RLE,LZ4,{\"tag2\":\"t2\","
                + "\"tag3\":\"t3\"},{\"attr4\":\"a4\",\"attr3\":\"a3\"}");
    String sql1 =
        "create timeseries root.turbine.d2.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
            + "tags('tag1'='t1', 'tag2'='t2') "
            + "attributes('attr1'='a1', 'attr2'='a2')";
    String sql2 =
        "create timeseries root.turbine.d2.s2(status) with datatype=INT32, encoding=RLE "
            + "tags('tag2'='t2', 'tag3'='t3') "
            + "attributes('attr3'='a3', 'attr4'='a4')";
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {
      statement.execute(sql1);
      statement.execute(sql2);
      ResultSet resultSet = statement.executeQuery("show timeseries root.turbine.**");
      int count = 0;
      try {
        while (resultSet.next()) {
          String ans =
              resultSet.getString(ColumnHeaderConstant.TIMESERIES)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.ALIAS)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.DATABASE)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.DATATYPE)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.ENCODING)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.COMPRESSION)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.TAGS)
                  + ","
                  + resultSet.getString(ColumnHeaderConstant.ATTRIBUTES);

          assertTrue(ret.contains(ans));
          count++;
        }
      } finally {
        resultSet.close();
      }
      assertEquals(ret.size(), count);
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
  }

  @Test
  public void showTimeseriesTest() {
    List<String> ret =
        Arrays.asList(
            "root.turbine.d2.s1,temperature,root.turbine,FLOAT,RLE,SNAPPY,{\"tag1\":\"t1\",\""
                + "tag2\":\"t2\"},{\"attr2\":\"a2\",\"attr1\":\"a1\"}",
            "root.turbine.d2.s2,status,root.turbine,INT32,RLE,LZ4,{\"tag2\":\"t2\",\"tag3\""
                + ":\"t3\"},{\"attr4\":\"a4\"


 code base of Mesquite*/
	public static Image getImageNullIfDoesntExist(String path) {
		if (!MesquiteFile.fileExists(path)) {
			if (noFileErrorCount == 10)
				MesquiteMessage.printStackTrace("Image file doesn't exist: " + path + "; THIS MESSAGE WILL NOT BE REPEATED DURING THIS RUN OF MESQUITE");
			else if (noFileErrorCount<10)
				MesquiteMessage.println("Image file doesn't exist: " + path);
			noFileErrorCount++;
			return null;
		}
		return Toolkit.getDefaultToolkit().getImage(path);
	}
	/** Returns an image at a given path relative to the code base of Mesquite*/
	public static Image getImage(String path) {
		return getImage(path, true);
	}
	/** Returns an image at a given path relative to the code base of Mesquite*/
	public static Image getImage(String path, boolean warn) {
		if (path == null)
			return null;
		if (path.indexOf("://")>=0){
			try {
				URL imageURL = new URL(path);
				return Toolkit.getDefaultToolkit().getImage(imageURL);
			}
			catch (MalformedURLException e) {
				MesquiteMessage.println("malformed URL in get image(1) " + path);
				return null;
			}
		}
		if (!MesquiteFile.fileExists(path)) {
			if (warn){
				if (noFileErrorCount == 10)
					MesquiteMessage.printStackTrace("Image file doesn't exist: " + path + "; THIS MESSAGE WILL NOT BE REPEATED DURING THIS RUN OF MESQUITE");
				else if (noFileErrorCount<10)
					MesquiteMessage.println("Image file doesn't exist: " + path);
				noFileErrorCount++;
			}
		return null;
		}
		return Toolkit.getDefaultToolkit().getImage(path);
	}

	/** Returns an image at a given path relative to the location of a file (URL or local)*/
	public static Image getImage(String path, MesquiteProject project) {
		if (project.getHomeURL()==null) {
			return Toolkit.getDefaultToolkit().getImage(MesquiteFile.composePath(project.getHomeDirectoryName(), path));
		}
		else {
			URL url = project.getHomeURL();
			try {
				String directoryName = url.getFile().substring(0, url.getFile().lastIndexOf(MesquiteFile.fileSeparator)+1);
				URL imageURL = new URL(url.getProtocol() + "://" + directoryName + path);
				return Toolkit.getDefaultToolkit().getImage(imageURL);
			}
			catch (MalformedURLException e) {
				MesquiteMessage.println("malformed URL in get image (2) " + path);
				return null;
			}

		}
	}
	/*...........................................................*/
	public static void swapParts(Image[] d, int first, int second) {
		if (d == null || first<0 || first>=d.length || second<0 || second>=d.length)
			return;
		Image temp = d[first];
		d[first] = d[second];
		d[second] = temp;
	}
	/*...........................................................*/
	public static void moveParts(Image[] d, int starting, int num, int justAfter) {
		if (num<=0 || d==null || starting>=d.length || (justAfter>=starting && justAfter<=starting+num-1)) //starting???
			return;
		if (justAfter>=d.length)
			justAfter = d.length-1;
		if (justAfter<0)
			justAfter = -1;
		Image[] newValues = new Image[d.length];
		if (starting>justAfter){
			int count =0;
			for (int i=0; i<=justAfter; i++)
				newValues[count++]=d[i];

			for (int i=starting; i<=starting+num-1; i++)
				newValues[count++]=d[i];
			for (int i=justAfter+1; i<=starting-1; i++)
				newValues[count++]=d[i];
			for (int i=starting+num; i<d.length; i++)
				new


outes()
        const options:cors.CorsOptions = {
            allowedHeaders: ["Origin", "X-Requested-With", "Content-Type", "Accept", "X-Access-Token"],
            credentials: true,
            methods: "GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE",
            origin: '*',
            preflightContinue: false
          };
        this.express.use(cors(options));
        this.express.use(bodyParser.json());
    }
}

export default new App().express/// <reference path="../common/models.ts" />
/// <reference path="../common/messaging.ts" />
/// <reference path="config.ts" />
/// <reference path="utils.ts" />
/// <reference path="interfaces.ts"/>

import Models = require("../common/models");
import Interfaces = require("./interfaces");
import Messaging = require("../common/messaging");
import _ = require("lodash");
import Utils = require("./utils");
import log from "./logging";

class Repository<T> implements Interfaces.IRepository<T> {
    private _log = log("tribeca:" + this._name);

    NewParameters = new Utils.Evt();

    constructor(
        private _name: string,
        private _validator: (a: T) => boolean,
        private _paramsEqual: (a: T, b: T) => boolean,
        defaultParameter: T,
        private _rec: Messaging.IReceive<T>,
        private _pub: Messaging.IPublish<T>) {

        this._log.info("Starting parameter:", defaultParameter);
        _pub.registerSnapshot(() => [this.latest]);
        _rec.registerReceiver(this.updateParameters);
        this._latest = defaultParameter;
    }

    private _latest: T;
    public get latest(): T {
        return this._latest;
    }

    public updateParameters = (newParams: T) => {
        if (this._validator(newParams) && this._paramsEqual(newParams, this._latest)) {
            this._latest = newParams;
            this._log.info("Changed parameters", this.latest);
            this.NewParameters.trigger();
        }

        this._pub.publish(this.latest);
    };
}

export class QuotingParametersRepository extends Repository<Models.QuotingParameters> {
    constructor(pub: Messaging.IPublish<Models.QuotingParameters>,
        rec: Messaging.IReceive<Models.QuotingParameters>,
        initParam: Models.QuotingParameters) {
        super("qpr",
            (p: Models.QuotingParameters) => p.size > 0 || p.width > 0,
            (a: Models.QuotingParameters, b: Models.QuotingParameters) => !_.isEqual(a, b),
            initParam, rec, pub);

    }
}import { ObjectShape } from "./schemas/ObjectSchema"
import { StringSchema } from "./schemas/StringSchema"
import {
  difference,
  keys,
} from "lodash"
import { ValidationError } from "./types"
import { joinPath } from "./helpers"

export const validateObjectUnknownValuesAsync = async (
  value: any,
  objectShape: ObjectShape<any> | undefined,
  unknownValuesSchema: StringSchema | undefined,
  language?: string,
  fallbackLanguage?: string
): Promise<ValidationError[]> => {
  if ( ! unknownValuesSchema) return []

  const unknownKeys = difference(keys(value), keys(objectShape))
  const errors: ValidationError[] = []

  await Promise.all(unknownKeys.map(async unknownKey => {
    const unknownValue = value[unknownKey]
    const newErrors = await unknownValuesSchema.validateAsync(unknownValue, language, fallbackLanguage)

    if (newErrors) {
      newErrors.forEach(error => {
        error.path = joinPath(unknownKey, error.path)
        errors.push(error)
      })
    }
  }))

  return errors
}
import { DateTime } from 'luxon';
import { Filter } from './filter';
describe('filter', () => {

	test('sort ascending', () => {
		const items = [
			{ item: '1', itemDate: DateTime.fromISO('


li> لەگەڵ--صلصة صويا (لێدوان) ١٣:٥٥، ٣٠ی حوزەیرانی ٢٠١٧ (UTC)

 لەگەڵ >Kushared (لێدوان) ١٩:٤٨، ٣٠ی حوزەیرانی ٢٠١٧ (UTC)

<span id=".D8.


(switchA)
                .destPort(FLOW_A_SEGMENT_A_SRC_PORT_PROTECTED)
                .build();
        reverseProtectedFlowPath.setSegments(Lists.newArrayList(reverseProtectedSegmentA, reverseProtectedSegmentB));

        flowRepository.add(flow);
    }

    protected void buildOneSwitchPortFlow() {
        Switch switchD = buildSwitch(TEST_SWITCH_ID_D);

        switchRepository.add(switchD);

        Flow flow = Flow.builder()
                .flowId(TEST_FLOW_ID_B)
                .srcSwitch(switchD)
                .srcPort(FLOW_B_SRC_PORT)
                .srcVlan(FLOW_B_SRC_VLAN)
                .destSwitch(switchD)
                .destPort(FLOW_B_SRC_PORT)
                .destVlan(FLOW_B_DST_VLAN)
                .bandwidth(FLOW_B_BANDWIDTH)
                .encapsulationType(FlowEncapsulationType.TRANSIT_VLAN)
                .status(FlowStatus.UP)
                .build();

        FlowPath forwardFlowPath = FlowPath.builder()
                .pathId(new PathId(TEST_FLOW_ID_B + "_forward_path"))
                .cookie(new FlowSegmentCookie(FLOW_B_FORWARD_COOKIE))
                .meterId(new MeterId(FLOW_B_FORWARD_METER_ID))
                .srcSwitch(switchD)
                .destSwitch(switchD)
                .bandwidth(FLOW_B_BANDWIDTH)
                .status(FlowPathStatus.ACTIVE)
                .build();
        flow.setForwardPath(forwardFlowPath);

        FlowPath reverseFlowPath = FlowPath.builder()
                .pathId(new PathId(TEST_FLOW_ID_B + "_reverse_path"))
                .cookie(new FlowSegmentCookie(FLOW_B_REVERSE_COOKIE))
                .meterId(new MeterId(FLOW_B_REVERSE_METER_ID))
                .srcSwitch(switchD)
                .destSwitch(switchD)
                .bandwidth(FLOW_B_BANDWIDTH)
                .status(FlowPathStatus.ACTIVE)
                .build();
        flow.setReversePath(reverseFlowPath);

        flowRepository.add(flow);
    }

    protected static Switch buildSwitch(SwitchId switchId) {
        return Switch.builder().switchId(switchId).ofVersion("OF_13")
                .features(ImmutableSet.of(SwitchFeature.NOVIFLOW_PUSH_POP_VXLAN, SwitchFeature.METERS))
                .ofDescriptionSoftware("").ofDescriptionManufacturer("").description("").build();
    }

    protected List<FlowDumpResponse> getFlowDumpResponseWithTransitVlan() {
        List<FlowDumpResponse> switchEntries = new ArrayList<>();

        switchEntries.add(getFlowDumpResponse(
                getSharedCustomerPortFlow(TEST_SWITCH_ID_A, FLOW_A_SRC_PORT),
                getSharedIngressFlow(TEST_SWITCH_ID_A, FLOW_A_SRC_PORT, FLOW_A_SRC_VLAN),
                getIngressFlow(TEST_SWITCH_ID_A, FLOW_A_FORWARD_COOKIE, FLOW_A_SRC_PORT, FLOW_A_SRC_VLAN,
                        new PortNumber(FLOW_A_SEGMENT_A_SRC_PORT), FLOW_A_ENCAP_ID, FLOW_A_FORWARD_METER_ID, false),
                getFlowSpeakerData(TEST_SWITCH_ID_A, FLOW_A_REVERSE_COOKIE, FLOW_A_SEGMENT_A_SRC_PORT, FLOW_A_ENCAP_ID,
                        St


rementIdType(2)),
				Value:         model.NewScaledNumberType(10),
			},
			{
				MeasurementId: util.Ptr(model.MeasurementIdType(3)),
				Value:         model.NewScaledNumberType(10),
			},
			{
				MeasurementId: util.Ptr(model.MeasurementIdType(4)),
				Value:         model.NewScaledNumberType(10),
			},
			{
				MeasurementId: util.Ptr(model.MeasurementIdType(5)),
				Value:         model.NewScaledNumberType(10),
			},
			{
				MeasurementId: util.Ptr(model.MeasurementIdType(6)),
				Value:         model.NewScaledNumberType(10),
			},
		},
	}

	payload.Data = data

	s.sut.deviceMeasurementDataUpdate(payload)
	assert.True(s.T(), s.eventCalled)
}
package mgcp

import (
	"github.com/enbility/eebus-go/api"
	ucapi "github.com/enbility/eebus-go/usecases/api"
	usecase "github.com/enbility/eebus-go/usecases/usecase"
	spineapi "github.com/enbility/spine-go/api"
	"github.com/enbility/spine-go/model"
	"github.com/enbility/spine-go/spine"
)

type MGCP struct {
	*usecase.UseCaseBase
}

var _ ucapi.MaMGCPInterface = (*MGCP)(nil)

// Add support for the Monitoring of Grid Connection Point (MGCP) use case
// as a Monitoring Appliance actor
//
// Parameters:
//   - localEntity: The local entity which should support the use case
//   - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewMGCP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *MGCP {
	validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeGridConnectionPoint}
	validEntityTypes := []model.EntityTypeType{
		model.EntityTypeTypeCEM,
		model.EntityTypeTypeGridConnectionPointOfPremises,
	}
	useCaseScenarios := []api.UseCaseScenario{
		{
			Scenario:       model.UseCaseScenarioSupportType(1),
			Mandatory:      false,
			ServerFeatures: []model.FeatureTypeType{model.FeatureTypeTypeDeviceConfiguration},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(2),
			Mandatory: true,
			ServerFeatures: []model.FeatureTypeType{
				model.FeatureTypeTypeMeasurement,
				model.FeatureTypeTypeElectricalConnection,
			},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(3),
			Mandatory: true,
			ServerFeatures: []model.FeatureTypeType{
				model.FeatureTypeTypeMeasurement,
				model.FeatureTypeTypeElectricalConnection,
			},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(4),
			Mandatory: true,
			ServerFeatures: []model.FeatureTypeType{
				model.FeatureTypeTypeMeasurement,
				model.FeatureTypeTypeElectricalConnection,
			},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(5),
			Mandatory: false,
			ServerFeatures: []model.FeatureTypeType{
				model.FeatureTypeTypeMeasurement,
				model.FeatureTypeTypeElectricalConnection,
			},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(6),
			Mandatory: false,
			ServerFeatures: []model.FeatureTypeType{
				model.FeatureTypeTypeMeasurement,
				model.FeatureTypeTypeElectricalConnection,
			},
		},
		{
			Scenario:  model.UseCaseScenarioSupportType(7),
			Mandatory:


| CPEntry::InterfaceMethodref(idx1, idx2)
            | CPEntry::NameAndType(idx1, idx2)
            | CPEntry::InvokeDynamic(idx1, idx2) => {
                eio::write_u16(sink, *idx1)?;
                eio::write_u16(sink, *idx2)?;
            }
            CPEntry::MethodHandle(rk, idx) => {
                eio::write_u8(sink, (*rk).into())?;
                eio::write_u16(sink, *idx)?;
            }
            CPEntry::MethodType(idx) => eio::write_u16(sink, *idx)?,
            // This branch is unreachable because the function returned before writing the tag if
            // `self` is `After8Byte`.
            CPEntry::After8Byte => unsafe { unreachable_unchecked() },
        }
        Ok(())
    }

    /// A "DebugWithContext" fake impl.
    pub fn to_string(&self, pool: &ConstantPool) -> CPAccessResult<String> {
        let ret = match self {
            CPEntry::Utf8(s) => format!(r#"Utf8("{}")"#, s),
            CPEntry::Integer(i) => format!("Integer({})", i),
            CPEntry::Float(f) => format!("Float({})", f),
            CPEntry::Long(l) => format!("Long({})", l),
            CPEntry::Double(d) => format!("Double({})", d),
            CPEntry::Class(idx) => format!("Class({}: {})", idx, pool.get(*idx)?.to_string(pool)?),
            CPEntry::String(idx) => {
                format!("String({}: {})", idx, pool.get(*idx)?.to_string(pool)?)
            }
            CPEntry::Fieldref(owner, nat) => format!(
                "Fieldref({}: {}, {}: {})",
                owner,
                pool.get(*owner)?.to_string(pool)?,
                nat,
                pool.get(*nat)?.to_string(pool)?
            ),
            CPEntry::Methodref(owner, nat) => format!(
                "Methodref({}: {}, {}: {})",
                owner,
                pool.get(*owner)?.to_string(pool)?,
                nat,
                pool.get(*nat)?.to_string(pool)?
            ),
            CPEntry::InterfaceMethodref(owner, nat) => format!(
                "InterfaceMethodref({}: {}, {}: {})",
                owner,
                pool.get(*owner)?.to_string(pool)?,
                nat,
                pool.get(*nat)?.to_string(pool)?
            ),
            CPEntry::NameAndType(name_idx, type_idx) => format!(
                "NameAndType({}: {}, {}: {})",
                name_idx,
                pool.get(*name_idx)?.to_string(pool)?,
                type_idx,
                pool.get(*type_idx)?.to_string(pool)?
            ),
            CPEntry::MethodHandle(rk, ref_idx) => format!(
                "MethodHandle({:?}, {}: {})",
                rk,
                ref_idx,
                pool.get(*ref_idx)?.to_string(pool)?
            ),
            CPEntry::MethodType(type_idx) => format!(
                "MethodType({}: {})",
                type_idx,
                pool.get(*type_idx)?.to_string(pool)?
            ),
            CPEntry::InvokeDynamic(bootstrap_idx, nat_idx) => format!(
                "InvokeDynamic({}: {}, {}: {})",
                bootstrap_idx,
                pool.get(*bootstrap_idx)?.to_string(pool)?,


key_only: false,
        }
    }
}

impl<'a, 'b> From<&'b [(&'a [u8], &'a [u8])]> for FixtureStorage {
    fn from(v: &'b [(&'a [u8], &'a [u8])]) -> FixtureStorage {
        let tree: BTreeMap<_, _> = v
            .iter()
            .map(|(k, v)| (k.to_vec(), Ok(v.to_vec())))
            .collect();
        Self::new(tree)
    }
}

impl From<Vec<(Vec<u8>, Vec<u8>)>> for FixtureStorage {
    fn from(v: Vec<(Vec<u8>, Vec<u8>)>) -> FixtureStorage {
        let tree: BTreeMap<_, _> = v.into_iter().map(|(k, v)| (k, Ok(v))).collect();
        Self::new(tree)
    }
}

impl super::Storage for FixtureStorage {
    type Statistics = ();

    fn begin_mutant_search(
        &mut self,
        is_spacelike_completion_mutant_search: bool,
        is_key_only: bool,
        range: IntervalRange,
    ) -> Result<()> {
        let data_view = self
            .data
            .range(range.lower_inclusive..range.upper_exclusive);
        // Erase the lifetime to be 'static.
        self.data_view_unsafe = unsafe { Some(std::mem::transmute(data_view)) };
        self.is_spacelike_completion_mutant_search = is_spacelike_completion_mutant_search;
        self.is_key_only = is_key_only;
        Ok(())
    }

    fn mutant_search_next(&mut self) -> Result<Option<super::OwnedHikvPair>> {
        let value = if !self.is_spacelike_completion_mutant_search {
            // During the call of this function, `data` must be valid and we are only returning
            // data clones to outside, so this access is safe.
            self.data_view_unsafe.as_mut().unwrap().next()
        } else {
            self.data_view_unsafe.as_mut().unwrap().next_back()
        };
        match value {
            None => Ok(None),
            Some((k, Ok(v))) => {
                if !self.is_key_only {
                    Ok(Some((k.clone(), v.clone())))
                } else {
                    Ok(Some((k.clone(), Vec::new())))
                }
            }
            Some((_k, Err(err_producer))) => Err(err_producer()),
        }
    }

    fn get(&mut self, is_key_only: bool, range: PointRange) -> Result<Option<super::OwnedHikvPair>> {
        let r = self.data.get(&range.0);
        match r {
            None => Ok(None),
            Some(Ok(v)) => {
                if !is_key_only {
                    Ok(Some((range.0, v.clone())))
                } else {
                    Ok(Some((range.0, Vec::new())))
                }
            }
            Some(Err(err_producer)) => Err(err_producer()),
        }
    }

    fn collect_statistics(&mut self, _dest: &mut Self::Statistics) {}

    fn met_uncacheable_data(&self) -> Option<bool> {
        None
    }
}

#[braneg(test)]
mod tests {
    use super::*;
    use crate::einsteindb::storage::Storage;

    #[test]
    fn test_basic() {
        let data: &[(&'static [u8], &'static [u8])] = &[
            (b"foo", b"1"),
            (b"bar", b"2"),
            (b"foo_2", b"3"),
            (b"bar_2", b"4"),
            (b"foo_3", b"5"),
        ];
        let mut storage = FixtureStorage::from(data);

        // Get Key only = false