}

pub fn eval(env: Rc<RefCell<Env>>, program: &Program) -> Result<Value> {
    let res = try!(eval_block_stmt(env, &program.0));
    Ok(unwrap_return!(res))
}

fn eval_block_stmt(env: Rc<RefCell<Env>>, block: &BlockStmt) -> Result<Value> {
    let mut res = Rc::new(Value::Null);

    for stmt in block {
        res = try!(eval_stmt(env.clone(), stmt));
        match res.as_ref() {
            &Value::Return(..) => break,
            _ => continue,
        }
    }

    return Ok(res);
}

fn eval_stmt(env: Rc<RefCell<Env>>, stmt: &Stmt) -> Result<Value> {
    match stmt {
        &Stmt::Expr(ref expr) => eval_expr(env, expr),
        &Stmt::Return(ref expr) => {
            let val = try!(eval_expr(env, expr));
            ret(Value::Return(val))
        }
        &Stmt::Let(ref ident, ref expr) => eval_let_stmt(env, ident, expr),
    }
}

fn eval_let_stmt(env: Rc<RefCell<Env>>, ident: &Ident, expr: &Expr) -> Result<Value> {
    let val = try!(eval_expr(env.clone(), &expr));
    env.borrow_mut().insert_var(ident.clone(), val.clone());
    Ok(val)
}

fn eval_expr(env: Rc<RefCell<Env>>, expr: &Expr) -> Result<Value> {
    match expr {
        &Expr::Ident(ref i) => eval_ident(env, i),
        &Expr::Lit(ref l) => eval_literal(l),
        &Expr::Prefix(ref p, ref expr) => eval_prefix(env, p, expr),
        &Expr::Infix(ref i, ref left, ref right) => eval_infix(env, i, left, right),
        &Expr::If {
            ref cond,
            ref con,
            ref alt,
            ..
        } => eval_if(env, cond, con, alt),
        &Expr::Fn {
            ref params,
            ref body,
            ..
        } => eval_fn(env, params, body),
        &Expr::Call { ref func, ref args } => eval_call(env, func, args),
        &Expr::Array(ref arr, ..) => eval_array(env, arr),
        &Expr::Hash(ref hash, ..) => eval_hash(env, hash),
        &Expr::Index {
            ref target,
            ref index,
        } => eval_index(env, target, index),
    }
}

fn eval_ident(env: Rc<RefCell<Env>>, ident: &Ident) -> Result<Value> {
    match env.borrow().get_var(&ident) {
        Some(val) => Ok(val),
        None => throw(format!("identifier not found: {}", ident.0), ident.pos()),
    }
}

fn eval_literal(lit: &Literal) -> Result<Value> {
    match lit {
        &Literal::Bool(b, ..) => ret(Value::Bool(b)),
        &Literal::Int(i, ..) => ret(Value::Int(i)),
        &Literal::String(ref s, ..) => ret(Value::String(s.clone())),
    }
}

macro_rules! force_eval {
    ($env:expr, $expr:expr, $type:ident, $not_found_name:expr) => {{
        let pos = $expr.pos();
        let result = try!(eval_expr($env, $expr));
        match result.as_ref() {
            &Value::$type(ref v) => v.clone(),


        }
        #[stdcall_win]
        extern fn _5(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_drag_handler_t {
            //println!("drag");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _6(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_find_handler_t {
            //println!("find");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _7(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_focus_handler_t {
            //println!("focus");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _8(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_geolocation_handler_t {
            //println!("geo");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _9(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_jsdialog_handler_t {
            //println!("js");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _10(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_keyboard_handler_t {
            //println!("keyboard");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _11(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_life_span_handler_t {
            //println!("lifespan");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _12(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_load_handler_t {
            //println!("load");
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _13<T : BrowserClient>(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_render_handler_t {
            //println!("render");
            unsafe {
                let this: &mut BrowserClientWrapper<T> = unsafe_downcast_mut(&mut *_self);
                this.callback.get_render_handler()
                    .map(|x| upcast_ptr(RenderHandlerWrapper::new(x)))
                    .unwrap_or_else(|| zeroed())
            }
        }
        #[stdcall_win]
        extern fn _14<T : BrowserClient>(_self: *mut ffi::cef_client_t) -> *mut ffi::cef_request_handler_t {
            unsafe { zeroed() }
        }
        #[stdcall_win]
        extern fn _15<T : BrowserClient>(
            _self: *mut ffi::cef_client_t,
            browser: *mut ffi::cef_browser_t,
            source_process: ffi::cef_process_id_t,
            message: *mut ffi::cef_process_message_t) -> libc::c_int
        {
            //println!("message");
            unsafe {
                let this: &mut BrowserClientWrapper<T> = unsafe_downcast_mut(&mut *_self);
                this.callback.on_process_message_received(
                    cast_mut_ref(&mut *browser),
                    match source_process {
                        ffi::PID_BROWSER => ProcessID::Browser,
                        ffi::PID_RENDERER => ProcessID::Renderer,
                        _ => panic!("Invalid source process ID passed to on_process_message_received by CEF!")
                    },
                    cast_mut_ref(&mut *message)) as libc::c_int
            }
        }
        CefRc::make(move |base| {
            BrowserClientWrapper {
                vtable: ffi::cef_client_t {
                    base: base,


 private const val ENTITY_NAME = "name"
    private const val ENTITY_ID = "id"

    private val SNBT_CODEC: Codec<CompoundTag, String, CommandSyntaxException, RuntimeException> =
        Codec.codec({ SNBTParser.parse(it) }, { it.asString() })

    override fun deserializeShowItem(input: Component): HoverEvent.ShowItem {
        return try {
            val nbt = SNBT_CODEC.decode(PlainTextComponentSerializer.plainText().serialize(input))
            val tag = nbt.getCompound(ITEM_TAG)
            val holder = if (!tag.isEmpty) BinaryTagHolder.encode(tag, SNBT_CODEC) else null
            HoverEvent.ShowItem.of(Key.key(nbt.getString(ITEM_TYPE)), nbt.getByte(ITEM_COUNT).toInt(), holder)
        } catch (exception: CommandSyntaxException) {
            throw IOException(exception)
        }
    }

    override fun deserializeShowEntity(input: Component, decoder: Codec.Decoder<Component, String, out RuntimeException>): HoverEvent.ShowEntity {
        return try {
            val nbt = SNBT_CODEC.decode(PlainTextComponentSerializer.plainText().serialize(input))
            val name = decoder.decode(nbt.getString(ENTITY_NAME))
            HoverEvent.ShowEntity.of(Key.key(nbt.getString(ENTITY_TYPE)), UUID.fromString(nbt.getString(ENTITY_ID)), name)
        } catch (exception: CommandSyntaxException) {
            throw IOException(exception)
        }
    }

    override fun serializeShowItem(input: HoverEvent.ShowItem): Component {
        val tag = ImmutableCompoundTag.builder().putString(ITEM_TYPE, input.item().asString()).putByte(ITEM_COUNT, input.count().toByte())
        try {
            input.nbt()?.let { tag.put(ITEM_TAG, it.get(SNBT_CODEC)) }
        } catch (exception: CommandSyntaxException) {
            throw IOException(exception)
        }
        return Component.text(SNBT_CODEC.encode(tag.build()))
    }

    override fun serializeShowEntity(input: HoverEvent.ShowEntity, encoder: Codec.Encoder<Component, String, out RuntimeException>): Component {
        val tag = ImmutableCompoundTag.builder().putString(ENTITY_ID, input.id().toString()).putString(ENTITY_TYPE, input.type().asString())
        input.name()?.let { tag.putString(ENTITY_NAME, encoder.encode(it)) }
        return Component.text(SNBT_CODEC.encode(tag.build()))
    }
}
/*
 * This file is part of the Krypton project, licensed under the Apache License v2.0
 *
 * Copyright (C) 2021-2023 KryptonMC and the contributors of the Krypton project
 *
 * 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.
 */
package org.kryptonmc.krypton.shapes.discrete

import org.kryptonmc.api.util.Direction
import org.kryptonmc.krypton.util.math.Maths

class SliceDiscreteVoxelShape(
    private val parent: DiscreteVoxelShape,
    private val startX: Int,
    private val startY: Int,
    private val startZ: Int,
    private val endX: Int,
    private val endY: Int,
    private val endZ: Int
) : DiscreteVoxelShape(endX - startX, endY -


.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Correct inability to style clickable `input` types in iOS.
 * 3. Improve usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
 *    Known issue: inner spacing remains in IE 6.
 */

button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
    -webkit-appearance: button; /* 2 */
    cursor: pointer; /* 3 */
    *overflow: visible;  /* 4 */
}

/**
 * Re-set default cursor for disabled elements.
 */

button[disabled],
html input[disabled] {
    cursor: default;
}

/**
 * 1. Address box sizing set to content-box in IE 8/9.
 * 2. Remove excess padding in IE 8/9.
 * 3. Remove excess padding in IE 7.
 *    Known issue: excess padding remains in IE 6.
 */

input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
    *height: 13px; /* 3 */
    *width: 13px; /* 3 */
}

/**
 * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
 * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
 *    (include `-moz` to future-proof).
 */

input[type="search"] {
    -webkit-appearance: textfield; /* 1 */
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box; /* 2 */
    box-sizing: content-box;
}

/**
 * Remove inner padding and search cancel button in Safari 5 and Chrome
 * on OS X.
 */

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/**
 * Remove inner padding and border in Firefox 3+.
 */

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/**
 * 1. Remove default vertical scrollbar in IE 6/7/8/9.
 * 2. Improve readability and alignment in all browsers.
 */

textarea {
    overflow: auto; /* 1 */
    vertical-align: top; /* 2 */
}

/* ==========================================================================
   Tables
   ========================================================================== */

/**
 * Remove most spacing between table cells.
 */

table {
    border-collapse: collapse;
    border-spacing: 0;
}
/* Ion.RangeSlider, Nice Skin
// css version 1.5.11
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/

/* =====================================================================================================================
// Skin details */

.irs-line-mid,
.irs-line-left,
.irs-line-right,
.irs-diapason,
.irs-slider {
    background:#E5E5E5;
}

.irs-diapason {
    background: #ffb848;
}

.irs {
    height: 40px;
}
.irs-with-grid {
    height: 60px;
}
.irs-line {
    height: 8px; top: 25px;
}
    .irs-line-left {
        height: 8px;
    }
    .irs-line-mid {
        height: 8


blic event EventHandler<DocumentId> ActiveDocumentChanged
            {
                add => _inner.ActiveDocumentChanged += value;
                remove => _inner.ActiveDocumentChanged -= value;
            }

            public event EventHandler<EventArgs> NonRoslynBufferTextChanged
            {
                add => _inner.NonRoslynBufferTextChanged += value;
                remove => _inner.NonRoslynBufferTextChanged -= value;
            }

            public DocumentId GetActiveDocument() => _inner.GetActiveDocument();

            public ImmutableArray<DocumentId> GetVisibleDocuments() => _inner.GetVisibleDocuments();

            public DocumentId? TryGetActiveDocument() => _inner.TryGetActiveDocument();
        }

        public IWorkspaceService? CreateService(HostWorkspaceServices workspaceServices)
        {
            var innerService = workspaceServices.GetService<IDocumentTrackingService>();
            return innerService != null ? new DocumentTrackingService(innerService) : null;
        }
    }
}


@override
  int finish(fb.Builder fbBuilder) {
    final int? dvecOffset = _dvec == null ? null
        : fbBuilder.writeListFloat64(_dvec!);
    final int? fvecOffset = _fvec == null ? null
        : fbBuilder.writeListFloat32(_fvec!);
    fbBuilder.startTable(11);
    fbBuilder.addFloat64(0, _d0);
    fbBuilder.addFloat64(1, _d1);
    fbBuilder.addFloat64(2, _d2);
    fbBuilder.addFloat64(3, _d3);
    fbBuilder.addFloat32(4, _f0);
    fbBuilder.addFloat32(5, _f1);
    fbBuilder.addFloat32(6, _f2);
    fbBuilder.addFloat32(7, _f3);
    fbBuilder.addOffset(8, dvecOffset);
    fbBuilder.addOffset(9, fvecOffset);
    return fbBuilder.endTable();
  }

  /// Convenience method to serialize to byte list.
  @override
  Uint8List toBytes([String? fileIdentifier]) {
    final fbBuilder = fb.Builder(deduplicateTables: false);
    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
    return fbBuilder.buffer;
  }
}
// automatically generated by the FlatBuffers compiler, do not modify
// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable

import 'dart:typed_data' show Uint8List;
import 'package:flat_buffers/flat_buffers.dart' as fb;

class OptionsEnum {
  final int value;
  const OptionsEnum._(this.value);

  factory OptionsEnum.fromValue(int value) {
    final result = values[value];
    if (result == null) {
        throw StateError('Invalid value $value for bit flag enum OptionsEnum');
    }
    return result;
  }

  static OptionsEnum? _createOrNull(int? value) =>
      value == null ? null : OptionsEnum.fromValue(value);

  static const int minValue = 1;
  static const int maxValue = 3;
  static bool containsValue(int value) => values.containsKey(value);

  static const OptionsEnum A = OptionsEnum._(1);
  static const OptionsEnum B = OptionsEnum._(2);
  static const OptionsEnum C = OptionsEnum._(3);
  static const Map<int, OptionsEnum> values = {
    1: A,
    2: B,
    3: C};

  static const fb.Reader<OptionsEnum> reader = _OptionsEnumReader();

  @override
  String toString() {
    return 'OptionsEnum{value: $value}';
  }
}

class _OptionsEnumReader extends fb.Reader<OptionsEnum> {
  const _OptionsEnumReader();

  @override
  int get size => 4;

  @override
  OptionsEnum read(fb.BufferContext bc, int offset) =>
      OptionsEnum.fromValue(const fb.Uint32Reader().read(bc, offset));
}

class MyTable {
  MyTable._(this._bc, this._bcOffset);
  factory MyTable(List<int> bytes) {
    final rootRef = fb.BufferContext.fromBytes(bytes);
    return reader.read(rootRef, 0);
  }

  static const fb.Reader<MyTable> reader = _MyTableReader();

  final fb.BufferContext _bc;
  final int _bcOffset;

  List<OptionsEnum>? get options => const fb.ListReader<OptionsEnum>(OptionsEnum.reader).vTableGetNullable(_bc, _bcOffset, 4);

  @override
  String toString() {
    return 'MyTable{options: ${options}}';
  }

  MyTableT unpack() => MyTableT(
      options: const fb.ListReader<OptionsEnum>(OptionsEnum.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 4));

  static int pack(fb.Builder fbBuilder, MyTableT? object) {
    if (object == null) return 0;
    return object.pack(fbBuilder);
  }
}

class MyTableT implements fb.Packable {
  List<OptionsEn


T5nACxYR+IiL8wUACQhFtihxMwoVPIIQOWnEYGBAAIfkECQAAyAAsBAAGAAgABgAACCQAkQkcWGygwQIGBUY6NmBgAxAthiGrEwHMlE4PBqqSAkvNwIAAIfkEBQAAyAAsAAAAAAwADAAACDUAkQkcSLCgwYMIEypcyJBgMWEKCxBLGOzYAIFG4hA0dmwYQTuoRuxZRcBYwVRuPJ1BI2BgQAAh+QQFAADIACwBAAYABwAGAAAIIQAnIBtI0AZBgmYaHUQmRAmQhYYOpbCSwMBAAV0cHCAWEAAh+QQJAADIACwAAAUABgAHAAAIIgCHIBs4cIsigshYVcFFEBKmDgQrwHmUBqGFWwYSICR2ICAAIfkEBQAAyAAsAAAAAAwADAAACC8AkQkcSLCgwYMIEw78lUPhjTAKeV1RGOWUwhCARCkcdsyYwmLADCRIKIDYAYMBAQAh+QQJAADIACwAAAEABAAIAAAIIwCRIXtwAZkYCmxsSdKDrFQPDMgqrRA4ipNAYgAEDjgWDFlAACH5BAkAAMgALAAAAAAMAAwAAAgzAJEJHEhwYIMTsmL9KSjQCRUeDAXu0oQjosBedCwKBLBGIzJhkzwSA+BxwLFgHlOqVBkQACH5BAkAAMgALAAAAAAMAAwAAAhjAJEJ3HTEVAQIAQQqtDTj06s+T4AFUxiMxiUdCo0dU4AswDEsCjMuCFCMQMiQBYgBKHZSYTFhwli2RPZS5UxkKQccm3gy2LEByIYdMxZS4zCXwAwkSGCAANGQAogdOEBMgMKAACH5BAkAAMgALAAAAAAMAAwAAAhjAJEJHFDLi48PAQQqHAasRBNGgrJkUhgMmDGFFcrIUIAswLFhChUaWxCgGIGQIQsQA1AMpcJiwoS1dIkM5kqayFQOOBbMZbBjA5ANO3ZR5MeXwAwkSGCAQFGFAogdOEBMgMKAACH5BAUAAMgALAAAAAAMAAwAAAhgAJEJHEiQ4DBgABC4iuGL1sBgwIwNXEJoRyJkAY4NK4gsA5QAxQhwFIiCGIBiI5HJESYM5chiwkymLEBswLFgHIMdG4Bs2DGJA41pHFgMmIEECQwQADpQALEDB4gJGBgQADs=) no-repeat center;
  vertical-align: middle;
  margin: 0 5px;
}
.uxcore .kuma-upload-filelist.nwmode .kuma-upload-fileitem-img .field-image-info .filename {
  font-size: 12px;
  vertical-align: middle;
  white-space: nowrap;
}
.uxcore .kuma-upload-filelist.nwmode .kuma-upload-fileitem-img .field-status {
  float: right;
  margin-top: 17px;
  margin-right: 5px;
}
.uxcore .kuma-upload-filelist.nwmode .kuma


local api = vim.api
local fn = vim.fn
local cmd = vim.cmd

local async = require('async')
local path = require('fundo.fs.path')
local fs = require('fundo.fs')
local utils = require('fundo.utils')

---@class FundoUndo
---@field dir string
---@field bufnr number
---@field attached boolean
local Undo = {}

function Undo:new(bufnr, dir)
    local o = setmetatable({}, self)
    self.__index = self
    o.bufnr = bufnr
    o.dir = dir
    return o
end

function Undo:attach()
    local bt = vim.bo[self.bufnr].bt
    local name = api.nvim_buf_get_name(self.bufnr)
    if path.dirname(name) == self.dir then
        vim.bo[self.bufnr].undofile = false
    end
    self.attached = (bt == '' or bt == 'acwrite') and vim.bo[self.bufnr].undofile
    if self.attached then
        self:reset()
    end
    return self.attached
end

function Undo:dispose()
    self.attached = false
end

---
---@param dirty? boolean
---@param bufName? string
function Undo:reset(dirty, bufName)
    if not self.attached then
        return
    end
    local name = bufName or api.nvim_buf_get_name(self.bufnr)
    if name ~= self.name then
        self.undoPath = fn.undofile(name)
        local basename = path.basename(self.undoPath)
        self.fallbackPath = path.join(self.dir, basename)
    end
    self.name = name
    self.isDirty = dirty and self.undoPath ~= '' and vim.bo[self.bufnr].undolevels ~= 0
end

function Undo:isEmpty()
    local res = utils.bufCall(self.bufnr, function()
        return api.nvim_exec('undolist', true)
    end)
    return not res:match('^number')
end

function Undo:loadUndo()
    return utils.bufCall(self.bufnr, function()
        return pcall(cmd, 'sil rundo ' .. fn.fnameescape(self.undoPath))
    end)
end

function Undo:loadFileAndUndo(


235,225,1) 10%,rgba(231,226,212,1) 80%,rgba(229,223,208,1) 100%);
    background: -ms-linear-gradient(top,  rgba(231,228,219,1) 0%,rgba(238,235,225,1) 10%,rgba(231,226,212,1) 80%,rgba(229,223,208,1) 100%);
    background: linear-gradient(to bottom,  rgba(231,228,219,1) 0%,rgba(238,235,225,1) 10%,rgba(231,226,212,1) 80%,rgba(229,223,208,1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e7e4db', endColorstr='#e5dfd0',GradientType=0 );
}
.nicEdit-panelContain{border-bottom: 1px solid #c3b9a7;}
.nicEdit-button-undefined{border: 0 none !important;}
.nicEdit-panel > div:first-child .nicEdit-button-undefined{border-top-left-radius: 4px;}
.nicEdit-button{margin:0 auto;}

.nicEdit-container{
    background: #ded6c5;
    -webkit-border-radius: 0 0 5px 5px;
    -moz-border-radius: 0 0 5px 5px;
    border-radius: 0 0 5px 5px;
    padding:0;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
}
.nicEdit-container{font-weight: 400;}
.nicEdit-container i{font-style: italic !important;}
.nicEdit-container b{font-weight: 700 !important;}
.nicEdit-container .nicEdit-main{color: #5f513f;}
.nicEdit-main p, .nicEdit-main div {line-height: normal; margin-bottom: 0;}

/*-----------------------------------*/
/* Login Form styled */
/*-----------------------------------*/

.widget_login.styled .inner{padding: 19px 15px 10px;}

.widget_login.styled .field_text {margin: 0 0 11px;}

.widget_login.styled input[type="text"],
.widget_login.styled input[type="password"]{
    background: #e4ddce;
    height: 29px;
    -webkit-box-shadow: inset 1px 1px 3px rgba(118, 108, 100, 0.26), 0 1px 1px rgba(255, 255, 255, 0.6);
    -moz-box-shadow: inset 1px 1px 3px rgba(118, 108, 100, 0.26), 0 1px 1px rgba(255, 255, 255, 0.6);
    box-shadow: inset 1px 1px 3px rgba(118, 108, 100, 0.26), 0 1px 1px rgba(255, 255, 255, 0.6);
    border: 1px solid #B9AD9E;
}
.widget_login.styled .input_icon{background-color: #ece9df; border-right: 1px solid #dbd4c4;}
.widget_login.styled .input_icon.input_email {background-position: 8px -220px;}
.widget_login.styled .input_icon.input_pass {background-position: 8px -256px;}

.widget_login.styled label,
.widget_login.styled .forget_password a{
    font-size: 10px;
    line-height: 22px;
    color: #7f7c6d;
}
.widget_login.styled .rowRemember{margin-bottom: 0;}
.widget_login.styled .rowSubmit{margin: 0 -15px !important; padding: 0; background: none;}

@media (min-width: 992px){
    .widget_login.styled{margin: 0 16px 30px;}
}

/*-----------------------------------*/
/* Search Form styled */
/*-----------------------------------*/

.widget_search.styled .inner{padding: 15px 15px 10px 18px;}

.widget_search.styled .field_text inp


91 -4.8906 Q57.5234 -5.5 56.7266 -5.5 Q55.9922 -5.5 55.4922 -5.0156 Q55.0078 -4.5312 54.9609 -3.7031 ZM66.3848 -3.75 L60.6973 -1.3281 L60.6973 -2.375 L65.1973 -4.25 L60.6973 -6.0938 L60.6973 -7.1406 L66.3848 -4.7344 L66.3848 -3.75 ZM73.3926 -3.75 L67.7051 -1.3281 L67.7051 -2.375 L72.2051 -4.25 L67.7051 -6.0938 L67.7051 -7.1406 L73.3926 -4.7344 L73.3926 -3.75 Z" style="stroke:none; clip-path:url(#clipPath17_5a030266-df71-4d7f-8927-453ecde4fd08);"/></g><g style="text-rendering:optimizeLegibility; stroke-width:2; font-family:sans-serif;" transform="matrix(1.3333,0,0,1.3333,3789.9271,3441.5834) translate(1980.2749,2146.5257)"><path d="M4.4121 7.0488 L4.4121 5.8457 L5.6152 5.8457 L5.6152 7.0488 L4.4121 7.0488 ZM4.4121 12.0645 L4.4121 10.8613 L5.6152 10.8613 L5.6152 12.0645 L4.4121 12.0645 ZM17.0645 9.0488 L18.1895 9.3457 Q17.8301 10.7363 16.9082 11.4707 Q15.9863 12.2051 14.6426 12.2051 Q13.252 12.2051 12.377 11.6426 Q11.502 11.0801 11.0488 10.0176 Q10.5957 8.9395 10.5957 7.7051 Q10.5957 6.3613 11.1113 5.3613 Q11.627 4.3613 12.5645 3.8457 Q13.5176 3.3301 14.6582 3.3301 Q15.9395 3.3301 16.8145 3.9863 Q17.7051 4.6426 18.0488 5.8301 L16.9238 6.0957 Q16.627 5.1582 16.0488 4.7363 Q15.4863 4.2988 14.627 4.2988 Q13.6426 4.2988 12.9707 4.7832 Q12.3145 5.252 12.0332 6.0488 Q11.7676 6.8457 11.7676 7.7051 Q11.7676 8.7988 12.0801 9.6113 Q12.4082 10.4238 13.0801 10.8301 Q13.752 11.2363 14.5488 11.2363 Q15.502 11.2363 16.1582 10.6895 Q16.8301 10.1426 17.0645 9.0488 ZM23.5273 11.2988 Q22.9336 11.7988 22.3867 12.002 Q21.8555 12.2051 21.2305 12.2051 Q20.1992 12.2051 19.6523 11.7051 Q19.1055 11.2051 19.1055 10.4238 Q19.1055 9.9707 19.3086 9.5957 Q19.5117 9.2051 19.8555 8.9863 Q20.1992 8.752 20.6211 8.6426 Q20.918 8.5488 21.5586 8.4707 Q22.8242 8.3301 23.4336 8.1113 Q23.4336 7.8926 23.4336 7.8457 Q23.4


,@body
      (princ "")))]])

    command('set lisp')
    command('/^(defun')
    feed('=G:/^(defun/,$yank A<cr>')
    poke_eventloop()

    -- Put @a and clean empty line
    command('%d')
    command('0put a')
    command('$d')

    -- Assert buffer contents.
    expect([[
      (defun html-file (base)
        (format nil "~(~A~).html" base))

      (defmacro page (name title &rest body)
        (let ((ti (gensym)))
          `(with-open-file (*standard-output*
      		       (html-file ,name)
      		       :direction :output
      		       :if-exists :supersede)
             (let ((,ti ,title))
      	 (as title ,ti)
      	 (with center
      	       (as h2 (string-upcase ,ti)))
      	 (brs 3)
      	 ,@body))))

      ;;; Utilities for generating links

      (defmacro with-link (dest &rest body)
        `(progn
           (format t "" (html-file ,dest))
           ,@body
           (princ "")))]])
  end)
end)


DataType.DOUBLE, A, X, Y);
            dsyr2(order, Uplo, (int) X.length(), alpha, X, X.stride(-1), Y, Y.stride(-1), A, (int) A.size(0));
        } else {
            DefaultOpExecutioner.validateDataType(DataType.FLOAT, A, X, Y);
            ssyr2(order, Uplo, (int) X.length(), (float) alpha, X, X.stride(-1), Y, Y.stride(-1), A, (int) A.size(0));
        }

        OpExecutionerUtil.checkForAny(A);
    }

    /**
     * syr2 performs a rank-2 update of an n-by-n symmetric matrix a:
     * a := alpha*x*y' + alpha*y*x' + a.
     *
     * @param order
     * @param Uplo
     * @param TransA
     * @param Diag
     * @param A
     * @param X
     */
    @Override
    public void tbmv(char order, char Uplo, char TransA, char Diag, INDArray A, INDArray X) {
        if (X.length() > Integer.MAX_VALUE || A.columns() > Integer.MAX_VALUE || A.size(0) > Integer.MAX_VALUE) {
            throw new ND4JArraySizeException();
        }

        if (X.data().dataType() == DataType.DOUBLE) {
            DefaultOpExecutioner.validateDataType(DataType.DOUBLE, A, X);
            dtbmv(order, Uplo, TransA, Diag, (int) X.length(), (int) A.columns(), A, (int) A.size(0), X, X.stride(-1));
        } else {
            DefaultOpExecutioner.validateDataType(DataType.FLOAT, A, X);
            stbmv(order, Uplo, TransA, Diag, (int) X.length(), (int) A.columns(), A, (int) A.size(0), X, X.stride(-1));
        }
    }

    /**
     * ?tbsv solves a system of linear equations whose coefficients are in a triangular band matrix.
     *
     * @param order
     * @param Uplo
     * @param TransA
     * @param Diag
     * @param A
     * @param X
     */
    @Override
    public void tbsv(char order, char Uplo, char TransA, char Diag, INDArray A, INDArray X) {
        if (X.length() > Integer.MAX_VALUE || A.columns() > Integer.MAX_VALUE || A.size(0) > Integer.MAX_VALUE ) {
            throw new ND4JArraySizeException();
        }

        if (X.data().dataType() == DataType.DOUBLE) {
            DefaultOpExecutioner.validateDataType(DataType.DOUBLE, A, X);
            dtbsv(order, Uplo, TransA, Diag, (int) X.length(), (int) A.columns(), A, (int) A.size(0), X, X.stride(-1));
        } else {
            DefaultOpExecutioner.validateDataType(DataType.FLOAT, A, X);
            stbsv(order, Uplo, TransA, Diag, (int) X.length(), (int) A.columns(), A, (int) A.size(0), X, X.stride(-1));
        }

    }

    /**
     * tpmv computes a matrix-vector product using a triangular packed matrix.
     *
     * @param order
     * @param Uplo
     * @param TransA
     * @param Diag
     * @param Ap
     * @param X
     */
    @Override
    public void tpmv(char order, char Uplo, char TransA, char Diag, INDArray Ap, INDArray X) {
          if (Ap.length() > Integer.MAX_VALUE)
            throw new ND4JArraySizeException();

        if (X.data().dataType() == DataType.DOUBLE) {
            DefaultOpExecutioner.validateDataType(DataType.DOUBLE, X);


/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of Qt for Python.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef SMART_REGISTRY_H
#define SMART_REGISTRY_H

#include <vector>

#include "libsmartmacros.h"

class Obj;
class Integer;

// Used to track which C++ objects are alive.
class LIB_SMART_API Registry {
public:
    static Registry *getInstance();
    ~Registry();

    Registry(const Registry &) = delete;
    Registry &operator=(const Registry &) = delete;
    Registry(Registry &&) = delete;
    Registry &operator=(Registry &&) = delete;

    void add(Obj *p);
    void add(Integer *p);
    void remove(Obj *p);
    void remove(Integer *p);
    int countObjects() const;
    int countIntegers() const;
    bool shouldPrint() const;
    void setShouldPrint(bool flag);

protected:
    Registry();

private:
    std::vector<Obj *> m_objects;
    std::vector<Integer *> m_integers;
    bool m_printStuff = false;
};

#endif // SMART_REGISTRY_H


         }
            else if (byte1 >> 4 == 1)   // 0001
            {
                (length, displacement) = HandleOneCompressedBlock(byte1, byte2, input, output);
            }
            else    // >= 0010
            {
                (length, displacement) = HandleRemainingCompressedBlock(byte1, byte2, input, output);
            }

            circularBuffer.Copy(output, displacement, length);
        }

        private (int length, int displacement) HandleZeroCompressedBlock(byte byte1, byte byte2, Stream input, Stream output)
        {
            if (input.Length - input.Position < 1)
                throw new StreamTooShortException();

            var byte3 = input.ReadByte();
            var length = ((byte1 & 0xF) << 4 | byte2 >> 4) + 0x11;  // max 0xFF + 0x11 = 0x110
            var displacement = ((byte2 & 0xF) << 8 | byte3) + 1;  // max 0xFFF + 1 = 0x1000

            if (displacement > output.Length)
                throw new DisplacementException(displacement, output.Length, input.Position - 3);

            return (length, displacement);
        }

        private (int length, int displacement) HandleOneCompressedBlock(byte byte1, byte byte2, Stream input, Stream output)
        {
            if (input.Length - input.Position < 2)
                throw new StreamTooShortException();

            var byte3 = input.ReadByte();
            var byte4 = input.ReadByte();
            var length = ((byte1 & 0xF) << 12 | byte2 << 4 | byte3 >> 4) + 0x111; // max 0xFFFF + 0x111 = 0x10110
            var displacement = ((byte3 & 0xF) << 8 | byte4) + 1;  // max 0xFFF + 1 = 0x1000

            if (displacement > output.Length)
                throw new DisplacementException(displacement, output.Length, input.Position - 4);

            return (length, displacement);
        }

        private (int length, int displacement) HandleRemainingCompressedBlock(byte byte1, byte byte2, Stream input, Stream output)
        {
            var length = (byte1 >> 4) + 1;  // max 0xF + 1 = 0x10
            var displacement = ((byte1 & 0xF) << 8 | byte2) + 1;   // max 0xFFF + 1 = 0x1000

            if (displacement > output.Length)
                throw new DisplacementException(displacement, output.Length, input.Position - 2);

            return (length, displacement);
        }

        public void Dispose()
        {
        }
    }
}


launch
import kotlin.time.Duration.Companion.milliseconds

private val Speeds = arrayOf(
    "0.5X" to 0.5f,
    "0.75X" to 0.75f,
    "1.0X" to 1.0f,
    "1.25X" to 1.25f,
    "1.5X" to 1.5f,
    "2.0X" to 2.0f
)

private val Resizes = arrayOf(
    "适应" to ResizeMode.Fit,
    "拉伸" to ResizeMode.Fill,
    "填充" to ResizeMode.Full,
    "16:9" to ResizeMode.FixedRatio_16_9,
    "4:3" to ResizeMode.FixedRatio_4_3,
)

/* 屏幕方向改变会导致丢失状态 */
@Composable
fun VideoPlayScreen(
    onBackClick: () -> Unit,
    activity: Activity
) {
    val viewModel:VideoPlayViewModel = viewModel()
    val animeVideoState by viewModel.videoState.collectAsState()

    val view = LocalView.current

    StateHandler(
        state = animeVideoState,
        onLoading = {
            view.keepScreenOn = true
            requestLandscapeOrientation(view, activity)
            Box(
                modifier = Modifier
                    .background(Color.Black)
                    .fillMaxSize(),
                contentAlignment = Alignment.Center
            ) {
                CircularProgressIndicator()
            }
        },
        onFailure = {
            Column(
                modifier = Modifier
                    .fillMaxSize()
                    .background(Color.Black),
                horizontalAlignment = Alignment.CenterHorizontally,
                verticalArrangement = Arrangement.Center
            ) {
                Icon(
                    imageVector = Icons.Rounded.Info,
                    tint = Color.White,
                    contentDescription = ""
                )
                Spacer(modifier = Modifier.padding(vertical = 8.dp))
                Text(
                    text = stringResource(id = R.string.txt_empty_result),
                    color = Color.White,
                    style = MaterialTheme.typography.bodyMedium
                )
                Spacer(modifier = Modifier.padding(vertical = 8.dp))
                OutlinedButton(onClick = onBackClick) {
                    Text(text = stringResource(id = R.string.back), color = Color.White)
                }
            }
        }
    ) { resource ->
        resource.data?.let { video ->
            val playerState = rememberVideoPlayerState()

            val onBackHandle: () -> Unit = remember {
                {
                    playerState.control.setFullscreen(false)
                    requestPortraitOrientation(view, activity)
                    onBackClick()
                }
            }

            Box(
                modifier = Modifier
                    .background(Color.Black)
                    .fillMaxSize()
                    .adaptiveSize(playerState.isFullscreen.value, view, activity),
                contentAlignment = Alignment.Center
            ) {

                VideoPlayer(
                    url = video.url,
                    playerState = playerState,
                ) {
                    VideoPlayerControl(
                        state = playerState,
                        title = video.title,
                        onBackClick = onBackHandle
                    )
                }

                VideoStateMessage(playerState)

                VolumeBrightnessIndicator(playerState)

                VideoSideSheet(video, playerState, viewModel)
            }

        }
    }

    DisposableEffect(Unit) {
        onDispose {
            view.keepScreenOn = false
            requestPortraitOrientation(view, activity)
        }
    }
}

@SuppressLint("SourceLockedOrientationActivity")
private fun requestPortraitOrientation(view: View, activity: Activity) {
    showSystemBars(view, activity)
    activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
}

private fun requestLandscapeOrientation(view: View, activity: Activity) {
    hideSyste


ect, srcSubresource.mipLevel);

	VkExtent3D extent = image->getMipLevelExtent(aspect, srcSubresource.mipLevel);
	int w = extent.width;
	int h = extent.height;
	if(w != h)
	{
		UNSUPPORTED("Cube doesn't have square faces : (%d, %d)", w, h);
	}

	// Src is expressed in the regular [0, width-1], [0, height-1] space
	bool srcHorizontal = ((srcEdge == TOP) || (srcEdge == BOTTOM));
	int srcDelta = srcHorizontal ? bytes : pitchB;
	VkOffset3D srcOffset = { (srcEdge == RIGHT) ? (w - 1) : 0, (srcEdge == BOTTOM) ? (h - 1) : 0, 0 };

	// Dst contains borders, so it is expressed in the [-1, width], [-1, height] space
	bool dstHorizontal = ((dstEdge == TOP) || (dstEdge == BOTTOM));
	int dstDelta = (dstHorizontal ? bytes : pitchB) * (reverse ? -1 : 1);
	VkOffset3D dstOffset = { (dstEdge == RIGHT) ? w : -1, (dstEdge == BOTTOM) ? h : -1, 0 };

	// Don't write in the corners
	if(dstHorizontal)
	{
		dstOffset.x += reverse ? w : 1;
	}
	else
	{
		dstOffset.y += reverse ? h : 1;
	}

	const uint8_t *src = static_cast<const uint8_t *>(image->getTexelPointer(srcOffset, srcSubresource));
	uint8_t *dst = static_cast<uint8_t *>(image->getTexelPointer(dstOffset, dstSubresource));
	ASSERT((src < image->end()) && ((src + (w * srcDelta)) < image->end()));
	ASSERT((dst < image->end()) && ((dst + (w * dstDelta)) < image->end()));

	for(int i = 0; i < w; ++i, dst += dstDelta, src += srcDelta)
	{
		memcpy(dst, src, bytes);
	}
}

}  // namespace sw
// Copyright 2020 Google LLC
//
// 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
//
//     https://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.

#include "privacy/net/krypton/session.h"

#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>

#include "net/proto2/contrib/parse_proto/parse_text_proto.h"
#include "privacy/net/attestation/proto/attestation.proto.h"
#include "privacy/net/common/proto/auth_and_sign.proto.h"
#include "privacy/net/common/proto/get_initial_data.proto.h"
#include "privacy/net/common/proto/ppn_status.proto.h"
#include "privacy/net/common/proto/update_path_info.proto.h"
#include "privacy/net/krypton/add_egress_response.h"
#include "privacy/net/krypton/auth.h"
#include "privacy/net/krypton/datapath_interface.h"
#include "privacy/net/krypton/egress_manager.h"
#include "privacy/net/krypton/endpoint.h"
#include "privacy/net/krypton/json_keys.h"
#include "privacy/net/krypton/pal/mock_http_fetcher_interface.h"
#include "privacy/net


St2_dQt * d2Qt_dthetat_dthetaf;
        d2St2_dthetat_dVmf =
            2 * dPt_dVmf * dPt_dthetat + dSt2_dPt * d2Pt_dthetat_dVmf +
            2 * dQt_dVmf * dQt_dthetat + dSt2_dQt * d2Qt_dthetat_dVmf;
        d2St2_dthetat_dthetat =
            2 * dPt_dthetat * dPt_dthetat + dSt2_dPt * d2Pt_dthetat_dthetat +
            2 * dQt_dthetat * dQt_dthetat + dSt2_dQt * d2Qt_dthetat_dthetat;
        d2St2_dthetat_dVmt =
            2 * dPt_dVmt * dPt_dthetat + dSt2_dPt * d2Pt_dthetat_dVmt +
            2 * dQt_dVmt * dQt_dthetat + dSt2_dQt * d2Qt_dthetat_dVmt;

        val[0] = val[1] = val[2] = val[3] = 0.0;

        col[0] = xidxf[j] - nxsparse;
        col[1] = xidxf[j] + 1 - nxsparse;
        col[2] = xidxt[j] - nxsparse;
        col[3] = xidxt[j] + 1 - nxsparse;

        row[0] = xidxt[j] - nxsparse;

        val[0] = lambda_dev[gloc] * d2Sf2_dthetat_dthetaf +
                 lambda_dev[gloc + 1] * d2St2_dthetat_dthetaf;
        val[1] = lambda_dev[gloc] * d2Sf2_dthetat_dVmf +
                 lambda_dev[gloc + 1] * d2St2_dthetat_dVmf;
        val[2] = lambda_dev[gloc] * d2Sf2_dthetat_dthetat +
                 lambda_dev[gloc + 1] * d2St2_dthetat_dthetat;
        val[3] = lambda_dev[gloc] * d2Sf2_dthetat_dVmt +
                 lambda_dev[gloc + 1] * d2St2_dthetat_dVmt;

        RAJA::atomicAdd<exago_raja_atomic>(&HDD_view(row[0], col[0]), val[0]);
        RAJA::atomicAdd<exago_raja_atomic>(&HDD_view(row[0], col[1]), val[1]);
        RAJA::atomicAdd<exago_raja_atomic>(&HDD_view(row[0], col[2]), val[2]);
        RAJA::atomicAdd<exago_raja_atomic>(&HDD_view(row[0], col[3]), val[3]);

        //    ierr = MatSetValues(H,1,row,4,col,val,ADD_VALUES);CHKERRQ(ierr);

        double d2Sf2_dVmt_dthetaf, d2Sf2_dVmt_dVmf, d2Sf2_dVmt_dthetat,
            d2Sf2_dVmt_dVmt;
        double d2St2_dVmt_dthetaf, d2St2_dVmt_dVmf, d2St2_dVmt_dthetat,
            d2St2_dVmt_dVmt;

        d2Sf2_dVmt_dthetaf =
            2 * dPf_dthetaf * dPf_dVmt + dSf2_dP


      ),
    )

    rule.mainClock.advanceTimeByFrame()
    dropshots.assertSnapshot(rule.activity, testName.methodName + "_[after_image_change]")
  }

  @Test fun content_padding(
    @TestParameter contentPadding: ContentPaddingParam,
    @TestParameter subSamplingStatus: SubSamplingStatus,
  ) {
    lateinit var state: ZoomableImageState
    val zoomRequests = Channel<Float>()
    val isPlaceholderVisible = MutableStateFlow(true)

    rule.setContent {
      val fullQualityImage = when (contentPadding) {
        ContentPaddingParam.Symmetric -> "arale_1080p.jpg"
        ContentPaddingParam.Asymmetric -> "cat_1920.jpg"
      }
      val placeholderImage = when (contentPadding) {
        ContentPaddingParam.Symmetric -> "arale_250.jpg"
        ContentPaddingParam.Asymmetric -> "cat_250.jpg"
      }

      ZoomableImage(
        modifier = Modifier
          .fillMaxSize()
          .testTag("image"),
        image = ZoomableImageSource
          .asset(fullQualityImage, subSample = subSamplingStatus.enabled)
          .withPlaceholder(assetPainter(placeholderImage), isPlaceholderVisible),
        contentDescription = null,
        state = rememberZoomableImageState().also { state = it },
        contentPadding = contentPadding.contentPadding,
      )

      LaunchedEffect(Unit) {
        zoomRequests.consumeAsFlow().collectLatest { factor ->
          state.zoomableState.zoomTo(factor)
        }
      }
    }

    rule.waitUntil { state.isPlaceholderDisplayed }
    rule.runOnIdle {
      dropshots.assertSnapshot(rule.activity, testName.methodName + "_placeholder")
    }

    isPlaceholderVisible.value = false
    rule.waitUntil { state.isImageDisplayedInFullQuality }
    rule.runOnIdle {
      dropshots.assertSnapshot(rule.activity, testName.methodName + "_full_image")
    }

    zoomRequests.trySend(1.1f)
    rule.waitUntil { state.isImageDisplayedInFullQuality }
    rule.runOnIdle {
      dropshots.assertSnapshot(rule.activity, testName.methodName + "_zoomed")
    }

    with(rule.onNodeWithTag("image")) {
      performTouchInput {
        swipeLeft(startX = center.x, endX = centerLeft.x)
      }
    }
    rule.waitUntil { state.isImageDisplayedInFullQuality }
    rule.runOnIdle {
      dropshots.assertSnapshot(rule.activity, testName.methodName + "_zoomed_and_panned")
    }
  }

  @Test fun min_zoom_factor_should_exclude_content_padding() {
    lateinit var state: ZoomableImageState
    rule.setContent {
      ZoomableImage(
        modifier = Modifier
          .fillMaxSize()
          .testTag("image"),
        image = ZoomableImageSource.asset("fox_1000.jpg", subSample = true),
        contentDescription = null,
        state = rememberZoomableImageState().also { state = it },
        contentPadding = PaddingValues(40.dp),
        contentScale = ContentScale.Fit,
      )
    }

    // When the image is zoomed in and then fully out,
    // it should go back to its original padded position.
    rule.waitUntil { state.isImageDisplayedInFullQuality }
    repeat(2) {
      rule.onNodeWithTag("image").performTouchInput { doubleClick() }
      rule.waitForIdle()
    }

    with(state.zoomableState.coordinateSystem) {
      val contentBounds = contentBounds.rectIn(CoordinateSpace.Viewport)
      assertThat(contentBounds.topLeft.round()).isEqualTo(IntOffset(105, 910))
    }
    assertThat(state.zoomableState.zoomFraction).isEqualTo(0f)
  }

  // Regression test.
  @Test fun placeholder_should_not_be_zoomable_when_content_paddi


), intArrayOf(x, y))
    }

    private fun scaleX(x: Int): Int {
        return mScreenMetrics?.scaleX(x) ?: x
    }

    private fun scaleY(y: Int): Int {
        return mScreenMetrics?.scaleX(y) ?: y
    }

    @RequiresApi(api = Build.VERSION_CODES.N)
    fun swipe(x1: Int, y1: Int, x2: Int, y2: Int, delay: Long): Boolean {
        return gesture(0, delay, intArrayOf(x1, y1), intArrayOf(x2, y2))
    }

}
package org.autojs.autojs.tool

import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.drawable.Drawable
import android.graphics.drawable.BitmapDrawable
import android.net.Uri
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.File

/**
 * Created by Stardust on 2017/4/22.
 * Modified by wilinz on 2022/5/23
 */
object BitmapTool {
    @JvmStatic
    fun scaleBitmap(origin: Bitmap?, newWidth: Int, newHeight: Int): Bitmap? {
        if (origin == null) {
            return null
        }
        val height = origin.height
        val width = origin.width
        val scaleWidth = newWidth.toFloat() / width
        val scaleHeight = newHeight.toFloat() / height
        val matrix = Matrix()
        matrix.postScale(scaleWidth, scaleHeight) // 使用后乘
        return Bitmap.createBitmap(origin, 0, 0, width, height, matrix, false)
    }

    @JvmStatic
    fun drawableToBitmap(drawable: Drawable): Bitmap {
        if (drawable is BitmapDrawable) {
            return drawable.bitmap
        }
        val bitmap = Bitmap.createBitmap(
            drawable.intrinsicWidth,
            drawable.intrinsicHeight,
            Bitmap.Config.ARGB_8888
        )
        val canvas = Canvas(bitmap)
        //fix bug, setBounds should be called here, otherwise it cannot be display bitmap
        drawable.setBounds(0, 0, canvas.width, canvas.height)
        drawable.draw(canvas)
        return bitmap
    }
}

fun Bitmap.writeTo(file: File) {
    file.outputStream().use { out ->
        compress(Bitmap.CompressFormat.PNG, 100, out)
    }
}

suspend fun saveIcon(context: Context, uri: Uri, file: File): File? {
    return withContext(Dispatchers.IO) {
        file.parentFile?.let { if (!it.exists()) it.mkdirs() }
        try {
            uri.copyTo(context, file)
            file
        } catch (e: Exception) {
            e.printStackTrace()
            null
        }
    }
}package org.autojs.autojs.ui.splash

import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx


addr psx.Addr) (SpriteSet, datarange.DataRange, error) {
	if err := addr.MoveFile(r, baseAddr); err != nil {
		return nil, datarange.DataRange{}, fmt.Errorf("invalid sprite offset: %w", err)
	}

	// the end of the Sprite array is the beginning of the earliest Sprite offset
	boundaries := baseAddr.Boundaries()
	earliestSpriteOff := boundaries.GameEnd
	currentOff := addr
	var spriteOffsets []psx.Addr
	for {
		if currentOff >= earliestSpriteOff {
			break
		}
		currentOff += 4

		var spriteOffset psx.Addr
		if err := binary.Read(r, binary.LittleEndian, &spriteOffset); err != nil {
			return nil, datarange.DataRange{}, err
		}
		spriteOffsets = append(spriteOffsets, spriteOffset)
		if spriteOffset != psx.RamNull {
			if !spriteOffset.InRange(baseAddr, boundaries.GameEnd) {
				err := fmt.Errorf("sprite offset %s is not valid", spriteOffset)
				return nil, datarange.DataRange{}, err
			}
			earliestSpriteOff = min(earliestSpriteOff, spriteOffset)
		}
	}
	headerRange := datarange.New(addr, earliestSpriteOff)
	bank := make(SpriteSet, len(spriteOffsets))
	var spriteRanges []datarange.DataRange
	for i, offset := range spriteOffsets {
		if offset == psx.RamNull {
			bank[i] = nil
			continue
		}
		sprites, ranges, err := readSpriteParts(r, baseAddr, offset)
		if err != nil {
			return nil, datarange.DataRange{}, fmt.Errorf("unable to read sprites: %w", err)
		}
		bank[i] = &sprites
		if !ranges.Empty() {
			spriteRanges = append(spriteRanges, ranges)
		}
	}

	return bank, datarange.MergeDataRanges(append(spriteRanges, headerRange)), nil
}

func BuildSpriteSet(sb *strings.Builder, set SpriteSet, mainSymbol string) {
	var symbols []string
	for i, spriteGroup := range set {
		if spriteGroup != nil {
			symbol := fmt.Sprintf("%s_%d", mainSymbol, i)
			size := len(*spriteGroup)*11 + 1
			if (len(*spriteGroup) & 1) == 1 { // perform alignment at the end
				size += 2
			} else {
				size += 1
			}
			sb.WriteString(fmt.Sprintf("static s16 %s[%d];\n", symbol, size))
			symbols = append(symbols, symbol)
		} else {
			symbols = append(symbols, "")
		}
	}
	sb.WriteString(fmt.Sprintf("s16* %s[] = {\n", mainSymbol))
	for _, symbol := range symbols {
		if len(symbol) > 0 {
			sb.WriteString(fmt.Sprintf("    %s,\n", symbol))
		} else {
			sb.WriteString("    0,\n")
		}
	}
	sb.WriteString("};\n")
	for i, spriteGroup := range set {
		if spriteGroup == nil {
			continue
		}
		sb.WriteString(fmt.Sprintf("static s16 %s[] = {\n", symbols[i]))
		sb.WriteString(fmt.Sprintf("    %d,\n", len(*spriteGroup)))
		for _, sprite := range *spriteGroup {
			sb.WriteString(fmt.Sprintf("    %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d,\n",
				sprite.Flags, sprite.X, sprite


    }
};// Copyright (c) 2019 Victorien Elvinger
// Licensed under the zlib license (https://opensource.org/licenses/zlib).

import { u32, u4 } from "./number"

/**
 * @internal
 * Set of 4bits unsigned integers (hexadecimal digits)
 */
export type U4Set = u32

/**
 * @internal
 * Empty set
 */
export const U4_EMPTY_U4SET = 0

/**
 * @internal
 * @param s set
 * @param n
 * @param Is `n` in `s`?
 */
export function has(s: U4Set, n: u4): boolean {
    const pos = 0b1 << n
    return (s & pos) !== 0
}

/**
 * @internal
 * @param s set
 * @param n
 * @return new set that adds `n` to `s`
 */
export function add(s: U4Set, n: u4): U4Set {
    const pos = 0b1 << n
    return s | pos
}
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import CatalogItem from './models/catalog-item.model';
import { CatalogItemType } from './fixed/catalog-type.enum';

@Injectable()
export class CatalogService {
  constructor(
    @InjectModel(CatalogItem.name)
    private catalogRepository: Model<CatalogItem>,
  ) {}

  async remove(id: string): Promise<void> {
    await this.catalogRepository.remove(id);
  }

  async update(item: CatalogItem): Promise<CatalogItem> {
    await this.catalogRepository.updateOne((x) => x._id == item._id, item);
    return item;
  }

  async add(item: CatalogItem): Promise<CatalogItem> {
    await this.catalogRepository.create(item);
    return item;
  }

  findBrands(): CatalogItemType[] {
    return Object.values(CatalogItemType);
  }

  async findById(id: string): Promise<CatalogItem> {
    return await this.catalogRepository.findById(id);
  }

  async findAll(): Promise<CatalogItem[]> {
    return await this.catalogRepository.find(
      {},
      { type: 1, brandName: 1, name: 1 },
    );
  }
}
import { Injectable } from '@angular/core';

import { CookiesService } from '../cookies.service';
import { CookieOptions } from '../cookie-options';
import { CookiesOptionsService } from '../cookies-options.service';
import {
  isBlank,
  isString,
  mergeOptions,
  safeDecodeURIComponent,
} from '../utils';

@Injectable()
export class BrowserCookiesService extends CookiesService {
  constructor(cookiesOptions: CookiesOptionsService) {
    super(cookiesOptions);
  }

  get cookieString(): string {
    return document.cookie || '';
  }

  set cookieString(val: string) {
    document.cookie = val;
  }

  protected cookiesReader(): { [key: string]: any } {
    let lastCookies: Record<string, string> = {};
    let lastCookieString = '';
    let currentCookieString = this.cookieString;

    if (currentCookieString !== lastCookieString) {
      lastCookieString = currentCookieString;
      const cookiesArray = lastCookieString.split('; ');
      lastCookies = {};

      for (let i = 0; i < cookiesArray.length; i++) {
        const cookie = cookiesArray[i];
        const index = cookie.indexOf('=');

        if (index > 0) {
          // ignore nameless cookies
          const name = safeDecodeURIComponent(cookie.substring(0, index));

          if (isBlank(lastCookies[name])) {
            lastCookies[name] = safeDecodeURIComponent(
              cookie.substring(index + 1)
            );
          }


time"

	"github.com/hashicorp/go-multierror"
	"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

	"github.com/chnsz/golangsdk/openstack/swr/v2/namespaces"

	"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/common"
	"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API SWR GET /v2/manage/namespaces/{name}
// @API SWR DELETE /v2/manage/namespaces/{name}
// @API SWR POST /v2/manage/namespaces
func ResourceSWROrganization() *schema.Resource {
	return &schema.Resource{
		CreateContext: resourceSWROrganizationCreate,
		ReadContext:   resourceSWROrganizationRead,
		DeleteContext: resourceSWROrganizationDelete,
		Importer: &schema.ResourceImporter{
			StateContext: schema.ImportStatePassthroughContext,
		},

		Timeouts: &schema.ResourceTimeout{
			Create: schema.DefaultTimeout(5 * time.Minute),
			Delete: schema.DefaultTimeout(5 * time.Minute),
		},

		// Request and response parameters.
		Schema: map[string]*schema.Schema{
			"region": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
				ForceNew: true,
			},
			"name": {
				Type:     schema.TypeString,
				Required: true,
				ForceNew: true,
			},
			"creator": {
				Type:     schema.TypeString,
				Computed: true,
			},
			"permission": {
				Type:     schema.TypeString,
				Computed: true,
			},
			"login_server": {
				Type:     schema.TypeString,
				Computed: true,
			},
		},
	}
}

func resourceSWROrganizationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
	cfg := meta.(*config.Config)
	swrClient, err := cfg.SwrV2Client(cfg.GetRegion(d))

	if err != nil {
		return diag.Errorf("unable to create SWR client: %s", err)
	}

	name := d.Get("name").(string)
	createOpts := namespaces.CreateOpts{
		Namespace: name,
	}

	err = namespaces.Create(swrClient, createOpts).ExtractErr()

	if err != nil {
		return diag.Errorf("error creating SWR organization: %s", err)
	}

	d.SetId(name)

	return resourceSWROrganizationRead(ctx, d, meta)
}

func resourceSWROrganizationRead(_ context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
	cfg := meta.(*config.Config)
	swrClient, err := cfg.SwrV2Client(cfg.GetRegion(d))
	if err != nil {
		return diag.Errorf("error creating SWR client: %s", err)
	}

	n, err := namespaces.Get(swrClient, d.Id()).Extract()
	if err != nil {
		return common.CheckDeletedDiag(d, err, "error retrieving SWR")
	}

	permission := resourceSWRAuthToPermission(n.Auth)

	mErr := multierror.Append(nil,
		d.Set("region", cfg.GetRegion(d)),
		d.Set("name", n.Name),
		d.Set("creator", n.CreatorName),
		d.Set("permission", permission),
	)

	login := fmt.Sprintf("swr.%s.%s", cfg.GetRegion(d), cfg.Cloud)
	mErr = multierror.Append(mErr, d.Set("login_server", login))

	if mErr.ErrorOrNil() != nil {
		return diag.FromErr(mErr)
	}

	return nil
}

func resourceSWROrganizationDelete(_ context.Context, d *schema.Reso


2)
	if part1 and part2 then
		local noCollision = Instance.new("NoCollisionConstraint")
		noCollision.Part0 = part1
		noCollision.Part1 = part2
		noCollision.Parent = part1
	end
end

function R6CollisionEmulator:SetupHumanoid()
	local humanoid = self.Humanoid
	for partName, _ in LegacyParts do
		if partName ~= "Torso" then
			self:DisableCollision(self.AdapterNameToAdapterPart[partName], self.AdapterNameToAdapterPart["Torso"]) -- R6 limbs do not collide with self torso, keep this behavior
		end
	end
	table.insert(
		self.Connections,
		humanoid.StateChanged:Connect(function(...)
			self:OnHumanoidStateChanged(...)
		end)
	)
	table.insert(
		self.Connections,
		humanoid.Died:Connect(function()
			self:OnHumanoidDied()
		end)
	)
	self:OnHumanoidStateChanged(humanoid:GetState(), humanoid:GetState())

	table.insert(
		self.Connections,
		humanoid.Died:Connect(function()
			self:OnHumanoidDied()
		end)
	)
end

function R6CollisionEmulator:OnHumanoidStateChanged(_, newState)
	for partName, _ in LegacyParts do
		local part = self.AdapterNameToAdapterPart[partName]
		if not part then
			part = self.Character:FindFirstChild(partName)
			if part then
				self.AdapterNameToAdapterPart[partName] = part
			else
				continue
			end
		end

		local collisions = CollisionOverides[newState] or CollisionDefaults
		local shouldCollide = collisions[partName]
		if shouldCollide == nil then
			shouldCollide = CollisionDefaults[partName]
		end

		part.CanCollide = shouldCollide
	end
end

function R6CollisionEmulator:OnHumanoidDied()
	if self.BreakJointsOnDeath then
		for _, descendant in self.Character:GetDescendants() do
			if descendant:IsA("Motor6D") and JointsToBreak[descendant.Name] then
				descendant.Enabled = false
			end
		end
	end
	self.Humanoid.PlatformStand = true
end

function R6CollisionEmulator:Destroy()
	for _, connection in self.Connections do
		connection:Disconnect()
	end
	table.clear(self.Connections)
end

return R6CollisionEmulator


represents the overflow.
#
# For R and B we pack the table by taking the 11 bit representation of their
# values, and toggling bit 10 in the U and V tables.
#
# For the green case we calculate 4*G (thus effectively using 10 bits for the
# valid range) truncate to 12 bits. We toggle bit 11 in the Y table.

# Theorarm library
# Copyright (C) 2009 Robin Watts for Pinknoise Productions Ltd

	.text

	.global	yuv420_2_rgb555

# void yuv420_to_rgb565
#  uint8_t *x_ptr
#  uint8_t *y_ptr
#  uint8_t *u_ptr
#  uint8_t *v_ptr
#  int      height
#  int      width
#  int      y_span
#  int      uv_span

DITH1	*	6
DITH2	*	7

yuv420_2_rgb555

	# r0 = x_ptr
	# r1 = y_ptr
	# r2 = u_ptr
	# r3 = v_ptr
	# <> = height
	# <> = width
	# <> = y_span
	# <> = uv_span
	STMFD	r13!,{r4-r11,r14}

	LDR	r8, [r13,#9*4]		@ r8 = height
	LDR	r9, [r13,#10*4]		@ r9 = width
	LDR	r10,[r13,#11*4]		@ r10= y_span
	LDR	r4, =0x07C07C1F
	LDR	r5, =0x40040100
	MOV	r9, r9, LSL #1
yloop1
	SUB	r8, r8, r9, LSL #15	@ r8 = height-(width<<16)
xloop1
	LDRB	r11,[r2], #1		@ r11 = u  = *u_ptr++
	LDRB	r12,[r3], #1		@ r12 = v  = *v_ptr++
	LDRB	r7, [r1, r10]		@ r7  = y2 = y_ptr[stride]
	LDRB	r6, [r1], #1		@ r6  = y0 = *y_ptr++
	ADR	r14,u_table
	LDR	r11,[r14,r11,LSL #2]	@ r11 = u  = u_table[u]
	ADD	r14,r14,#1024		@ r14 = v_table
	LDR	r12,[r14,r12,LSL #2]	@ r12 = v  = v_table[v]
	ADD	r14,r14,#1024		@ r14 = y_table
	LDR	r7, [r14,r7, LSL #2]	@ r7  = y2 = y_table[y2]
	LDR	r6, [r14,r6, LSL #2]	@ r6  = y0 = y_table[y0]
	ADD	r11,r11,r12		@ r11 = uv = u+v

	ADD	r12,r11,r5, LSR #DITH1	@ (dither 1/4)
	ADD	r7, r7, r12		@ r7  = y0 + uv
	ADD	r6, r6, r12		@ r6  = y2 + uv
	ADD	r6, r6, r5, LSR #DITH2	@ (dither 3/4)
	ANDS	r12,r7, r5
	TSTEQ	r6, r5
	BNE	fix101
return101
	AND	r7, r4, r7, LSR #3
	ORR	r7, r7, r7, LSR #17
	BIC	r7,r7,#0x8000
	STRH	r7, [r0, r9]
	AND	r6, r4, r6, LSR #3
	ORR	r6, r6, r6, LSR #17
	LDRB	r12,[r1, r10]		@ r12 = y3 = y_ptr[stride]
	LDRB	r7, [r1], #1		@ r6  = y1 = *y_ptr++
	BIC	r6,r6,#0x8000
	STRH	r6, [r0], #2

	LDR	r12,[r14, r12,LSL #2]	@ r7  = y3 = y_table[y2]
	LDR	r6, [r14, r7, LSL #2]	@ r6  = y1 = y_table[y0]

	ADD	r7, r12,r11		@ r7  = y3 + uv
	ADD	r6, r6, r11		@ r6  = y1 + uv
	ADD	r7, r7, r5, LSR #D


    ["D"] = "켄타우로스는 여러 부족으로 이루어져 있소. 각 부족마다 우두머리가 있고 자기들만의 방식이 있지만, 그들 모두 잔인하다는 공통점이 한 가지 있지.$B$B우리가 평화를 되찾으려면 반드시 켄타우로스들을 제거해야만 하오. 그리고 바로 이 일을 당신에게 맡기려고 하오.$B$B잊혀진 땅을 두루 돌아다니며 켄타우로스 녀석들을 처치하고 녀석들의 귀걸이를 가져오시오. 많으면 많을수록 좋소.$B$B얼라이언스를 위해 이 일을 해주시기 바라오. 그러면 전쟁의 끝에 한걸음 더 가까워지게 될 거요.",
    ["O"] = "잊혀진 땅의 나이젤의 야영지에 있는 하사관 멜킨스에게 켄타우로스의 귀걸이 15개를 가져가야 합니다.",
    ["T"] = "켄타우로스 현상금",
  },
  [1388] = {
    ["D"] = "모든 것이 계획대로 진행되고 있소. 당신이 죽음의추적자 즈레더스에게 이 진실의 물약을 가져다주길 바라오. 그러면 그가 그걸 어떻게 사용하는지 알려 줄 거요. 제대로... 사용하는 방법 말이지.$B$B하하!",
    ["O"] = "부랑자 소굴에 있는 죽음의추적자 즈레더스에게 파우스틴의 진실의 물약을 가져가야 합니다.",
    ["T"] = "진실의 물약",
  },
  [1389] = {
    ["D"] = "드레노어 성역에 사는 드레나이들의 겉모습은 우리와 같지만 아제로스에 이르는 고된 여정으로 인해 미쳐 버렸소. 한때는 우리 형제였지만 지금은 동쪽의 드레노어 성역에 살면서 주위에 나타나는 이들은 전부 �


Stat = cmbStats;
			if(cStat != null && !(mb.isEmpty()) && cStat.originalSize > 1000) {
				long colsEstimate = cStat.estimatedSizeCols;
				long actualSize = cStat.compressedSize;
				long originalSize = cStat.originalSize;
				int allowedTolerance = 4096;

				if(_cs.samplingRatio < 1.0) {
					allowedTolerance = sampleTolerance;
				}
				if(rows > 50000) {
					allowedTolerance *= 10;
				}

				boolean res = Math.abs(colsEstimate - actualSize) <= originalSize;
				res = res && actualSize - allowedTolerance < colsEstimate;
				if(!res) {
					StringBuilder builder = new StringBuilder();
					builder.append("\n\t" + String.format("%-40s - %12d", "Actual compressed size: ", actualSize));
					builder.append("\n\t" + String.format("%-40s - %12d with tolerance: %5d",
						"<= estimated isolated ColGroups: ", colsEstimate, allowedTolerance));
					builder.append("\n\t" + String.format("%-40s - %12d", "<= Original size: ", originalSize));
					builder.append("\n\tcol groups types: " + cStat.getGroupsTypesString());
					builder.append("\n\tcol groups sizes: " + cStat.getGroupsSizesString());
					builder.append("\n\t" + bufferedToString);
					fail(builder.toString());
				}
			}
		}
		catch(Exception e) {
			e.printStackTrace();
			throw new RuntimeException(bufferedToString + "\n" + e.getMessage(), e);
		}
	}

	@Ignore
	@Test
	public void testCompressionEstimationVSJolEstimate() {
		try {
			if(!(cmb instanceof CompressedMatrixBlock))
				return;
			CompressionStatistics cStat = cmbStats;
			if(cStat != null) {
				long actualSize = cStat.compressedSize;
				long originalSize = cStat.originalSize;
				long JolEstimatedSize = getJolSize(((CompressedMatrixBlock) cmb), cmbStats);

				StringBuilder builder = new StringBuilder();
				if(!(actualSize <= originalSize && (_cs.allowSharedDictionary || actualSize == JolEstimatedSize))) {

					builder.append("\n\t" + String.format("%-40s - %12d", "Actual compressed size: ", actualSize));
					builder.append("\n\t" + String.format("%-40s - %12d", "<= Original size: ", originalSize));
					builder.append("\n\t" + String.format("%-40s - %12d", "and equal to JOL Size: ", JolEstimatedSize));
					// builder.append("\n\t " + getJolSizeString(cmb));
					builder.append("\n\tcol groups types: " + cStat.getGroupsTypesString());
					builder.append("\n\tcol groups sizes: " + cStat.getGroupsSizesString());
					builder.append("\n\t" + bufferedToString);

					// NOTE: The Jol estimate is wrong for shared dictionaries because
					// it treats the object hierarchy as a tree and not a graph
					fail(builder.toString());
				}
			}
		}
		catch(Exception e) {
			e.printStackTrace();
			throw new RuntimeException(bufferedToString + "\n" + e.getMessage(), e);
		}
	}

	@Test
	public void testCompressionScale() {
		// This test is here for a sanity check such that we verify that the compression
		// ratio from our Matrix
		// Compressed Block is not unreasonably good.
		try {
			if(!(cmb instanceof CompressedMatrixBlock))
				return;

			CompressionStatistics cStat = cmbStats;
			if(cStat != null) {
				final double compressRatio = cStat.getRatio();

				if(compressRatio > 1000.0) {
					StringBuilder builder = new StringBuilder(


one",
                  ...n,
                },
                r.createElement("path", {
                  d: "M26.23 17.31L20.5 11.58V33.54H15.5V11.58L9.76998 17.31L6.22998 13.77L18 2.00001L29.77 13.77L26.23 17.31Z",
                  fill: "currentColor",
                }),
              );
            case "down":
              return r.createElement(
                "svg",
                {
                  xmlns: "http://www.w3.org/2000/svg",
                  width: "36px",
                  height: "36px",
                  viewBox: "0 0 36 36",
                  fill: "none",
                  ...n,
                },
                r.createElement("path", {
                  d: "M26.23 18.23L20.5 23.96V2H15.5V23.96L9.76998 18.23L6.22998 21.77L18 33.54L29.77 21.77L26.23 18.23Z",
                  fill: "currentColor",
                }),
              );
            case "left":
              return r.createElement(
                "svg",
                {
                  xmlns: "http://www.w3.org/2000/svg",
                  width: "36px",
                  height: "36px",
                  viewBox: "0 0 36 36",
                  fill: "none",
                  ...n,
                },
                r.createElement("path", {
                  d: "M17.54 9.53998L11.81 15.27L33.77 15.27V20.27H11.81L17.54 26L14 29.54L2.23002 17.77L14 5.99998L17.54 9.53998Z",
                  fill: "currentColor",
                }),
              );
            case "right":
              return r.createElement(
                "svg",
                {
                  viewBox: "0 0 36 36",
                  width: "36px",
                  height: "36px",
                  fill: "none",
                  xmlns: "http://www.w3.org/2000/svg",
                  ...n,
                },
                r.createElement("path", {
                  d: "M18.46 9.54004L24.19 15.27L2.22998 15.27L2.22998 20.27H24.19L18.46 26L22 29.54L33.77 17.77L22 6.00004L18.46 9.54004Z",
                  fill: "currentColor",
                }),
              );
          }
        }
        function ge(e) {
          return r.createElement(
            "svg",
            {
              version: "1.1",
              id: "Layer_1",
              xmlns: "http://www.w3.org/2000/svg",
              x: "0px",
              y: "0px",
              width: "50px",
              height: "100px",
              viewBox: "0 0 50 100",
              fill: e.fill || "#ffffff",
              ...e,
            },
            r.createElement("polygon", {
              points:
                "0,0.093 0,25.702 24.323,50.026 0,74.349 0,99.955 49.929,50.026 ",
            }),
          );
        }
        function fe(e) {
          return r.createElement(
            "svg",
            {
              style: { transform: `rotate(${e.angle}deg)` },
              version: "1.1",
              id: "arrowBase",
              xmlns: "http://www.w3.org/2000/svg",
              className: "SVGIcon_Button SVGIcon_DoubleArrow",
              x


) pLocalSrc;
			pLocalDst_xmm = (__m128i *) pLocalDst;
			while (width)
			{
				r0 = _mm_loadu_si128(pLocalSrc_xmm++);
				_mm_store_si128(pLocalDst_xmm++, r0);
				r1 = _mm_loadu_si128(pLocalSrc_xmm++);
				_mm_store_si128(pLocalDst_xmm++, r1);

				width--;
			}

			pLocalSrc = (unsigned char *)pLocalSrc_xmm;
			pLocalDst = (unsigned char *)pLocalDst_xmm;
			for (int x = 0; x < postfixWidth; x++)
				*pLocalDst++ = *pLocalSrc++;

			pSrcImage += srcImageStrideInBytes;
			pDstImage += dstImageStrideInBytes;
			height--;
		}
	}
	return AGO_SUCCESS;
}

#if USE_BMI2
/*The function assumes that the destination pointer is 16 byte aligned and the destination stride as well.
Also, the width is a multiple of 32, if not then number of pixels copies would be the next largest multiple of 32 after dstWidth.
The LSB of every byte is copies, therefore 0 -> 0 and non zero -> 1*/
int HafCpu_ChannelCopy_U8_U1
	(
		vx_uint32     dstWidth,
		vx_uint32     dstHeight,
		vx_uint8    * pDstImage,
		vx_uint32     dstImageStrideInBytes,
		vx_uint8    * pSrcImage,
		vx_uint32     srcImageStrideInBytes
	)
{
	__m128i * dst = (__m128i*) pDstImage;
	__m128i r0, r1;
	__m128i zeromask = _mm_setzero_si128();

	__declspec(align(16)) uint64_t pixels_u64[4];
	uint64_t maskConv = 0x0101010101010101;

	for (unsigned int height = 0; height < dstHeight; height++)
	{
		for (unsigned int width = 0; width < dstWidth; width += 32)
		{
			// Read the U1 values from src1
			pixels_u64[0] = (uint64_t)(*(pSrcImage + (width >> 3)));
			pixels_u64[1] = (uint64_t)(*(pSrcImage + (width >> 3) + 1));
#ifdef _WIN64
			pixels_u64[0] = _pdep_u64(pixels_u64[0], maskConv);
			pixels_u64[1] = _pdep_u64(pixels_u64[1], maskConv);
#else
#pragma message("Warning: TBD: need a 32-bit implementation using _pext_u32")
#endif
			// Read the U1 values from src2
			pixels_u64[2] = (uint64_t)(*(pSrcImage + (width >> 3) + 2));
			pixels_u64[3] = (uint64_t)(*(pSrcImage + (width >> 3) + 3));
#ifdef _WIN64
			pixels_u64[2] = _pdep_u64(pixels_u64[2], maskConv);
			pixels_u64[3] = _pdep_u64(pixels_u64[3], maskConv);
#else
#pragma message("Warning: TBD: need a 32-bit implementation using _pext_u32")
#endif
			r0 = _mm_load_si128((__m128i*) pixels_u64);
			r1 = _mm_load_si128((__m128i*) (pixels_u64 + 2));

			// Convert U1 to U8	- Thresholded
			r0 = _mm_cmpgt_epi8(r0, zeromask);
			r1 = _mm_cmpgt_epi8(r1, zeromask);

			_mm_store_si128(&dst[width >> 4], r0);


solution
	m.WriteFloat32(72)    // vertical resolution
	m.Skip(4)             // reserved
	m.WriteUint16(1)      // frame count
	m.Skip(32)            // compressor name
	m.WriteUint16(24)     // depth
	m.WriteUint16(0xFFFF) // color table id (-1)

	switch codec {
	case core.CodecH264:
		m.StartAtom("avcC")
	case core.CodecH265:
		m.StartAtom("hvcC")
	}
	m.Write(conf)
	m.EndAtom() // AVCC

	m.StartAtom("pasp") // Pixel Aspect Ratio
	m.WriteUint32(1)    // hSpacing
	m.WriteUint32(1)    // vSpacing
	m.EndAtom()

	m.EndAtom() // AVC1
}

func (m *Movie) WriteAudio(codec string, channels uint16, sampleRate uint32, conf []byte) {
	switch codec {
	case core.CodecAAC, core.CodecMP3:
		m.StartAtom("mp4a") // supported in all players and browsers
	case core.CodecFLAC:
		m.StartAtom("fLaC") // supported in all players and browsers
	case core.CodecOpus:
		m.StartAtom("Opus") // supported in Chrome and Firefox
	case core.CodecPCMU:
		m.StartAtom("ulaw")
	case core.CodecPCMA:
		m.StartAtom("alaw")
	default:
		panic("unsupported iso audio: " + codec)
	}

	if channels == 0 {
		channels = 1
	}

	m.Skip(6)
	m.WriteUint16(1)                    // data_reference_index
	m.Skip(2)                           // version
	m.Skip(2)                           // revision
	m.Skip(4)                           // vendor
	m.WriteUint16(channels)             // channel_count
	m.WriteUint16(16)                   // sample_size
	m.Skip(2)                           // compression id
	m.Skip(2)                           // reserved
	m.WriteFloat32(float64(sampleRate)) // sample_rate

	switch codec {
	case core.CodecAAC:
		m.WriteEsdsAAC(conf)
	case core.CodecMP3:
		m.WriteEsdsMP3()
	case core.CodecFLAC:
		m.StartAtom("dfLa")
		m.Write(pcm.FLACHeader(false, sampleRate))
		m.EndAtom()
	case core.CodecOpus:
		m.WriteOpus(channels, sampleRate)
	case core.CodecPCMU, core.CodecPCMA:
		// don't know what means this magic
		m.StartAtom("chan")
		m.WriteBytes(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0)
		m.EndAtom()
	}

	m.EndAtom() // MP4A/OPUS
}

func (m *Movie) WriteEsdsAAC(conf []byte) {
	m.StartAtom("esds")
	m.Skip(1) // version
	m.Skip(3) // flags

	// MP4ESDescrTag[3]:
	// - MP4DecConfigDescrTag[4]:
	//   - MP4DecSpecificDescrTag[5]: conf
	// - Other[6]
	const header = 5
	const size3 = 3
	const size4 = 13
	size5 := byte(len(conf))
	const size6 = 1

	m.WriteBytes(3, 0x80, 0x80, 0x80, size3+header+size4+header+size5+header+size6)
	m.Skip(2) // es id
	m.Skip(1) // es flags

	// https://learn.microsoft.com/en-us/windows/win32/medfound/mpeg-4-file-sink#aac-audio
	m.WriteBytes(4, 0x80, 0x80, 0x80, size4+header+size5)
	m.WriteBytes(0x40) // object id
	m.WriteBytes(0x15) // stream type


ind': 'TYPE', 'value': 'AA'},
            {'kind': 'TYPE', 'value': 'BB'},
          ],
        },
        {
          'length': 5,
          'positions': [
            {'file': '/gb.dart', 'offset': 10},
            {'file': '/gb.dart', 'offset': 100},
          ],
          'suggestions': [],
        },
      ],
      'selection': {'file': '/selection.dart', 'offset': 42},
    };
    expect(change.toJson(), expectedJson);
    // some toString()
    change.toString();
  }
}

@reflectiveTest
class EditTest {
  /// There is no ambiguity in edits sorted last-to-first and the implementation
  /// may optimize this case.
  void test_applySequence_lastToFirst() {
    var edit1 = SourceEdit(5, 2, 'abc');
    var edit2 = SourceEdit(1, 0, '!');
    expect(
      SourceEdit.applySequence('0123456789', [edit1, edit2]),
      '0!1234abc789',
    );
  }

  void test_applySequence_lastToFirst_invalidLength_negative() {
    var edit1 = SourceEdit(1, 0, 'a');
    var edit2 = SourceEdit(0, -1, '');
    expect(
      () => SourceEdit.applySequence('', [edit1, edit2]),
      throwsRangeError('The edit length is negative.'),
    );
  }

  void test_applySequence_lastToFirst_invalidLength_pastEndOfString() {
    var edit1 = SourceEdit(1, 100, 'a');
    var edit2 = SourceEdit(0, 0, '');
    expect(
      () => SourceEdit.applySequence('aa', [edit1, edit2]),
      throwsRangeError('The edit extends past the end of the code.'),
    );
  }

  void test_applySequence_lastToFirst_invalidOffset_negative() {
    var edit1 = SourceEdit(1, 0, 'a');
    var edit2 = SourceEdit(-1, 0, '');
    expect(
      () => SourceEdit.applySequence('', [edit1, edit2]),
      throwsRangeError('The edit offset is negative.'),
    );
  }

  void test_applySequence_lastToFirst_invalidOffset_pastEndOfString() {
    var edit1 = SourceEdit(1, 0, 'a');
    var edit2 = SourceEdit(0, 0, 'b');
    expect(
      () => SourceEdit.applySequence('', [edit1, edit2]),
      throwsRangeError('The edit starts past the end of the code.'),
    );
  }

  /// Last-to-first offsets may have overlaps if edit `n+1` replaces text
  /// inserted by edit `n`. The result should be as if they were applied
  /// sequentially.
  ///
  /// Although sorted last-to-first, this case will fall back to sequential
  /// processing.
  void test_applySequence_lastToFirstOffsets_overlap() {
    var edit1 = SourceEdit(3, 0, '1111');
    var edit2 = SourceEdit(1, 4, '2222'); // replaces aa11
    expect(SourceEdit.applySequence('aaaa', [edit1, edit2]), 'a222211a');
  }

  /// Last-to-first offsets may have overlaps if edit `n+1` replaces text
  /// inserted by edit `n`. The result should be as if they were applied
  /// sequentially.
  ///
  /// Although sorted last-to-first, this case will fall back to sequential
  /// processing.
  void test_applySequence_lastToFirstOffsets_touching() {
    var edit1 = SourceEdit(3, 0, '1111');
    var edit2 = SourceEdit(1, 2, '2222'); // replaces aa
    expect(SourceEdit.applySequence('aaaa', [edit1, edit2]), 'a22221111a');
  }

  /// Edits are described sequentially, so the offsets in edit `n` assume edit
  /// `n-1` has been applied.
  void


 ConstantInt *ConstInt = dyn_cast<ConstantInt>(SrcValue2)) {
    if (SrcVT == MVT::i64 || SrcVT == MVT::i32 || SrcVT == MVT::i16 ||
        SrcVT == MVT::i8 || SrcVT == MVT::i1) {
      const APInt &CIVal = ConstInt->getValue();
      Imm = (IsZExt) ? (long)CIVal.getZExtValue() : (long)CIVal.getSExtValue();
      if ((IsZExt && isUInt<16>(Imm)) || (!IsZExt && isInt<16>(Imm)))
        UseImm = true;
    }
  }

  unsigned SrcReg1 = getRegForValue(SrcValue1);
  if (SrcReg1 == 0)
    return false;

  unsigned SrcReg2 = 0;
  if (!UseImm) {
    SrcReg2 = getRegForValue(SrcValue2);
    if (SrcReg2 == 0)
      return false;
  }

  unsigned CmpOpc;
  bool NeedsExt = false;

  auto RC1 = MRI.getRegClass(SrcReg1);
  auto RC2 = SrcReg2 != 0 ? MRI.getRegClass(SrcReg2) : nullptr;

  switch (SrcVT.SimpleTy) {
    default: return false;
    case MVT::f32:
      if (HasSPE) {
        switch (Pred) {
          default: return false;
          case PPC::PRED_EQ:
            CmpOpc = PPC::EFSCMPEQ;
            break;
          case PPC::PRED_LT:
            CmpOpc = PPC::EFSCMPLT;
            break;
          case PPC::PRED_GT:
            CmpOpc = PPC::EFSCMPGT;
            break;
        }
      } else {
        CmpOpc = PPC::FCMPUS;
        if (isVSSRCRegClass(RC1))
          SrcReg1 = copyRegToRegClass(&PPC::F4RCRegClass, SrcReg1);
        if (RC2 && isVSSRCRegClass(RC2))
          SrcReg2 = copyRegToRegClass(&PPC::F4RCRegClass, SrcReg2);
      }
      break;
    case MVT::f64:
      if (HasSPE) {
        switch (Pred) {
          default: return false;
          case PPC::PRED_EQ:
            CmpOpc = PPC::EFDCMPEQ;
            break;
          case PPC::PRED_LT:
            CmpOpc = PPC::EFDCMPLT;
            break;
          case PPC::PRED_GT:
            CmpOpc = PPC::EFDCMPGT;
            break;
        }
      } else if (isVSFRCRegClass(RC1) || (RC2 && isVSFRCRegClass(RC2))) {
        CmpOpc = PPC::XSCMPUDP;
      } else {
        CmpOpc = PPC::FCMPUD;
      }
      break;
    case MVT::i1:
    case MVT::i8:
    case MVT::i16:
      NeedsExt = true;
      LLVM_FALLTHROUGH;
    case MVT::i32:
      if (!UseImm)
        CmpOpc = IsZExt ? PPC::CMPLW : PPC::CMPW;
      else
        CmpOpc = IsZExt ? PPC::CMPLWI : PPC::CMPWI;
      break;
    case MVT::i64:
      if (!UseImm)
        CmpOpc = IsZExt ? PPC::CMPLD : PPC::CMPD;
      else
        CmpOpc = IsZExt ? PPC::CMPLDI : PPC::CMPDI;
      break;
  }

  if (NeedsExt) {
    unsigned ExtReg = createResultReg(&PPC::GPRCRegClass);
    if (!PPCEmitIntExt(SrcVT, SrcReg1, MVT::i32, ExtReg, IsZExt))
      return false;
    SrcReg1 = ExtReg;

    if (!UseImm) {
      unsigned ExtReg = createResultReg(&PPC::GPRCRegClass);
      if (!PPCEmitIntExt(SrcVT, SrcReg2, MVT::i32, ExtReg, IsZExt))
        return false;
      SrcReg2 = ExtReg;
    }
  }


   description = "Switch jobs with the player you're looking at",
    delay = 1.5,
    condition = fn.Compose{fn.Curry(fn.GetValue, 2)("allowjobswitch"), fn.Curry(fn.GetValue, 2)("Config"), gmod.GetGamemode}
}

DarkRP.declareChatCommand{
    command = "jobswitch",
    description = "Switch jobs with the player you're looking at",
    delay = 1.5,
    condition = fn.Compose{fn.Curry(fn.GetValue, 2)("allowjobswitch"), fn.Curry(fn.GetValue, 2)("Config"), gmod.GetGamemode}
}

DarkRP.declareChatCommand{
    command = "teamban",
    description = "Ban someone from getting a certain job",
    delay = 1.5,
    tableArgs = true
}

DarkRP.declareChatCommand{
    command = "teamunban",
    description = "Undo a teamban",
    delay = 1.5,
    tableArgs = true
}


${this.doc.join('\n')}\n`;
  }
}
import { SimpleCommand } from "chatcommon/src/Commands";
import { IProtocol, IProtocolType, IChannelBody } from "chatcommon/src/IProtocol";
import { iSocket } from "chatcommon/src/iSocket";
import { ChatSvrSocket } from "./ChatSvrSocket";
import { Log } from "chatcommon/src/log/Log";

export class ChannelCommand extends SimpleCommand {
    constructor() { super() }
    receiver(protocol: IProtocol, sock: iSocket): void {
        let channelBody:IChannelBody = protocol.msg_body;
        switch (protocol.type) {
            case IProtocolType.joinChannel:
                Log.infoLog(`${protocol.id}进入了 channel : ${channelBody.channelName}`)
                break;
            case IProtocolType.levelChannel:
                Log.infoLog(`${protocol.id}离开了 channel : ${channelBody.channelName}`)
                break;
        }
    }

    send(type: number, socket: iSocket, ...args) {
        let chatClient: ChatSvrSocket = <ChatSvrSocket>socket;
        switch (type) {
            case IProtocolType.joinChannel:
            case IProtocolType.levelChannel:
                const channelName: string = args[0];
                let channelBody: IChannelBody = {
                    channelName: channelName,
                }
                var protocol: IProtocol = {
                    type: type,
                    in_char_svr: chatClient.chat_svr.svr_name,
                    in_product: chatClient.opts.product,
                    id: chatClient.opts.userId,
                    msg_body: channelBody
                }
                socket.send(protocol);
            break;
        }
    }
}// src/store/chat/reducers.ts
import * as io from 'socket.io-client';

import {
    ChatState,
    ChatActionTypes,
    LOGIN,
    UPDATE_MESSAGE,
} from './types'

const initialState: ChatState = {
    username: '',
    uid: '',
    messages: [],
    onlineUsers: {uid: '', username: ''},
    onlineCount: 0,
    socket: io('http://localhost:3000'),
}

export function chatReducer(
    state = initialState,
    action: ChatActionTypes
): ChatState {
    switch (action.type) {
        case LOGIN:
        case UPDATE_MESSAGE:
            return { ...state, ...action.payload }
        default:
            return state
    }
}import Body from "../objects/Body";
import Equation from "../equations/Equation";
export interface ConstraintOptions {
  collideConnected: boolean;
  wakeUpBodies: boolean;
}
/**
 * Constraint base class
 * @class Constraint
 * @author schteppe
 * @constructor
 * @param {Body} bodyA
 * @param {Body} bodyB
 * @param {object} [options]
 * @param {boolean} [options.collideConnected=true]
 * @param {boolean} [options.wakeUpBodies=true]
 */
export default abstract class Constraint {
  static idCounter: number = 0;
  /**
   * @property {Number} id
   */
  public id: number;
  /**
   * Equations to be solved in this constraint
   * @property equations
   * @type {Array}
   */
  public equations: Equation[];
  /**
   * @property {Body} bodyA
   */
  public bodyA: Body;
  /**
   * @property {Body} bodyB
   */
  public bodyB: Body;
  /**
   * Set to true if you want the bodies to collide when they are connected.
   * @property collideConnected
   * @type {boolean}
   */
  public collideConnected: boolean;

  constructor(
    bodyA: Body,
    bodyB: Body,
    options: ConstraintOptions = { collideConnected: true, wakeUpBodies: true }
  ) {
    this.id = Constraint.idCounter++;
    this.bodyA = bodyA;


-cc_interrupt

.globl do_interrupt
	.hidden do_interrupt
	.type	do_interrupt, @function
do_interrupt:
	mov	pcaddr, %edi
	add	$-12, %esp
	push	%edi
	call	get_addr_ht
	add	$16, %esp
	mov	reg_cop0+36, %esi
	mov	next_interupt, %ebx
	mov	%ebx, last_count
	sub	%ebx, %esi
	add	$2, %esi
	jmp	*%eax
	.size	do_interrupt, .-do_interrupt

.globl fp_exception
	.hidden fp_exception
	.type	fp_exception, @function
fp_exception:
	mov	$0x1000002c, %edx
.E7:
	mov	reg_cop0+48, %ebx
	add	$-12, %esp
	or	$2, %ebx
	mov	%ebx, reg_cop0+48 /* Status */
	mov	%edx, reg_cop0+52 /* Cause */
	mov	%eax, reg_cop0+56 /* EPC */
	push    $0x80000180
	call	get_addr_ht
	add	$16, %esp
	jmp	*%eax
	.size	fp_exception, .-fp_exception

.globl fp_exception_ds
	.hidden fp_exception_ds
	.type	fp_exception_ds, @function
fp_exception_ds:
	mov	$0x9000002c, %edx /* Set high bit if delay slot */
	jmp	.E7
	.size	fp_exception_ds, .-fp_exception_ds

.globl jump_syscall
	.hidden jump_syscall
	.type	jump_syscall, @function
jump_syscall:
	mov	$0x20, %edx
	mov	reg_cop0+48, %ebx
	add	$-12, %esp
	or	$2, %ebx
	mov	%ebx, reg_cop0+48 /* Status */
	mov	%edx, reg_cop0+52 /* Cause */
	mov	%eax, reg_cop0+56 /* EPC */
	push    $0x80000180
	call	get_addr_ht
	mov	$16, %esp
	jmp	*%eax
	.size	jump_syscall, .-jump_syscall

.globl jump_eret
	.hidden jump_eret
	.type	jump_eret, @function
jump_eret:
	mov	reg_cop0+48, %ebx /* Status */
	add	last_count, %esi
	and	$0xFFFFFFFD, %ebx
	mov	%esi, reg_cop0+36 /* Count */
	mov	%ebx, reg_cop0+48 /* Status */
	call	check_interupt
	mov	next_interupt, %eax
	mov	reg_cop0+36, %esi
	mov	%eax, last_count
	sub	%eax, %esi
	mov	reg_cop0+56, %eax /* EPC */
	jns	.E11
.E8:
	mov	$248, %ebx
	xor	%edi, %edi
.E9:
	mov	reg(%ebx), %ecx
	mov	reg+4(%ebx), %edx
	sar	$31, %ecx
	xor	%ecx, %edx
	neg	%edx
	adc	%edi, %edi
	sub	$8, %ebx
	jne	.E9
	mov	hi(%ebx), %ecx
	mov	hi+4(%ebx), %edx
	sar	$31, %ecx
	xor	%ecx, %edx
	jne	.E10
	mov	lo(%ebx), %ecx
	mov	lo+4(%ebx), %edx
	sar	$31,


Width(radius);
		/**
		 * 画背景
		 */
		if(isShowBg){
		 canvas.drawCircle(width/2, height/2, radius*3f, bgPaint1);
		 canvas.drawCircle(width/2, height/2, radius*2f, bgPaint2);
		 canvas.drawCircle(width/2, height/2, radius*1f, bgPaint3);
		}
		/**
		 * 圆弧位置
		 */
		RectF rectF1 = getRectF1();
		RectF rectF2 = getRectF2();
		RectF rectF3 = getRectF3();
		float[] loc = getLocation1();
		float[] angle = getAngle1();
		canvas.drawArc(rectF1, angle[0], angle[1], false, arcPaint1);
		//这是画圆弧两头的圆点
		canvas.drawCircle(loc[0], loc[1], radius/2, circlePaint1);
		canvas.drawCircle(loc[2], loc[3], radius / 2, circlePaint1);
		angle = getAngle2();
		loc = getLocation2();
		canvas.drawArc(rectF2, angle[0], angle[1], false, arcPaint2);
		//这是画圆弧两头的圆点
		canvas.drawCircle(loc[0], loc[1], radius/2, circlePaint2);
		canvas.drawCircle(loc[2], loc[3], radius/2, circlePaint2);
		angle = getAngle3();
		loc = getLocation3();
		canvas.drawArc(rectF3, angle[0], angle[1], false, arcPaint3);
		//这是画圆弧两头的圆点
		canvas.drawCircle(loc[0], loc[1], radius/2, circlePaint3);
		canvas.drawCircle(loc[2], loc[3], radius/2, circlePaint3);
		if (!stop) {
			index++;
			invalidate();
			if (index == Integer.MAX_VALUE)
				index = 0;
		}
		super.onDraw(canvas);
	}

	private void initPaint() {
		arcPaint1.setColor(color1);
		arcPaint2.setColor(color2);
		arcPaint3.setColor(color3);
		circlePaint1.setColor(color1);
		circlePaint2.setColor(color2);
		circlePaint3.setColor(color3);
		bgPaint1.setColor(color1);
		bgPaint1.setAlpha(bgAlpha);
		bgPaint2.setColor(color2);
		bgPaint2.setAlpha(bgAlpha);
		bgPaint3.setColor(color3);
		bgPaint3.setAlpha(bgAlpha);
	}

	/**
	 * 圆弧位置
	 *
	 * @return
	 */
	private RectF getRectF1() {
		if (width > height) {
			return new RectF((width - height) / 2 + (radius * 0.5f),
					(radius * 0.5f), width - (width - height) / 2
					- (radius * 0.5f), height - (radius * 0.5f));
		} else {
			return new RectF((radius * 0.5f), (height - width) / 2
					+ (radius * 0.5f), width - (radius * 0.5f), height
					- (height - width) / 2 - (radius * 0.5f));
		}
	}

	/**
	 * 圆弧位置
	 *
	 * @return
	 */
	private RectF getRectF2() {
		if (width > height) {
			return new RectF((width - height) / 2 + (radius * 1.5f),
					(radius * 1.5f), width - (width - height) / 2
					- (radius * 1.5f), height - (radius * 1.5f));
		} else {
			return new RectF(radius * 1.5f, (height - width) / 2
					+ (radius * 1.5f), width - (radius * 1


) {
  DBUG_TRACE;
  DBUG_PRINT("enter", ("mode : %d", auto_mode));

  return (bool)mysql_real_query(
      mysql, auto_mode ? "set autocommit=1" : "set autocommit=0", 16);
}

/********************************************************************
 Multi query execution + SPs APIs
*********************************************************************/

/*
  Returns true/false to indicate whether any more query results exist
  to be read using mysql_next_result()
*/

bool STDCALL mysql_more_results(MYSQL *mysql) {
  bool res;
  DBUG_TRACE;

  res = ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1 : 0);
  DBUG_PRINT("exit", ("More results exists ? %d", res));
  return res;
}

/*
  Reads and returns the next query results
*/
int STDCALL mysql_next_result(MYSQL *mysql) {
  DBUG_TRACE;

  /*
    This is a hack for clients who call mysql_next_result on closed
    connections. MYSQL_TRACE_STAGE will allocate memory in that case,
    but that memory is never free'd since we already called mysql_close,
    resulting in a leak.
  */
  if (mysql->net.vio == nullptr) return -1;

  MYSQL_TRACE_STAGE(mysql, WAIT_FOR_RESULT);

  if (mysql->status != MYSQL_STATUS_READY) {
    set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
    return 1;
  }

  net_clear_error(&mysql->net);
  mysql->affected_rows = ~(uint64_t)0;

  if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
    return (*mysql->methods->next_result)(mysql);
  else {
    MYSQL_TRACE_STAGE(mysql, READY_FOR_COMMAND);
  }

  return -1; /* No more results */
}

/*
  This API reads the next statement result and returns a status to indicate
  whether more results exist

  @param[in]    mysql                                    connection handle

  @retval       NET_ASYNC_ERROR                          Error
  @retval       NET_ASYNC_NOT_READY                      reading next result not
                                                         yet completed, call
                                                         this API again
  @retval       NET_ASYNC_COMPLETE                       finished reading result
  @retval       NET_ASYNC_COMPLETE_NO_MORE_RESULTS       status to indicate if
                                                         more results exist
*/
net_async_status STDCALL mysql_next_result_nonblocking(MYSQL *mysql) {
  DBUG_TRACE;
  net_async_status status;
  if (mysql->status != MYSQL_STATUS_READY) {
    set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
    return NET_ASYNC_ERROR;
  }
  net_clear_error(&mysql->net);
  mysql->affected_rows = ~(uint64_t)0;

  if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) {
    status = (*mysql->methods->next_result_nonblocking)(mysql);
    return status;
  } else {
    MYSQL_TRACE_STAGE(mysql, READY_FOR_COMMAND);
  }

  return NET_ASYNC_COMPLETE_NO_MORE_RESULTS; /* No more results */
}

int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt) {
  MYSQL *mysql = stmt->mysql;
  int rc;
  DBUG_TRACE;

  if (!mysql) return 1;

  if (stmt->last_errno) return stmt->last_errno;

  if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) {
    if (reset_stmt_handle(stmt, RESET_STOR


singleton = Settings._internal();

  factory Settings() => _singleton;

  // late LocalSettings _localSettings;

  late ServerSettings _serverSettings;

  Settings._internal();

  Future<void> init() async {
    // _localSettings = await LocalSettings.load();
    _serverSettings = await ServerSettings.load();
  }

  // Future<LocalSettings> get localSettings async {
  //   await init();
  //   return _localSettings;
  // }

  Future<ServerSettings> get serviceSettings async {
    await init();
    return _serverSettings;
  }

  // void updateValue(String key, dynamic value) {
  //   switch (key) {
  //     case LocalSettings.keyUseMeetId:
  //       _localSettings.useMeetId = value as bool;
  //       break;
  //     case LocalSettings.keyCameraOpen:
  //       _localSettings.cameraOpen = value as bool;
  //       break;
  //     case LocalSettings.keyMicroOpen:
  //       _localSettings.microphoneOpen = value as bool;
  //       break;
  //     case LocalSettings.keyShowMeetTimeOpen:
  //       _localSettings.showMeetingTime = value as bool;
  //       break;
  //   }
  //   UserPreferences().setLocalSettings(jsonEncode(_localSettings));
  // }
}

/// 本地设置
// class LocalSettings {
//   static const String keyUseMeetId = 'useMeetId';
//   static const String keyCameraOpen = 'cameraOpen';
//   static const String keyMicroOpen = 'microphoneOpen';
//   static const String keyShowMeetTimeOpen = 'showMeetingTime';
//
//   /// 是否使用个人会议Id
//   bool useMeetId = false;
//
//   /// 默认摄像头状态
//   bool cameraOpen = true;
//
//   /// 默认麦克风状态
//   bool microphoneOpen = true;
//
//   /// 显示会议持续时间
//   bool showMeetingTime = false;
//
//   Map toJson() => {
//         keyUseMeetId: useMeetId,
//         keyCameraOpen: cameraOpen,
//         keyMicroOpen: microphoneOpen,
//         keyShowMeetTimeOpen: showMeetingTime,
//       };
//
//   /// load from sp
//   static Future<LocalSettings> load() async {
//     var localSettings = await UserPreferences().localSettings;
//     return fromJson(localSettings);
//   }
//
//   static LocalSettings fromJson(String? localSettings) {
//     if (TextUtil.isEmpty(localSettings)) {
//       return LocalSettings(); // default value
//     }
//     return fromMap(json.decode(localSettings!) as Map);
//   }
//
//   static LocalSettings fromMap(Map map) {
//     var settings = LocalSettings();
//     settings.useMeetId = (map[keyUseMeetId] ?? false) as bool;
//     settings.cameraOpen = (map[keyCameraOpen] ?? true) as bool;
//     settings.microphoneOpen = (map[keyMicroOpen] ?? true) as bool;
//     settings.showMeetingTime = (map[keyShowMeetTimeOpen] ?? true) as bool;
//     return settings;
//   }
// }

/// 服务器设置
class ServerSettings {
  /// load from sp
  static Future<ServerSettings> load() async {
    var serverSettings = await UserPreferences().serverSettings;
    return fromJson(serverSettings);
  }

  static ServerSettings fromJson(String? serverSettings) {
    if (TextUtil.isEmpty


TestObject {
    Circle,
    Line,
    Point,
    Poly
}

impl CollisionDataType for CollisionTestObject {}

impl Game for CollisionTestGame {
    type Primitive = StandardPrimitive;

    fn update_input(&mut self) {
        self.update_switches();
        self.update_object_controls();
        self.update_player_control();
    }

    fn update_logic(&mut self, t_step: f64) {
        self.set_mouse();
        let mov_horizontal = self.game_input.mov_horizontal;
        let mov_vertical = self.game_input.mov_vertical;
        let rot = self.game_input.rot;

        for obj in self.get_collision_wrappers_mut() {
            obj.set_prev();
            if obj.is_player_controlled() {
                obj.shift_by(t_step * 0.4 * Point::new(mov_horizontal as f64, mov_vertical as f64));
                obj.rotate_at_center(t_step * rot as f64);
            }
        }

        self.handle_collision();

        self.update_colors();
    }

    fn get_renderables(&mut self, _: WindowSpec) -> Vec<Box<StandardRenderable>> {
        let mut output: Vec<Box<StandardRenderable>> = vec![];
        for obj in self.get_collision_wrappers() {
            output.append(&mut obj.render(0.0));
            output.append(&mut obj.render_coll_results(-0.1));
        }
        output
    }

    fn get_input<'a>(&'a mut self) -> Option<&'a mut dyn games::GameInput> {
        Some(&mut self.external_input)
    }
}

impl CollisionTestGame {
    fn handle_collision(&mut self) {
        let collidables: Vec<_> = self.get_collidables_mut().collect();
        Collider::process_all(collidables);
    }

    fn set_mouse(&mut self) {
        if let Some(mouse) = self.external_input.mouse.devices.iter().nth(0) {
            let ext_mouse_mov = mouse.movement;
            self.mouse_mov = self.mouse_speed * Point::new(ext_mouse_mov.0 as f64, -ext_mouse_mov.1 as f64);
        }
    }

    fn get_collidables_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut dyn Collidable<Data = CollisionTestObject>> {
        self.polys.iter_mut().map(|it| -> &'a mut dyn Collidable<Data = CollisionTestObject> {it})
        .chain(self.lines.iter_mut().map(|it| -> &'a mut dyn Collidable<Data = CollisionTestObject> {it}))
        .chain(self.circles.iter_mut().map(|it| -> &'a mut dyn Collidable<Data = CollisionTestObject> {it}))
        .chain(self.points.iter_mut().map(|it| -> &'a mut dyn Collidable<Data = CollisionTestObject> {it}))
    }

    fn get_collision_wrappers_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut dyn CollidableWrapperTrait> {
        self.polys.iter_mut().map(|it| -> &'a mut dyn CollidableWrapperTrait{it})
        .chain(self.lines.iter_mut().map(|it| -> &'a mut dyn CollidableWrapperTrait{it}))
        .chain(self.circles.iter_mut().map(|it| -> &'a mut dyn CollidableWrapperTrait{it}))
        .chain(self.points.iter_mut().map(|it| -> &'a mut dyn CollidableWrapperTrait{it}))
    }

    fn get_collision_wrappers<'a>(&'a self) -> impl Iterator<Item = &'a dyn CollidableWrapperTrait> {