hi,x ; This write enables the effect

    rts

;======================================================================================================================
; FAMISTUDIO_SFX_UPDATE (internal)
;
; Updates a single sound effect stream.
;
; [in] x: Offset of sound effect channel, should be FAMISTUDIO_SFX_CH0..FAMISTUDIO_SFX_CH3
;======================================================================================================================

famistudio_sfx_update:

    .local .tmp
    .local .tmpx
    .local .effect_data_ptr
    .tmp = famistudio_r0
    .tmpx = famistudio_r1
    .effect_data_ptr = famistudio_ptr0

    lda famistudio_sfx_repeat,x ; Check if repeat counter is not zero
    beq .famistudio_sfx_update_no_repeat
    dec famistudio_sfx_repeat,x ; Decrement and return
    bne .famistudio_sfx_update_update_buf ; Just mix with output buffer

.famistudio_sfx_update_no_repeat:
    lda famistudio_sfx_ptr_hi,x ; Check if MSB of the pointer is not zero
    bne .famistudio_sfx_update_sfx_active
    rts ; Return otherwise, no active effect

.famistudio_sfx_update_sfx_active:
    sta *.effect_data_ptr+1         ;load effect pointer into temp
    lda famistudio_sfx_ptr_lo,x
    sta *.effect_data_ptr+0
    ldy famistudio_sfx_offset,x
    clc

.famistudio_sfx_update_read_byte:
    lda [*.effect_data_ptr],y ; Read byte of effect
    bmi .famistudio_sfx_update_get_data ; If bit 7 is set, it is a register write
    beq .famistudio_sfx_update_eof
    iny
    bne .famistudio_sfx_update_store_repeat
    jsr .famistudio_sfx_update_inc_sfx
.famistudio_sfx_update_store_repeat:
    sta famistudio_sfx_repeat,x ; If bit 7 is reset, it is number of repeats
    tya
    sta famistudio_sfx_offset,x
    jmp .famistudio_sfx_update_update_buf

.famistudio_sfx_update_get_data:
    iny
    bne .famistudio_sfx_update_get_data2
    jsr .famistudio_sfx_update_inc_sfx
.famistudio_sfx_update_get_data2:
    stx *.tmp ; It is a register write
    adc *.tmp ; Get offset in the effect output buffer
    tax
    lda [*.effect_data_ptr],y
    iny
    bne .famistudio_sfx_update_write_buffer
    stx *.tmpx
    ldx *.tmp
    jsr .famistudio_sfx_update_inc_sfx
    ldx *.tmpx
.famistudio_sfx_update_write_buffer:
    sta famistudio_sfx_buffer-128,x
    ldx *.tmp
    jmp .famistudio_sfx_update_read_byte

.famistudio_sfx_update_eof:
    sta famistudio_sfx_ptr_hi,x ; Mark channel as inactive

.famistudio_sfx_update_update_buf:
    lda fa


\n

\n

\n
\n
\n\n

\n\n
\n            <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${a(e.interaction.input)} aria-label="${c("aria:input")}">\n\n            <input :arr="options" class="pcr-type" data-type="HEXA" value="${s?"HEX":"HEXA"}" type="button" ${a(e.interaction.hex)}>\n            <input :arr="options" class="pcr-type" data-type="RGBA" value="${s?"RGB":"RGBA"}" type="button" ${a(e.interaction.rgba)}>\n            <input :arr="options" class="pcr-type" data-type="HSLA" value="${s?"HSL":"HSLA"}" type="button" ${a(e.interaction.hsla)}>\n            <input :arr="options" class="pcr-type" data-type="HSVA" value="${s?"HSV":"HSVA"}" type="button" ${a(e.interaction.hsva)}>\n            <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${a(e.interaction.cmyk)}>\n\n            <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${a(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n            <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${a(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n            <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${a(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n
\n
\n
\n    `),u=p.interaction;return u.options.find(t=>!t.hidden&&!t.classList.add("active")),u.type=()=>u.options.find(t=>t.classList.contains("active")),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],r=()=>this._color||(this._color=this._lastColor.clone()),s={palette:$({element:t._root.palette.picker,wrapper:t._


36 --
TITAN_ZONELEVEL_KAKE = "Kargathia Keep"; -- 28 / 30 --
TITAN_ZONELEVEL_KAOU = "Kargathia Outpost"; -- 0 / 0 --
TITAN_ZONELEVEL_KAR = "Kargath"; -- 30 / 60 --
TITAN_ZONELEVEL_KHA = "Kharanos"; -- 5 / 30 --
TITAN_ZONELEVEL_KOGR = "Kodo Graveyard"; -- 31 / 38 --
TITAN_ZONELEVEL_KOCR = "Kolkar Crag"; -- 2 / 9 --
TITAN_ZONELEVEL_KOVI = "Kolkar Village"; -- 30 / 33 --
TITAN_ZONELEVEL_KOHU = "Kormek's Hut"; -- 30 / 34 --
TITAN_ZONELEVEL_KUCO = "Kurzen's Compound"; -- 30 / 35 --

--<< L >>--
TITAN_ZONELEVEL_LAEV = "Lake Everstill"; -- 16 / 22 --
TITAN_ZONELEVEL_LAFA = "Lake Falathim"; -- 18 / 20 --
TITAN_ZONELEVEL_LAKE = "Lake Kel'Theril"; -- 54 / 57 --
TITAN_ZONELEVEL_LAMEN = "Lake Mennar"; -- 50 / 54 --
TITAN_ZONELEVEL_LAMER = "Lake Mereldar"; -- 53 / 56 --
TITAN_ZONELEVEL_LANA = "Lake Nazferiti"; -- 30 / 36 --
TITAN_ZONELEVEL_LAHI = "Lakeridge Highway"; -- 14 / 19 --
TITAN_ZONELEVEL_LAK = "Lakeshire"; -- 0 / 0 --
TITAN_ZONELEVEL_LATAPI = "Lakkari Tar Pits"; -- 48 / 61 --
TITAN_ZONELEVEL_LAENBE = "Land's End Beach"; -- 48 / 50 --
TITAN_ZONELEVEL_LAPA = "Lariss Pavillion"; -- 40 / 46 --
TITAN_ZONELEVEL_LEEN = "Legash Encampment"; -- 51 / 51 --
TITAN_ZONELEVEL_LERA = "Lethlor Ravine"; -- 41 / 57 --
TITAN_ZONELEVEL_LIHOCH = "Light's Hope Chapel"; -- 52 / 62 --
TITAN_ZONELEVEL_LIG = "Lighthouse"; -- 0 / 0 --
TITAN_ZONELEVEL_LITAPI = "Lik'ash Tar Pits"; -- 0 / 0 --
TITAN_ZONELEVEL_LOMO = "Loch Modan"; -- 10 / 36 --
TITAN_ZONELEVEL_LON = "Longshore"; -- 10 / 19 --
TITAN_ZONELEVEL_LOINCA = "Lordamere Internment Camp"; -- 24 / 36 --
TITAN_ZONELEVEL_LOLA = "Lordamere Lake"; -- 12 / 35 --
TITAN_ZONELEVEL_LOPO = "Lost Point"; -- 37 / 37 --
TITAN_ZONELEVEL_LORICO = "Lost Rigger Cove"; -- 44 / 54 --
TITAN_ZONELEVEL_LOWI = "Lower Wilds"; -- 36 / 65 --
TITAN_ZONELEVEL_LUOA = "Lushwater Oasis"; -- 12 / 30 --

--<< M >>--
TITAN_ZONELEVEL_MAPO = "Maestra's Post"; -- 18 / 42 --
TITAN_ZONELEVEL_MAVI = "Magram Village"; -- 32 / 37 --
TITAN_ZONELEVEL_MAJI = "Malaka'jin"; -- 20 / 30 --
TITAN_ZONELEVEL_MAOR = "Malden's Orchard"; -- 10 / 12 --
TITAN_ZONELEVEL_MACO = "Mannoroc Coven"; -- 30 / 40 --
TITAN_ZONELEVEL_MAMI = "Manor Mistmantle"; -- 29 / 30 --
TITAN_ZONELEVEL_MARO = "Mantle Rock"; -- 0 / 0 --
TITAN_ZONELEVEL_MAR = "Maraudon"; -- 37 / 50 --
TITAN_ZONELEVEL_MAR


Pointer<T> Function<T extends ffi.NativeType>(String symbolName) lookup,
  ) : _lookup = lookup;

  void a_func1() {
    return _a_func1();
  }

  late final _a_func1Ptr = _lookup<ffi.NativeFunction<ffi.Void Function()>>(
    'a_func1',
  );
  late final _a_func1 = _a_func1Ptr.asFunction<void Function()>();

  void a_func2(imp$1.BaseStruct2 s, imp$1.BaseUnion2 u, imp$1.BaseTypedef2 t) {
    return _a_func2(s, u, t);
  }

  late final _a_func2Ptr =
      _lookup<
        ffi.NativeFunction<
          ffi.Void Function(
            imp$1.BaseStruct2,
            imp$1.BaseUnion2,
            imp$1.BaseTypedef2,
          )
        >
      >('a_func2');
  late final _a_func2 = _a_func2Ptr
      .asFunction<
        void Function(imp$1.BaseStruct2, imp$1.BaseUnion2, imp$1.BaseTypedef2)
      >();

  void a_func3(imp$1.DartBaseNativeTypedef1 i) {
    return _a_func3(i);
  }

  late final _a_func3Ptr =
      _lookup<ffi.NativeFunction<ffi.Void Function(imp$1.BaseNativeTypedef1)>>(
        'a_func3',
      );
  late final _a_func3 = _a_func3Ptr
      .asFunction<void Function(imp$1.DartBaseNativeTypedef1)>();

  void a_func4(imp$1.DartBaseNativeTypedef1 i) {
    return _a_func4(i);
  }

  late final _a_func4Ptr =
      _lookup<ffi.NativeFunction<ffi.Void Function(imp$1.BaseNativeTypedef2)>>(
        'a_func4',
      );
  late final _a_func4 = _a_func4Ptr
      .asFunction<void Function(imp$1.DartBaseNativeTypedef1)>();

  void a_func5(imp$1.DartBaseNativeTypedef1 i) {
    return _a_func5(i);
  }

  late final _a_func5Ptr =
      _lookup<ffi.NativeFunction<ffi.Void Function(imp$1.BaseNativeTypedef3)>>(
        'a_func5',
      );
  late final _a_func5 = _a_func5Ptr
      .asFunction<void Function(imp$1.DartBaseNativeTypedef1)>();
}

final class A_Struct1 extends ffi.Struct {
  @ffi.Int()
  external int a;
}

final class A_Union1 extends ffi.Union {
  @ffi.Int()
  external int a;
}

enum A_Enum {
  A_ENUM_1(0),
  A_ENUM_2(1);

  final int value;
  const A_Enum(this.value);

  static A_Enum fromValue(int value) => switch (value) {
    0 => A_ENUM_1,
    1 => A_ENUM_2,
    _ => throw ArgumentError('Unknown value for A_Enum: $value'),
  };
}

const int BASE_MACRO_1 = 1;

const int A_MACRO_1 = 1;
// ignore_for_file: non_constant_identifier_names, camel_case_types

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;

/// Bindings to `headers/a.h`.
class NativeLibraryA {
  /// Holds the symbol lookup function.
  final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
  _lookup;

  /// The symbols are looked up in [dynamicLibrary].


Arg6, Arg7, Arg8> {
    private val subscribers: HashSet<DelegateHandler8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>> = HashSet()
    operator fun invoke(
        arg1: Arg1,
        arg2: Arg2,
        arg3: Arg3,
        arg4: Arg4,
        arg5: Arg5,
        arg6: Arg6,
        arg7: Arg7,
        arg8: Arg8,
    ) {
        for (handler in subscribers)
            handler(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
    }

    fun add(handler: DelegateHandler8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>): Delegate8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8> {
        subscribers.add(handler)
        return this
    }

    fun remove(handler: DelegateHandler8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>): Delegate8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8> {
        subscribers.remove(handler)
        return this
    }

    fun clear(): Delegate8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8> {
        subscribers.clear()
        return this
    }

    operator fun minusAssign(handler: DelegateHandler8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>) {
        subscribers.remove(handler)
    }

    operator fun plusAssign(handler: DelegateHandler8<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>) {
        subscribers.add(handler)
    }
}package net.liplum.holo

import mindustry.type.Item
import mindustry.type.ItemStack
import mindustry.type.LiquidStack
import net.liplum.registry.CioFluid
import plumy.core.arc.Tick
import plumy.dsl.plus

class HoloPlan(
    val unitType: HoloUnitType,
    val req: HoloPlanRequirement,
) {
    val time: Tick get() = req.time
    val cyberion get() = req.cyberion
    val items get() = req.items
    val liquid get() = req.liquid
    val liquidArray get() = req.liquidArray
    operator fun contains(stack: ItemStack) = stack in req
    operator fun contains(item: Item) = item in req
}

class HoloPlanRequirement(
    val cyberion: Float = 0f,
    val items: Array<ItemStack> = emptyArray(),
    val time: Tick,
) {
    val liquid = CioFluid.cyberion + cyberion
    val liquidArray = arrayOf(liquid)
    operator fun contains(stack: ItemStack): Boolean {
        for (req in items)
            if (req == stack) return true
        return false
    }

    operator fun contains(item: Item): Boolean {
        for (req in items)
            if (req.item == item) return true
        return false
    }
}

val HoloPlan?.itemReqs: Array<ItemStack>
    get() = this?.items ?: ItemStack.empty
val HoloPlan?.cyberionReq: LiquidStack?
    get() = this?.liquid
package net.liplum.holo

import mindustry.game.Team
import net.liplum.annotations.SubscribeEvent
import net.liplum.event.BattleExitEvent

val Team2HoloCapacity: HashMap<Team, Int> = HashMap


safe.Pointer(i)))
	return r
}

func _ICoreWebView2PermissionRequestedEventHandlerIUnknownQueryInterface(this *ICoreWebView2PermissionRequestedEventHandler, refiid, object unsafe.Pointer) uintptr {
	return this.impl.QueryInterface(refiid, object)
}

func _ICoreWebView2PermissionRequestedEventHandlerIUnknownAddRef(this *ICoreWebView2PermissionRequestedEventHandler) uintptr {
	return this.impl.AddRef()
}

func _ICoreWebView2PermissionRequestedEventHandlerIUnknownRelease(this *ICoreWebView2PermissionRequestedEventHandler) uintptr {
	return this.impl.Release()
}

func _ICoreWebView2PermissionRequestedEventHandlerInvoke(this *ICoreWebView2PermissionRequestedEventHandler, sender *ICoreWebView2, args *ICoreWebView2PermissionRequestedEventArgs) uintptr {
	return this.impl.PermissionRequested(sender, args)
}

var iCoreWebView2PermissionRequestedEventHandlerFn *iCoreWebView2PermissionRequestedEventHandlerVtbl

func NewICoreWebView2PermissionRequestedEventHandler(impl iCoreWebView2PermissionRequestedEventHandlerImpl) *ICoreWebView2PermissionRequestedEventHandler {
	if iCoreWebView2PermissionRequestedEventHandlerFn == nil {
		iCoreWebView2PermissionRequestedEventHandlerFn = &iCoreWebView2PermissionRequestedEventHandlerVtbl{
			IUnknownVtbl{
				NewComProc(_ICoreWebView2PermissionRequestedEventHandlerIUnknownQueryInterface),
				NewComProc(_ICoreWebView2PermissionRequestedEventHandlerIUnknownAddRef),
				NewComProc(_ICoreWebView2PermissionRequestedEventHandlerIUnknownRelease),
			},
			NewComProc(_ICoreWebView2PermissionRequestedEventHandlerInvoke),
		}
	}
	return &ICoreWebView2PermissionRequestedEventHandler{
		vtbl: iCoreWebView2PermissionRequestedEventHandlerFn,
		impl: impl,
	}
}
package edge

import (
	"github.com/twgh/xcgui/common"
	"github.com/twgh/xcgui/wapi"

	"syscall"
	"unsafe"
)

// ICoreWebView2NavigationStartingEventArgs2 是 ICoreWebView2NavigationStartingEventArgs 的延续, 使开发者能够提供额外允许的框架祖先。
//
// https://learn.microsoft.com/zh-cn/microsoft-edge/webview2/reference/win32/icorewebview2navigationstartingeventargs2
type ICoreWebView2NavigationStartingEventArgs2 struct {
	ICoreWebView2NavigationStartingEventArgs
}

// GetAdditionalAllowedFrameAncestors 获取额外允许的框架祖先。
func (i *ICoreWebView2NavigationStartingEventArgs2) GetAdditionalAllowedFrameAncestors() (string, error) {
	var _ancestors *uint16
	r, _, _ := i.Vtbl.GetAdditionalAllowedFrameAncestors.Call(
		uintptr(unsafe.Pointer(i)),
		uintptr(unsafe.Pointer(&_ancestors)),
	)
	if r != 0 {
		return "", syscall.Errno(r)
	}
	ancestors := common.UTF16PtrToString(_ancestors)
	wapi.CoTaskMemFree(unsafe.Pointer(_ancestors))
	return ancestors, nil
}

// SetAdditionalAllowedFrameAncestors 设置额外允许的框架祖先。
func (i *ICoreWebView2NavigationStartingEventArgs2) SetAdditionalAllowedFrameAncestors(ancestors string) error {
	_ancestors, err := syscall.UTF16PtrFromString(ancestors)
	if err != nil {
		return err
	}
	r, _, _ := i.Vtbl.PutAdditionalAll


_02336064
	cmp sb, #0
	mov r1, #8
	movlt r2, #0x58
	movge r2, #0x50
	mov r3, r4
	add r0, sp, #0
	strh r5, [sp]
	strh sl, [sp, #2]
	strh r2, [sp, #0x16]
	strh r3, [sp, #0x18]
	strh r1, [sp, #0x1a]
	strh r1, [sp, #0x1c]
	bl sub_0201F2A0
	add r0, r4, #8
	mov r0, r0, lsl #0x10
	mov r4, r0, asr #0x10
_02336064:
	cmp sb, #0
	rsblt r0, sb, #0
	movlt r0, r0, lsl #0x10
	movlt sb, r0, asr #0x10
	add r1, r5, r4
	mov r6, #0
	sub r0, r7, #1
	add r8, r1, r0, lsl #3
	mov r5, r6
	mov r4, r6
	mov fp, #8
	b _023360E8
_02336094:
	sub r2, r8, r6, lsl #3
	mov


" }
                    dockerClient.killContainerCmd(it).exec()
                } catch (th: Throwable) {
                    log.error(th) { "could not kill $name with container id $it" }
                }

                log.info { "killed $name with container id $it" }
            }
        }

        network.stop()
    }

    private class LogContainerResultCallback :
        ResultCallbackTemplate<LogContainerResultCallback, Frame>() {
        override fun onNext(item: Frame) {
            String(item.payload).trim().split('\r', '\n').filter { it.isNotBlank() }.forEach {
                log.info(it)
            }
        }
    }

    private class GracefulWaitContainerResultCallback : WaitContainerResultCallback() {
        override fun onError(throwable: Throwable?) {
            // this is ok, just meant that the container already terminated before we tried to wait
            if (throwable is NotFoundException) {
                return
            }
            super.onError(throwable)
        }
    }

    companion object {
        private val log = getLogger<Composer>()
        private val defaultDockerClientConfig =
            DefaultDockerClientConfig.createDefaultConfigBuilder().build()
        private val httpClient = ApacheDockerHttpClient.Builder()
            .dockerHost(defaultDockerClientConfig.dockerHost)
            .sslConfig(defaultDockerClientConfig.sslConfig)
            .maxConnections(100)
            .connectionTimeout(Duration.ofSeconds(60))
            .responseTimeout(Duration.ofSeconds(120))
            .build()
        val dockerClient: DockerClient =
            DockerClientImpl.getInstance(defaultDockerClientConfig, httpClient)
    }
}

object ContainerUtil {
    val isRunningInDocker = File("/proc/1/cgroup")
        .takeIf { it.exists() }?.useLines { lines ->
            lines.any { it.contains("/docker") }
        } ?: false

    fun dockerTargetOrLocalHost(): String {
        if (isRunningInDocker)
            return "host.docker.internal"
        else
            return "localhost"
    }

    fun dockerTargetOrLocalIp(): String {
        if (isRunningInDocker)
            return "host.docker.internal"
        else
            return "127.0.0.1"
    }
}

private class DockerNetwork(private val name: String, private val docker: DockerClient) {

    private lateinit var networkId: String

    fun id(): String {
        return networkId
    }

    fun start() {
        log.info { "creating $name network" }

        docker.listNetworksCmd().withNameFilter(name).exec().forEach {
            log.info { "removing previous $name network with id ${it.id}" }
            docker.removeNetworkCmd(it.id).exec()
        }
        networkId = docker.createNetworkCmd()
            .withName(name)
            .withCheckDuplicate(true)
            .exec()
            .id
    }

    fun stop() {
        log.info { "removing $name network with id $networkId" }
        docker.removeNetworkCmd(networkId).exec()
    }

    companion object {
        private val log = getLogger<DockerNetwork>()
    }
}
/*
 * Copyright (C) 2021 Square, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to i


variable": "$code",
                        "operation": "==",
                        "value": "200",
                        "bz": ""
                    },
                    {
                        "type": "item",
                        "variable": "$body",
                        "operation": "contains",
                        "value": "test",
                        "bz": ""
                    }
                ]
            },
            "SetVariable": []
        }
    ],
    "ExploitSteps": [
        "AND",
        {
            "Request": {
                "method": "GET",
                "uri": "/test.php",
                "follow_redirect": true,
                "header": {},
                "data_type": "text",
                "data": ""
            },
            "ResponseTest": {
                "type": "group",
                "operation": "AND",
                "checks": [
                    {
                        "type": "item",
                        "variable": "$code",
                        "operation": "==",
                        "value": "200",
                        "bz": ""
                    },
                    {
                        "type": "item",
                        "variable": "$body",
                        "operation": "contains",
                        "value": "test",
                        "bz": ""
                    }
                ]
            },
            "SetVariable": []
        }
    ],
    "Tags": [
        "Code Execution"
    ],
    "VulType": [
        "Code Execution"
    ],
    "CVEIDs": [
        ""
    ],
    "CNNVD": [
        ""
    ],
    "CNVD": [
        ""
    ],
    "CVSSScore": "9.8",
    "Translation": {
        "CN": {
            "Name": "用友 NC OAContactsFuzzySearchServlet 接口远程代码执行漏洞",
            "Product": "用友-NC-Cloud",
            "Description": "
用友 NC Cloud 是一种商业级的企业资源规划云平台，为企业提供全面的管理解决方案，包括财务管理、采购管理、销售管理、人力资源管理等功能，实现企业的数字化转型和业务流程优化。

用友 NC Cloud 存在反序列化代码执行漏洞，攻击者可通过该漏洞在服务器端任意执行代码，写入后门，获取服务器权限，进而控制整个web服务器。
",
            "Recommendation": "
厂商已发布了漏洞修复程序，请及时关注更新：https://security.yonyou.com/#/noticeInfo?id=285
",
            "Impact": "
用友 NC Cloud 存在反序列化代码执行漏洞，攻击者可通过该漏洞在服务器端任意执行代码，写入后门，获取服务器权限，进而控制整个 web 服务器。
",
            "VulType": [
                "代码执行"
            ],
            "Tags": [
                "代码执行"
            ]
        },
        "EN": {
            "Name": "Yonyou NC OAContactsFuzzySearchServlet Api Remote Code Execute Vulnerability",
            "Product": "yonyou-NC-Cloud",
            "Description": "
Yonyou NC Cloud is a commercial level enterprise resource planning cloud platform that provides comprehensive management


现有分类名称相同，则进行合并。

覆盖导入：直接用导入数据覆盖现有的数据，原数据被覆盖。

导入来源

支持文本框导入和本地文件导入

v2.7.7 版本支持浏览器 html 书签文件导入

注意：NiceTab 不支持目录无限嵌套，导入的目录最终会转化为 分类>标签组>标签页 结构

导出

可以将插件的标签列表和偏好设置等数据导出到本地文件

插件支持远程同步功能，并且远程同步比导出到本地更方便。虽然目前没有出现过远程数据丢失等异常情况发生，不过还是建议不定期的导出数据到本地进行备份（可能备份文件派不上用场），双保险比较稳妥。

v2.7.7 版本支持将 NiceTab 数据保存为 html 书签文件，导出的书签文件可导入到浏览器

管理后台-远程同步

目前现状

目前远程同步只是个基础的备份功能，由于以下历史因素，存在一些功能缺陷，并非完整版同步功能。

1、NiceTab远程同步功能最初的目的只是为了远程备份、保证数据不丢失，采用的增量合并策略，并不会同步删除操作。

2、插件是以分类/标签组名称来区分相同分类/标签组的（初期为了节省数据存储，没有存储id属性，所以未采用id作为唯一标识），NiceTab是允许存在相同的分类/标签组名称的。

3、远程同步合并本地与远程数据时，会将相同名称的分类/标签组进行合并，但是创建标签组时默认名称都是 Unnamed Tag, 创建标签组时默认名称都是 Unnamed Group, 如果这些分类/标签组未进行重命名，那么在合并时，为了避免将这些未重命名的分类/标签组合并到一起，插件会先强制将这些分类/标签组进行随机重命名，然后进行合并；最终您可能会发现未重命名的标签组被复制了一份，因为插件没办法确定本地的哪个 Unnamed Group 与远程的哪个 Unnamed Group</code


.XPos) string {
	format := func(p src.Pos) string {
		return fmt.Sprintf("%s:%d:%d", d.short(p.Filename()), p.Line(), p.Col())
	}
	if d.inlineSuffixOnly {
		return format(ctxt.InnermostPos(pos))
	}
	var stk []string
	ctxt.AllPos(pos, func(p src.Pos) {
		stk = append(stk, format(p))
	})
	return strings.Join(stk, "; ")
}

// log prints a match with the given hash and textual formatting.
// TODO: Delete varname parameter when we switch to bisect-only.
func (d *HashDebug) log(varname string, hash uint64, text string) {
	d.mu.Lock()
	defer d.mu.Unlock()

	file := d.logfile
	if file == nil {
		if tmpfile := os.Getenv("GSHS_LOGFILE"); tmpfile != "" {
			var err error
			file, err = os.OpenFile(tmpfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
			if err != nil {
				Fatalf("could not open hash-testing logfile %s", tmpfile)
				return
			}
		}
		if file == nil {
			file = os.Stdout
		}
		d.logfile = file
	}

	// Bisect output.
	fmt.Fprintf(file, "%s %s\n", text, bisect.Marker(hash))

	// Gossahash output.
	// TODO: Delete rest of function when we switch to bisect-only.
	fmt.Fprintf(file, "%s triggered %s %s\n", varname, text, hashString(hash))
}
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Debug arguments, set by -d flag.

package base

// Debug holds the parsed debugging configuration values.
var Debug DebugFlags

// DebugFlags defines the debugging configuration values (see var Debug).
// Each struct field is a different value, named for the lower-case of the field name.
// Each field must be an int or string and must have a `help` struct tag.
//
// The -d option takes a comma-separated list of settings.
// Each setting is name=value; for ints, name is short for name=1.
type DebugFlags struct {
	AlignHot              int    `help:"enable hot block alignment (currently requires -pgo)" concurrent:"ok"`
	Append                int    `help:"print information about append compilation"`
	Checkptr              int    `help:"instrument unsafe pointer conversions\n0: instrumentation disabled\n1: conversions involving unsafe.Pointer are instrumented\n2: conversions to unsafe.Pointer force heap allocation" concurrent:"ok"`
	Closure               int    `help:"print information about closure compilation"`
	Defer                 int    `help:"print information about defer compilation"`
	DisableNil            int    `help:"disable nil checks" concurrent:"ok"`
	DumpInlFuncProps      string `help:"dump function properties from inl heuristics to specified file"`
	DumpInlCallSiteScores int    `help:"dump scored callsites during inlining"`
	InlScoreAdj           string `help:"set inliner score adjustments (ex: -d=inlscoreadj=panicPathAdj:10/passConstToNestedIfAdj:-90)"`
	InlBudgetSlack        int    `help:"amount to expand the initial inline budget when new inliner enabled. Defaults to 80 if option not set." concurrent:"ok"`
	DumpPtrs              int    `help:"show Node pointers values in dump output"`
	DwarfInl              int    `help:"print information about DWARF inlined function creation"`
	EscapeMutationsCalls  int    `help:"print extra escape analysis diagnostics about mutations and calls" concurrent:"ok"`
	Export                int    `help:"print export data"`
	FIPSHash              string `help:"hash value for FIPS debugging" concurrent:"ok"`
	Fmahash               string `help:"hash value for use in debugging platform-dependent multiply-add use" concurrent:"ok"`
	GCAdjust              int    `help:"log adjustments to GOGC" concurrent:"ok"`
	GCCheck               int    `help:"check heap/gc use by compiler" concurrent:"ok"`
	GCProg                int    `help:"print dump of GC programs"`
	Gossahash             s


public static void testB64toF128(byte[] input, float[] output) {
        vectorCast(B2F, BSPEC64, FSPEC128, input, output);
    }

    @Run(test = "testB64toF128")
    public static void runB64toF128() throws Throwable {
        runCastHelper(B2F, BSPEC64, FSPEC128);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_8, "1"})
    public static void testB64toF256(byte[] input, float[] output) {
        vectorCast(B2F, BSPEC64, FSPEC256, input, output);
    }

    @Run(test = "testB64toF256")
    public static void runB64toF256() throws Throwable {
        runCastHelper(B2F, BSPEC64, FSPEC256);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_16, "1"})
    public static void testB128toF512(byte[] input, float[] output) {
        vectorCast(B2F, BSPEC128, FSPEC512, input, output);
    }

    @Run(test = "testB128toF512")
    public static void runB128toF512() throws Throwable {
        runCastHelper(B2F, BSPEC128, FSPEC512);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"})
    public static void testB64toD64(byte[] input, double[] output) {
        vectorCast(B2D, BSPEC64, DSPEC64, input, output);
    }

    @Run(test = "testB64toD64")
    public static void runB64toD64() throws Throwable {
        runCastHelper(B2D, BSPEC64, DSPEC64);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"})
    public static void testB64toD128(byte[] input, double[] output) {
        vectorCast(B2D, BSPEC64, DSPEC128, input, output);
    }

    @Run(test = "testB64toD128")
    public static void runB64toD128() throws Throwable {
        runCastHelper(B2D, BSPEC64, DSPEC128);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_4, "1"})
    public static void testB64toD256(byte[] input, double[] output) {
        vectorCast(B2D, BSPEC64, DSPEC256, input, output);
    }

    @Run(test = "testB64toD256")
    public static void runB64toD256() throws Throwable {
        runCastHelper(B2D, BSPEC64, DSPEC256);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_8, "1"})
    public static void testB64toD512(byte[] input, double[] output) {
        vectorCast(B2D, BSPEC64, DSPEC512, input, output);
    }

    @Run(test = "testB64toD512")
    public static void runB64toD512() throws Throwable {
        runCastHelper(B2D, BSPEC64, DSPEC512);
    }

    @Test
    @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_4, "1"})
    public static void testS64toB64(short[] input, byte[] output) {
        vectorCast(S2B, SSPEC


-label'],.has-warning.is-focused [class^=bmd-label]{color:#ff5722}.has-warning .is-focused .bmd-label-placeholder,.has-warning.is-focused .bmd-label-placeholder{color:#ff5722}.has-warning .is-focused .custom-file-control,.has-warning .is-focused .form-control,.has-warning.is-focused .custom-file-control,.has-warning.is-focused .form-control{border-color:#ff5722}.has-warning .is-focused .bmd-help,.has-warning.is-focused .bmd-help{color:rgba(0,0,0,.54)}.has-danger [class*=' bmd-label'],.has-danger [class^=bmd-label]{color:#f44336}.has-danger .custom-file-control,.has-danger .form-control,.is-focused .has-danger .custom-file-control,.is-focused .has-danger .form-control{background-image:linear-gradient(to top,#f44336 2px,rgba(244,67,54,0) 2px),linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px)}.has-danger .custom-file-control:invalid,.has-danger .form-control:invalid{background-image:linear-gradient(to top,#d50000 2px,rgba(213,0,0,0) 2px),linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px)}.has-danger .custom-file-control:-moz-read-only,.has-danger .form-control:-moz-read-only{background-image:linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px),linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px)}.has-danger .custom-file-control:read-only,.has-danger .form-control:read-only{background-image:linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px),linear-gradient(to top,rgba(0,0,0,.26) 1px,rgba(0,0,0,0) 1px)}.has-danger .custom-file-control:disabled,.has-danger .custom-file-control[disabled],.has-danger .disabled.custom-file-control,.has-danger .form-control.disabled,.has-danger .form-control:disabled,.has-danger .form-control[disabled],fieldset[disabled][disabled] .has-danger .custom-file-control,fieldset[disabled][disabled] .has-danger .form-control{background-image:linear-gradient(to right,rgba(0,0,0,.26) 0,rgba(0,0,0,.26) 30%,transparent 30%,transparent 100%);background-repeat:repeat-x;background-size:3px 1px}.has-danger .form-control-success.custom-file-control,.has-danger .form-control.form-control-success,.is-focused .has-danger .form-control-success.custom-file-control,.


 class Page {
    constructor({ width }: PageParams = {}) {
        this.width = width;
    }

    /** 单页宽度 */
    width: number = 210;

    /** 单页高度 */
    height: number = 297;

    /** 长度单位 */
    unit: 'mm' | 'px' = 'mm';
}import {
  LoginManager as FacebookLoginManager,
  AccessToken as FacebookAccessToken,
} from 'react-native-fbsdk'
import auth from '@react-native-firebase/auth'

const login = async () => {
  const result = await FacebookLoginManager.logInWithPermissions([
    'public_profile',
    'email',
  ])

  if (result.isCancelled) {
    throw 'User cancelled the login process'
  }

  // Once signed in, get the users AccessToken
  const data = await FacebookAccessToken.getCurrentAccessToken()

  if (!data) {
    throw 'Something went wrong obtaining access token'
  }

  // Create a Firebase credential with the AccessToken
  const facebookCredential = auth.FacebookAuthProvider.credential(
    data.accessToken,
  )

  // Sign-in the user with the credential
  return auth().signInWithCredential(facebookCredential)
}

export const FacebookAuthentication = {
  setup: () => () => {},
  login,
  logout: () => {},
}
/**
 * @file 条件类型
 * @author Angus Yang
 * @date 2020/11/4
 * @description 由 条件表达式 来决定的类型
 */

// T extends U ? x : y

type TypeName<T> =
    T extends string ? string :
    T extends number ? number :
    T extends boolean ? boolean :
    T extends undefined ? undefined :
    T extends Function ? Function :
        object

type T1 = TypeName<string> // T1: string
type T2 = TypeName<string[]> // T2: object

/**
 * ❗联合类型 extends 一个类型, 那么会拆解解析该联合类型.
 */
// (A | B) extends U ? x : y
//=> (A extends U ? x : y) | (B extends U ? x : y)
type T3 = TypeName<string | string[]>
//=> T3: string | object

/* 过滤掉, 官方已实现, 名为 Exclude<T, U> */
type Diff<T, U> = T extends U ? never : T
type T4 = Diff<"a" | "b" | "c", "a" | "e">
//=> T4: "b" | "c"
/* 解析 */
// Diff<"a", "a" | "e"> | Diff<"b", "a" | "e"> | Diff<"c", "a" | "e">
// never | "b" | "c"
// "b" | "c"

/* 官方已实现, 名为 NonNullable<T> */
type NotNull<T> = Diff<T, undefined | null>
type T5 = NotNull<string | number | undefined | null> // T5: string | number

/* 其他官方类型 举例 */
// Extract<T, U> 从 T 中抽取出可以赋值给 U 的类型, 与 Exclude 相反
type T6 = Extract<"a" | "b" | "c", "a" | "e"> // T6: "a"

// ReturnType<T> 获取函数返回值的类型
type T7 = ReturnType<() => string> // T7: string
import 'reflect-metadata';
import { ExpressServer } from './server/express-server';
import { ConnectionOptions, createConnection } from 'typeorm';
// Controllers
import { CONTROLLERS } from './controllers';
import { environment } from './environment';

// sửa lại từ ormconfig.json => khi build thì đổi

// const connectionOptions: ConnectionOptions = {
//   type: 'mongodb',
//   host: 'localhost',
//   port: 27017,
//   username: '',
//   password: '',
//   database: 'todos',
//   useNewUrlParser: true,
//   useUnifiedTopology: true,
//   synch


' if precio > 50 else 'Barato'}"
print(txt)
```

## 5. Ejecutar funciones

Podemos llamar funciones dentro de las llaves:

```python
fruta = "manzanas"
txt = f"Me gustan {fruta.upper()}"
print(txt)
```

O nuestras propias funciones:

```python
def convertir_a_metros(pies):
    return pies * 0.3048

txt = f"El avión vuela a {convertir_a_metros(30000)} metros de altura"
print(txt)
```

## 6. Más modificadores

Algunos ejemplos útiles:

```python
precio = 59000
txt = f"El precio es {precio:,} dólares"  # separador de miles
print(txt)
```

Otros formatos incluyen alineación, porcentaje, hexadecimal, etc. (`:<`, `:>`, `:%`, `:x`, etc.)

## 7. Método format() (forma antigua)

Antes de Python 3.6 se usaba `format()`:

```python
precio = 49
txt = "El precio es {} dólares"
print(txt.format(precio))
```

### Se pueden usar múltiples valores:

```python
cantidad = 3
articulo = 567
precio = 49
pedido = "Quiero {} unidades del artículo {} por {:.2f} dólares."
print(pedido.format(cantidad, articulo, precio))
```

### O índices para repetir valores:

```python
edad = 36
nombre = "Juan"
txt = "Su nombre es {1}. {1} tiene {0} años."
print(txt.format(edad, nombre))
```

### O nombres para mayor claridad:

```python
pedido = "Tengo un {auto}, es un {modelo}."
print(pedido.format(auto="Ford", modelo="Mustang"))
```[← Volver al índice](README.md)

# Manejo de Errores en Python

## 1. Try y Except

- `try`: sirve para "probar" un bloque de código que podría generar un error
- `except`: sirve para manejar el error si ocurre

### Ejemplo básico:

```python
try:
    print(x)  # x no está definido
except:
    print("Ocurrió un error")
```

Como `x` no está definido, el bloque `try` genera un error, y Python ejecuta el bloque `except`.

Si no usamos `try`, el programa se detendría y mostraría un error:

```python
print(x)  # Esto causará un error
```

En Python, los errores se llaman **excepciones**. Cuando ocurre una excepción, normalmente el programa se detiene y muestra un mensaje de error. Para evitar que nuestro programa se caiga, podemos manejar estas excepciones usando `try` y `except`.

1. Try y Except

try: sirve para “probar” un bloque de código que podría generar un error.

except: sirve para manejar el error si ocurre.

Ejemplo básico:

try:
    print(x)  # x no está definido
except:
    print("Ocurrió un error")

Como x no está definido, el bloque try genera un error, y Python ejecuta el bloque except.

Si no usamos try, el programa se detendría y mostraría un error:

print(x)  # Esto causará un error

## 2. Diferentes tipos de excepciones

Podemos definir varios bloques `except` para distintos tipos de erro


ra nei neperšaunamas, nei absoliutus. Nesuklyskite, „Monero“ yra beveik toks pat privatus, koks yra nepatikimoje srityje, tačiau yra keletas aspektų, į kuriuos vartotojai turi atsižvelgti, kad užtikrintų, jog jų privatumas išliktų tvirtas.
\n\n
 Tas pats galioja ir kitose gyvenimo srityse. Pavyzdžiui, galite nesinaudoti bet kokia socialine žiniasklaida, kad jūsų gyvenimas būtų privatus, bet jei nuolat esate su draugais, kurie fotografuoja asmenukes su jumis, pasakykite, kad jie yra su jumis, ir pažymėkite savo vieta, jūsų pastangos gali būti bergždžios. Socialinės žiniasklaidos konglomeratas vis tiek gali sukurti jūsų profilį, nepaisant to, kad jūs asmeniškai nesate jų platformoje.
\n\n
Viena iš dažnai minimų situacijų, kai žmonės neatsižvelgia į visas pasekmes ir galimai nutekėjusius metaduomenis, yra Bitcoin prekybos Monero problema. Bendruomenėje paprastai manoma, kad Monero įsigijimas naudojant Bitcoin bus visiškai išvalytas ir kad vartotojas išsaugos visas privatumo privilegijas, kai patenka į Monero, nepaisant to, kad tai yra skaidri grandinė.
\n\n
Panašiai, kai kurie mano, kad gauti Monero iš ne KYC ir KYC šaltinių yra taip pat privatu. Manoma, kad tai panašu į grynųjų pinigų gavimą banke. Tokiu atveju bankas pats žino jūsų veidą ir vardą, ir žino, kiek iš viso turite sąskaitoje ir kiek išėmėte grynųjų, bet nežino, ką po to darysite su grynaisiais. Turint Monero privatumo garantijas, taip turėtų būti ir gaunant Monero iš KYC/AML šaltinio, tiesa?
\n\n
 Na, ne visai.
\n\n
Pirmiausia žengkime žingsnį atgal ir apibrėžkime, ką reiškia KYC/AML. Šis akronimas reiškia „Pažink savo klientą“ (KYC) / Kovos su pinigų plovimu (AML) įstatymus, pagal kuriuos biržos ir įmonės turi rinkti identifikuojančią informaciją apie savo klientus. Kuo didesnė pinigų suma keičiama, tuo daugiau informacijos reikia. Kaip rodo pavadinimas, visa tai daroma siekiant sumažinti žmonių plovimo riziką.
\n\n
Atgal į Monero. Be abejo, pinigų perkėlimas į „Monero“ iš KYC šaltinio yra astronomiškai geresnis privatumui, nei naudojant KYC šaltinį, kad įsigytum kažką panašaus į BTC ar bet kokią kitą skaidrią monetą, tačiau vis tiek reikia apsvarstyti, kas bus atskleista ir kas ta


#nullable disable
using System.Collections.Generic;
using System.Linq;
using QuestViva.Engine.Scripts;

namespace QuestViva.Engine
{
    internal class TimerRunner
    {
        private WorldModel m_worldModel;
        private Element m_gameElement;

        public TimerRunner(WorldModel worldModel, bool initialise)
        {
            m_worldModel = worldModel;
            if (initialise)
            {
                // When a game begins, set initial triggers. We don't need to do this when loading
                // a saved game.
                foreach (Element timer in EnabledTimers)
                {
                    timer.Fields[FieldDefinitions.Trigger] = timer.Fields[FieldDefinitions.Interval];
                }
            }
        }

        private IEnumerable<Element> EnabledTimers
        {
            get
            {
                return m_worldModel.Elements.GetElements(ElementType.Timer).Where(t => t.Fields[FieldDefinitions.Enabled]);
            }
        }

        private IEnumerable<Element> DisabledTimers
        {
            get
            {
                return m_worldModel.Elements.GetElements(ElementType.Timer).Where(t => !t.Fields[FieldDefinitions.Enabled]);
            }
        }

        private Element GameElement
        {
            get
            {
                if (m_gameElement == null)
                {
                    m_gameElement = m_worldModel.Elements.Get("game");
                }
                return m_gameElement;
            }
        }

        private int TimeElapsed
        {
            get { return GameElement.Fields[FieldDefinitions.TimeElapsed]; }
            set { GameElement.Fields[FieldDefinitions.TimeElapsed] = value; }
        }

        public void IncrementTime(int elapsedTime)
        {
            TimeElapsed += elapsedTime;

            foreach (var timer in DisabledTimers)
            {
                // Disabled timers get their


od` can also be returned as the result of instant arithmetic operations (see [Instant.periodUntil]).
 *
 * Additionally, there are several `kotlinx-serialization` serializers for [DateTimePeriod]:
 * - The default serializer, delegating to [toString] and [parse].
 * - [DateTimePeriodIso8601Serializer] for the ISO 8601 format.
 * - [DateTimePeriodComponentSerializer]  for an object with components.
 *
 * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.construction
 * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.simpleParsingAndFormatting
 */
@Serializable(with = DateTimePeriodSerializer::class)
// TODO: could be error-prone without explicitly named params
public sealed class DateTimePeriod {
    internal abstract val totalMonths: Long

    /**
     * The number of calendar days. Can be negative.
     *
     * Note that a calendar day is not identical to 24 hours, see [DateTimeUnit.DayBased] for details.
     * Also, this field does not get normalized together with months, so values larger than 31 can be present.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public abstract val days: Int
    internal abstract val totalNanoseconds: Long

    /**
     * The number of whole years. Can be negative.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public val years: Int get() = (totalMonths / 12).toInt()

    /**
     * The number of months in this period that don't form a whole year, so this value is always in `(-11..11)`.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public val months: Int get() = (totalMonths % 12).toInt()

    /**
     * The number of whole hours in this period. Can be negative.
     *
     * This field does not get normalized together with days, so values larger than 23 or smaller than -23 can be present.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public open val hours: Int get() = (totalNanoseconds / 3_600_000_000_000).toInt()

    /**
     * The number of whole minutes in this period that don't form a whole hour, so this value is always in `(-59..59)`.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public open val minutes: Int get() = ((totalNanoseconds % 3_600_000_000_000) / 60_000_000_000).toInt()

    /**
     * The number of whole seconds in this period that don't form a whole minute, so this value is always in `(-59..59)`.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public open val seconds: Int get() = ((totalNanoseconds % 60_000_000_000) / NANOS_PER_ONE).toInt()

    /**
     * The number of whole nanoseconds in this period that don't form a whole second, so this value is always in
     * `(-999_999_999..999_999_999)`.
     *
     * @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
     */
    public open val nanoseconds: Int get() = (totalNanoseconds % NANOS_PER_ONE).toInt()

    private fun allNonpositive() =
        totalMonths <= 0 && days <= 0 && totalNanoseconds <= 0 && (totalMonths or totalNanoseconds != 0L || days != 0)

    /**
     * Converts this period to the ISO 8601 string representation for durations, for example, `P2M1DT3H`.
     *
     * Note that the ISO 8601 duration is not the same as [Duration],
     * but instead includes the date components, like [DateTimePeriod] does.
     *
     * Examples of the output:
     * - `P2Y4M-1D`: two years, four months, minus one day;
     * -


較低，則不應設置過高的 max_accel 或增加 square_corner_velocity 參數。最好選擇 MZV 甚至 ZV input shaper 而不是 EI（或 2HUMP_EI 和 3HUMP_EI 整形器）。

### 成功打印一段時間後沒有環紋，它似乎又回來了

有可能在一段時間後共振頻率發生了變化。例如。可能是皮帶張力發生了變化（皮帶變得更鬆了）等。最好按照 [Ringing frequency](#ringing-frequency) 部分中的說明檢查並重新測量環紋頻率，並在必要時更新配置文件.

### input shaper是否支持雙步進匣設置？

Yes. In this case, one should measure the resonances twice for each carriage. For example, if the second (dual) carriage is installed on X axis, it is possible to set different input shapers for X axis for the primary and dual carriages. However, the input shaper for Y axis should be the same for both carriages (as ultimately this axis is driven by one or more stepper motors each commanded to perform exactly the same steps). One possibility to configure the input shaper for such setups is to keep `[input_shaper]` section empty and additionally define a `[delayed_gcode]` section in the `printer.cfg` as follows:

```
[input_shaper]
# Intentionally empty

[delayed_gcode init_shaper]
initial_duration: 0.1
gcode:
  SET_DUAL_CARRIAGE CARRIAGE=1
  SET_INPUT_SHAPER SHAPER_TYPE_X=<dual_carriage_shaper> SHAPER_FREQ_X=<dual_carriage_freq> SHAPER_TYPE_Y=<y_shaper> SHAPER_FREQ_Y=<y_freq>
  SET_DUAL_CARRIAGE CARRIAGE=0
  SET_INPUT_SHAPER SHAPER_TYPE_X=<primary_carriage_shaper> SHAPER_FREQ_X=<primary_carriage_freq> SHAPER_TYPE_Y=<y_shaper> SHAPER_FREQ_Y=<y_freq>
```

Note that `SHAPER_TYPE_Y` and `SHAPER_FREQ_Y` should be the same in both commands. It is also possible to put a similar snippet into the start g-code in the slicer, however then the shaper will not be enabled until any print is started.

Note that the input shaper only needs to be configured once. Subsequent changes of the


#-----------------------------------------------------------------------------
# This file is part of the 'SLAC Firmware Standard Library'. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
#    https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# No part of the 'SLAC Firmware Standard Library', including this file, may be
# copied, modified, propagated, or distributed except according to the terms
# contained in the LICENSE.txt file.
#-----------------------------------------------------------------------------

import sys

cnt = -1
ofd = open('temp.txt', 'w')
ofd.write('   constant AXI_STREAM_CONFIG_C : AxiStreamConfigVectorArray(0 to SIZE_C-1, 0 to 1) := (\n')

#-----------------------------------------------------------------------------
#   function ssiAxiStreamConfig (
#      dataBytes : positive;
#      tKeepMode : TKeepModeType         := TKEEP_COMP_C;
#      tUserMode : TUserModeType         := TUSER_FIRST_LAST_C;
#      tDestBits : natural range 0 to 8  := 4;
#      tUserBits : positive range 2 to 8 := 2)
#-----------------------------------------------------------------------------
dataBytesConfig = [1,64]
tUserConfig = [2,8]
tKeepModeType = ['TKEEP_COMP_C']
tUserModeType = ['TUSER_FIRST_LAST_C']
for dataBytesIn in range(len(dataBytesConfig)):
    for dataBytesOut in range(len(dataBytesConfig)):
        for tKeepModeIn in range(len(tKeepModeType)):
            for tKeepModeOut in range(len(tKeepModeType)):
                for tUserModeIn in range(len(tUserModeType)):
                    for tUserModeOut in range(len(tUserModeType)):
                        for tUserIn in range(len(tUserConfig)):
                            for tUserOut in range(len(tUserConfig)):
                                cnt = cnt + 1
                                ofd.write(f"""
      {cnt}    => (
         0 => ssiAxiStreamConfig({dataBytesConfig[dataBytesIn]}, {tKeepModeType[tKeepModeIn]}, {tUserModeType[tUserModeIn]}, 4, {tUserConfig[tUserIn]}),
         1 => ssiAxiStreamConfig({dataBytesConfig[dataBytesOut]}, {tKeepModeType[tKeepModeOut]}, {tUserModeType[tUserModeOut]}, 4, {tUserConfig[tUserOut]})),""")
#-----------------------------------------------------------------------------
dataBytesConfig = [8]
tUserConfig = [4]
tKeepModeType = ['TKEEP_NORMAL_C','TKEEP_COMP_C','TKEEP_COUNT_C']
tUserModeType = ['TUSER_NORMAL_C','TUSER_FIRST_LAST_C','TUSER_LAST_C','TUSER_NONE_C']
for dataBytesIn in range(len(dataBytesConfig)):
    for dataBytesOut in range(len(dataBytesConfig)):
        for tKeepModeIn in range(len(tKeepModeType)):
            for tKeepModeOut in range(len(tKeepModeType)):
                for tUserModeIn in range(len(tUserModeType)):
                    for tUserModeOut in range(len(tUserModeType)):
                        for tUserIn in range(len(tUserConfig)):
                            for tUserOut in range(len(tUserConfig)):
                                cnt = cnt + 1
                                ofd.write(f"""
      {cnt}    => (
         0 => ssiAxiStreamConfig({dataBytesConfig[dataBytesIn]}, {tKeepModeType[tKeepModeIn]}, {tUserModeType[tUserModeIn]}, 4, {tUserConfig[tUserIn]}),
         1 => ssiAxiStreamConfig({dataBytesConfig[dataBytesOut]}, {tKeepModeType[tKeepModeOut]}, {tUserModeType[tUserModeOut]}, 4, {tUserConfig[tUserOut]})),""")
#-----------------------------------------------------------------------------


, CoverImage = "Assets/5.png" });
            books.Add(new Book { BookId = 6, Title = "Nonummy Erat", Author = "Legunt Xaepius", CoverImage = "Assets/6.png" });
            books.Add(new Book { BookId = 7, Title = "Nostrud", Author = "Eleifend", CoverImage = "Assets/7.png" });
            books.Add(new Book { BookId = 8, Title = "Per Modo", Author = "Vero Tation", CoverImage = "Assets/8.png" });
            books.Add(new Book { BookId = 9, Title = "Suscipit Ad", Author = "Jack Tibbles", CoverImage = "Assets/9.png" });
            books.Add(new Book { BookId = 10, Title = "Decima", Author = "Tuffy Tibbles", CoverImage = "Assets/10.png" });
            books.Add(new Book { BookId = 11, Title = "Erat", Author = "Volupat", CoverImage = "Assets/11.png" });
            books.Add(new Book { BookId = 12, Title = "Consequat", Author = "Est Possim", CoverImage = "Assets/12.png" });
            books.Add(new Book { BookId = 13, Title = "Aliquip", Author = "Magna", CoverImage = "Assets/13.png" });

            return books;
        }
    }
}


valDataset(bmk['json_path'], val_cfg["IMAGE_SHAPE"], bmk["scale_enlarge"])
        sampler = SequentialSampler(dataset)
        dataloader = DataLoader(dataset, sampler=sampler, batch_size=val_cfg["BATCH_SIZE"], num_workers=2, timeout=120)

        evaluator = Evaluator(dataloader, img_size=val_cfg["IMAGE_SHAPE"], val_root_index=val_cfg.get("ROOT_INDEX", 9))
        evaluator_dict[bmk['name']] = evaluator

    return evaluator_dict

def infer(epoch):
    log_model_dir = get_log_model_dir(_CONFIG['NAME'])
    model_path = os.path.join(log_model_dir, epoch)
    print(model_path)
    model = HandNet(_CONFIG, pretrained=False)

    checkpoint = torch.load(open(model_path, "rb"))
    model.load_state_dict(checkpoint["state_dict"], strict=True)
    model.eval()

    evaluator_dict = build_evaluator(_CONFIG["VAL"])

    for bmk_name in evaluator_dict:
        evaluator = evaluator_dict[bmk_name]
        result_dict = evaluator.evaluate(model, True)
        print(bmk_name)
        print(result_dict)

if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()

    parser.add_argument("--infer_all", action="store_true")
    parser.add_argument("--epoch", type=str, default="latest")

    args = parser.parse_args()
    infer(args.epoch)


h g;
  IntArcMap lo(g), up(g);
  IntNodeMap delta(g, 0);
  Node s, t;

  std::istringstream input(test_lgf);
  DigraphReader<Digraph>(g,input).
    arcMap("lcap", lo).
    arcMap("ucap", up).
    node("source",s).
    node("sink",t).
    run();

  delta[s] = 7; delta[t] = -7;
  checkCirculation(g, lo, up, delta, true);

  delta[s] = 13; delta[t] = -13;
  checkCirculation(g, lo, up, delta, true);

  delta[s] = 6; delta[t] = -6;
  checkCirculation(g, lo, up, delta, false);

  delta[s] = 14; delta[t] = -14;
  checkCirculation(g, lo, up, delta, false);

  delta[s] = 7; delta[t] = -13;
  checkCirculation(g, lo, up, delta, true);

  delta[s] = 5; delta[t] = -15;
  checkCirculation(g, lo, up, delta, true);

  delta[s] = 10; delta[t] = -11;
  checkCirculation(g, lo, up, delta, true);

  delta[s] = 11; delta[t] = -10;
  checkCirculation(g, lo, up, delta, false);

  return 0;
}
/* -*- mode: C++; indent-tabs-mode: nil; -*-
 *
 * This file is a part of LEMON, a generic C++ optimization library.
 *
 * Copyright (C) 2003-2009
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
 *
 * Permission to use, modify and distribute this software is granted
 * provided that this copyright notice appears in all copies. For
 * precise terms see the accompanying LICENSE file.
 *
 * This software is provided "AS IS" with no warranty of any kind,
 * express or implied, and with no claim as to its suitability for any
 * purpose.
 *
 */

#include <iostream>

#include <lemon/planarity.h>

#include <lemon/smart_graph.h>
#include <lemon/lgf_reader.h>
#include <lemon/connectivity.h>
#include <lemon/dim2.h>

#include "test_tools.h"

using namespace lemon;
using namespace lemon::dim2;

const int lgfn = 4;
const std::string lgf[lgfn] = {
  "@nodes\n"
  "label\n"
  "0\n"
  "1\n"
  "2\n"
  "3\n"
  "4\n"
  "@edges\n"
  "     label\n"
  "0 1  0\n"
  "0 2  0\n"
  "0 3  0\n"
  "0 4  0\n"
  "1 2  0\n"
  "1 3  0\n"
  "1 4  0\n"
  "2 3  0\n"
  "2 4  0\n"
  "3 4  0\n",

  "@nodes\n"
  "label\n"
  "0\n"
  "1\n"
  "2\n"
  "3\n"
  "4\n"
  "@edges\n"
  "     label\n"
  "0 1  0\n"
  "0 2  0\n"
  "0 3  0\n"
  "0 4  0\n"
  "1 2  0\n"
  "1 3  0\n"
  "2 3  0\n"
  "2 4  0\n"
  "3 4  0\n",

  "@nodes\n"
  "label\n"
  "0\n"
  "1\n"
  "2\n"
  "3\n"
  "4\n"
  "5\n"
  "@edges\n"
  "     label\n"
  "0 3  0\n"
  "0 4  0\n"
  "0 5  0\n"
  "1 3  0\n"
  "1 4  0\n"
  "1 5


TransparentTypedObject) \
    _(IntrinsicObjectIsOpaqueTypedObject) \
    _(IntrinsicObjectIsTypeDescr)   \
    _(IntrinsicTypeDescrIsSimpleType) \
    _(IntrinsicTypeDescrIsArrayType)\
    _(IntrinsicSetTypedObjectOffset)

struct JSJitInfo;

namespace js {
namespace jit {

enum class InlinableNative : uint16_t {
#define ADD_NATIVE(native) native,
    INLINABLE_NATIVE_LIST(ADD_NATIVE)
#undef ADD_NATIVE
};

#define ADD_NATIVE(native) extern const JSJitInfo JitInfo_##native;
    INLINABLE_NATIVE_LIST(ADD_NATIVE)
#undef ADD_NATIVE

} // namespace jit
} // namespace js

#endif /* jit_InlinableNatives_h */


/*
 * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#include <openssl/core_names.h>
#include "crypto/rsa.h"

/*
 * The following tables are constants used during RSA parameter building
 * operations. It is easier to point to one of these fixed strings than have
 * to dynamically add and generate the names on the fly.
 */

/*
 * A fixed table of names for the RSA prime factors starting with
 * P,Q and up to 8 additional primes.
 */
const char *ossl_rsa_mp_factor_names[] = {
    OSSL_PKEY_PARAM_RSA_FACTOR1,
    OSSL_PKEY_PARAM_RSA_FACTOR2,
#ifndef FIPS_MODULE
    OSSL_PKEY_PARAM_RSA_FACTOR3,
    OSSL_PKEY_PARAM_RSA_FACTOR4,
    OSSL_PKEY_PARAM_RSA_FACTOR5,
    OSSL_PKEY_PARAM_RSA_FACTOR6,
    OSSL_PKEY_PARAM_RSA_FACTOR7,
    OSSL_PKEY_PARAM_RSA_FACTOR8,
    OSSL_PKEY_PARAM_RSA_FACTOR9,
    OSSL_PKEY_PARAM_RSA_FACTOR10,
#endif
    NULL
};

/*
 * A fixed table of names for the RSA exponents starting with
 * DP,DQ and up to 8 additional exponents.
 */
const char *ossl_rsa_mp_exp_names[] = {
    OSSL_PKEY_PARAM_RSA_EXPONENT1,
    OSSL_PKEY_PARAM_RSA_EXPONENT2,
#ifndef FIPS_MODULE
    OSSL_PKEY_PARAM_RSA_EXPONENT3,
    OSSL_PKEY_PARAM_RSA_EXPONENT4,
    OSSL_PKEY_PARAM_RSA_EXPONENT5,
    OSSL_PKEY_PARAM_RSA_EXPONENT6,
    OSSL_PKEY_PARAM_RSA_EXPONENT7,
    OSSL_PKEY_PARAM_RSA_EXPONENT8,
    OSSL_PKEY_PARAM_RSA_EXPONENT9,
    OSSL_PKEY_PARAM_RSA_EXPONENT10,
#endif
    NULL
};

/*
 * A fixed table of names for the RSA coefficients starting with
 * QINV and up to 8 additional exponents.
 */
const char *ossl_rsa_mp_coeff_names[] = {
    OSSL_PKEY_PARAM_RSA_COEFFICIENT1,
#ifndef FIPS_MODULE
    OSSL_PKEY_PARAM_RSA_COEFFICIENT2,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT3,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT4,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT5,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT6,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT7,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT8,
    OSSL_PKEY_PARAM_RSA_COEFFICIENT9,
#endif
    NULL
};


CommUtil.saveIPageList2ModelAndView(url + "/admin/group_list.htm", "",
       params, pList, mv);
     return mv;
   }

   @SecurityMapping(display = false, rsequence = 0, title="团购增加", value="/admin/group_add.htm*", rtype="admin", rname="团购管理", rcode="group_admin", rgroup="运营")
   @RequestMapping({"/admin/group_add.htm"})
   public ModelAndView group_add(HttpServletRequest request, HttpServletResponse response, String currentPage)
   {
     ModelAndView mv = new JModelAndView("admin/blue/group_add.html",
       this.configService.getSysConfig(),
       this.userConfigService.getUserConfig(), 0, request, response);
     mv.addObject("currentPage", currentPage);
     Map params = new HashMap();
     params.put("status", Integer.valueOf(0));
     List groups = this.groupService
       .query("select obj from Group obj where obj.status=:status order by obj.endTime desc",
       params, 0, 1);
     if (groups.size() > 0) {
       Group group = (Group)groups.get(0);
       mv.addObject("group", group);
     }
     return mv;
   }

   @SecurityMapping(display = false, rsequence = 0, title="团购编辑", value="/admin/group_edit.htm*", rtype="admin", rname="团购管理", rcode="group_admin", rgroup="运营")
   @RequestMapping({"/admin/group_edit.htm"})
   public ModelAndView group_edit(HttpServletRequest request, HttpServletResponse response, String id, String currentPage)
   {
     ModelAndView mv = new JModelAndView("admin/blue/group_add.html",
       this.configService.getSysConfig(),
       this.userConfigService.getUserConfig(), 0, request, response);
     if ((id != null) && (!id.equals(""))) {
       Group group = this.groupService.getObjById(Long.valueOf(Long.parseLong(id)));
       mv.addObject("obj", group);
       mv.addObject("currentPage", currentPage);
       mv.addObject("edit", Boolean.valueOf(true));
       Map params = new HashMap();
       params.put("status", Integer.valueOf(0));
       List groups = this.groupService
         .query("select obj from Group obj where obj.status=:status order by obj.endTime desc",
         params, 0, 1);
       if (groups.size() > 0) {
         Group group1 = (Group)groups.get(0);
         mv.addObject("group", group1);
       }
     }
     return mv;
   }

   @SecurityMapping(display = false, rsequence = 0, title="团购保存", value="/admin/group_save.htm*", rtype="admin", rname="团购管理", rcode="group_admin", rgroup="运营")
   @RequestMapping({"/admin/group_save.htm"})
   public ModelAndView group_save(HttpServletRequest request, HttpServletResponse response, String id, String currentPage, String cmd, String begin_hour, String end_hour, String join_hour)
   {
     WebForm wf = new WebForm();
     Group group = null;
     if (id.equals("")) {
       group = (Group)wf.toPo(request, Group.class);
       group.setAddTime(new Date());
     } else {
       Group obj = this.groupService.getObjById(Long.valueOf(Long.parseLong(id)));
       group = (Group)wf.toPo(request, obj);
     }
     Date beginTime = group.getBeginTime();
     beginTime.setHours(CommUtil.null2Int(begin_hour));
     group.setBeginTime(beginTime);
     Dat


/* $Id: dba_read.c,v 1.5 2020/06/22 19:20:40 schwarze Exp $ */
/*
 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Function to read the mandoc database from disk into RAM,
 * such that data can be added or removed.
 * The interface is defined in "dba.h".
 * This file is seperate from dba.c because this also uses "dbm.h".
 */
#include "config.h"

#include <regex.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "mandoc_aux.h"
#include "mansearch.h"
#include "dba_array.h"
#include "dba.h"
#include "dbm.h"

struct dba *
dba_read(const char *fname)
{
	struct dba		*dba;
	struct dba_array	*page;
	struct dbm_page		*pdata;
	struct dbm_macro	*mdata;
	const char		*cp;
	int32_t			 im, ip, iv, npages;

	if (dbm_open(fname) == -1)
		return NULL;
	npages = dbm_page_count();
	dba = dba_new(npages < 128 ? 128 : npages);
	for (ip = 0; ip < npages; ip++) {
		pdata = dbm_page_get(ip);
		page = dba_page_new(dba->pages, pdata->arch,
		    pdata->desc, pdata->file + 1, *pdata->file);
		for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1)
			dba_page_add(page, DBP_NAME, cp);
		for (cp = pdata->sect; *cp != '\0'; cp = strchr(cp, '\0') + 1)
			dba_page_add(page, DBP_SECT, cp);
		if ((cp = pdata->arch) != NULL)
			while (*(cp = strchr(cp, '\0') + 1) != '\0')
				dba_page_add(page, DBP_ARCH, cp);
		cp = pdata->file;
		while (*(cp = strchr(cp, '\0') + 1) != '\0')
			dba_page_add(page, DBP_FILE, cp);
	}
	for (im = 0; im < MACRO_MAX; im++) {
		for (iv = 0; iv < dbm_macro_count(im); iv++) {
			mdata = dbm_macro_get(im, iv);
			dba_macro_new(dba, im, mdata->value, mdata->pp);
		}
	}
	dbm_close();
	return dba;
}


types::VersionStrings,
    std_types::{RBox, RBoxError, RResult, RStr, RString, RVec},
    StableAbi,
};

use serde::{Deserialize, Serialize};

/// Represents United States cents.
#[repr(transparent)]
#[derive(StableAbi, Debug, Clone, Copy, PartialEq, Deserialize, Serialize)]
pub struct Cents {
    pub cents: u64,
}

/// The unique identifier of an item that is/was in the catalogue,
/// which are never reused for a different item.
#[repr(transparent)]
#[derive(StableAbi, Debug, Clone, Copy, PartialEq, Deserialize, Serialize)]
pub struct ItemId {
    #[doc(hidden)]
    pub id: usize,
}

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

/// The parameters of `Shop::run_command`.
///
/// Every variant of this enum corresponds to a variant of `ReturnVal`.
#[non_exhaustive]
#[repr(u8)]
#[derive(StableAbi, Debug, Clone, PartialEq, Deserialize, Serialize)]
#[sabi(kind(WithNonExhaustive(
    size = "[usize;8]",
    traits(Send, Sync, Debug, Clone, PartialEq, Serialize, Deserialize),
    assert_nonexhaustive = "Command",
)))]
pub enum Command {
    /// `#[sabi(with_boxed_constructor)]` tells the `StableAbi` derive macro to
    /// generate the `fn CreateItem_NE(ParamCreateItem)->ReturnVal_NE` associated function.
    #[sabi(with_boxed_constructor)]
    CreateItem(RBox<ParamCreateItem>),
    DeleteItem {
        id: ItemId,
    },
    AddItem {
        id: ItemId,
        count: u32,
    },
    RemoveItem {
        id: ItemId,
        count: u32,
    },

    /// This variant was added in the 1.1 version of the library.
    #[cfg(feature = "v1_1")]
    RenameItem {
        id: ItemId,
        new_name: RString,
    },

    /// This variant was added in the 1.1 version of the library.
    ///
    /// `#[sabi(with_constructor)]` tells the `StableAbi` derive macro to
    /// generate the `fn Many_NE(RVec<Command_NE>)->Command_NE` associated function.
    #[cfg(feature = "v1_1")]
    #[sabi(with_constructor)]
    Many {
        list: RVec<Command_NE>,
    },
}

/*
//This was generated by the StableAbi derive macro on Command.
pub type Command_NE=
    NonExhaustive<
        Command,
        Command_Storage,
        Command_Interface,
    >;
*/

#[repr(C)]
#[derive(StableAbi, Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct ParamCreateItem {
    pub name: RString,
    pub initial_count: u32,
    pub price: Cents,
}

/// This specifies how `Command_NE` is serialized.
///
/// `Command_Interface` was generated by `#[derive(StableAbi)]`,
/// because `trait()` was passed as a parameter to
/// `#[sabi(kind(WithNonExhaustive( ... )))]`.
impl SerializeEnum<Command_NE> for Command_Interface {
    /// The intermediate type the enum is converted into with `SerializeEnum::serialize_enum`,
    /// and then serialized.
    type Proxy = RawValueBox;

    fn serialize_enum(this: &Command_NE) -> Result<RawValueBox, RBoxError> {
        ShopMod_Ref::get_module().unwrap().serialize_command()(this).into_result()
    }
}

/// This specifies how `Command_NE` is deserialized.
impl<'a> DeserializeEnum<'a, Command_NE> for Command_Interface {
    /// The intermediate type that is deserialized,
    /// and t


r128 modifier is not supported on this GPU

image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU
// CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
// CHECK-NEXT:{{^}}                                            ^

image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU
// CHECK-NEXT:{{^}}image_atomic_add v10, v6, s[8:15] dmask:0x1 nor128
// CHECK-NEXT:{{^}}                                            ^

//==============================================================================
// unified format is not supported on this GPU

tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: unified format is not supported on this GPU
// CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], v1, s[4:7], s0 format:[BUF_FMT_8_SNORM,BUF_DATA_FORMAT_8] idxen
// CHECK-NEXT:{{^}}                                                         ^

//==============================================================================
// duplicate format

tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: duplicate format
// CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7], dfmt:1 s0 format:[BUF_NUM_FORMAT_FLOAT]
// CHECK-NEXT:{{^}}                                                            ^

//==============================================================================
// not a valid operand

v_cndmask_b32_sdwa v5, sext(v1), v2, vcc dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0 src1_sel:WORD_0
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: not a valid operand.
// CHECK-NEXT:{{^}}v_cndmask_b32_sdwa v5, sext(v1), v2, vcc dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:BYTE_0 src1_sel:WORD_0
// CHECK-NEXT:{{^}}                       ^

//==============================================================================
// out of range dfmt

tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: out of range dfmt
// CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:16 nfmt:1 s0
// CHECK-NEXT:{{^}}                                                 ^

//==============================================================================
// out of range nfmt

tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: out of range nfmt
// CHECK-NEXT:{{^}}tbuffer_store_format_xyzw v[1:4], off, ttmp[4:7] dfmt:1 nfmt:-1 s0
// CHECK-NEXT:{{^}}                                                        ^


-----------------------------------
-- Area: Port Bastok
--  NPC: Argus
-- Type: Mission Giver
-- !pos 132.157 7.496 -2.187 236
-----------------------------------
require("scripts/globals/settings")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
local ID = require("scripts/zones/Port_Bastok/IDs")
-----------------------------------

function onTrade(player, npc, trade)

    local CurrentMission = player:getCurrentMission(BASTOK)
    local Count = trade:getItemCount()

    if (CurrentMission ~= tpz.mission.id.bastok.NONE) then
        if (CurrentMission == tpz.mission.id.bastok.FETICHISM and player:hasCompletedMission(BASTOK, tpz.mission.id.bastok.FETICHISM) == false and trade:hasItemQty(606, 1) and trade:hasItemQty(607, 1) and trade:hasItemQty(608, 1) and trade:hasItemQty(609, 1) and Count == 4) then
            player:startEvent(1008) -- Finish Mission "Fetichism" (First Time)
        elseif (CurrentMission == tpz.mission.id.bastok.FETICHISM and trade:hasItemQty(606, 1) and trade:hasItemQty(607, 1) and trade:hasItemQty(608, 1) and trade:hasItemQty(609, 1) and Count == 4) then
            player:startEvent(1005) -- Finish Mission "Fetichism" (Repeat)
        elseif (CurrentMission == tpz.mission.id.bastok.TO_THE_FORSAKEN_MINES and player:hasCompletedMission(BASTOK, tpz.mission.id.bastok.TO_THE_FORSAKEN_MINES) == false and trade:hasItemQty(563, 1) and Count == 1) then
            player:startEvent(1010) -- Finish Mission "To the forsaken mines" (First Time)
        elseif (CurrentMission == tpz.mission.id.bastok.TO_THE_FORSAKEN_MINES and trade:hasItemQty(563, 1) and Count == 1) then
            player:startEvent(1006) -- Finish Mission "To the forsaken mines" (Repeat)
        end
    end

end

function onTrigger(player, npc)

    i


oteId.hashCode);

    return _SystemHash.finish(hash);
  }
}

@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin PostNotifierRef on NotifierProviderRef<NotesCreateRequest> {
  /// The parameter `account` of this provider.
  Account get account;

  /// The parameter `noteId` of this provider.
  String? get noteId;
}

class _PostNotifierProviderElement
    extends NotifierProviderElement<PostNotifier, NotesCreateRequest>
    with PostNotifierRef {
  _PostNotifierProviderElement(super.provider);

  @override
  Account get account => (origin as PostNotifierProvider).account;
  @override
  String? get noteId => (origin as PostNotifierProvider).noteId;
}

// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'aria_backup.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

_AriaBackup _$AriaBackupFromJson(Map<String, dynamic> json) => _AriaBackup(
  metadata: json['metadata'] as Map<String, dynamic>?,
  timelineTabs: (json['timelineTabs'] as List<dynamic>?)
      ?.map((e) => TabSettings.fromJson(e as Map<String, dynamic>))
      .toList(),
  accountSettings: (json['accountSettings'] as Map<String, dynamic>?)?.map(
    (k, e) => MapEntry(k, AccountSettings.fromJson(e as Map<String, dynamic>)),
  ),
  generalSettings: json['generalSettings'] == null
      ? null
      : GeneralSettings.fromJson(
          json['generalSettings'] as Map<String, dynamic>,
        ),
  themes: (json['themes'] as List<dynamic>?)?.map((e) => e as String).toList(),
  aiscriptStorage: (json['aiscriptStorage'] as Map<String, dynamic>?)?.map(
    (k, e) => MapEntry(k, Map<String, String>.from(e as Map)),
  ),
);

Map<String, dynamic> _$AriaBackupToJson(
  _AriaBackup instance,
) => <String, dynamic>{
  if (instance.metadata case final value?) 'metadata': value,
  if (instance.timelineTabs?.map((e) => e.toJson()).toList() case final value?)
    'timelineTabs': value,
  if (instance.accountSettings?.map((k, e) => MapEntry(k, e.toJson()))
      case final value?)
    'accountSettings': value,
  if (instance.generalSettings?.toJson() case final value?)
    'generalSettings': value,
  if (instance.themes case final value?) 'themes': value,
  if (instance.aiscriptStorage case final value?) 'aiscriptStorage': value,
};
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'mfm_config.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$MfmConfig {

 TextStyle get style; bool get disableNyaize; double get scale; double get opacity; TextAlign? get align; int get xNest;
/// Create a copy of MfmConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false


)
  })
})

describe('solveQubicFomula', () => {
  it('1 real solution', () => {
    const ret = geo.solveQubicFomula(1, -14, 69, -108)
    expect(ret).toHaveLength(1)
    expect(ret[0]).toBeCloseTo(3)
  })
  it('2 real solutions', () => {
    const ret = geo.solveQubicFomula(1, 4, 5, 2)
    expect(ret).toHaveLength(2)
    expect(ret[0]).toBeCloseTo(-2)
    expect(ret[1]).toBeCloseTo(-1)
  })
  it('3 real solutions', () => {
    const ret = geo.solveQubicFomula(1, -12, 47, -60)
    expect(ret).toHaveLength(3)
    expect(ret[0]).toBeCloseTo(5)
    expect(ret[1]).toBeCloseTo(3)
    expect(ret[2]).toBeCloseTo(4)
  })
  it('quadratic: 2 real solutions', () => {
    const ret = geo.solveQubicFomula(0, 1, -5, 6)
    expect(ret).toHaveLength(2)
    expect(ret[0]).toBeCloseTo(3)
    expect(ret[1]).toBeCloseTo(2)
  })
  it('quadratic: 1 real solution', () => {
    const ret = geo.solveQubicFomula(0, 1, -4, 4)
    expect(ret).toHaveLength(1)
    expect(ret[0]).toBeCloseTo(2)
  })
  it('linear: 1 real solution', () => {
    const ret = geo.solveQubicFomula(0, 0, 1, 1)
    expect(ret).toHaveLength(1)
    expect(ret[0]).toBeCloseTo(-1)
  })
  it('Inappropriate: empty', () => {
    const ret = geo.solveQubicFomula(0, 0, 0, 1)
    expect(ret).toHaveLength(0)
  })
  it.each([
    [10, -30, 30, 0, [0]],
    [10, -30, 30, -10, [1]],
  ])('a: %s, b: %s, c: %s, d: %s => %s', (a, b, c, d, expected) => {
    const ret = geo.solveQubicFomula(a, b, c, d)
    ret.forEach((t, i) => {
      expect(t).toBeCloseTo(expected[i])
    })
  })
})

describe('clamp', () => {
  it.each([
    [0, 1, 2, 1],
    [0, 1, -1, 0],
    [0, 1, 0.2, 0.2],
  ])('clamp(%s, %s, %s) => %s', (min, max, val, expected) => {
    expect(geo.clamp(min, max, val)).toBe(expected)
  })
  it('only min', () => {
    expect(geo.clamp(1, undefined, -1)).toBe(1)
    expect(geo.clamp(1, undefined, 2)).toBe(2)
  })
  it('only max', () => {
    expect(geo.clamp(undefined, 1, -1)).toBe(-1)
    expect(geo.clamp(undefined, 1, 2)).toBe(1)
  })
})

describe('circleClamp', () => {
  it.each([
    [0, 0, 1.2, 0],
    [0, 1, 1.2, 0.2],
    [0, 1, -0.2, 0.8],
    [-1, 3, -2, 2],
    [-1, 3, 3.5, -0.5],
  ])('circleClamp(%s, %s, %s) => %s', (min, max, val, expected) => {
    expect(geo.circleClamp(min, max, val)).toBeCloseTo(expected)
  })
})

describe('roundTrip', () => {


hdcOwned = false;
	}
}

void SurfaceGDI::Release() {
	Clear();
}

bool SurfaceGDI::Initialised() {
	return hdc != 0;
}

void SurfaceGDI::Init(WindowID wid) {
	Release();
	hdc = ::CreateCompatibleDC({});
	hdcOwned = true;
	::SetTextAlign(hdc, TA_BASELINE);
	logPixelsY = DpiForWindow(wid);
}

void SurfaceGDI::Init(SurfaceID sid, WindowID wid) {
	Release();
	hdc = static_cast<HDC>(sid);
	::SetTextAlign(hdc, TA_BASELINE);
	// Windows on screen are scaled but printers are not.
	const bool printing = ::GetDeviceCaps(hdc, TECHNOLOGY) != DT_RASDISPLAY;
	logPixelsY = printing ? ::GetDeviceCaps(hdc, LOGPIXELSY) : DpiForWindow(wid);
}

void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID wid) {
	Release();
	SurfaceGDI *psurfOther = dynamic_cast<SurfaceGDI *>(surface_);
	// Should only ever be called with a SurfaceGDI, not a SurfaceD2D
	PLATFORM_ASSERT(psurfOther);
	hdc = ::CreateCompatibleDC(psurfOther->hdc);
	hdcOwned = true;
	bitmap = ::CreateCompatibleBitmap(psurfOther->hdc, width, height);
	bitmapOld = SelectBitmap(hdc, bitmap);
	::SetTextAlign(hdc, TA_BASELINE);
	SetUnicodeMode(psurfOther->unicodeMode);
	SetDBCSMode(psurfOther->codePage);
	logPixelsY = DpiForWindow(wid);
}

void SurfaceGDI::PenColour(ColourDesired fore) {
	if (pen) {
		::SelectObject(hdc, penOld);
		::DeleteObject(pen);
		pen = {};
		penOld = {};
	}
	pen = ::CreatePen(0,1,fore.AsInteger());
	penOld = SelectPen(hdc, pen);
}

void SurfaceGDI::BrushColour(ColourDesired back) noexcept {
	if (brush) {
		::SelectObject(hdc, brushOld);
		::DeleteObject(brush);
		brush = {};
		brushOld = {};
	}
	brush = ::CreateSolidBrush(back.AsInteger());
	brushOld = SelectBrush(hdc, brush);
}

void SurfaceGDI::SetFont(const Font &font_) noexcept {
	const FormatAndMetrics *pfm = FamFromFontID(font_.GetID());
	PLATFORM_ASSERT(pfm->technology == SCWIN_TECH_GDI);
	if (fontOld) {
		SelectFont(hdc, pfm->hfont);
	} else {
		fontOld = SelectFont(hdc, pfm->hfont);
	}
}

int SurfaceGDI::LogPixelsY() {
	return logPixelsY;
}

int SurfaceGDI::DeviceHeightFont(int points) {
	return ::MulDiv(points, LogPixelsY(), 72);
}

void SurfaceGDI::MoveTo(int x_, int y_) {
	::MoveToEx(hdc, x_, y_, nullptr);
}

void SurfaceGDI::LineTo(int x_, int y_) {
	::LineTo(hdc, x_, y_);
}

void SurfaceGDI::Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back) {
	PenColour(fore);
	BrushColour(back);
	std::vector<POINT> outline;
	for (size_t i=0; i<npts; i++) {
		const POINT pt = POINTFromPoint(pts[i]);
		outline.push_back(pt);
	}
	::Polygon(hdc, outline.data(), static_cast<int>(npts));
}

void SurfaceGDI::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
	PenColour(fore);
	BrushColour(back);
	const RECT rcw = RectFromPRectangle(rc);
	::Rectangle(hdc, rcw


 3, r34	//(9)
	;;
	shl r69 = r66, 1		//(6)
	shladd r70 = r66, 1, r34	//(7)
	shl r73 = r68, 1		//(10)
	shladd r74 = r68, 1, r34	//(11)
	shl r75 = r66, 2		//(12)
	shladd r76 = r66, 2, r34	//(13)
	shladd r77 = r66, 2, r65	//(14)
	shladd r78 = r66, 2, r66	//(15)
	;;
	cmp.eq p16, p17 = 0, r31	// prepare predicates according to the misalignment
	cmp.eq p18, p19 = 2, r31	// ref
	cmp.eq p20, p21 = 4, r31
	cmp.eq p22, p23 = 6, r31
	cmp.eq p24, p25 = 1, r31
	cmp.eq p26, p27 = 3, r31
	cmp.eq p28, p29 = 5, r31
	mov r96 = r14			// and calculate all the adresses where we have
	mov r33 = r32			// to load from
	add r97 = r14, r64
	add r35 = r32, r64
	add r98 = r14, r65
	add r37 = r32, r65
	add r99 = r14, r66
	add r39 = r32, r66
	add r100 = r14, r67
	add r41 = r32, r67
	add r101 = r14, r68
	add r43 = r32, r68
	add r102 = r14, r69
	add r45 = r32, r69
	add r103 = r14, r70
	add r47 = r32, r70
	add r104 = r14, r71
	add r49 = r32, r71
	add r105 = r14, r72
	add r51 = r32, r72
	add r106 = r14, r73
	add r53 = r32, r73
	add r107 = r14, r74
	add r55 = r32, r74
	add r108 = r14, r75
	add r57 = r32, r75
	add r109 = r14, r76
	add r59 = r32, r76
	add r110 = r14, r77
	add r61 = r32, r77
	add r111 = r14, r78
	add r63 = r32, r78
	;;
	ld8 r32 = [r33], 8		// Load all the data which is needed for the sad
	ld8 r34 = [r35], 8		// in the registers. the goal is to have the array
	ld8 r36 = [r37], 8		// adressed by cur in the registers r32 - r63 and
	ld8 r38 = [r39], 8		// the aray adressed by ref in the registers
	ld8 r40 = [r41], 8		// r64 - r95. The registers r96 - r111 are needed
	ld8 r42 = [r43], 8		// to load the aligned 24 bits in which the
	ld8 r44 = [r45], 8		// needed misaligned 16 bits must be.
	ld8 r46 = [r47], 8		// After loading we start a preprocessing which
	ld8 r48 = [r49], 8		// guarantees that the data adressed by ref is in
	ld8 r50 = [r51], 8		// the registers r64 - r95.
	ld8 r52 = [r53], 8
	ld8 r54 = [r55], 8
	ld8 r56 = [r57], 8
	ld8 r58 = [r59], 8
	ld8 r60 = [r61], 8
	ld8 r62 = [r63], 8
	ld8 r64 = [r96], 8
	ld8 r66 = [r97], 8
	ld8 r68


abort these steps.

If the depth buffer present in <var>nativeDepthInformation</var> meets user agent’s criteria to limit the amount of information available in depth buffer, adjust the depth buffer accordingly.

Initialize <var>result</var>’s width to the width of the depth buffer returned in <var>nativeDepthInformation</var>.

Initialize <var>result</var>’s height to the height of the depth buffer returned in <var>nativeDepthInformation</var>.

Initialize <var>result</var>’s normDepthBufferFromNormView to a new XRRigidTransform, based on <var>nativeDepthInformation</var>’s depth coordinates transformation matrix.

Initialize <var>result</var>’s texture to an opaque texture containing the depth buffer returned in <var>nativeDepthInformation</var>.

Initialize <var>result</var>’s view to <var>view</var>.

Return <var>result</var>.

The following code demonstrates how depth data can be obtained within <a data-link-type="idl" href="https://immersive-web.github.io/webxr/#callbackdef-xrframerequestcallback" id="ref-for-callbackdef-xrframerequestcallback①


order special branches but starting with defaultBranch", () => {
    const branches = [masterBranch, developBranch, defaultBranch, branch3];
    orderBranches(branches);
    expect(branches).toEqual([branch3, masterBranch, defaultBranch, developBranch]);
  });
});
import {
  IsString,
  IsEnum,
  IsNotEmpty,
  IsMongoId,
  IsUUID
} from 'class-validator';
import { Exclude } from 'class-transformer';
import {
  UserRole,
  Schema$RefreshToken,
  Param$CreateRefreshToken
} from '@/typings';

class Excluded implements Partial<Schema$RefreshToken> {
  @Exclude()
  id?: string;

  @Exclude()
  current?: undefined;

  @Exclude()
  userAgent?: undefined;

  @Exclude()
  createdAt?: undefined;

  @Exclude()
  updatedAt?: undefined;
}

export class CreateRefreshTokenDto
  implements
    Required<Omit<Param$CreateRefreshToken, keyof Excluded>>,
    Required<Omit<Schema$RefreshToken, keyof Excluded>> {
  @IsMongoId()
  user_id: string;

  @IsString()
  @IsNotEmpty()
  username: string;

  @IsString()
  @IsNotEmpty()
  nickname: string;

  @IsEnum(UserRole)
  role: UserRole;

  @IsUUID()
  refreshToken: string;
}
import { IPaEntry, IPaConfig } from '../declarations'
import fs, { Dirent } from 'fs'
import path from 'path'
import colors from 'chalk'
import { matchFile } from '../helpers/utils'

export default async function entryFactory(
  list: Dirent[],
  config: IPaConfig
): Promise<IPaEntry[]> {
  const { root, silent, debug, pageTemplate, exclude } = config
  const entryList: IPaEntry[] = []
  const subFolderList: string[] = []
  if (pageTemplate == null) {
    if (silent == null || !silent) {
      console.log(colors.red('Can not find pageTemplate.'))
    }
    throw new Error('Can not find pageTemplate.')
  }
  list.forEach(i => {
    const entry = path.join(root as string, i.name)
    const { dir, name, ext, base } = path.parse(entry)
    // exclude
    if (exclude != null && checkExclude(i, exclude)) {
      return
    }
    // simple mode
    if (i.isFile() && ext.match(/\.(ts|js)$/i) !== null) {
      entryList.push({
        dir,
        name,
        ext,
        base,
        pageTemplate
      })
      if ((silent == null || !silent) && debug != null && debug) {
        console.log(`${name} built`)
      }
      return
    }
    // complete mode
    if (i.isDirectory()) {
      subFolderList.push(i.name)
    }
  })
  if (subFolderList.length === 0) {
    return entryList
  }
  const scanSubFolderRes = await scanSubFolder(
    config as Required<IPaConfig>,
    subFolderList
  )
  const result = entryList.concat(scanSubFolderRes)
  if (silent == null || !silent) {
    if (result.length === 0) {
      console.log(colors.yellow(`No entries found.`))
    } else {
      console.group(
        colors.underline(`${result.length} entries have been created: `)
      )
      console.log(colors.green(result.map(i => i.name).join('\n')))
      console.groupEnd()
    }
  }
  return result
}

async function scanSubFolder(
  config: Required<IPaConfig>,
  subFolderList: string[]
): Promise<IPaEntry[]> {
  const {


}{
		MaxTotal: maxTotal,
		Data:     data,
		Name:     filter.name,
	})
	if err != nil {
		http.Error(w, fmt.Sprintf("failed to execute template: %v", err), http.StatusInternalServerError)
		return
	}
}

// httpUserTask presents the details of the selected tasks.
func httpUserTask(w http.ResponseWriter, r *http.Request) {
	filter, err := newTaskFilter(r)
	if err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	res, err := analyzeAnnotations()
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	tasks := res.tasks

	type event struct {
		WhenString string
		Elapsed    time.Duration
		Go         uint64
		What       string
		// TODO: include stack trace of creation time
	}
	type entry struct {
		WhenString string
		ID         uint64
		Duration   time.Duration
		Complete   bool
		Events     []event
		Start, End time.Duration // Time since the beginning of the trace
		GCTime     time.Duration
	}

	base := time.Duration(firstTimestamp()) * time.Nanosecond // trace start

	var data []entry

	for _, task := range tasks {
		if !filter.match(task) {
			continue
		}
		// merge events in the task.events and task.regions.Start
		rawEvents := append([]*trace.Event{}, task.events...)
		for _, s := range task.regions {
			if s.Start != nil {
				rawEvents = append(rawEvents, s.Start)
			}
		}
		sort.SliceStable(rawEvents, func(i, j int) bool { return rawEvents[i].Ts < rawEvents[j].Ts })

		var events []event
		var last time.Duration
		for i, ev := range rawEvents {
			when := time.Duration(ev.Ts)*time.Nanosecond - base
			elapsed := time.Duration(ev.Ts)*time.Nanosecond - last
			if i == 0 {
				elapsed = 0
			}

			what := describeEvent(ev)
			if what != "" {
				events = append(events, event{
					WhenString: fmt.Sprintf("%2.9f", when.Seconds()),
					Elapsed:    elapsed,
					What:       what,
					Go:         ev.G,
				})
				last = time.Duration(ev.Ts) * time.Nanosecond
			}
		}

		data = append(data, entry{
			WhenString: fmt.Sprintf("%2.9fs", (time.Duration(task.firstTimestamp())*time.Nanosecond - base).Seconds()),
			Duration:   task.duration(),
			ID:         task.id,
			Complete:   task.complete(),
			Events:     events,
			Start:      time.Duration(task.firstTimestamp()) * time.Nanosecond,
			End:        time.Duration(task.endTimestamp()) * time.Nanosecond,
			GCTime:     task.overlappingGCDuration(res.gcEvents),
		})
	}
	sort.Slice(data, func(i, j int) bool {
		return data[i].Duration < data[j].Duration
	})

	// Emit table.
	err = templUserTaskType.Execute(w, struct {
		Name  string
		Entry []entry
	}{
		Name:  filter.name,
		Entry: data,
	})
	if err != nil {
		log.Printf("failed to execute template: %v", err)
		http.Error(w, fmt.Sprintf("failed to execute template: %v", err), http.StatusInternalServerError)
		return
	}
}

type annotationAnalysisResult struct {
	tasks    map[uint64]*taskDesc          // tasks
	regions  map[regionTypeID][]regionDesc // regions
	gcEvents []*trace.Event                // GCStartevents, sorted
}

type regionTypeID struct {
	Frame trace.Frame /


            .unwrap();

        info!("Set server 1 in group 1 to 1");
        ch1.set_weight(&server_1, 1).await.unwrap();
        info!("Set server 2 in group 1 to 2");
        ch1.set_weight(&server_2, 2).await.unwrap();
        info!("Set server 3 in group 1 to 3");
        ch1.set_weight(&server_3, 3).await.unwrap();

        info!("Set server 1 in group 2 to 1");
        ch2.set_weight(&server_1, 1).await.unwrap();
        info!("Set server 2 in group 2 to 1");
        ch2.set_weight(&server_2, 1).await.unwrap();

        info!("Set server 1 in group 3 to 2");
        ch3.set_weight(&server_1, 2).await.unwrap();

        info!("Init table for conshash 1");
        ch1.init_table().await.unwrap();
        info!("Init table for conshash 2");
        ch2.init_table().await.unwrap();
        info!("Init table for conshash 3");
        ch3.init_table().await.unwrap();

        let ch1_server_node_changes_count = Arc::new(AtomicUsize::new(0));
        let ch1_server_node_changes_count_clone = ch1_server_node_changes_count.clone();
        info!("Watch node change from conshash 1");
        ch1.watch_server_nodes_range_changed(&server_2, move |_| {
            ch1_server_node_changes_count_clone.fetch_add(1, Ordering::Relaxed);
        });

        let ch2_server_node_changes_count = Arc::new(AtomicUsize::new(0));
        let ch2_server_node_changes_count_clone = ch2_server_node_changes_count.clone();
        info!("Watch node change from conshash 2");
        ch2.watch_server_nodes_range_changed(&server_2, move |_| {
            ch2_server_node_changes_count_clone.fetch_add(1, Ordering::Relaxed);
        });

        let ch3_server_node_changes_count = Arc::new(AtomicUsize::new(0));
        let ch3_server_node_changes_count_clone = ch3_server_node_changes_count.clone();
        info!("Watch node change from conshash 3");
        ch3.watch_server_nodes_range_changed(&server_2, move |_| {
            ch3_server_node_changes_count_clone.fetch_add(1, Ordering::Relaxed);
        });

        info!("Counting nodes for conshash 1");
        assert_eq!(ch1.nodes_count(), 6);
        info!("Counting nodes for conshash 2");
        assert_eq!(ch2.nodes_count(), 2);
        info!("Counting nodes for conshash 3");
        assert_eq!(ch3.nodes_count(), 1);

        info!("Batch get server by string from conshash 1");
        let mut ch_1_mapping: HashMap<String, u64> = HashMap::new();
        let data_set_size: usize = 30000;

        for i in 0..data_set_size {
            let k = format!("k - {}", i);
            let server = ch1.get_server_by_string(&k).unwrap();
            *ch_1_mapping.entry(server.clone()).or_insert(0) += 1;
        }
        info!("Counting distribution for conshash 1");
        assert_eq!(ch_1_mapping.get(&server_1).unwrap(), &4936);
        assert_eq!(ch_1_mapping.get(&server_2).unwrap(), &9923);
        assert_eq!(ch_1_mapping.get(&server_3).unwrap(), &15141); // hard coded due to constant

        info!("Batch get server by string from conshash 2");
        let mut ch_2_mapping: HashM


local L0_1, L1_1, L2_1, L3_1, L4_1, L5_1, L6_1, L7_1
L0_1 = require
L1_1 = "Ui.Avatar.AssistAvatarItemPanel"
L0_1(L1_1)
L0_1 = require
L1_1 = "Ui.Avatar.AssistAvatarItemPanelBinder"
L0_1(L1_1)
L0_1 = require
L1_1 = "Ui.Avatar.AvatarElementFilter"
L0_1(L1_1)
L0_1 = require
L1_1 = "Ui.Avatar.AvatarClassFilter"
L0_1(L1_1)
L0_1 = require
L1_1 = "Utilities.FriendUtils"
L0_1(L1_1)
L0_1 = require
L1_1 = "Ui.Common.FilterSort.BtnFilterPanel"
L0_1(L1_1)
L0_1 = G
L0_1 = L0_1.Class
L1_1 = "StrangerAssistAvatarSelectTabItem"
L2_1 = G
L2_1 = L2_1.TabItem
L0_1 = L0_1(L1_1, L2_1)
L1_1 = CS
L1_1 = L1_1.RPG
L1_1 = L1_1.Client
L1_1 = L1_1.GlobalVars
L1_1 = L1_1.s_ModuleManager
L1_1 = L1_1.FriendModule
L2_1 = "UIText_Assist_List_Default_Label"
L3_1 = "UIText_PlayerCard_Character_Empty"
L4_1 = "UIText_Assist_Filter_Content_Stranger"
L5_1 = 1
L6_1 = 157
function L7_1(A0_2)
  local L1_2, L2_2
  L1_2 = G
  L1_2 = L1_2.new
  L2_2 = G
  L2_2 = L2_2.AvatarElementFilter
  L1_2 = L1_2(L2_2)
  A0_2._element_filter = L1_2
  L1_2 = G
  L1_2 = L1_2.new
  L2_2 = G
  L2_2 = L2_2.AvatarClassFilter
  L1_2 = L1_2(L2_2)
  A0_2._class_filter = L1_2
  A0_2._cur_select_index = 0
  L1_2 = {}
  A0_2._assist_data_list = L1_2
  L1_2 = {}
  A0_2._filter_assists = L1_2
end
L0_1.ctor = L7_1
function L7_1(A0_2)
  local L1_2, L2_2, L3_2
  L1_2 = A0_2._binder
  L1_2 = L1_2.scroll_assists
  if L1_2 then
    L1_2 = A0_2._binder
    L1_2 = L1_2.scroll_assists
    L2_2 = L1_2
    L1_2 = L1_2.GetShownItemByItemIndex
    L3_2 = A0_2._cur_select_index
    L1_2 = L1_2(L2_2, L3_2)
    if L1_2 ~= nil then
      L2_2 = L1_2.UserObjectData
      if L2_2 ~= nil then
        L2_2 = L1_2.UserObjectData
        L2_2 = L2_2._binder
        L2_2 = L2_2.btn_root
        L2_2 = L2_


vk_"..keyboard_layout]?[key] or vk_qwerty[key]
end

-- Listen for key pressed and fire an event if the pressed key is part of the listenedKeys table, true when pressed and false when release, which is then passed to the callback of jo_libs:rawKeys:XXX
CreateThread(function()
    while true do
        local length = #listenedKeys

        if (length == 0) then
            Wait(100)
        else
            for i = 1, length do
                local vk_key = listenedKeys[i]
                if IsRawKeyPressed(getVKValue(vk_key)) then
                    TriggerEvent("jo_libs:rawKeys:" .. vk_key, true)
                end
                if IsRawKeyReleased(getVKValue(vk_key)) then
                    TriggerEvent("jo_libs:rawKeys:" .. vk_key, false)
                end
            end
        end

        Wait(0)
    end
end)

AddConvarChangeListener("jo_libs:keyboard_layout",function()
    keyboard_layout = GetConvar('jo_libs:keyboard_layout','qwerty')
    keyboard_layout = string.lower(keyboard_layout)
    print(keyboard_layout)
end)

AddEventHandler("onResourceStop", function(resource)
    for key in pairs(linkedResources) do
        removeScriptKeys(resource, key)
    end
end)

-- debug
-- CreateThread(function()
--     while true do
--         for key,value in pairs(vk_qwerty) do
--             if IsRawKeyPressed(value) then print(key,value) end
--         end
--         Wait(0)
--     end
-- end)


 === 'request') {
    requests[0].requestWaited = true

    return requests[0]
  }

  // When response, return the first request that has the wanted state.
  for (let i = 0; i < requests.length; i++) {
    const request = requests[i]

    if (RESPONSE_WAITED_STATES.includes(request.state)) {
      request.responseWaited = true

      return request
    }
  }

  return null
}
export interface Week {
    /**
     * Number of commits
     */
    c: number;
    /**
     * Number of deletions
     */
    d: number;
    /**
     * Number of additions
     */
    a: number;
    /**
     * Start of the week, given as a Unix timestamp.
     */
    w: number;
}
import {Inject} from "../../Joy/Decorators/Inject"
import {Logger} from "../../Joy/Debug/Logger"
import {MySecondService} from "./MySecondService"

export class MyFirstService {

    @Inject(MySecondService)
    mySecondService: MySecondService;

    @Inject(Logger)
    logger: Logger;

    foo() {
        this.mySecondService.myMethod();
    }

    bar() {
        this.logger.log("MyFirstService::bar()");
    }

}/*
 Copyright (c) 2022 Xiamen Yaji Software Co., Ltd.

 http://www.cocos.com

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated engine source code (the "Software"), a limited,
  worldwide, royalty-free, non-assignable, revocable and non-exclusive license
 to use Cocos Creator solely to develop games on your target platforms. You shall
  not use Cocos Creator software for developing other software or tools that's
  used for developing games. You are not granted to publish, distribute,
  sublicense, and/or sell copies of Cocos Creator.

 The software or tools in this License Agreement are licensed, not sold.
 Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
*/
import { HTML5 } from 'internal:constants';
import { legacyCC } from './global-exports';

declare const fsUtils: any;

/**
 * @zh
 * Settings 中的默认分组，通常与模块一一对应。
 *
 * @en
 * The default grouping in Settings, which usually corresponds to the module.
 */
enum Category {
    PATH = 'path',
    ENGINE = 'engine',
    ASSETS = 'assets',
    SCRIPTING = 'scripting',
    PHYSICS = 'physics',
    RENDERING = 'rendering',
    LAUNCH = 'launch',
    SCREEN = 'screen',
    SPLASH_SCREEN = 'splashScreen',
    ANIMATION = 'animation',
    PROFILING = 'profiling',
    PLUGINS = 'plugins',
}

/**
 * @zh
 * 配置模块用于获取 settings.json 配置文件中的配置信息，同时你可以覆盖一些配置从而影响引擎的启动和运行，可参考 [game.init] 的参数选项说明。你可以通过 [settings] 访问此模块单例。
 * @en
 * The Settings module is used to get the configuration information in the settings.json configuration file,
 * and you can override some of the configuration to affect the launch and running of the engine, as described in the [game.init] parameter options.
 * You can access this single instance of the module via [settings].
 */
export class Settings {
    static Category = Category;

    /**
     * Initialization
     *