luding
 * without limitation fees for hosting or consulting/ support services related to the Software), a
 * product or service whose value derives, entirely or substantially, from the functionality of the
 * Software. Any license notice or attribution required by the License must also include this
 * Commons Clause License Condition notice.
 *
 * Software: Infinitic
 *
 * License: MIT License (https://opensource.org/licenses/MIT)
 *
 * Licensor: infinitic.io
 */
package io.infinitic.dashboard.svgs.icons

import io.infinitic.dashboard.svgs.path
import io.infinitic.dashboard.svgs.svg
import kweb.Element
import kweb.ElementCreator
import kweb.new

fun ElementCreator<Element>.iconWorkflow(): Element {
  val svg = svg()
  svg.setClasses("h-6 w-6")
      .set("fill", "none")
      .set("viewBox", "0 0 24 24")
      .set("stroke", "currentColor")
      .new {
        path()
            .set("stroke-linecap", "round")
            .set("stroke-linejoin", "round")
            .set("stroke-width", "2")
            .set(
                "d",
                "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z")
        path()
            .set("stroke-linecap", "round")
            .set("stroke-linejoin", "round")
            .set("stroke-width", "2")
            .set("d", "15 12a3 3 0 11-6 0 3 3 0 016 0z")
      }

  return svg
}
/**
 * "Commons Clause" License Condition v1.0
 *
 * The Software is provided to you by the Licensor under the License, as defined below, subject to
 * the following condition.
 *
 * Without limiting other conditions in the License, the grant of rights under the License will not
 * include, and the License does not grant to you, the right to Sell the Software.
 *
 * For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you
 * under the License to provide to third parties, for a fee or other consideration (including
 * without limitation fees for hosting or consulting/ support services related to the Software), a
 * product or service whose value derives, entirely or substantially, from the functionality of the
 * Software. Any license notice or attribution required by the License must also include this
 * Commons Clause License Condition notice.
 *
 * Software: Infinitic
 *
 * License: MIT License (https://opensource.org/licenses/MIT)
 *
 * Licensor: infinitic.io
 */
package io.infinitic.dashboard.panels.workflows

import io.infinitic.dashboard.Panel
import io.infinitic.dashboard.menus.WorkflowMenu
import kweb.Element
import kweb.ElementCreator
import kweb.div
import kweb.h1
import kweb.new

object WorkflowsPanel : Panel() {
  override val menu = WorkflowMenu
  override val url = "/workflows"

  override fun render(creator: ElementCreator<Element>): Unit =
      with(creator) {
        div().classes("py-6").new {
          div().classes("max-w-7xl mx-auto px-4 sm:px-6 md:px-8").new {


 when running with Node 16
// (node:75278) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
import pkg from './package.json' assert { type: 'json' };

const devMode = process.env.devMode ?? false;

const plugins = [
  typescript(),
  resolve(),
  commonjs(), // at least required to bundle mxGraph with is a CommonJS module
  string({include: "**/*.bpmn"}), // let import the BPMN diagram in the TypeScript code
];

// Copy static resources to dist
const copyTargets = [];
copyTargets.push({src: "src/*.html", dest: "dist/"});
copyTargets.push({src: "src/static", dest: "dist"});
let copyPlugin;
if (devMode) {
  copyPlugin = copyWatch({
    watch: ["src/static/**", "src/*.html"],
    targets: copyTargets,
  });
} else {
  copyPlugin = copy({
    targets: copyTargets,
  });
}
plugins.push(copyPlugin);

if (devMode) {
  // Create a server for dev mode
  plugins.push(serve({contentBase: "dist", port: 10001}));
  // Allow to livereload on any update
  plugins.push(livereload({watch: "dist", verbose: true}));
} else {
  plugins.push(terser({ecma: 2015}));
}

export default [
  {
    input: "src/index.ts",
    output: [
      {
        file: pkg.module,
        format: "es",
        sourcemap: true,
      },
    ],
    plugins: plugins,
  },
];
const navigation = {enabled: true};
const loadOptions = {fit: {type: bpmnvisu.FitType.Center, margin: 20}};

class BpmnVisualizationCustomizedColors extends bpmnvisu.BpmnVisualization {
    constructor(globalOptions) {
        super(globalOptions);
        this.configureStyle();
    }

    configureStyle() {
        // do nothing by default
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// custom markers for message flows
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class BpmnVisualizationCustomColorsMarkers extends BpmnVisualizationCustomizedColors {
    configureStyle() {
        const styleSheet = this.graph.getStylesheet(); // mxStylesheet parameter
        const style = styleSheet.styles[bpmnvisu.FlowKind.MESSAGE_FLOW];
        style[bpmnvisu.BpmnStyleIdentifier.EDGE_START_FILL_COLOR] = '#ee1cb0';
        style[bpmnvisu.BpmnStyleIdentifier.EDGE_END_FILL_COLOR] = 'orange';
    }
}

const bpmnVisualization1 = new BpmnVisualizationCustomColorsMarkers({container: 'bpmn-container-1', navigation});
bpmnVisualization1.load(getIncidentManagementBpmnDiagram(), loadOptions);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// custom markers for sequence flows
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class BpmnVisualizationCustomColorsMarkersSeqFlow extends BpmnVisualizationCustomizedCol


            'notification.codex_config_deleted': 'Codex配置删除成功',
            'notification.claude_config_added': 'Claude配置添加成功',
            'notification.claude_config_updated': 'Claude配置更新成功',
            'notification.claude_config_deleted': 'Claude配置删除成功',
            'notification.field_required': '必填字段不能为空',
            'notification.openai_provider_required': '请填写提供商名称和Base URL',
            'notification.openai_provider_added': 'OpenAI提供商添加成功',
            'notification.openai_provider_updated': 'OpenAI提供商更新成功',
            'notification.openai_provider_deleted': 'OpenAI提供商删除成功',
            'notification.openai_model_name_required': '请填写模型名称',
            'notification.data_refreshed': '数据刷新成功',
            'notification.connection_required': '请先建立连接',
            'notification.refresh_failed': '刷新失败',
            'notification.update_failed': '更新失败',
            'notification.add_failed': '添加失败',
            'notification.delete_failed': '删除失败',
            'notification.upload_failed': '上传失败',
            'notification.download_failed': '下载失败',
            'notification.login_failed': '登录失败',
            'notification.please_enter': '请输入',
            'notification.please_fill': '请填写',
            'notification.provider_name_url': '提供商名称和Base URL',
            'notification.api_key': 'API密钥',
            'notification.gemini_api_key': 'Gemini API密钥',
            'notification.codex_api_key': 'Codex API密钥',
            'notification.claude_api_key': 'Claude API密钥',

            // 语言切换
            'language.switch': '语言',
            'language.chinese': '中文',
            'language.english': 'English',

            // 主题切换
            'theme.switch': '主题',
            'theme.light': '亮色',
            'theme.dark': '暗色',
            'theme.switch_to_light': '切换到亮色模式',
            'theme.switch_to_dark': '切换到暗色模式',
            'theme.auto': '跟随系统',

            // 页脚
            'footer.version': '版本',
            'footer.author': '作者'
        },

        'en-US': {
            // Common
            'common.login': 'Login',
            'common.logout': 'Logout',
            'common.cancel': 'Cancel',
            'common.confirm': 'Confirm',
            'common.save': 'Save',
            'common.delete': 'Delete',
            'common.edit': 'Edit',
            'common.add': 'Add',
            'common.update': 'Update',
            'common.refresh': 'Refresh',
            'common.close': 'Close',
            'common.success': 'Success',
            'common.error': 'Error',
            'common.info': 'Info',
            'common.warning': 'Warning',
            'common.loading': 'Loading...',
            'common.connecting': 'Connecting...',
            'common.connected': 'Connected',
            'common.disconnected': 'Disconnected',
            'common.connecting_status': 'Connecting',
            'common.connected_status': 'Connected',
            'common.disconnected_status': 'Disconnected',
            'common.yes': 'Yes',
            'common.no': 'No',
            'common.optional': 'Optional',
            'common.required': 'Required',
            'common.api_key': 'Key',
            'common.base_url': 'Address',
            'common.proxy_url': 'Proxy',
            'common.alias': 'Alias',

            // Page titles
            'title.main': 'CLI Proxy API Management Center',
            'title.login': 'CLI Proxy API Management Center',

            // Au


///
  /// Parameter [functionName] :
  /// The name or ARN of the Lambda function.
  ///
 Name formats
  ///
  ///

  ///

  /// Function name - MyFunction.
  ///

  ///

  /// Function ARN -
  /// arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
  ///

  ///

  /// Partial ARN - 123456789012:function:MyFunction.
  ///

  ///

  /// The length constraint applies only to the full ARN. If you specify only
  /// the function name, it is limited to 64 characters in length.
  ///
  /// Parameter [codeSha256] :
  /// Only publish a version if the hash value matches the value that's
  /// specified. Use this option to avoid publishing a version if the function
  /// code has changed since you last updated it. You can get the hash for the
  /// version that you uploaded from the output of UpdateFunctionCode.
  ///
  /// Parameter [description] :
  /// A description for the version to override the description in the function
  /// configuration.
  ///
  /// Parameter [revisionId] :
  /// Only update the function if the revision ID matches the ID that's
  /// specified. Use this option to avoid publishing a version if the function
  /// configuration has changed since you last updated it.
  Future<FunctionConfiguration> publishVersion({
    required String functionName,
    String? codeSha256,
    String? description,
    String? revisionId,
  }) async {
    final $payload = <String, dynamic>{
      if (codeSha256 != null) 'CodeSha256': codeSha256,
      if (description != null) 'Description': description,
      if (revisionId != null) 'RevisionId': revisionId,
    };
    final response = await _protocol.send(
      payload: $payload,
      method: 'POST',
      requestUri:
          '/2015-03-31/functions/${Uri.encodeComponent(functionName)}/versions',
      exceptionFnMap: _exceptionFns,
    );
    return FunctionConfiguration.fromJson(response);
  }

  /// Update the code signing configuration for the function. Changes to the
  /// code signing configuration take effect the next time a user tries to
  /// deploy a code package to the function.
  ///
  /// May throw [ServiceException].
  /// May throw [InvalidParameterValueException].
  /// May throw [ResourceNotFoundException].
  /// May throw [TooManyRequestsException].
  /// May throw [ResourceConflictException].
  /// May throw [CodeSigningConfigNotFoundException].
  ///
  /// Parameter [codeSigningConfigArn] :
  /// The The Amazon Resource Name (ARN) of the code signing configuration.
  ///
  /// Parameter [functionName] :
  /// The name or ARN of the Lambda function.
  ///
 Name formats
  ///
  ///

  ///

  /// Function name - MyFunction.
  ///

  ///

  /// Function ARN -
  /// arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
  ///

  ///

  /// Partial ARN - 123456789012:function:MyFunction.
  ///

  ///

  /// The length constraint applies only to the full ARN. If you specify only
  /// the function name, it is limited to 64 characters in length.
  Future<PutFunctionCodeSigningConfigResponse> putFunctionCodeSigningConfig({
    required String codeSigningConfigArn,
    required String functionName,
  }) async {
    final $payload = <String, dynamic>{
      'CodeSigningConfigArn': codeSigningConfig


23, 1
	cmp	x23, 4
	bne	.L878
.L879:
	add	w20, w20, 1
	b	.L876
.L884:
	mov	w24, 0
	b	.L880
.L877:
	ldr	x0, [x19, 64]
	ldr	w0, [x0]
	cmp	w0, w28
	bne	.L879
	mov	w1, w4
	adrp	x0, .LC13
	add	x0, x0, :lo12:.LC13
	bl	printk
	ldr	x1, [x19, 64]
	mov	w2, 2048
	mov	x0, x25
	bl	ftl_memcpy
	ldr	x0, [x19, 64]
	ldr	w0, [x0, 512]
	strb	w0, [x19, 89]
	ldr	w0, [x19, 72]
	cmp	w20, w0
	bcs	.L884
	mov	w24, 0
	str	w20, [x19, 72]
	bl	FlashSavePhyInfo
	b	.L879
	.size	FlashReadIdbDataRaw, .-FlashReadIdbDataRaw
	.align	2
	.global	FlashInit
	.type	FlashInit, %function
FlashInit:
	stp	x29, x30, [sp, -112]!
	add	x29, sp, 0
	stp	x19, x20, [sp, 16]
	adrp	x20, .LANCHOR0
	stp	x23, x24, [sp, 48]
	add	x23, x20, :lo12:.LANCHOR0
	stp	x21, x22, [sp, 32]
	adrp	x19, .LANCHOR2
	add	x21, x19, :lo12:.LANCHOR2
	mov	x22, x0
	stp	x25, x26, [sp, 64]
	mov	w0, 32768
	stp	x27, x28, [sp, 80]
	bl	ftl_dma32_malloc
	str	x0, [x23, 64]
	mov	w0, 32768
	bl	ftl_dma32_malloc
	str	x0, [x21, 2216]
	mov	w0, 4096
	bl	ftl_dma32_malloc
	str	x0, [x21, 2224]
	mov	w0, 32768
	bl	ftl_dma32_malloc
	str	x0, [x21, 2232]
	mov	w0, 4096
	bl	ftl_dma32_malloc
	str	x0, [x21, 2240]
	mov	w0, 50
	strb	w0, [x21, 2212]
	adrp	x25, .LC14
	strb	w0, [x23, 89]
	mov	w0, 128
	str	w0, [x23, 92]
	mov	w0, 60
	strb	wzr, [x21, 2104]
	add	x25, x25, :lo12:.LC14
	strb	w0, [x21, 2213]
	mov	x0, x22
	strb	wzr, [x21, 2248]
	adrp	x22, IDByte
	str	wzr, [x21, 2184]
	add	x21, x22, :lo12:IDByte
	mov	w24, 0
	mov	w28, 239
	strb	wzr, [x23, 88]
	str	wzr, [x23, 72]
	bl	NandcInit
.L899:
	ldrb	w2, [x23, 8]
	and	w26, w24, 255
	str	w2, [x29, 108]
	mov	w0, w26
	ldr	x


 output = format!(" {}:", self.node);
        for gene in &self.incoming { // so v.iter() and &v are the same thing!
            output += &format!("({},{:.1}),", gene.source, gene.strength );
        }
        write!(f, "{}", output)
    }
}

pub(crate) struct Brain {
	pub(crate) node_state: Vec<f32>,
	pub(crate) inputs: Vec<Node>,
	pub(crate) nurons: Vec<Nuron>,
	pub(crate) outputs: Vec<Nuron>,
}

impl Brain {
	pub(crate) fn new( genome :&Genome ) -> Self {
		// Find active neurons.
		let mut nurons: Vec<Nuron> = Vec::new();
		'find_nuron: for chro in genome.chromos.iter() {
		  for gene in chro.genes.iter() {
			// let's only look at sources (arbitrary, could have selective sinks)
			if gene.source.is_hidden() & gene.active {
				// Ignore if it's already been added to nurons
				for nuron in nurons.iter() {
					if nuron.node == gene.source {
						continue 'find_nuron;
					}
				}

				// Find all incoming nodes
				let mut incoming: Vec<Gene> = Vec::new();
				for c2 in genome.chromos.iter() {
				  for g2 in c2.genes.iter() {
					if g2.active & (g2.sink == gene.source) {
						incoming.push( *g2 );
					}
				  }
				}

				assert!( incoming.len() > 0 );
				nurons.push( Nuron { node:gene.source, incoming:incoming, state:0f32 });
			}
		  }
		}

		// Find active inputs
		let mut inputs :Vec<Node> = Vec::new();
		for chro in genome.chromos.iter() { // use iter, because sometimes you don't know/care-to-look-up if the current vector is & or not. More robust. :)
		  for gene in chro.genes.iter() {
			if gene.source.is_input() & gene.active {
				if !inputs.contains( &gene.source ) {
					inputs.push( gene.source );
				}
			}
		  }
		}

		// Setup active outputs
		let mut outputs :Vec<Nuron> = Vec::new();
		'find_output: for chro in genome.chromos.iter() {
		  for gene in chro.genes.iter() {
			if gene.sink.is_output() & gene.active {
				let node = gene.sink; // & is not necessary here because Node is copyable, right?

				// Ignore if it's already been added to outputs
				for output in outputs.iter() {
					if output.node == node {
						continue 'find_output;
					}
				}

				// Find all incoming nodes
				let mut incoming: Vec<Gene> = Vec::new();
				for c2 in genome.chromos.iter() {
				  for g2 in c2.genes.iter() {
					if g2.active & (g2.sink == node) {
						incoming.push( *g2 );
					}
				  }
				}

				assert!( incoming.len() > 0 );
				outputs.push( Nuron { node:node, incoming:incoming, state:0f32 });
			}
		  }
		}

		Self { // let brain =
			inputs,
			nurons,
			outputs,
			node_state: vec![0.; Config::get().node_count()],
		}
		// brain.print();
		// return brain
	}

	#[allow(dead_code)]
	fn print(&self) {
		println!("Inputs: {:?}", &self.inputs);
		print_nurons( "Neurons", &self.nurons


;
}

/* line 63, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-vertical .x-tab-bar-strip {
  height: 100%;
  top: 0;
}

/* line 68, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-strip-top {
  bottom: 0;
}

/* line 72, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-strip-bottom {
  top: 0;
}

/* line 76, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-strip-left {
  right: 0;
}

/* line 87, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-strip-right {
  left: 0;
}

/* line 98, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-bar-plain {
  background: transparent !important;
}

/* line 102, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-icon-el {
  position: absolute;
  background-repeat: no-repeat;
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
}

/* line 118, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-close-btn {
  position: absolute;
  font-size: 0;
  line-height: 0;
  background: no-repeat;
}

/* line 125, ../../../ext-theme-base/sass/src/tab/Panel.scss */
.x-tab-mc {
  overflow: visible;
}

/* line 1, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-surface {
  display: -moz-inline-stack;
  display: inline-block;
  vertical-align: middle;
  *vertical-align: auto;
  zoom: 1;
  *display: inline;
  overflow: hidden;
}

/* line 6, ../../../ext-theme-base/sass/src/draw/Component.scss */
.rvml {
  behavior: url(#default#VML);
}

/* line 10, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-surface tspan {
  user-select: none;
  -o-user-select: none;
  -ms-user-select: none;
  -moz-user-select: -moz-none;
  -webkit-user-select: none;
  cursor: default;
}

/* line 14, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-vml-sprite {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
}

/* line 22, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-vml-group {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 1000px;
}

/* line 30, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-vml-measure-span {
  position: absolute;
  left: -9999em;
  top: -9999em;
  padding: 0;
  margin: 0;
  display: inline;
}

/* line 39, ../../../ext-theme-base/sass/src/draw/Component.scss */
.x-vml-base {
  position: relative;
  top: 0;
  left: 0;
  overflow: hidden;
  display: inline-block;
}

/* line 47, ../../../ext-theme-base/sass/src/draw/Comp


    return 0;
}
/* **********************************************************
 * Copyright (c) 2012-2014 Google, Inc.  All rights reserved.
 * **********************************************************/

/* Dr. Memory: the memory debugger
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation;
 * version 2.1 of the License, and no later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Library General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef ASM_CODE_ONLY /* C code ***********************************************/

#include <stdio.h>

typedef unsigned int uint;

struct bitfield {
    bitfield() : bits21_(0), bits1_(0) { }
    bitfield(uint bits21, bool bits1) : bits21_(bits21), bits1_(bits1) { }
    uint bits21_ : 21;
    bool bits1_ : 1;
};

extern "C" {
void bitfield_asm_test(char *undef, char *def);
}

static void
bitfield_asm_test_C(void)
{
    char undef[128];
    char def[128] = {0,};
    bitfield_asm_test(undef, def);
}

int
main(int argc, char *argv[])
{
    bitfield b1(argc, true);
    if (b1.bits21_ > 0)
        printf("correct\n");
    bitfield b2;
    if (b2.bits21_ == 0)
        printf("correct\n");

#ifdef BITFIELD_ASM
    bitfield_asm_test_C();
#endif

    printf("all done\n");
    return 0;
}

#else /* asm code *************************************************************/
#include "cpp2asm_defines.h"
START_FILE

#define FUNCNAME bitfield_asm_test
/* void bitfield_asm_test(char *undef, char *def); */
        DECLARE_FUNC_SEH(FUNCNAME)
GLOBAL_LABEL(FUNCNAME:)
        mov      REG_XAX, ARG1
        mov      REG_XDX, ARG2
        push     REG_XBP
        mov      REG_XBP, REG_XSP
        END_PROLOG

        /* test i#849-ish bitfield sequence for i#1520 */
        mov      ecx, DWORD [REG_XAX] /* undef */
        shr      ecx, HEX(1b)
        and      ecx, HEX(0f)
        mov      ecx, 0
        sete     cl
        cmp      eax,ecx

        /* test i#878-ish bitfield sequence for i#1520 */
        push     REG_XBX /* save callee-saved reg */
        mov      ecx, 0
        mov      cl, BYTE [REG_XAX] /* undef */
        push     REG_XCX /* set up undef memory we can write to */
        xor      cl, cl
        mov      bl, BYTE [REG_XSP] /* undef */
        xor      bl, cl
        and      bl, 1
        xor      bl, BYTE [REG_XSP]
        mov      BYTE [REG_XSP], bl
        test     bl, 1
        pop      REG_XBX
        pop      REG_XBX /* restore */

        /* test i#1520 bitfield sequence A */
        mov      ecx, DWORD [REG_XAX] /* undef */
        and      ecx, HEX(80000000)
        shr      ecx, HEX(11)
        test     cl, 1

        /* test i#1520 bitfield sequence B */
        mov      ecx, DWORD [REG_XAX] /* undef */
        and


{
						unvisited = {hl_group = "Blue"},
						visited = {hl_group = "Green"},
						active = {hl_group = "Cyan"}
					}
				}),
				i(3, "text", {
					node_ext_opts = {
						unvisited = {hl_group = "Blue"},
						visited = {hl_group = "Green"},
						active = {hl_group = "Cyan"}
					}
				})
			})
		]]
		exec_lua("ls.snip_expand(" .. snip .. ")")
		screen:expect({
			grid = [[
			{7:^t}{8:ext}{5:texttext}                                      |
			{0:~                                                 }|
			{2:-- SELECT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		screen:expect({
			grid = [[
			{4:text}{7:^t}{8:ext}{5:text}                                      |
			{0:~                                                 }|
			{2:-- SELECT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		screen:expect({
			grid = [[
			{4:texttext}{7:^t}{8:ext}                                      |
			{0:~                                                 }|
			{2:-- SELECT --}                                      |]],
		})
	end)

	it("Inheritance", function()
		local snip = [[
			s("trig", {
				-- so the snippet is active at all.
				i(1, "text", {
					node_ext_opts = {
						snippet_passive = {hl_group = "Red"},
						passive = {hl_group = "Blue"},
						visited = {hl_group = "Green"},
						active = {hl_group = "Cyan"}
					}
				}),
				i(2, "text", {
					node_ext_opts = {
						passive = {hl_group = "Blue"},
						visited = {hl_group = "Green"},
						active = {hl_group = "Cyan"}
					}
				}),
			})
		]]
		exec_lua("ls.snip_expand(" .. snip .. ")")
		screen:expect({
			grid = [[
			{7:^t}{8:ext}{5:text}                                          |
			{0:~                                                 }|
			{2:-- SELECT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		screen:expect({
			grid = [[
			{4:text}{7:^t}{8:ext}                                          |
			{0:~                                                 }|
			{2:-- SELECT --}                                      |]],
		})
		exec_lua("ls.jump(1)")
		screen:expect({
			grid = [[
			{9:text}text^                                          |
			{0:~                                                 }|
			{2:-- INSERT --}                                      |]],
		})
	end)
end)


public object LiteralValue
        //
        // *******

        public TokensGroup(TokenType tokenType, IList<Token> originalTokens) :
            base(tokenType, originalTokens[0].StartIndex, originalTokens[originalTokens.Count - 1].StopIndex, originalTokens[originalTokens.Count - 1].UsesVirtualSpaceAtEndOfLine, originalTokens[0].TokensLine)
        {
            OriginalTokens = originalTokens;
        }

        /// <summary>
        /// Original tokens in the source text which were replaced
        /// </summary>
        public IList<Token> OriginalTokens { get; private set; }

        /// <summary>
        /// Debug string : concat the description of all OriginalTokens
        /// </summary>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            foreach(Token token in OriginalTokens)
            {
                sb.Append(token.ToString());
            }
            return sb.ToString();
        }

        /// <summary>
        /// Text returned to the parser :
        /// - The concatenation of SourceText of all OriginalTokens.
        /// </summary>
        public override string SourceText
        {
            get
            {
                StringBuilder sb = new StringBuilder();
                foreach (Token token in OriginalTokens)
                {
                    sb.Append(token.SourceText);
                }
                String t = sb.ToString();
                return t;
            }
        }

    }
}


/***
  This file is part of PulseAudio.

  Copyright 2006 Lennart Poettering

  PulseAudio is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as published
  by the Free Software Foundation; either version 2.1 of the License,
  or (at your option) any later version.

  PulseAudio is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
***/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <pulsecore/macro.h>

#include "once.h"

/* See http://www.hpl.hp.com/research/linux/atomic_ops/example.php4 for the
 * reference algorithm used here. */

bool pa_once_begin(pa_once *control) {
    pa_mutex *m;

    pa_assert(control);

    if (pa_atomic_load(&control->done))
        return false;

    /* Caveat: We have to make sure that the once func has completed
     * before returning, even if the once func is not actually
     * executed by us. Hence the awkward locking. */

    m = pa_static_mutex_get(&control->mutex, false, false);
    pa_mutex_lock(m);

    if (pa_atomic_load(&control->done)) {
        pa_mutex_unlock(m);
        return false;
    }

    return true;
}

void pa_once_end(pa_once *control) {
    pa_mutex *m;

    pa_assert(control);

    pa_assert(!pa_atomic_load(&control->done));
    pa_atomic_store(&control->done, 1);

    m = pa_static_mutex_get(&control->mutex, false, false);
    pa_mutex_unlock(m);
}

/* Not reentrant -- how could it be? */
void pa_run_once(pa_once *control, pa_once_func_t func) {
    pa_assert(control);
    pa_assert(func);

    if (pa_once_begin(control)) {
        func();
        pa_once_end(control);
    }
}


    const data = await API.account.refreshAccessToken({refreshToken});
    accessToken = data.accessToken;
  } catch (error) {
    // If we fail to refresh our access token then sign the user out!
    currentState = null;
    await Promise.all([
      SecureStore.deleteItemAsync(ACCESS_TOKEN_KEY),
      SecureStore.deleteItemAsync(REFRESH_TOKEN_KEY),
    ]);
    throw error;
  }

  // Update our current state with the new access token and save it in async
  // storage so that when the app restarts we can restore the user’s session.
  currentState = {accessToken, refreshToken, accessTokenExpiresAt: null};
  await SecureStore.setItemAsync(ACCESS_TOKEN_KEY, accessToken);
  return accessToken;
}

// Override `API.account.signIn` so that we save the access token and refresh
// token to async storage after the method successfully finishes executing.
const signIn = API.account.signIn;
(API as any).account.signIn = async (input: any, options: any) => {
  const {accessToken, refreshToken} = await signIn(input, options);
  currentState = {accessToken, refreshToken, accessTokenExpiresAt: null};
  await Promise.all([
    SecureStore.setItemAsync(ACCESS_TOKEN_KEY, accessToken),
    SecureStore.setItemAsync(REFRESH_TOKEN_KEY, refreshToken),
  ]);
  return {accessToken: "", refreshToken: ""};
};

// Override `API.account.signUp` so that we save the access token and refresh
// token to async storage after the method successfully finishes executing.
const signUp = API.account.signUp;
(API as any).account.signUp = async (input: any, options: any) => {
  const {accessToken, refreshToken} = await signUp(input, options);
  currentState = {accessToken, refreshToken, accessTokenExpiresAt: null};
  await Promise.all([
    SecureStore.setItemAsync(ACCESS_TOKEN_KEY, accessToken),
    SecureStore.setItemAsync(REFRESH_TOKEN_KEY, refreshToken),
  ]);
  return {accessToken: "", refreshToken: ""};
};

// Override `API.account.signOut` so that we send the refresh token from our
// local storage to the API and so that we purge our local state of all API
// request tokens.
//
// Ignore the input. We will be using the refresh token from our local storage.
const signOut = API.account.signOut;
(API as any).account.signOut = async (_input: any, options: any) => {
  // Get the current refresh token from our state.
  let refreshToken: RefreshToken | undefined;
  if (currentState !== null) {
    refreshToken = currentState.refreshToken;
  }

  // Clear our current state and async storage of all API tokens whether or not
  // our actual API request fails or succeeds.
  currentState = null;
  await Promise.all([
    SecureStore.deleteItemAsync(ACCESS_TOKEN_KEY),
    SecureStore.deleteItemAsync(REFRESH_TOKEN_KEY),
  ]);

  // Send a request to our API to destroy the refresh token using our original
  // `signOut` method before we wrapped it in this function.
  if (refreshToken !== undefined) {
    await signOut({refreshToken}, options);
  }

  // Successfully signed out!
  return {};
};
//需求 在当前的文件创建服务类 (Injectable)
//在服务类 封装一个方法 负责 网络通信 通信前显示一个loading 通信后 将loading 关闭
import {Injectable} from '@angular


/**
 * @file jiffies_timer.h
 * @brief O(1)复杂度定时器，设计参考linux kernel(4.9.10)的jiffies timer
 * @see https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/kernel/time/timer.c
 * Licensed under the MIT licenses.
 *
 * @note 可以根据实际需要自定义每个tick的间隔,所有的算法都是以tick为单位的
 *       4.9.10版本的jiffies_timer分为8-9级定时器，每级精度相差2^3倍，所有定时器列表集中存放在一个2^6*[8-9]=512-576个定时器列表
 *       由于本定时器是软实现，并不调用硬件时钟，所以如果tick精度很高的话开销比较大。这种情况请直接使用kernel的timer，因为内核版本会利用硬件时钟
 * @version 1.0
 * @author owent
 * @date 2017-02-16
 * @history
 *      2017-02-17: 第一版实现，暂时不加锁
 *      2025-06-30: 默认使用非线程安全的智能指针，支持自定义 allocator (除回调函数外)
 */

#pragma once

/**
 * 精度参考
 * HZ 1000 steps, LVL_BITS=6,LVL_CLK_SHIFT=3,LVL_DEPTH=9
 * Level Offset  Granularity            Range
 *  0      0         1 ms                0 ms -         63 ms
 *  1     64         8 ms               64 ms -        511 ms
 *  2    128        64 ms              512 ms -       4095 ms (512ms - ~4s)
 *  3    192       512 ms             4096 ms -      32767 ms (~4s - ~32s)
 *  4    256      4096 ms (~4s)      32768 ms -     262143 ms (~32s - ~4m)
 *  5    320     32768 ms (~32s)    262144 ms -    2097151 ms (~4m - ~34m)
 *  6    384    262144 ms (~4m)    2097152 ms -   16777215 ms (~34m - ~4h)
 *  7    448   2097152 ms (~34m)  16777216 ms -  134217727 ms (~4h - ~1d)
 *  8    512  16777216 ms (~4h)  134217728 ms - 1073741822 ms (~1d - ~12d)
 *
 * HZ  250, LVL_BITS=6,LVL_CLK_SHIFT=3,LVL_DEPTH=9
 * Level Offset  Granularity            Range
 *  0	     0         4 ms                0 ms -        255 ms
 *  1	    64        32 ms              256 ms -       2047 ms (256ms - ~2s)
 *  2	   128       256 ms             2048 ms -      16383 ms (~2s - ~16s)
 *  3	   192      2048 ms (~2s)      16384 ms -     131071 ms (~16s - ~2m)
 *  4	   256     16384 ms (~16s)    131072 ms -    1048575 ms (~2m - ~17m)
 *  5	   320    131072 ms (~2m)    1048576 ms -    8388607 ms (~17m - ~2h)
 *  6	   384   1048576 ms (~17m)   8388608 ms -   67108863 ms (~2h - ~18h)
 *  7	   448   8388608 ms (~2h)   67108864 ms -  536870911 ms (~18h - ~6d)
 *  8    512  67108864 ms (~18h) 536870912 ms - 4294967288 ms (~6d - ~49d)
 *
 * HZ  100, LVL_BITS=6,LVL_CLK_SHIFT=3,LVL_DEPTH=8
 * Level Offset  Granularity            Range
 *  0	   0         10 ms               0 ms -        630 ms
 *  1	  64         80 ms             640 ms -       5110 ms (640ms - ~5s)
 *  2	 128        640 ms            5120 ms -      40950 ms (~5s - ~40s)
 *  3	 192       5120 ms (~5s)     40960 ms -     327670 ms (~40s - ~5m)
 *  4	 256      40960 ms (~40s)   327680 ms -    2621430 ms (~5m - ~43m)
 *  5	 320     327680 ms (~5m)   2621440 ms -   20971510 ms (~43m - ~5h)
 *  6	 384    2621440 ms (~43m) 20971520 ms -  167772150 ms (~5h - ~1d)
 *  7	 448   20971520 ms (~5h) 167772160 ms - 1342177270 ms (~1d - ~15d)
 *
 * HZ  10, LVL_BITS=8,LVL_CLK_SHIFT=3,LVL_DEPTH=8
 * Level Offset  Granularity              Range
 *  0	     0        100 ms                 0 ms -       25500 ms (0s - ~25s)
 *  1	   256        800 ms             25600 ms -      204700 ms (25s - ~204s)
 *  2	   512       6400 ms (~6s)      204800 ms -     1638300 ms (~204s - ~27m)
 *  3	   768      51200 ms (~51s)    1638400 ms -    13107100 ms (~27m - ~3h)
 *  4   1024     409600 ms (~409s)  13107200 ms -   104857500 ms (~3h - ~29h)
 *  5   1280    3276800 ms (~55m)  104857600 ms -   838860700 ms (~29h - ~9d)
 *  6   1536   26214400 ms (~7h)   838860800 ms -  6710886300 ms (~9d - ~77d)
 *  7   1792  209715200 ms (~58h) 6710886400 ms - 13421772700 ms (~19d - ~621d)
 */

#include <config/compile_optimize.h>
#include <config/compiler_features.h>

#include <config/atframe_utils_build_feature.h>

#include <memory/rc_ptr.h>

#include <assert.h>
#include <stdint.h>
#include <bitset>
#include <cstddef>
#include <cstring>
#include <ctime>
#include <functional>
#include <list>
#include <memory>

ATFRAMEWORK_UTILS_NAMESPACE_BEGIN
namespace time {
/**
 * @brief jiffies timer 定时器实现
 * @note 空间复杂度: O(LVL_DEPTH * 2^LVL_BITS * sizeof(std::list))

 *       每次tick的最低时间复杂度: O(LVL_DEPTH)

 *       每层定时器误差倍数: 2^LVL_CLK_SHIFT

 *       最大定时器范围: 2^(LVL_CLK_SHIFT * (LVL_DEPTH - 1) + LVL_BITS) * tick周期

 * @note 如果外部需要引用定时器对象，请使用 timer_t 代替函数签名中的 timer_type
 */
template <time_t LVL_BITS = 6, time_t LVL_CLK_SHIFT = 3, size_t LVL_DEPTH = 8,
          memory::compat_strong_ptr_mode PTR_MODE = memory::compat_strong_ptr_mode::kStrongRc>
class ATFRAMEWORK_UTILS_API_HEAD_ONLY jiffies_timer {
 public


a0§7: §aShow all\n" +
            "§c20§7: §cHide all"
    )
    @ConfigEditorSlider(minValue = 0f, maxValue = 20f, minStep = 1f)
    var essenceThreshold: Int = 5

    enum class SimplePowderMiningRewardTypes(val displayName: String) {
        ASCENSION_ROPE("§9Ascension Rope"),
        WISHING_COMPASS("§aWishing Compass"),
        OIL_BARREL("§aOil Barrel"),
        PREHISTORIC_EGG("§fPrehistoric Egg"),
        PICKONIMBUS("§5Pickonimbus 2000"),
        JUNGLE_HEART("§6Jungle Heart"),
        SLUDGE_JUICE("§aSludge Juice"),
        YOGGIE("§aYoggie"),
        ROBOT_PARTS("§9Robot Parts"),
        TREASURITE("§5Treasurite"),
        ;

        override fun toString() = displayName
    }

    @Expose
    @ConfigOption(name = "Common Items", desc = "Hide reward messages for listed items.")
    @ConfigEditorDraggableList
    val simplePowderMiningTypes: MutableList<SimplePowderMiningRewardTypes> = mutableListOf(
        SimplePowderMiningRewardTypes.ASCENSION_ROPE,
        SimplePowderMiningRewardTypes.WISHING_COMPASS,
        SimplePowderMiningRewardTypes.OIL_BARREL,
        SimplePowderMiningRewardTypes.JUNGLE_HEART,
        SimplePowderMiningRewardTypes.SLUDGE_JUICE,
        SimplePowderMiningRewardTypes.YOGGIE,
        SimplePowderMiningRewardTypes.TREASURITE
    )

    @Expose
    @ConfigOption(name = "Goblin Egg", desc = "Hide Goblin Egg rewards that are below a certain rarity.")
    @ConfigEditorDropdown
    var goblinEggs: GoblinEggEntry = GoblinEggEntry.YELLOW_UP

    enum class GoblinEggEntry(val displayName: String) {
        SHOW_ALL("Show all"),
        HIDE_ALL("Hide all"),
        GREEN_UP("Show §aGreen §7and up"),
        YELLOW_UP("Show §eYellow §7and up"),
        RED_UP("Show §cRed §7and up"),
        BLUE_ONLY("Show §3Blue §7only");

        override fun toString() = displayName
    }

    @Expose
    @ConfigOption(name = "Gemstones", desc = "")
    @Accordion
    val gemstone: PowderMiningGemstoneConfig = PowderMiningGemstoneConfig()
}
package at.hannibal2.skyhanni.config.features.event.hoppity

import at.hannibal2.skyhanni.config.FeatureToggle
import com.google.gson.annotations.Expose
import io.github.notenoughupdates.moulconfig.ChromaColour
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption

class HoppityWaypointsConfig {
    @Expose
    @ConfigOption(name = "Enabled", desc = "Toggle guess waypoints for Hoppity's Hunt.")
    @ConfigEditorBoolean
    @FeatureToggle
    var enabled: Boolean = true

    @Expose
    @ConfigOption(
        name = "Shared Waypoints",
        desc = "Enable being able to share and receive egg waypoints in your lobby."
    )
    @ConfigEditorBoolean
    @FeatureToggle
    var shared: Boolean = true

    @Expose
    @ConfigOption(name = "Color", desc = "Color of the waypoint.")
    @ConfigEditorColour
    var color: ChromaColour = ChromaColour.fromStaticRGB(46, 224, 73, 53)

    @Expose
    @ConfigOption(name = "Show Line", desc = "Show a line to the waypoint.")
    @ConfigEditorBoolean
    @FeatureToggle
    var showLine: Boolean = false

    @Expose
    @ConfigOption(name = "Show Path Finder", desc


 display:block;
}
.ace-thumbnails > li > .tools{
 filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C000000', endColorstr='#8C000000', GradientType=0) !important;
}
.ace-thumbnails > li > :first-child > .text{
 filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8C000000', endColorstr='#8C000000', GradientType=0) !important;
}

.btn.btn-app.btn-light {
  border: 1px solid #D9D9D9;
}
.btn.btn-app.btn-yellow {
  border: 1px solid #FEE188;
}

.widget-box-overlay {
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#55000000', endColorstr='#55000000',GradientType=0 ) !important;
}
.ace-file-overlay {
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7F000000', endColorstr='#7F000000',GradientType=0 ) !important;
}
.ace-file-overlay  > .ace-icon, .ace-file-overlay  > .fa, .ace-file-overlay  > .glyphicon {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: transparent url('images/loading.gif') no-repeat center;
}
.ace-file-overlay  > .ace-icon:before, .ace-file-overlay  > .fa:before, .ace-file-overlay  > .glyphicon:before {
  display: none;
}

.grid3 {
 width:31%;
}
.grid4 {
 width:23%;
}

.itemdiv.dialogdiv > .body:before{
 display:none;
}

.fc-event-hori, .fc-event-vert {
 border-width: 0 !important;
}

[class*="tab-color-"] .nav-tabs > li > a > .ace-icon:first-child,
[class*="tab-color-"] .nav-tabs > li > a > .fa:first-child
 {
 color: #666 !important;
}

.dropdown-preview > .dropdown-menu {
 *width: 180px;
}

/*jquery ui*/
.ui-datepicker , .ui-autocomplete , .ui-menu{
  border:1px solid #CCC;
}
.ui-widget-overlay  {
  filter:alpha(opacity=100) !important;
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#44000000', endColorstr='#44000000',GradientType=0 ) !important;
}

.message-content {
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CCFFFFFF', endColorstr='#CCFFFFFF',GradientType=0 ) !important;
}

/* semi transparent gritter backgrounds */
.gritter-item-wrapper {
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EA323232', endColorstr='#EA323232',GradientType=0 ) !important; /* IE6-9 */
}
.gritter-item-wrapper.gritter-info {
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EA315185', endColorstr='#EA315185',GradientType=0 ) !important; /* IE6-9 */
}
.gritter-item-wrapper.gritter-error {
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EA992812', endColorstr='#EA992812',GradientType=0 ) !important; /* IE6-9 */
}
.gritter-item-wrapper.gritter-success {
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EA59834B', endColorstr='#EA59834B',GradientType=0 ) !important; /* IE6-9 */
}
.gritt


rmatter: ILogMessageFormatter;
    private readonly _configuration: ILoggingConfiguration;

    constructor(
        formatter: ILogMessageFormatter,
        configuration: ILoggingConfiguration
    ) {
        this._formatter = formatter;
        this._configuration = Object.freeze(configuration);
    }

    public logCritical(message: ILogMessage): void {
        this._printLogMessage('error', message, LogLevel.CRITICAL);
    }

    public logDebug(message: ILogMessage): void {
        this._printLogMessage('debug', message, LogLevel.DEBUG);
    }

    public logError(message: ILogMessage): void {
        this._printLogMessage('error', message, LogLevel.ERROR);
    }

    public logSuccess(message: ILogMessage): void {
        this._printLogMessage('log', message, LogLevel.SUCCESS);
    }

    public logVerbose(message: ILogMessage): void {
        this._printLogMessage('log', message, LogLevel.VERBOSE);
    }

    public logWarning(message: ILogMessage): void {
        this._printLogMessage('warn', message, LogLevel.WARNING);
    }

    private _printLogMessage(
        method: ConsoleMethod,
        logMessage: ILogMessage,
        logLevel: LogLevel
    ): void {
        const { message, styles } = this._createFormattedLogMessage(
            logMessage,
            logLevel
        );

        (console[method] as Function)(message, ...styles);

        if (logMessage.trace) {
            this._printTrace(logMessage.trace);
        }
    }

    private _getStylesForLogLevel(logLevel: LogLevel): ILogLevelConfiguration {
        return this._configuration[
            LogLevel[logLevel].toLowerCase() as keyof ILoggingConfiguration
        ];
    }

    private _createFormattedLogMessage(
        message: ILogMessage,
        logLevel: LogLevel
    ): IFormattedLogMessage {
        const { messageStyle, prefixStyle } = this._getStylesForLogLevel(
            logLevel
        );
        const prefix = this._createLogMessagePrefix(
            message.subject,
            prefixStyle
        );
        return {
            message: `${prefix.message}%c${this._formatter.format(
                message,
                logLevel
            )}`,
            styles: [
                ...prefix.styles,
                `${this._convertConsoleStyleToString(
                    messageStyle
                )} font-weight: bold;`
            ]
        };
    }

    private _createLogMessagePrefix(
        prefixLabel: string,
        prefixStyle: ILoggingStyle
    ): IFormattedLogMessage {
        return {
            message: `%c${prefixLabel}`,
            styles: [
                `${this._convertConsoleStyleToString(
                    prefixStyle
                )} font-weight: bold; padding: 2px 0.5em; border-radius: 0.5em; margin-right: 5px;`
            ]
        };
    }

    private _convertConsoleStyleToString(style: ILoggingStyle): string {
        return `color: ${
            style.textColor
        }; background-color: ${style.backgroundColor || 'white'};`;
    }

    private _printTrace(trace: string): void {
        console.group('Trace');
        console.log(trace);
        console.groupEnd();
    }
}

interface IFormattedLogMessage {
    message: string;
    styles: Array<string>;
}

type ConsoleMethod = Exclude<keyof Console, 'Console'>;
import isFunction from 'lodash/isFunction';
import isBoolean from 'lodash/isBoolean';
import { computed, nextTick } from 'vue';
import dayjs from 'dayjs';
import { COMPONENT_NAME }


डे | टी–शर्ट | नीला | पोषाक | शर्ट',
    ),
    Emoji(
      '👖',
      'कपडे | जींस | ट्राउज़र | नीला | पैंट्स | पोषाक',
    ),
    Emoji(
      '🧣',
      'गर्दन | गला | गुलूबंद | ठण्ड | दुपट्टा | सर्दी | स्कार्फ़',
    ),
    Emoji(
      '🧤',
      'दस्ताने | हाथ | हाथ, दस्ताने, दस्ताना',
    ),
    Emoji(
      '🧥',
      'कोट | जैकेट | सर्दी',
    ),
    Emoji(
      '🧦',
      'जुराब | जुराबें | मोज़े | मौज़ा',
    ),
    Emoji(
      '👗',
      'कपडे | ड्रेस | पोषाक | वन पीस',
    ),
    Emoji(
      '👘',
      'कपडे | किमोनो | ड्रेस | पोषाक',
    ),
    Emoji(
      '👙',
      'कपडे | पोषाक | बाथिंग सूट | बिकनी',
    ),
    Emoji(
      '👚',
      'कपडे | कपड़े | पोषाक | महिला के कपड़े | महिलाओं के परिधान',
    ),
    Emoji(
      '👛',
      'कपडे | कॉइन पर्स | पर्स | पोषाक | सिक्का',
    ),
    Emoji(
      '👜',
      'कपडे | पोषाक | बैग | हैंडबैग',
    ),
    Emoji(
      '👝',
      'कपडे | पाउच | पोषाक | बैग',
    ),
    Emoji(
      '🎒',
      'बस्ता | विद्यालय | स्कूल का बस्ता | स्कूल बैग',
    ),
    Emoji(
      '👞',
      'कपडे | जूते | पुरुषों का जूता | पुरुषों के जूते | पोषाक | भूरा',
    ),
    Emoji(
      '👟',
      'एथलेटिक जूता | एथलेटिक जूते | कपडे | जूते | दौड़ने वाले जूते | पोषाक | स्नीकर',
    ),
    Emoji(
      '🥾',
      'कैंपिंग | जूता | जूते | पह


rror) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetDatabaseId", dbName, snapshot)
	ret0, _ := ret[0].(uint64)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetDatabaseId indicates an expected call of GetDatabaseId.
func (mr *MockCompilerContext2MockRecorder) GetDatabaseId(dbName, snapshot interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDatabaseId", reflect.TypeOf((*MockCompilerContext2)(nil).GetDatabaseId), dbName, snapshot)
}

// GetLowerCaseTableNames mocks base method.
func (m *MockCompilerContext2) GetLowerCaseTableNames() int64 {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetLowerCaseTableNames")
	ret0, _ := ret[0].(int64)
	return ret0
}

// GetLowerCaseTableNames indicates an expected call of GetLowerCaseTableNames.
func (mr *MockCompilerContext2MockRecorder) GetLowerCaseTableNames() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLowerCaseTableNames", reflect.TypeOf((*MockCompilerContext2)(nil).GetLowerCaseTableNames))
}

// GetProcess mocks base method.
func (m *MockCompilerContext2) GetProcess() *process.Process {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetProcess")
	ret0, _ := ret[0].(*process.Process)
	return ret0
}

// GetProcess indicates an expected call of GetProcess.
func (mr *MockCompilerContext2MockRecorder) GetProcess() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProcess", reflect.TypeOf((*MockCompilerContext2)(nil).GetProcess))
}

// GetQueryResultMeta mocks base method.
func (m *MockCompilerContext2) GetQueryResultMeta(uuid string) ([]*ColDef, string, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetQueryResultMeta", uuid)
	ret0, _ := ret[0].([]*ColDef)
	ret1, _ := ret[1].(string)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}

// GetQueryResultMeta indicates an expected call of GetQueryResultMeta.
func (mr *MockCompilerContext2MockRecorder) GetQueryResultMeta(uuid interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryResultMeta", reflect.TypeOf((*MockCompilerContext2)(nil).GetQueryResultMeta), uuid)
}

// GetQueryingSubscription mocks base method.
func (m *MockCompilerContext2) GetQueryingSubscription() *SubscriptionMeta {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetQueryingSubscription")
	ret0, _ := ret[0].(*SubscriptionMeta)
	return ret0
}

// GetQueryingSubscription indicates an expected call of GetQueryingSubscription.
func (mr *MockCompilerContext2MockRecorder) GetQueryingSubscription() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryingSubscription", reflect.TypeOf((*MockCompilerContext2)(nil).GetQueryingSubscription))
}

// GetRootSql mocks base method.
func (m *MockCompilerContext2) GetRootSql() string {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetRootSql")


Service := NewPriceService(
				lggr,
				nil,
				jobId,
				destChainSelector,
				sourceChainSelector,
				tc.sourceNativeToken,
				priceGetter,
				nil,
			).(*priceService)
			priceService.gasPriceEstimator = gasPriceEstimator

			sourceGasPriceUSD, err := priceService.observeGasPriceUpdates(context.Background(), lggr)
			if tc.expErr {
				assert.Error(t, err)
				return
			}
			assert.NoError(t, err)
			assert.True(t, tc.expSourceGasPriceUSD.Cmp(sourceGasPriceUSD) == 0)
		})
	}
}

func TestPriceService_observeTokenPriceUpdates(t *testing.T) {
	lggr := logger.TestLogger(t)
	jobId := int32(1)
	destChainSelector := uint64(12345)
	sourceChainSelector := uint64(67890)
	sourceNativeToken := cciptypes.Address(utils.RandomAddress().String())

	const nTokens = 10
	tokens := make([]cciptypes.Address, nTokens)
	for i := range tokens {
		tokens[i] = cciptypes.Address(utils.RandomAddress().String())
	}
	sort.Slice(tokens, func(i, j int) bool { return tokens[i] < tokens[j] })

	testCases := []struct {
		name                string
		destTokens          []cciptypes.Address
		tokenDecimals       map[cciptypes.Address]uint8
		sourceNativeToken   cciptypes.Address
		filterOutTokens     []cciptypes.Address
		priceGetterRespData map[cciptypes.Address]*big.Int
		priceGetterRespErr  error
		expTokenPricesUSD   map[cciptypes.Address]*big.Int
		expErr              bool
		expDecimalErr       bool
	}{
		{
			name: "base case with src native token not equals to dest token",
			tokenDecimals: map[cciptypes.Address]uint8{ // only destination tokens
				tokens[1]: 18,
				tokens[2]: 12,
			},
			sourceNativeToken: sourceNativeToken,
			priceGetterRespData: map[cciptypes.Address]*big.Int{ // should return all tokens (including source native token)
				sourceNativeToken: val1e18(100),
				tokens[1]:         val1e18(200),
				tokens[2]:         val1e18(300),
			},
			priceGetterRespErr: nil,
			expTokenPricesUSD: map[cciptypes.Address]*big.Int{ // should only return the tokens in destination chain
				tokens[1]: val1e18(200),
				tokens[2]: val1e18(300 * 1e6),
			},
			expErr: false,
		},
		{
			name: "base case with src native token equals to dest token",
			tokenDecimals: map[cciptypes.Address]uint8{
				sourceNativeToken: 18,
				tokens[1]:         12,
			},
			sourceNativeToken: sourceNativeToken,
			priceGetterRespData: map[cciptypes.Address]*big.Int{
				sourceNativeToken: val1e18(100),
				tokens[1]:         val1e18(200),
			},
			priceGetterRespErr: nil,
			expTokenPricesUSD: map[cciptypes.Address]*big.Int{
				sourceNativeToken: val1e18(100),
				tokens[1]:         val1e18(200 * 1e6),
			},
			expErr: false,
		},
		{
			name: "price getter returned an error",
			tokenDecimals: map[cciptypes.Address]uint8{
				tokens[0]: 18,
				tokens[1]: 18,
			},
			sourceNativeToken:   to


ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}` >/dev/null 2>&1")
  Execute( [cmd1],
    not_if  = no_op_test
  )

# the version of hadoop-auth jar files in bigtop 0.8 oozie is wrong
def correct_hadoop_auth_jar_files():

  hadoop_auth_jar_file = "/usr/lib/hadoop/hadoop-auth-2.4.1.jar"

  if not os.path.exists(hadoop_auth_jar_file):
    raise Fail("Could not find %s" % (hadoop_auth_jar_file))

  commands = ' '.join(
    (
      "if [ -f /usr/lib/oozie/lib/hadoop-auth-2.0.2-alpha.jar ];",
      "then",
      "rm -rf /usr/lib/oozie/lib/hadoop-auth-2.0.2-alpha.jar;",
      "cp " + hadoop_auth_jar_file + " /usr/lib/oozie/lib;",
      "fi"
    )
  )
  Execute(commands)

  commands = ' '.join(
    (
      "if [ -f /usr/lib/oozie/libtools/hadoop-auth-2.0.2-alpha.jar ];",
      "then",
      "rm -rf /usr/lib/oozie/libtools/hadoop-auth-2.0.2-alpha.jar;",
      "cp " + hadoop_auth_jar_file + " /usr/lib/oozie/libtools;",
      "fi"
    )
  )
  Execute(commands)


draw_framebuffer:

	; 2 + (4*(X*8)+5) -1 =
	; 2 + 4*(8+5) -1 = 85

	ldx	#4					; 2
fb4_loop:
	lda	FRAMEBUFFER+0				; 3
	sta	$5a8+18-1,x				; 5
	dex						; 2
	bne	fb4_loop				; 3

	; 2 + (12*(X*8)+5) -1 =
	; 2 + 12*(16+5) -1 = 253

	ldx	#12					; 2
fb12_loop:
	lda	FRAMEBUFFER+1				; 3
	sta	$628+14-1,x				; 5
	lda	FRAMEBUFFER+2				; 3
	sta	$6a8+14-1,x				; 5
	dex						; 2
	bne	fb12_loop				; 3

	; 2 + (20*(X*8)+5) -1 =
	; 2 + 20*(16+5) -1 = 421

	ldx	#20					; 2
fb20_loop:
	lda	FRAMEBUFFER+3				; 3
	sta	$728+10-1,x				; 5
	lda	FRAMEBUFFER+4				; 3
	sta	$7a8+10-1,x				; 5
	dex						; 2
	bne	fb20_loop				; 3

	; 2 + (28*(X*8)+5) -1 =
	; 2 + 28*(24+5) -1 = 813

	ldx	#28					; 2
fb28_loop:
	lda	FRAMEBUFFER+5				; 3
	sta	$450+6-1,x				; 5
	lda	FRAMEBUFFER+6				; 3
	sta	$4d0+6-1,x				; 5
	lda	FRAMEBUFFER+7				; 3
	sta	$550+6-1,x				; 5
	dex						; 2
	bne	fb28_loop				; 3

	; 2 + (36*(X*8)+5) -1 =
	; 2 + 36*(16+5) -1 = 757

	ldx	#36					; 2
fb36_loop:
	lda	FRAMEBUFFER+8				; 3
	sta	$5d0+2-1,x				; 5
	lda	FRAMEBUFFER+9				; 3
	sta	$650+2-1,x				; 5
	dex						; 2
	bne	fb36_loop				; 3

	; 2 + (40*(X*8)+5) -1 =
	; 2 + 40*(24+5) + -1 = 1161

	ldx	#40					; 2
fb40_loop:
	lda	FRAMEBUFFER+10				; 3
	sta	$6d0-1,x				; 5
	lda	FRAMEBUFFER+11				; 3
	sta	$750-1,x				; 5
	lda	FRAMEBUFFER+12				; 3
	sta	$7d0-1,x				; 5
	dex						; 2
	bne	fb40_loop				; 3

							; -1
	rts						; 6

;.align $100
;.include "screen_split.s"
;background_hgr:
;.incbin "SB_BACKGROUNDC.BIN.lz4",11
;background_hgr_end:

score_text:
.byte 0,0
.asciiz "LEVEL:6  LIVES:2  SCORE:001978 HI:002018"

; Note on the distance calculations
; we use something simplistic here
; see http://www.extentofthejam.com/pseudo/

; "Texture": 64?
; 0    GREY	5,7,f,7,5,0,0,0
; 1		0,0,0,0,0,0,0,0
; 2    BLUE	2,6,f,6,2,0,0,0
; 3		0,0,0,0,0,0,0,0
; 4    GREEN	4,c,f,c,4,0,0,0
; 5		0,0,0,0,0,0,0,0
; 6    RED	1,b,f,b,1,0,0


Etrue for etrue
	ElectModeEtrue = iota
	// ElectModeFake for Test purpose
	ElectModeFake
)

var (
	// maxUint256 is a big integer representing 2^256-1
	maxUint256 = new(big.Int).Exp(big.NewInt(2), big.NewInt(256), big.NewInt(0))
)

var (
	ErrCommittee     = errors.New("get committee failed")
	ErrInvalidMember = errors.New("invalid committee member")
	ErrInvalidSwitch = errors.New("invalid switch block info")
)

type candidateMember struct {
	coinbase   common.Address
	address    common.Address
	publickey  *ecdsa.PublicKey
	difficulty *big.Int
	upper      *big.Int
	lower      *big.Int
}

type committee struct {
	id                  *big.Int
	beginFastNumber     *big.Int // the first fast block proposed by this committee
	endFastNumber       *big.Int // the last fast block proposed by this committee
	firstElectionNumber *big.Int // the begin snailblock to elect members
	lastElectionNumber  *big.Int // the end snailblock to elect members
	switchCheckNumber   *big.Int // the snailblock that start switch next committee
	members             types.CommitteeMembers
	backupMembers       types.CommitteeMembers
	switches            []*big.Int // blocknumbers whose block include switchinfos
}

// Members returns dump of the committee members
func (c *committee) Members() []*types.CommitteeMember {
	members := make([]*types.CommitteeMember, len(c.members))
	copy(members, c.members)
	return members
}

// Members returns dump of the backup committee members
func (c *committee) BackupMembers() []*types.CommitteeMember {
	members := make([]*types.CommitteeMember, len(c.backupMembers))
	copy(members, c.backupMembers)
	return members
}

func (c *committee) setMemberState(pubkey []byte, flag uint32) {
	for i, m := range c.members {
		if bytes.Equal(m.Publickey, pubkey) {
			c.members[i] = &types.CommitteeMember{
				Coinbase:  m.Coinbase,
				Publickey: m.Publickey,
				Flag:      flag,
			}
			break
		}
	}
	for i, m := range c.backupMembers {
		if bytes.Equal(m.Publickey, pubkey) {
			c.backupMembers[i] = &types.CommitteeMember{
				Coinbase:  m.Coinbase,
				Publickey: m.Publickey,
				Flag:      flag,
			}
			break
		}
	}
}

type Election struct {
	chainConfig *params.ChainConfig

	genesisCommittee []*types.CommitteeMember
	defaultMembers   []*types.CommitteeMember

	commiteeCache *lru.Cache
	epochCache    *lru.Cache

	electionMode    ElectMode
	committee       *committee
	nextCommittee   *committee
	mu              sync.RWMutex
	testPrivateKeys []*ecdsa.PrivateKey

	startSwitchover bool //Flag bit for handling event switching
	singleNode      bool

	electionFeed event.Feed
	scope        event.SubscriptionScope

	prepare    bool
	disabled   bool
	switchNext chan struct{}

	snailChainEventCh  chan types.SnailChainEvent
	snailChainEventSub event.Subscription

	fastchain  BlockChain
	snailchain SnailBlockChain

	engine consensus.Engine
}

type BlockChain interface {
	CurrentBlock() *types.Block

	CurrentHeader() *types.Header

	GetBlockByNumber(number uint64) *types.Block

	StateAt(root common.Hash) (*state.StateDB, error)
}

// SnailLightChain encapsulates functions required to synchronise a light chain.
type SnailLightChain interface {
	// CurrentHeader retrieves the head header from the local chain.
	CurrentHeader() *types.SnailHea


_table.0))
            .unwrap();

        let ele = Iovec {
            iov_base: GuestAddress(0xff),
            iov_len: std::mem::size_of::<Iovec>() as u64,
        };
        mem_space
            .write_object::<Iovec>(&ele, GuestAddress(0x2000))
            .unwrap();
        mem_space
            .write_object::<u16>(&0, GuestAddress(queue_config_inf.avail_ring.0 + 4 as u64))
            .unwrap();
        mem_space
            .write_object::<u16>(&1, GuestAddress(queue_config_inf.avail_ring.0 + 2 as u64))
            .unwrap();

        assert!(handler.process_balloon_queue(BALLOON_INFLATE_EVENT).is_ok());
        assert_eq!(handler.get_balloon_memory_size(), 0);
        assert_eq!(qmp_query_balloon(), Some(MEMORY_SIZE));

        // SplitVringDesc for deflate.
        let desc = SplitVringDesc {
            addr: GuestAddress(0x2000),
            len: 4,
            flags: 1,
            next: 1,
        };

        mem_space
            .write_object::<SplitVringDesc>(&desc, GuestAddress(queue_config_def.desc_table.0))
            .unwrap();

        mem_space
            .write_object::<Iovec>(&ele, GuestAddress(0x3000))
            .unwrap();
        mem_space
            .write_object::<u16>(&0, GuestAddress(queue_config_def.avail_ring.0 + 4 as u64))
            .unwrap();
        mem_space
            .write_object::<u16>(&1, GuestAddress(queue_config_def.avail_ring.0 + 2 as u64))
            .unwrap();

        assert!(handler.process_balloon_queue(BALLOON_DEFLATE_EVENT).is_ok());
    }

    #[test]
    fn test_balloon_activate() {
        let mem_space = address_space_init();
        let interrupt_evt = EventFd::new(libc::EFD_NONBLOCK).unwrap();
        let interrupt_status = Arc::new(AtomicU32::new(0));
        let interrupt_cb = Arc::new(Box::new(
            move |int_type: &VirtioInterruptType, _queue: Option<&Queue>| {
                let status = match int_type {
                    VirtioInterruptType::Config => VIRTIO_MMIO_INT_CONFIG,
                    VirtioInterruptType::Vring => VIRTIO_MMIO_INT_VRING,
                };
                interrupt_status.fetch_or(status, Ordering::SeqCst);
                interrupt_evt.write(1).chain_err(|| ErrorKind::EventFdWrite)
            },
        ) as VirtioInterrupt);

        let mut queue_config_inf = QueueConfig::new(QUEUE_SIZE);
        queue_config_inf.desc_table = GuestAddress(0);
        queue_config_inf.avail_ring = GuestAddress(4096);
        queue_config_inf.used_ring = GuestAddress(8192);
        queue_config_inf.ready = true;
        queue_config_inf.size = QUEUE_SIZE;

        let mut queues: Vec<Arc<Mutex<Queue>>> = Vec::new();
        let queue1 = Arc::new(Mutex::new(Queue::new(queue_config_inf, 1).unwrap()));
        queues.push(queue1);
        let event_inf = EventFd::new(libc::EFD_NONBLOCK).unwrap();
        let queue_evts: Vec<EventFd> = vec![event_inf.try_clone().unwrap()];

        let bln_cfg = BalloonConfig {
            id: "bln".to_string(),
            deflate_on_oom: true,
        };


;
        }
      }
    }
    return DefUseEffect.UNCHANGED;
  }

  private static DefUseEffect intAnd(Instruction s, OptOptions opts) {
    if (opts.SIMPLIFY_INTEGER_OPS) {
      canonicalizeCommutativeOperator(s);
      Operand op1 = Binary.getVal1(s);
      Operand op2 = Binary.getVal2(s);
      if (op1.similar(op2)) {
        // THE SAME OPERAND: x & x == x
        Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s));
        return op1.isConstant() ? DefUseEffect.MOVE_FOLDED : DefUseEffect.MOVE_REDUCED;
      }
      if (op2.isIntConstant()) {
        int val2 = op2.asIntConstant().value;
        if (op1.isIntConstant()) {
          // BOTH CONSTANTS: FOLD
          int val1 = op1.asIntConstant().value;
          Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(val1 & val2));
          return DefUseEffect.MOVE_FOLDED;
        } else {
          // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS
          if (val2 == 0) {                  // x & 0 == 0
            Move.mutate(s, INT_MOVE, Binary.getClearResult(s), IC(0));
            return DefUseEffect.MOVE_FOLDED;
          }
          if (val2 == -1) {                 // x & -1 == x & 0xffffffff == x
            Move.mutate(s, INT_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s));
            return DefUseEffect.MOVE_REDUCED;
          }
        }
      }
    }
    return DefUseEffect.UNCHANGED;
  }

  private static DefUseEffect intDiv(AbstractRegisterPool regpool, Instruction s, OptOptions opts) {
    if (opts.SIMPLIFY_INTEGER_OPS) {
      Operand op1 = GuardedBinary.getVal1(s);
      Operand op2 = GuardedBinary.getVal2(s);
      if (op1.similar(op2)) {
        // THE SAME OPERAND: x / x == 1
        Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), IC(1));
        return DefUseEffect.MOVE_FOLDED;
      }
      if (op2.isIntConstant()) {
        int val2 = op2.asIntConstant().value;
        if (val2 == 0) {
          // TODO: This instruction is actually unreachable.
          // There will be an INT_ZERO_CHECK
          // guarding this instruction that will result in an
          // ArithmeticException.  We
          // should probabbly just remove the INT_DIV as dead code.
          return DefUseEffect.UNCHANGED;
        }
        if (op1.isIntConstant()) {
          // BOTH CONSTANTS: FOLD
          int val1 = op1.asIntConstant().value;
          Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), IC(val1 / val2));
          return DefUseEffect.MOVE_FOLDED;
        } else {
          // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS
          if (val2 == 1) {                  // x / 1 == x;
            Move.mutate(s, INT_MOVE, GuardedBinary.getClearResult(s), GuardedBinary.getClearVal1(s));
            return DefUseEffect.MOVE_REDUCED;
          }
          // x / c == (x + (((1 << c) - 1) & (x >> 31))) >> c .. if c is power of 2
          if (s.hasPrev()) {
            int power = PowerOf2(val2);
            if (power != -1) {
              RegisterOperand tempInt1 = regpool.makeTempInt();
              RegisterOperand tempInt2 = regpool.makeTempInt();
              RegisterOperand tempInt3 = regpool.mak


*/ f();

    var /*@ type=C* */ v5 = super /*@target=Base.[]*/ /*@target=Base.[]=*/ [
        /*@ typeArgs=Index* */ f()] /*@target=B.&*/ &= /*@ typeArgs=A* */ f();

    var /*@ type=B* */ v6 = /*@target=B.-*/ --super /*@target=Base.[]*/ /*@target=Base.[]=*/ [
        /*@ typeArgs=Index* */ f()];

    var /*@ type=B* */ v7 = super /*@target=Base.[]*/ /*@target=Base.[]=*/ [
        /*@ typeArgs=Index* */ f()] /*@target=B.-*/ --;
  }
}

main() {}
// Copyright (c) 2023, 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.

// Derived from co19/LanguageFeatures/Patterns/map_A04_t01

class C {
  const C();
}

const c1 = C();
const c2 = C();

String test1(Map map) {
  return switch (map) {
    {const C(): 1, const C(): 2} => "",
    {1: 1, 1: 2} => "",
    {c1: var a1, c2: final b1} => "",
    {3.14: var a2, 3.14: final b2} => "",
    {"x": var a3, "x": final b3} => "",
    _ => "default"
  };
}

void test2(Map map) {
  switch (map) {
    case {const C(): 1, const C(): 2}:
      break;
    case {1: 1, 1: 2}:
      break;
    case {c1: var a1, c2: final b1}:
    case {3.14: var a2, 3.14: final b2}:
      break;
    case {"x": var a3, "x": final b3}:
      break;
  }
}

void test3(Map map) {
  if (map case {const C(): 1, const C(): 2}) {
  }
  if (map case {1: 1, 1: 2}) {
  }
  if (map case {c1: var a1, c2: final b1}) {
  }
  if (map case {3.14: var a2, 3.14: final b2}) {
  }
  if (map case {"x": var a3, "x": final b3}) {
  }
}

test() {
  var {const C(): a, const C(): b} = {const C(): 1};
  var {1: c, 1: d} = {1: 2};
  final {c1: var a1, c2: final b1} = {c2: 2};
  final {3.14: var a2, 3.14: final b2} = {3.14: 1};
  final {"x": var a3, "x": final b3} = {"x": 1};
}// Copyright (c) 2023, 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.

enum E { a, b, c }

class PrimitiveEquals {
  final int field;

  const PrimitiveEquals(this.field);
}

class NonPrimitiveEquals {
  final int field;

  const NonPrimitiveEquals(this.field);

  int get hashCode => field.hashCode;

  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is NonPrimitiveEquals && field == other.field;
  }
}

switchStatement(o) {
  switch (o) {
    case [var a] when a > 5:
    case [_, var a] when a < 5:
      print(a);
    case {1: var a}:


effect_tactic = {
			320111
		}
	},
	[32012] = {
		name = "巡洋指揮",
		exp = 3,
		next_id = 32013,
		id = 32012,
		icon = "buff",
		lv = 2,
		desc = {
			{
				1,
				"作為參謀位指揮喵時，依據指揮喵指揮屬性，提高所在艦隊中輕巡、重巡的炮擊屬性(效果小)"
			},
			{
				2,
				"作為參謀位指揮喵時，依據指揮喵後勤屬性，提高所在艦隊中輕巡、重巡的雷擊屬性(效果小)"
			},
			{
				3,
				"作為參謀位指揮喵時，依據指揮喵指揮屬性，提高所在艦隊中輕巡、重巡的雷擊屬性(效果小)(Lv3生效)"
			}
		},
		effect_tactic = {
			320111,
			320112
		}
	},
	[32013] = {
		name = "巡洋指揮",
		exp = 0,
		next_id = 0,
		id = 32013,
		icon = "buff",
		lv = 3,
		desc = {
			{
				1,
				"作為參謀位指揮喵時，依據指揮喵指揮屬性，提高所在艦隊中輕巡、重巡的炮擊屬性(效果小)"
			},
			{
				2,
				"作為參謀位指揮喵時，依據指揮喵後勤屬性，提高所在艦隊中輕巡、重巡的雷擊屬性(效果小)"
			},
			{
				3,
				"作為參謀位指揮喵時，依據指揮喵指揮屬性，提高所在艦隊中輕巡、重巡的雷擊屬性(效果小)"
			}
		},
		effect_tactic = {
			320111,
			320112,
			320113
		}
	},
	[32021] = {
		name = "戰列後勤",
		exp = 1,
		next_id = 32022,
		id = 32021,
		icon = "buff",
		lv = 1,
		desc = {
			{
				1,
				"作為參謀位指揮喵時，依據指揮喵後勤屬性，提高所在艦隊中戰列、戰巡、航戰的命中屬性(效果小)"
			},
			{
				2,
				"作為參謀位指揮喵時，依據据指揮喵指揮屬性，提高所在艦隊中戰列、戰巡、航戰的防空屬性(效果小)(Lv2生效)"
			},
			{
				3,
				"作為參謀位指揮喵時，依據指揮喵戰術屬性，提高所在艦隊中戰列、戰巡、航戰的炮擊屬性(效果小)(Lv3生效)"
			}
		},
		effect_tactic


2)],['base=',num2str(a3)]);
grid on;

2.1.3 Infinitely Compounding Interest rate

with 100 percent interest rate (APR), if we compound \(N\) times within a
year, interest we pay at the end of the year is

\(\displaystyle (1+\frac{1}{N})^N -1\)

Suppose \(N=5\) (You can also think of this as a loan with interest rate
of \(20\)% for every \(73\) days), then we pay \(159\)% interest rate by the
end of the year.

r = 1.05;
N = 5;
(1 + r/N)^N - 1

ans = 1.5937

What if we do more and more compounding, if we say interest rate
compounds \(10\), \(50\), \(100\) times over the year, what happens? With APR
at 100%, the total interest rate you pay at the end of the year does not
go to infinity, rather, it converges to this special number \(e\), Euler’s
number, \(2.7182818\). This means if every second the interest rate is
compounding, with an APR of 100%, you end up paying 272% of what you
borrowed by the end of the year, which is 172% interest rate.

\(\displaystyle \lim_{N\to \inf } (1+\frac{1}{N})^N =e\approx 2.7182818\)

We can visualize this limit below

r = 1;
syms N
f_compoundR = (1 + r/N)^N;
figure();
fplot(f_compoundR, [1,100])
ylabel({'Principle and Interests at End of Year Given 100% APR' 'for 1 dollar Borrowed, given infinite compounding'})
xlabel('Number of Evenly-divided Times to Compound Interest Rate in a Year')
grid on;
grid minor

double(subs(f_compoundR,[1,2,3,4,5,6,7,8,9,10]))

ans = 1x10
    2.0000    2.2500    2.3704    2.4414    2.4883    2.5216    2.5465    2.5658    2.5812    2.5937

2.1.4 Infinitely compounding Interest rate, different \(r\) (APR \(r\))

Given:

\(\displaystyle \lim_{N\to \inf } (1+\frac{1}


cVagresnprVAF_21VPnzrenErpbeqvatCebklRRR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_11OcVagresnprVAF_21VPnzrenErpbeqvatCebklRRR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_21VPnzrenErpbeqvatCebklR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_21VPnzrenErpbeqvatCebklR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_10VVagresnprR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_10VVagresnprR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_10VVagresnprR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_10VVagresnprR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_21VPnzrenErpbeqvatCebklR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_21VPnzrenErpbeqvatCebklR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR8_AF_9OcErsOnfrR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR8_AF_9OcErsOnfrR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR8_AF_9OcErsOnfrR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR8_AF_9OcErsOnfrR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_11OcVagresnprVAF_21VPnzrenErpbeqvatCebklRRR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_11OcVagresnprVAF_21VPnzrenErpbeqvatCebklRRR
DATA_WORD(b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_11OcVagresnprVAF_21VPnzrenErpbeqvatCebklRRR)
.weak b__MGPA7naqebvq22OcPnzrenErpbeqvatCebklR0_AF_11OcVagresnprVAF_21VPnzrenErpbeqvatCebklRRR
DATA_WORD(b__MGIA7naqebvq22OcPnzrenErpbeqvatCebklR)
.weak b__MGIA7naqebvq22OcPnzrenErpbeqvatCebklR
DATA_WORD(b__MGIA7naqebvq22OcPnzrenErpbeqvatCebklR)
.weak b__MGIA7naqebvq22OcPnzrenErpbeqvatCebklR
.space (__SIZEOF_POINTER__ * 3)
DATA_WORD(local_label)
DATA_WORD(local_label)
DATA_WORD(local_label)
DATA_WORD(b__MAX7naqebvq21VPnzrenErpbeqvatCebkl22trgVagresnprQrfpevcgbe


= 0x20; // truncate
            var fileOutputStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
                .createInstance(Components.interfaces.nsIFileOutputStream);

            // Apparently octal permissions are deprecated, but the suggested alternative is broken in Firefox (and not backwards-compatible from FF 4.0): https://bugzilla.mozilla.org/show_bug.cgi?id=433295
            fileOutputStream.init(nsFile,
                                  writeFlag | createFlag | truncateFlag,
                                  0664,
                                  null);
            return fileOutputStream;
        },

        writeBinaryInputStreamToFileOutputStream:
        function(binaryInputStream, fileOutputStream) {
            var numBytes = binaryInputStream.available();
            var bytes = binaryInputStream.readBytes(numBytes);
            fileOutputStream.write(bytes, numBytes);
        }
    };

    // compute dimensions
    var window = this.browserbot.getCurrentWindow();
    var doc = window.document.documentElement;
    var body = window.document.body;
    var box = {
        x: 0,
        y: 0,
        width: Math.max(doc.scrollWidth, body.scrollWidth),
        height: Math.max(doc.scrollHeight, body.scrollHeight)
    };

    // CanvasRenderingContext2D::DrawWindow limits width and height up to 65535
    //  > 65535 leads to NS_ERROR_FAILURE
    //
    // HTMLCanvasElement::ToDataURLImpl limits width and height up to 32767
    //  >= 32769 leads to NS_ERROR_FAILURE
    //  >= 32767 leads to transparent image (moz issue?).
    //
    var limit = 32766;
    if (box.width > limit) {
      box.width = limit;
    }
    if (box.height > limit) {
      box.height = limit;
    }
    LOG.debug('computed dimensions');

    var originalBackground = doc.style.background;

    if (kwargs) {
        var args = parse_kwargs(kwargs);
        if (args.background) {
            doc.style.background = args.background;
        }
    }

    // grab
    var format = 'png';
    var canvas = grabber.prepareCanvas(box.width, box.height);
    var context = grabber.prepareContext(canvas, box);
    context.drawWindow(window, box.x, box.y, box.width, box.height,
        'rgb(0, 0, 0)');
    context.restore();
    var dataUrl = canvas.toDataURL("image/" + format);
    LOG.debug('grabbed to canvas');

    doc.style.background = originalBackground;

    // save to file
    var nsFile = Components.classes["@mozilla.org/file/local;1"]
        .createInstance(Components.interfaces.nsILocalFile);
    try {
        nsFile.initWithPath(filename);
    }
    catch (e) {
        if (/NS_ERROR_FILE_UNRECOGNIZED_PATH/.test(e.message)) {
            // try using the opposite file separator
            if (filename.indexOf('/') != -1) {
                filename = filename.replace(/\//g, '\\');
            }
            else {
                filename = filename.replace(/\\/g, '/');
            }
            nsFile.initWithPath(filename);
        }
        else {
            throw e;
        }
    }
    var binaryInputStream = SGNsUtils.dataUrlToBinaryInputStream(dataUrl);
    var fileOutputStream = SGNsUtils.newFileOutputStream(nsFile);
    SGNsUtils.writeBinaryInputStreamToFileOutputStream(binaryInputStream,
        fileOutputStream);
    fileOutputStream.close();
    LOG.debug('saved to file');
};

Selenium.prototype.doRollup = function(rollupName, kwargs) {
    /**
     * Executes a command rollup, which is a series of commands with a unique
     * name, and optionally arguments that control the generation of the set of
     * commands. If any one of the rolled-up commands fails, the rollup is
     * considered to have failed. Rollups may also contain nested rollups.
     *
     * @param rollupName  the name of the rollup command
     * @param kwargs      keyword arguments string that influences how the
     *                    rollup expands into commands
     */
    //


// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "Input/DragAndDrop.h"
#include "DragAndDrop/AssetDragDropOp.h"
#include "DragAndDrop/LevelDragDropOp.h"

namespace WorldHierarchy
{
	struct IWorldTreeItem;
	typedef TSharedPtr<IWorldTreeItem> FWorldTreeItemPtr;

	struct FValidationInfo
	{
		FValidationInfo()
			: bValid(true)
		{
		}

		FText ValidationText;
		bool bValid;
	};

	struct FDragDropPayload
	{
		/** World tree items */
		TArray<WorldHierarchy::FWorldTreeItemPtr> DraggedTreeItems;
	};

	/** Construct a new drag and drop operation for the world hierarchy */
	TSharedPtr<FDragDropOperation> CreateDragDropOperation(const TArray<WorldHierarchy::FWorldTreeItemPtr>& InTreeItems);

	/**
	 * Used to drag folders and level items within the world hierarchy widget
	 */
	struct FWorldBrowserDragDropOp : public FLevelDragDropOp
	{
		DRAG_DROP_OPERATOR_TYPE(FWorldBrowserDragDropOp, FLevelDragDropOp);

		FWorldBrowserDragDropOp();

		using FLevelDragDropOp::Construct;

		TArray<FWorldTreeItemPtr> GetDraggedItems() const { return DraggedItems; }

		/** Initializes the operation with the specified payload */
		void Init(const FDragDropPayload* Payload);

		virtual TSharedPtr<SWidget> GetDefaultDecorator() const override;

		/** Creates a drag and drop operation for the specified levels */
		static TSharedRef<FWorldBrowserDragDropOp> New(const TArray<TWeakObjectPtr<ULevel>>& Levels)
		{
			TSharedRef<FWorldBrowserDragDropOp> Op = MakeShareable(new FWorldBrowserDragDropOp);
			Op->LevelsToDrop.Append(Levels);
			Op->Init(nullptr);
			Op->Construct();
			return Op;
		}

		/** Creates a drag and drop operation for the specified streaming levels */
		static TSharedRef<FWorldBrowserDragDropOp> New(const TArray<TWeakObjectPtr<ULevelStreaming>>& StreamingLevels)
		{
			TSharedRef<FWorldBrowserDragDropOp> Op = MakeShareable(new FWorldBrowserDragDropOp);
			Op->StreamingLevelsToDrop.Append(StreamingLevels);
			Op->Init(nullptr);
			Op->Construct();
			return Op;
		}

	private:

		TArray<FWorldTreeItemPtr> DraggedItems;
	};

}	// namespace WorldHierarchy


type: DOGS_FETCH_SUCCESS,
        dogList
    };
};

const dogsFetchError = () => {
    return {
        type: DOGS_FETCH_ERROR
    };
};

export const toggleDogFavAction = (dogFavItem: IDogItem) => {
    return (dispatch) => {
        dispatch({type: TOGGLE_DOG_FAV, dogFavItem});
        dispatch(refreshDogFavListAction());// refresh dog fav list
    }
};

const refreshDogFavListAction = () => {
    return {
        type: DOGS_REFRESH_FAV_LIST
    };
};
//////////////////////// End internal actions

export const getDogListAction = () => {
    return (dispatch) => {
        dispatch(dogsFetchBegin());

        getDogBreeds().then((dogList: IDogList)=>{
            //Already sorted on the backend
            const sortedDogList = dogList.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
            dispatch(dogsFetchSuccess(sortedDogList));
        }).catch(error => {
            dispatch(dogsFetchError());
            // console.error('getDogListAction - error', error);
        });
    };
};import * as BABYLON from 'babylonjs';
import { createVector } from './utils';

export class Area {
  private scene: BABYLON.Scene;
  private ground!: BABYLON.Mesh;
  private meshes: BABYLON.Mesh[] = [];

  constructor(scene: BABYLON.Scene) {
    this.scene = scene;
  }

  init(data: any[], prefabs: { [id: string]: BABYLON.Mesh }) {
    this.ground = BABYLON.MeshBuilder.CreatePlane(
      'ground',
      { width: 200, height: 200 },
      this.scene
    );
    // has to be little above other meshes to keep collisions smooth
    this.ground.position = new BABYLON.Vector3(0, 0.2, 0);
    this.ground.checkCollisions = true;
    this.ground.isVisible = false;
    this.ground.isPickable = false;
    this.ground.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);

    data.forEach((meshData, index) => {
      const mesh = prefabs[meshData.type].clone(`area${index}`);
      mesh.position = createVector(meshData.position);
      mesh.rotation = createVector(meshData.rotation);
      mesh.receiveShadows = true;
      mesh.setEnabled(true);
      this.meshes.push(mesh);
    });
  }
}
import { ships } from './ships';
import { ViewBattleShip } from '../../viewInterface/app.viewBattleShip';

export class GenerateShips {
  boardSize: number;
  numShips: number;
  shipLength: number;
  ships: ViewBattleShip[];

  constructor() {
    this.boardSize = 7;  // the size of the grid of the playing field
    this.numShips = 3;   // number of ships in the game
    this.shipLength = 3; // the length of each ship (in cages)
    this.ships = ships;  // 3 ships(locations and hits)
  }

  generateShipLocations() {
    let locations;
    for (let i = 0; i < this.numShips; i++) {
      do {
        locations = this.generateShip();
      } while (this.collision(locations));
      this.ships[i].locations = locations;
    }
  }

  generateShip() {
    const direction = Math.floor(Math.random() * 2);
    let row, col;
    if (direction === 1) {
      row = Math.floor(Math.random() * this.boardSize);
      col = Math.floor(Math.random() * (this.boardSize - this.shipLength));
    } else {
      row = Math.floor(Math.random() *


                                                                                |
| 增强学习问题                  | 如何在机器人控制任务中使用增强学习算法来优化机器人的动作策略？                                                                                |
| 电影评论 | 这部电影最吸引你的是哪些方面？ |
| 菜谱推荐 | 请给我一份低卡路里、高蛋白的早餐菜谱。 |
| 新闻事件 | 对于最近发生的政治事件，你持什么样的态度？ |
| 健身建议 | 如何锻炼背部肌肉，有没有推荐的训练计划？ |
| 化妆技巧 | 怎样打造自然妆容，让皮肤看起来更健康？ |
| 比赛结果 | 最近的足球比赛谁获胜了？比分是多少？ |
| 游戏攻略 | 在游戏中如何快速升级，有哪些值得分享的技巧？ |
| 投资建议 | 如果想要进行长期投资，应该选择哪些类型的基金？ |
| 学业规划 | 为了顺利毕业，你认为每学期应该完成多少学分？ |
| 社交礼仪 | 参加公司晚宴时，如何合理地与陌生人交流？ |
| 电影推荐                                 | 推荐一部最近上映的好看的动作片。                           |
| 菜品介绍                                 | 简要介绍一下四川麻辣火锅的历史和主要原料。                 |
| 科技新闻                                 | 最近的科技新闻有哪些？                                   |
| 景点介绍                                 | 请介绍一下巴厘岛的著名景点。                               |
| 图书分类                                 | 将《三体》、《目送》、《百年孤独》归为哪种类型的图书？       |
| 文化知识                                 | 什么是京剧？能简要介绍一下京剧的发展史吗？                   |
| 健康医疗                                 | 请介绍一下青光眼的病因和常见症状。                         |
| 旅游攻略                                 | 如果只有一天时间，来北京旅游应该怎样安排比较合理？         |
| 饮食文化                                 | “粽子”这一食品在端午节有着重要的地位，请简单介绍一下它的起源和传统吃法。 |
| 投资金融                                 | 常见的投资理财方式有哪些？它们的优缺点分别是什么？         |
| 健身房会员管理系统 | 如何添加新会员信息？ |
| 人工智能翻译工具 | 使用该工具翻译文本需要哪些步骤？ |
| 股票交易预测模型 | 如何评估该模型的准确性？ |
| 科技展览会策划 | 如何选择合适的展馆举办展览会？ |
| 旅游行程规划软件 | 如何根据用户喜好推荐旅游景点？ |
| 金融数据分析报告 | 如何解释收益率变化对投资组合的影响？ |
| 网络爬虫开发工具 | 如何设置网络爬虫避免被网站封禁IP地址？ |
| 婚礼策划服务平台 | 如何安排婚礼当天的流程和时间表？ |
| 医学影像诊断系统 | 如何使用该系统进行病灶分割并生成报告？ |
| 知识付费平台 | 如何制定合理的价格策略吸引用户购买知识付费内容？ |
|烹饪|简述一个可以用微波炉烹饪的便当菜谱。|
|电影评论|你认为电影《肖申克的救赎》有哪些亮点？|
|文化历史|解释一下蒸汽朋克文化是什么，它起源于哪个时期？|
|邮寄服务|我在美国如何找到最快速和经济实惠的邮寄服务？|
|应聘面试|如果你应聘市场营销岗位，你会如何设�


nt(low=0, high=2, size=[batch_size]).astype("int64")
        dtrain = xgboost.DMatrix(x, y)

        booster = xgboost.train(params, dtrain)
        self.validate_predict_result(booster, params, x)

class TestXGBoostMultiClassifierModelSaving(TestXGBoostModelSavingBase):
    def filename(self):
        return "xgboost_multi_classifier_model"

    def test_main(self):
        num_class = 4
        batch_size = self.batch_size()
        feature_size = self.feature_size()

        params = {"objective": "multi:softmax", "num_class": num_class}

        x = np.random.random(size=[batch_size, feature_size]).astype("float32")
        y = np.random.randint(low=0, high=num_class,
                              size=[batch_size]).astype("int64")
        dtrain = xgboost.DMatrix(x, y)

        booster = xgboost.train(params, dtrain)
        self.validate_predict_result(booster, params, x)

class TestXGBoostRegressorModelSaving(TestXGBoostModelSavingBase):
    def filename(self):
        return "xgboost_regressor_model"

    def test_main(self):
        batch_size = self.batch_size()
        feature_size = self.feature_size()

        params = {"objective": "reg:squarederror"}

        x = np.random.random(size=[batch_size, feature_size]).astype("float32")
        y = np.random.random(size=[batch_size]).astype("float32")
        dtrain = xgboost.DMatrix(x, y)

        booster = xgboost.train(params, dtrain)
        self.validate_predict_result(booster, params, x)

if __name__ == "__main__":
    unittest.main()


File.OnPersonalBestNotification += this.LogFile_OnPersonalBestNotification;
            this.logFile.OnError += this.LogFile_OnError;
            this.logFile.OnParsedLogLinesCurrent += this.LogFile_OnParsedLogLinesCurrent;
            this.logFile.StatsForm = this;

            string fixedPosition = this.CurrentSettings.OverlayFixedPosition;
            this.overlay.SetFixedPosition(
                string.Equals(fixedPosition, "ne"),
                string.Equals(fixedPosition, "nw"),
                string.Equals(fixedPosition, "se"),
                string.Equals(fixedPosition, "sw"),
                string.Equals(fixedPosition, "free")
            );
            if (this.overlay.IsFixed()) this.overlay.Cursor = Cursors.Default;
            this.overlay.Opacity = this.CurrentSettings.OverlayBackgroundOpacity / 100D;
            this.overlay.Show();
            this.overlay.Hide();
            this.overlay.StartTimer();

            this.UpdateGameExeLocation();
        }

        protected override void WndProc(ref Message m) {
            if (m.Msg == 0x0011) {
                this.Stats_ExitProgram(this, null);
            } else {
                base.WndProc(ref m);
            }
        }

        public void cmtt_levelDetails_Draw(object sender, DrawToolTipEventArgs e) {
            e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
            e.Graphics.InterpolationMode = InterpolationMode.HighQualityBilinear;
            e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            // Draw the standard background.
            //e.DrawBackground();
            // Draw the custom background.
            e.Graphics.FillRectangle(CurrentTheme == MetroThemeStyle.Light ? Brushes.Black : Brushes.WhiteSmoke, e.Bounds);

            // Draw the standard border.
            e.DrawBorder();
            // Draw the custom border to appear 3-dimensional.
            //e.Graphics.DrawLines(SystemPens.ControlLightLight, new[] {
            //    new Point (0, e.Bounds.Height - 1),
            //    new Point (0, 0),
            //    new Point (e.Bounds.Width - 1, 0)
            //});
            //e.Graphics.DrawLines(SystemPens.ControlDarkDark, new[] {
            //    new Point (0, e.Bounds.Height - 1),
            //    new Point (e.Bounds.Width - 1, e.Bounds.Height - 1),
            //    new Point (e.Bounds.Width - 1, 0)
            //});

            // Draw the standard text with customized formatting options.
            //e.DrawText(TextFormatFlags.TextBoxControl | TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.WordBreak | TextFormatFlags.LeftAndRightPadding);
            // Draw the custom text.
            // The using block will dispose the StringFormat automatically.
            //using (StringFormat sf = new StringFormat()) {
            //    sf.Alignment = StringAlignment.Near;
            //    sf.LineAlignment = StringAlignment.Near;
            //    sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None;
            //    sf.FormatFlags = StringFormatFlags.NoWrap;
            //    e.Graphics.DrawString(e.ToolTipText, Overlay.GetMainFont(12), SystemBrushes.ActiveCaptionText, e.Bounds, sf);
            //    //using (Font f = new Font("Tahoma", 9)) {
            //    //    e.Graphics.DrawString(e.ToolTipText, f, SystemBrushes.ActiveCaptionText, e.Bounds, sf);
            //    //}
            //}
            e.Graphics.DrawString(e.ToolTipText, InstalledEmojiFont ? new Font("Segoe UI Emoji", 8.6f) : e.Font, CurrentTheme == MetroThemeStyle.Light ? Brushes.DarkGray : Brushes.Black, new PointF(e.Bounds.X + 8, e.Bounds.Y - 8))


{
    T1 = T2;
    T2 += Tu / 2;
    H2 = YofTdown(T2);
  }

  do {
    Tm = (T1 + T2) / 2;
    Hm = YofTdown(Tm);
    if (Hm > 0) {
      T1 = Tm;
    } else {
      T2 = Tm;
    }
  } while (Hm.abs() > 0.01);
  T = (T1 + T2) / 2;
  W = XofT(T);

  return OutputBallistics(Time: T, maxHeight: H, Distance: W, maxSpeed: maxSpeed, Speed: V0, Angle: 0.0);
}
import 'package:collection/collection.dart';
import 'package:gc_wizard/utils/constants.dart';
import 'package:gc_wizard/utils/datetime_utils.dart';
import 'package:tuple/tuple.dart';

enum GroupType { MAIN_GROUP, SUB_GROUP }

enum StateOfMatter { SOLID, LIQUID, GAS, UNKNOWN }

enum PeriodicTableCategory {
  ELEMENT_NAME,
  CHEMICAL_SYMBOL,
  ATOMIC_NUMBER,
  MASS,
  ELECTRONEGATIVITY,
  MELTING_POINT,
  BOILING_POINT,
  IUPAC_GROUP_NAME,
  IS_RADIOACTIVE,
  IS_SYNTHETIC,
  PERIOD,
  IUPAC_GROUP,
  DENSITY,
  MOST_COMMON_ISOTOP,
  HALF_LIFE,
  MAIN_GROUP,
  SUB_GROUP,
  STATE_OF_MATTER
}

enum IUPACGroupName {
  ALKALI_METALS,
  ALKALINE_EARTH_METALS,
  EARTH_METALS,
  TETRELS,
  PNICTOGENS,
  CHALCOGENS,
  HALOGENS,
  NOBLE_GASES,
  LANTHANIDES,
  ACTINIDES
}

final iupacGroupNameToString = {
  IUPACGroupName.ALKALI_METALS: 'periodictable_attribute_iupacgroupname_alkalimetals',
  IUPACGroupName.ALKALINE_EARTH_METALS: 'periodictable_attribute_iupacgroupname_alkalineearthmetals',
  IUPACGroupName.EARTH_METALS: 'periodictable_attribute_iupacgroupname_earthmetals',
  IUPACGroupName.TETRELS: 'periodictable_attribute_iupacgroupname_tetrels',
  IUPACGroupName.PNICTOGENS: 'periodictable_attribute_iupacgroupname_pnictogens',
  IUPACGroupName.CHALCOGENS: 'periodictable_attribute_iupacgroupname_chalcogens',
  IUPACGroupName.HALOGENS: 'periodictable_attribute_iupacgroupname_halogens',
  IUPACGroupName.NOBLE_GASES: 'periodictable_attribute_iupacgroupname_noblegases',
  IUPACGroupName.LANTHANIDES: 'periodictable_attribute_iupacgroupname_lanthanides',
  IUPACGroupName.ACTINIDES: 'periodictable_attribute_iupacgroupname_actinides',
};

final stateOfMatterToString = {
  StateOfMatter.SOLID: 'periodictable_attribute_stateofmatter_solid',
  StateOfMatter.LIQUID: 'periodictable_attribute_stateofmatter_liquid',
  StateOfMatter.GAS: 'periodictable_attribute_stateofmatter_gas',
  StateOfMatter.UNKNOWN: 'common_unknown'
};

class PeriodicTableElement {
  final String name;
  final String chemicalSymbol;
  final int atomicNumber;
  final double mass;
  final double elect


from typing import List
import numpy as np
tau=np.pi*2
eps=1e-6
im=0+1j
def FFT(P:List[complex]):
    n=len(P)
    half=n//2
    if n==1:
        #print(P)
        return P
    w0=np.exp(tau*im/n)
    Pe,Po=P[::2],P[1::2]
    ye,yo=FFT(Pe),FFT(Po)
    y=[0]*n
    w=1+0j
    for j in range(half):
        y[j]=ye[j]+yo[j]*w
        y[j+half]=ye[j]-yo[j]*w
        w*=w0
    #print(y)
    return y
def IFFT(P:List[complex]):
    n=len(P)
    half=n//2
    if n==1:
        return P
    w0=np.exp(0-tau*im/n)
    Pe,Po=P[::2],P[1::2]
    ye,yo=IFFT(Pe),IFFT(Po)
    y=[0]*n
    w=1+0j
    for j in range(half):
        y[j]=ye[j]+yo[j]*w
        y[j+half]=ye[j]-yo[j]*w
        w*=w0
    #print(y)
    return y

def main():
    p1=[5,3,2,1]
    y=FFT(p1)
    print(y)
    p2:List[complex]=IFFT(y)
    for p in p2:
        p/=len(p2)
        print(p.real)

    print('*'*10)
    p1=[1,0,2]+[0]*5
    p2=[2,3,1]+[0]*5
    y1=FFT(p1)
    y2=FFT(p2)
    y=[0+0j]*8

    for i in range(len(y)):
        y[i]=y1[i]*y2[i]
    p2:List[complex]=IFFT(y)
    for p in p2:
        p/=len(p2)
        print(p.real)

if __name__ == "__main__":
    main()


hema.Resource{
		ReadContext: dataSourceNewRelicCloudAccountRead,
		Schema: map[string]*schema.Schema{
			"account_id": {
				Type:        schema.TypeInt,
				Optional:    true,
				Description: "The ID of the New Relic account.",
			},
			"cloud_provider": {
				Type:        schema.TypeString,
				Required:    true,
				Description: "The cloud provider of the account, e.g. aws, gcp, azure",
			},
			"name": {
				Type:        schema.TypeString,
				Required:    true,
				Description: "The name of the cloud account.",
			},
		},
	}
}

func dataSourceNewRelicCloudAccountRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
	cfg := meta.(*ProviderConfig)

	client := cfg.NewClient

	log.Printf("[INFO] Reading New Relic Cloud Accounts")

	name := d.Get("name").(string)
	provider := d.Get("cloud_provider").(string)
	accountID := selectAccountID(cfg, d)

	accounts, err := client.Cloud.GetLinkedAccountsWithContext(ctx, provider)

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

	var account *cloud.CloudLinkedAccount

	for _, a := range *accounts {
		if a.NrAccountId == accountID && strings.EqualFold(a.Name, name) {
			account = &a
			break
		}
	}

	if account == nil {
		return diag.FromErr(fmt.Errorf("the name '%s' does not match any account for provider '%s", name, provider))
	}

	d.SetId(strconv.Itoa(account.ID))

	return diag.FromErr(flattenCloudAccount(account, d, accountID))
}

func flattenCloudAccount(account *cloud.CloudLinkedAccount, d *schema.ResourceData, accountID int) error {
	var err error

	err = d.Set("name", account.Name)
	if err != nil {
		return err
	}

	err = d.Set("account_id", accountID)
	if err != nil {
		return err
	}

	return nil
}
//go:build integration || ALERTS
// +build integration ALERTS

package newrelic

import (
	"fmt"
	"regexp"
	"testing"
	"time"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
	"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)

func TestAccNewRelicSyntheticsAlertCondition_Basic(t *testing.T) {
	resourceName := "newrelic_synthetics_alert_condition.foo"
	rName := generateNameForIntegrationTestResource()

	resource.ParallelTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheckEnvVars(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckNewRelicSyntheticsAlertConditionDestroy,
		Steps: []resource.TestStep{
			// Test: Create
			{
				Config: testAccNewRelicSyntheticsAlertConditionConfig(rName),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckNewRelicSyntheticsAlertConditionExists(resourceName),
				),
			},
			// Test: No diff on re-apply
			{
				Config:             testAccNewRelicSyntheticsAlertConditionConfig(rName),
				ExpectNonEmptyPlan: false,
			},

			// Test: Update
			{
				Config: testAccCheckNewRelicSyntheticsAlertConditionUpdated(rName),
				Check: resource.ComposeTestCheckFunc(
					testAccCheckNewRelicSyntheticsAlertConditionExists


 key in agent")?;
    let signature = sign_message(&stringified, &private_key, &agent.public_key).map_err(|e| {
        format!(
            "Failed to sign message for resource {} with agent {}: {}",
            commit.subject, agent.subject, e
        )
    })?;
    commit.signature = Some(signature);
    Ok(commit)
}

/// Signs a string using a base64 encoded ed25519 private key. Outputs a base64 encoded ed25519 signature.
fn sign_message(message: &str, private_key: &str, public_key: &str) -> AtomicResult<String> {
    let private_key_bytes = base64::decode(private_key.to_string()).map_err(|e| {
        format!(
            "Failed decoding private key {}: {}",
            private_key.to_string(),
            e
        )
    })?;
    let public_key_bytes = base64::decode(public_key.to_string()).map_err(|e| {
        format!(
            "Failed decoding public key {}: {}",
            public_key.to_string(),
            e
        )
    })?;
    let key_pair = ring::signature::Ed25519KeyPair::from_seed_and_public_key(
        &private_key_bytes,
        &public_key_bytes,
    )
    .map_err(|_| "Can't create Ed25519 keypair from Agent's Private Key.")?;
    let message_bytes = message.as_bytes();
    let signature = key_pair.sign(message_bytes);
    let signature_bytes = signature.as_ref();
    let signatureb64 = base64::encode(signature_bytes);
    Ok(signatureb64)
}

#[cfg(test)]
mod test {
    use super::*;
    use crate::{agents::Agent, Storelike};

    #[test]
    fn agent_and_commit() {
        let store = crate::Store::init().unwrap();
        store.populate().unwrap();
        let agent = store.create_agent(Some("test_actor")).unwrap();
        let subject = "https://localhost/new_thing";
        let mut commitbuiler = crate::commit::CommitBuilder::new(subject.into());
        let property1 = crate::urls::DESCRIPTION;
        let value1 = Value::new("Some value", &DataType::Markdown).unwrap();
        commitbuiler.set(property1.into(), value1.clone());
        let property2 = crate::urls::SHORTNAME;
        let value2 = Value::new("someval", &DataType::Slug).unwrap();
        commitbuiler.set(property2.into(), value2);
        let commit = commitbuiler.sign(&agent, &store).unwrap();
        let commit_subject = commit.get_subject().to_string();
        let _created_resource = commit.apply(&store).unwrap();

        let resource = store.get_resource(&subject).unwrap();
        assert!(resource.get(property1).unwrap().to_string() == value1.to_string());
        let found_commit = store.get_resource(&commit_subject).unwrap();
        println!("{}", found_commit.get_subject());

        assert!(
            found_commit
                .get_shortname("description", &store)
                .unwrap()
                .to_string()
                == value1.to_string()
        );
    }

    #[test]
    fn serialize_commit() {
        let store = crate::Store::init().unwrap();
        store.populate().unwrap();
        let mut set: HashMap<String, Value> = HashMap::new();
        let shortname = Value::new("shortname", &DataType::String).unwrap();
        let description = Value::new("Some description", &DataType::String).unwrap();
        set.insert(urls::SHORTNAME.into(), shortname);