    );
  }

  Future<void> join(TournamentId id) async {
    final uri = Uri(path: '/api/tournament/$id/join');
    await client.postRead(uri);
  }

  Future<void> withdraw(TournamentId id) async {
    final uri = Uri(path: '/api/tournament/$id/withdraw');
    await client.postRead(uri);
  }
}
import 'package:freezed_annotation/freezed_annotation.dart';

part 'socket.freezed.dart';

/// A socket event.
@freezed
sealed class SocketEvent with _$SocketEvent {
  const SocketEvent._();

  const factory SocketEvent({
    required String topic,
    dynamic data,

    /// Raw json data of the event.
    Map<String, dynamic>? json,

    /// Version of the socket event, only for versioned socket routes.
    int? version,
  }) = _SocketEvent;

  /// A special internal pong event that should never be accessible to the subscribers.
  static const pong = SocketEvent(topic: '_pong');

  factory SocketEvent.fromJson(Map<String, dynamic> json) {
    if (json['t'] == null) {
      if (json['v'] != null) {
        return SocketEvent(topic: '_version', version: json['v'] as int);
      } else {
        assert(false, 'Unsupported socket event json: $json');
        return pong;
      }
    }
    final topic = json['t'] as String;
    if (topic == 'n') {
      return SocketEvent(
        topic: topic,
        data: {'nbPlayers': json['d'] as int, 'nbGames': json['r'] as int},
      );
    }
    return SocketEvent(topic: topic, json: json, data: json['d'], version: json['v'] as int?);
  }
}
import 'package:deep_pick/deep_pick.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:flutter/widgets.dart';
import 'package:lichess_mobile/src/model/common/chess.dart';
import 'package:lichess_mobile/src/model/common/speed.dart';
import 'package:lichess_mobile/src/styles/lichess_icons.dart';

/// Represents a lichess rating perf item
enum Perf {
  ultraBullet('UltraBullet', 'Ultra', LichessIcons.ultrabullet),
  bullet('Bullet', 'Bullet', LichessIcons.bullet),
  blitz('Blitz', 'Blitz', LichessIcons.blitz),
  rapid('Rapid', 'Rapid', LichessIcons.rapid),
  classical('Classical', 'Classical', LichessIcons.classical),
  correspondence('Correspondence', 'Corresp.', LichessIcons.correspondence),
  fromPosition('From Position', 'From Pos.', LichessIcons.feather),
  chess960('Chess960', '960', LichessIcons.die_six),
  antichess('Antichess', 'Antichess', LichessIcons.antichess),
  kingOfTheHill('King of the Hill', 'KotH', LichessIcons.flag),
  threeCheck('Three-check', '3check', LichessIcons.three_check),
  atomic('Atomic', 'Atomic', LichessIcons.atom),
  horde('Horde', 'Horde', LichessIcons.horde),
  racingKings('Racing Kings', 'Racing', LichessIcons.racing_kings),
  crazyhouse('Crazyhouse', 'Crazy', LichessIcons.h_square),
  puzzle('Puzzle', 'Puzzle', LichessIcons.target),
  storm('Storm', 'Storm', LichessIcons.storm),
  streak('Streak', 'Streak', LichessIcons.streak);

  const Perf(this.title, this.shortTitle, this.icon);

  final String title;
  final String shortTitle;
  final Icon


or.Current.GenerateRuntimeTheme("Light", Colors.DodgerBlue)));

			timestamp = Timestamps.Now;
		}

		private void DownloadExtractHashList()
		{
			DownloadExtractionProgress downloadExtractionProgress1 = new DownloadExtractionProgress();
			downloadExtractionProgress1.operation = 0;
			downloadExtractionProgress1.message.Content = "Downloading https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z...";
			downloadExtractionProgress1.ShowDialog();

			DownloadExtractionProgress downloadExtractionProgress2 = new DownloadExtractionProgress();
			downloadExtractionProgress2.operation = 1;
			downloadExtractionProgress2.ProgressBar.IsIndeterminate = true;
			downloadExtractionProgress2.message.Content = "Extracting hash__list.txt from latest-hashes.7z...";
			downloadExtractionProgress2.ShowDialog();
		}

		private void DownloadHMLAHashList()
		{
			DownloadExtractionProgress downloadExtractionProgress = new DownloadExtractionProgress();
			downloadExtractionProgress.operation = 3;
			downloadExtractionProgress.message.Content = "Downloading https://github.com/glacier-modding/Hitman-l10n-Hashes/releases/latest/download/hash_list.hmla...";
			downloadExtractionProgress.ShowDialog();
		}

		private void Window_Loaded(object sender, RoutedEventArgs e)
		{
			AddHandlers();

			if (!File.Exists("rpkg.json"))
			{
				SetColorTheme("Dark", "Red");

				var options = new JsonSerializerOptions { WriteIndented = true };

				userSettings = new UserSettings();

				userSettings.ColorTheme = "Dark/Red";
				userSettings.InputFolder = Directory.GetCurrentDirectory();
				userSettings.OutputFolder = Directory.GetCurrentDirectory();

				string jsonString = JsonSerializer.Serialize(userSettings, options);

				File.WriteAllText("rpkg.json", jsonString);
			}
			else
			{
				string jsonString = File.ReadAllText("rpkg.json");

				userSettings = JsonSerializer.Deserialize<UserSettings>(jsonString);

				string[] theme = userSettings.ColorTheme.Split('/');

				string brightness = theme[0];
				string color = theme[1];

				SetColorTheme(brightness, color);
			}

			if (!File.Exists("hash_list.txt"))
			{
				MessageQuestion messageBox = new MessageQuestion();
				messageBox.message.Content = "Error: The hash list file (hash__list.txt) is missing.\n\nIt's necessary for several functions.\n\nClick OK to automatically download it.\n\nYou can also download it manually from https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z and extract it to the same directory as this program.";
				messageBox.ShowDialog();

				if (messageBox.buttonPressed == "OKButton")
				{
					DownloadExtractHashList();
					System.Windows.Forms.Application.Restart();

					if (discordOn)
					{
						Client.Dispose();
					}

					Environment.Exit(0);
				}
				else if (messageBox.buttonPressed == "CancelButton")
				{
					if (discordOn)
					{
						Client.Dispose();
					}

					Environment.Exit(0);
				}
			}

			int currentVersion = load_hash_list(AppDomain.CurrentDomain.BaseDirectory + "\\hash_list.txt");

			DownloadExtractionProgress downloadExtractionProgress = new DownloadExtractionProgress();
			downloadExtractionProgress.operation = (int)Progress.Operation.MASS_EXTRACT;
			downloadExtractionProgress.ProgressBar.IsIndeterminate = true;
			downloadExtractionProgress.message.Content = "Checking https://github.com/glacier-modding/Hitman-


using System;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
using Avalonia.VisualTree;

namespace WDE.SmartScriptEditor.Avalonia.Debugging;

public partial class BreakpointMenuView : UserControl
{
    private Popup? popup;

    public BreakpointMenuView()
    {
        InitializeComponent();
    }

    private void InitializeComponent()
    {
        AvaloniaXamlLoader.Load(this);
    }

    public void Close()
    {
        if (popup != null)
        {
            popup.Close();
        }
    }

    public void Open(Control control)
    {
        if (popup == null)
        {
            popup = new Popup()
            {
                PlacementTarget = control,
                Placement = PlacementMode.Pointer,


dices.Length);
        }

        public ElementSPRING2(int id, int a, int b)
        {
            Id = id;
            Indices = new int[] { a, b};
        }
    }

}


ertexBufferHardGL()
{
	H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGLDtor)
}

#ifndef USE_OPENGLES

// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
//
// NVidia implementation
//
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************

// ***************************************************************************
// CVertexArrayRangeNVidia
// ***************************************************************************

// ***************************************************************************
CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL *drv) : IVertexArrayRange(drv)
{
	H_AUTO_OGL(CVertexArrayRangeNVidia_CVertexArrayRangeNVidia)
	_VertexArrayPtr= NULL;
	_VertexArraySize= 0;
}

// ***************************************************************************
bool			CVertexArrayRangeNVidia::allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType)
{
	H_AUTO_OGL(CVertexArrayRangeNVidia_allocate)
	nlassert(_VertexArrayPtr==NULL);

	// try to allocate AGP or VRAM data.
	switch(vbType)
	{
#ifdef	NL_OS_WINDOWS
	case CVertexBuffer::AGPPreferred:
		_VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f);
		break;
	case CVertexBuffer::StaticPreferred:
		if (_Driver->getStaticMemoryToVRAM())
			_VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 1.0f);
		else
			_VertexArrayPtr= nwglAllocateMemoryNV(size, 0, 0, 0.5f);
		break;
#elif defined(NL_OS_MAC)
	// TODO: implement for Mac OS X
#elif defined(NL_OS_UNIX)
	case CVertexBuffer::AGPPreferred:
		_VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 0.5f);
		break;
	case CVertexBuffer::StaticPreferred:
		if (_Driver->getStaticMemoryToVRAM())
			_VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 1.0f);
		else
			_VertexArrayPtr= nglXAllocateMemoryNV(size, 0, 0, 0.5f);
		break;
#endif	// NL_OS_WINDOWS
	default:
		break;
	}

	// init the allocator.
	if(_VertexArrayPtr)
	{
		/* Init with an alignment of 8. Not sure it is useful, but GDC01_Performance.pdf papers talks about
		  "Data arrays must be 8-byte aligned". Don't know what "Data" is.
		*/
		_HeapMemory.initHeap(_VertexArrayPtr, size, 8);

		// set the size
		_VertexArraySize= size;
	}

	return _VertexArrayPtr!=NULL;
}

// ***************************************************************************
uint			CVertexArrayRangeNVidia::sizeAllocated() const
{
	H_AUTO_OGL(CVertexArrayRangeNVidia_sizeAllocated)
	return _VertexArraySize;
}

// ***************************************************************************
void			CVertexArrayRangeNVidia::free()
{
	H_AUTO_OGL(CVertexArrayRangeNVidia_free)
	// release the ptr.
	if(_VertexArrayPtr)
	{
		// reset the allocator.
		_HeapMemory.reset();

#ifdef	NL_OS_WINDOWS
		// Free special memory.
		nwglFreeMemoryNV(_VertexArrayPtr);
#elif defined(NL_OS_MAC)
		// TODO: implement for Mac OS X
#elif defined(NL_OS_UNIX)
		nglXFreeMemoryNV(_VertexArrayPtr);
#endif	// NL_OS_WINDOWS

		_VertexArrayPtr= NULL;
		_VertexArraySize= 0;
	}
}

// ***************************************************************************
void			CVertexArra


}
}

/**
 * Converts the given string to lowercase.
 */
std::string to_lower(std::string str) {
    std::transform(
        str.begin(), str.end(), str.begin(),
        [](unsigned char c){ return std::tolower(c); }
    );
    return str;
}

/**
 * Converts the given string to uppercase.
 */
std::string to_upper(std::string str) {
    std::transform(
        str.begin(), str.end(), str.begin(),
        [](unsigned char c){ return std::toupper(c); }
    );
    return str;
}

/**
 * Replaces all occurrences of from in str with to.
 */
std::string replace_all(std::string str, const std::string &from, const std::string &to) {
    // https://stackoverflow.com/questions/2896600/how-to-replace-all-occurrences-of-a-character-in-string
    size_t start_pos = 0;
    while((start_pos = str.find(from, start_pos)) != std::string::npos) {
        str.replace(start_pos, from.length(), to);
        start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
    }
    return str;
}

/**
 * Returns whether str matches the pattern specified by pattern. Pattern syntax
 * is the usual one with * and ?, where * represents zero or more characters,
 * and ? represents exactly one character.
 */
Bool pattern_match(const Str &pattern, const Str &str) {
    StrStrm ss;
    for (char c : pattern) {
        if (c == '*') {
            ss << ".*";
        } else if (c == '?') {
            ss << ".";
        } else if (isalnum(c)) {
            ss << c;
        } else {
            ss << "\\x" << std::setfill('0') << std::setw(2) << std::hex << (int)c;
        }
    }
    return std::regex_match(str, std::regex(ss.str()));
}

/**
 * Takes a raw string and replaces its line prefix accordingly. Any prefixed
 * spacing common to all non-empty lines is removed, as are any empty lines at
 * the start and end. The remaining lines are then prefixed with line_prefix and
 * terminated with a single newline before being written to os.
 */
void dump_str(std::ostream &os, const Str &line_prefix, const Str &raw) {

    // Split into lines.
    List<Str> lines;
    UInt prev = 0;
    while (true) {
        UInt next = raw.find('\n', prev);
        lines.push_back(raw.substr(prev, next - prev));
        if (next == Str::npos) break;
        prev = next + 1;
    }

    // Clear empty lines entirely and find how much common whitespace we have.
    Int common_whitespace = -1;
    for (auto &line : lines) {
        auto whitespace = line.find_first_not_of(' ');
        if (whitespace == Str::npos) {
            line.clear();
        } else if (common_whitespace == -1 || common_whitespace > (Int)whitespace) {
            common_whitespace = whitespace;
        }
    }
    if (common_whitespace < 0) {
        common_whitespace = 0;
    }

    // Remove empty lines from the front and back of the list.
    while (!lines.empty() && lines.front().empty()) lines.pop_front();
    while (!lines.empty() && lines.back().empty()) lines.pop_back();

    // Print to the output stream.
    for (const auto &line : lines) {
        os << line_prefix << (line.empty() ? "" : line.substr(common_whitespace)) << '\n';
    }
    os.flush();

}

/**
 * Takes a (documentation) string, and:
 *  - wraps long lines at column 80;
 *  - prefixes all resulting lines with line_prefix; and
 *  - dumps the resulting line


2), 6337.5);

    body1.angle = 2.2;
    body2.angle = -3.5;
    appliedForceBody1 = spring.getForce(body1);
    assert.vectorEqual(appliedForceBody1.force, new Vector(733.2255037095349, 153.99364925175052));
    assert.vectorEqual(appliedForceBody1.point, new Vector(5.193036695047217, 12.625953110056816));
    appliedForceBody2 = spring.getForce(body2);
    assert.vectorEqual(appliedForceBody2.force, new Vector(-733.2255037095349, -153.99364925175052));
    assert.vectorEqual(appliedForceBody2.point, new Vector(54.074736942349546, 22.89219639350685));
    assert.close(spring.energy(body1) + spring.energy(body2), 18711.122776665743);

    spring.setRate(30);
    appliedForceBody1 = spring.getForce(body1);
    assert.vectorEqual(appliedForceBody1.force, new Vector(733.2255037095349 * 2, 153.99364925175052 * 2));
});

QUnit.test("FreeFallAccuracy", assert => {
    let body = createBox(new Vector(10, 10), 200, new Vector(0, 0), new Vector(0, 0));
    let gravity = Physics.createGravity(50);
    let physics = new Physics(
        [body],
        [gravity],
        0.01,
        AdvanceMode.Smart
    );
    const initialEnergy = physics.totalEnergy();
    const steps = 1000;
    for (let i = 0; i < steps; i += 1) {
        physics.advance();
    }
    physics.catchUpPositions();
    assert.close(physics.totalEnergy() - initialEnergy, -12.5);
    const totalTime = steps * physics.step;
    assert.close(body.position.y - gravity.acceleration.y * totalTime * totalTime / 2, 2.50125);
});

QUnit.test("SpringPendulumAccuracy", assert => {
    let body = createBox(new Vector(10, 10), 100, new Vector(0, 400), new Vector(0, 10));
    let gravity = Physics.createGravity(100);
    let spring = Physics.createFixedSpring(25, new Vector(0, 0), body, new Vector(0, 0));
    let physics = new Physics(
        [body],
        [spring, gravity],
        0.01,
        AdvanceMode.Smart
    );
    const initialEnergy = physics.totalEnergy();
    const steps = 1000;
    for (let i = 0; i < steps; i += 1) {
        physics.advance();
    }
    physics.catchUpPositions();
    assert.close(physics.totalEnergy() - initialEnergy, 0.0025572783779352903);
});

import * as Union from "../../infrastructure/union";

import { Story } from "../script";

export const Tags = {
    Start: "Start",
    PassTime: "PassTime",
} as const;
export type Tags = typeof Tags;

export type Start<TCommand, TEvent> = Union.Case<Tags["Start"], Story.Script<TCommand, TEvent>>;
export type PassTime = Union.Case<Tags["PassTime"], number>;

export type Commands<TCommand, TEvent> =
    | Start<TCommand, TEvent>
    | PassTime

export const Commands = <TCommand, TEvent>() => ({
    Start: Union.Case(Tags.Start)<Story.Script<TC


equired: true)]
        private InputList<Inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleGetArgs>? _routeRules;

        /// <summary>
        /// The routeRules to match against. routeRules support advanced routing behaviour, and can match on paths, headers and query parameters, as well as status codes and HTTP methods.
        /// Structure is documented below.
        /// </summary>
        public InputList<Inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleGetArgs> RouteRules
        {
            get => _routeRules ?? (_routeRules = new InputList<Inputs.EdgeCacheServiceRoutingPathMatcherRouteRuleGetArgs>());
            set => _routeRules = value;
        }

        public EdgeCacheServiceRoutingPathMatcherGetArgs()
        {
        }
        public static new EdgeCacheServiceRoutingPathMatcherGetArgs Empty => new EdgeCacheServiceRoutingPathMatcherGetArgs();
    }
}


>keyup the value of the focused input element will be submitted to the form, where the server side will need to handle the request.

[You can see a working demo here (from jQuery for Designers)](http://jqueryfordesigners.com/demo/ajax-validation.php)

## HTML

<form action="/profile" method="post">
  <fieldset>
    <legend>Change your username</legend>
    <div>
      <label for="username">Username:</label>
      <input type="text" name="username" value="" id="username" />
    </div>
  </fieldset>
</form>

## jQuery

[Download the liveCheck plugin](/downloads/livecheck.js)

Include [jQuery](http://jquery.com) and the live check plugin above the following code:

$(function () {
    $('#username').liveCheck({ 'image' : '/images/ajax-loader.gif' });
});

The plugin takes a single options variable which can be omitted.  The available values are:

* error - the class applied to the loading message span, defaults to 'error'
* image - the [loading image](/downloads/ajax-loader.gif), defaults to blank
* text - the text shown during the Ajax request, defaults to 'validating...'

## JSON response

The response from the Ajax only needs to be two fields, one indicating success and one with a message for the user:

{ 'ok' : true, 'message' : 'The username selected is available' }

..or (for example):

{ 'ok' : false, 'message' : 'Username must be more than 3 characters' }

If you particularly need change the JSON response structure, you can do so via the following two options which are passed in to the liveCheck plugin call:

* ok - the JSON response field indicating the check passed, defaults to 'ok'
* message - the JSON response field offering the user some information as to the pass or fail.  This text will replace the loading message, defaults to 'message'

## Server side

Whatever your language of choice, the server side is pretty much the same.  The logic breaks down to this:

1. If header HTTP\_X\_REQUESTED\_WITH exists, treat it as an Ajax request instead of normal
2. Run the existing validation against the individual field
3. Respond with a single JSON object and exit

For example, if my only validation check was the length of the username, before the Ajaxifying the code, my PHP would look like this:

<?php
  if ($Action == 'save') {
    $username_errors = User::validateUsername($_POST['username']);
    $password_errors = User::validatePassword($_POST['password']);
    $email_errors = User::validateEmail($_POST['email']);

    if (!count($username_errors) && !count($password_errors) && !count($email_errors)) {
      // save...
    } else {
      // handle errors
    }
  }
?>

The modification is simple to handle the live check:

<?php
  if ($Action == 'save') {
    // existing code...
  } else if ($_SERVER['HTTP_X_REQUESTED_WITH']) {
    if (@$_POST['username']) { // silence warn
      $username_errors = User::validateUsername($_POST['username']);
      $json = array('ok' => true, 'message' => 'Selected username is fine');

      if (count($username_errors)) {


="type std::convert::TryFrom::Error">Error>

执行转换。

source§
impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§
type Error = <U as TryFrom<T>>::Error

发生转换错误时返回的类型。

source§
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。


%{garage}',
        your_vehicle_has_been_marked = 'Phương tiện của bạn đã được đánh dấu',
    },
    info = {
        garage_menu_header = '🚘| %{header}',
        job_vehicle_menu_header = '🚘 | Danh sách xe dành cho %{grade}',
        close_menu = '❌| Đóng',
        vehicle_info = 'Biển số: %{plate}
Xăng: %{fuel}%
Máy: %{engine}%
Thân xe: %{body}%
Thùng Xăng: %{tank}%
Bụi Bẩn: %{dirt}%',
        vehicle_info_and_price = 'Tiền chuộc: ${price}
Biển số: %{plate}
Xăng: %{fuel}%
Máy: %{engine}%
Thân xe: %{body}%
Thùng Xăng: %{tank}%
Bụi Bẩn: %{dirt}%',
    }
}

Lang = Locale:new({
    phrases = Translations,
    warnOnMissing = true
})


import kotlin.math.pow

const val FPI         = 3.1415926536f
const val HALF_PI     = FPI * 0.5f
const val TWO_PI      = FPI * 2.0f
const val FOUR_PI     = FPI * 4.0f
const val INV_PI      = 1.0f / FPI
const val INV_TWO_PI  = INV_PI * 0.5f
const val INV_FOUR_PI = INV_PI * 0.25f

val HALF_ONE = Half(0x3c00.toUShort())
val HALF_TWO = Half(0x4000.toUShort())

inline fun clamp(x: Float, min: Float, max: Float) = if (x < min) min else (if (x > max) max else x)

inline fun clamp(x: Half, min: Half, max: Half) = if (x < min) min else (if (x > max) max else x)

inline fun saturate(x: Float) = clamp(x, 0.0f, 1.0f)

inline fun saturate(x: Half) = clamp(x, Half.POSITIVE_ZERO, HALF_ONE)

inline fun mix(a: Float, b: Float, x: Float) = a * (1.0f - x) + b * x

inline fun mix(a: Half, b: Half, x: Half) = a * (HALF_ONE - x) + b * x

inline fun degrees(v: Float) = v * (180.0f * INV_PI)

inline fun radians(v: Float) = v * (FPI / 180.0f)

inline fun fract(v: Float) = v % 1

inline fun sqr(v: Float) = v * v

inline fun sqr(v: Half) = v * v

inline fun pow(x: Float, y: Float) = (x.toDouble().pow(y.toDouble())).toFloat()
package ie.equalit.ouinet

import android.content.Context
import android.net.ConnectivityManager
import android.net.ConnectivityManager.NetworkCallback
import android.net.Network
import android.net.NetworkRequest
import android.net.NetworkRequest.Builder
import android.net.NetworkCapabilities
import android.os.Handler
import android.os.Looper
import android.util.Log
import ie.equalit.ouinet.Constants.MILLISECOND

class ConnectivityStateMonitor (
    context : Context,
    background : OuinetBackground
) : NetworkCallback() {

    private val context : Context
    private val background : OuinetBackground
    private val mHandler = Handler(Looper.myLooper()!!)
    private var isStarted : Boolean = false
    private var startupTimeout : Int = 0
    private var availableNetworks : MutableList<Network> = mutableListOf()
    val networkRequest: NetworkRequest

    init {
        this.context = context
        this.background = background
        networkRequest = Builder()
            .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
            .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
            .build()
    }

    private var checkForOuinetStarted: Runnable = object : Runnable {
        override fun run() {
            try {
                if (background.getState() == Ouinet.RunningState.Started.toString() ||
                    background.getState() == Ouinet.RunningState.Degraded.toString() ||
                    startupTimeout >= INIT_TIMEOUT
                ) {
                    isStarted = true
                    startupTimeout = INIT_TIMEOUT
                }
                else {
                    startupTimeout++
                }
            } finally {
                if (!isStarted){
                    mHandler.postDelayed(
                        this,
                        1 * MILLISECOND)
                }
            }
        }
    }

    fun enable() {
        isStarted = false
        val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
        connectivityManager.registerNetworkCallback(networkRequest, this)


 'preparing',
  BotStatus.running: 'running',
  BotStatus.SUCCESS: 'SUCCESS',
  BotStatus.CUSTOM: 'CUSTOM',
  BotStatus.RETRY: 'RETRY',
  BotStatus.TOCHECK: 'TOCHECK',
  BotStatus.FAILED: 'FAILED',
};

_$JobProgressImpl _$$JobProgressImplFromJson(Map<String, dynamic> json) =>
    _$JobProgressImpl(
      jobId: json['jobId'] as String,
      runnerId: json['runnerId'] as String?,
      configId: json['configId'] as String,
      status: $enumDecode(_$JobStatusEnumMap, json['status']),
      startTime: DateTime.parse(json['startTime'] as String),
      endTime: json['endTime'] == null
          ? null
          : DateTime.parse(json['endTime'] as String),
      totalLines: (json['totalLines'] as num?)?.toInt() ?? 0,
      processedLines: (json['processedLines'] as num?)?.toInt() ?? 0,
      hits: (json['hits'] as List<dynamic>?)
              ?.map((e) => ValidDataResult.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
      fails: (json['fails'] as List<dynamic>?)
              ?.map((e) => ValidDataResult.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
      customs: (json['customs'] as List<dynamic>?)
              ?.map((e) => ValidDataResult.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
      toChecks: (json['toChecks'] as List<dynamic>?)
              ?.map((e) => ValidDataResult.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
      cpm: (json['cpm'] as num?)?.toInt() ?? 0,
      blockExecutions: (json['blockExecutions'] as List<dynamic>?)
              ?.map((e) => BlockExecution.fromJson(e as Map<String, dynamic>))
              .toList() ??
          const [],
      currentBlock: json['currentBlock'] as String?,
      error: json['error'] as String?,
      results: json['results'] as Map<String, dynamic>? ?? const {},
    );

Map<String, dynamic> _$$JobProgressImplToJson(_$JobProgressImpl instance) =>
    <String, dynamic>{
      'jobId': instance.jobId,
      'runnerId': instance.runnerId,
      'configId': instance.configId,
      'status': _$JobStatusEnumMap[instance.status]!,
      'startTime': instance.startTime.toIso8601String(),
      'endTime': instance.endTime?.toIso8601String(),
      'totalLines': instance.totalLines,
      'processedLines': instance.processedLines,
      'hits': instance.hits,
      'fails': instance.fails,
      'customs': instance.customs,
      'toChecks': instance.toChecks,
      'cpm': instance.cpm,
      'blockExecutions': instance.blockExecutions,
      'currentBlock': instance.currentBlock,
      'error': instance.error,
      'results': instance.results,
    };

const _$JobStatusEnumMap = {
  JobStatus.idle: 'idle',
  JobStatus.preparing: 'preparing',
  JobStatus.running: 'running',
  JobStatus.paused: 'paused',
  JobStatus.completed: 'completed',
  JobStatus.failed: 'failed',
  JobStatus.cancelled: 'cancelled',
};

_$BlockExecutionImpl _$$BlockExecutionImplFromJson(Map<String, dynamic> json) =>
    _$BlockExecutionImpl(
      blockName: json['blockName'] as String,
      startTime: DateTime.parse(json['startTime'] as String),
      endTime: json['endTime'] == null
          ? null
          : DateTime.parse(json['en


th}/Lato-#{$type}-webfont.woff') format('woff'),
             url('#{$lato-font-path}/Lato-#{$type}-webfont.ttf') format('truetype'),
             url('#{$lato-font-path}/Lato-#{$type}-webfont.svg#Lato') format('svg');
        font-weight: $weight;
        font-style: $style;
    }
    @font-face {
        font-family: 'Lato-#{$type}';
        src: url('#{$lato-font-path}/Lato-#{$type}-webfont.eot');
        src: url('#{$lato-font-path}/Lato-#{$type}-webfont.eot?#iefix') format('embedded-opentype'),
             url('#{$lato-font-path}/Lato-#{$type}-webfont.woff') format('woff'),
             url('#{$lato-font-path}/Lato-#{$type}-webfont.ttf') format('truetype'),
             url('#{$lato-font-path}/Lato-#{$type}-webfont.svg#Roboto') format('svg');
    }
}

@mixin lato-font-pair($type, $weight) {
    @include lato-font('#{$type}', $weight, normal);
    @include lato-font('#{$type}Ita', $weight, italic);
}

@include lato-font-pair('Hai', 100);
@include lato-font-pair('Lig', 300);
@include lato-font-pair('Reg', 400);
@include lato-font-pair('Bol', 700);
@include lato-font-pair('Bla', 900);

// ------------------------------------------------------------------
// Google fonts
// ------------------------------------------------------------------
$google-font-path: './google';

@mixin google-font($family, $type, $weight, $style) {
    @font-face {
        font-family: $family;
        src: url('#{$google-font-path}/#{$family}/#{$family}-#{$type}.ttf') format('truetype');
        font-weight: $weight;
        font-style: $style;
    }
}

@mixin google-font-pair($family) {
    @include google-font('#{$family}', 'Regular', 400, normal);
}

@include google-font-pair('Montserrat');
@include google-font-pair('Open_Sans');
@include google-font-pair('Oswald');
@include google-font-pair('Raleway');
@include google-font-pair('Roboto');
@include google-font-pair('Tajawal');
///
/// Backend Custom Utility Classes
/// ==============================================================================

$utilities: map-merge(
    $utilities,
    (
        // Limit 'text-X' classes generation.
        // See bootstrap_review_backend.scss
        "color": (
            property: color,
            class: text,
            local-vars: (
                "text-opacity": 1
            ),
            values: (
                "body": $body-color,
                "muted": $text-muted,
                "reset": inherit,
            ),
        ),

        // Disable 'bg-X' classes generation.
        // See bootstrap_review_backend.scss
        "background-color": null
    )
);

/************** DEFINITION of ANIMATIONS **************/

// 'bounce' effect
@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(.9, .9, .9


/** Proofs GPU - Space and Time's cryptographic proof algorithms on the CPU and GPU.
 *
 * Copyright 2023-present Space and Time Labs, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#pragma once

#include <cstring>

#include "sxt/base/macro/cuda_callable.h"
#include "sxt/curve_g1/random/element_p2.h"
#include "sxt/curve_g1/type/conversion_utility.h"
#include "sxt/curve_g1/type/element_affine.h"
#include "sxt/curve_g1/type/element_p2.h"

namespace sxt::cg1rn {
//--------------------------------------------------------------------------------------------------
// generate_random_element
//--------------------------------------------------------------------------------------------------
CUDA_CALLABLE
inline void generate_random_element(cg1t::element_affine& a,
                                    basn::fast_random_number_generator& rng) noexcept {
  cg1t::element_p2 p;
  generate_random_element(p, rng);
  cg1t::to_element_affine(a, p);
}
} // namespace sxt::cg1rn


="priceTableName">Reflective Incense	2000	100	800	40	2~4	Reflects magic bullets and certain special attacks.

Aggressive Incense	2000	100	800	40	2~4	Doubles damage received.

Defensive Incense	2000	100	800	40	2~4	Halves damage received.

Blurry Incense	2000	100	800	40	2~4	Reduces field of view to a 1 tile radius.

Weighted Incense	2000	100	800	40	2~4	Prevents moving in the air or warping.

Unwanting Incense	2000	100	800	40	2~4	Can't pick up items.
Monsters won't steal or go after items.

Incense Details

Heat-ban Incense

    </span


import {IPlayer} from '../../Interfaces/IPlayer';
import {IBoardCoordinates} from '../../Interfaces/IBoardCoordinates';
import {CheckWinConditionsService} from '../../services/check-win-conditions.service';
import {IGameOptions} from '../../Interfaces/IGameOptions';
import {EasyComputerAIService} from '../../services/computerAI/easy-computer-ai.service';
import {NormalComputerAIService} from '../../services/computerAI/normal-computer-ai.service';
import {UnbeatableComputerAIService} from '../../services/computerAI/unbeatable-computer-ai.service';

@Component({
  selector: 'app-board-constructor',
  templateUrl: './board-constructor.component.html',
  styleUrls: ['./board-constructor.component.css']
})
export class BoardConstructorComponent implements OnInit, OnChanges {
  @Input()
  public gameOptions: IGameOptions;

  // A string array representing the board. Numbers go letft to right top to bottom
  private currentBoardOverview: string[] = [];

  private playerOne: IPlayer;
  private playerTwo: IPlayer;
  private currentPlayer: IPlayer;

  // Used to update the UI
  // noinspection JSMismatchedCollectionQueryUpdate
  private winningGroupIndexes: number[];

  // A hack to generate an array with the correct number of indexes for the ngfor to work.
  // Basing the html layout on rows instead of currentBoardOverview is done
  // to remove the redrawing of the board that would occur by each change of currentBoardOverview
  private rows = [];

  constructor(
    private checkWinConditionsService: CheckWinConditionsService,
    private easyComputerAIService: EasyComputerAIService,
    private normalComputerAIService: NormalComputerAIService,
    private unbeatableComputerAIService: UnbeatableComputerAIService
  ) {
  }

  ngOnInit() {
  }

  ngOnChanges(changes: SimpleChanges): void {
    if (!changes.gameOptions.currentValue) {
      return;
    }

    this.rows = new Array(Number(this.gameOptions.boardDimentions));

    for (let i = 0; i < this.gameOptions.boardDimentions * this.gameOptions.boardDimentions; i++) {
      this.currentBoardOverview[i] = i + '';
    }

    this.setupGame();
  }

  private setupGame() {
    this.generatePlayers();
    this.makePlayerComputerIfSinglePlayerGame();
    this.assignRandomPlayerToStart();
  }

  private onSquareClick(selectedIndex) {
    if (!this.currentPlayer) {
      return;
    }

    if (this.currentBoardOverview[selectedIndex] === 'O'
      || this.currentBoardOverview[selectedIndex] === 'X' ) {
      console.log('Symbols in squares can not be ovewritten.');
      return;
    }

    this.currentBoardOverview[selectedIndex] = this.currentPlayer.mark;

    this.onPlayerPlayed({
      boardStatus: this.currentBoardOverview,
      selectedIndex,
      boardDimensions: this.gameOptions.boardDimentions
    });
  }

  private resetBoard() {
    for (let i = 0; i < this.gameOptions.boardDimentions * this.gameOptions.boardDimentions; i++) {
      this.currentBoardOverview[i] = i + '';
    }
  }

  private generatePlayers() {
    this.playerOne = {
      mark: 'X',
      wins: 0,
      computer: false
    };

    this.playerTwo = {
      mark: 'O',
      wins: 0,
      computer: false
    };
  }

  private makePlayerComputer


 {
        try {
            mSurface = Surface(mSurfaceTexture)
            outputSize?.let {
                mSurfaceTexture?.setDefaultBufferSize(it.width, it.height)
            }
            //创建捕抓会话 TEMPLATE_RECORD 创建适合录像的请求
            mRequestBuilder = mCamera?.createCaptureRequest(CameraDevice.TEMPLATE_RECORD)
            mSurface?.let {
                mRequestBuilder?.addTarget(it)
                mRequestBuilder?.set(CaptureRequest.CONTROL_AF_MODE,
                        CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_VIDEO)
                mRequestBuilder?.set(CaptureRequest.FLASH_MODE, if (mIsFlashLightOn)
                    CaptureRequest.FLASH_MODE_TORCH
                else
                    CaptureRequest.FLASH_MODE_OFF)

                mCamera?.createCaptureSession(listOf(it),
                        mCaptureStateCallback, mBackgroundHandler)
            }

        } catch (e: Throwable) {
            Log.e(TAG, "", e)
        }

    }

    override fun onStopPreview() {
        abortSession()
        mCamera?.close()
        mCamera = null
        stopBackgroundThread()
    }

    override fun onOpenCamera(@CameraType cameraType: Int) {
        initialize(cameraType)
    }

    /**
     * 开启HandlerThread
     */
    fun startBackgroundThread(){
        mBackgroundThread = HandlerThread("CameraBackground")
        mBackgroundThread?.start()
        mBackgroundHandler = mBackgroundThread?.looper?.let { Handler(it) }
    }

    fun stopBackgroundThread(){
        try {
            mBackgroundThread?.apply {
                quitSafely()
                join()
            }
            mBackgroundThread = null
            mBackgroundHandler =null
        }catch (e:InterruptedException){
            Log.e(TAG,e.toString())
        }

    }

    @SuppressLint("MissingPermission")
    private fun initialize(@CameraType cameraType: Int) {
        try {
            startBackgroundThread()
            //打开摄像头
            mManager?.openCamera(if (cameraType == FRONT_CAMERA)
                frontCameraIdV21
            else
                backCameraIdV21,
                    mStateCallback, mBackgroundHandler)
            updateOutputSize()
        } catch (e: Throwable) {
            Log.e(TAG, "", e)
        }

    }

    override fun onTurnLight(on: Boolean) {
        if (mIsFlashLightOn == on) {
            return
        }
        mIsFlashLightOn = on
        if (mCameraType == FRONT_CAMERA && on) {
            return
        }
        abortSession()
        mRequestBuilder?.set(CaptureRequest.FLASH_MODE, if (mIsFlashLightOn)
            CaptureRequest.FLASH_MODE_TORCH
        else
            CaptureRequest.FLASH_MODE_OFF)
        startRequest(mCaptureSession)
    }

    companion object {

        private val TAG = "CameraCompatV21"
    }
}
package com.werb.pickphotoview.util

import android.content.ContentResolver
import android.database.Cursor
import android.provider.MediaStore
import android.util.Log
import com.werb.eventbus.EventBus
import com.werb.pickphotoview.event.PickFinishEvent
import com.werb.pickphotoview.model.DirImage
import com.werb.pickphotoview.model.GroupImage
import com.werb.pickphotoview.model.MediaModel
import com.werb.pickphotoview.model.SelectModel
import java.io.File
import java.util.*
import kotlin.collections.ArrayList

/**
 * Created by wanbo on 2016/12/31.
 */

object PickPhotoHelper {

    val selectImages: ArrayList<SelectModel> by lazy { arrayListOf<SelectModel>() }
    private val mGroupMap = LinkedHashMap<String, ArrayList<MediaModel>>()
    private val dirNames = ArrayList<String>()
    var groupImage: GroupImage? = null
        private set
    var dirImage: DirImage? = null
        private set

    fun start(showGif: Boolean, showVideo: Boolean, resolver: ContentResolver) {
        clear()
        imageT


, 30.0, '%.0f'); ImGui::SameLine(ctx); demo.HelpMarker('Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen.')
      -- slider('DisplaySafeAreaPadding', 0.0, 30.0, '%.0f'); ImGui::SameLine(ctx); demo.HelpMarker('Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).')

      ImGui.EndTabItem(ctx)
    end

    if ImGui.BeginTabItem(ctx, 'Colors') then
      if not app.style_editor.colors then
        app.style_editor.colors = {
          filter = ImGui.CreateTextFilter(),
          alpha_flags = ImGui.ColorEditFlags_None,
        }
        ImGui.Attach(ctx, app.style_editor.colors.filter)
      end

      ImGui.TextFilter_Draw(app.style_editor.colors.filter, ctx, 'Filter colors', ImGui.GetFontSize(ctx) * 16)

      if ImGui.RadioButton(ctx, 'Opaque', app.style_editor.colors.alpha_flags == ImGui.ColorEditFlags_AlphaOpaque) then
        app.style_editor.colors.alpha_flags = ImGui.ColorEditFlags_AlphaOpaque
      end
      ImGui.SameLine(ctx)
      if ImGui.RadioButton(ctx, 'Alpha',  app.style_editor.colors.alpha_flags == ImGui.ColorEditFlags_None) then
        app.style_editor.colors.alpha_flags = ImGui.ColorEditFlags_None
      end
      ImGui.SameLine(ctx)
      if ImGui.RadioButton(ctx, 'Both',   app.style_editor.colors.alpha_flags == ImGui.ColorEditFlags_AlphaPreviewHalf) then
        app.style_editor.colors.alpha_flags = ImGui.ColorEditFlags_AlphaPreviewHalf
      end
      ImGui.SameLine(ctx)
      demo.HelpMarker(
        'In the color list:\n\z
         Left-click on color square to open color picker,\n\z
         Right-click to open edit options menu.')

      ImGui.SetNextWindowSizeConstraints(ctx, 0.0, ImGui.GetTextLineHeightWithSpacing(ctx) * 10, FLT_MAX, FLT_MAX)
      if ImGui.BeginChild(ctx, '##colors', 0, 0, ImGui.ChildFlags_Borders | ImGui.ChildFlags_NavFlattened,
          ImGui.WindowFlags_AlwaysVerticalScrollbar | ImGui.WindowFlags_AlwaysHorizontalScrollbar) then
        ImGui.PushItemWidth(ctx, ImGui.GetFontSize(ctx) * -12)
        local inner_spacing = ImGui.GetStyleVar(ctx, ImGui.StyleVar_ItemInnerSpacing)
        for i, name in demo.EachEnum('Col') do
          if ImGui.TextFilter_PassFilter(app.style_editor.colors.filter, name) then
            ImGui.PushID(ctx, i)
            if ImGui.Button(ctx, '?') then
              ImGui.DebugFlashStyleColor(ctx, i)
            end
            ImGui.SetItemTooltip(ctx, 'Flash given color to identify places where it is used.')
            ImGui.SameLine(ctx)
            rv, app.style_editor.style.colors[i] = ImGui.ColorEdit4(ctx, '##color', app.style_editor.style.colors[i], ImGui.ColorEditFlags_AlphaBar | app.style_editor.colors.alpha_flags)
            if app.style_editor.style.colors[i] ~= app.style_editor.ref.colors[i] then
              -- Tips: in a real user application, you may want to merge and use an icon font into the main font,
              -- so instead of "Save"


//}

				break;
			}
		case VJ_genes:
			{

				//string v_seq = constructed_sequences.at(V_gene_seq);

				/*
				 * //Get the offset of V alignment
					int v_offset = chosen_genes.at(V_gene).second.offset;
					int original_v_seq_size = chosen_genes.at(V_gene).first.value_str.size();

				//Get the number of deletions
				//use operator[] to find_or_add (default initialize int to 0 if not found)
				//TODO check if default initializing to 0 is better and then change the values
				int v_del = deletion_map[make_pair(V_gene,Three_prime)];
				*/

				//string j_seq = constructed_sequences.at(J_gene_seq);
				/*
				//Get the offset of J alignment
				int j_offset = chosen_genes.at(J_gene).second.offset;
				//Get the number of deletions
				int j_del = deletion_map[make_pair(J_gene,Five_prime)];
				*/
				//TODO declare insertion before and call iterate common after, clean code get rid of code duplication
				//int insertions = (j_offset + j_del) - (v_offset  + (original_v_seq_size ) - v_del )-1;
				//int insertions = sequence.size() - (v_seq.size() + j_seq.size());

				//insertions = seq_offsets.at(pair<Seq_type,Seq_side>(J_gene_seq,Five_prime)) - seq_offsets.at(pair<Seq_type,Seq_side>(V_gene_seq,Three_prime)) -1;
				//insertions = seq_offsets.at(j_5_pair) - seq_offsets.at(v_3_pair) -1;
				insertions = seq_offsets.at(J_gene_seq,Five_prime) - seq_offsets.at(V_gene_seq,Three_prime) -1;

				proba_contribution = iterate_common( proba_contribution , insertions , base_index , base_index_map , offset_map , model_parameters_point);

				if(proba_contribution!=0){
					inserted_str.assign(insertions , -1);
					new_index = base_index + realization_index;//this->event_realizations.at(to_string(insertions)).index;
					constructed_sequences[VJ_ins_seq] = &inserted_str;
					downstream_proba_map.set_value(VJ_ins_seq,junction_length_best_proba_map.at(insertions),memory_layer_proba_map_junction);
				}

				break;
			}

		default:
			throw invalid_argument("Unknown gene_class for Insertion: " + this->event_class);
			break;
	}

	if(proba_contribution!=0){
		//TODO new_scenario proba necessary?
		new_scenario_proba*=proba_contribution;
		//tmp_err_w_proba*=proba_contribution;
		(*dinuc_updated_bound) = upper_bound_per_ins.at(insertions);

		//Compute scenario downstream proba bound
		scenario_upper_bound_proba = new_scenario_proba;
		//Multiply all downstream probas
		downstream_proba_map.multiply_all(scenario_upper_bound_proba,current_downstream_proba_memory_layers);

		if(scenario_upper_bound_proba>=(seq_max_prob_scenario*proba_threshold_factor)){
			Rec_Event::iterate_wrap_up(new_scenario_proba , downstream_proba_map , sequence , int_sequence , base_index_map , offset_map , next_event_ptr_arr  , updated_marginals_point  , model_parameters_point , allowed_realizations , constructed_sequences , seq_offsets , error_rate_p , counters_list , events_map , safety_set ,mismatches_lists,seq_max_prob_scenario,proba_threshold_factor);
		}
	}
}

/


"submodule": "Table"
        },
        {
            "file": "src/io/p5.Table.js",
            "line": 120,
            "description": "
Removes a row from the table object.
\n",
            "itemtype": "method",
            "name": "removeRow",
            "params": [
                {
                    "name": "id",
                    "description": "
ID number of the row to remove
\n",
                    "type": "Integer"
                }
            ],
            "example": [
                "\n
\n\n// Given the CSV file \"mammals.csv\"\n// in the project's \"assets\" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n  //my table is comma separated value \"csv\"\n  //and has a header specifying the columns labels\n  table = loadTable('assets/mammals.csv', 'csv', 'header');\n}\n\nfunction setup() {\n  //remove the first row\n  table.removeRow(0);\n\n  //print the results\n  for (var r = 0; r < table.getRowCount(); r++)\n    for (var c = 0; c < table.getColumnCount(); c++)\n      print(table.getString(r, c));\n}\n\n
"
            ],
            "alt": "no image displayed",
            "class": "p5.Table",
            "module": "IO",
            "submodule": "Table"
        },
        {
            "file": "src/io/p5.Table.js",
            "line": 168,
            "description": "
Returns a reference to the specified p5.TableRow. The reference\ncan then be used to get and set values of the selected row.
\n",
            "itemtype": "method",
            "name": "getRow",
            "params": [
                {
                    "name": "rowID",
                    "description": "
ID number of the row to get
\n",
                    "type": "Integer"
                }
            ],
            "return": {
                "description": "p5.TableRow object",
                "type": "p5.TableRow"
            },
            "example": [
                "\n
\n\n// Given the CSV file \"mammals.csv\"\n// in the project's \"assets\" folder:\n//\n// id,species,name\n// 0,Capra hircus,Goat\n// 1,Panthera pardus,Leopard\n// 2,Equus zebra,Zebra\n\nvar table;\n\nfunction preload() {\n  //my table is comma separated value \"csv\"\n  //and has a header specifying the columns labels\n  table = loadTable('assets/mammals.csv', 'csv', 'header');\n}\n\nfunction setup() {\n  var row = table.getRow(1);\n  //print it column by column\n  //note: a row is an object, not an array\n  for (var c = 0; c < table.getColumnCount(); c++) {\n    print(row.getString(c));\n  }\n}\n\n
"
            ],
            "alt": "no image displayed",
            "class": "p5.Table",
            "module": "IO",
            "submodule": "Table"
        },
        {
            "file": "src/io/p5.Table.js",
            "line": 214,
            "description": "
Gets all rows from the table. Returns an array of p5.TableRows.
\n",
            "itemtype": "method",
            "name": "getRows",
            "return": {
                "description": "Array of p5.TableRows",
                "


clerView
import org.freedesktop.gstreamer.examples.webrtcsrc.R
import org.freedesktop.gstreamer.examples.webrtcsrc.model.Peer

class ProducerTableRowAdapter(private var producers: List<Peer>, private val onClick: (Peer) -> Unit) :
    RecyclerView.Adapter<ProducerTableRowAdapter.ViewHolder>() {

    override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): ViewHolder {
        val v: View = LayoutInflater.from(viewGroup.context)
            .inflate(R.layout.producer_table_row_layout, viewGroup, false)
        return ViewHolder(v, onClick)
    }

    override fun onBindViewHolder(viewHolder: ViewHolder, i: Int) {
        viewHolder.bind(producers[i])
    }

    override fun getItemCount() = producers.size

    class ViewHolder(itemView: View, val onClick: (Peer) -> Unit) : RecyclerView.ViewHolder(itemView) {
        private val tvProducerId: TextView = itemView.findViewById(R.id.tv_producer_id)
        private val tvProducerMeta: TextView = itemView.findViewById(R.id.tv_producer_meta)
        private var curProducer: Peer? = null

        init {
            itemView.setOnClickListener {
                curProducer?.let {
                    onClick(it)
                }
            }
            itemView.setOnFocusChangeListener { v, hasFocus ->
                if (hasFocus)
                    v.setBackgroundColor(Color.LTGRAY)
                else
                    v.setBackgroundColor(Color.TRANSPARENT)
            }
        }

        @SuppressLint("SetTextI18n")
        fun bind(producer: Peer) {
            tvProducerId.text = producer.id.substring(0..7) + "..."
            tvProducerMeta.text = producer.meta.toString()
            curProducer = producer
        }
    }

    @SuppressLint("NotifyDataSetChanged")
    fun setProducers(list: List<Peer>) {
        producers = list
        notifyDataSetChanged()
    }
}class Tablet(private val model: String, private val color: String,
             private val screen: Float, private val ram: String) {

    private val brand = "Lenovo"

    fun presentarse(): String{
        return "$brand $model: color $color, pantalla $screen\", RAM $ram"
    }
}

class MyQueue<E>(private val cola: ArrayList<E>) {

    fun addComponent(vararg elem: E){
        for (e in elem){
            cola.addLast(e)
        }
    }

    fun removeComponent(){
        cola.removeFirst()
    }

    fun peekComponent(): E{
        return cola.first()
    }

    fun printQueue(): ArrayList<E>{
        return cola
    }
}

class MyStack<E>(private val pila: ArrayList<E>) {

    fun addComponent(vararg elem: E){
        for (e in elem){
            pila.addLast(e)
        }
    }

    fun removeComponent(){
        pila.removeLast()
    }

    fun peekComponent(): E{
        return pila.last()
    }

    fun printStack(): ArrayList<E>{
        return pila
    }
}

fun main() {
    val tablet1 = Tablet("Tab M10", "Gris", 10.6f, "4GB")
    val tablet2 = Tablet("Tab P12", "Gris", 12.7f, "8GB")
    val tablet3 = Tablet("Tab K10", "Azul", 10.3f, "4GB")

    println(tablet1.presentarse())
    println(tablet2.presentarse())
    println(tablet3.presentarse())

    println("${"\n"+"~".repeat(7)} EJERCICIO EXTRA ${"~".repeat(7)}")
    println("-> QUEUES")
    val colaList = ArrayList<String>()
    val queue = MyQueue(colaList)

    queue.addComponent("Uno")
    queue.addComponent("Dos", "Tres")
    queue.addComponent("Cuatro", "Cinco", "Seis")
    println(queue.printQueue())

    queue.removeComponent()
    println(queue.print


begin();
            it1 != listElementCount.end() && it2 != arrayElementCount.end();
            ++it1, ++it2)
        {
            EXPECT_EQ(it1->first, it2->first);
            EXPECT_EQ(it1->second, it2->second);
        }

        // check that number of owned and possessed shares are equal for each issuance
        issuanceIdx = indexLists.issuancesFirstIdx;
        while (issuanceIdx != NO_ASSET_INDEX)
        {
            Asset asset(assets[issuanceIdx].varStruct.issuance.publicKey, assetNameFromString(assets[issuanceIdx].varStruct.issuance.name));
            long long numOfSharesOwned = 0, numOfSharesPossessed = 0;
            for (AssetOwnershipIterator iter(asset); !iter.reachedEnd(); iter.next())
            {
                numOfSharesOwned += iter.numberOfOwnedShares();
            }
            for (AssetPossessionIterator iter(asset); !iter.reachedEnd(); iter.next())
            {
                numOfSharesPossessed += iter.numberOfPossessedShares();
            }
            EXPECT_EQ(numOfSharesPossessed, numOfSharesOwned);

            issuanceIdx = indexLists.nextIdx[issuanceIdx];
        }
    }
};

TEST(TestCoreAssets, CheckLoadFile)
{
    AssetsTest test;
    if (loadUniverse(L"universe.136"))
    {
        test.checkAssetsConsistency(true);
    }
    else
    {
        std::cout << "Universe file not found. Skipping file test..." << std::endl;
    }
}

struct AssetSharesKey
{
    m256i publicKey;
    unsigned int managingContract;

    bool operator < (const AssetSharesKey& rhs) const
    {
        if (publicKey < rhs.publicKey)
            return true;
        else if (rhs.publicKey < publicKey)
            return false;
        else
            return managingContract < rhs.managingContract;
    }
};

struct AssetKey : public Asset
{
    bool operator < (const Asset& rhs) const
    {
        if (issuer < rhs.issuer)
            return true;
        else if (rhs.issuer < issuer)
            return false;
        else
            return assetName < rhs.assetName;
    }
};

struct IssuanceTestData
{
    Asset id;
    unsigned short managingContract;
    unsigned int universeIdx;
    long long numOfShares;
    int numOfOwners;
    int transferDivisor;

    std::map<AssetSharesKey, long long> shares;
    std::map<AssetSharesKey, long long> ownershipIdx;
    std::map<AssetSharesKey, long long> possessionIdx;

    void checkIssuance(const AssetIssuanceIterator& iter) const
    {
        unsigned int idxI = iter.issuanceIndex();
        EXPECT_LT(idxI, ASSETS_CAPACITY);
        EXPECT_EQ(idxI, universeIdx);
        EXPECT_EQ(assets[idxI].varStruct.issuance.type, ISSUANCE);
        EXPECT_EQ((*((unsigned long long*)assets[idxI].varStruct.issuance.name)) & 0xFFFFFFFFFFFFFF, id.assetName);
        EXPECT_EQ(assets[idxI].varStruct.issuance.publicKey, id.issuer);

        EXPECT_EQ(iter.issuer(), id.issuer);
        EXPECT_EQ(iter.assetName(), id.assetName);
    }

    void checkOwnershipAndIssuance(const AssetOwnershipIterator& iter) const
    {
        unsigned int idxI = iter.issuanceIndex();
        EXPECT_LT(idxI, ASSETS_CAPACITY);
        EXPECT_EQ(idxI, universeIdx);
        EXPECT_EQ(assets[idxI].varStruct.issuance.type, ISSUANCE);
        EXPECT_EQ(


import frappe
from frappe.model.utils.rename_field import rename_field

def execute():
	try:
		rename_field("Leave Type", "encashment_threshold_days", "non_encashable_leaves")

	except Exception as e:
		if e.args[0] != 1054:
			raise

	if not frappe.db.has_column("Leave Encashment", "encashable_days"):
		return

	# set new field values
	LeaveEncashment = frappe.qb.DocType("Leave Encashment")
	(
		frappe.qb.update(LeaveEncashment)
		.set(LeaveEncashment.encashment_days, LeaveEncashment.encashable_days)
		.where((LeaveEncashment.encashment_days.isnull()))
	).run()

	(
		frappe.qb.update(LeaveEncashment)
		.set(LeaveEncashment.actual_encashable_days, LeaveEncashment.encashable_days)
		.where((LeaveEncashment.actual_encashable_days.isnull()))
	).run()


/*****************************************************************************
* File Name: MyIsr.h
*
* Version: 1.0
*
* Description:
* This file provides the declarations for the ISRs.
*
* Note:
*
* Owner:
* UDYG
*
* Related Document:
* PSoC 4 BLE Heart Rate Monitor Solution Demo IROS: 001-92353
*
* Hardware Dependency:
* PSoC 4 BLE HRM Solution Demo Board
*
* Code Tested With:
* 1. PSoC Creator 3.1
* 2. ARM-GCC Compiler
*
******************************************************************************
* Copyright (2014), Cypress Semiconductor Corporation.
******************************************************************************
* This software is owned by Cypress Semiconductor Corporation (Cypress) and is
* protected by and subject to worldwide patent protection (United States and
* foreign), United States copyright laws and international treaty provisions.
* Cypress hereby grants to licensee a personal, non-exclusive, non-transferable
* license to copy, use, modify, create derivative works of, and compile the
* Cypress Source Code and derivative works for the sole purpose of creating
* custom software in support of licensee product to be used only in conjunction
* with a Cypress integrated circuit as specified in the applicable agreement.
* Any reproduction, modification, translation, compilation, or representation of
* this software except as specified above is prohibited without the express
* written permission of Cypress.
*
* Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH
* REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* Cypress reserves the right to make changes without further notice to the
* materials described herein. Cypress does not assume any liability arising out
* of the application or use of any product or circuit described herein. Cypress
* does not authorize its products for use as critical components in life-support
* systems where a malfunction or failure may reasonably be expected to result in
* significant injury to the user. The inclusion of Cypress' product in a life-
* support systems application implies that the manufacturer assumes all risk of
* such use and in doing so indemnifies Cypress against all charges. Use may be
* limited by and subject to the applicable Cypress software license agreement.
*****************************************************************************/

#if !defined (_MY_ISR_H)
#define _MY_ISR_H

#include <cytypes.h>
#include <stdbool.h>

/*****************************************************************************
* Extern variables
*****************************************************************************/
extern volatile bool canMeasureBattery;
extern volatile bool canMeasureHeartRate;

/*****************************************************************************
* Function Declarations
*****************************************************************************/
CY_ISR_PROTO(MyAdcIsr);

#endif  /* #if !defined (_MY_ISR_H) */

/* [] END OF FILE */


                style: TextStyle(
                  color: oscilloscopeOptionTitleColor,
                  fontStyle: FontStyle.normal,
                  fontWeight: FontWeight.bold,
                  fontSize: 13,
                ),
              ),
            ),
          ),
        )
      ],
    );
  }
}
import 'dart:math';
import 'package:pslab/communication/peripherals/i2c.dart';
import 'package:pslab/communication/science_lab.dart';
import 'package:pslab/others/logger_service.dart';

import '../../l10n/app_localizations.dart';
import '../../providers/locator.dart';

class BMP180 {
  AppLocalizations appLocalizations = getIt.get<AppLocalizations>();

  static const String tag = "BMP180";

  static const int address = 0x77;

  static const int ultraLowPower = 0;
  static const int standard = 1;
  static const int highRes = 2;
  static const int ultraHighRes = 3;

  static const int calAC1 = 0xAA;
  static const int calAC2 = 0xAC;
  static const int calAC3 = 0xAE;
  static const int calAC4 = 0xB0;
  static const int calAC5 = 0xB2;
  static const int calAC6 = 0xB4;
  static const int calB1 = 0xB6;
  static const int calB2 = 0xB8;
  static const int calMB = 0xBA;
  static const int calMC = 0xBC;
  static const int calMD = 0xBE;
  static const int control = 0xF4;
  static const int tempData = 0xF6;
  static const int pressData = 0xF6;

  static const int readTempCmd = 0x2E;
  static const int readPressureCmd = 0x34;

  int mode = highRes;
  int oversampling = highRes;

  static const int numPlots = 3;
  static const List<String> plotNames = ["Temperature", "Pressure", "Altitude"];
  static const String name = "Altimeter BMP180";

  final I2C i2c;
  late int ac1, ac2, ac3, ac4, ac5, ac6, b1, b2, mb, mc, md;
  double temperature = 0.0;
  double pressure = 0.0;

  static const double seaLevelPressure = 101325.0;

  BMP180._(this.i2c);
  bool _validateCalibrationValues() {
    if (ac1 == 0 || ac2 == 0 || ac3 == 0 || ac4 == 0 || ac5 == 0 || ac6 == 0) {
      return false;
    }
    if (ac1 < -32768 || ac1 > 32767) return false;
    if (ac2 < -32768 || ac2 > 32767) return false;
    if (ac3 < -32768 || ac3 > 32767) return false;
    if (ac4 < 0 || ac4 > 65535) return false;
    if (ac5 < 0 || ac5 > 65535) return false;
    if (ac6 < 0 || ac6 > 65535) return false;
    if (b1 < -32768 || b1 > 32767) return false;
    if (b2 < -32768 || b2 > 32767) return false;
    if (mb < -32768 || mb > 32767) return false;
    if (mc < -32768 || mc > 32767) return false;
    if (md < -32768 || md > 32767) return false;
    return true;
  }

  static Future<BMP180> create(I2C i2c, ScienceLab scienceLab) async {
    final bmp180 = BMP180._(i2c);
    await bmp180._initializeCalibrationValues(scienceLab);
    if (!bmp180._validateCalibrationValues()) {
      throw Exception('BMP180 calibration values are invalid or out of range.');
    }
    return bmp180;
  }

  Future<void> _initializeCalibrationValues(ScienceLab scienceLab) async {


project.
---Calls `xcodebuild` commands to get the build settings.
---@param opts {skipIfSamePlatform:boolean} the options table
---@param callback function|nil the callback function to be called after
---the settings are updated.
function M.update_settings(opts, callback)
  local xcode = require("xcodebuild.core.xcode")
  local util = require("xcodebuild.util")

  if opts.skipIfSamePlatform and last_platform and last_platform == M.settings.platform then
    util.call(callback)
    return
  end

  if M.settings.swiftPackage then
    M.settings.appPath = nil
    M.settings.productName = nil
    M.settings.bundleId = nil
    M.settings.buildDir = nil
    M.save_settings()
    last_platform = nil
    util.call(callback)
  else
    local helpers = require("xcodebuild.helpers")
    local notifications = require("xcodebuild.broadcasting.notifications")

    helpers.defer_send("Updating project settings...")
    xcode.get_build_settings(
      M.settings.platform,
      M.settings.projectFile,
      M.settings.scheme,
      M.settings.xcodeproj,
      function(buildSettings)
        M.settings.appPath = buildSettings.appPath
        M.settings.productName = buildSettings.productName
        M.settings.bundleId = buildSettings.bundleId
        M.settings.buildDir = buildSettings.buildDir
        M.save_settings()
        last_platform = M.settings.platform
        util.call(callback)
        notifications.send("Pr


id : ids) {
            modelService.delete(id);
            userRoleService.deleteByUserId(id);
        }

        if (1 < ids.length) {
            return BaseResult.success("批量删除数据成功");
        }

        return BaseResult.success();
    }

    @Override
    @GetMapping("/view/{id}")
    @ApiOperation("查看单个数据详情")
    public BaseResult view(@PathVariable String id) {
        User model = modelService.findById(id);
        if(StrUtil.isNotBlank(model.getDepartmentId())){
            Department department = departmentService.findById(model.getDepartmentId());
            if (null != department) {
                model.setDepartmentName(department.getName());
            }
        }
        List<Role> roles = roleService.findByUserId(model.getId());
        model.setRoles(roles);

        return BaseResult.success(model);
    }

    @Override
    @PostMapping("/import-data")
    @ApiOperation("导入数据")
    public BaseResult importData(@RequestBody List<User> models) {

        List<String> reasons = new ArrayList<>();
        int i = 0;
        for (User model : models) {
            i++;

            if (StrUtil.isBlank(model.getUsername()) || StrUtil.isBlank(model.getPassword())) {
                reasons.add("第" + i + "行：用户名或密码为空
");
                continue;
            }

            if (null != modelService.findByUsername(model.getUsername())) {
                reasons.add("第" + i + "行：用户名已存在
");
                continue;
            }

            if (StrUtil.isNotBlank(model.getDepartmentId())) {
                Department department = departmentService.findById(model.getDepartmentId());
                if (null == department) {
                    reasons.add("第" + i + "行：部门不存在
");
                    continue;
                }
            }

            Role role = roleService.findByIsDefault(CommonConstant.ROLE_DEFAULT_YES);
            if (null != role) {
                UserRole userRole = new UserRole();
                userRole.setUserId(model.getId());
                userRole.setRoleId(role.getId());
                userRoleService.save(userRole);
            }

            if (null == model.getStatus()) {
                model.setStatus(CommonConstant.STATUS_ENABLE);
            }

            model.setPassword(new BCryptPasswordEncoder().encode(model.getPassword()));
            modelService.save(model);
        }

        StringBuilder message = new StringBuilder();
        if (0 < reasons.size()) {
            message.append("部分导入成功，成功").append(models.size() - reasons.size()).append("条，失败").append(reasons.size()).append("条");
            message.append(reasons.toString());
        } else {
            message.append("全部导入成功，共").append(models.size() - reasons.size()).append("条");
        }

        return BaseResult.success(message);
    }

    @GetMapping("/department-user/{departmentId}")
    @ApiOperation("返回所有数据，需谨慎")
    public BaseResult departmentUser(@PathVariable String departmentId) {
        List<User> models = modelService.findByDepartmentId(departmentId);

        return BaseResult.success(models);
    }

    @PostMapping("/unlock")
    @ApiOperation("验证当前用户密码解锁后续操作")
    public BaseResult unlock(@RequestParam String password) {

        if (!new BCryptPasswordEncoder().matches(password, bootanUser.me().getPassword())) {
            return BaseResult.error("密码错误");
        }

        return BaseResult.success();
    }

    @PostMapping("/reset-password")
    @ApiOperation("重置密码")
    public BaseResult resetPassword(@RequestParam String[] ids) {

        for (String id : ids) {
            User model = modelService.findById(id);
            if (null != model) {
                model.setPassword(new BCryptPasswordEncoder().encode("123456"));


ypeHash)
	uint8                                         Pad_33[0x1];                                       // 0x0033(0x0001)(Fixing Size After Last Property [ Dumper-7 ])
	int32                                         CallFunc_GetRecipeNumber_ReturnValue;              // 0x0034(0x0004)(ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
	bool                                          K2Node_SwitchEnum_CmpSuccess;                      // 0x0038(0x0001)(ZeroConstructor, IsPlainOldData, NoDestructor)
	uint8                                         Pad_39[0x3];                                       // 0x0039(0x0003)(Fixing Size After Last Property [ Dumper-7 ])
	int32                                         CallFunc_GetRecipeNumber_ReturnValue2;             // 0x003C(0x0004)(ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
};
static_assert(alignof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber) == 0x000008, "Wrong alignment on WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber");
static_assert(sizeof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber) == 0x000040, "Wrong size on WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, Number) == 0x000000, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::Number' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, Category) == 0x000008, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::Category' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, CallFunc_GetUMGManager_ReturnValue) == 0x000010, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::CallFunc_GetUMGManager_ReturnValue' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, CallFunc_GetUMGManager_ReturnValue2) == 0x000018, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::CallFunc_GetUMGManager_ReturnValue2' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, CallFunc_GetAccessorSenreki_ReturnValue) == 0x000020, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::CallFunc_GetAccessorSenreki_ReturnValue' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, CallFunc_GetAccessorSenreki_ReturnValue2) == 0x000028, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::CallFunc_GetAccessorSenreki_ReturnValue2' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber, CallFunc_GetSelectedClassification_ReturnValue) == 0x000030, "Member 'WBP_Menu_Senreki_Fusigikazi_Window_001_modern_C_SetCategoryNumber::CallFunc_GetSelectedClassification_ReturnValue' has a wrong offset!");
static_assert(offsetof(WBP_Menu_Senreki_Fusigikazi


dth );",
					"float dy = 1.0 / float( boneTextureHeight );",

					"y = dy * ( y + 0.5 );",

					"vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );",
					"vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );",
					"vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );",
					"vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );",

					"mat4 bone = mat4( v1, v2, v3, v4 );",

					"return bone;",

				"}",

			"#else",

				"uniform mat4 boneGlobalMatrices[ MAX_BONES ];",

				"mat4 getBoneMatrix( const in float i ) {",

					"mat4 bone = boneGlobalMatrices[ int(i) ];",
					"return bone;",

				"}",

			"#endif",

		"#endif"

	].join("\n"),

	skinbase_vertex: [

		"#ifdef USE_SKINNING",

			"mat4 boneMatX = getBoneMatrix( skinIndex.x );",
			"mat4 boneMatY = getBoneMatrix( skinIndex.y );",
			"mat4 boneMatZ = getBoneMatrix( skinIndex.z );",
			"mat4 boneMatW = getBoneMatrix( skinIndex.w );",

		"#endif"

	].join("\n"),

	skinning_vertex: [

		"#ifdef USE_SKINNING",

			"#ifdef USE_MORPHTARGETS",

			"vec4 skinVertex = vec4( morphed, 1.0 );",

			"#else",

			"vec4 skinVertex = vec4( position, 1.0 );",

			"#endif",

			"vec4 skinned  = boneMatX * skinVertex * skinWeight.x;",
			"skinned      += boneMatY * skinVertex * skinWeight.y;",
			"skinned      += boneMatZ * skinVertex * skinWeight.z;",
			"skinned      += boneMatW * skinVertex * skinWeight.w;",

		"#endif"

	].join("\n"),

	// MORPHING

	morphtarget_pars_vertex: [

		"#ifdef USE_MORPHTARGETS",

			"#ifndef USE_MORPHNORMALS",

			"uniform float morphTargetInfluences[ 8 ];",

			"#else",

			"uniform float morphTargetInfluences[ 4 ];",

			"#endif",

		"#endif"

	].join("\n"),

	morphtarget_vertex: [

		"#ifdef USE_MORPHTARGETS",

			"vec3 morphed = vec3( 0.0 );",
			"morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];",
			"morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];",
			"morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];",
			"morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];",

			"#ifndef USE_MORPHNORMALS",

			"morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];",
			"morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];",
			"morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];",
			"morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];",

			"#endif",

			"morphed += position;",

		"#endif"

	].join("\n"),

	default_vertex : [

		"vec4 mvPosition;",

		"#ifdef USE_SKINNING",

			"mvPosition = modelViewMatrix * skinned;",

		"#endif",

		"#if !defined(


0025A3F4  54 00 F8 7E */	srwi r0, r0, 1
/* 8025E798 0025A3F8  7C 09 03 A6 */	mtctr r0
/* 8025E79C 0025A3FC  2C 04 00 00 */	cmpwi r4, 0
/* 8025E7A0 0025A400  40 81 00 2C */	ble lbl_8025E7CC
lbl_8025E7A4:
/* 8025E7A4 0025A404  A0 83 00 00 */	lhz r4, 0(r3)
/* 8025E7A8 0025A408  54 A0 04 3E */	clrlwi r0, r5, 0x10
/* 8025E7AC 0025A40C  38 63 00 02 */	addi r3, r3, 2
/* 8025E7B0 0025A410  7C A5 22 14 */	add r5, r5, r4
/* 8025E7B4 0025A414  54 A4 04 3E */	clrlwi r4, r5, 0x10
/* 8025E7B8 0025A418  7C 00 20 40 */	cmplw r0, r4
/* 8025E7BC 0025A41C  40 81 00 0C */	ble lbl_8025E7C8
/* 8025E7C0 0025A420  38 04 00 01 */	addi r0, r4, 1
/* 8025E7C4 0025A424  54 05 04 3E */	clrlwi r5, r0, 0x10
lbl_8025E7C8:
/* 8025E7C8 0025A428  42 00 FF DC */	bdnz lbl_8025E7A4
lbl_8025E7CC:
/* 8025E7CC 0025A42C  7C A0 28 F8 */	nor r0, r5, r5
/* 8025E7D0 0025A430  54 03 04 3E */	clrlwi r3, r0, 0x10
/* 8025E7D4 0025A434  4E 80 00 20 */	blr

.global func_8025E7D8
func_8025E7D8:
/* 8025E7D8 0025A438  7C 66 1B 78 */	mr r6, r3
/* 8025E7DC 0025A43C  7C A9 03 A6 */	mtctr r5
/* 8025E7E0 0025A440  2C 05 00 00 */	cmpwi r5, 0
/* 8025E7E4 0025A444  40 81 00 20 */	ble lbl_8025E804
lbl_8025E7E8:
/* 8025E7E8 0025A448  A0 04 00 00 */	lhz r0, 0(r4)
/* 8025E7EC 0025A44C  38 84 00 02 */	addi r4, r4, 2
/* 8025E7F0 0025A450  2C 00 00 00 */	cmpwi r0, 0
/* 8025E7F4 0025A454  B0 03 00 00 */	sth r0, 0(r3)
/* 8025E7F8 0025A458  38 63 00 02 */	addi r3, r3, 2
/* 8025E7FC 0025A45C  41 82 00 08 */	beq lbl_8025E804
/* 8025E800 0025A460  42 00 FF E8 */	bdnz lbl_8025E7E8
lbl_8025E804:
/* 8025E804 0025A464  7C C3 33 78 */	mr r3, r6
/* 8025E808 0025A468  4E 80 00 20 */	blr

.global func_8025E80C
func_8025E80C:
/* 8025E80C 0025A46C  7C A9 03 A6 */	mtctr r5
/* 8025E810 0025A470  2C 05 00 00 */	cmpwi r5, 0
/* 8025E814 0025A474  40 81


   private void CheckForResolveProblems(IHighlightingConsumer consumer, IReference reference)
    {
      var resolveErrorType = reference.CheckResolveResult();
      if (resolveErrorType == null)
        throw new InvalidOperationException("ResolveErrorType is null for reference " + reference.GetType().FullName);

      if (resolveErrorType.IsAcceptable)
        return;

      // ReSharper disable once AssignNullToNotNullAttribute
      if (myResolveHighlighterRegistrar.ContainsHandler(YamlLanguage.Instance, resolveErrorType))
      {
        var highlighting = myResolveHighlighterRegistrar.GetResolveHighlighting(reference, resolveErrorType);
        if (highlighting != null)
          consumer.AddHighlighting(highlighting);
      }
      else
        consumer.AddHighlighting(new NotResolvedError(reference));
    }
  }
}


--##### Lua Engine Transparency Script for Cheat Engine
--##### Author: FreeER (based on DB code snippet)
--##### Github: https://github.com/FreeER
--##### Website: https://www.facebook.com/groups/CheatTheGame
--##### YouTube: https://www.youtube.com/channel/UCLy60mbqc3rSvh42jkpCDxw
--[[
  http://forum.cheatengine.org/viewtopic.php?t=606479
  add a menu option to make the lua engine always on top and transparent (based on given alpha value 0-255)
]]

-- START OF USER CONFIG --
local useGroupMenu = true
-- END OF CONFIG --

-- START OF EXT TEMPLATE CONFIG --
local extGroupMenuCaption = 'F&reeER\'s Extensions'
local extItemCaption = 'Lua Engine Transparency'
local requiredVersion = 6.4 -- requirement for inputQuery
-- START OF EXT TEMPLATE CONFIG --

if getCEVersion() < requiredVersion then
    error(("%s requires CE >= %d, update CE!"):format(extItemCaption, requiredVersion))
end

-- menu code --
local mf = getMainForm()
local mm = mf.Menu
local extMenu = nil

if useGroupMenu then
  -- look for existing group menu
  for i=0,mm.Items.Count-1 do
      if mm.Items.Item[i].Caption == extGroup


and_splayed_tone2",
"1f590-1f3fd": "hand_splayed_tone3",
"1f590-1f3fe": "hand_splayed_tone4",
"1f590-1f3ff": "hand_splayed_tone5",
"1f596": "vulcan",
"1f596-1f3fb": "vulcan_tone1",
"1f596-1f3fc": "vulcan_tone2",
"1f596-1f3fd": "vulcan_tone3",
"1f596-1f3fe": "vulcan_tone4",
"1f596-1f3ff": "vulcan_tone5",
"1f44b": "wave",
"1f44b-1f3fb": "wave_tone1",
"1f44b-1f3fc": "wave_tone2",
"1f44b-1f3fd": "wave_tone3",
"1f44b-1f3fe": "wave_tone4",
"1f44b-1f3ff": "wave_tone5",
"1f919": "call_me",
"1f919-1f3fb": "call_me_tone1",
"1f919-1f3fc": "call_me_tone2",
"1f919-1f3fd": "call_me_tone3",
"1f919-1f3fe": "call_me_tone4",
"1f919-1f3ff": "call_me_tone5",
"1f4aa": "muscle",
"1f4aa-1f3fb": "muscle_tone1",
"1f4aa-1f3fc": "muscle_tone2",
"1f4aa-1f3fd": "muscle_tone3",
"1f4aa-1f3fe": "muscle_tone4",
"1f4aa-1f3ff": "muscle_tone5",
"1f9b5": "leg",
"1f9b5-1f3fb": "leg_tone1",
"1f9b5-1f3fc": "leg_tone2",
"1f9b5-1f3fd": "leg_tone3",
"1f9b5-1f3fe": "leg_tone4",
"1f9b5-1f3ff": "leg_tone5",
"1f9b6": "foot",
"1f9b6-1f3fb": "foot_tone1",
"1f9b6-1f3fc": "foot_tone2",
"1f9b6-1f3fd": "foot_tone3",
"1f9b6-1f3fe": "foot_tone4",
"1f9b6-1f3ff": "foot_tone5",
"1f595": "middle_finger",
"1f595-1f3fb": "middle_finger_tone1",
"1f595-1f3fc": "middle_finger_tone2",
"1f595-1f3fd": "middle_finger_tone3",
"1f595-1f3fe": "middle_finger_tone4",
"1f595-1f3ff": "middle_finger_tone5",
"270d": "writing_hand",
"270d-1f3fb": "writing_hand_tone1",
"270d-1f3fc": "writing_hand_tone2",
"270d-1f3fd": "writing_hand_tone3",
"270d-1f3fe": "writing_hand_tone4",
"270d-1f3ff": "writing_hand_tone5",
"1f64f": "pray",
"1f64f-1f3fb": "pray_tone1",
"1f64f-1f3fc": "pray_tone2",
"1f64f-1f3fd": "pray_tone3",
"1f64f-1f3fe": "pray_tone4",
"1f64f-1f3ff": "pray_tone5",
"1f48d": "ring",
"1f484": "lip


_id: 'ChIJpwmMR7pLHRUR98g1DgIgZ4c'
    }
  },
  {
    name: 'Ramat-Gan',
    company: 'gett',
    info: {
      formatted_address: 'Ramat Gan, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJreSU54ZMHRURb1IX5z6_AC0'
    }
  },
  {
    name: 'Rehovot',
    company: 'gett',
    info: {
      formatted_address: 'Rehovot, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJj-W_kgW3AhURV_lYF8v4re4'
    }
  },
  {
    name: 'Netaniya',
    company: 'gett',
    info: {
      formatted_address: 'Netanya, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJ1XXAkwRAHRURIj88VL6V2Sw'
    }
  },
  {
    name: 'Kfar Saba',
    company: 'gett',
    info: {
      formatted_address: 'Kefar Sava, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJX5VRIbM5HRURajf6VPPFUI4'
    }
  },
  {
    name: 'Holon',
    company: 'gett',
    info: {
      formatted_address: 'Holon, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJOb8zDLu0AhURLeclBWR53fs'
    }
  },
  {
    name: 'Tel Aviv',
    company: 'gett',
    info: {
      formatted_address: 'Tel Aviv-Yafo, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJH3w7GaZMHRURkD-WwKJy-8E'
    }
  },
  {
    name: 'Haifa',
    company: 'gett',
    info: {
      formatted_address: 'Haifa, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJRegNdUy6HRURmlKBKpgjXcM'
    }
  },
  {
    name: 'Jerusalem',
    company: 'gett',
    info: {
      formatted_address: 'Jerusalem, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJS_zBNNbXAhURy-FuRT5ib9k'
    }
  },
  {
    name: 'Rishon Lezion',
    company: 'gett',
    info: {
      formatted_address: 'Rishon LeTsiyon, Israel',
      country: {
        long_name: 'Israel',
        short_name: 'IL',
        types: ['country', 'political']
      },
      place_id: 'ChIJ_2arJzi0AhURuHoaV0rFvBc'
    }
  },
  {
    name: 'Petah Tikva',


 semi-blue (keywords)
    Purple      = H'A6E22E',    -- light-grass-green
  },
}

-- add more of the specified color (keeping all in 0-255 range)
local mixer = function(c, n, more)
  if not c or #c == 0 then return c end
  local c = {c[1], c[2], c[3]} -- create a copy, so it can be modified
  c[n] = c[n] + more
  local excess = c[n] - 255
  if excess > 0 then
    for clr = 1, 3 do
      c[clr] = n == clr and 255 or c[clr] > excess and c[clr] - excess or 0
    end
  end
  return c
end

local C = colors[theme] or colors.Tomorrow
local isdefault = theme:find("^Default") or false
return {
  -- wxstc.wxSTC_LUA_DEFAULT
  lexerdef = {fg = C.Foreground},
  -- wxstc.wxSTC_LUA_COMMENT, wxstc.wxSTC_LUA_COMMENTLINE, wxstc.wxSTC_LUA_COMMENTDOC
  comment = {fg = C.Comment, fill = true},
  -- wxstc.wxSTC_LUA_STRING, wxstc.wxSTC_LUA_CHARACTER, wxstc.wxSTC_LUA_LITERALSTRING
  stringtxt = {fg = C.Green},
  -- wxstc.wxSTC_LUA_STRINGEOL
  stringeol = {fg = C.Green, fill = true},
  -- wxstc.wxSTC_LUA_PREPROCESSOR
  preprocessor = {fg = C.Orange},
  -- wxstc.wxSTC_LUA_OPERATOR
  operator = {fg = C.Aqua},
  -- wxstc.wxSTC_LUA_NUMBER
  number = {fg = C.Red},

  -- wxstc.wxSTC_LUA_WORD, wxstc.wxSTC_LUA_WORD2-8
  keywords0 = {fg = C.Blue, b = not isdefault},
  keywords1 = {fg = C.Purple, b = false},
  keywords2 = {fg = C.Purple, b = not isdefault },
  keywords3 = {fg = C.Purple, b = false},
  keywords4 = {fg = C.Purple, b = false},
  keywords5 = {fg = C.Purple, b = false},
  keywords6 = {fg = C.Purple, b = false},
  keywords7 = {fg = C.Purple, b = false},

  -- common (inherit fg/bg from text)
  -- wxstc.wxSTC_LUA_IDENTIFIER
  text = {fg = C.Foreground, bg = C.Background},
  linenumber = {fg = C.Comment},
  bracematch = {fg = C.Orange, b = true},
  bracemiss = {fg = C.Red, b = true},
  ctrlchar = {fg = C.Yellow},
  indent = {fg = C.Comment},
  calltip = {fg = C.Foreground, bg = C.Background},

  -- common special (need custom fg & bg)
  sel = {bg = C.Selection},
  caret = {fg = C.Foreground},
  caretlinebg = {bg = C.CurrentLine},
  fold = {fg = C.Comment, bg = C.Background, sel = mixer(C.Comment, 1, 96)},
  whitespace = {fg = C.Comment},
  edge = {},

  indicator = isdefault and {
    fncall = nil,
    varlocal = nil,
    varglobal = nil,
    varmasking = nil,
    varmasked = {},
  } or {
    fncall = {fg = C.Purple, st = wxstc.wxSTC_INDIC_HIDDEN},
    --[[ other possible values are:
      wxSTC_INDIC_PLAIN	 Single-line underline
      wxSTC


 setFloat(int index, float value) {
        values[index] = value;
    }

    @Override
    public GGMLType type() {
        return GGMLType.F32;
    }

    @Override
    public MemorySegment asMemorySegment() {
        return MemorySegment.ofArray(values);
    }

    @Override
    public FloatTensor fillInPlace(int thisOffset, int size, float value) {
        Arrays.fill(values, thisOffset, thisOffset + size, value);
        return this;
    }

    @Override
    public FloatVector getFloatVector(VectorSpecies<Float> species, int index) {
        if (!USE_VECTOR_API) {
            throw new UnsupportedOperationException();
        }
        return FloatVector.fromArray(species, values, index);
    }
}
/*
 * This file is part of Tornado: A heterogeneous programming framework:
 * https://github.com/beehive-lab/tornadovm
 *
 * Copyright (c) 2021, APT Group, Department of Computer Science,
 * School of Engineering, The University of Manchester. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */
package uk.ac.manchester.tornado.drivers.spirv.timestamps;

import uk.ac.manchester.tornado.api.profiler.ProfilerType;
import uk.ac.manchester.tornado.drivers.spirv.SPIRVDeviceContext;
import uk.ac.manchester.tornado.drivers.spirv.SPIRVLevelZeroCommandQueue;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroByteBuffer;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroCommandList;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroContext;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.LevelZeroDevice;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.Sizeof;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeDeviceProperties;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventDescriptor;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventHandle;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventPoolDescriptor;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventPoolFlags;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventPoolHandle;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeEventScopeFlags;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeHostMemAllocDescriptor;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.ZeKernelTimeStampResult;
import uk.ac.manchester.tornado.drivers.spirv.levelzero.utils.LevelZeroUtils;
import uk.ac.manchester.tornado.runtime.common.TornadoOptions;
import uk.ac.manchester.tornado.runtime.tasks.meta.TaskDataContext;

public class LevelZeroKernelTimeStamp {

    private ZeKernelTimeStampResult resultKernel;
    private LevelZeroByteBuffer timeStampBuffer;
    private ZeEventPoolHandle eventPoolHandle;
    private SPIRVDeviceContext deviceContext;
    private LevelZeroCommandList commandList;
    private ZeEventHandle kernelEventTimer;
    private SPIRVLev


)

   shape.point(vec2(W/2,H/2), 48, vec4(1,0,0,1))
   shape.point(vec2(W/2,H/2), 24, vec4(0,1,0,1))
   shape.line(vec2(0,0), vec2(W/3,H/3), 2, vec4(0,0,0,1), 8)
   P = vec2(W,0)
   dir = vec2(-W,H):normalize()
   shape.point(P, 48, vec4(1,1,0,1))
   shape.linedir(P, dir*100, 8, vec4(0,0,0,1))

   P1 = vec2(W/2,H/2)
   P2 = P1/2
   shape.rect(P1, P2, 0, 4, vec4(0,0,0,.7), 8)
   shape.box(P1-P2, P1+P2, 0.2, 'fill', vec4(1,0,0,.2), 12)
   shape.square(vec2(W/2, H/2), W/2, 0, 'fill', vec4(0,1,0,.2))
   shape.circle(vec2(W/2,H/2), H/8, 16, vec4(0,0,1,1))
   shape.circle(vec2(W/2,H/2), H/8, 'fill', vec4(0,1,0,.4))
   shape.circle(vec2(W/2,H/2), H/8, 16, vec4(0,0,1,1))
   shape.circle(.75*vec2(W,H), H/10, 'fill', vec4(1,0,0,1))
   shape.circle(.75*vec2(W,H), H/9, 1, vec4(0,0,0,1), 4)
   shape.point(vec2(0,0), 24, vec4(0,0,1,1))
   shape.point(vec2(W/3,H/3), 24, vec4(0,0,1,1))
   shape.box(vec2(0,H/2), vec2(W/2,H), math.pi/4, 'fill', vec4(.5,.5,.5,.7))
   shape.box(vec2(W/2,H/2), vec2(W,H), .2, 8, vec4(1,.5,.5,.7))
   shape.square(vec2(W/2,H/2), W/4, .6, 4, vec4(1,0,1,.7))
   shape.rect(vec2(W/2,H/2), vec2(1,1)*W/3, 0.5, 'fill', vec4(1,.5,.5,.7))
   shape.rect(vec2(W/2,H/2), vec2(1,1)*W/3, 0.2, 4, vec4(0,0,0,.7))

   glfw.swap_buffers(window)
   collectgarbage()
end


elligentmodel",
             "智能模型的信息类。 msdk 5.15.0开始支持",
             "ismarttrackmissionmanager",
             "跟随任务管理类。 msdk 5.14.0开始支持",
             "ispotlightmanager",
             "聚焦任务管理类。 msdk 5.14.0开始支持",
             "ipoimissionmanager",
             "环绕任务管理类。 msdk 5.14.0开始支持",
             "iflytomissionmanager",
             "飞向目标点任务管理类。 msdk 5.14.0开始支持",
             "onautosensinginfoupdate",
             "当自动识别信息发生变化时会回调此方法。 msdk 5.14.0开始支持  @param info 自动识别信息",
             "ontrackingtargetupdate",
             "当跟随目标发生变化时会回调此方法。 msdk 5.14.0开始支持  @param target 跟随目标信息",
             "onintelligentmodelupdate",
             "当智能模型列表发生变化时会回调此方法。 msdk 5.15.0开始支持  @param models 智能模型列表",
             "onrunningintelligentmodelupdate",
             "当运行智能模型发生变化时会回调此方法。 msdk 5.15.0开始支持  @param modelid 运行中的模型id",
             "gettargettype",
             "获取聚焦功能的目标类型。  @return 返回聚焦功能的目标类型。",
             "settargettype",
             "设置聚焦功能的目标类型。  @param targettype 聚焦功能的目标类型。",
             "gettargetindex",
             "获取聚焦功能的目标索引。  @return 返回聚焦功能的目标索引。",
             "settargetindex",
             "设置聚焦功能的目标索引。  @param targetindex 聚焦功能的目标索引。",
             "gettargetlocation",
             "获取聚焦功能的目标位置。  @return 返回聚焦功能的目标位置。",
             "settargetlocation",
             "设置聚焦功能的目标位置。  @param targetlocation 聚焦功能的目标位置。",
             "gettargetrect",
             "获取聚焦功能的目标区域。  @return 返回聚焦功能的目标区域。",
             "settargetrect",
             "设置聚焦功能的目标区域。  @param targetrect 聚焦功能的目标区域。",
             "getsupportedtargettypes",
             "获取聚焦功能支持的目标类型。  @return 返回聚焦功能支持的目标类型。",
             "addmissioncapabilitylistener",
             "添加聚焦功能的能力集监听器。用于获取不同的机型的能力集。 msdk 5.14.0开始支持  @param listener 聚焦功能的能力集�


 BitArray maskBits = new BitArray();
    maskBits.appendBits(TYPE_INFO_MASK_PATTERN, 15);
    bits.xor(maskBits);

    if (bits.getSize() != 15) {  // Just in case.
      throw new WriterException("should not happen but we got: " + bits.getSize());
    }
  }

  // Make bit vector of version information. On success, store the result in "bits" and return true.
  // See 8.10 of JISX0510:2004 (p.45) for details.
  static void makeVersionInfoBits(Version version, BitArray bits) throws WriterException {
    bits.appendBits(version.getVersionNumber(), 6);
    int bchCode = calculateBCHCode(version.getVersionNumber(), VERSION_INFO_POLY);
    bits.appendBits(bchCode, 12);

    if (bits.getSize() != 18) {  // Just in case.
      throw new WriterException("should not happen but we got: " + bits.getSize());
    }
  }

  // Check if "value" is empty.
  private static boolean isEmpty(int value) {
    return value == -1;
  }

  private static void embedTimingPatterns(ByteMatrix matrix) {
    // -8 is for skipping position detection patterns (size 7), and two horizontal/vertical
    // separation patterns (size 1). Thus, 8 = 7 + 1.
    for (int i = 8; i < matrix.getWidth() - 8; ++i) {
      int bit = (i + 1) % 2;
      // Horizontal line.
      if (isEmpty(matrix.get(i, 6))) {
        matrix.set(i, 6, bit);
      }
      // Vertical line.
      if (isEmpty(matrix.get(6, i))) {
        matrix.set(6, i, bit);
      }
    }
  }

  // Embed the lonely dark dot at left bottom corner. JISX0510:2004 (p.46)
  private static void embedDarkDotAtLeftBottomCorner(ByteMatrix matrix) throws WriterException {
    if (matrix.get(8, matrix.getHeight() - 8) == 0) {
      throw new WriterException();
    }
    matrix.set(8, matrix.getHeight() - 8, 1);
  }

  private static void embedHorizontalSeparationPattern(int xStart,
                                                       int yStart,
                                                       ByteMatrix matrix) throws WriterException {
    for (int x = 0; x < 8; ++x) {
      if (!isEmpty(matrix.get(xStart + x, yStart))) {
        throw new WriterException();
      }
      matrix.set(xStart + x, yStart, 0);
    }
  }

  private static void embedVerticalSeparationPattern(int xStart,
                                                     int yStart,
                                                     ByteMatrix matrix) throws WriterException {
    for (int y = 0; y < 7; ++y) {
      if (!isEmpty(matrix.get(xStart, yStart + y))) {
        throw new WriterException();
      }
      matrix.set(xStart, yStart + y, 0);
    }
  }

  private static void embedPositionAdjustmentPattern(int xStart, int yStart, ByteMatrix matrix) {
    for (int y = 0; y < 5; ++y) {
      int[] patternY = POSITION_ADJUSTMENT_PATTERN[y];
      for (int x = 0; x < 5; ++x) {
        matrix.set(xStart + x, yStart + y, patternY[x]);
      }
    }
  }

  private static void embedPositionDetectionPattern(int xStart, int yStart, ByteMatrix matrix) {
    for (int y = 0; y < 7; ++y) {
      int[] patternY = POSITION_DETECTION_PATTERN[y];
      for (int x = 0; x < 7; ++x) {
        matrix.set(xStart + x, yStart +


), NodeLabel.newInstance("y")));
    mgr.addLabelsToNode(ImmutableMap.of(NodeId.newInstance("h1", 0), toSet("x")));

    // inject node label manager
    MockRM rm1 = new MockRM(TestUtils.getConfigurationWithQueueLabels(conf)) {
      @Override
      public RMNodeLabelsManager createNodeLabelManager() {
        return mgr;
      }
    };

    rm1.getRMContext().setNodeLabelManager(mgr);
    rm1.start();
    MockNM nm1 = rm1.registerNode("h1:1234", 8 * GB); // label = y
    MockNM nm2 = rm1.registerNode("h2:1234", 100 * GB); // label = <empty>

    ContainerId nextContainerId;

    // launch an app to queue b1 (label = y), AM container should be launched in nm3
    MockRMAppSubmissionData data =
        MockRMAppSubmissionData.Builder.createWithMemory(1 * GB, rm1)
            .withAppName("app")
            .withUser("user")
            .withAcls(null)
            .withQueue("b1")
            .withUnmanagedAM(false)
            .build();
    RMApp app1 = MockRMAppSubmitter.submit(rm1, data);
    MockAM am1 = MockRM.launchAndRegisterAM(app1, rm1, nm2);

    // request containers from am2, priority=1 asks for "" * 6 (id from 4 to 9),
    // nm2/nm3 do
    // heartbeat at the same time, check containers are always allocated to nm3.
    // This is to verify when there's resource available in non-labeled
    // partition, non-labeled resource should allocate to non-labeled partition
    // first.
    am1.allocate("*", 1 * GB, 6, 1, new ArrayList<ContainerId>(), "");
    for (int i = 2; i < 2 + 6; i++) {
      nextContainerId =
          ContainerId.newContainerId(am1.getApplicationAttemptId(), i);
      assertTrue(rm1.waitForState(Arrays.asList(nm1, nm2),
          nextContainerId, RMContainerState.ALLOCATED));
    }
    // no more container allocated on nm1
    checkLaunchedContainerNumOnNode(rm1, nm1.getNodeId(), 0);
    // all 7 (1 AM container + 6 task container) containers allocated on nm2
    checkLaunchedContainerNumOnNode(rm1, nm2.getNodeId(), 7);

    rm1.close();
  }

  @Test
  public void testPreferenceOfQueuesTowardsNodePartitions()
      throws Exception {
    /**
     * Test case: have a following queue structure:
     *
     * <pre>
     *            root
     *         /   |   \
     *        a     b    c
     *       / \   / \  /  \
     *      a1 a2 b1 b2 c1 c2
     *     (x)    (x)   (x)
     * </pre>
     *
     * Only a1, b1, c1 can access label=x, and their default label=x Each each
     * has one application, asks for 5 containers. NM1 has label=x
     *
     * NM1/NM2 doing heartbeat for 15 times, it should allocate all 15
     * containers with label=x
     */

    CapacitySchedulerConfiguration csConf =
        new CapacitySchedulerConfiguration(this.conf);

    // Define top-level queues
    csConf.setQueues(ROOT, new String[] {"a", "b", "c"});
    csConf.setCapacityByLabel(ROOT, "x", 100);

    csConf.setCapacity(A, 33);
    csConf.setAccessibleNodeLabels(A, toSet("x"));
    csConf.setCapacityByLabel(A, "x",