			return offset * -1;
		case '=':
			return offset * -2;
		default:
			return offset * Number(digit);
		}
	}).reduce(sum);
};

function toSnafuNumber( humanNumber: number ): string {
	const digits: number[] = [];

	while ( humanNumber > 0 ) {
		digits.push(( (humanNumber + 2) % 5 ));
		humanNumber = Math.floor( (humanNumber + 2)/ 5 );
	}

	return digits.reverse().map(digit =>{
		switch(digit){
		case 0:
			return '=';
		case 1:
			return '-';
		case 2:
			return '0';
		case 3:
			return '1';
		case 4:
			return '2';
		}
	}).join('');
}

const totalSum = fs.readFileSync('inputs/day25.txt', 'utf8')
	.split('\n')
	.filter(l => l.length !== 0)
	.map(l => toHumanNumber(l))
	.reduce(sum);

const answer = toSnafuNumber(totalSum);

console.log(answer);
/*!
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License.
 */

import {
	Actor,
	CollisionDetectionMode,
	QuaternionLike,
	RigidBodyConstraints,
	Vector3,
	Vector3Like
} from '../..';
import { Payloads } from '../../internal';

/**
 * Describes the properties of a Rigid Body
 */
export interface RigidBodyLike {
	/** Whether the rigid body is enabled or not. */
	enabled: boolean;
	/** The velocity of the rigid body. */
	velocity: Partial<Vector3Like>;
	/** The angular velocity of the rigid body. */
	angularVelocity: Partial<Vector3Like>;
	/** The mass of the rigid body. */
	mass: number;
	/** Whether to detect collisions with this rigid body. */
	detectCollisions: boolean;
	/** The collision detection mode to use with this rigid body.  @see CollisionDetectionMode for options. */
	collisionDetectionMode: CollisionDetectionMode;
	/** Whether the rigid body is affected by gravity. */
	useGravity: boolean;
	/**
	 * Whether the rigid body is kinematic.  Note kinematic rigid bodies participate in collisions,
	 * but are not simulated by the rigid body.  This is useful for objects that should collide with
	 * other objects, but you want to control the position/rotation manually or animate them.
	 */
	isKinematic: boolean;
	/** The constraints that the rigid body is bound by.  @see RigidBodyConstraints for options. */
	constraints: RigidBodyConstraints[];
}

/**
 * Class that represents a rigid body found on an actor.
 */
export class RigidBody implements RigidBodyLike {
	private _velocity: Vector3;
	private _angularVelocity: Vector3;
	private _constraints: RigidBodyConstraints[];

	/** @inheritdoc */
	public enabled = true;

	/** @inheritdoc */
	public mass = 1.0;

	/** @inheritdoc */
	public detectCollisions = true;

	/** @inheritdoc */
	public collisionDetectionMode = CollisionDetectionMode.Discrete;

	/** @inheritdoc */
	public useGravity = true;

	/** @inheritdoc */
	public isKinematic = false;

	/**
	 * PUBLIC ACCESSORS
	 */

	/** @inheritdoc */
	public get velocity() { return this._velocity; }
	public set velocity(value: Partial<Vector3>) { this._velocity.copy(value); }

	/** @inheritdoc */
	public get angularVelocity() { return this._angularVelocity; }
	public set angularVelocity(value: Partial<Vector3>) { this._angularVelocity.copy(value); }

	/** @inheritdoc */
	public get constraints() { return this._constraints; }
	public set constraints(value: RigidBodyConstraints[]) {
		this._constraints = [...value];
		// TODO: Figure out array pa


getCode()
        };

        final PUBACK pubAck = new PUBACK(1, notAuthorizedCode, null, Mqtt5UserProperties.NO_USER_PROPERTIES);

        encodeTestBufferSize(expected, pubAck);
    }

    @Test
    public void encode_multiple_user_properties() {
        final byte[] expected = {
                // fixed header
                //   type, reserved
                (byte) 0b0100_0000,
                //   remaining length
                48,
                // variable header
                //   packet identifier
                0, 1,
                //   PUBACK reason code
                (byte) reasonCode.getCode(),
                //   property length
                44,
                //   properties
                //     reason string
                0x1F, 0, 6, 'r', 'e', 'a', 's', 'o', 'n',
                //     user property
                0x26, 0, 4, 'u', 's', 'e', 'r', 0, 8, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y',
                //     user property
                0x26, 0, 4, 'u', 's', 'e', 'r', 0, 9, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '2'
        };

        final MqttUserProperty userProperty = new MqttUserProperty("user", "property");
        final MqttUserProperty userProperty2 = new MqttUserProperty("user", "property2");
        final Mqtt5UserProperties userProperties =
                Mqtt5UserProperties.of(ImmutableList.of(userProperty, userProperty2));

        final PUBACK pubAck = new PUBACK(1, reasonCode, "reason", userProperties);

        encodeTestBufferSize(expected, pubAck);
    }

    @Test
    public void encode_maximum_packet_size_exceeded_on_success_omit_user_properties() {
        final byte[] expected = {
                // fixed header
                //   type, reserved
                (byte) 0b0100_0000,
                //   remaining length
                2,
                // variable header
                //   packet identifier
                0, 1
        };
        final MaximumPacketBuilder maxPacket = new MaximumPacketBuilder().build(MAX_PACKET_SIZE);

        final PUBACK pubAck =
                new PUBACK(1, reasonCode, null, getUserProperties(maxPacket.getMaxUserPropertiesCount() + 1));

        encodeTestBufferSize(expected, pubAck);
    }

    @Test
    public void encode_omit_reason_code_and_property_length() {
        // MQTT v5.0 Spec §3.4.2.1
        final byte[] expected = {
                // fixed header
                //   type, reserved
                (byte) 0b0100_0000,
                //   remaining length
                2,
                // variable header
                //   packet identifier
                0, 1
        };

        final Mqtt5UserProperties userProperties = Mqtt5UserProperties.NO_USER_PROPERTIES;

        final PUBACK pubAck = new PUBACK(1, reasonCode, null, userProperties);

        encodeTestBufferSize(expected, pubAck);
    }
}
/*
 * Copyright 2019-present HiveMQ GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hivemq.codec.decoder.mqtt.mqtt5;

import com.hivemq.bootstrap.ClientConnection;
import com.hivemq.configuration.service.Configura


然而它也可能被用户修改, 如通过 UI 前端, 或通过自动重载.
 *
 * 一些常用的基础类型实现由代码生成创建特性的优化.
 *
 * @see PluginData 容纳 [Value] 的数据对象
 *
 * @see PrimitiveValue 基础数据类型实现
 * @see CompositeValue 复合数据类型实现
 */
public interface Value<T> : ReadWriteProperty<Any?, T> {
    @get:JvmName("get")
    @set:JvmName("set")
    public var value: T

    @JvmSynthetic // avoid ambiguity with property `value`
    public override operator fun getValue(thisRef: Any?, property: KProperty<*>): T = value

    @JvmSynthetic
    public override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
        this.value = value
    }
}

/**
 * 可被序列化的 [Value].
 */
public class SerializableValue<T>(
    @JvmField internal val delegate: Value<T>,
    /**
     * 用于更新和保存 [delegate] 的序列化器
     */
    public override val serializer: KSerializer<Unit>
) : Value<T> by delegate, SerializerAwareValue<T> {
    public override fun toString(): String = delegate.toString()

    public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other?.javaClass != this.javaClass) return false

        @Suppress("UNCHECKED_CAST")
        other as SerializableValue<T>
        if (other.delegate != this.delegate) return false
        // if (other.serializer != this.serializer) return false
        // TODO: 2020/9/9 serializers should be checked here, but it will cause incomparable issue when putting a SerializableValue as a Key
        return true
    }

    override fun hashCode(): Int {
        @Suppress("UnnecessaryVariable", "CanBeVal")
        var result = delegate.hashCode()
        // result = 31 * result + serializer.hashCode()
        // TODO: 2020/9/9 serializers should be checked here, but it will cause incomparable issue when putting a SerializableValue as a Key
        return result
    }

    public companion object {
        @JvmStatic
        @JvmName("create")
        public fun <T> Value<T>.serializableValueWith(
            serializer: KSerializer<T>
        ): SerializableValue<T> {
            return SerializableValue(
                this,
                serializer.map(serializer = {
                    this.value
                }, deserializer = { this.setValueBySerializer(it) })
            )
        }
    }
}

/**
 * 带有显式 [序列化器][serializer] 的 [Value].
 *
 * @see SerializableValue 简单实现
 * @see PluginData.value 创建一个这样的 [SerializerAwareValue]
 */
public interface SerializerAwareValue<T> : Value<T> {
    /**
     * 用于更新 [value] 的序列化器. 在反序列化时不会创建新的 [T] 对象实例.
     *
     * - 序列化: `val text: String = Yaml.default.encodeToString(serializer, Unit)`
     * - 反序列化 (本质上是更新 [value], 不创建新的 [T] 实例): `Yaml.default.decodeFromString(serializer, text)`
     */
    public val serializer: KSerializer<Unit>

    public companion object {
        /**
         * 使用 [指定格式格式][format] 序列化一个 [SerializerAwareValue]
         */
        @JvmStatic


.timeout, 1000)
			assert.Equal(t, []string{"one", "two", "three"}, ntp.pool)
			assert.Equal(t, 1000*time.Minute, ntp.interval)
			assert.Equal(t, testCase.expectedTimeout, ntp.timeout)
		})
	}
}

func TestOffset_Interval(t *testing.T) {
	testCases := []struct {
		name              string
		interval          uint
		timeout           uint
		offset            time.Duration
		pool              []string
		now               func() time.Time
		ntpQuery          func(host string, opt ntp.QueryOptions) (*ntp.Response, error)
		ntpResponses      []ntpResp
		updatedAt         time.Time
		expectedOffset    time.Duration
		expectedError     error
		expectedUpdatedAt time.Time
	}{
		{
			name:          "empty list of hosts should return error",
			expectedError: ErrEmptyNtpHosts,
		},
		{
			name:              "first request should not use cached value",
			now:               nowMock("2022-09-28 16:02:45"),
			pool:              []string{"one", "two"},
			ntpResponses:      []ntpResp{{buildValidNtpResponse(50 * time.Millisecond), nil}, {buildValidNtpResponse(10 * time.Millisecond), nil}},
			expectedOffset:    30 * time.Millisecond,
			expectedUpdatedAt: mustParse("2006-01-02 15:04:05", "2022-09-28 16:02:45"), // same as now
		},
		{
			name:              "request before interval should return interval error",
			now:               nowMock("2022-09-28 16:02:45"),
			updatedAt:         mustParse("2006-01-02 15:04:05", "2022-09-28 15:52:45"),
			pool:              []string{"one", "two"},
			expectedError:     ErrNotInInterval,
			expectedUpdatedAt: mustParse("2006-01-02 15:04:05", "2022-09-28 15:52:45"),
		},
		{
			name:              "request after interval should request new value",
			now:               nowMock("2022-09-28 16:02:45"),
			updatedAt:         mustParse("2006-01-02 15:04:05", "2022-09-28 15:42:45"),
			pool:              []string{"one", "two"},
			offset:            20 * time.Millisecond,
			ntpResponses:      []ntpResp{{buildValidNtpResponse(50 * time.Millisecond), nil}, {buildValidNtpResponse(10 * time.Millisecond), nil}},
			expectedOffset:    30 * time.Millisecond,
			expectedUpdatedAt: mustParse("2006-01-02 15:04:05", "2022-09-28 16:02:45"), // same as now
		},
		{
			name:              "request with query error should update updatedAt",
			now:               nowMock("2022-09-28 16:02:45"),
			updatedAt:         mustParse("2006-01-02 15:04:05", "2022-09-28 15:42:45"),
			pool:              []string{"one"},
			ntpResponses:      []ntpResp{{nil, errors.New("this is an error")}},
			expectedError:     ErrGettingNtpOffset,
			expectedUpdatedAt: mustParse("2006-01-02 15:04:05", "2022-09-28 16:02:45"), // same as now
		},
	}
	for _, testCase := range testCases {
		t.Run(testCase.name, func(t *testing.T) {
			ntpMonitor := NewNtp(testCase.pool, testCase.timeout, testCase.interval)


self._AncestorProcessUserGroup = params.get("AncestorProcessUserGroup")
        self._AncestorProcessPath = params.get("AncestorProcessPath")
        self._AncestorProcessParam = params.get("AncestorProcessParam")
        self._OperationTime = params.get("OperationTime")
        self._ContainerNetStatus = params.get("ContainerNetStatus")
        self._ContainerNetSubStatus = params.get("ContainerNetSubStatus")
        self._ContainerIsolateOperationSrc = params.get("ContainerIsolateOperationSrc")
        self._CheckPlatform = params.get("CheckPlatform")
        self._FileAccessTime = params.get("FileAccessTime")
        self._FileModifyTime = params.get("FileModifyTime")
        self._NodeSubNetID = params.get("NodeSubNetID")
        self._NodeSubNetName = params.get("NodeSubNetName")
        self._NodeSubNetCIDR = params.get("NodeSubNetCIDR")
        self._ClusterID = params.get("ClusterID")
        self._PodIP = params.get("PodIP")
        self._PodStatus = params.get("PodStatus")
        self._NodeUniqueID = params.get("NodeUniqueID")
        self._NodeType = params.get("NodeType")
        self._NodeID = params.get("NodeID")
        self._ClusterName = params.get("ClusterName")
        self._Namespace = params.get("Namespace")
        self._WorkloadType = params.get("WorkloadType")
        self._RequestId = params.get("RequestId")

class DescribeVirusEventTendencyRequest(AbstractModel):
    """DescribeVirusEventTendency请求参数结构体

    """

    def __init__(self):
        r"""
        :param _TendencyPeriod: 趋势周期(默认为7天)
        :type TendencyPeriod: int
        """
        self._TendencyPeriod = None

    @property
    def TendencyPeriod(self):
        return self._TendencyPeriod

    @TendencyPeriod.setter
    def TendencyPeriod(self, TendencyPeriod):
        self._TendencyPeriod = TendencyPeriod

    def _deserialize(self, params):
        self._TendencyPeriod = params.get("TendencyPeriod")
        memeber_set = set(params.keys())
        for name, value in vars(self).items():
            property_name = name[1:]
            if property_name in memeber_set:
                memeber_set.remove(property_name)
        if len(memeber_set) > 0:
            warnings.warn("%s fileds are useless." % ",".join(memeber_set))

class DescribeVirusEventTendencyResponse(AbstractModel):
    """DescribeVirusEventTendency返回参数结构体

    """

    def __init__(self):
        r"""
        :param _List: 趋势列表
        :type List: list of VirusTendencyInfo
        :param _RequestId: 唯一请求 ID，由服务端生成，每次请求都会返回（若请求因其他原因未能抵达服务端，则该次请求不会获得 RequestId）。定位问题时需要提供该次请求的 RequestId。
        :type RequestId: str
        """
        self._List = None
        self._RequestId = None

    @property
    def List(self):
        return self._List

    @List.setter
    def List(self, List):
        self._List = List

    @property
    def RequestId(self):
        return self._RequestId

    @RequestId.setter
    def RequestId(self, RequestId):
        self._RequestId = RequestId

    def _deserialize(self, params):
        if params.get("List") is not None:
            self._List = []
            for item in params.get("List"):
                obj = VirusTendencyInfo()
                obj._deserialize(item)
                self._List.append(obj)
        self._RequestId = params.get("RequestId")

class DescribeVirusListRequest(AbstractModel):
    """DescribeVirusList请求参数结构体

    """

    def __init__(self):
        r"""
        :param _Limit: 需要返回的数量，默认为10，最大值为100
        :type Limit: int
        :param _Offset: 偏移量，默认为0。
        :type Offset: int
        :param _Filters: 过滤条件。

FileName - String - 是否必填：否 - 文件名称

FilePath - String - 是否必填：否 - 文件路径

VirusName - String - 是否必填：否 - 病毒名称

ContainerName- String - 是否必填：是 - 容器名称

ContainerId- string - 是否必填：否 - 容器id

ImageName- string - 是否必填：否 - 镜像名称

ImageId- string - 是否必填：否 - 镜像id

IsRealTime- int - 是否必填：否 - 过滤是否实时监控数据

TaskId- string - 是否必填：否 - 任务ID

ContainerNetStatus - String -是否必填: 否 -  容器网络状态筛选 NORMAL ISOLATED ISOLATING RESTORING RESTORE_FAILED

TimeRange - string -是否必填: 否 - 时间范围筛选 ["2022-03-31 16:55:00", "2022-03-31 17:00:00"]

ContainerStatus - string -是否必填: 否 - 容器状态 RUNNING PAUSED STOPPED CREATED DESTROYED RESTARTING REMOVING

AutoIsolateMode - string -是否必填: 否 - 隔离方式 MANUAL AUTO

MD5 - string -是否必填: 否 - md5

        :type Filters: list of RunTimeFilters
        :param _Order: 排序方式
        :


/*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * SPDX-License-Identifier: MPL-2.0
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

#pragma once

/*****
***** Module Info
*****/

/*! \file isc/quota.h
 *
 * \brief The isc_quota_t object is a simple helper object for implementing
 * quotas on things like the number of simultaneous connections to
 * a server.  It keeps track of the amount of quota in use, and
 * encapsulates the locking necessary to allow multiple tasks to
 * share a quota.
 */

/***
 *** Imports.
 ***/

#include <isc/atomic.h>
#include <isc/job.h>
#include <isc/magic.h>
#include <isc/mutex.h>
#include <isc/os.h>
#include <isc/refcount.h>
#include <isc/types.h>
#include <isc/urcu.h>

/*****
***** Types.
*****/

/* Add -DISC_QUOTA_TRACE=1 to CFLAGS for detailed reference tracing */

/*%
 * isc_quota structure
 *
 * NOTE: We are using struct cds_wfcq_head which has an internal
 * mutex, because we are using enqueue and dequeue, and dequeues need
 * synchronization between multiple threads (see urcu/wfcqueue.h for
 * detailed description).
 */
STATIC_ASSERT(ISC_OS_CACHELINE_SIZE >= sizeof(struct __cds_wfcq_head),
	      "ISC_OS_CACHELINE_SIZE smaller than "
	      "sizeof(struct __cds_wfcq_head)");
struct isc_quota {
	int		     magic;
	atomic_uint_fast32_t max;
	atomic_uint_fast32_t used;
	atomic_uint_fast32_t soft;
	struct {
		struct cds_wfcq_head head;
		uint8_t		     __padding[ISC_OS_CACHELINE_SIZE -
				       sizeof(struct __cds_wfcq_head)];
		struct cds_wfcq_tail tail;
	} jobs;
	ISC_LINK(isc_quota_t) link;
};

void
isc_quota_init(isc_quota_t *quota, unsigned int max);
/*%<
 * Initialize a quota object.
 */

void
isc_quota_destroy(isc_quota_t *quota);
/*%<
 * Destroy a quota object.
 */

void
isc_quota_soft(isc_quota_t *quota, unsigned int soft);
/*%<
 * Set a soft quota.
 */

void
isc_quota_max(isc_quota_t *quota, unsigned int max);
/*%<
 * Re-set a maximum quota.
 */

unsigned int
isc_quota_getmax(isc_quota_t *quota);
/*%<
 * Get the maximum quota.
 */

unsigned int
isc_quota_getsoft(isc_quota_t *quota);
/*%<
 * Get the soft quota.
 */

unsigned int
isc_quota_getused(isc_quota_t *quota);
/*%<
 * Get the current usage of quota.
 */

#define isc_quota_acquire(quota) isc_quota_acquire_cb(quota, NULL, NULL, NULL)
isc_result_t
isc_quota_acquire_cb(isc_quota_t *quota, isc_job_t *job, isc_job_cb cb,
		     void *cbarg);
/*%<
 *
 * Attempt to reserve one unit of 'quota', if there's no quota left then
 * cb->cb(cb->cbarg) will be called when there's quota again.
 *
 * Note: It's the caller's responsibility to make sure that we don't end up
 * with a huge number of callbacks waiting, making it easy to create a
 * resource exhaustion attack. For example, in the case of TCP listening,
 * we simply don't accept new connections when the quota is exceeded, so
 * the number of callbacks waiting in the queue will be limited by the
 * listen() backlog.
 *
 * Returns:
 * \li	#ISC_R_SUCCESS		Success
 * \li	#ISC_R_SOFTQUOTA	Success soft quota reached
 * \li	#ISC_R_QUOTA		Quota is full
 */

void
isc_quota_release(isc_quota_t *quota);
/*%<
 * Release one unit of quota.
 */


 com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam
import com.tencent.devops.common.pipeline.pojo.element.trigger.TimerTriggerElement
import com.tencent.devops.process.constant.ProcessMessageCode
import com.tencent.devops.process.constant.ProcessMessageCode.ERROR_TIMER_TRIGGER_SVN_BRANCH_NOT_EMPTY
import com.tencent.devops.process.engine.service.PipelineRepositoryService
import com.tencent.devops.process.plugin.ElementBizPlugin
import com.tencent.devops.process.plugin.annotation.ElementBiz
import com.tencent.devops.process.plugin.trigger.service.PipelineTimerService
import com.tencent.devops.process.plugin.trigger.service.PipelineTimerTriggerTaskService
import com.tencent.devops.process.pojo.pipeline.PipelineYamlVo
import org.slf4j.LoggerFactory

@ElementBiz
class TimerTriggerElementBizPlugin constructor(
    private val pipelineTimerService: PipelineTimerService,
    private val timerTriggerTaskService: PipelineTimerTriggerTaskService,
    private val pipelineRepositoryService: PipelineRepositoryService
) : ElementBizPlugin<TimerTriggerElement> {

    override fun elementClass(): Class<TimerTriggerElement> {
        return TimerTriggerElement::class.java
    }

    override fun check(element: TimerTriggerElement, appearedCnt: Int) = Unit

    override fun afterCreate(
        element: TimerTriggerElement,
        projectId: String,
        pipelineId: String,
        pipelineName: String,
        userId: String,
        channelCode: ChannelCode,
        create: Boolean,
        container: Container,
        yamlInfo: PipelineYamlVo?
    ) {
        val params = pipelineRepositoryService.getTriggerParams((container as TriggerContainer))
        logger.info("[$pipelineId]|$userId| Timer trigger [${element.name}] enable=${element.elementEnabled()}")
        val crontabExpressions = timerTriggerTaskService.getCrontabExpressions(
            params = params,
            element = element
        )
        val repo = timerTriggerTaskService.getRepo(
            projectId = projectId,
            element = element,
            params = params,
            yamlInfo = yamlInfo
        )
        // svn仓库分支必填
        if (repo != null && repo.getScmType() == ScmType.CODE_SVN && element.branches.isNullOrEmpty()) {
            throw ErrorCodeException(
                errorCode = ERROR_TIMER_TRIGGER_SVN_BRANCH_NOT_EMPTY
            )
        }
        // 删除旧的定时器任务, taskId未补充完整时, 保存流水线可能生成重复的定时任务
        pipelineTimerService.deleteTimer(
            projectId = projectId,
            pipelineId = pipelineId,
            userId = userId,
            taskId = ""
        )
        // 参数使用变量时，解析变量
        val finalBranches = element.branches
                ?.filter { it.isNotBlank() }
                ?.map { EnvUtils.parseEnv(it, params) }
                ?.toSet()

        if (crontabExpressions.isNotEmpty()) {
            val result = pipelineTimerService.saveTimer(
                projectId = projectId,
                pipelineId = pipelineId,
                userId = userId,
                crontabExpressions = crontabExpressions,
                channelCode = channelCode,
                repoHashId = repo?.repoHashId,
                branchs = finalBranches,
                noScm = element.noScm,
                taskId = element.id ?: "",
                startParam = element.convertStartParams()
            )
            logger.info("[$pipelineId]|$userId| Update pipeline timer|crontab=$crontabExpressions")
            if (result.isNotOk()) {
                throw ErrorCodeException(
                    errorCode =


for i := uint64(0); i < tvi-1; i++ {
		name := fmt.Sprintf("btsmmmm%v", i)
		g.NextBlock(name, nil, outs[1:], replaceTreasuryVersions,
			replaceCoinbase)
		g.SaveTipCoinbaseOutsWithTreasury()
		g.AcceptTipBlock()
		outs = g.OldestCoinbaseOuts()
	}

	// After mining the small and large tspends, the maximum allowed
	// expenditure shoud be zero.
	tipHash = &g.chain.BestSnapshot().Hash
	maxExpenditure, err := g.chain.MaxTreasuryExpenditure(tipHash)
	if err != nil {
		t.Fatal(err)
	}
	wantExpenditure := int64(0)
	if maxExpenditure != wantExpenditure {
		t.Fatalf("unexpected max expenditure - got %d, want %d",
			maxExpenditure, wantExpenditure)
	}
}
// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

package progresslog

import (
	"io"
	"reflect"
	"testing"
	"time"

	"github.com/decred/dcrd/wire"
	"github.com/decred/slog"
)

var (
	backendLog = slog.NewBackend(io.Discard)
	testLog    = backendLog.Logger("TEST")
)

// TestLogProgress ensures the logging functionality works as expected via a
// test logger.
func TestLogProgress(t *testing.T) {
	testBlocks := []wire.MsgBlock{{
		Header: wire.BlockHeader{
			Version:     1,
			Height:      100000,
			Timestamp:   time.Unix(1293623863, 0), // 2010-12-29 11:57:43 +0000 UTC
			Voters:      2,
			Revocations: 1,
			FreshStake:  4,
		},
		Transactions:  make([]*wire.MsgTx, 4),
		STransactions: nil,
	}, {
		Header: wire.BlockHeader{
			Version:     1,
			Height:      100001,
			Timestamp:   time.Unix(1293624163, 0), // 2010-12-29 12:02:43 +0000 UTC
			Voters:      3,
			Revocations: 2,
			FreshStake:  2,
		},
		Transactions:  make([]*wire.MsgTx, 2),
		STransactions: nil,
	}, {
		Header: wire.BlockHeader{
			Version:     1,
			Height:      100002,
			Timestamp:   time.Unix(1293624463, 0), // 2010-12-29 12:07:43 +0000 UTC
			Voters:      1,
			Revocations: 3,
			FreshStake:  1,
		},
		Transactions:  make([]*wire.MsgTx, 3),
		STransactions: nil,
	}}

	tests := []struct {
		name                string
		reset               bool
		inputBlock          *wire.MsgBlock
		forceLog            bool
		inputLastLogTime    time.Time
		wantReceivedBlocks  uint64
		wantReceivedTxns    uint64
		wantReceivedVotes   uint64
		wantReceivedRevokes uint64
		wantReceivedTickets uint64
	}{{
		name:                "round 1, block 0, last log time < 10 secs ago, not forced",
		inputBlock:          &testBlocks[0],
		forceLog:            false,
		inputLastLogTime:    time.Now(),
		wantReceivedBlocks:  1,
		wantReceivedTxns:    4,
		wantReceivedVotes:   2,
		wantReceivedRevokes: 1,
		wantReceivedTickets: 4,
	}, {
		name:                "round 1, block 1, last log time < 10 secs ago, not forced",
		inputBlock:          &testBlocks[1],
		forceLog:            false,
		inputLastLogTime:    time.Now(),
		wantReceivedBlocks:  2,
		wantReceivedTxns:    6,
		wantReceivedVotes:   5,
		wantReceivedRevokes: 3,
		wantReceivedTickets: 6,
	}, {
		name:                "round 1


?l:u,a,i,s);}}static rxChangeStatus(n){return n===1?!this.isExpansion:this.isExpansion;}static arcToArcConnect(n,e){let t=n.offsetEdge,r=e.offsetEdge,i=Yv(t,r);if(i){let s=this.getInters(i),o;if(s.length===2){let u=this.originalPrimitive[e.index].start(),c=s[0],h=s[1],f=c.distance2(u),d=h.distance2(u);f<d?o=c:o=h;}else o=s[0];let a,l;o.equals1(t.center)?a=new z(t.center,o):Math.abs(t.sweepAngle)<1e-4?a=new z(t.start(),o):(a=ee.build4(t.start(),o,t.center,t.rx,t.ry,t.sweep()),a instanceof ee&&a.sweepAngle===0&&(a=new z(a.start(),a.end()))),this.rawOffsetPrimitive.push(a),o.equals1(r.center)?l=new z(o,r.center):Math.abs(r.sweepAngle)<1e-4?l=new z(o,r.end()):(l=ee.build4(o,r.end(),r.center,r.rx,r.ry,r.sweep()),l instanceof ee&&l.sweepAngle===0&&(l=new z(l.start(),l.end()))),this.updateNextOffsetPrimitive(e.index,l);}else{let s=this.originalPrimitive[n.index],o=this.originalPrimitive[e.index],a=this.rxChangeStatus(s.sweep()),l=this.rxChangeStatus(o.sweep()),u=this.originalPrimitive[e.index].start(),c=this.getSweep(u,t,n.index),h=Math.abs(this.offsetDistance),f=ee.build2(u,a?s.endAngle():s.endAngle()+180,l?o.startAngle:o.startAngle+180,h,h,c);this.rawOffsetPrimitive.push(t),this.rawOffsetPrimitive.push(f);}}},_class16.originalPrimitive=[],_class16.offsetPrimitive=[],_class16.rawOffsetPrimitive=[],_class16.testI=0,_class16),In=class mc extends ec{constructor(e,t,r,i,s,o){if(super(),t<0||r<0)throw new Error("The width and height of rect can't be less than 0!");this.leftUpPoint=e,this.width=t,this.height=r,this.angle=i,this.isCCW=s,this.radius=Math.min(Math.max(o,0),t/2,r/2);}get radiusRatio(){return this.radius/Math.min(this.width,this.height);}start(){return this.leftUpPoint.add(new A(this.radius,0).multiply3(Ae.rotateD(this.angle)));}end(){return this.start();}getLeftPoint(){return this.leftUpPoint.add(new A(0,-this.height/2).multiply3(Ae.rotateD(this.angle)));}getRightPoint(){return this.leftUpPoint.add(new A(this.width,-this.height/2).multiply3(Ae.rotateD(this.angle)));}extend(e){return new mc(this.leftUpPoint.add(new A(-e,e).rotateD(A.ORIGIN,this.angle)),this.width+e*2,this.height+e*2,this.angle,this.isCCW,this.radius+e);}bbox(){let e=Ae.rotateD(this.angle),{leftUpPoint:t,width:r,height:i,radius:s}=


ests.
     QMapIterator<int, PeerWireClient *> it2(d->readIds);
     while (it2.findNext(client))
         d->readIds.remove(it2.key());

     // Delete the client later.
     disconnect(client, SIGNAL(disconnected()), this, SLOT(removeClient()));
     client->deleteLater();
     ConnectionManager::instance()->removeConnection(client);

     emit peerInfoUpdated();
     d->callPeerConnector();
 }

 void TorrentClient::peerPiecesAvailable(const QBitArray &pieces)
 {
     PeerWireClient *client = qobject_cast<PeerWireClient *>(sender());

     // Find the peer in our list of announced peers. If it's there,
     // then we can use the piece list into to gather statistics that
     // help us decide what peers to connect to.
     TorrentPeer *peer = 0;
     QList<TorrentPeer *>::Iterator it = d->peers.begin();
     while (it != d->peers.end()) {
         if ((*it)->address == client->peerAddress() && (*it)->port == client->peerPort()) {
             peer = *it;
             break;
         }
         ++it;
     }

     // If the peer is a seed, and we are in seeding mode, then the
     // peer is uninteresting.
     if (pieces.count(true) == d->pieceCount) {
         if (peer)
             peer->seed = true;
         emit peerInfoUpdated();
         if (d->state == Seeding) {
             client->abort();
             return;
         } else {
             if (peer)
                 peer->interesting = true;
             if ((client->peerWireState() & PeerWireClient::InterestedInPeer) == 0)
                 client->sendInterested();
             d->callScheduler();
             return;
         }
     }

     // Update our list of available pieces.
     if (peer) {
         peer->pieces = pieces;
         peer->numCompletedPieces = pieces.count(true);
     }

     // Check for interesting pieces, and tell the peer whether we are
     // interested or not.
     bool interested = false;
     int piecesSize = pieces.size();
     for (int pieceIndex = 0; pieceIndex < piecesSize; ++pieceIndex) {
         if (!pieces.testBit(pieceIndex))
             continue;
         if (!d->completedPieces.testBit(pieceIndex)) {
             interested = true;
             if ((client->peerWireState() & PeerWireClient::InterestedInPeer) == 0) {
                 if (peer)
                     peer->interesting = true;
                 client->sendInterested();
             }

             QMultiMap<PeerWireClient *, TorrentPiece *>::Iterator it = d->payloads.find(client);
             int inProgress = 0;
             while (it != d->payloads.end() && it.key() == client) {
                 if (it.value()->inProgress)
                     inProgress += it.value()->requestedBlocks.count(true);
                 ++it;
             }
             if (!inProgress)
                 d->callScheduler();
             break;
         }
     }
     if (!interested &&


[0].Descriptor()
}

func (LabelDetectionMode) Type() protoreflect.EnumType {
	return &file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_enumTypes[0]
}

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

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

// Bucketized representation of likelihood.
type Likelihood int32

const (
	// Unspecified likelihood.
	Likelihood_LIKELIHOOD_UNSPECIFIED Likelihood = 0
	// Very unlikely.
	Likelihood_VERY_UNLIKELY Likelihood = 1
	// Unlikely.
	Likelihood_UNLIKELY Likelihood = 2
	// Possible.
	Likelihood_POSSIBLE Likelihood = 3
	// Likely.
	Likelihood_LIKELY Likelihood = 4
	// Very likely.
	Likelihood_VERY_LIKELY Likelihood = 5
)

// Enum value maps for Likelihood.
var (
	Likelihood_name = map[int32]string{
		0: "LIKELIHOOD_UNSPECIFIED",
		1: "VERY_UNLIKELY",
		2: "UNLIKELY",
		3: "POSSIBLE",
		4: "LIKELY",
		5: "VERY_LIKELY",
	}
	Likelihood_value = map[string]int32{
		"LIKELIHOOD_UNSPECIFIED": 0,
		"VERY_UNLIKELY":          1,
		"UNLIKELY":               2,
		"POSSIBLE":               3,
		"LIKELY":                 4,
		"VERY_LIKELY":            5,
	}
)

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

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

func (Likelihood) Descriptor() protoreflect.EnumDescriptor {
	return file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_enumTypes[1].Descriptor()
}

func (Likelihood) Type() protoreflect.EnumType {
	return &file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_enumTypes[1]
}

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

// Deprecated: Use Likelihood.Descriptor instead.
func (Likelihood) EnumDescriptor() ([]byte, []int) {
	return file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_rawDescGZIP(), []int{1}
}

// Streaming video annotation feature.
type StreamingFeature int32

const (
	// Unspecified.
	StreamingFeature_STREAMING_FEATURE_UNSPECIFIED StreamingFeature = 0
	// Label detection. Detect objects, such as dog or flower.
	StreamingFeature_STREAMING_LABEL_DETECTION StreamingFeature = 1
	// Shot change detection.
	StreamingFeature_STREAMING_SHOT_CHANGE_DETECTION StreamingFeature = 2
	// Explicit content detection.
	StreamingFeature_STREAMING_EXPLICIT_CONTENT_DETECTION StreamingFeature = 3
	// Object detection and tracking.
	StreamingFeature_STREAMING_OBJECT_TRACKING StreamingFeature = 4
	// Action recognition based on AutoML model.
	StreamingFeature_STREAMING_AUTOML_ACTION_RECOGNITION StreamingFeature =


(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:pro


wser_compatibility">Browser compatibility

For obvious reasons, support is primarily expected on mobile browsers.

Supported in Firefox OS 1.0.1.

See also

MozMobileMessageManager

MozMmsEvent

MozSmsEvent

---
title: MozMobileMessageManager.getMessage()
slug: Archive/B2G_OS/API/MozMobileMessageManager/getMessage
tags:
  - API
  - B2G
  - DOM
  - Firefox OS
  - Method
  - Mobile
  - Non Standard
  - Reference
  - Référence(2)
  - WebSMS
---

Mobile Messaging API

Archive

Events

open

message

error

close

sending

sent

failed

deliverysuccess

deliveryerror

retrieving

received

Related pages for Mobile Messaging API

MozMmsEvent

MozMmsMessage

MozMobileMessageManager

MozMobileMessageThread

MozSmsEvent

MozSmsFilter

M


name"] = "Bonescythe Pauldrons";
	   ["req"] = 60;
	};
	[2279] = {
	   ["faction"] = "Alliance";
	   ["type"] = "Dungeon";
	   ["source"] = {
	      [1] = {
	         ["id"] = 131474;
	         ["type"] = "object";
	      };
	   };
	   ["next"] = 2439;
	   ["objective"] = "Take the miniature version of the Discs of Norgannon to the Explorers' League in Ironforge.";
	   ["gather"] = {
	      [1] = 6064;
	   };
	   ["zone"] = "Badlands";
	   ["repgain"] = {
	      [47] = 350;
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 5387;
	         ["type"] = "npc";
	      };
	   };
	   ["name"] = "The Platinum Discs";
	   ["prev"] = 2278;
	   ["prequests"] = {
	      [1] = 2278;
	   };
	   ["level"] = 47;
	   ["sort"] = "Uldaman";
	   ["req"] = 40;
	};
	[4605] = {
	   ["type"] = "Dungeon";
	   ["objective"] = "";
	   ["zone"] = "Dun Morogh";
	   ["sort"] = "Gnomeregan";
	   ["reward"] = {
	      [1] = 9363;
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 175084;
	         ["type"] = "object";
	      };
	   };
	   ["name"] = "The Sparklematic 5200!";
	   ["prev"] = 4601;
	   ["prequests"] = {
	      [1] = 4601;
	   };
	   ["level"] = 30;
	   ["source"] = {
	      [1] = {
	         ["id"] = 175084;
	         ["type"] = "object";
	      };
	   };
	   ["req"] = 25;
	};
	[4621] = {
	   ["objective"] = "Slay Fleet Master Seahorn and Baron Revilgaz of Booty Bay, and then return to Fleet Master Firallon aboard the Crimson Veil off the coast of Stranglethorn Vale.";
	   ["zone"] = "Stranglethorn Vale";
	   ["reward"] = {
	      [1] = 12185;
	   };
	   ["kill"] = {
	      [1] = 2496;
	      [2] = 2487;
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 2546;
	         ["type"] = "npc";
	      };
	   };
	   ["name"] = "Avast Ye, Admiral!";
	   ["sort"] = "Stranglethorn Vale";
	   ["level"] = 60;
	   ["source"] = {
	      [1] = {
	         ["id"] = 2546;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 55;
	};
	[9272] = {
	   ["objective"] = "";
	   ["zone"] = "Stranglethorn Vale";
	   ["repgain"] = {
	      [87] = 10;
	   };
	   ["reward"] = {
	      [1] = 22746;
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 2546;
	         ["type"] = "npc";
	      };
	   };
	   ["name"] = "Dressing the Part";
	   ["sort"] = "Stranglethorn Vale";
	   ["level"] = 55;
	   ["source"] = {
	      [1] = {
	         ["id"] = 2546;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 49;
	};
	[9304] = {
	   ["objective"] = "Take the Smudged Document to the Keeper of the Rolls at Light's Hope Chapel in the Eastern Plaguelands.";
	   ["repgain"] = {
	      [529] = 25;
	   };
	   ["gather"] = {


"
      },
      {
        "id": 3,
        "from": "Wien",
        "to": "Hamburg",
        "date": "2017-14-24T17:00:00.000+01:00"
      },
      {
        "id": 4,
        "from": "Wien",
        "to": "Hamburg",
        "date": "2017-15-24T17:00:00.000+01:00"
      },
      {
        "id": 5,
        "from": "Wien",
        "to": "Hamburg",
        "date": "2017-16-24T17:00:00.000+01:00"
      },
      {
        "id": 6,
        "from": "Wien",
        "to": "Hamburg",
        "date": "2017-17-24T17:00:00.000+01:00"
      },
      {
        "id": 7,
        "from": "Wien",
        "to": "Hamburg",
        "date": "2017-18-24T17:00:00.000+01:00"
      }
    ];

    if(from || to) {
      return flights.splice(0,4);
    }
    return flights;
  }

}
import { processEntity, ProcessedEntity } from "..";
import { AlgolEntityAnon } from "../../types";

type EntityTest = {
  entity: AlgolEntityAnon;
  expected: ProcessedEntity[];
};

const processEntityTests: EntityTest[] = [
  { entity: "a1", expected: [{ pos: "a1", x: 1, y: 1 }] },
  {
    entity: { sites: ["b2", "d5"] },
    expected: [{ pos: "b2", x: 2, y: 2 }, { pos: "d5", x: 4, y: 5 }]
  },
  {
    entity: { datasites: [{ bar: "baz" }, "b2", "d5"] },
    expected: [
      { pos: "b2", x: 2, y: 2, bar: "baz" },
      { pos: "d5", x: 4, y: 5, bar: "baz" }
    ]
  },
  {
    entity: { rect: ["c2", "e3"] },
    expected: [
      { pos: "c2", x: 3, y: 2 },
      { pos: "c3", x: 3, y: 3 },
      { pos: "d2", x: 4, y: 2 },
      { pos: "d3", x: 4, y: 3 },
      { pos: "e2", x: 5, y: 2 },
      { pos: "e3", x: 5, y: 3 }
    ]
  },
  {
    entity: { datarect: [{ baz: "bin" }, "c2", "e3"] },
    expected: [
      { pos: "c2", x: 3, y: 2, baz: "bin" },
      { pos: "c3", x: 3, y: 3, baz: "bin" },
      { pos: "d2", x: 4, y: 2, baz: "bin" },
      { pos: "d3", x: 4, y: 3, baz: "bin" },
      { pos: "e2", x: 5, y: 2, baz: "bin" },
      { pos: "e3", x: 5, y: 3, baz: "bin" }
    ]
  },
  {
    entity: { holerect: ["c2", "e3", "d3", "c2"] },
    expected: [
      { pos: "c3", x: 3, y: 3 },
      { pos: "d2", x: 4, y: 2 },
      { pos: "e2", x: 5, y: 2 },
      { pos: "e3", x: 5, y: 3 }
    ]
  },
  {
    entity: { dataholerect: [{ foo: "bar" }, "c2", "e3", "d3", "e2"] },
    expected: [
      { pos: "c2", x: 3, y: 2, foo: "bar" },
      { pos: "c3", x: 3, y: 3, foo: "bar" },
      { pos: "d2", x: 4, y: 2, foo: "bar" },
      { pos: "e3", x: 5, y: 3, foo: "bar" }
    ]
  }
];

test("processEntity", () => {
  processEntityTests.forEach(({ entity, expected }) =>
    expect(processEntity(entity)).toEqual(expected)
  );
});
import { ICommand } from '../../


ectionCloseType)) {
				cc := p.GetFirst(qt.ConnectionCloseType).(*qt.ConnectionCloseFrame)
				if cc.ErrorCode == 0x3 {
					trace.ErrorCode = 0
				} else if cc.ErrorCode & 0x100 == 0x100 {
					trace.ErrorCode = SFC_TLSHandshakeFailed
				}
				s.Finished()
			}
		case <-conn.ConnectionClosed:
			return
		case <-s.Timeout():
			return
		}
	}
}
package scenarii

import (
	"fmt"
	qt "github.com/QUIC-Tracker/quic-tracker"
)

const (
	SSRS_TLSHandshakeFailed               = 1
	SSRS_DidNotCloseTheConnection         = 2
	SSRS_CloseTheConnectionWithWrongError = 3
	SSRS_MaxStreamUniTooLow               = 4
	SSRS_UnknownError                     = 5
)

type StopSendingOnReceiveStreamScenario struct {
	AbstractScenario
}

func NewStopSendingOnReceiveStreamScenario() *StopSendingOnReceiveStreamScenario {
	return &StopSendingOnReceiveStreamScenario{AbstractScenario{name: "stop_sending_frame_on_receive_stream", version: 1}}
}

func (s *StopSendingOnReceiveStreamScenario) Run(conn *qt.Connection, trace *qt.Trace, preferredPath string, debug bool) {
	connAgents := s.CompleteHandshake(conn, trace, SSRS_TLSHandshakeFailed)
	if connAgents == nil {
		return
	}
	defer connAgents.CloseConnection(false, 0, "")

	if conn.TLSTPHandler.ReceivedParameters.MaxUniStreams == 0 {
		trace.MarkError(SSRS_MaxStreamUniTooLow, "", nil)
		return
	}

	incPackets := conn.IncomingPackets.RegisterNewChan(1000)

	conn.SendHTTP09GETRequest(preferredPath, 2)
	conn.FrameQueue.Submit(qt.QueuedFrame{&qt.StopSendingFrame{2, 0}, qt.EncryptionLevel1RTT})

	trace.ErrorCode = SSRS_DidNotCloseTheConnection
	for {
		select {
		case i := <-incPackets:
			switch p := i.(type) {
			case qt.Framer:
				if p.Contains(qt.ConnectionCloseType) {
					cc := p.GetFirst(qt.ConnectionCloseType).(*qt.ConnectionCloseFrame)
					if cc.ErrorCode != qt.ERR_STREAM_STATE_ERROR && cc.ErrorCode != qt.ERR_PROTOCOL_VIOLATION {
						trace.MarkError(SSRS_CloseTheConnectionWithWrongError, fmt.Sprintf("Expected 0x%02x, got 0x%02x", qt.ERR_STREAM_STATE_ERROR, cc.ErrorCode), p)
						trace.Results["connection_closed_error_code"] = fmt.Sprintf("0x%x", cc.ErrorCode)
						return
					}
					trace.ErrorCode = 0
					return
				}
			}
		case <-conn.ConnectionClosed:
			return
		case <-s.Timeout():
			return
		}
	}
}
package scenarii

import (
	qt "github.com/QUIC-Tracker/quic-tracker"
	"github.com/QUIC-Tracker/quic-tracker/agents"
)

const (
	AE_TLSHandshakeFailed = 1
	AE_FailedToSetECN     = 2
	AE_NonECN             = 3
	AE_NoACKECNReceived   = 4
	AE_NonECNButACKECN    = 5
)

type AckECNScenario struct {
	AbstractScenario
}

func NewAckECNScenario() *AckECNScenario {
	return &AckECNScenario{AbstractScenario{name: "ack_ecn", version: 1}}
}
func (s *AckECNScenario) Run(conn *qt.Connection, trace *qt.Trace, preferredPath string, debug bool) {
	connAgents := s


ounded};
use na;
use point::{LocalPointQuery, PointQuery};
use entities::bounding_volume::AABB;
use math::{Scalar, Point, Vect};

#[old_impl_check]
impl<N, P, V> LocalPointQuery<N, P> for AABB

    where N: Scalar,
          P: Point<N, V>,
          V: Vect<N> {
    #[inline]
    fn project_point(&self, pt: &P, solid: bool) -> P {
        let mins_pt = *self.mins() - *pt;
        let pt_maxs = *pt - *self.maxs();
        let shift   = na::sup(&na::zero(), &mins_pt) - na::sup(&na::zero(), &pt_maxs);

        if !shift.is_zero() || solid {
            *pt + shift
        }
        else {
            let _max: N     = Bounded::max_value();
            let mut best    = -_max;
            let mut best_id = 0isize;

            for i in 0 .. na::dim::<V>() {
                let mins_pt_i = mins_pt[i];
                let pt_maxs_i = pt_maxs[i];

                if mins_pt_i < pt_maxs_i {
                    if pt_maxs[i] > best {
                        best_id = i as isize;
                        best = pt_maxs_i
                    }
                }
                else if mins_pt_i > best {
                    best_id = -(i as isize);
                    best = mins_pt_i
                }
            }

            let mut shift: V = na::zero();

            if best_id < 0 {
                shift[(-best_id) as usize] = best;
            }
            else {
                shift[best_id as usize] = -best;
            }

            *pt + shift
        }
    }

    #[inline]
    fn distance_to_point(&self, pt: &P) -> N {
        let mins_pt = *self.mins() - *pt;
        let pt_maxs = *pt - *self.maxs();

        na::norm(&na::sup(&na::zero(), &na::sup(&mins_pt, &pt_maxs)))
    }

    #[inline]
    fn contains_point(&self, pt: &P) -> bool {
        for i in 0 .. na::dim::
() {
            if pt[i] < self.mins()[i] || pt[i] > self.maxs()[i] {
                return false
            }
        }

        true
    }
}

#[old_impl_check]
impl<N, P, V, M> PointQuery<N, P, M> for AABB

    where N: Scalar,
          P: Point<N, V>,
          V: Vect<N>,
          M: Transform
 {
}
<reponame>jaynus/space<gh_stars>0
//! This module contains helpers to work with morton codes, otherwise known as a z-order curve.

mod region;
mod wrapper;

pub use self::region::*;
pub use self::wrapper::*;

use bitintr::{Pdep, Pext};
use nalgebra::Vector3;
use num_traits::{FromPrimitive, PrimInt, ToPrimitive};
use std::hash::{Hash, Hasher};

/// Use this to map regions defined by a z-order curve on a particular level to arbitrary objects.
/// This uses a custom hasher that is optimized for z-order data locality.
pub type MortonRegionMap<T, M> = std::collections::HashMap<MortonRegion<M>, T, MortonBuildHasher>;
/// Use this to have a set of regions defined by a z-order curve on a particular level.
/// This will not exclude subset regions.
/// This uses a custom hasher that is optimized for z-order data locality.
pub type MortonRegionSet<M> = std::collections::HashSet<MortonRegion<M>, MortonBuildHasher>;
/// Use this to map voxels in z-order to arbitrary objects.
/// This uses a custo


, 9], true)).toEqual([2.5, 5, 7.5]);
  expect(quartile([1, 2, 3, 4, 5, 6, 7, 8])).toEqual([2.5, 4.5, 6.5]);
  expect(quartile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])).toEqual([3, 6, 9]);
  expect(quantile([1, 2, 3, 4, 5, 6, 7, 8, 9], 25)).toBe(3);
  expect(quantile([1, 2, 3, 4, 5, 6, 7, 8, 9], 25, true)).toBe(3);
  expect(quantile([1, 2, 3, 4, 5, 6, 7, 8, 9], 60)).toBe(6);

  const data5 = [5, 20, 40, 80, 100];
  expect(geometricMean(data5).toFixed(4)).toBe('31.6979');
  expect(harmonicMean(data5).toFixed(4)).toBe('16.8067');
  expect(variance(data5)).toBe(1284);
  expect(standardDeviation(data5).toFixed(4)).toBe('35.8329');

  const data6 = [1, 2, 3];
  expect(sum(data6)).toBe(6);
  expect(mean(data6)).toBe(2);
  expect(min(data6)).toBe(1);
  expect(min([3, 2, 1])).toBe(1);
  expect(max(data6)).toBe(3);
  expect(minIndex(data5)).toBe(0);
  expect(maxIndex(data5)).toBe(4);
  expect(covariance([1.1, 1.9, 3], [5.0, 10.4, 14.6]).toFixed(2)).toBe('3.02');
  expect(pearson([1.1, 1.9, 3], [5.0, 10.4, 14.6]).toFixed(4)).toBe('0.9868');
  expect(pearson([5.0, 10.4, 14.6], [1.1, 1.9, 3]).toFixed(4)).toBe('0.9868');
  expect(coefficientOfVariance([1, 2, 5, 9, 10, 11]).toFixed(4)).toBe('0.6160');

  // test cache
  expect(geometricMean(data5).toFixed(4)).toBe('31.6979');
  expect(harmonicMean(data5).toFixed(4)).toBe('16.8067');
  expect(variance(data5)).toBe(1284);
  expect(min(data6)).toBe(1);
  expect(max(data6)).toBe(3);
  expect(minIndex(data5)).toBe(0);
  expect(maxIndex(data5)).toBe(4);

  // 不小于均值
  expect(cdf(-0.1, -0.1, 2)).toBeCloseTo(0.5);
  expect(cdf(2, 0, 1)).toBeCloseTo(0.977);
  expect(cdf(2, 2, -3)).toBe(NaN);
  // 小于均值
  const cdfTestData = [
    -31.20860982319482, 12.590973577445197, 6.405819130157852, 40.749230591240234, 20.729801362383682,
    -61.037096924074945, -67.5656613441704, 1.336135458046897, 124.85998285693745, 27.915065732344942,
    -9.261606232548274, 14.535172710349343, 66.9231081402304, 25.407440121578702, -8.392386043428473,
    -54.91091630601909,
  ];
  expect(cdf(cdfTestData[0], mean(cdfTestData), standardDeviation(cdfTestData))).toBeCloseTo(0.2103);
  expect(cdf(-1.11, 0, 1)).toBeCloseTo(0.1334);

  expect(maxabs([0, 2, -7])).toBe(7);

  expect(normalDistributionQuantile(0.7673, 0, 1)).toBeCloseTo(0.73);
  expect(normalDistributionQuanti


 Timer.periodic(new Duration(milliseconds: 100), (timer) {
        if (currentPlayer.isStreamingAudio()) {
          isLoading = false;
          _view.onPlayerData(StatusPlayer.PLAYING);
          _timer?.cancel();
          _timer = null;
        } else if (timer.tick > 500) {
          currentPlayer.stop();
          isLoading = false;
          _view.onPlayerData(StatusPlayer.FAILED);
          _timer?.cancel();
          _timer = null;
        }
      });
    }
  }

  _stopAndPlay() async {
    isLoading = true;
    var success = await currentPlayer.stopAndPlay();
    bool isConnectionAvailable = await connection.isConnectionAvailable();
    if (!isConnectionAvailable || !success) {
      currentPlayer.stop();
      isLoading = false;
      _view.onPlayerData(StatusPlayer.FAILED);
    } else {
      if (_timer != null) {
        _timer?.cancel();
      }
      _timer = new Timer.periodic(new Duration(milliseconds: 100), (timer) {
        if (currentPlayer.isStreamingAudio()) {
          isLoading = false;
          _view.onPlayerData(StatusPlayer.PLAYING);
          _timer?.cancel();
          _timer = null;
        } else if (timer.tick > 500) {
          currentPlayer.stop();
          isLoading = false;
          _view.onPlayerData(StatusPlayer.FAILED);
          _timer?.cancel();
          _timer = null;
        }
      });
    }
  }
}
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:ui';

import 'package:animations/animations.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:cuacfm/injector/dependency_injector.dart';
import 'package:cuacfm/models/new.dart';
import 'package:cuacfm/models/now.dart';
import 'package:cuacfm/models/outstanding.dart';
import 'package:cuacfm/models/program.dart';
import 'package:cuacfm/models/radiostation.dart';
import 'package:cuacfm/models/time_table.dart';
import 'package:cuacfm/translations/localizations.dart';
import 'package:cuacfm/ui/home/home_presenter.dart';
import 'package:cuacfm/utils/bottom_bar.dart';
import 'package:cuacfm/utils/custom_image.dart';
import 'package:cuacfm/utils/neumorfism.dart';
import 'package:cuacfm/utils/player_view.dart';
import 'package:cuacfm/utils/radiocom_colors.dart';
import 'package:cuacfm/utils/safe_map.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:injector/injector.dart';
import 'package:intl/intl.dart';
import 'package:progress_indicators/progress_indicators.dart';

class MyHomePage extends StatefulWidget {
  final String title;

  MyHomePage({Key? key, required this.title}) : super(key: key);

  @override
  MyHomePageState createState() => new MyHomePageState();
}

class MyHomePageState extends State<MyHomePage>
    with WidgetsBindingObserver
    implements HomeView {
  late HomePresenter _presenter;
  late MediaQueryData queryData;
  late BuildContext context;
  final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
  BottomBarOption bottomBarOption = BottomBarOption.HOME;
  bool shouldShowPlayer = false;
  bool isMini = true;
  Now _nowProgram = Now.mock();
  Outstanding? _outstanding;
  List<Program> _podcast = [];
  List<New> _lastNews = [];
  List<TimeTable> _timeTable = [];
  List<TimeTable> _recentPodcast = [];
  List categories = [];
  List<Program> podcast0 = [];
  List<Program> podcast1 = [];
  List<Program> podcast2 = [];
  List<Program> podcast3 = [];
  List<Program> podcast4 = [];
  L


 must be >= 0, but was {splitBeginIndex}.");
			}

			if (splitEndIndex < 0)
			{
				throw new ArgumentException($"Split end index must be >= 0, but was {splitEndIndex}.");
			}

			if (splitBeginIndex > splitEndIndex)
			{
				throw new ArgumentException($"Split begin index must be smaller than split end index, but split begin index was {splitBeginIndex} and split end index was {splitEndIndex}.");
			}

			if (splitInterval < splitEndIndex - splitBeginIndex + 1)
			{
				throw new ArgumentException($"Split interval must be >= split size (split end index - split begin index), but split interval was {splitInterval}, split begin index {splitBeginIndex}, split end index {splitEndIndex} and split size {splitEndIndex - splitBeginIndex + 1}.");
			}

			UnderlyingDataset = underlyingDataset;
			SplitSize = splitEndIndex - splitBeginIndex + 1;
			SplitBeginIndex = splitBeginIndex;
			SplitEndIndex = splitEndIndex;
			SplitInterval = splitInterval;
		}

		/// <summary>
		/// Map an index relative to this dataset slice to an index relative to the underlying dataset.
		/// </summary>
		/// <param name="blockIndex"></param>
		/// <returns></returns>
		protected int MapToUnderlyingIndex(int blockIndex)
		{
			int round = blockIndex / SplitSize;
			int innerRoundIndex = blockIndex % SplitSize;

			return round * SplitInterval + SplitBeginIndex + innerRoundIndex;
		}

		public IDataset[] SplitBlockwise(params int[] parts)
		{
			return ExtractedDataset.SplitBlockwise(this, parts);
		}

		public IDataset[] SplitRecordwise(params double[] parts)
		{
			return ExtractedDataset.SplitRecordwise(this, parts);
		}

		public bool TrySetBlockSize(int blockSizeRecords)
		{
			return UnderlyingDataset.TrySetBlockSize(blockSizeRecords);
		}

		public bool IsBlockActive(int blockIndex)
		{
			return UnderlyingDataset.IsBlockActive(MapToUnderlyingIndex(blockIndex));
		}

		public bool IsBlockActive(int blockIndex, IComputationHandler handler)
		{
			return UnderlyingDataset.IsBlockActive(MapToUnderlyingIndex(blockIndex), handler);
		}

		public long GetBlockSizeBytes(int blockIndex, IComputationHandler handler)
		{
			return UnderlyingDataset.GetBlockSizeBytes(MapToUnderlyingIndex(blockIndex), handler);
		}

		public bool CanFetchBlocksAfter(int blockIndex)
		{
			return UnderlyingDataset.CanFetchBlocksAfter(MapToUnderlyingIndex(blockIndex));
		}

		public IDictionary<string, INDArray> FetchBlock(int blockIndex, IComputationHandler handler, bool shouldWaitUntilAvailable = true)
		{
			return UnderlyingDataset.FetchBlock(MapToUnderlyingIndex(blockIndex), handler, shouldWaitUntilAvailable);
		}

		public Task<IDictionary<string, INDArray>> FetchBlockAsync(int blockIndex, IComputationHandler handler, bool shouldWaitUntilAvailable = true)
		{
			return UnderlyingDataset.FetchBlockAsync(MapToUnderlyingIndex(blockIndex), handler, shouldWaitUntilAvailable);
		}

		public void FreeBlock(int blockIndex, IComputationHandler handler)
		{
			UnderlyingDataset.FreeBlock(MapToUnderlyingIndex(blockIndex), handler);
		}

		public void Dispose()
		{
			UnderlyingDataset.Dispose();
		}
	}
}


# id 34207 ([Chu Chu] The Five-Color Hill Special 1), field 450002023
sm.setSpeakerID(3003151) # Simia
sm.setParam(4)
sm.setInnerOverrideSpeakerTemplateID(3003151) # Simia
sm.sendNext("#b#h0##k!\r\nHow would one make one of those... #bsand... wiches#k?")
sm.setParam(2)
sm.sendSay("Uh... I need #bbread for a bun, something green and leafy like lettuce, and then some kind of meat patty#k...")
sm.setParam(4)
sm.sendSay("Okay! Then let's recreate the #bbread and 'lettuce'#k first!")
sm.setParam(2)
sm.sendSay("Okay. Can you think of anything here that tastes like the #blettuce, and the bread#k that were on the top and bottom of the sandwich?")
sm.setParam(4)
sm.sendSay("Ooh... I have an idea!")
sm.sendSay("First, head over to Five-Color Hill and gather #b40#k #i4034943:# #b#t4034943##k items from the #bBighorn Pinedeer#k. Those should perfectly replicate the flavor of the bread!")
sm.sendSay("Oh! But first, we need a #bname for our culinary experiment#k. How about we start with a word that #bdescribes the dish#k!")
sm.setParam(2)
sm.sendSay("I think the word 'sandwich' is already perfectly fine...")
sm.setParam(4)
sm.sendSay("No! Our food can't truly be great without a #bgreat name#k!\r\nPi siblings! Help the traveler brainstorm.")
sm.setSpeakerType(3)
sm.setInnerOverrideSpeakerTemplateID(3003153) # Pibik
res = sm.sendNext("Me first! Okay! Pick One:\r\n#b#L0# Delicious#l\r\n#b#L1# Homecooked#l#l\r\n#b#L2# This is dumb.#l")
sm.setSpeakerType(4)
sm.sendNext("#bDelicious #kis it? That's sounds cool!")
sm.setParam(2)
sm.sendSay("What... That's a terrible start for a sandwich name.")
sm.setSpeakerType(3)
sm.setParam(4)
sm.setInnerOverrideSpeakerTemplateID(3003154) # Pimi
res = sm.sendNext("Next, how about one of these!\r\n#b#L0# Beefy#l\r\n#b#L1# Smelly#l#l\r\n#b#L2# Your ideas are all terrible...#l")
sm.setSpeakerType(4)
sm.sendNext("Hmm. Sure, #bBeefy #kcould work!")
sm.setParam(2)
sm.sendSay("(Sighs) ...Whatever.")
sm.setSpeakerType(3)
sm.setParam(4)
sm.setInnerOverrideSpeakerTemplateID(3003155) # Pidol
res = sm.sendNext("Hehe, hehehe. I pick too!\r\n#b#L0# Bite of Heaven#l\r\n#b#L1# Surprise#l\r\n#b#L2# Delight#l")
sm.setSpeakerType(4)
sm.sendNext("...No like! I say... '#bTastesplosion#k' instead! Heheheh. Kaboom!")
sm.setParam(2)
sm.sendSay("Umm...")
sm.setParam(4)
sm.setInnerOverrideSpeakerTemplateID(3003151) # Simia
sm.sendSay("Okay, that settles it! The name of our sandwich is the #bDelicious Beefy Tastesplosion#k!")
sm.sendSay("Okay! Let's prepare our dish!")
sm.createQuestWithQRValue(34219, "foodname=Delicious Beefy Tastesplosion Sandwich")
sm.startQuest(parentID)
sm.warp(450002002)


26岁，毕业于北京大学，拥有3年以上的工作经验。|
|分类新闻报道|请将以下标题上的新闻报道分类为政治、娱乐或体育：1. 特朗普宣布参加2024年总统选举；2. 女演员因涉嫌吸毒被捕；3. 罗杰斯领衔的绿湾队进入超级碗。|
|编辑产品说明书|请为下列产品编写一份产品说明书（注明使用方法、注意事项和产品功能）：智能手环。|
| 情感分析                         | 请根据这段电影评论判断它的情感倾向是正面、负面还是中立？"这部电影很糟糕，完全没有看头。" |
| 关键词提取                       | 请从以下文章中提取出关键词："人工智能在当今社会中扮演着越来越重要的角色，各行各业都在加速其应用。" |
| 文本生成                         | 请使用以下关键词生成一篇科技新闻："5G 技术，云计算，自动驾驶，智能手机" |
| 主题分类                         | 请根据以下文本判断它所属的主题类别："苹果公司发布了一款新的 iPhone 手机，售价比上一代更高，但配备了更多的功能和更好的性能。" |
| 语法纠错                         | 请对以下句子中的语法错误进行纠正："我昨天去买了一部新的电脑，它的配置非常好。" |
| 实体识别                         | 请从以下句子中识别出所有的地名实体："我最近去了北京、上海、广州三个城市旅游。" |
| 文本摘要                         | 请对以下新闻文章进行摘要："中国国家主席习近平发表了新年贺词，强调要坚持以人民为中心的发展思想，建设更高水平的社会主义现代化国家。" |
| 图片分类                         | 请根据以下图片判断它所属的类别："https://example.com/image.jpg" |
| 对话生成                         | 请根据以下对话继续进行下去


.GroupType.fromJson(data) as T;
    }
    if (t == _i10.Example) {
      return _i10.Example.fromJson(data) as T;
    }
    if (t == _i11.MessageNotSentException) {
      return _i11.MessageNotSentException.fromJson(data) as T;
    }
    if (t == _i12.NotFoundException) {
      return _i12.NotFoundException.fromJson(data) as T;
    }
    if (t == _i13.Group) {
      return _i13.Group.fromJson(data) as T;
    }
    if (t == _i14.Message) {
      return _i14.Message.fromJson(data) as T;
    }
    if (t == _i15.ServerMembership) {
      return _i15.ServerMembership.fromJson(data) as T;
    }
    if (t == _i1.getType<_i2.DiscordChannel?>()) {
      return (data != null ? _i2.DiscordChannel.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i3.DiscordServer?>()) {
      return (data != null ? _i3.DiscordServer.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i4.DiscordUser?>()) {
      return (data != null ? _i4.DiscordUser.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i5.DiscordChannelEntity?>()) {
      return (data != null ? _i5.DiscordChannelEntity.fromJson(data) : null)
          as T;
    }
    if (t == _i1.getType<_i6.DiscordGroupEntity?>()) {
      return (data != null ? _i6.DiscordGroupEntity.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i7.DiscordServerEntity?>()) {
      return (data != null ? _i7.DiscordServerEntity.fromJson(data) : null)
          as T;
    }
    if (t == _i1.getType<_i8.ActivityStatus?>()) {
      return (data != null ? _i8.ActivityStatus.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i9.GroupType?>()) {
      return (data != null ? _i9.GroupType.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i10.Example?>()) {
      return (data != null ? _i10.Example.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i11.MessageNotSentException?>()) {
      return (data != null ? _i11.MessageNotSentException.fromJson(data) : null)
          as T;
    }
    if (t == _i1.getType<_i12.NotFoundException?>()) {
      return (data != null ? _i12.NotFoundException.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i13.Group?>()) {
      return (data != null ? _i13.Group.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i14.Message?>()) {
      return (data != null ? _i14.Message.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<_i15.ServerMembership?>()) {
      return (data != null ? _i15.ServerMembership.fromJson(data) : null) as T;
    }
    if (t == _i1.getType<List<_i15.ServerMembership>?>()) {
      return (data != null
          ? (data as List)
              .map((e) => deserialize<_i15.ServerMembership>(


;
	    }

	    return node;
	}

	function maybeToken(tokenizer) {
	    var ch = tokenizer.peek();

	    if (ch === '') {
	        return null;
	    }

	    return {
	        type: 'Token',
	        value: ch
	    };
	}

	function readProperty(tokenizer) {
	    var name;

	    tokenizer.eat(LESSTHANSIGN);
	    tokenizer.eat(APOSTROPHE);

	    name = scanWord(tokenizer);

	    tokenizer.eat(APOSTROPHE);
	    tokenizer.eat(GREATERTHANSIGN);

	    return maybeMultiplied(tokenizer, {
	        type: 'Property',
	        name: name
	    });
	}

	// https://drafts.csswg.org/css-values-3/#numeric-ranges
	// 4.1. Range Restrictions and Range Definition Notation
	//
	// Range restrictions can be annotated in the numeric type notation using CSS bracketed
	// range notation—[min,max]—within the angle brackets, after the identifying keyword,
	// indicating a closed range between (and including) min and max.
	// For example, <integer [0, 10]> indicates an integer between 0 and 10, inclusive.
	function readTypeRange(tokenizer) {
	    // use null for Infinity to make AST format JSON serializable/deserializable
	    var min = null; // -Infinity
	    var max = null; // Infinity
	    var sign = 1;

	    tokenizer.eat(LEFTSQUAREBRACKET);

	    if (tokenizer.charCode() === HYPERMINUS) {
	        tokenizer.peek();
	        sign = -1;
	    }

	    if (sign == -1 && tokenizer.charCode() === INFINITY) {
	        tokenizer.peek();
	    } else {
	        min = sign * Number(scanNumber(tokenizer));
	    }

	    scanSpaces(tokenizer);
	    tokenizer.eat(COMMA);
	    scanSpaces(tokenizer);

	    if (tokenizer.charCode() === INFINITY) {
	        tokenizer.peek();
	    } else {
	        sign = 1;

	        if (tokenizer.charCode() === HYPERMINUS) {
	            tokenizer.peek();
	            sign = -1;
	        }

	        max = sign * Number(scanNumber(tokenizer));
	    }

	    tokenizer.eat(RIGHTSQUAREBRACKET);

	    // If no range is indicated, either by using the bracketed range notation
	    // or in the property description, then [−∞,∞] is assumed.
	    if (min === null && max === null) {
	        return null;
	    }

	    return {
	        type: 'Range',
	        min: min,
	        max: max
	    };
	}

	function readType(tokenizer) {
	    var name;
	    var opts = null;

	    tokenizer.eat(LESSTHANSIGN);
	    name = scanWord(tokenizer);

	    if (tokenizer.charCode() === LEFTPARENTHESIS &&
	        tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
	        tokenizer.pos += 2;
	        name += '()';
	    }

	    if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET) {
	        scanSpaces(tokenizer);
	        opts = readTypeRange(tokenizer);
	    }

	    tokenizer.eat(GREATERTHANSIGN);

	    return maybeMultiplied(tokenizer, {
	        type: 'Type',
	        name: name,
	        opts: opts
	    });
	}

	function readKeywordOrFunction(tokenizer) {
	    var name;

	    name = scanWord(tokenizer);

	    if (tokenizer.charCode() === LEFTPARENTHESIS) {
	        tokenizer.pos++;

	        return {
	            type: 'Function',
	            name: name
	        };
	    }

	    return maybeMultiplied(tokenizer, {
	        type: 'Keyword',
	        name: name
	    });
	}

	function regroupTerms(terms, combinators) {
	    function createGroup(terms, combinator) {
	        return {
	            type: 'Group',
	            terms: terms,
	            combinator: combinator,
	            disallowEmpty: false,
	            explicit: false
	        };
	    }

	    combinators = Object.keys(combinators).sort(function(a, b) {
	        retu


DataIndex[i]
    local groupData = table.clone(_productsMaterialGroupTpl:getGroupDataByMaterialGroupId(materialGroupId))
    local itemData = groupData[groupDataIndex]
    local tableId = itemData.tableId
    table.insert(result, tableId)
  end
  return result
end

function this:getMaxCanDo()
  local canNum = L_Const.maxInt
  f


, InitialState) {
  RateLimitConfig config;
  config.max_requests_per_window = 60;
  createFilter(config);

  // Just test that filter is created successfully
  EXPECT_TRUE(filter_ != nullptr);
  EXPECT_EQ(config.max_requests_per_window, 60);
}

}  // namespace#include <gtest/gtest.h>

#include "mcp/logging/log_macros.h"
#include "mcp/logging/logger_registry.h"

using namespace mcp::logging;

// Test sink for capturing
class TestCaptureSink : public LogSink {
 public:
  void log(const LogMessage& msg) override {
    std::lock_guard<std::mutex> lock(mutex_);
    messages.push_back(msg);
  }

  void flush() override {}
  SinkType type() const override { return SinkType::Null; }

  std::vector<LogMessage> getMessages() {
    std::lock_guard<std::mutex> lock(mutex_);
    return messages;
  }

  void clear() {
    std::lock_guard<std::mutex> lock(mutex_);
    messages.clear();
  }

 private:
  std::mutex mutex_;
  std::vector<LogMessage> messages;
};

class LoggerRegistryTest : public ::testing::Test {
 protected:
  void SetUp() override {
    // Get registry instance
    registry_ = &LoggerRegistry::instance();

    // Create test sink
    test_sink_ = std::make_shared<TestCaptureSink>();
  }

  LoggerRegistry* registry_;
  std::shared_ptr<TestCaptureSink> test_sink_;
};

TEST_F(LoggerRegistryTest, SingletonInstance) {
  auto& instance1 = LoggerRegistry::instance();
  auto& instance2 = LoggerRegistry::instance();

  EXPECT_EQ(&instance1, &instance2);
}

TEST_F(LoggerRegistryTest, DefaultLogger) {
  auto logger = registry_->getDefaultLogger();

  ASSERT_NE(logger, nullptr);
  EXPECT_EQ(logger->getName(), "default");
  EXPECT_EQ(logger->getLevel(), LogLevel::Info);
}

TEST_F(LoggerRegistryTest, GetOrCreateLogger) {
  auto logger1 = registry_->getOrCreateLogger("test.logger");
  auto logger2 = registry_->getOrCreateLogger("test.logger");

  // Should return same instance
  EXPECT_EQ(logger1, logger2);
  EXPECT_EQ(logger1->getName(), "test.logger");
}

TEST_F(LoggerRegistryTest, ComponentLogger) {
  ComponentLogger logger(Component::Server, "test_server");

  // Set sink for testing
  auto registry_logger = registry_->getOrCreateLogger("Server.test_server");
  registry_logger->setSink(test_sink_);

  logger.log(LogLevel::Info, "Component log message");

  auto messages = test_sink_->getMessages();
  ASSERT_GE(messages.size(), 1);
  EXPECT_EQ(messages.back().component, Component::Server);
}

TEST_F(LoggerRegistryTest, SetGlobalLevel) {
  registry_->setGlobalLevel(LogLevel::Warning);

  auto logger = registry_->getOrCreateLogger("test.global");
  EXPECT_EQ(logger->getLevel(), LogLevel::Warning);

  registry_->setGlobalLevel(LogLevel::Debug);
  EXPECT_EQ(logger->getLevel(), LogLevel::Debug);
}

TEST_F(LoggerRegistryTest, SetComponentLevel) {
  registry_->setComponentLevel(Component::Network, LogLevel::Error);

  auto logger1 = registry_->getOrCreateLogger("Network.test1");
  auto logger2 = registry_->getOrCreateLogger("Server.test2");

  // Component level should be applied
  ComponentLogger net_logger(Component::Network, "test1");
  net_logger.setLevel(LogLevel::Error);

  // Other components use global level
  ComponentLogger srv_logger(Component::Server, "test2");
}

TEST_F(LoggerRegistryTest, PatternBasedLogging) {
  // Set global level explicitly to ensure consi


clone().into();
    let mut params = syn::parse2::<UriParams>(input)?;
    prefix_last_segment(&mut params.route_path, URI_MACRO_PREFIX);

    let path = &params.route_path;
    Ok(quote!(#path!(#input2)))
}

fn extract_exprs<'a>(internal: &'a InternalUriParams) -> Result<(
        impl Iterator<Item = (&'a Ident, &'a Type, &'a Expr)>,
        impl Iterator<Item = (&'a Ident, &'a Type, &'a ArgExpr)>,
    )>
{
    let route_name = &internal.uri_params.route_path;
    match internal.validate() {
        Validation::Ok(exprs) => {
            let path_param_count = internal.route_uri.path().matches('<').count();
            for expr in exprs.iter().take(path_param_count) {
                if !expr.as_expr().is_some() {
                    return Err(expr.span().error("path parameters cannot be ignored"));
                }
            }

            // Create an iterator over all `ident`, `ty`, and `expr` triples.
            let arguments = internal.fn_args.iter()
                .zip(exprs.into_iter())
                .map(|(FnArg { ident, ty }, expr)| (ident, ty, expr));

            // Create iterators for just the path and query parts.
            let path_params = arguments.clone()
                .take(path_param_count)
                .map(|(i, t, e)| (i, t, e.unwrap_expr()));

            let query_params = arguments.skip(path_param_count);
            Ok((path_params, query_params))
        }
        Validation::Unnamed(expected, actual) => {
            let mut diag = internal.uri_params.args_span().error(
                format!("`{}` route uri expects {} but {} supplied", quote!(#route_name),
                         p!(expected, "parameter"), p!(actual, "was")));

            if expected > 0 {
                let ps = p!("parameter", expected);
                diag = diag.note(format!("expected {}: {}", ps, internal.fn_args_str()));
            }

            Err(diag)
        }
        Validation::Named(missing, extra, dup) => {
            let e = format!("invalid parameters for `{}` route uri", quote!(#route_name));
            let mut diag = internal.uri_params.args_span().error(e)
                .note(format!("uri parameters are: {}", internal.fn_args_str()));

            fn join<S: Display, T: Iterator<Item = S>>(iter: T) -> (&'static str, String) {
                let mut items: Vec<_> = iter.map(|i| format!("`{}`", i)).collect();
                items.dedup();
                (p!("parameter", items.len()), items.join(", "))
            }

            if !missing.is_empty() {
                let (ps, msg) = join(missing.iter());
                diag = diag.help(format!("missing {}: {}", ps, msg));
            }

            if !extra.is_empty() {
                let (ps, msg) = join(extra.iter());
                let spans: Vec<_> = extra.iter().map(|ident| ident.span()).collect();
                diag = diag.span_help(spans, format!("unknown {}: {}", ps, msg));
            }

            if !dup.is_empty() {
                let (ps, msg) = join(dup.iter());
                let spans: Vec<_> = dup.iter().map(|ident| ident.span()).collect();
                diag = diag.span_help(spans, format!("duplicate {}: {}", ps, msg));
            }

            Err(diag)
        }
    }
}

fn add_binding(to: &mut Vec<TokenStream>, id


	fprintf(output_file, "\",\n");
    }

    if (!rflag) outline += 2;
    fprintf(output_file, "};\n#endif\n");
}

output_stype()
{
    if (!unionized && ntags == 0)
    {
	outline += 3;
	fprintf(code_file, "#ifndef YYSTYPE\ntypedef int YYSTYPE;\n#endif\n");
    }
}

output_trailing_text()
{
    register int c, last;
    register FILE *in, *out;

    if (line == 0)
	return;

    in = input_file;
    out = code_file;
    c = *cptr;
    if (c == '\n')
    {
	++lineno;
	if ((c = getc(in)) == EOF)
	    return;
	if (!lflag)
	{
	    ++outline;
	    fprintf(out, line_format, lineno, input_file_name);
	}
	if (c == '\n')
	    ++outline;
	putc(c, out);
	last = c;
    }
    else
    {
	if (!lflag)
	{
	    ++outline;
	    fprintf(out, line_format, lineno, input_file_name);
	}
	do { putc(c, out); } while ((c = *++cptr) != '\n');
	++outline;
	putc('\n', out);
	last = '\n';
    }

    while ((c = getc(in)) != EOF)
    {
	if (c == '\n')
	    ++outline;
	putc(c, out);
	last = c;
    }

    if (last != '\n')
    {
	++outline;
	putc('\n', out);
    }
    if (!lflag)
	fprintf(out, line_format, ++outline + 1, code_file_name);
}

output_semantic_actions()
{
    register int c, last;
    register FILE *out;

    fclose(action_file);
    action_file = fopen(action_file_name, "r");
    if (action_file == NULL)
	open_error(action_file_name);

    if ((c = getc(action_file)) == EOF)
	return;

    out = code_file;
    last = c;
    if (c == '\n')
	++outline;
    putc(c, out);
    while ((c = getc(action_file)) != EOF)
    {
	if (c == '\n')
	    ++outline;
	putc(c, out);
	last = c;
    }

    if (last != '\n')
    {
	++outline;
	putc('\n', out);
    }

    if (!lflag)
	fprintf(out, line_format, ++outline + 1, code_file_name);
}

free_itemsets()
{
    register core *cp, *next;

    FREE(state_table);
    for (cp = first_state; cp; cp = next)
    {
	next = cp->next;
	FREE(cp);
    }
}

free_shifts()
{
    register shifts *sp, *next;

    FREE(shift_table);
    for (sp = first_shift; sp; sp = next)
    {
	next = sp->next;
	FREE(sp);
    }
}

free_reductions()
{
    register reductions *rp, *next;

    FREE(reduction_table);
    for (rp = first_reduction; rp; rp = next)
    {
	next = rp->next;
	FREE(rp);
    }
}


ponent - Write"
description: ""
sidebar_position: 4
contributors: ["Jongseob Jeon"]
---

## Component

컴포넌트(Component)를 작성하기 위해서는 다음과 같은 내용을 작성해야 합니다.

1. 컴포넌트 콘텐츠(Component Contents) 작성
2. 컴포넌트 래퍼(Component Wrapper) 작성

이제 각 과정에 대해서 알아보도록 하겠습니다.

## Component Contents

컴포넌트 콘텐츠는 우리가 흔히 작성하는 파이썬 코드와 다르지 않습니다.
예를 들어서 숫자를 입력으로 받고 입력받은 숫자를 출력한 뒤 반환하는 컴포넌트를 작성해 보겠습니다.
파이썬 코드로 작성하면 다음과 같이 작성할 수 있습니다.

```python
print(number)
```

그런데 이 코드를 실행하면 에러가 나고 동작하지 않는데 그 이유는 출력해야 할 `number`가 정의되어 있지 않기 때문입니다.

[Kubeflow Concepts](../kubeflow/kubeflow-concepts.md)에서 `number` 와 같이 컴포넌트 콘텐츠에서 필요한 값들은 **Config**로 정의한다고 했습니다. 컴포넌트 콘텐츠를 실행시키기 위해 필요한 Config들은 컴포넌트 래퍼에서 전달이 되어야 합니다.

## Component Wrapper

### Define a standalone Python function

이제 필요한 Config를 전달할 수 있도록 컴포넌트 래퍼를 만들어야 합니다.

별도의 Config 없이 컴포넌트 래퍼로 감쌀 경우 다음과 같이 됩니다.

```python
def print_and_return_number():
    print(number)
    return number
```

이제 콘텐츠에서 필요한 Config를 래퍼의 argument로 추가합니다. 다만, argument 만을 적는 것이 아니라 argument의 타입 힌트도 작성해야 합니다. Kubeflow에서는 파이프라인을 Kubeflow 포맷으로 변환할 때, 컴포넌트 간의 연결에서 정해진 입력과 출력의 타입이 일치하는지 체크합니다. 만약 컴포넌트가 필요로 하는 입력과 다른 컴포넌트로부터 전달받은 출력의 포맷이 일치하지 않을 경우 파이프라인 생성을 할 수 없습니다.

이제 다음과 같이 argument와 그 타입, 그리고 반환하는 타입을 적어서 컴포넌트 래퍼를 완성합니다.

```python
def print_and_return_number(number: int) -> int:
    print(number)
    return number
```

Kubeflow에서 반환 값으로 사용할 수 있는 타입은 json에서 표현할 수 있는 타입들만 사용할 수 있습니다. 대표적으로 사용되며 권장하는 타입들은 다음과 같습니다.

- int
- float
- str

만약 단일 값이 아닌 여러 값을 반환하려면 `collections.namedtuple` 을 이용해야 합니다.
자세한 내용은 [Kubeflow 공식 문서](https://www.kubeflow.org/docs/components/pipelines/sdk/python-function-components/#passing-parameters-by-value)를 참고 하시


 Colours::transparentBlack;
  //bodyTextField->setColours(Colours::white, tb, tb, Colours::black, tb, tb);
  //bodyTextField->setColourScheme(colourScheme);
  bodyTextField->setText( String(T("This is a box in which some message can be displayed")));
  addAndMakeVisible(bodyTextField);

  okButton = new RButton(String(T("OK")));
  //okButton->setClickingTogglesState(false);
  okButton->addRButtonListener(this);
  addWidget(okButton);
}

RMessageBox::~RMessageBox()
{
  deleteAllChildren();
}

//-------------------------------------------------------------------------------------------------
// setup:

void RMessageBox::setHeadlineText(const String& newText)
{
  headlineTextField->setText(newText);
}

void RMessageBox::setBodyText(const String& newText)
{
  bodyTextField->setText(newText, false);
}

//-------------------------------------------------------------------------------------------------
// callbacks:

void RMessageBox::rButtonClicked(RButton* button)
{
  setVisible(false);
}

void RMessageBox::resized()
{
  headlineTextField->setBounds(4, 8, getWidth()-8, 16);
  bodyTextField->setBounds(16, 32, getWidth()-32, getHeight()-64);
  okButton->setBounds(getWidth()/2-20, getHeight()-28, 40, 20);
}
#include "GNUPlotter.h"
//#include <stdarg.h>  // needed?
#include <fstream>
#include <iostream>
#include <algorithm>

GNUPlotter::GNUPlotter()
{
  setDataPrecision(8);

  graphStyles.resize(1);
  graphStyles[0] = std::string("lines");    // standard lines, width 1 - maybe change to 1.5 or 2

  // installation path of the GNUPlot executable:
  gnuplotPath = "C:/Program Files/gnuplot/bin/gnuplot.exe";
  //gnuplotPath = "C:/Program Files/gnuplot/bin/wgnuplot.exe";

  // paths for data file and command batchfile:
  dataPath    = "E:/Temp/gnuplotData.dat";
  commandPath = "E:/Temp/gnuplotCommands.txt";   // this path may not contain whitepaces

  // initialize data- and commandfile:
  initFile(dataPath);
  initFile(commandPath);
  addDefaultCommands();
}

GNUPlotter::~GNUPlotter()
{
  delete[] formatString;
}

// plotting:

void GNUPlotter::plot()
{
  addPlotCommand(false);
  invokeGNUPlot();
}

void GNUPlotter::plot3D()
{
  addPlotCommand(true);
  invokeGNUPlot();
}

template <class T>
void GNUPlotter::plotFunctionTables(int N, T *x, T *y1, T *y2, T *y3, T *y4, T *y5, T *y6, T *y7,
  T *y8, T *y9)
{
  addDataArrays(N, x, y1, y2, y3, y4, y5, y6, y7, y8, y9);
  plot();
}

template <class T>
void GNUPlotter::plotArrays(int N, T *y1, T *y2, T *y3, T *y4, T *y5, T


jdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_THREE_PER_EM_SPACE = goog.getMsg('Three-per-em Space');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers over the character
   *   displayed. Newlines are not allowed; translation should be a noun and
   *   as consise as possible. More details:
   *   docs/fileview?id=0B8NbxddKsFtwYjExMGJjNzgtYjkzOS00NjdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_FIGURE_SPACE = goog.getMsg('Figure Space');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers over the character
   *   displayed. Newlines are not allowed; translation should be a noun and
   *   as consise as possible. More details:
   *   docs/fileview?id=0B8NbxddKsFtwYjExMGJjNzgtYjkzOS00NjdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_MONGOLIAN_SOFT_HYPHEN = goog.getMsg('Mongolian Soft Hyphen');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers over the character
   *   displayed. Newlines are not allowed; translation should be a noun and
   *   as consise as possible. More details:
   *   docs/fileview?id=0B8NbxddKsFtwYjExMGJjNzgtYjkzOS00NjdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_THIN_SPACE = goog.getMsg('Thin Space');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers over the character
   *   displayed. Newlines are not allowed; translation should be a noun and
   *   as consise as possible. More details:
   *   docs/fileview?id=0B8NbxddKsFtwYjExMGJjNzgtYjkzOS00NjdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_SOFT_HYPHEN = goog.getMsg('Soft Hyphen');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers over the character
   *   displayed. Newlines are not allowed; translation should be a noun and
   *   as consise as possible. More details:
   *   docs/fileview?id=0B8NbxddKsFtwYjExMGJjNzgtYjkzOS00NjdiLTlmOGQtOGVhZDkyZDU5YjM4.
   */
  var MSG_CP_ZERO_WIDTH_SPACE = goog.getMsg('Zero Width Space');

  /**
   * @desc Name for a symbol, character or a letter. Used in a pop-up balloon,
   *   shown to a document editing user trying to insert a special character.
   *   The balloon help would appear while the user hovers


    font-size: 12px;
    font-family: Roboto, "Helvetica Neue", sans-serif;
  }

  .mat-badge-small .mat-badge-content {
    font-size: 9px;
  }

  .mat-badge-large .mat-badge-content {
    font-size: 24px;
  }

  .mat-h1, .mat-headline, .mat-typography h1 {
    font: 400 24px/32px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
    margin: 0 0 16px;
  }

  .mat-h2, .mat-title, .mat-typography h2 {
    font: 500 20px/32px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
    margin: 0 0 16px;
  }

  .mat-h3, .mat-subheading-2, .mat-typography h3 {
    font: 400 16px/28px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
    margin: 0 0 16px;
  }

  .mat-h4, .mat-subheading-1, .mat-typography h4 {
    font: 400 15px/24px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
    margin: 0 0 16px;
  }

  .mat-h5, .mat-typography h5 {
    font: 400 calc(14px * 0.83)/20px Roboto, "Helvetica Neue", sans-serif;
    margin: 0 0 12px;
  }

  .mat-h6, .mat-typography h6 {
    font: 400 calc(14px * 0.67)/20px Roboto, "Helvetica Neue", sans-serif;
    margin: 0 0 12px;
  }

  .mat-body-strong, .mat-body-2 {
    font: 500 14px/24px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
  }

  .mat-body, .mat-body-1, .mat-typography {
    font: 400 14px/20px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
  }
  .mat-body p, .mat-body-1 p, .mat-typography p {
    margin: 0 0 12px;
  }

  .mat-small, .mat-caption {
    font: 400 12px/20px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
  }

  .mat-display-4, .mat-typography .mat-display-4 {
    font: 300 112px/112px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: -0.05em;
    margin: 0 0 56px;
  }

  .mat-display-3, .mat-typography .mat-display-3 {
    font: 400 56px/56px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: -0.02em;
    margin: 0 0 64px;
  }

  .mat-display-2, .mat-typography .mat-display-2 {
    font: 400 45px/48px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: -0.005em;
    margin: 0 0 64px;
  }

  .mat-display-1, .mat-typography .mat-display-1 {
    font: 400 34px/40px Roboto, "Helvetica Neue", sans-serif;
    letter-spacing: normal;
    margin: 0 0 64px;
  }

  .mat-bottom-sheet-container {
    font: 400 14px/20px Roboto, "Helvetica Neue", sans-serif;
    le


  color: #aaa;
}

.toastui-editor-contents ul ul,
.toastui-editor-contents ul ol,
.toastui-editor-contents ol ol,
.toastui-editor-contents ol ul {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.toastui-editor-contents ul li,
.toastui-editor-contents ol li {
  position: relative;
}

.toastui-editor-contents ul p,
.toastui-editor-contents ol p {
  margin: 0;
}

.toastui-editor-contents hr {
  border-top: 1px solid #eee;
  margin: 16px 0;
}

.toastui-editor-contents a {
  text-decoration: underline;
  color: #4b96e6;
}

.toastui-editor-contents a:hover {
  color: #1f70de;
}

.toastui-editor-contents .image-link {
  position: relative;
}

.toastui-editor-contents .image-link:hover::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  right: 0px;
  border-radius: 50%;
  border: 1px solid #c9ccd5;
  background: #fff url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgICAgICA8ZyBzdHJva2U9IiM1NTUiIHN0cm9rZS13aWR0aD0iMS41Ij4KICAgICAgICAgICAgPGc+CiAgICAgICAgICAgICAgICA8Zz4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy42NjUgMTUuMDdsLTEuODE5LS4wMDJjLTEuNDg2IDAtMi42OTItMS4yMjgtMi42OTItMi43NDR2LS4xOTJjMC0xLjUxNSAxLjIwNi0yLjc0NCAyLjY5Mi0yLjc0NGgzLjg0NmMxLjQ4NyAwIDIuNjkyIDEuMjI5IDIuNjkyIDIuNzQ0di4xOTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDAwIC00NTgxKSB0cmFuc2xhdGUoOTk1IDQ1NzYpIHRyYW5zbGF0ZSg1IDUpIHNjYWxlKDEgLTEpIHJvdGF0ZSg0NSAzNy4yOTMgMCkiLz4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMzI2IDQuOTM0bDEuODIyLjAwMmMxLjQ4NyAwIDIuNjkzIDEuMjI4IDIuNjkzIDIuNzQ0di4xOTJjMCAxLjUxNS0xLjIwNiAyLjc0NC0yLjY5MyAyLjc0NGgtMy44NDVjLTEuNDg3IDAtMi42OTItMS4yMjktMi42OTItMi43NDRWNy42OCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwMDAgLTQ1ODEpIHRyYW5zbGF0ZSg5OTUgNDU3NikgdHJhbnN


.Item_dem_gamble_closet2 =
{
  template = "Item_dem_gamble_closet1"
  map = "MAP02"

  theme = "!tech"

  thing_2007 =
  {
   berserk = 1
   invis = 5
   allmap = 2
   goggles = 5
  }

  thing_2008 =
  {
   bullet_box = 5
   shell_box = 5
   rocket_box = 2
   cell_pack = 1
  }

  thing_2010 =
  {
   green_armor = 2
   backpack = 1
   stimpack = 5
   medikit = 5
  }
}

PREFABS.Item_dem_gamble_closet2_tech =
{
  template = "Item_dem_gamble_closet1"
  map = "MAP03"

  theme = "tech"

  thing_2007 =
  {
   berserk = 1
   invis = 5
   allmap = 2
   goggles = 5
  }

  thing_2008 =
  {
   bullet_box = 5
   shell_box = 5
   rocket_box = 2
   cell_pack = 1
  }

  thing_2010 =
  {
   green_armor = 2
   backpack = 1
   stimpack = 5
   medikit = 5
  }
}


	MSG_NOT_WHITELISTED = '⚜ Join the Mercy Framework Discord & Do an intake to gain access to the Mercy GTA RP Server: https://discord.gg/mercy-coll',
		},
	},
}

Config.Rankings = {
	-- LOWER NUMBER === HIGHER PRIORITY
	-- [''] = {25, "You are {QUEUE_NUM}/{QUEUE_MAX} in queue. Please Wait.\n⚜ See our discord for more information: https://discord.gg/mercy-coll\n FiveM Account: LINKED ✔\n Priority Queue: Intaker 🎙\n⚠ If you should have Priority Queue then close your game and wait 5 minutes before reconnecting the server again ⚠"}, -- Admin
	-- [''] = {25, "You are {QUEUE_NUM}/{QUEUE_MAX} in queue. Please Wait.\n⚜ See our discord for more information: https://discord.gg/mercy-coll\n FiveM Account: LINKED ✔\n Priority Queue: Administrator 🛡\n⚠ If you should have Priority Queue then close your game and wait 5 minutes before reconnecting the server again ⚠"}, -- Admin
	-- [''] = {1, "You are {QUEUE_NUM}/{QUEUE_MAX} in queue. Please Wait.\n⚜ See our discord for more information: https://discord.gg/mercy-coll\n FiveM Account: LINKED ✔\n Priority Queue: Developer 🛠\n⚠ If you should have Priority Queue then close your game and wait 5 minutes before reconnecting the server again ⚠"}, -- Developers
	-- [''] = {1, "You are {QUEUE_NUM}/{QUEUE_MAX} in queue. Please Wait.\n⚜ See our discord for more information: https://discord.gg/mercy-coll\n FiveM Account: LINKED ✔\n Priority Queue: Owner 💎\n⚠ If you should have Priority Queue then close your game and wait 5 minutes before reconnecting the server again ⚠"}, -- Founder
}


nt i;

	vidactive = ingame;
	if (CurrentConsoleFont != NULL)
	{
		cwidth = CurrentConsoleFont->GetCharWidth ('M');
		cheight = CurrentConsoleFont->GetHeight();
	}
	else
	{
		cwidth = cheight = 8;
	}
	ConWidth = (width - LEFTMARGIN - RIGHTMARGIN);
	CmdLine.ConCols = ConWidth / cwidth;

	if (conbuffer == NULL) conbuffer = new FConsoleBuffer;

	i = Args->CheckParm ("-refreshfile");
	if (i > 0 && i < (int)Args->NumArgs() - 1)
	{
		RefreshFile = Args->GetArgList(i + 1);
		RefreshInterval = TICRATE;
		v = Args->CheckValue ("-refreshinterval");
		if (v != NULL && (atoi(v) != 0))
		{
			RefreshInterval = atoi(v);
		}
	}
}

//==========================================================================
//
// CCMD atexit
//
//==========================================================================

UNSAFE_CCMD (atexit)
{
	if (argv.argc() == 1)
	{
		Printf ("Registered atexit commands:\n");
		GameAtExit *record = ExitCmdList;
		while (record != NULL)
		{
			Printf ("%s\n", record->Command.GetChars());
			record = record->Next;
		}
		return;
	}
	for (int i = 1; i < argv.argc(); ++i)
	{
		GameAtExit *record = new GameAtExit(argv[i]);
		record->Next = ExitCmdList;
		ExitCmdList = record;
	}
}

//==========================================================================
//
// C_DeinitConsole
//
// Executes the contents of the atexit cvar, if any, at quit time.
// Then releases all of the console's memory.
//
//==========================================================================

void C_DeinitConsole ()
{
	GameAtExit *cmd = ExitCmdList;

	while (cmd != NULL)
	{
		GameAtExit *next = cmd->Next;
		AddCommandString (cmd->Command);
		delete cmd;
		cmd = next;
	}

	// Free command history
	History *hist = HistTail;

	while (hist != NULL)
	{
		History *next = hist->Newer;
		delete hist;
		hist = next;
	}
	HistTail = HistHead = HistPos = NULL;

	// Free alias commands. (i.e. The "commands" that can be allocated
	// at runtime.)
	for (size_t i = 0; i < countof(Commands); ++i)
	{
		FConsoleCommand *command = Commands[i];

		while (command != NULL)
		{
			FConsoleCommand *nextcmd = command->m_Next;
			if (command->IsAlias())
			{
				delete command;
			}
			command = nextcmd;
		}
	}

	// Make sure all tab commands are cleared before the memory for
	// their names is deallocated.
	C_ClearTabCommands ();
	C_ClearDynCCmds();

	// Free AddToConsole()'s work buffer
	if (work != NULL)
	{
		free (work);
		work = NULL;
		worklen = 0;
	}

	if (conbuffer != NULL)
	{
		delete conbuffer;
		conbuffer = NULL;
	}
}

static void ClearConsole ()
{
	if (conbuffer != NULL)
	{
		conbuffer->Clear();
	}
	TopLine = InsertLine = 0;
}

static void setmsgcolor (int index, int color)
{
	if ((unsigned)color >=


.getUsedCategoriesIds().first().size
        assertEquals(poiList.first().categories.map { it.id }.size, usedCategoriesCount2)
    }

    @Test
    fun test_delete_poi_older_then_90_days_nothing_to_delete() = runTest {
        categoriesDataSource.addCategories(testCategories)
        testCreationPoiList.forEach { poi -> SUT.insertPoi(poi) }
        val deletedPoi = SUT.deletePoiOlderThen(90)
        assertTrue(deletedPoi.isEmpty())
    }

    @Test
    fun test_delete_poi_also_deletes_used_categories() = runTest {
        categoriesDataSource.addCategories(testCategories)
        val poiId = SUT.insertPoi(testCreationPoi)
        val useCategoriesCount = SUT.getUsedCategoriesIds().first().size
        assertEquals(testCreationPoi.categories.size, useCategoriesCount)

        SUT.deletePoi(poiId.toString())
        val useCategoriesCount2 = SUT.getUsedCategoriesIds().first().size
        assertEquals(0, useCategoriesCount2)
    }

    @Test
    fun test_get_statistics_returns_statistics_values_based_on_test_input() = runTest {
        categoriesDataSource.addCategories(testCategories)
        testCreationPoiList.forEach { poi -> SUT.insertPoi(poi) }
        SUT.insertPoi(testCreationPoi)
        SUT.insertPoi(testCreationPoi)

        SUT.getPoi("1")
        SUT.getPoi("2")

        val statistics = SUT.getStatistics()

        assertEquals(2, statistics.viewedCount)
        assertEquals(3, statistics.unViewedCount)

        assertEquals(4, statistics.categoriesUsage.size)
        assertEquals(2, statistics.categoriesUsage["2"])
        assertEquals(2, statistics.categoriesUsage["6"])
        assertEquals(3, statistics.categoriesUsage["1"])
        assertEquals(3, statistics.categoriesUsage["5"])

        assertEquals(4, statistics.history.size)
    }

    private val testCreationPoi by lazy {
        PoiDataModel(
            id = UNSPECIFIED_ID,
            title = "Title",
            body = "Body",
            imageUrl = "https://www.google.com/image",
            contentLink = "https://www.google.com/somethingelse?query=1",
            creationDate = Clock.System.now(),
            commentsCount = 0,
            severity = 0,
            categories = listOf(
                CategoryDataModel(1, "High", Color.RED, type = "SEVERITY", false),
                CategoryDataModel(5, "Name", Color.WHITE, type = "PERSONAL", true)
            )
        )
    }

    private val testCreationPoiList by lazy {
        arrayListOf(
            PoiDataModel(
                id = 1,
                title = "A Title",
                body = "A Body",
                imageUrl = "https://www.google.com/image",
                contentLink = "https://www.google.com/somethingelse?query=1",
                creationDate = Clock.System.now() - 2.days,
                commentsCount = 0,
                severity = 0,
                categories = listOf(
                    CategoryDataModel(1, "High", Color.RED, type = "SEVERITY", false),
                    CategoryDataModel(5, "Name", Color.WHITE, type = "PERSONAL", true)
                )
            ),
            PoiDataModel(
                id = 2,
                title = "B Title",
                body = "B Body",
                imageUrl = "https://www.google.com/image",
                contentLink = "https://www.google.com/somethingelse?query=1",
                creationDate = Clock.System.now() - 7.days,
                commentsCount = 0,
                severity = 1,
                categories = listOf(
                    CategoryDataModel(2, "High", Color.RED, type = "


 "技後の慣性補正"), // 34
            new SkillInfoTypeEntry(0x07, 0x00AA6400, "標的"), // 35
            new SkillInfoTypeEntry(0x00, 0x00DCDCFF, "耐久力"), // 36
            new SkillInfoTypeEntry(0x0F, 0x00C86432, "汎用変数"), // 37
            new SkillInfoTypeEntry(0x2A, 0x00C86432, "技ツールパラメータ"), // 38
            new SkillInfoTypeEntry(0x00, 0x00E0E0E0, "装甲"), // 39
            new SkillInfoTypeEntry(0x00, 0x00E0E0E0, "ハイパーアーマー"), // 40
            new SkillInfoTypeEntry(0x00, 0x00E0E0E0, "装甲ﾋｯﾄｽﾄｯﾌﾟ補正率"), // 41
            new SkillInfoTypeEntry(0x00, 0x00E0E0E0, "無敵"), // 42
            new SkillInfoTypeEntry(0x00, 0x00E0E0E0, "死亡(自爆)"), // 43
            new SkillInfoTypeEntry(0x00, 0x00C80000, "弱点"), // 44
            new SkillInfoTypeEntry(0x00, 0x00C84000, "熱量"), // 45
            new SkillInfoTypeEntry(0x16, 0x00E61E1E, "攻撃：メカ"), // 46
            new SkillInfoTypeEntry(0x16, 0x00E61E1E, "攻撃：弾"), // 47
            new SkillInfoTypeEntry(0x00, 0x00E61E1E, "攻撃判定拡大縮小反映率"), // 48
            new SkillInfoTypeEntry(0x29, 0x00821E1E, "パラメータ変動"), // 49
            new SkillInfoTypeEntry(0x17, 0x001E1EE0, "ＣＰＵ回避"), // 50
            new SkillInfoTypeEntry(0x18, 0x001E1EE0, "ＣＰＵボタン入力"), // 51
            new SkillInfoTypeEntry(0x00, 0x001E1EE0, "ＣＰＵ特殊行動"), // 52
            new SkillInfoTypeEntry(0x00, 0x00000001, "ｷｬﾝｾﾙﾌﾗｸﾞ"), // 53
            new SkillInfoTypeEntry(0x19, 0x001EC8E6, "エフェクト"), // 54
            new SkillInfoTypeEntry(0x1A, 0x001EC8E6, "残像"), // 55
            new SkillInfoTypeEntry(0x1B, 0x00C80000, "溜め"), // 56
            new SkillInfoTypeEntry(0x1C, 0x00E6821E, "接触"), // 57
            new SkillInfoTypeEntry(0x1D, 0x00D0B010, "ＳＥ"), // 58
            new SkillInfoTypeEntry(0x1E, 0x00D0B010, "ボイス"), // 59
            new SkillInfoTypeEntry(0x00, 0x0060605E, "影の濃さ"), // 60
            new SkillInfoTypeEntry(0x00, 0x00C86432, "優先順位補正"), // 61
            new SkillInfoTypeEntry(0x2B, 0x00C8C832, "属性"), // 62
            new SkillInfoTypeEntry(0x00, 0x0082E61E, "ﾌｫｰｽﾌｨｰﾄﾞﾊﾞｯｸ"), // 63
            new SkillInfoTypeEntry(0x00, 0x0082E61E, "ﾚｰｻﾞｰ：振幅"), // 64
            new SkillInfoTypeEntry(0x00, 0x0082E61E, "ﾚｰｻﾞｰ：周期"), //


"""Model Context Protocol (MCP) integration.

This package provides integration with the Model Context Protocol (MCP), allowing agents to use tools provided by MCP
servers.

- Docs: https://www.anthropic.com/news/model-context-protocol
"""

from .mcp_agent_tool import MCPAgentTool
from .mcp_client import MCPClient
from .mcp_types import MCPTransport

__all__ = ["MCPAgentTool", "MCPClient", "MCPTransport"]