rem}.ui-dialog .ui-dialog-titlebar-close:before{content:"\f00d";line-height:1.5rem;margin:0 !important}.ui-dialog .ui-dialog-content>.popupmenu{display:block !important}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{display:flex;justify-content:flex-end}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link,.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{overflow:hidden;text-overflow:ellipsis;min-width:5rem;margin:9px 4px}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link:last-child,.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:last-child{margin-right:0}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link{padding-right:0;padding-left:0;text-decoration:none;color:#2c363a}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link:focus{background-color:rgba(55,190,255,0.5)}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link.options{order:-1;padding:.375rem .25rem;margin-right:.3rem}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset a.btn-link.options:before{content:"\f013";width:100%;height:1.25em}.ui-dialog iframe,.ui-dialog .ui-dialog-content.iframe{padding:0;width:100% !important;height:100%;border:0;overflow:hidden}.ui-dialog,.ui-dialog-content{box-sizing:initial}.ui-widget-content .ui-icon.ui-resizable-se{background:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%0A%20%20%3Cpath%20fill%3D%22%23888%22%20d%3D%22M6.7%2016L16%206.7V5.3L5.3%2016zM9.7%2016L16%209.7V8.3L8.3%2016zM12.7%2016l3.3-3.3v-1.4L11.3%2016zM15.7%2016l.3-.3v-1.4L14.3%2016z%22%2F%3E%0A%3C%2Fsvg%3E%0A")}@media screen and (max-width:480px){.ui-dialog{width:100% !important;height:100% !important;display:flex;flex-direction:column;border:0;top:0 !important}.ui-dialog .ui-resizable-handle,.ui-dialog .ui-dialog-titlebar-close{display:none !important}.ui-dialog .ui-dialog-titlebar{height:58px;text-align:center;background-color:#f4f4f4}.ui-dialog .ui-dialog-title{line-height:58px;font-size:1rem;padding:0 1rem}.ui-dialog .ui-dialog-content{flex:1}.ui-dialog .ui-dialog-content:not(.iframe){padding:1rem}.ui-dialog .ui-dialog-buttonpane{padding:0 !important;text-align:center !important;border-top:1px solid #ddd;height:58px !important;background-color:#f4f4f4}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{justify-content:space-around}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{margin:0 !important;padding:.45rem;border:0 !important;height:58px;box-shadow:none;font-size:90%;line-height:1.5}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button


ND_DATA: u32 = 110u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_METHOD_VIRTUAL_CHANNEL_SET_ACCESS: u32 = 111u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPFILTERENABLED: u32 = 219u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPFILTER_ENABLED: u32 = 218u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPFLAGS: u32 = 223u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPLICATION: u32 = 211u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPLICATION_FILTER: u32 = 215u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPLICATION_LIST: u32 = 217u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_APPNAME: u32 = 214u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_ATTENDEELIMIT: u32 = 235u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_ATTENDEES: u32 = 203u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_ATTENDEE_FLAGS: u32 = 230u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_CHANNELMANAGER: u32 = 206u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_CODE: u32 = 241u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_CONINFO: u32 = 231u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_CONNECTION_STRING: u32 = 232u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_COUNT: u32 = 244u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_CTRL_LEVEL: u32 = 242u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_DBG_CLX_CMDLINE: u32 = 222u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_DISCONNECTED_STRING: u32 = 237u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID_RDPSRAPI_PROP_DISPIDVALUE: u32 = 200u32;
#[doc = "*Required features: `\"Win32_System_DesktopSharing\"`*"]
pub const DISPID


    public event Action<SceneAdapter, SceneAdapter>? ActiveSceneChanged;

    public static readonly SceneManagerAdapter Instance = new();

    private SceneManagerAdapter()
    {
        SceneManager.sceneLoaded += (scene, mode)
            => SceneLoaded?.Invoke(new SceneAdapter(scene.name), mode);

        SceneManager.sceneUnloaded += scene
            => SceneUnloaded?.Invoke(new SceneAdapter(scene.name));

        SceneManager.activeSceneChanged += (sceneFrom, sceneTo) =>
        {
            ActiveSceneChanged?.Invoke(
                new SceneAdapter(sceneFrom.name),
                new SceneAdapter(sceneTo.name));
        };
    }

    public SceneAdapter GetActiveScene() => new(SceneManager.GetActiveScene().name);
}


.

 3. The names of the authors may not be used to endorse or promote products
 derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
 INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.
 * JZlib is based on zlib-1.1.3, so all credit should go authors
 * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
 * and contributors of zlib.
 */

var Deflater = (function(obj) {

	// Global

	var MAX_BITS = 15;
	var D_CODES = 30;
	var BL_CODES = 19;

	var LENGTH_CODES = 29;
	var LITERALS = 256;
	var L_CODES = (LITERALS + 1 + LENGTH_CODES);
	var HEAP_SIZE = (2 * L_CODES + 1);

	var END_BLOCK = 256;

	// Bit length codes must not exceed MAX_BL_BITS bits
	var MAX_BL_BITS = 7;

	// repeat previous bit length 3-6 times (2 bits of repeat count)
	var REP_3_6 = 16;

	// repeat a zero length 3-10 times (3 bits of repeat count)
	var REPZ_3_10 = 17;

	// repeat a zero length 11-138 times (7 bits of repeat count)
	var REPZ_11_138 = 18;

	// The lengths of the bit length codes are sent in order of decreasing
	// probability, to avoid transmitting the lengths for unused bit
	// length codes.

	var Buf_size = 8 * 2;

	// JZlib version : "1.0.2"
	var Z_DEFAULT_COMPRESSION = -1;

	// compression strategy
	var Z_FILTERED = 1;
	var Z_HUFFMAN_ONLY = 2;
	var Z_DEFAULT_STRATEGY = 0;

	var Z_NO_FLUSH = 0;
	var Z_PARTIAL_FLUSH = 1;
	var Z_FULL_FLUSH = 3;
	var Z_FINISH = 4;

	var Z_OK = 0;
	var Z_STREAM_END = 1;
	var Z_NEED_DICT = 2;
	var Z_STREAM_ERROR = -2;
	var Z_DATA_ERROR = -3;
	var Z_BUF_ERROR = -5;

	// Tree

	// see definition of array dist_code below
	var _dist_code = [ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
			12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
			14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,


0x18]

v_min_i32 v5, 0, v2
// CHECK: [0x80,0x04,0x0a,0x18]

v_min_i32 v5, -1, v2
// CHECK: [0xc1,0x04,0x0a,0x18]

v_min_i32 v5, 0.5, v2
// CHECK: [0xf0,0x04,0x0a,0x18]

v_min_i32 v5, -4.0, v2
// CHECK: [0xf7,0x04,0x0a,0x18]

v_min_i32 v5, src_vccz, v2
// CHECK: [0xfb,0x04,0x0a,0x18]

v_min_i32 v5, src_execz, v2
// CHECK: [0xfc,0x04,0x0a,0x18]

v_min_i32 v5, src_scc, v2
// CHECK: [0xfd,0x04,0x0a,0x18]

v_min_i32 v5, src_lds_direct, v2
// CHECK: [0xfe,0x04,0x0a,0x18]

v_min_i32 v5, 0xaf123456, v2
// CHECK: [0xff,0x04,0x0a,0x18,0x56,0x34,0x12,0xaf]

v_min_i32 v5, 0x3f717273, v2
// CHECK: [0xff,0x04,0x0a,0x18,0x73,0x72,0x71,0x3f]

v_min_i32 v5, v1, v255
// CHECK: [0x01,0xff,0x0b,0x18]

v_max_i32 v5, v1, v2
// CHECK: [0x01,0x05,0x0a,0x1a]

v_max_i32 v255, v1, v2
// CHECK: [0x01,0x05,0xfe,0x1b]

v_max_i32 v5, v255, v2
// CHECK: [0xff,0x05,0x0a,0x1a]

v_max_i32 v5, s1, v2
// CHECK: [0x01,0x04,0x0a,0x1a]

v_max_i32 v5, s101, v2
// CHECK: [0x65,0x04,0x0a,0x1a]

v_max_i32 v5, flat_scratch_lo, v2
// CHECK: [0x66,0x04,0x0a,0x1a]

v_max_i32 v5, flat_scratch_hi, v2
// CHECK: [0x67,0x04,0x0a,0x1a]

v_max_i32 v5, vcc_lo, v2
// CHECK: [0x6a,0x04,0x0a,0x1a]

v_max_i32 v5, vcc_hi, v2
// CHECK: [0x6b,0x04,0x0a,0x1a]

v_max_i32 v5, tba_lo, v2
// CHECK: [0x6c,0x04,0x0a,0x1a]

v_max_i32 v5, tba_hi, v2
// CHECK: [0x6d,0x04,0x0a,0x1a]

v_max_i32 v5, tma_lo, v2
// CHECK: [0x6e,0x04,0x0a,0x1a]

v_max_i32 v5, tma_hi, v2
// CHECK: [0x6f,0x04,0x0a,0x1a]

v_max_


PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

package avail.compiler.instruction

import avail.compiler.AvailCodeGenerator
import avail.descriptor.functions.FunctionDescriptor
import avail.descriptor.tokens.A_Token
import avail.descriptor.tuples.A_Tuple
import avail.interpreter.levelOne.L1Operation.L1_doSetOuter
import avail.io.NybbleOutputStream

/**
 * Set the value of a variable found in the function's list of captured outer
 * variables.
 *
 * @author Mark van Gulik <mark@availlang.org>
 *
 * @constructor
 *
 * Construct a new `AvailSetOuterVariable`.
 *
 * @param relevantTokens
 *   The [A_Tuple] of [A_Token]s that are associated with this instruction.
 * @param outerIndex
 *   The index of the variable in a [function's][FunctionDescriptor] outer
 *   variables.
 */
class AvailSetOuterVariable constructor(
	relevantTokens: A_Tuple,
	outerIndex: Int) : AvailInstructionWithIndex(relevantTokens, outerIndex)
{
	override val isOuterUse: Boolean
		get() = true

	override fun writeNybblesOn(aStream: NybbleOutputStream)
	{
		L1_doSetOuter.writeTo(aStream)
		writeIntegerOn(index, aStream)
	}

	/**
	 * The receiver sets the value of an outer variable, so it can't be an
	 * outer reference to an argument (they aren't wrapped in a variable).
	 */
	override fun fixUsageFlags(
		localData: MutableList<AvailVariableAccessNote?>,
		outerData: MutableList<AvailVariableAccessNote?>,
		codeGenerator: AvailCodeGenerator)
	{
		var note = outerData[index - 1]
		if (note === null)
		{
			note = AvailVariableAccessNote()
			outerData[index - 1] = note
		}
		// If there was a get before this set, leave its canClear flag set to
		// true.
		note.previousGet = null
		// Any previous push could not be the last access, as we're using the
		// variable right now.
		note.previousPush?.isLastAccess = false
	}
}
/*
 * AvailSetLiteralVariable.kt
 * Copyright © 1993-2022, The Avail Foundation, LLC.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * * Neither the name of the copyright holder nor the names of the contributors
 *   may be used to endorse or promote products derived from this software
 *   without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE


 int result = 0;

	public int getResult() {
		return result;
	}

	public void visitNode(TreeNode node) {
		// do nothing
	}

	public void visitLeaf(TreeLeaf leaf) {
		result += leaf.getValue();
	}
}

class ProductOfRedNodesVisitor extends TreeVis {
	private long result = 1;
	private final int M = 1000000007;

	public int getResult() {
		return (int) result;
	}

	public void visitNode(TreeNode node) {
		if (node.getColor() == Color.RED) {
			result = (result * node.getValue()) % M;
		}
	}

	public void visitLeaf(TreeLeaf leaf) {
		if (leaf.getColor() == Color.RED) {
			result = (result * leaf.getValue()) % M;
		}
	}
}

class FancyVisitor extends TreeVis {
	private int nonLeafEvenDepthSum = 0;
	private int greenLeavesSum = 0;

	public int getResult() {
		return Math.abs(nonLeafEvenDepthSum - greenLeavesSum);
	}

	public void visitNode(TreeNode node) {
		if (node.getDepth() % 2 == 0) {
			nonLeafEvenDepthSum += node.getValue();
		}
	}

	public void visitLeaf(TreeLeaf leaf) {
		if (leaf.getColor() == Color.GREEN) {
			greenLeavesSum += leaf.getValue();
		}
	}
}

public class JavaVisitorPattern {
	static int[] values;
	static Color[] colors;
	static ArrayList<Integer>[] edges;
	// each edges[i] holds arrayList of all nodes connnected to node i

	@SuppressWarnings("unchecked")
	public static Tree solve() {
		int n;
		TreeNode root;
		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		values = new int[n];
		colors = new Color[n];
		for (int i = 0; i < n; i++)
			values[i] = sc.nextInt();
		for (int i = 0; i < n; i++)
			colors[i] = sc.nextInt() == 0 ? Color.RED : Color.GREEN;

		// initialize arraylists
		edges = (ArrayList<Integer>[]) new ArrayList[n + 1];
		for (int i = 1; i <= n; i++)
			edges[i] = new ArrayList<Integer>();

		// read the n- 1 edges and store them in both directions
		for (int i = 0; i < n - 1; i++) {
			int edgeNode1 = sc.nextInt();
			int edgeNode2 = sc.nextInt();
			edges[edgeNode1].add(edgeNode2);
			edges[edgeNode2].add(edgeNode1);
		}
		sc.close();
		root = new TreeNode(values[0], colors[0], 0); // root is always internal
		addChildren(root, 1);
		return root;
	}

	public static void addChildren(Tree node, Integer nodeNumber) {
		// for all edges coming out of this node
		for (Integer otherNodeNumber : edges[nodeNumber]) {
			Tree otherNode;
			if (edges[otherNodeNumber].size() > 1)
				// new internal node
				otherNode = new TreeNode(values[otherNodeNumber - 1], colors[otherNodeNumber - 1], node.getDepth() + 1);
			else
				// new leaf
				otherNode = new TreeLeaf(values[otherNodeNumber - 1], colors[otherNodeNumber - 1], node.getDepth() + 1);
			((TreeNode) node).addChild(otherNode);
			edges[otherNodeNumber].remove(nodeNumber); // remove reverse edge
			if (otherNode instanceof TreeNod


28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackgroun


8.4-71.6-160-160-160zm0 32c70.7 0 128 57.3 128 128c0 13.9-2.2 27.3-6.3 39.8C337.4 246.3 321.8 256 304 256l-8.4 0c15.2-17 24.4-39.4 24.4-64c0-53-43-96-96-96s-96 43-96 96c0 24.6 9.3 47.1 24.5 64.1c-5.4 9.4-8.5 20.3-8.5 31.9c0 1.4 0 2.7 .1 4C114.8 268.6 96 232.5 96 192c0-70.7 57.3-128 128-128zM208 352l16 0 16 0 64 0 9.6 0C387.8 352 448 412.2 448 486.4c0 14.1-11.5 25.6-25.6 25.6L25.6 512C11.5 512 0 500.5 0 486.4C0 412.2 60.2 352 134.4 352l73.6 0zm105.6 32l-179.2 0C80 384 35.5 426.4 32.2 480l383.6 0c-3.3-53.6-47.8-96-102.2-96z"],"arrows-retweet":[640,512,["retweet-alt"],"f361","M116.7 68.7c6.2-6.2 16.4-6.2 22.6 0l88 88c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L144 118.6 144 336c0 26.5 21.5 48 48 48l144 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-144 0c-44.2 0-80-35.8-80-80l0-217.4L51.3 179.3c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l88-88zM528 393.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-88 88c-6.2 6.2-16.4 6.2-22.6 0l-88-88c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L496 393.4 496 176c0-26.5-21.5-48-48-48l-144 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l144 0c44.2 0 80 35.8 80 80l0 217.4z"],"person-snowboarding":[512,512,[127938,"snowboarding"],"f7ce","M221.3 7.1c-4.9-7.4-14.8-9.3-22.2-4.4s-9.3 14.8-4.4 22.2l40.6 61c7.1 10.6 18 17.9 30.5 20.4l37 7.4-83.3 39.2c-16.8 7.9-27.6 24.8-27.6 43.4l0 83.1-88.9 59.2c-4.2 2.8-6.6 7.2-7.1 11.8l-18.9-7.4c-7.5-2.9-14.2-7.8-19.4-14L28.3 293.8c-5.7-6.8-15.7-7.7-22.5-2s-7.7 15.7-2 22.5l29.5 35.4C41.8 360 52.9 368 65.5 372.9L406.9 506.5c9.3 3.6 19.2 5.5 29.2 5.5l43.9 0c8.8


 *    - Individual users may use this software for personal profit (e.g., trading/investing)
 *      without releasing proprietary strategies.
 *
 *    - Redistribution, public tools, or commercial use require compliance with AGPL
 *      or a commercial license. Contact: license@tradiny.com
 *
 * For full details, see the LICENSE.md file in the root directory of this project.
 */

export class Utils {
  static canvas = document.createElement("canvas");

  static toDate(d) {
    const ds = d.split(/-|\s|:/);
    if (ds.length === 6) {
      return new Date(
        parseInt(ds[0], 10),
        parseInt(ds[1], 10) - 1,
        parseInt(ds[2], 10),
        parseInt(ds[3], 10),
        parseInt(ds[4], 0),
        parseInt(ds[5], 10),
      );
    }
  }

  static toAlphanumeric(name) {
    return name.replace(/[^a-zA-Z0-9]/g, "_");
  }

  static getTextHeight(text, font) {
    const context = Utils.canvas.getContext("2d");
    context.font = font;
    const metrics = context.measureText(text);
    const fontBoundingBoxAscent = metrics.fontBoundingBoxAscent;
    if (fontBoundingBoxAscent !== undefined) {
      return fontBoundingBoxAscent;
    } else {
      console.log("fontBoundingBoxAscent is not supported.");
      return 12;
    }
    return metrics.fontBoundingBoxAscent;
  }
  static getTextWidth(text, font) {
    text = text.toString() + "00";
    const context = Utils.canvas.getContext("2d");
    context.font = font;
    const metrics = context.measureText(text);
    return metrics.width;
  }

  static formatFloat(f, precision) {
    // Ensure precision is a non-negative integer
    if (precision < 0) {
      throw new Error("Precision must be a non-negative integer");
    }

    // Convert the input to a float
    let num = parseFloat(f);
    if (isNaN(num)) {
      return f;
      // throw new Error('Invalid input: not a number');
    }

    // Use toFixed to format the float to the specified precision
    let str = num.toFixed(precision);

    // Remove trailing zeros after the decimal point, if any
    if (str.includes(".")) {
      str = str.replace(/\.?0+$/, "");
    }

    return str;
  }

  static toFixed(x) {
    if (Math.abs(x) < 1.0) {
      var e = parseInt(x.toString().split("e-")[1]);
      if (e) {
        const precision = x.toString().split("e-")[0].length;
        x *= Math.pow(10, e - 1);
        x =
          "0." +
          new Array(e).join("0") +
          x.toString().substring(2, 2 + precision);
      }
    } else {
      var e = parseInt(x.toString().split("+")[1]);
      if (e > 20) {
        e -= 20;
        x /= Math.pow(10, e);
        x += new Array(e + 1).join("0");
      }
    }
    return x;
  }

  static webglColor(identifier) {
    const { r, g, b, opacity } = d3.color(identifier).rgb();
    return [r / 255, g / 255, b / 255, opacity];
  }

  static toFullNumberString(number) {
    // Convert to string and check if it already doesn't use scientific notation
    if (!number.toString().includes("e")) {
      return number.toString();
    }

    // Use a large enough `toFixed` or a loop with incremented decimals
    const places = Math.max(1, Math.abs(Math.floor(Math.log10(number))));
    return number.toFixed(plac


alf("access config loading failed: %v", err)
	}
	if len(ac.Repositories) != 2 && len(ac.Keys) != 2 {
		t.Fatalf("invalid access config (missing items): %+v", ac)
	}
	if _, present := (ac.Repositories["test1.repo.org"].Keys["keyid123"]); !present {
		t.Fatalf("invalid access config (placeholder was not substituted): %+v", ac)
	}
	if _, present := ac.Keys["keyid123"]; !present {
		t.Fatalf("invalid access config (default key was not loaded): %+v", ac)
	}
}

func TestLoadAccessConfigVersion2NoKeys(t *testing.T) {
	ac := emptyAccessConfig()
	rd := strings.NewReader(accessConfigV2NoKeys)
	err := ac.load(rd, mockKeyImporter)
	if err != nil {
		t.Fatalf("access config loading failed: %v", err)
	}
	if len(ac.Repositories) != 1 && len(ac.Keys) != 1 {
		t.Fatalf("invalid access config (missing items): %+v", ac)
	}
	if _, present := (ac.Repositories["test1.repo.org"].Keys["keyid123"]); !present {
		t.Fatalf("invalid access config (placeholder was not substituted): %+v", ac)
	}
	if _, present := ac.Keys["keyid123"]; !present {
		t.Fatalf("invalid access config (default key was not loaded): %+v", ac)
	}
}

func TestKeyCheck(t *testing.T) {
	ac := emptyAccessConfig()
	rd := strings.NewReader(accessConfigV2)
	err := ac.load(rd, mockKeyImporter)
	if err != nil {
		t.Fatalf("access config loading failed: %v", err)
	}
	t.Run("valid", func(t *testing.T) {
		if err := ac.Check("keyid2", "/restricted/to/subdir/below", "test2.repo.org"); err != nil {
			t.Errorf("valid key was rejected: %v", err)
		}
	})
	t.Run("invalid_repo", func(t *testing.T) {
		if ac.Check("keyid2", "/restricted/to/subdir/below", "invalid.repo.org") == nil {
			t.Errorf("invalid repo was accepted")
		}
	})
	t.Run("invalid_key", func(t *testing.T) {
		if ac.Check("badkey", "/restricted/to/subdir/below", "test2.repo.org") == nil {
			t.Errorf("invalid key was accepted")
		}
	})
	t.Run("invalid_path", func(t *testing.T) {
		if ac.Check("keyid2", "/invalid/path", "test2.repo.org") == nil {
			t.Errorf("invalid path was accepted")
		}
	})
}
package backend

import (
	"context"
	"fmt"
	"io"

	gw "github.com/cvmfs/gateway/internal/gateway"
	"github.com/cvmfs/gateway/internal/gateway/receiver"
	stats "github.com/cvmfs/gateway/internal/gateway/statistics"
)

// Services is a container for the various
// backend services
type Services struct {
	Config        gw.Config
	Access        AccessConfig
	DB            *DB
	Pool          *receiver.Pool
	Notifications *NotificationSystem
	StatsMgr      *stats.StatisticsMgr
}

// ActionController contains the various actions that can be performed with the backend
type ActionController interface {
	GetKey(ctx context.Context, keyID string) *KeyConfig
	GetRepo(ctx context.Context, repoName string) (*RepositoryConfig, error)
	GetRepos(ctx context.Context) (map[string]RepositoryConfig, error)
	SetRepoEnabled(ctx context.Context, repository string, enabled bool) error
	NewLease(ctx context.Context, keyID, leasePath, hostname string, protocolVersion int) (st


Of(items: number[], errorMessage?: string)`](#isoneofitems-number-errormessage-string)
    - [`pattern(regExp: RegExp, errorMessage?: string)`](#patternregexp-regexp-errormessage-string-1)
    - [`range(minLength: number, maxLength: number, errorMessage?: string)`](#rangeminlength-number-maxlength-number-errormessage-string)
    - [`min(min: number, errorMessage?: string)`](#minmin-number-errormessage-string)
    - [`max(max: number, errorMessage?: string)`](#maxmax-number-errormessage-string)
  - [ArrayType(errorMessage?: string)](#arraytypeerrormessage-string)
    - [`isRequiredOrEmpty(errorMessage?: string)`](#isrequiredoremptyerrormessage-string)
    - [`rangeLength(minLength: number, maxLength: number, errorMessage?: string)`](#rangelengthminlength-number-maxlength-number-errormessage-string-1)
    - [`minLength(minLength: number, errorMessage?: string)`](#minlengthminlength-number-errormessage-string-1)
    - [`maxLength(maxLength: number, errorMessage?: string)`](#maxlengthmaxlength-number-errormessage-string-1)
    - [`unrepeatable(errorMessage?: string)`](#unrepeatableerrormessage-string)
    - [`of()`](#of)
  - [DateType(errorMessage?: string)](#datetypeerrormessage-string)
    - [`range(min: Date, max: Date, errorMessage?: string)`](#rangemin-date-max-date-errormessage-string)
    - [`min(min: Date, errorMessage?: string)`](#minmin-date-errormessage-string)
    - [`max(max: Date, errorMessage?: string)`](#maxmax-date-errormessage-string)
  - [ObjectType(errorMessage?: string)](#objecttypeerrormessage-string)
    - [`shape(fields: object)`](#shapefields-object)
  - [BooleanType(errorMessage?: string)](#booleantypeerrormessage-string)
- [⚠ Notes](#-notes)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Installation

```
npm install schema-typed --save
```

## Usage

### Getting Started

```js
import { SchemaModel, StringType, DateType, NumberType, ObjectType, ArrayType } from 'schema-typed';

const model = SchemaModel({
  username: StringType().isRequired('Username required'),
  email: StringType().isEmail('Email required'),
  age: NumberType('Age should be a number').range(18, 30, 'Over the age limit'),
  tags: ArrayType().of(StringType('The tag should be a string').isRequired()),
  role: ObjectType().shape({
    name: StringType().isRequired('Name required'),
    permissions: ArrayType().isRequired('Permissions required')
  })
});

const checkResult = model.check({
  username: 'foobar',
  email: 'foo@bar.com',
  age: 40,
  tags: ['Sports', 'Games', 10],
  role: { name: 'administrator' }
});

console.log(checkResult);
```

`checkResult` return structure is:

```js
{
  username: { hasError: false },
  email: { hasError: false },
  age: { hasError: true, errorMessage: 'Over the age limit' },
  tags: {
    hasError: true,
    array: [
      { hasError: false },
      { hasError: false },
      { hasError: true, errorMessage: 'The tag should be a string' }
    ]
  },
  role: {
    hasError: true,
    object: {
      name: { hasError: false },
      permissions: { hasError: true, errorMessage: 'Permissions required' }
    }
  }
};
```

### Multiple verification

```js
StringType()
  .minLength(6, "Can't be less than 6 characters")


 './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  title = 'todolist';
  listatemporaria = "";

  list = {} as Lists;
  lists: Lists[];
  task = {} as Tasks;
  tasks: Tasks[];

  // Essas duas variáveis existem para serem uma lista ou uma tarefa temporária, para que eu possa deletar ou salvar corretamente elas
  lista: Lists[];
  tarefa: Tasks[];

  constructor(private listService: ListsService, private tasksService: TasksService, private changeRef: ChangeDetectorRef) {
    this.lists = [];
    this.tasks = [];
    this.lista = [];
    this.tarefa = [];
  }

  ngOnInit() {
    this.getLists();
    this.getTasks();
  }

  getLists() {
    this.listService.getLists().subscribe((lists: Lists[]) => {
      this.lists = lists;
    });
  }

  //Diferentemente de getLists, aqui em getTasks eu tenho que mudar css e propriedades html caso a tarefa já tenha sido marcada como feita
  //Para isso, toda vez que a página é recarregada ou uma mudança é feita para adicionar uma tarefa, todas as tarefas são checadas para que elas se mantenham com o estilo de "feita".
  //Novamente, usei o detectChanges aqui pois o layout estava carregando muito rápido e o CSS não estava mudando.
  getTasks() {
    this.tasksService.getTasks().subscribe((tasks: Tasks[]) => {
      this.tasks = tasks;
      this.changeRef.detectChanges();

      for(var i = 0; i < this.tasks.length; ++i){
        const label = document.getElementById("label" + tasks[i].id);
        const checkbox = document.getElementById("checkbox" + tasks[i].id);

        if(tasks[i].checked == true){
          label!.style.color = 'green';
          checkbox!.setAttribute("checked", "checked");
        }
        else{
          label!.style.color = 'black';
        }
      }
    });
  }

  //Salva uma nova lista e limpa o form, além de buscar novamente todas as listas
  saveList(form: NgForm){
    //Antes de adicionar, o ChangeDetector, o sistema salvava uma lista nova, sem título nenhum
    this.changeRef.detectChanges();
    //Verificação padrão para que um título não possa ser adicionado vazio
    if(this.list.title == null){
      alert("O título não pode ser vazio!");
    }else{
    this.listService.saveList(this.list).subscribe(() => {
      this.cleanForm(form);
    });}
  }

  //Para salvar uma task, primeiro eu transformo o valor pego no html para string e coloco ele dentro da variável lista temporaria.
  //Após isso, utilizo o serviço para pegar a lista que foi selecionada no html. Com a lista em mãos, coloco ela dentro da variável lista para conseguir utilizá-la.
  //Com isso feito, guardo o id da lista buscada dentro de task e por último, chamo o serviço de salvar a task.
  saveTask(form: NgForm){
    //Verificação padrão para que um título ou um listId não possam ser adicionados vazios
    if(this.task.listId == null || this.task.title == null){
      alert("O título ou a lista não podem ser vazios!");
    }
    else{
    this.listatemporaria = this.task.listId.toString();
    this.listService.getListByTitle(this.listatemporaria).subscribe


();
        m.put("id", 1);
        m.put("name", "lisi");
        assertThat(redisJSON.set(key, SetArgs.Builder.create(".", GsonUtils.toJson(m)))).isEqualTo("OK");

        assertThat(redisJSON.strAppend(key, ".name", "123")).isEqualTo(7);
        Map<String, Object> actual = redisJSON.get(key, Map.class, new GetArgs().path(".").indent("\t").newLine("\n").space(" "));
        assertThat(actual).isNotNull().containsEntry("name", "lisi123");

        assertThat(redisJSON.strLen(key, ".name")).isEqualTo("lisi123".length());
    }

    @Test
    public void testArr() {
        RedisJSON redisJSON = getRedisJSON();
        String key = "foo";
        Map<String, Object> m = new HashMap<>();
        m.put("id", 1);
        m.put("names", new ArrayList<>());
        assertThat(redisJSON.set(key, SetArgs.Builder.create(".", GsonUtils.toJson(m)))).isEqualTo("OK");

        assertThat(redisJSON.arrAppend(key, ".names", "zhansan")).isEqualTo(1);
        assertThat(redisJSON.arrAppend(key, ".names", "lisi")).isEqualTo(2);

        Map<String, Object> actual = redisJSON.get(key, Map.class, new GetArgs().path(".").indent("\t").newLine("\n").space(" "));
        assertThat(actual).isNotNull();
        List<String> actualList = (List<String>) actual.get("names");
        assertThat(actualList).containsExactly("zhansan", "lisi");

        assertThat(redisJSON.arrIndex(key, ".names", "lisi", 0, 2)).isEqualTo(1);

        assertThat(redisJSON.arrLen(key, ".names")).isEqualTo(2);

        assertThat(redisJSON.arrTrim(key, ".names", 1, 1)).isEqualTo(1);

        actual = redisJSON.get(key, Map.class, new GetArgs().path(".").indent("\t").newLine("\n").space(" "));
        actualList = (List<String>) actual.get("names");
        assertThat(actualList).containsExactly("lisi");

        assertThat(redisJSON.arrInsert(key, ".names", 0, "wangwu")).isEqualTo(2);
        actual = redisJSON.get(key, Map.class, new GetArgs().path(".").indent("\t").newLine("\n").space(" "));
        actualList = (List<String>) actual.get("names");
        assertThat(actualList).containsExactly("wangwu", "lisi");

        assertThat(redisJSON.arrLen(key, ".names")).isEqualTo(2);
        assertThat(redisJSON.arrPop(key, ".names", String.class, 0)).isEqualTo("wangwu");
        assertThat(redisJSON.arrLen(key, ".names")).isEqualTo(1);
    }

    @Test
    public void testObjLen() {
        RedisJSON redisJSON = getRedisJSON();
        String key = "foo";
        Map<String, Object> m = new HashMap<>();
        m.put("id", 1);
        m.put("names", new ArrayList<>());
        assertThat(redisJSON.set(key, SetArgs.Builder.create(".", GsonUtils.toJson(m)))).isEqualTo("OK");

        assertThat(redisJSON.objLen(key, ".")).isEqualTo(2);
        assertThat(redisJSON.objLen("not exist", ".")).isEqualTo(0);
    }

    @Test
    public void testObjKeys() {
        Map<String, Object> m = new HashMap<>();
        m.put("a", Arrays.asList(3));
        Map<String, Object> nestedMap = new HashMap<>();
        Map<String, Object> a = new HashMap<>();
        a.put("b",


? domain,
  }) async {
    final headers = <String, String>{
      'Content-Type': 'application/x-amz-json-1.1',
      'X-Amz-Target': 'AmazonPersonalize.CreateSchema'
    };
    final jsonResponse = await _protocol.send(
      method: 'POST',
      requestUri: '/',
      exceptionFnMap: _exceptionFns,
      // TODO queryParams
      headers: headers,
      payload: {
        'name': name,
        'schema': schema,
        if (domain != null) 'domain': domain.value,
      },
    );

    return CreateSchemaResponse.fromJson(jsonResponse.body);
  }

  /// <important>
  /// By default, all new solutions use automatic training. With automatic
  /// training, you incur training costs while your solution is active. To avoid
  /// unnecessary costs, when you are finished you can update
  /// the solution to turn off automatic training. For information about
  /// training costs, see Amazon Personalize
  /// pricing.
  /// </important>
  /// Creates the configuration for training a model (creating a solution
  /// version). This configuration includes the recipe to use for model training
  /// and optional training configuration, such as columns to use in training
  /// and feature transformation parameters. For more information about
  /// configuring a solution, see Creating
  /// and configuring a solution.
  ///
  /// By default, new solutions use automatic training to create solution
  /// versions every 7 days. You can change the training frequency. Automatic
  /// solution version creation starts within one hour after the solution is
  /// ACTIVE. If you manually create a solution version within the hour, the
  /// solution skips the first automatic training. For more information, see Configuring
  /// automatic training.
  ///
  /// To turn off automatic training, set performAutoTraining to
  /// false. If you turn off automatic training, you must manually create a
  /// solution version by calling the CreateSolutionVersion
  /// operation.
  ///
  /// After training starts, you can get the solution version's Amazon Resource
  /// Name (ARN) with the ListSolutionVersions
  /// API operation. To get its status, use the DescribeSolutionVersion.
  ///
  /// After training completes you can evaluate model accuracy by calling GetSolutionMetrics.
  /// When you are satisfied with the solution version, you deploy it using CreateCampaign.
  /// The campaign provides recommendations to a client through the GetReco


                moveTo(0f, 0f)
                lineTo(500f, 0f)
                lineTo(500f, 500f)
                lineTo(0f, 500f)
                lineTo(0f, 0f)
                close()
            }
            path(fill = SolidColor(Color.White), stroke = SolidColor(Color.Blue), strokeLineWidth = strokeLineWidth0) {
                moveTo(283.91f, 100f)
                curveTo(330.2522f, 155.2285f, 323.0484f, 200f, 267.8199f, 200f)
                curveTo(212.5914f, 200f, 130.2522f, 155.2285f, 83.91f, 100f)
                curveTo(37.5678f, 44.7715f, 44.7715f, 0f, 100f, 0f)
                curveTo(155.2285f, 0f, 237.5678f, 44.7715f, 283.91f, 100f)
                close()
            }
        }.build()
        return _transform_circle!!
    }

private var _transform_circle: ImageVector? = null

@Preview
@Composable
private fun transform_circlePreview() {
    Image(transform_circle, null)
}

@Preview(showBackground = true)
@Composable
private fun transform_circleBackgroundPreview() {
    Image(transform_circle, null)
}
/*
 * Forked from:
 * https://android.googlesource.com/platform//frameworks/support/+/7b4652f32f5867e5bbe53dcb20ec95c52f3fe979/compose/material/material/icons/generator/src/main/kotlin/androidx/compose/material/icons/generator/IconTheme.kt
 *
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.github.irgaly.compose.icons.xml

import java.util.Locale

/**
 * Enum representing the different themes for Material icons.
 *
 * @property themePackageName the lower case name used for package names and in xml files
 * @property themeClassName the CameCase name used for the theme objects
 */
internal enum class IconTheme(val themePackageName: String, val themeClassName: String) {
    Filled("filled", "Filled"),
    Outlined("outlined", "Outlined"),
    Rounded("rounded", "Rounded"),
    TwoTone("twotone", "TwoTone"),
    Sharp("sharp", "Sharp")
}

/**
 * Returns the matching [IconTheme] from [this] [IconTheme.themePackageName].
 */
internal fun String.toIconTheme() = requireNotNull(
    IconTheme.values().find {
        it.themePackageName == this
    }
) { "No matching theme found" }

/**
 * The ClassName representing this [IconTheme] object, so we can generate extension properties on
 * the object.
 *
 * @see [autoMirroredClassName]
 */
internal val IconTheme.className
    get() =
        PackageNames.MaterialIconsPackage.className("Icons", themeClassName)

/**
 * The ClassName representing this [IconTheme] object so we can generate extension properties on the
 * object when used for auto-mirrored icons.
 *
 * @see [className]
 */
internal val IconTheme.autoMirroredClassName
    get() =
        PackageNames.MaterialIconsPackage.className("Icons", AutoMirroredName, themeClassName)

internal const val AutoMirroredName = "AutoMirrored"
internal val AutoMirroredPackageName = AutoMirroredName.lowercase(Locale.ROOT)
/*
 * Forked from:
 * https://android.googlesource.com/platform//framewor


height: 1.5;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased; }

.config {
  overflow: hidden; }

/**
 * Basic styles for headings and paragraph
 */
h1, h2, h3, h4, h5, h6 {
  padding: 0;
  margin: 0; }

h1 {
  font-size: 50px;
  line-height: 50px; }

h2 {
  font-size: 32px;
  line-height: 46px; }

h3 {
  font-size: 18px;
  line-height: 32px; }

h4 {
  font-size: 16px;
  line-height: 30px; }

h5 {
  font-size: 15px;
  line-height: 30px; }

p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 24px; }

/**
 * Basic styles for links
 */
a, a:hover, a:focus {
  outline: none;
  text-decoration: none;
  cursor: pointer; }

/**
 * Basic style for image element
 */
img {
  border: 0; }
  img:focus {
    outline: none; }

/**
 * Basic style for iframe element
 */
iframe {
  border: none;
  overflow: hidden; }

iframe[src*="soundcloud"] {
  width: 100%; }

/*--------------------------------------------------------------
Box Module
--------------------------------------------------------------*/
/* Body Element */
@media (min-width: 576px) {
  html.boxed body {
    background-color: #ffffff;
    margin: 0 auto; } }

@media (min-width: 576px) {
  html.boxed body {
    max-width: 546px; } }

@media (min-width: 791px) {
  html.boxed body {
    max-width: 770px; } }

@media (min-width: 1025px) {
  html.boxed body {
    max-width: 990px; } }

@media (min-width: 1230px) {
  html.boxed body {
    max-width: 1200px; } }

/* Header with container Element */
@media (max-width: 1024px) {
  html.boxed header .container {
    padding-left: 20px;
    padding-right: 20px; } }

@media (min-width: 1025px) {
  html.boxed header .container {
    padding-left: 40px;
    padding-right: 40px; } }

/* Header & Footer Element */
@media (min-width: 576px) {
  html.boxed header, html.boxed footer {
    margin-right: auto;
    margin-left: auto;
    width: 100%; } }

@media (min-width: 576px) {
  html.boxed header, html.boxed footer {
    max-width: 456px; } }

@media (min-width: 791px) {
  html.boxed header, html.boxed footer {
    max-width: 770px; } }

@media (min-width: 1025px) {
  html.boxed header, html.boxed footer {
    max-width: 990px; } }

@media (min-width: 1230px) {
  html.boxed header, html.boxed footer {
    max-width: 1200px; } }

/* App Content exclude Header & Footer */
@media (min-width: 576px) {
  html.boxed .app-content {
    margin: 0 auto;
    overflow: hidden; } }

@media (min-width: 576px) {
  html.boxed .app-content {
    max-width: 546px; } }

@media (min-width: 791px) {
  html.boxed .app-content {
    max-width: 770px; } }

@media (min-width: 1025px) {
  html.boxed .app-content {
    max-width: 990px; } }

@media (min-width: 1230px) {
  html.boxed .app-content {
    max-width: 1200px; } }

/* App Content with container */
@


from __future__ import annotations

from abc import abstractmethod
from typing import TYPE_CHECKING

from daft.expressions import ExpressionsProjection
from daft.logical.schema import Schema

if TYPE_CHECKING:
    from daft.recordbatch import MicroPartition

class MapPartitionOp:
    @abstractmethod
    def get_output_schema(self) -> Schema:
        """Returns the output schema after running this MapPartitionOp."""

    @abstractmethod
    def run(self, input_partition: MicroPartition) -> MicroPartition:
        """Runs this MapPartitionOp on the supplied vPartition."""

class ExplodeOp(MapPartitionOp):
    input_schema: Schema
    explode_columns: ExpressionsProjection

    def __init__(self, input_schema: Schema, explode_columns: ExpressionsProjection) -> None:
        super().__init__()
        self.input_schema = input_schema
        output_fields = []
        explode_columns = ExpressionsProjection([c._explode() for c in explode_columns])
        explode_schema = explode_columns.resolve_schema(input_schema)
        for f in input_schema:
            if f.name in explode_schema.column_names():
                output_fields.append(explode_schema[f.name])
            else:
                output_fields.append(f)

        self.output_schema = Schema._from_field_name_and_types([(f.name, f.dtype) for f in output_fields])
        self.explode_columns = explode_columns

    def get_output_schema(self) -> Schema:
        return self.output_schema

    def run(self, input_partition: MicroPartition) -> MicroPartition:
        return input_partition.explode(self.explode_columns)


}

  getElementColorImg(elem: string): Path {
    return `${ELEMENT_PATH_COLOR}${elem.toLocaleLowerCase()}.png`;
  }

  getRoleIcon(role: string): Path {
    return `${ROLES_PATH}${role.toLocaleLowerCase()}.png`;
  }

  getNumberOfMonstersPerElement(elem: ElemType): number {
    return this.monsters.filter(m => m.elements.includes(elem)).length;
  }

  getNumberOfMonstersPerRole(role: Role): number {
    return this.monsters.filter(m => m.role === role).length;
  }

  getNumberOfMonsterComplexity(num: number): number {
    return this.monsters.filter(m => m.complexity === num).length;
  }

  getNumberOfAttacksPerElement(elem: ElemType): number {
    let num = 0;
    this.monsters.forEach(m => {
      m.actions.forEach(a => {
        if ((a.attack !== undefined || a.attack !== null) && a.element === elem) {
          num++;
        }
      });
    });
    return num;
  }

  getTotalModifiersPerElement(elem: ElemType): number {
    let total = 0;
    // const index = getElementIndex(elem);
    // this.monsters.forEach(m => {
    //   m.actions.forEach(a => {
    //     total += a.modifiers[index];
    //   });
    // });
    return total;
  }

}
import RootStore, { RootContext } from '../../store/RootStore';
import { useContext } from 'react';

interface Store {
  rootStore: RootStore;
}

// TODO: store 생성 시 이곳에서 return 부분에 추가하면 됩니다!
const useStore = (): Store => {
  return { rootStore: useContext(RootContext) };
};

export default useStore;
import { TodoListItemInfo, QueueData } from './interfaces';
import utils from '../modules/utils';

class ModuleStore {
    constructor() {
        this.initTodoList();
        this.initQueueList();
    }

    private readonly todoKey = 'todo';

    public todoId = 0;

    public todoList: Array<TodoListItemInfo> = [];

    /** 初始化列表数据 */
    private initTodoList() {
        this.todoList = this.fetchTodoList();
        const list = this.todoList.map(item => item.id);
        if (list.length > 0) {
            this.todoId = Math.max(...list);
        }
    }

    private fetchTodoList() {
        let list: any = localStorage.getItem(this.todoKey);
        if (list) {
            list = JSON.parse(list);
        } else {
            list = [];
        }
        return list;
    }

    /** 储存 todolist 数据 */
    public saveTodoList() {
        localStorage.setItem(this.todoKey, JSON.stringify(this.todoList));
    }

    /** 排序过滤数据 */
    public queueData: QueueData = {
        index: 0,
        menu: [
            {
                id: 0,
                text: '高到低'
            },{
                id: 1,
                text: '低到高'
            },{
                id: 2,
                text: '随机'
            }
        ],
        seachText: '',
        queueList: [],
        goodsList: []
    }

    private initQueueList() {
        const list = [];
        for (let i = 0; i < 20; i++) {
            const num = utils.ranInt(1000, 11000) / 100;
            const index = i + 1;
            list.push({
                id: index,
                pric


val selectedAlbumIds = awaitItem().selectedAlbumIds
            assertThat(expectedAlbum.id !in selectedAlbumIds).isTrue()
        }
    }

    @Test
    fun `test that album is cleared properly`() = runTest {
        // given
        val expectedAlbum1 = Album.UserAlbum(
            id = AlbumId(1L),
            title = "Album 1",
            cover = null,
            creationTime = 0L,
            modificationTime = 0L,
            isExported = false,
        )

        val expectedAlbum2 = Album.UserAlbum(
            id = AlbumId(2L),
            title = "Album 2",
            cover = null,
            creationTime = 0L,
            modificationTime = 0L,
            isExported = false,
        )

        // when
        underTest.selectAlbum(expectedAlbum1)
        underTest.selectAlbum(expectedAlbum2)
        underTest.clearAlbumSelection()

        // then
        underTest.state.test {
            val selectedAlbumIds = awaitItem().selectedAlbumIds
            assertThat(selectedAlbumIds.isEmpty()).isTrue()
        }
    }

    @Test
    fun `test that refresh album works correctly`() = runTest {
        // given
        underTest.systemAlbumPhotos[Album.FavouriteAlbum] = listOf(
            createImage(id = 1L),
            createImage(id = 2L),
            createImage(id = 3L),
        )

        underTest.userAlbums[AlbumId(1L)] = createUserAlbum()
        underTest.userAlbumPhotos[AlbumId(1L)] = listOf(
            createImage(id = 4L),
            createImage(id = 5L),
            createImage(id = 6L),
        )

        underTest.userAlbums[AlbumId(2L)] = createUserAlbum()
        underTest.userAlbumPhotos[AlbumId(2L)] = listOf(
            createImage(id = 7L),
            createImage(id = 8L),
            createImage(id = 9L),
        )

        // when
        underTest.refreshAlbums()

        // then
        underTest.state.test {
            val albums = awaitItem().albums
            assertThat(albums.size).isEqualTo(3)
        }
    }

    @Test
    fun `test that showHiddenItems and accountDetail are fetched properly`() = runTest {
        // given
        wheneverBlocking { getFeatureFlagValueUseCase(ApiFeatures.HiddenNodesInternalRelease) }.thenReturn(
            true
        )
        initUnderTest()
        advanceUntilIdle()

        // then
        underTest.state.test {
            val accountType = awaitItem().accountType
            assertThat(accountType).isEqualTo(AccountType.FREE)
            assertThat(underTest.showHiddenItems).isTrue()
        }
    }

    @Test
    fun `test that on pagination enabled should invoke use case with correct parameters`() =
        runTest {
            val isPaginationEnabled = true
            val defaultAlbums: Map<Album, PhotoPredicate> = mapOf(
                Album.FavouriteAlbum to { false },
                Album.GifAlbum to { false },
                Album.RawAlbum to { false },
            )

            whenever(getDefaultAlbumsMapUseCase()).thenReturn(defaultAlbums)
            whenever(getFeatureFlagValueUseCase(AppFeatures.TimelinePhotosPagination)).thenReturn(
                isPaginationEnabled
            )

            initUnderTest()
            advanceUntilIdle()

            verify(getDefaultAlbumPhotos).invoke(
                isPaginationEnabled,
                defaultAlbums.values.toList()
            )
        }

    private fun createUserAlbum(
        id: AlbumId = AlbumId(0L),
        title: String = "",
        cover: Photo? = null,
        creationTime: Long = 0L,
        modificationTime: Long = 0L,
        isExported: Boolean = false,
    ): Album.UserAlbum =


 workingDirectory: packageDir);
}
// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:pub/src/exit_codes.dart' as exit_codes;
import 'package:test/test.dart';

import '../../descriptor.dart' as d;
import '../../test_pub.dart';

void main() {
  test('cannot use both --path and --git-<option> flags', () async {
    ensureGit();

    await d.git('foo.git', [
      d.libDir('foo'),
      d.libPubspec('foo', '1.0.0'),
    ]).create();
    await d.dir('bar', [
      d.libDir('bar'),
      d.libPubspec('foo', '0.0.1'),
    ]).create();

    await d.appDir(dependencies: {}).create();

    await pubAdd(
      args: ['foo', '--git-url', '../foo.git', '--path', '../bar'],
      error: allOf([
        contains(
          'Packages can only have one source, pub add flags '
          '"--git-url" and "--path" are',
        ),
        contains('conflicting.'),
      ]),
      exitCode: exit_codes.USAGE,
    );

    await d.appDir(dependencies: {}).validate();
    await d.dir(appPath, [
      d.nothing('.dart_tool/package_config.json'),
      d.nothing('pubspec.lock'),
    ]).validate();
  });

  test('cannot use both --path and --host-<option> flags', () async {
    // Make the default server serve errors. Only the custom server should
    // be accessed.
    (await servePackages()).serveErrors();

    final server = await startPackageServer();
    server.serve('foo', '1.2.3');

    await d.dir('bar', [
      d.libDir('bar'),
      d.libPubspec('foo', '0.0.1'),
    ]).create();
    await d.appDir(dependencies: {}).create();

    await pubAdd(
      args: [
        'foo',
        '--hosted-url',
        'http://localhost:${server.port}',
        '--path',
        '../bar',
      ],
      error: allOf([
        contains(
          'Packages can only have one source, pub add flags '
          '"--hosted-url" and "--path" are',
        ),
        contains('conflicting.'),
      ]),
      exitCode: exit_codes.USAGE,
    );

    await d.appDir(dependencies: {}).validate();
    await d.dir(appPath, [
      d.nothing('.dart_tool/package_config.json'),
      d.nothing('pubspec.lock'),
    ]).validate();
  });

  test('cannot use both --hosted-url and --git-<option> flags', () async {
    // Make the default server serve errors. Only the custom server should
    // be accessed.
    (await servePackages()).serveErrors();

    final server = await startPackageServer();
    server.serve('foo', '1.2.3');

    ensureGit();

    await d.git('foo.git', [
      d.libDir('foo'),
      d.libPubspec('foo', '1.0.0'),
    ]).create();
    await d.appDir(dependencies: {}).create();

    await pubAdd(
      args: [
        'foo',
        '--hosted-url',
        'http://localhost:${server.port}',
        '--git-url',
        '../foo.git',
      ],
      error: allOf([
        contains(
          'Packages can only have one source, pub add flags '
          '"--git-url


比RGB值
def is_similar(image1,image2,x,y):
    pass
    #获取指定位置的RGB值
    pixel1=image1.getpixel((x,y))
    pixel2=image2.getpixel((x,y))
    for i in range(0,3):
        # 如果相差超过50则就认为找到了缺口的位置
        if abs(pixel1[i]-pixel2[i])>=50:
            return False
    return True

#计算缺口的位置
def get_diff_location(image1,image2):
    i=0
    # 两张原始图的大小都是相同的260*116
    # 那就通过两个for循环依次对比每个像素点的RGB值
    # 如果相差超过50则就认为找到了缺口的位置
    for i in range(0,260):
        for j in range(0,116):
            if is_similar(image1,image2,i,j)==False:
                return  i

#根据缺口的位置模拟x轴移动的轨迹
def get_track(length):
    pass
    list=[]
    #间隔通过随机范围函数来获得,每次移动一步或者两步
    x=random.randint(1,3)
    #生成轨迹并保存到list内
    while length-x>=5:
        list.append(x)
        length=length-x
        x=random.randint(1,3)
    #最后五步都是一步步移动
    for i in range(length):
        list.append(1)
    return list

#滑动验证码破解程序
def main():
    #打开火狐浏览器
    driver = webdriver.Firefox()
    #用火狐浏览器打开网页
    driver.get("http://www.geetest.com/exp_embed")
    #等待页面的上元素刷新出来
    WebDriverWait(driver, 30).until(lambda the_driver: the_driver.find_element_by_xpath("//div[@class="gt_slider_knob gt_show"]").is_displayed())
    WebDriverWait(driver, 30).until(lambda the_driver: the_driver.find_element_by_xpath("//div[@class="gt_cut_bg gt_show"]").is_displayed())
    WebDriverWait(driver, 30).until(lambda the_driver: the_driver.find_element_by_xpath("//div[@class="gt_cut_fullbg gt_show"]").is_displayed())
    #下载图片
    image1=get_image(driver, "//div[@class="gt_cut_bg gt_show"]/div")
    image2=get_image(driver, "//div[@class="gt_cut_fullbg gt_show"]/div")
    #计算缺口位置
    loc=get_diff_location(image1, image2)
    #生成x的移动轨迹点
    track_list=get_track(loc)
    #找到滑动的圆球find_element_by_xpath('//div[@class="gt_slider_knob gt_show"]')
    element=driver.find_element_by_xpath("//div[@class="gt_slider_knob gt_show"]")
    location=element.location
    #获得滑动圆球的高度
    y=location["y"]
    #鼠标点击元素并按住不放
    print ("第一步,点击元素")
    ActionChains(driver).click_and_hold(on_element=element).perform()
    time.sleep(0.15)
    print ("第二步，拖动元素")
    track_string = ""


 = &head;
    start_guard.reset();
    goto retry;
  }

  for (;;) {
    // (5) - this acquire-load synchronizes-with the release-CAS (7, 8, 10, 13)
    if (!info.cur.acquire_if_equal(*info.prev, info.next, std::memory_order_acquire)) {
      goto retry;
    }

    if (!info.cur) {
      return false;
    }

    info.next = info.cur->next.load(std::memory_order_relaxed);
    if (info.next.mark() != 0) {
      // Node *cur is marked for deletion -> update the link and retire the element

      // (6) - this acquire-load synchronizes-with the release-CAS (7, 8, 10, 13)
      info.next = info.cur->next.load(std::memory_order_acquire).get();

      // Try to splice out node
      marked_ptr expected = info.cur.get();
      // (7) - this release-CAS synchronizes with the acquire-load (1, 2, 3, 4, 5, 6, 11)
      //       and the require-CAS (9, 12)
      //       it is the head of a potential release sequence containing (9, 12)
      if (!info.prev->compare_exchange_weak(
            expected, info.next, std::memory_order_release, std::memory_order_relaxed)) {
        backoff();
        goto retry;
      }
      info.cur.reclaim();
    } else {
      if (info.prev->load(std::memory_order_relaxed) != info.cur.get()) {
        goto retry; // cur might be cut from list.
      }

      const Key& ckey = info.cur->key;
      compare compare;
      if (!compare(ckey, key)) {
        return !compare(key, ckey);
      }

      info.prev = &info.cur->next;
      std::swap(info.save, info.cur);
    }
  }
}

template <class Key, class... Policies>
bool harris_michael_list_based_set<Key, Policies...>::contains(const Key& key) {
  find_info info{&head};
  backoff backoff;
  return find(key, info, backoff);
}

template <class Key, class... Policies>
auto harris_michael_list_based_set<Key, Policies...>::find(const Key& key) -> iterator {
  find_info info{&head};
  backoff backoff;
  if (find(key, info, backoff)) {
    return iterator(*this, std::move(info));
  }
  return end();
}

template <class Key, class... Policies>
template <class... Args>
bool harris_michael_list_based_set<Key, Policies...>::emplace(Args&&... args) {
  auto result = emplace_or_get(std::forward<Args>(args)...);
  return result.second;
}

template <class Key, class... Policies>
template <class... Args>
auto harris_michael_list_based_set<Key, Policies...>::emplace_or_get(Args&&... args) -> std::pair<iterator, bool> {
  node* n = new node(std::forward<Args>(args)...);
  find_info info{&head};
  backoff backoff;
  for (;;) {
    if (find(n->key, info, backoff)) {
      delete n;
      return {iterator(*this, std::move(info)), false};
    }

    // Try to install new node
    marked_ptr expected = info.cur.get();
    n->next.store(expected, std::memory_order_relaxed);
    guard_ptr new_guard(n);

    // (8) - this release-CAS synchronizes with the acquire-load (1, 2, 3, 4, 5, 6, 11)
    //       and the acquire-CAS (9, 12)
    //       it is the head of a potential release sequence containing (9, 12)
    if (info.prev->


/**
 * *****************************************************************************
 * File name:   ac_memory.h
 *
 * @brief 自定义内存管理类
 *
 *
 * Created by Aegon on 2023-04-18
 * Copyright © 2023 House Targaryen. All rights reserved.
 * *****************************************************************************
 */
#ifndef ACINFER_ULTRA_TRT_MEMORY_H
#define ACINFER_ULTRA_TRT_MEMORY_H

#include <memory>

#define CURRENT_DEVICE_ID -1

namespace TRT {

    class CudaDeviceGuard {
    public:
        CudaDeviceGuard(int device_id);
        ~CudaDeviceGuard();
    private:
        int old_device_;
    };

    class Memory {
    public:
        Memory(int device_id = CURRENT_DEVICE_ID);
        Memory(void* cpu, size_t cpu_size, void* gpu, size_t gpu_size);

        ~Memory();

        void* cpu(size_t size);
        void* gpu(size_t size);

        void release_gpu();
        void release_cpu();
        void release_all();

        inline bool owner_gpu() const{return owner_gpu_;}
        inline bool owner_cpu() const{return owner_cpu_;}

        inline size_t cpu_size() const{return cpu_size_;}
        inline size_t gpu_size() const{return gpu_size_;}

        inline int device_id() const{return device_id_;}

        inline void* cpu() { return cpu_; }
        inline void* gpu() { return gpu_; }

        void reference_data(void* cpu, size_t cpu_size, void* gpu, size_t gpu_size);

    private:
        void* cpu_ = nullptr;
        void* gpu_ = nullptr;

        size_t cpu_size_ = 0;
        size_t gpu_size_ = 0;

        bool owner_cpu_ = true;
        bool owner_gpu_ = true;

        int device_id_ = 0;
    };

} // namespace TRT

#endif // ACINFER_ULTRA_TRT_MEMORY_H


{
				FCoverageVertex *v1 = &shape[i];
				FCoverageVertex *v2 = &shape[(i+1) % shape.Size()];
				FCoverageLine vl = {{*v1, *v2}};

				double dist_v1 = PartitionDistance(v1, bsp);
				double dist_v2 = PartitionDistance(v2, bsp);

				if(dist_v1 <= COVERAGE_EPSILON)
				{
					if (dist_v2 <= COVERAGE_EPSILON)
					{
						lists[centerside].Push(vl);
					}
					else
					{
						int side = PointOnSide(v2, bsp);
						lists[side].Push(vl);
					}
				}
				else if (dist_v2 <= COVERAGE_EPSILON)
				{
					int side = PointOnSide(v1, bsp);
					lists[side].Push(vl);
				}
				else
				{
					int side1 = PointOnSide(v1, bsp);
					int side2 = PointOnSide(v2, bsp);

					if(side1 != side2)
					{
						// if the partition line crosses this seg, we must split it.

						FCoverageVertex vert;

						if (GetIntersection(v1, v2, bsp, &vert))
						{
							lists[0].Push(vl);
							lists[1].Push(vl);
							lists[side1].Last().v[1] = vert;
							lists[side2].Last().v[0] = vert;
						}
						else
						{
							// should never happen
							lists[side1].Push(vl);
						}
					}
					else
					{
						// both points on the same side.
						lists[side1].Push(vl);
					}
				}
			}
			if (lists[1].Size() == 0)
			{
				CollectNode(bsp->children[0], shape);
			}
			else if (lists[0].Size() == 0)
			{
				CollectNode(bsp->children[1], shape);
			}
			else
			{
				// copy the static arrays into local ones
				TArray<FCoverageVertex> locallists[2];

				for(int l=0;l<2;l++)
				{
					for (unsigned i=0;i<lists[l].Size(); i++)
					{
						locallists[l].Push(lists[l][i].v[0]);
						unsigned i1= (i+1)%lists[l].Size();
						if (lists[l][i1].v[0] != lists[l][i].v[1])
						{
							locallists[l].Push(lists[l][i].v[1]);
						}
					}
				}

				CollectNode(bsp->children[0], locallists[0]);
				CollectNode(bsp->children[1], locallists[1]);
			}
		}
		else
		{
			// we reached a subsector so we can link the node with this subsector
			subsector_t *sub = (subsector_t *)((uint8_t *)node - 1);
			collect.Push(int(sub->Index()));
		}
	}
};

//==========================================================================
//
// Calculate portal coverage for a single subsector
// This data is used by the clipper to free up the ranges covered by a portal.
//
// This also gets called by the render hack code because ZDoom was really lax
// with its stacked sector things and allowed partial tagging of affected sectors
// Any such sector will only be found during rendering and must create its
// coverage info then.
//
//==========================================================================

void BuildPortalCoverage(FLevelLocals *Level, FPortalCoverage *coverage, subsector_t *subsector, const DVector2 &displacement)
{
	TArray<FCoverageVertex> shape;
	double centerx=0, centery=0;

	shape.Resize(subsector->numlines);
	for(unsigned i=0; i<subsector->numlines; i++)
	{
		centerx += (shape[i].x = FLOAT2FIXED(subsector->firstline[i].v1->fX() + displacement.X));


VYLkFQSS5EZXZpY2UuV2lmaVNlbGZUZXN0LlRlc3RSZXN1bHRSB2JsMlByb2QaYQoKVGVzdFJl'
    'c3VsdBISCgRuYW1lGAEgASgJUgRuYW1lEhgKB3N1Y2Nlc3MYAiABKAhSB3N1Y2Nlc3MSJQoOZm'
    'FpbHVyZV9yZWFzb24YAyABKAlSDWZhaWx1cmVSZWFzb24=');

@$core.Deprecated('Use wifiGuestInfoResponseDescriptor instead')
const WifiGuestInfoResponse$json = {
  '1': 'WifiGuestInfoResponse',
  '2': [
    {'1': 'is_guest', '3': 1, '4': 1, '5': 8, '10': 'isGuest'},
    {'1': 'is_online', '3': 2, '4': 1, '5': 8, '10': 'isOnline'},
    {'1': 'router_hardware_version', '3': 3, '4': 1, '5': 9, '10': 'routerHardwareVersion'},
    {'1': 'dish_hardware_version', '3': 4, '4': 1, '5': 9, '10': 'dishHardwareVersion'},
    {'1': 'is_router_aviation_conformed', '3': 5, '4': 1, '5': 8, '10': 'isRouterAviationConformed'},
  ],
};

/// Descriptor for `WifiGuestInfoResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List wifiGuestInfoResponseDescriptor = $convert.base64Decode(
    'ChVXaWZpR3Vlc3RJbmZvUmVzcG9uc2USGQoIaXNfZ3Vlc3QYASABKAhSB2lzR3Vlc3QSGwoJaX'
    'Nfb25saW5lGAIgASgIUghpc09ubGluZRI2Chdyb3V0ZXJfaGFyZHdhcmVfdmVyc2lvbhgDIAEo'
    'CVIVcm91dGVySGFyZHdhcmVWZXJzaW9uEjIKFWRpc2hfaGFyZHdhcmVfdmVyc2lvbhgEIAEoCV'
    'ITZGlzaEhhcmR3YXJlVmVyc2lvbhI/Chxpc19yb3V0ZXJfYXZpYXRpb25fY29uZm9ybWVkGAUg'
    'ASgIUhlpc1JvdXRlckF2aWF0aW9uQ29uZm9ybWVk');

@$core.Deprecated('Use wifiRfTestResponseDescriptor instead')
const WifiRfTestResponse$json = {
  '1': 'WifiRfTestResponse',
  '2': [
    {'1': 'report', '3': 1, '4': 1, '5': 9, '10': 'report'},
  ],
};

/// Descriptor for `WifiRfTestResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List wifiRfTestResponseDescriptor = $convert.base64Decode(
    'ChJXaWZpUmZUZXN0UmVzcG9uc2USFgoGcmVwb3J0GAEgASgJUgZyZXBvcnQ=');

@$core.Deprecated('Use wifiGetPersistentStatsResponseDescriptor instead')
const WifiGetPersistentStatsResponse$json = {
  '1': 'WifiGetPersistentStatsResponse',
  '2': [
    {'1': 'stats', '3': 1, '4': 1, '5': 11, '6': '.SpaceX.API.Device.WifiPersistentStats', '10': 'stats'},
  ],
};

/// Descriptor for `WifiGetPersistentStatsResponse`. Decode as a `google.protobu


x Instance_InstanceMessage_Code) Enum() *Instance_InstanceMessage_Code {
	p := new(Instance_InstanceMessage_Code)
	*p = x
	return p
}

func (x Instance_InstanceMessage_Code) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (Instance_InstanceMessage_Code) Descriptor() protoreflect.EnumDescriptor {
	return file_google_cloud_memcache_v1beta2_cloud_memcache_proto_enumTypes[3].Descriptor()
}

func (Instance_InstanceMessage_Code) Type() protoreflect.EnumType {
	return &file_google_cloud_memcache_v1beta2_cloud_memcache_proto_enumTypes[3]
}

func (x Instance_InstanceMessage_Code) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use Instance_InstanceMessage_Code.Descriptor instead.
func (Instance_InstanceMessage_Code) EnumDescriptor() ([]byte, []int) {
	return file_google_cloud_memcache_v1beta2_cloud_memcache_proto_rawDescGZIP(), []int{0, 2, 0}
}

type Instance struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// Required. Unique name of the resource in this scope including project and
	// location using the form:
	//     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
	//
	// Note: Memcached instances are managed and addressed at regional level so
	// location_id here refers to a GCP region; however, users may choose which
	// zones Memcached nodes within an instances should be provisioned in.
	// Refer to [zones] field for more details.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional. User provided name for the instance only used for display
	// purposes. Cannot be more than 80 characters.
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// Optional. Resource labels to represent user-provided metadata.
	// Refer to cloud documentation on labels for more details.
	// https://cloud.google.com/compute/docs/labeling-resources
	Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	// Optional. The full name of the Google Compute Engine
	// [network](https://cloud.google.com/vpc/docs/vpc) to which the
	// instance is connected. If left unspecified, the `default` network
	// will be used.
	AuthorizedNetwork string `protobuf:"bytes,4,opt,name=authorized_network,json=authorizedNetwork,proto3" json:"authorized_network,omitempty"`
	// Optional. Zones where Memcached nodes should be provisioned in.
	// Memcached nodes will be equally distributed across these zones. If not
	// provided, the service will by default create nodes in all zones in the
	// region for the instance.
	Zones []string `protobuf:"bytes,5,rep,name=zones,proto3" json:"zones,omitempty"`
	// Required. Number of nodes in the Memcached instance.
	NodeCount int32 `protobuf:"varint,6,opt,name=node_count,json=nodeCount,proto3" json:"node_count,


REGISTER_PIR_MAPPER(hard_swish, HardSwishMapper)

int32_t HardSwishMapper::GetMinOpsetVersion(bool verbose) {
  Logger(verbose, 7) << RequireOpset(7) << std::endl;
  return 7;
}

void HardSwishMapper::Opset7() {
  auto input_info = GetInput("X");
  auto output_info = GetOutput("Out");
  auto hardsigmoid = helper_->MakeNode("HardSigmoid", {input_info[0].name});
  AddAttribute(hardsigmoid, "alpha", static_cast<float>(1.0 / 6.0));
  AddAttribute(hardsigmoid, "beta", static_cast<float>(0.5));
  helper_->MakeNode("Mul",
                    {hardsigmoid->output(0), input_info[0].name},
                    {output_info[0].name});
}

void HardSwishMapper::Opset14() {
  auto input_info = GetInput("X");
  auto output_info = GetOutput("Out");
  helper_->MakeNode("HardSwish", {input_info[0].name}, {output_info[0].name});
}
}  // namespace paddle2onnx
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle2onnx/mapper/activation/hard_sigmoid.h"

namespace paddle2onnx {
REGISTER_MAPPER(hard_sigmoid, HardSigmoidMapper)
REGISTER_PIR_MAPPER(hard_sigmoid, HardSigmoidMapper)

void HardSigmoidMapper::Opset7() {
  auto input_info = GetInput("X");
  auto output_info = GetOutput("Out");
  auto node = helper_->MakeNode(
      "HardSigmoid", {input_info[0].name}, {output_info[0].name});
  AddAttribute(node, "alpha", alpha_);
  AddAttribute(node, "beta", beta_);
}
}  // namespace paddle2onnx
//===------- LegalizeVectorTypes.cpp - Legalization of vector types -------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file performs vector type splitting and scalarization for LegalizeTypes.
// Scalarization is the act of changing a computation in an illegal one-element
// vector type to be a computation in its scalar element type.  For example,
// implementing <1 x f32> arithmetic in a scalar f32 register.  This is needed
// as a base case when scalarizing vector arithmetic like <4 x f32>, which
// eventually decomposes to scalars if the target doesn't support v4f32 or v2f32
// types.
// Splitting is the act of changing a computation in an invalid vector type to
// be a computation in two vectors of half the size.  For example, implementing
// <128 x f32>


{contact.name}

)
```

`React` 使用特殊的 `key` 属性来区分列表中的每一项，确保整个列表不会全部重新渲染。

在 `SolidJS` 中，使用 `for` 和 `index` 内置元素：

```html
<For each={state.contacts}>
  {contact =>
{contact.name}
 }
</For>
```

在内部，`SolidJS` 使用它自己的内存与 `for`、`index` 决定状态更改时需要改动哪些元素。它比 `React` 更明确，而且避免了虚拟 `DOM` 的复杂性。

Svelte 使用 `each` 指令：

```js
{#each contacts as contact}

{contact.name}

{/each}
```

`Lit` 提供了一个 `repeat` 函数，工作方式类似于 `React` 的 `key`

```js
repeat(contacts, contact => contact.id,
    (contact, index) => html`<div>${contact.name}</div>`
```

## 框架带来的成本

上面我们提到，框架提供声名式的数据绑定、条件和列表渲染、以及传递更改的响应式机制，另外还提供组件复用等能力。

这些能力虽然给我们带来了方便，但也额外增加了很多成本。

### 捆绑依赖包的大小

在查看捆绑依赖包的大小时，我习惯查看压缩后非 `Gzip` 的大小。这是与 `JavaScript` 执行的 `CPU` 成本最相关的大小。

- `ReactDOM` 大约 120 KB。
- `SolidJS` 大约 18 KB。
- `Lit` 约为 16 KB。
- `Svelte` 大约 2 KB，但生成的代码大小不同。

似乎最新推出的框架在保持包大小方面都比 `React` 做得更好。虚拟 `DOM` 需要大量的 `JavaScript` 代码。

### 构建

不知从何时开始，我们习惯了“构建”我们的 Web 应用程序。如果不设置 `Node.js` 和 `Webpack` 之类的打包器、处理 `Babel-TypeScript` 启动包中最近的一些配置更改等等，就不可能启动前端项目。

框架的表现力越强，包体积越小，同时构建工具和编译时间的负担就越大。

`Svelte` 声称虚拟 `DOM` 是纯粹的开销。我同意，但 “编译”（如 `Svelte` 和 `SolidJS`）和自定义客户端模板引擎（如 `Lit`）是不是也是一种不同类型的纯开销呢？

### 调试

我们在使用或调试 `Web` 应用程序的时候，看到的代码和我们编写的代码是完全不同的。为了方便调试，我们一般需要依靠一些特殊调试工具来对网站上的代码进行逆向，并将其与我们自己代码中的错误联系起来。

在 `React` 中，调用堆栈永远


--[[

     Fishlive Lua Library
     Plugins for 3rd parties library and addons

     Plugins section

     Licensed under GNU General Public License v2
      * (c) 2022, A.Fischer
--]]

-- titlebars NICE
local nice = require("nice")

-- fishlive plugins submodule
local plugins = { _NAME = "fishlive.plugins" }

-- Configure Nice Titlebars Library
function plugins.createTitlebarsNiceLib()
  nice {
      win_shade_enabled = true,
      titlebar_height = 29,
      titlebar_radius = 11,
      titlebar_font = "Iosevka Nerd Font 9",
      button_size = 13,
      button_margin_horizontal = 5,
      button_margin_top = 2,
      minimize_color = "#ffb400",
      maximize_color = "#4CBB17",
      close_color


e
import org.rsmod.game.type.seq.SeqType
import org.rsmod.game.type.seq.SeqTypeList
import org.rsmod.game.type.seq.UnpackedSeqType
import org.rsmod.game.type.spot.SpotanimType
import org.rsmod.game.type.timer.TimerType
import org.rsmod.map.CoordGrid
import org.rsmod.map.util.Bounds
import org.rsmod.routefinder.collision.CollisionFlagMap
import org.rsmod.routefinder.flag.CollisionFlag

/**
 * Manages scoped actions for npcs that implicitly launch a coroutine, allowing functions such as
 * `delay`.
 *
 * This system is similar to `ProtectedAccess` for players but differs in that it does not enforce
 * safeguards when launching this scope for the [npc]. Even if the [npc] already has an active
 * [coroutine] or if [Npc.isBusy] is `true`, a new [StandardNpcAccess] can still be invoked.
 */
public class StandardNpcAccess(
    public val npc: Npc,
    private val coroutine: GameCoroutine,
    private val context: StandardNpcAccessContext,
) {
    public val random: GameRandom by context::random

    public val coords: CoordGrid by npc::coords
    public val mapClock: Int by npc::currentMapClock

    public var actionDelay: Int by npc::actionDelay

    public fun walk(dest: CoordGrid) {
        npc.walk(dest)
    }

    public suspend fun delay(cycles: Int = 1) {
        require(cycles > 0) { "`cycles` must be greater than 0. (cycles=$cycles)" }
        npc.delay(cycles)
        coroutine.pause { npc.isNotDelayed }
    }

    public suspend fun arriveDelay() {
        if (!npc.hasMovedPreviousCycle) {
            return
        }
        delay()
    }

    /**
     * Delays the npc for a number of ticks equal to the time duration of [seq].
     *
     * @param seq The seq type whose tick duration determines the delay.
     * @throws IllegalStateException if [UnpackedSeqType.tickDuration] is `0`.
     */
    public suspend fun delay(seq: SeqType, seqTypes: SeqTypeList) {
        delay(seqTypes[seq])
    }

    /**
     * Delays the npc for a number of ticks equal to the time duration of [seq].
     *
     * @param seq The seq type whose tick duration determines the delay.
     * @throws IllegalStateException if [UnpackedSeqType.tickDuration] is `0`.
     */
    public suspend fun delay(seq: UnpackedSeqType) {
        val ticks = seq.tickDuration
        check(ticks > 0) { "Seq tick duration must be positive: $seq" }
        delay(cycles = ticks)
    }

    public fun telejump(dest: CoordGrid, collision: CollisionFlagMap) {
        if (!collision.isZoneValid(dest)) {
            // TODO: Decide if we want to silently-fail, log, or let `PathingEntityCommon.telejump`
            //  error, which will cause the `npc` to be deleted by the engine.
            return
        }
        PathingEntityCommon.telejump(npc, collision, dest)
    }

    public fun teleport(dest: CoordGrid, collision: CollisionFlagMap) {
        if (!collision.isZoneValid(dest)) {
            // TODO: Decide if we want to silently-fail, log, or let `PathingEntityCommon.teleport`
            //  error, which will cause the `npc` to be deleted by the engine.
            return
        }
        PathingEntityCommon.teleport(npc, collision, dest)
    }

    public fun queueDeath() {
        npc.queueDeath()


"péng" /* 塳 */
  dict[0x5874] = "bèng" /* 塴 */
  dict[0x5875] = "chén" /* 塵 */
  dict[0x5876] = "lù" /* 塶 */
  dict[0x5877] = "lǔ" /* 塷 */
  dict[0x5878] = "ōu,qiū" /* 塸 */
  dict[0x5879] = "qiàn" /* 塹 */
  dict[0x587a] = "méi" /* 塺 */
  dict[0x587b] = "mò" /* 塻 */
  dict[0x587c] = "zhuān,tuán" /* 塼 */
  dict[0x587d] = "shuǎng" /* 塽 */
  dict[0x587e] = "shú" /* 塾 */
  dict[0x587f] = "lǒu" /* 塿 */
  dict[0x5880] = "chí" /* 墀 */
  dict[0x5881] = "màn" /* 墁 */
  dict[0x5882] = "biāo" /* 墂 */
  dict[0x5883] = "jìng" /* 境 */
  dict[0x5884] = "qī" /* 墄 */
  dict[0x5885] = "shù" /* 墅 */
  dict[0x5886] = "zhì,dì" /* 墆 */
  dict[0x5887] = "zhàng" /* 墇 */
  dict[0x5888] = "kàn" /* 墈 */
  dict[0x5889] = "yōng" /* 墉 */
  dict[0x588a] = "diàn" /* 墊 */
  dict[0x588b] = "chěn" /* 墋 */
  dict[0x588c] = "zhǐ,zhuó" /* 墌 */
  dict[0x588d] = "xì" /* 墍 */
  dict[0x588e] = "guō" /* 墎 */
  dict[0x588f] = "qiǎng" /* 墏 */
  dict[0x5890] = "jìn" /* 墐 */
  dict[0x5891] = "dì" /* 墑 */
  dict[0x5892] = "shāng" /* 墒 */
  dict[0x5893] = "mù" /* 墓 */
  dict[0x5894] = "cuī" /* 墔 */
  dict[0x5895] = "yàn" /* 墕 */
  dict[0x5896] = "tǎ" /* 墖 */
  dict[0x5897] = "zēng" /* 増 */
  dict[0x5898] = "qián" /* 墘 */
  dict[0x5899] = "qiáng" /* 墙 */
  dict[0x589a] = "liáng" /* 墚 */
  dict[0x589b] = "wèi" /* 墛 */
  dict[0x589c] = "zhuì" /* 墜 */
  dict[0x589d] = "qiāo" /* 墝 */
  dict[0x589e] = "zēng" /* 增 */
  dict[0x589f] = "xū" /* 墟 */
  dict[0x58a0] = "shàn" /* 墠 */
  dict[0x58a1] = "shàn" /* 墡 */
  dict[0x58a2] = "fá" /* 墢 */
  dict[0x58a3] = "pú" /* �


return error(pn + active_model->parse_node_offset, field, REASSIGN_CONSTANT);
            }else{
                sym.is_reassigned = true;
            }
        }else{
            sym.is_used = true;
        }

        parse_tree.setType(field, sym.type);
        parse_tree.setRows(field, sym.rows);
        parse_tree.setCols(field, sym.cols);
        return field;
    }else if(sym.type == NAMESPACE){
        auto lookup = symbolTable().scoped_vars.find(SymbolTable::ScopedVarKey(sym_id, parse_tree.getSelection(field)));
        if(lookup != symbolTable().scoped_vars.end()){
            parse_tree.setOp(field, OP_IDENTIFIER);
            Symbol& sym = *reinterpret_cast<Symbol*>(lookup->second);
            SymbolUsage& usage = *reinterpret_cast<SymbolUsage*>(parse_tree.getFlag(field));

            ParseNode pn = usage.pn;

            //Patch the empty usage inserted earlier
            usage.symbol_index = reinterpret_cast<size_t>(&sym);
            parse_tree.setSymbol(pn + active_model->parse_node_offset, &sym);
            //DESIGN QUAGMIRE (AST): handle parse_tree logic please
            active_model->parser.parse_tree.setOp(field - active_model->parse_node_offset, OP_IDENTIFIER);
            active_model->parser.parse_tree.setSymbol(pn, &sym);

            usage.prev_usage_index = reinterpret_cast<size_t>(sym.last_external_usage);
            sym.last_external_usage = &usage;

            if(write){
                if(sym.is_const){
                    return error(pn + active_model->parse_node_offset, field, REASSIGN_CONSTANT);
                }else{
                    sym.is_reassigned = true;
                }
            }else{
                sym.is_used = true;
            }

            parse_tree.setType(field, sym.type);
            parse_tree.setRows(field, sym.rows);
            parse_tree.setCols(field, sym.cols);
            return field;
        }else{
            return error(pn, field, BAD_READ);
        }
    }else{
        return error(pn, lhs, NOT_A_SCOPE);
    }
}

ParseNode StaticPass::resolveBlock(ParseNode pn) {
    for(size_t i = 0; i < parse_tree.getNumArgs(pn); i++){
        ParseNode stmt = resolveStmt(parse_tree.arg(pn, i));
        parse_tree.setArg(pn, i, stmt);
    }
    return pn;
}

ParseNode StaticPass::copyChildProperties(ParseNode pn) noexcept {
    ParseNode child = parse_tree.child(pn);
    parse_tree.setRows(pn, parse_tree.getRows(child));
    parse_tree.setCols(pn, parse_tree.getCols(child));
    parse_tree.setValue(pn, parse_tree.getValue(child));

    return child;
}

ParseNode StaticPass::enforceScalar(ParseNode pn){
    pn = resolveExpr(pn);

    if(parse_tree.getType(pn) != NUMERIC)
        return error(pn, pn, TYPE_ERROR);
    if(parse_tree.getRows(pn) > 1 || parse_tree.getCols(pn) > 1)
        return error(pn, pn, EXPECT_SCALAR);
    if(parse_tree.getRows(pn) == UNKNOWN_SIZE || parse_tree.getCols(pn) == UNKNOWN_SIZE){
        pn = parse_tree.addUnary(OP_CHECK_SCALAR, pn);
        parse_tree.setScalar(pn);
    }

    return pn;
}


idProxies(s hasConnectionAndConfig) []*data.BytestreamStreamhost {
	proxies, _ := s.Conn().Cache().GetOrComputeTimed("http://jabber.org/protocol/bytestreams . proxies", defaultBytestreamProxyTimeout, bytestreamsCalculateValidProxies(s))
	return proxies.([]*data.BytestreamStreamhost)
}

var errLocalCancel = errors.New("local cancel")

func closeAndIgnore(c io.Closer) {
	_ = c.Close()
}

func bytestreamsSendData(ctx *sendContext, c io.ReadWriteCloser) {
	defer closeAndIgnore(c)

	r, err := os.Open(ctx.file)
	if err != nil {
		ctx.onError(err)
		return
	}
	defer closeAndIgnore(r)

	reporting := func(v int) error {
		if ctx.weWantToCancel {
			removeInflightSend(ctx)
			return errLocalCancel
		}
		ctx.onUpdate(v)
		return nil
	}

	rep := &reportingWriter{report: reporting}

	ctx.totalSize = ctx.enc.totalSize(ctx.size)

	ww, beforeFinish := ctx.enc.wrapForSending(c, ioMultiWriter(c, rep))

	_, err = ioCopy(ioMultiWriter(ww, rep), r)
	if err != nil && err != errLocalCancel {
		ctx.onError(err)
	} else {
		beforeFinish()
		ctx.onFinish()
	}
}

func bytestreamsSendDo(ctx *sendContext) {
	go func() {
		proxies := bytestreamsGetCurrentValidProxies(ctx.s)
		proxiesToSend := make([]data.BytestreamStreamhost, len(proxies))
		proxyMap := make(map[string]data.BytestreamStreamhost)
		for ix, p := range proxies {
			proxiesToSend[ix] = *p
			proxyMap[p.Jid] = *p
		}

		var bq data.BytestreamQuery
		if err := basicIQ(ctx.s, ctx.peer, "set", &data.BytestreamQuery{
			Sid:         ctx.sid,
			Streamhosts: proxiesToSend,
		}, &bq, func(ciq *data.ClientIQ) {
			sh, ok := proxyMap[bq.StreamhostUsed.Jid]
			if !ok {
				ctx.onError(errors.New("Invalid streamhost to use - this is likely a developer error from the peers side"))
				return
			}
			dstAddr := hex.EncodeToString(digests.Sha1([]byte(ctx.sid + ciq.To + ciq.From)))
			if !tryStreamhost(ctx.s, sh, dstAddr, func(c io.ReadWriteCloser) {
				e := basicIQ(ctx.s, bq.StreamhostUsed.Jid, "set", &data.BytestreamQuery{
					Sid:      ctx.sid,
					Activate: ciq.From,
				}, nil, func(*data.ClientIQ) {
					go bytestreamsSendData(ctx, c)
				})
				if e != nil {
					ctx.onError(e)
				}
			}) {
				ctx.onError(fmt.Errorf("Failed at connecting to streamhost: %#v", sh))
			}
		}); err != nil {
			ctx.onError(err)
		}
	}()
}
package filetransfer

import (
	"bytes"
	"errors"
	"io"

	. "gopkg.in/check.v1"
)

var (
	testDataEncryptedContent = []byte{0x42, 0xf9, 0x6b, 0x9e, 0x70, 0x2d, 0xf8}

	testDataMac = []byte{
		0x2, 0x12, 0xac, 0x1b, 0xc3, 0xf6, 0x66, 0xe1,
		0x54, 0xb9, 0x95, 0xf9, 0xbd, 0x70, 0xf, 0x6a,
		0xad, 0x4a, 0xf3, 0x3c, 0x8d, 0x95, 0x


);
            expect(it.value).toEqual(2);

            it = list.end().offset(-5);
            expect(it.value).toEqual(1);

            it = list.end().offset(-6);
            expect(it.value).toEqual(1);

            it = list.end().offset(-7);
            expect(it.value).toEqual(1);
        });

        it("can traverse a 1-element list", () => {
            const list = new List<number>();
            list.push(1);
            expect(list.length).toEqual(1);

            const it = list.begin();

            let res = it.next();
            expect(res.done).toEqual(false);
            if (!res.done) {
                expect(res.value).toEqual(1);
            }

            res = it.next();
            expect(res.done).toEqual(true);
        });

        it("can traverse a 3-element list", () => {
            const list = new List<number>();
            list.push(1);
            list.push(2);
            list.push(3);
            expect(list.length).toEqual(3);

            const it: Iterator<number> = list.begin();

            let res = it.next();
            expect(res.done).toEqual(false);
            if (!res.done) {
                expect(res.value).toEqual(1);
            }

            res = it.next();
            expect(res.done).toEqual(false);
            if (!res.done) {
                expect(res.value).toEqual(2);
            }

            res = it.next();
            expect(res.done).toEqual(false);
            if (!res.done) {
                expect(res.value).toEqual(3);
            }

            res = it.next();
            expect(res.done).toEqual(true);
        });

        it("can move to previous element", () => {
            const list = List.fromArray([1, 2, 3, 4, 5]);
            let it = list.begin();

            it.prev();
            expect(list.begin().equals(it)).toBeTruthy();  // Will to move in front of the beginning node.

            it = list.end();
            expect(() => {
                it.value;   // eslint-disable-line @typescript-eslint/no-unused-expressions
            }).toThrowError("Attempted to get value from an iterator at end().");

            it.prev();
            expect(it.value).toEqual(5);
            it.prev();
            expect(it.value).toEqual(4);
            it.prev();
            expect(it.value).toEqual(3);
            it.prev();
            expect(it.value).toEqual(2);
            it.prev();
            expect(it.value).toEqual(1);
            it.prev();
            expect(it.value).toEqual(1);
        });

    });

});
import { Injectable } from '@opensumi/di';
import { IDisposable } from '@opensumi/ide-core-common';

@Injectable()
export abstract class IToolBarViewService {
  abstract registerToolBarElement(element: IToolBarAction | IToolBarComponent): IToolBarElementHandle | undefined;

  abstract getVisibleElements(position: ToolBarPosition): (IToolBarComponent | IToolBarAction)[];
}

export interface IToolBarElementHandle extends IDisposable {
  visible: boolean;

  setVisible(visible: boolean);
}

export interface IToolBarElement {
  id?: string;

  position: ToolBarPosition | string;

  type: 'component' | 'action';

  /**
   * 排序因子，越小越靠前
   * @ deprecated
   */
  order?: number;

  /**
   * 排序因子，越大越靠前
   */
  weight?: number;
}

export interface IToolBarAction extends IToolBarElement {
  type: 'action';

  iconClass: string;

  title: string;

  click: (event: React.MouseEvent<HTML


						mx;
	Float									my;
	const BaseContainer*	msg;
};

#define ReturnLong(v)		{ res_type = LV_RES_INT; result = (void*)(Int)(v); return; }
#define ReturnBitmap(v)	{ res_type = LV_RES_BITMAP; result = (void*)(v); return; }
#define ReturnString(v)	{ res_type = LV_RES_STRING; result = (void*)NewObjClear(String, v); return; }
#define ReturnNull()		{ res_type = LV_RES_NIL; result = nullptr; return; }
#define ReturnVector(v)	{ res_type = LV_RES_VECTOR; result = (void*)NewObjClear(Vector, v); return; }

class GeListView
{
	friend class GeDialog;

private:
	CUserArea*				cu;
	ListViewCallBack*	callback;
	void*							userdata;

public:
	GeListView();
	virtual ~GeListView();

	virtual void LvCallBack(Int32& res_type, void*& result, void* secret, Int32 cmd, Int32 line, Int32 col, void* data1);

	Int LvCallBackLong(void* secret, Int32 cmd, Int32 line, Int32 col, void* data1);
	void LvSuperCall(Int32& res_type, void*& result, void* secret, Int32 cmd, Int32 line, Int32 col);

	void Redraw(void);
	void DataChanged(void);
	void ShowCell(Int32 id, Int32 col);

	Bool SendParentMessage(BaseContainer* msg);
	Bool ExtractMouseInfo(void* secret, MouseDownInfo& info, Int32 size);
	Bool ExtractDrawInfo(void* secret, DrawInfo& info, Int32 size);
	Int32 GetId(void);

	Bool AttachListView(CDialog* cd, Int32 id, ListViewCallBack* callback = nullptr, void* userdata = nullptr);
};

class SimpleRoot : public GeListHead
{
public:
	Int32 GetCount(void);
	SimpleListNode* FindId(Int32 id);
	SimpleListNode* GetNumber(Int32 num);
	Int32 GetNumber(SimpleListNode* node);
};

#define SLV_MULTIPLESELECTION 1

class SimpleListView : public GeListView
{
	BaseSelect	select;
	Int32				focus;

	Int32				columns;
	Int32*			layout;
	Int32*			colidx;
	Bool				multipleselection;

	SimpleRoot	items;

public:
	SimpleListView();
	virtual ~SimpleListView();

	Bool SetLayout(Int32 columns, const BaseContainer& data);
	Bool SetItem(Int32 id, const BaseContainer& data);
	Bool GetItem(Int32 id, BaseContainer* data);
	Int32 GetItemCount(void);
	Bool GetItemLine(Int32 num, Int32* id, BaseContainer* data);

	Bool SetProperty(Int32 id, Int32 val);
	Int32 GetProperty(Int32 id);

	Bool RemoveItem(Int32 id);
	Int32 GetSelection(BaseSelect* selection);
	Bool SetSelection(BaseSelect* selection);
	void ShowCell(Int32 line, Int32 col);

	virtual void LvCallBack(Int32& res_type, void*& result, void* secret, Int32 cmd, Int32 line, Int32 col, void* data1);
};

#endif

#endif // C4D_LISTVIEW_H__


rt"))
        self.save_btn.setIcon(self.icon_manager.get_icon("save_all"))

        # --- [核心修改开始] ---
        # 3. 刷新“关闭窗口时操作”下拉框的图标
        #    这个下拉框在创建时已经设置了图标，但我们需要在主题切换时更新它们。
        if hasattr(self, 'close_action_combo'):
            # 创建一个从 userData 到图标名称的映射，使代码更清晰
            action_to_icon_map = {
                "prompt": "confirm",
                "tray": "minimize",
                "exit": "end_session_dark"
            }
            # 遍历下拉框中的每一项
            for i in range(self.close_action_combo.count()):
                # 获取该项存储的 userData (例如 "prompt", "tray")
                action_key = self.close_action_combo.itemData(i)
                # 从映射中找到对应的图标名称
                icon_name = action_to_icon_map.get(action_key)
                if icon_name:
                    # 从 IconManager 获取最新的、适配当前主题的图标
                    new_icon = self.icon_manager.get_icon(icon_name)
                    # 使用 setItemIcon 方法， surgically 地只更新图标，不影响文本和数据
                    self.close_action_combo.setItemIcon(i, new_icon)
        # --- [核心修改结束] ---
        # 3.5. 刷新“录音设备”下拉框的图标 (仅在简易模式下)
        if hasattr(self, 'input_device_combo') and self.simple_mode_switch.isChecked():
            # 创建一个从 userData 到图标名称的映射
            device_mode_to_icon = {
                "smart": "smart_select",
                "default": "system",
                "internal": "mic",
                "external": "usb",
                "loopback": "loopback"
            }
            # 遍历下拉框中的每一项并更新其图标
            for i in range(self.input_device_combo.count()):
                mode_key = self.input_device_combo.itemData(i)
                icon_name = device_mode_to_icon.get(mode_key)
                if icon_name:
                    new_icon = self.icon_manager.get_icon(icon_name)
                    self.input_device_combo.setItemIcon(i, new_icon)

        # 4. 刷新“模块管理”页面的按钮 (保持不变)
        self.add_module_btn.setIcon(self.icon_manager.get_icon("add_row"))
        self.module_settings_btn.setIcon(self.icon_manager.get_icon("settings"))
        self.remove_module_btn.setIcon(self.icon_manager.get_icon("delete"))

        # 5. 刷新“关于”页面的按钮 (保持不变)
        if hasattr(self, 'github_btn'):
            self.github_btn.setIcon(self.icon_manager.get_icon("github"))
            self.report_bug_btn.setIcon(self.icon_manager.get_icon("bug"))
            self.manual_btn.setIcon(self.icon_manager.get_icon("help"))
            self.check_update_btn.setIcon(self.icon_manager.get_icon("refresh"))

        # 6. 刷新音频测试和回放按钮的图标 (保持不变)
        if hasattr(self, 'test_mic_btn'):
            if self.is_testing_mic:
                self.test_mic_btn.setIcon(self.icon_manager.get_icon("stop"))
            else:
                self.test_mic_btn.setIcon(self.icon_manager.get_icon("record"))
            self.playback_test_btn.setIcon(self.icon_manager.get_icon("play"))

        # 7. 重新填充模块表格和更新按钮状态以刷新其内部图标 (保持不变)
        self.populate_module_table()
        self._update_module_buttons_state()

    def _create_about_page(self):
        """
        [v2.1 - 内容与功能增强版] 创建“关于”页面。
        此版本更新了鸣谢列表，修复了HTML代码显示问题，并实现了本地手册的打开功能。
        同时，将交互式按钮提升为实例属性，以便 update_icons() 可以刷新它们。
        """
        # --- 1. 创建主容器和布局 ---
        page = QWidget()
        scroll_area = QScrollArea()
        scroll_area.setWidgetResizable(True)
        scroll_area.setWidget(page)
        scroll_area.setObjectName("SettingsScrollArea")
        scroll_area.setStyleSheet("QScrollArea#SettingsScrollArea { border: none; }")

        # 使用一个包装布局来实现垂直和水平居中
        page_layout = QHBoxLayout(page)
        page_layout.addStretch() # 左侧弹簧

        # 内容容器，固定宽度以保证在宽屏下的可读性
        content_container = QWidget()
        content_container.setFixedWidth(700)
        content_layout = QVBoxLayout(content_container)
        content_layout.setContentsMargins(20, 20, 20, 20)
        content_layout.setSpacing(20) # 各个卡片之间的间距

        # --- 2. 顶部应用信息卡片 ---
        app_info_group = QGroupBox()
        app_info_group.setObjectName("CardGroup")
        app_info_layout = QHBoxLayout(app_info_group)
        app_info_layout.setSpacing(30)

        # --- [核心修改] 使用我们新的 AnimatedLogoLabel 类 ---
        logo_label = AnimatedLogoLabel()
        # --- [修改结束] ---

        custom_logo_path = os.path.join(get_base_path_for_module(), "assets", "logo.png")

        logo_pixmap = QPixmap()
        if os.path.exists(custom_logo_path):
            logo_pixmap.load(custom_logo_path)
        else:
            app_ico