.3K
 * Total Submissions: 9.5K
 * Testcase Example:  '[[3,7,8],[9,11,13],[15,16,17]]'
 *
 * Given a m * n matrix of distinct numbers, return all lucky numbers in the
 * matrix in any order.
 *
 * A lucky number is an element of the matrix such that it is the minimum
 * element in its row and maximum in its column.
 *
 *
 * Example 1:
 *
 *
 * Input: matrix = [[3,7,8],[9,11,13],[15,16,17]]
 * Output: [15]
 * Explanation: 15 is the only lucky number since it is the minimum in its row
 * and the maximum in its column
 *
 *
 * Example 2:
 *
 *
 * Input: matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
 * Output: [12]
 * Explanation: 12 is the only lucky number since it is the minimum in its row
 * and the maximum in its column.
 *
 *
 * Example 3:
 *
 *
 * Input: matrix = [[7,8],[1,2]]
 * Output: [7]
 *
 *
 *
 * Constraints:
 *
 *
 * m == mat.length
 * n == mat[i].length
 * 1 <= n, m <= 50
 * 1 <= matrix[i][j] <= 10^5.
 * All elements in the matrix are distinct.
 *
 */

// @lc code=start
class Solution {
    fun luckyNumbers (matrix: Array<IntArray>): List<Int> {
        val n = matrix.size
        val m = matrix[0].size
        val res = mutableListOf<Int>()
        for (i in 0 until n) {
            var temp = 1000000
            var pos = 0
            for (j in 0 until m) {
                if (matrix[i][j] < temp) {
                    temp = matrix[i][j]
                    pos = j
                }
            }
            var flag = true
            for (j in 0 until n) {
                if (j != i && matrix[j][pos] > temp) {
                    flag = false
                    break
                }
            }
            if (flag) res.add(temp)
        }
        return res
    }
}
// @lc code=end

/*
 * @lc app=leetcode id=279 lang=kotlin
 *
 * [279] Perfect Squares
 *
 * https://leetcode.com/problems/perfect-squares/description/
 *
 * algorithms
 * Medium (41.37%)
 * Total Accepted:    173.3K
 * Total Submissions: 418K
 * Testcase Example:  '12'
 *
 * Given a positive integer n, find the least number of perfect square numbers
 * (for example, 1, 4, 9, 16, ...) which sum to n.
 *
 * Example 1:
 *
 *
 * Input: n = 12
 * Output: 3
 * Explanation: 12 = 4 + 4 + 4.
 *
 * Example 2:
 *
 *
 * Input: n = 13
 * Output: 2
 * Explanation: 13 = 4 + 9.
 */
class Solution {
    fun numSquares(n: Int): Int {
        var mN = n
        while (mN % 4 == 0) mN /= 4
        if (mN % 8 == 7) return 4
        var i = 0
        while (i*i <= n) {
            val temp = Math.sqrt(n-i*i*1.0).toInt()
            if (n == temp*temp+i*i) {
                return if (temp == 0 || i == 0) 1 else 2
            }
            i++
        }
        return 3
    }
}
fun main(args: Array<String>) {
    val test = Solution()
    println(test.numSquares(29825))
} /*
 * @lc app=leetcode id


数据，能够对机密数据提供安全保护
* 逻辑数据独立性。视图对重构数据库提供了一定程度的逻辑独立性
## 5.视图的缺点

* 性能。数据库必须把视图的查询转化成对基本表的查询，如果这个视图是由一个复杂的多表查询所定义，那么，即使是视图的一个简单查询，数据库也把它变成一个复杂的结合体，需要花费一定的时间。
* 修改限制。当用户试图修改视图的某些行时，数据库必须把它转化为对基本表的某些行的修改。事实上，当从视图中插入或者删除时，情况也是这样。对于简单视图来说，这是很方便的，但是，对于比较复杂的视图，可能是不可修改的

这些视图有如下特征：

1. 有UNIQUE等集合操作符的视图。
2. 有GROUP BY子句的视图。
3. 有诸如AVG\SUM\MAX等聚合函数的视图。
4. 使用DISTINCT关键字的视图。
5. 连接表的视图（其中有些例外）
## 6.什么是游标？

游标是系统为用户开设的一个数据缓冲区，存放SQL语句的执行结果，每个游标区都有一个名字。用户可以通过游标逐一获取记录并赋给主变量，交由主语言进一步处理。

# 八、存储过程与函数

## 1.什么是存储过程？有哪些优缺点？

存储过程是一个预编译的SQL语句，优点是允许模块化的设计，就是说只需要创建一次，以后在该程序中就可以调用多次。如果某次操作需要执行多次SQL，使用存储过程比单纯SQL语句执行要快。

**优点**

* 存储过程是预编译过的，执行效率高。
* 存储过程的代码直接存放于数据库中，通过存储过程名直接调用，减少网络通讯。
* 安全性高，执行存储过程需要有一定权限的用户。
* 存储过程可以重复使用，减少数据库开发人员的工作量。

**缺点**

* 调试麻烦，但是用 PL/SQL Developer 调试很方便！弥补这个缺点。
* 移植问题，数据库端代码当然是与数据库相关的。但是如果是做工程型项目，基本不存在移植问题。
* 重新编译问题，因为后端代码是运行前编译的，如果带有引用关系的对象发生改变时，受影响的存储过程、包将需要重新编译（不过也可以设置成运行时刻自动编译）。
* 如果在一个程序系统中大量的使用存储过程，到程序交付使用的时候随着用户需求的增加会导致数据结构的变化，接着就是系统的相关问题了，最后如果用户想维护该系统可以说是很难很难、而且代价是


01); // ~1.11km east of meetup location along equator
        let time = correct_meetup_time(&cid, 1);
        let mut alice_attestations: Vec<TestAttestation> = vec![];
        alice_attestations.push(
            meetup_claim_sign(get_accountid(&alice), bob.clone(), cid, 1, 1, loc, time, 3),
        );
        alice_attestations.push(
            meetup_claim_sign(get_accountid(&alice), ferdie.clone(), cid, 1, 1, loc, time, 3),
        );
        assert!(EncointerCeremonies::register_attestations(
            Origin::signed(get_accountid(&alice)),
            alice_attestations
        ).is_err());
        let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1);
        assert!(wit_vec.len() == 0);
    });
}

#[test]
fn ballot_meetup_n_votes_works() {
    ExtBuilder::build().execute_with(|| {
        let cid = register_test_currency();
        let master = AccountId::from(AccountKeyring::Alice);
        let alice = AccountKeyring::Alice.pair();
        let bob = AccountKeyring::Bob.pair();
        let ferdie = AccountKeyring::Ferdie.pair();
        let charlie = AccountKeyring::Charlie.pair();
        let dave = AccountKeyring::Dave.pair();
        let eve = AccountKeyring::Eve.pair();
        let cindex = EncointerScheduler::current_ceremony_index();
        register_alice_bob_ferdie(cid);
        register_charlie_dave_eve(cid);

        run_to_next_phase();
        // ASSIGNING
        run_to_next_phase();
        // ATTESTING
        let loc = Location::default();
        let time = correct_meetup_time(&cid, 1);
        gets_attested_by(get_accountid(&alice), vec![bob.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&bob), vec![alice.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&charlie), vec![alice.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&dave), vec![alice.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&eve), vec![alice.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&ferdie), vec![dave.clone()], cid, 1, 1, loc, time, 6);
        assert!(EncointerCeremonies::ballot_meetup_n_votes(&cid, 1, 1) == Some((5, 5)));

        gets_attested_by(get_accountid(&alice), vec![bob.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&bob), vec![alice.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get_accountid(&charlie), vec![alice.clone()], cid, 1, 1, loc, time, 4);
        gets_attested_by(get_accountid(&dave), vec![alice.clone()], cid, 1, 1, loc, time, 4);
        gets_attested_by(get_accountid(&eve), vec![alice.clone()], cid, 1, 1, loc, time, 6);
        gets_attested_by(get_accountid(&ferdie), vec![dave.clone()], cid, 1, 1, loc, time, 6);
        assert!(EncointerCeremonies::ballot_meetup_n_votes(&cid, 1, 1) == None);

        gets_attested_by(get_accountid(&alice), vec![bob.clone()], cid, 1, 1, loc, time, 5);
        gets_attested_by(get


ment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:128]
@ CHECK-ERRORS:                                   ^
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:256]
@ CHECK-ERRORS:                                   ^

	vld1.8	{d0, d1, d2}, [r4]!
	vld1.8	{d0, d1, d2}, [r4:16]!
	vld1.8	{d0, d1, d2}, [r4:32]!
	vld1.8	{d0, d1, d2}, [r4:64]!
	vld1.8	{d0, d1, d2}, [r4:128]!
	vld1.8	{d0, d1, d2}, [r4:256]!

@ CHECK: vld1.8	{d0, d1, d2}, [r4]!     @ encoding: [0x24,0xf9,0x0d,0x06]
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:16]!
@ CHECK-ERRORS:                                   ^
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:32]!
@ CHECK-ERRORS:                                   ^
@ CHECK: vld1.8	{d0, d1, d2}, [r4:64]!  @ encoding: [0x24,0xf9,0x1d,0x06]
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:128]!
@ CHECK-ERRORS:                                   ^
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:256]!
@ CHECK-ERRORS:                                   ^

	vld1.8	{d0, d1, d2}, [r4], r6
	vld1.8	{d0, d1, d2}, [r4:16], r6
	vld1.8	{d0, d1, d2}, [r4:32], r6
	vld1.8	{d0, d1, d2}, [r4:64], r6
	vld1.8	{d0, d1, d2}, [r4:128], r6
	vld1.8	{d0, d1, d2}, [r4:256], r6

@ CHECK: vld1.8	{d0, d1, d2}, [r4], r6  @ encoding: [0x24,0xf9,0x06,0x06]
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:16], r6
@ CHECK-ERRORS:                                   ^
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:32], r6
@ CHECK-ERRORS:                                   ^
@ CHECK: vld1.8	{d0, d1, d2}, [r4:64], r6 @ encoding: [0x24,0xf9,0x16,0x06]
@ CHECK-ERRORS: error: alignment must be 64 or omitted
@ CHECK-ERRORS:         vld1.8  {d0, d1, d2}, [r4:128], r6
@ CHECK


mponent>().GetNumeric(attributeType);
            if (attributeModifyEffect.ModifyType == ModifyType.BaseValue)
            {
                numeric.SetBase(value);
            }
            if (attributeModifyEffect.ModifyType == ModifyType.Add)
            {
                numeric.AddModifier(ModifierType.FinalAdd, numericModifier);
            }
            if (attributeModifyEffect.ModifyType == ModifyType.PercentAdd)
            {
                numeric.AddModifier(ModifierType.FinalPctAdd, numericModifier);
            }
            AttributeModifier = numericModifier;
        }

        public override void OnDisable()
        {
            //Log.Debug($"EffectAttributeModifyComponent OnDisable {AttributeModifyEffect.AttributeType}");
            var parentEntity = GetEntity<AbilityEffect>().OwnerAbility.Parent;
            var attributeType = AttributeModifyEffect.AttributeType;
            var numeric = parentEntity.GetComponent<AttributeComponent>().GetNumeric(attributeType);
            if (AttributeModifyEffect.ModifyType == ModifyType.Add)
            {
                numeric.RemoveModifier(ModifierType.FinalAdd, AttributeModifier);
            }
            if (AttributeModifyEffect.ModifyType == ModifyType.PercentAdd)
            {
                numeric.RemoveModifier(ModifierType.FinalPctAdd, AttributeModifier);
            }
        }

        public void OnTriggerApplyEffect(Entity effectAssign)
        {
            Enable = true;
        }
    }
}


return expected, nil
		},
		DoProvision: func(spec instance.Spec) (*instance.ID, error) {
			provisioned <- []interface{}{spec}
			made++
			id := instance.ID(fmt.Sprintf("%v", made))
			return &id, nil
		},
	}

	testScope := testutil_scope.DefaultScope()
	testScope.ResolveInstance = func(n string) (instance.Plugin, error) {
		lookup <- n
		return testInstancePlugin, nil
	}

	err = access.Init(testScope, 1*time.Second)
	require.NoError(t, err)

	require.NotNil(t, access.Plugin)

	access.Start()

	access.Pause(false)
	access.Pause(true)
	access.Pause(false)

	require.Equal(t, "simulator/compute", <-lookup)
	require.Equal(t, []interface{}{access.Select, true}, <-described)

	var seen []instance.Description

	count := 0
	for samples := range access.Observations() {
		seen = samples
		require.Equal(t, expected, seen)
		count++

		if count == 1 {
			access.Stop()
		}
	}

	// provision
	id, err := access.Provision(access.Spec)
	require.NoError(t, err)
	require.Equal(t, "1", string(*id))

	require.Equal(t, types.AnyValueMust(provisionSpec), types.AnyValueMust((<-provisioned)[0]))

	close(lookup)
	close(described)
	close(provisioned)
}
package types // import "github.com/docker/infrakit/pkg/controller/gc/types"

import (
	"context"

	"github.com/docker/infrakit/pkg/controller/internal"
	logutil "github.com/docker/infrakit/pkg/log"
	"github.com/docker/infrakit/pkg/run/depends"
	"github.com/docker/infrakit/pkg/spi/controller"
	"github.com/docker/infrakit/pkg/types"
)

var (
	log    = logutil.New("module", "controller/gc/types")
	debugV = logutil.V(200)
)

func init() {
	depends.Register("gc", types.InterfaceSpec(controller.InterfaceSpec), ResolveDependencies)
}

// ResolveDependencies returns a list of dependencies by parsing the opaque Properties blob.
func ResolveDependencies(spec types.Spec) (depends.Runnables, error) {
	if spec.Properties == nil {
		return nil, nil
	}

	properties := Properties{}
	err := spec.Properties.Decode(&properties)
	if err != nil {
		return nil, err
	}

	return depends.Runnables{
		depends.AsRunnable(
			types.Spec{
				Kind: properties.InstanceObserver.Name.Lookup(),
				Metadata: types.Metadata{
					Name: properties.InstanceObserver.Name.String(),
				},
			},
		),
		depends.AsRunnable(
			types.Spec{
				Kind: properties.NodeObserver.Name.Lookup(),
				Metadata: types.Metadata{
					Name: properties.NodeObserver.Name.String(),
				},
			},
		),
	}, nil
}

// Properties is the schema of the configuration in the types.Spec.Properties
type Properties struct {

	// Model is the workflow model to use
	Model string

	// ModelProperties contains model-specific configurations
	ModelProperties *types.Any

	// InstanceObserver is the observer of 'instances' side
	InstanceObserver internal.InstanceObserver

	// NodeObserver is the observer of the 'node' side
	NodeObserver internal.InstanceObserver
}

// Validate validates the input properties
func (p Properties) Validate(ctx context.C


c(r8)
/* 80027704 00023364  54 E4 28 34 */	slwi r4, r7, 5
/* 80027708 00023368  80 01 00 78 */	lwz r0, 0x78(r1)
/* 8002770C 0002336C  7C A5 22 14 */	add r5, r5, r4
/* 80027710 00023370  80 81 00 7C */	lwz r4, 0x7c(r1)
/* 80027714 00023374  90 05 00 00 */	stw r0, 0(r5)
/* 80027718 00023378  80 01 00 80 */	lwz r0, 0x80(r1)
/* 8002771C 0002337C  90 85 00 04 */	stw r4, 4(r5)
/* 80027720 00023380  80 81 00 84 */	lwz r4, 0x84(r1)
/* 80027724 00023384  90 05 00 08 */	stw r0, 8(r5)
/* 80027728 00023388  80 01 00 88 */	lwz r0, 0x88(r1)
/* 8002772C 0002338C  90 85 00 0C */	stw r4, 0xc(r5)
/* 80027730 00023390  80 81 00 8C */	lwz r4, 0x8c(r1)
/* 80027734 00023394  90 05 00 10 */	stw r0, 0x10(r5)
/* 80027738 00023398  80 01 00 94 */	lwz r0, 0x94(r1)
/* 8002773C 0002339C  90 85 00 14 */	stw r4, 0x14(r5)
/* 80027740 000233A0  90 65 00 18 */	stw r3, 0x18(r5)
/* 80027744 000233A4  90 05 00 1C */	stw r0, 0x1c(r5)
/* 80027748 000233A8  90 C8 00 08 */	stw r6, 8(r8)
lbl_8002774C:
/* 8002774C 000233AC  A8 1C 00 00 */	lha r0, 0(r28)
/* 80027750 000233B0  2C 00 00 01 */	cmpwi r0, 1
/* 80027754 000233B4  40 82 00 0C */	bne lbl_80027760
/* 80027758 000233B8  80 9C 00 04 */	lwz r4, 4(r28)
/* 8002775C 000233BC  48 00 00 2C */	b lbl_80027788
lbl_80027760:
/* 80027760 000233C0  2C 00 00 02 */	cmpwi r0, 2
/* 80027764 000233C4  40 82 00 18 */	bne lbl_8002777C
/* 80027768 000233C8  C0 1C 00 04 */	lfs f0, 4(r28)
/* 8002776C 000233CC  FC 00 00 1E */	fctiwz f0, f0
/* 80027770 000233D0  D8 01 01 20 */	stfd f0, 0x120(r1)
/* 80027774 000233D4  80 61 01 24 */	lwz r3, 0x124(r1)
/* 80027778 000233D8  48 00 00 0C */	b lbl_80027784
lbl_8002777C:
/* 8002777C 000233DC  7F 83 E3 78 */	mr r3, r28
/* 80027780 000233E0  48 20 65 B5 */	bl func_8022DD34
lbl_80027784:
/* 80027784 000233E4  7C 64 1B 78 */	mr r4, r3
lbl_80027788:
/* 80027788 000233E8  7F C3 F3 78 */	mr r3, r30
/* 8002778C 000233EC  38 A0 00 01 */	li r5, 1
/* 80027790 000233F0  48 01 E2 39 */	bl func_


fo);
	if (err)
		dp->hsr_dev = NULL;

	return err;
}

void dsa_port_hsr_leave(struct dsa_port *dp, struct net_device *hsr)
{
	struct dsa_notifier_hsr_info info = {
		.sw_index = dp->ds->index,
		.port = dp->index,
		.hsr = hsr,
	};
	int err;

	dp->hsr_dev = NULL;

	err = dsa_port_notify(dp, DSA_NOTIFIER_HSR_LEAVE, &info);
	if (err)
		dev_err(dp->ds->dev,
			"port %d failed to notify DSA_NOTIFIER_HSR_LEAVE: %pe\n",
			dp->index, ERR_PTR(err));
}

int dsa_port_tag_8021q_vlan_add(struct dsa_port *dp, u16 vid, bool broadcast)
{
	struct dsa_notifier_tag_8021q_vlan_info info = {
		.tree_index = dp->ds->dst->index,
		.sw_index = dp->ds->index,
		.port = dp->index,
		.vid = vid,
	};

	if (broadcast)
		return dsa_broadcast(DSA_NOTIFIER_TAG_8021Q_VLAN_ADD, &info);

	return dsa_port_notify(dp, DSA_NOTIFIER_TAG_8021Q_VLAN_ADD, &info);
}

void dsa_port_tag_8021q_vlan_del(struct dsa_port *dp, u16 vid, bool broadcast)
{
	struct dsa_notifier_tag_8021q_vlan_info info = {
		.tree_index = dp->ds->dst->index,
		.sw_index = dp->ds->index,
		.port = dp->index,
		.vid = vid,
	};
	int err;

	if (broadcast)
		err = dsa_broadcast(DSA_NOTIFIER_TAG_8021Q_VLAN_DEL, &info);
	else
		err = dsa_port_notify(dp, DSA_NOTIFIER_TAG_8021Q_VLAN_DEL, &info);
	if (err)
		dev_err(dp->ds->dev,
			"port %d failed to notify tag_8021q VLAN %d deletion: %pe\n",
			dp->index, vid, ERR_PTR(err));
}


/*
 * Copyright (c) 2014, Derek Buitenhuis
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef SMALLFRY_H
#define SMALLFRY_H

#include <stdint.h>

#include "ijgdec.h"

typedef struct smallfryctx {
    uint8_t *inbuf;
    uint8_t *outbuf;

    uint8_t *decinput;
    uint8_t *decoutput;

    uint8_t *inplanar;
    uint8_t *outplanar;

    jinfo res;

    uint64_t isize;
    uint64_t osize;
} smallfryctx;

smallfryctx *smallfryallocctx(uint8_t *inbuf, uint64_t size);
void smallfryfreectx(smallfryctx **in);
int smallfryoptimize(smallfryctx *ctx);
uint64_t smallfrygetsize(smallfryctx *ctx);
uint8_t *smallfrygetbuffer(smallfryctx *ctx);

#endif


          "id": [1, 9, 2, 3, 7, 8],
            "ancestor_list": ["[9]", "[None]", "[9]", "[1]", "[9]", "[1]"],
        }
    )
    phylogeny_df["id_"] = phylogeny_df["id"]
    phylogeny_df = apply(phylogeny_df)
    original_df = phylogeny_df.copy()
    result_df = alifestd_mark_num_leaves_sibling_asexual(
        phylogeny_df,
        mutate=mutate,
    )
    result_df.index = result_df["id_"]
    assert result_df.loc[1, "num_leaves_sibling"] == 2
    assert result_df.loc[9, "num_leaves_sibling"] == 0
    assert result_df.loc[2, "num_leaves_sibling"] == 3
    assert result_df.loc[3, "num_leaves_sibling"] == 1
    assert result_df.loc[7, "num_leaves_sibling"] == 3
    assert result_df.loc[8, "num_leaves_sibling"] == 1

    if not mutate:
        assert original_df.equals(phylogeny_df)

@pytest.mark.parametrize("apply", [lambda x: x, alifestd_to_working_format])
@pytest.mark.parametrize("mutate", [True, False])
def test_simple5(apply: typing.Callable, mutate: bool):
    phylogeny_df = pd.DataFrame(
        {
            "id": [0, 1, 2, 3, 4],
            "ancestor_list": ["[None]", "[0]", "[0]", "[1]", "[None]"],
        }
    )
    phylogeny_df["id_"] = phylogeny_df["id"]
    phylogeny_df = apply(phylogeny_df)
    original_df = phylogeny_df.copy()
    result_df = alifestd_mark_num_leaves_sibling_asexual(
        phylogeny_df,
        mutate=mutate,
    )
    result_df.index = result_df["id_"]
    assert result_df.loc[0, "num_leaves_sibling"] == 0
    assert result_df.loc[1, "num_leaves_sibling"] == 1
    assert result_df.loc[2, "num_leaves_sibling"] == 1
    assert result_df.loc[3, "num_leaves_sibling"] == 0
    assert result_df.loc[4, "num_leaves_sibling"] == 0

    if not mutate:
        assert original_df.equals(phylogeny_df)


import unittest

from kivy.tests.common import GraphicUnitTest
from kivy.uix.widget import Widget
from kivy.graphics import Fbo, Color, Rectangle

class FboTest(Widget):
    def __init__(self, **kwargs):
        super(FboTest, self).__init__(**kwargs)
        self.positions = [
            (260.0, 260.0),
            (192.0, 192.0),
            (96.0, 192.0),
            (192.0, 96.0),
            (96.0, 96.0),
            (32.0, 192.0),
            (192.0, 32.0),
            (32.0, 32.0)
        ]

        self.fbo = Fbo(size=(256, 256))
        with self.fbo:
            Color(0.56789, 0, 0, 1)
            Rectangle(size=(256, 64))
            Color(0, 0.56789, 0, 1)
            Rectangle(size=(64, 256))
            Color(0.56789, 0, 0, .5)
            Rectangle(pos=(64, 64), size=(192, 64))
            Color(0, 0.56789, 0, .5)
            Rectangle(pos=(64, 64), size=(64, 192))
        self.fbo.draw()

class FBOGetPixelColorTest(GraphicUnitTest):
    def test_fbo_get_pixel_color(self):
        fbow = FboTest()
        render_error = 2
        values = [
            # out of bounds of FBO
            (tuple, int, (0, 0, 0, 0)),
            # in FBO, black
            (list, int, [0, 0, 0, 0]),
            # Color(0, 0.56789, 0, .5)
            (list, int, [0, 72, 0, 128]),
            # Color(0.56789, 0, 0, .5)
            (list, int, [72, 0, 0, 128]),
            # overlap above 2 w/ alpha
            (list, int, [36, 72, 0, 255]),
            # Color(0, 0.56789, 0, 1)
            (list, int, [0, 145, 0, 255]),
            # Color(0.56789, 0, 0, 1)
            (list, int, [145, 0, 0, 255]),
            # overlap above 2 w/o alpha
            (list, int, [0, 145, 0, 255]),
        ]

        for i, pos in enumerate(fbow.positions):
            c = fbow.fbo.get_pixel_color(pos[0], pos[1])
            # returned class
            self.assertTrue(isinstance(c, values[i][0]))
            # returned types in container
            for v in c:
                self.assertTrue(isinstance(v, values[i][1]))
            # returned values
            for j, val in enumerate(c):
                self.assertAlmostEqual(
                    val, values[i][2][j],
                    delta=render_error
                )

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


	}

	@Override
	public void processPubRel(int messageId) {
		MessageData msgObj = changeMessageStatus(messageId, MessageStatus.PUBREL);

		if ((msgObj != null) && (getListeners() != null)) {
			if (msgObj.getQos() == MqttQoS.EXACTLY_ONCE.value()) {
				getListeners().stream().filter(item -> item.matcher(msgObj.getTopic())).forEach(listener -> {
					listener.receiveMessage(msgObj.getMessageId(), msgObj.getTopic(), msgObj);
				});
			}
		}
		NettyLog.debug("process Pub-rel: messageId - {} ", messageId);
	}

	@Override
	public void processSubAck(int messageId) {
		NettyLog.debug("process Sub-ack: messageId - {} ", messageId);
	}

	@Override
	public void processUnSubBack(int messageId) {
		NettyLog.debug("process Un-sub-back: messageId - {} ", messageId);
	}

	@Override
	public void processPublish(MessageData msg) {
		NettyLog.info("process Publish: {} ", msg);

		if (getListeners() != null) {
			getListeners().stream().filter(item -> item.matcher(msg.getTopic())).forEach(listener -> {

				listener.receiveMessageByAny(msg.getMessageId(), msg.getTopic(), msg);

				if (msg.getQos() == MqttQoS.AT_MOST_ONCE.value() ||
						msg.getQos() == MqttQoS.EXACTLY_ONCE.value()) {
					listener.receiveMessage(msg.getMessageId(), msg.getTopic(), null);
				}
			});

		}
	}

	@Override
	public void sendPubRecMessage(int messageId) {
		NettyLog.debug("send Pub-rec: messageId - {} ", messageId);
		channel().writeAndFlush(ClientProtocolUtil.pubRecMessage(messageId));
	}

	@Override
	public void sendPubAckMessage(int messageId) {
		NettyLog.debug("send Pub-ack: messageId - {} ", messageId);
		channel().writeAndFlush(ClientProtocolUtil.pubAckMessage(messageId));
	}

	@Override
	public void sendPubCompMessage(int messageId) {
		NettyLog.debug("send Pub-comp: messageId - {} ", messageId);
		channel().writeAndFlush(ClientProtocolUtil.pubCompMessage(messageId));
	}

	public List<MqttConsumerListener> getListeners() {
		return listeners;
	}

	public void setListeners(List<MqttConsumerListener> listeners) {
		this.listeners = listeners;
	}

	@Override
	public void setCacheList(CacheList<MessageData> msgList) {
		if (msgList != null) {
			this.msgListCache = msgList;
		}
	}
}
package com.iteaj.iot.redis.proxy;

import com.iteaj.iot.redis.ComplexRedisProducer;
import com.iteaj.iot.redis.SimpleRedisProducer;
import com.iteaj.iot.redis.producer.RedisProducer;
import com.iteaj.network.ProtocolException;
import org.aopalliance.intercept.MethodInterceptor;
import org.springframework.aop.framework.ProxyFactory;

import java.lang.reflect.Method;

public class ProtocolHandleProxy {

    private static String BUSINESS_NAME = "business";

    public Object createProxy(RedisProducer target) {
        ProxyFactory proxyFactory = new ProxyFactory();
        proxyFactory.setTarget(target);
        try {

            proxyFactory.addAdvice((MethodInterceptor) invocation -> {
                Method method = invocation.getMethod();
                if(BUSINESS_NAME.equals(method.getName())) {
                    Object returnValue = method.invoke(invocation.getThis(), invocation.getArguments());

                    if(target instanceof SimpleRedisProducer) {

                        // 没有返回值, 直接返回
                        if(null == returnValue) {


case eStopReasonException:
  case eStopReasonExec:
  case eStopReasonFork:
  case eStopReasonVFork:
  case eStopReasonVForkDone:
  case eStopReasonSignal:
    // In all these cases we want to stop in the deepest frame.
    m_current_inlined_pc = curr_pc;
    m_current_inlined_depth = 0;
    break;
  case eStopReasonBreakpoint: {
    // FIXME: Figure out what this break point is doing, and set the inline
    // depth appropriately.  Be careful to take into account breakpoints that
    // implement step over prologue, since that should do the default
    // calculation. For now, if the breakpoints corresponding to this hit are
    // all internal, I set the stop location to the top of the inlined stack,
    // since that will make things like stepping over prologues work right.
    // But if there are any non-internal breakpoints I do to the bottom of the
    // stack, since that was the old behavior.
    uint32_t bp_site_id = stop_info_sp->GetValue();
    BreakpointSiteSP bp_site_sp(
        m_thread.GetProcess()->GetBreakpointSiteList().FindByID(bp_site_id));
    bool all_internal = true;
    if (bp_site_sp) {
      uint32_t num_owners = bp_site_sp->GetNumberOfConstituents();
      for (uint32_t i = 0; i < num_owners; i++) {
        Breakpoint &bp_ref =
            bp_site_sp->GetConstituentAtIndex(i)->GetBreakpoint();
        if (!bp_ref.IsInternal()) {
          all_internal = false;
        }
      }
    }
    if (!all_internal) {
      m_current_inlined_pc = curr_pc;
      m_current_inlined_depth = 0;
      break;
    }
  }
    [[fallthrough]];
  default: {
    // Otherwise, we should set ourselves at the container of the inlining, so
    // that the user can descend into them. So first we check whether we have
    // more than one inlined block sharing this PC:
    int num_inlined_functions = 0;

    for (Block *container_ptr = block_ptr->GetInlinedParent();
         container_ptr != nullptr;
         container_ptr = container_ptr->GetInlinedParent()) {
      if (!container_ptr->GetRangeContainingAddress(pc_as_address,
                                                    containing_range))
        break;
      if (pc_as_address != containing_range.GetBaseAddress())
        break;

      num_inlined_functions++;
    }
    m_current_inlined_pc = curr_pc;
    m_current_inlined_depth = num_inlined_functions + 1;
    Log *log = GetLog(LLDBLog::Step);
    if (log && log->GetVerbose())
      LLDB_LOGF(log,
                "ResetCurrentInlinedDepth: setting inlined "
                "depth: %d 0x%" PRIx64 ".\n",
                m_current_inlined_depth, curr_pc);

    break;
  }
  }
}

bool StackFrameList::DecrementCurrentInlinedDepth() {
  if (m_show_inlined_frames) {
    uint32_t current_inlined_depth = GetCurrentInlinedDepth();
    if (current_inlined_depth != UINT32_MAX) {
      if (current_inlined_depth > 0) {
        m_current_inlined_depth--;
        return true;
      }
    }
  }
  return false;
}

void StackFrameList::SetCurrentInlinedDepth(uint32_t new_depth) {
  m_current_inlined_depth = new_depth;
  if (new_depth == UINT32_MAX)
    m_current_inlined_pc = LLDB_INVALID_ADDRESS;
  else
    m_current_inlined_pc = m_thread.GetRegisterContext()->Get


 to getPreferredSize();
            isPrefCalled = true
        }
        return c.minimumSize.height
    }

    override fun getMinimumWidth(sz: Int): Int {
        if (!isPrefCalled) {
            c.preferredSize // To defeat a bug where the minimum size is different before and after the first call to getPreferredSize();
            isPrefCalled = true
        }
        return c.minimumSize.width
    }

    override fun getPreferredHeight(sz: Int): Int {
        // If the component has not gotten size yet and there is a size hint, trick Swing to return a better height.
        if (c.width == 0 && c.height == 0 && sz != -1) {
            c.setBounds(c.x, c.y, sz, 1)
        }
        return c.preferredSize.height
    }

    override fun getPreferredWidth(sz: Int): Int {
        // If the component has not gotten size yet and there is a size hint, trick Swing to return a better height.
        if (c.width == 0 && c.height == 0 && sz != -1) {
            c.setBounds(c.x, c.y, 1, sz)
        }
        return c.preferredSize.width
    }

    override fun getMaximumHeight(sz: Int): Int = if (c.isMaximumSizeSet) c.maximumSize.height else Integer.MAX_VALUE

    override fun getMaximumWidth(sz: Int): Int = if (c.isMaximumSizeSet) c.maximumSize.width else Integer.MAX_VALUE

    override fun getParent(): ContainerWrapper? {
        val p = c.parent as? JComponent ?: return null
        return ConceptSwingContainerWrapper(p)
    }

    override fun getHorizontalScreenDPI(): Int {
        try {
            return c.toolkit.screenResolution
        } catch (e: HeadlessException) {
            return PlatformDefaults.getDefaultDPI()
        }
    }

    override fun getVerticalScreenDPI(): Int {
        try {
            return c.toolkit.screenResolution
        } catch (e: HeadlessException) {
            return PlatformDefaults.getDefaultDPI()
        }
    }

    override fun getScreenWidth(): Int {
        try {
            return c.toolkit.screenSize.width
        } catch (ignore: HeadlessException) {
            return 1024
        }
    }

    override fun getScreenHeight(): Int {
        try {
            return c.toolkit.screenSize.height
        } catch (ignore: HeadlessException) {
            return 768
        }
    }

    override fun hasBaseline(): Boolean {
        if (hasBaseLine == ThreeState.UNSURE) {
            try {
                // do not use component dimensions since it made some components layout themselves to the minimum size
                // and that stuck after that. E.g. JLabel with HTML content and white spaces would be very tall.
                // Use large number but don't risk overflow or exposing size bugs with Integer.MAX_VALUE
                hasBaseLine = ThreeState.fromBoolean(getBaseline(8192, 8192) > -1)
            } catch (ignore: Throwable) {
                hasBaseLine = ThreeState.NO
            }
        }
        return hasBaseLine.toBoolean()
    }

    override fun getLinkId(): String? = c.name

    override fun setBounds(x: Int, y: Int, width: Int, height: Int) {
        c.setBounds(x, y, width, height)
    }

    override fun isVisible(): Boolean = c.isVisible

    override fun getVisualPadding(): IntArray? {
        visualPaddings?.let {
            return it
        }

        val component = when (c) {
            is ComponentWithBrowseButton<*> -> c.childComponent
            else -> c
        }

        val border = component.border ?: return null
        if (border is LineBorder || border is TitledBorder) {
            return null
        }

        /*val paddings = whe


bottom: 1em;
    margin-top: 1em;
}

.code-caption
{
    font-style: italic;
    font-size: 107%;
    margin: 0;
}

.source
{
    border: 1px solid #ddd;
    width: 80%;
    overflow: auto;
}

.prettyprint.source {
    width: inherit;
}

.source code
{
    font-size: 100%;
    line-height: 18px;
    display: block;
    padding: 4px 12px;
    margin: 0;
    background-color: #fff;
    color: #4D4E53;
}

.prettyprint code span.line
{
  display: inline-block;
}

.prettyprint.linenums
{
  padding-left: 70px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.prettyprint.linenums ol
{
  padding-left: 0;
}

.prettyprint.linenums li
{
  border-left: 3px #ddd solid;
}

.prettyprint.linenums li.selected,
.prettyprint.linenums li.selected *
{
  background-color: lightyellow;
}

.prettyprint.linenums li *
{
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.params .name, .props .name, .name code {
    color: #4D4E53;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 100%;
}

.params td.description > p:first-child,
.props td.description > p:first-child
{
    margin-top: 0;
    padding-top: 0;
}

.params td.description > p:last-child,
.props td.description > p:last-child
{
    margin-bottom: 0;
    padding-bottom: 0;
}

.disabled {
    color: #454545;
}
div.two-column {
    display: flex;
    margin-top: 10px;
    padding-top: 10px;

    justify-content: space-between;
}
div.two-column > section {
    flex-basis: 0;
    flex-grow: 1;
    padding-left: 30px;
}
div.two-column > section:first-child {
    padding-left: 0;
    padding-right: 30px;
}
div.two-column > section > *:first-child {
    margin-top: 0;
}
div.two-column > section.narrow-column {
    flex-grow: 0.7;
}
@media (max-width: 800px) {
    div.two-column {
        flex-direction: column;
    }
    div.two-column > section {
        padding-left: 0;
    }
}
@media (max-width: 1024px) {
    div.two-column > section:first-child {
        padding-right: 0;
    }
}

input, .ProseMirror, .last-reaction-text {
    font-family: StoryFont;
}

ul.participant-list {
    display: inline-block;

    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;

    font-size: 85%;
}
ul.participant-list li {
    display: inline;
    padding-left: 1em;
}

ul.search-results {
    columns: 3;
}

/* Mentions */
.mention-square {
    display: inline-block;
    widt


```objc
// Objective-C

XCTAssertEqual(1 + 1, 2, @"expected one plus one to equal two");
```

XCTest assertions have a couple of drawbacks:

1. **Not enough macros.** There's no easy way to assert that a string
   contains a particular substring, or that a number is less than or
   equal to another.
2. **It's hard to write asynchronous tests.** XCTest forces you to write
   a lot of boilerplate code.

Nimble addresses these concerns.

# Nimble: Expectations Using `expect(...).to`

Nimble allows you to express expectations using a natural,
easily understood language:

```swift
// Swift

import Nimble

expect(seagull.squawk).to(equal("Squee!"))
```

```objc
// Objective-C

@import Nimble;

expect(seagull.squawk).to(equal(@"Squee!"));
```

> The `expect` function autocompletes to include `file:` and `line:`,
  but these parameters are optional. Use the default values to have
  Xcode highlight the correct line when an expectation is not met.

To perform the opposite expectation--to assert something is *not*
equal--use `toNot` or `notTo`:

```swift
// Swift

import Nimble

expect(seagull.squawk).toNot(equal("Oh, hello there!"))
expect(seagull.squawk).notTo(equal("Oh, hello there!"))
```

```objc
// Objective-C

@import Nimble;

expect(seagull.squawk).toNot(equal(@"Oh, hello there!"));
expect(seagull.squawk).notTo(equal(@"Oh, hello there!"));
```

## Custom Failure Messages

Would you like to add more information to the test's failure messages? Use the `description` optional argument to add your own text:

```swift
// Swift

expect(1 + 1).to(equal(3))
// failed - expected to equal <3>, got <2>

expect(1 + 1).to(equal(3), description: "Make sure libKindergartenMath is loaded")
// failed - Make sure libKindergartenMath is loaded
// expected to equal <3>, got <2>
```

Or the *WithDescription version in Objective-C:

```objc
// Objective-C

@import Nimble;

expect(@(1+1)).to(equal(@3));
// failed - expected to equal <3.0000>, got <2.0000>

expect(@(1+1)).toWithDescription(equal(@3), @"Make sure libKindergartenMath is loaded");
// failed - Make sure libKindergartenMath is loaded
// expected to equal <3.0000>, got <2.0000>
```

## Type Checking

Nimble makes sure you don't compare two types that don't match:

```swift
// Swift

// Does not compile:
expect(1 + 1).to(equal("Squee!"))
```

> Nimble uses generics--only available in Swift--to ensure
  type correctness. That means type checking is
  not available when using Nimble in Objective-C. :sob:

## Operator Overloads

Tired of so much typing? With Nimble, you can use overloaded operators
like `==` for equivalence, or `>` for comparisons:

```swift
// Swift

// Passes if squawk does not equal "Hi!":
expect(seagull.squawk) != "Hi!"

// Passes if 10 is greater than 2:
expect(10) > 2
```

> Operator overloads are only available in Swift, so you won't be able
  to use this syntax in Objective-C. :broken_heart:

## Lazily Computed Values

The `expect` function doesn't evaluate the value it's given until it's
time to match. So Nimble can test whether an expression raises an
exception once evaluated:

```swift
// Swift

// Note: Swift currently doesn't have exceptions.
//       Only Objective-C code can raise exceptions
//       that Nimble will catch.
//       (see https://github.com/Quick/Nimble/issues/220#issuecomment-172667064)
let exception = NSException(
  name: NSInternalInconsistencyException,
  reason: "Not enough fish in the sea.",
  userInfo: ["something": "is fishy"])


>\n        '),n+='\n
'+(null==(t=e.t("File Name"))?"":t)+'
\n
'+(null==(t=e.t("Size"))?"":t)+"
\n        ",e.self.hasTypes&&(n+='\n
'+(null==(t=e.t("Type"))?"":t)+"
\n        "),n+="\n
\n
\n    ",e.files.forEach((function(r){n+='\n
\n
\n          ',e.disabled||(n+='\n

\n          '),n+='\n
\n            ',e.component.uploadOnly?n+="\n              "+(null==(t=r.originalName||r.name)?"":t)+"\n            ":n+='\n              \n                '+(null==(t=e.t("Press to open "))?"":t)+""+(null==(t=r.originalName||r.name)?"":t)+"\n              \n            ",n+='\n
\n
'+(null==(t=e.fileSize(r.size))?"":t)+"
\n          ",e.self.hasTypes&&!e.disabled&&(n+='\n
\n              <select class="file-type" ref="fileType">\n                ',e.component.fileTypes.map((function(o){n+='\n                  <option class="test" value="'+(null==(t=o.value)?"":t)+'" ',o.label===r.fileType&&(n+='selected="selected"'),n+=">"+(null==(t=e.t(o.label))?"":t)+"</option>\n                "})),n+="\n              </select>\n
\n          "),n+="\n          ",e.self.hasTypes&&e.disabled&&(n+='\n
'+(null==(t=r.fileType)?"":t)+"
\n          "),n+="\n
\n
\n    "})),n+="\n
\n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n  ",e.self.useWebViewCamera?n+='\n
\n      <button class="btn btn-primary" ref="galleryButton"> '+(null==(t=e.t("Gallery"))?"":t)+'</button>\n      <button class="btn btn-primary" ref="cameraButton"> '+(null==(t=e.t("Camera"))?"":t)+"</button>\n
\n  ":e.self.cameraMode?n+='\n
\n      <video class="video" autoplay="true" ref="videoPlayer" tabindex="-1"></video>\n
\n    <button class="btn btn-primary" ref="takePictureButton"> '+(null==(t=e.t("Take Picture"))?"":t)+'</button>\n    <button class="btn btn-primary"


0,n=0;for(;a!==e.length;++a)if((n=e.charCodeAt(a))===32||n===10||n===13)break;if(!r)t[0]=e.slice(0,a);if(a===e.length)return t;var i=e.match(Ce),s=0,f="",l=0,o="",c="",u=1;if(i)for(l=0;l!=i.length;++l){c=i[l];for(n=0;n!=c.length;++n)if(c.charCodeAt(n)===61)break;o=c.slice(0,n).trim();while(c.charCodeAt(n+1)==32)++n;u=(a=c.charCodeAt(n+1))==34||a==39?1:0;f=c.slice(n+1+u,c.length-u);for(s=0;s!=o.length;++s)if(o.charCodeAt(s)===58)break;if(s===o.length){if(o.indexOf("_")>0)o=o.slice(0,o.indexOf("_"));t[o]=f;t[o.toLowerCase()]=f}else{var h=(s===5&&o.slice(0,5)==="xmlns"?"xmlns":"")+o.slice(s+1);if(t[h]&&o.slice(s-3,s)=="ext")continue;t[h]=f;t[h.toLowerCase()]=f}}return t}function Ae(e){return e.replace(ye,"<$1")}var Ie={""":'"',"'":"'",">":">","<":"<","&":"&"};var Re=Y(Ie);var De=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/g,r=/_x([\da-fA-F]{4})_/g;return function t(a){var n=a+"",i=n.indexOf("<![CDATA[");if(i==-1)return n.replace(e,function(e,r){return Ie[e]||String.fromCharCode(parseInt(r,e.indexOf("x")>-1?16:10))||e}).replace(r,function(e,r){return String.fromCharCode(parseInt(r,16))});var s=n.indexOf("]]>");return t(n.slice(0,i))+n.slice(i+9,s)+t(n.slice(s+3))}}();var Fe=/[&<>'"]/g,Oe=/[\u0000-\u0008\u000b-\u001f]/g;function Pe(e){var r=e+"";return r.replace(Fe,function(e){return Re[e]}).replace(Oe,function(e){return"_x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+"_"})}function Ne(e){return Pe(e).replace(/ /g,"_x0020_")}var Le=/[\u0000-\u001f]/g;function Me(e){var r=e+"";return r.replace(Fe,function(e){return Re[e]}).replace(/\n/g,"<br/>").replace(Le,function(e){return"&#x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"})}function Ue(e){var r=e+"";return r.replace(Fe,function(e){return Re[e]}).replace(Le,function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"})}var He=function(){var e=/&#(\d+);/g;function r(e,r){return String.fromCharCode(parseInt(r,10))}return function t(a){return a.replace(e,r)}}();var We=function(){return function e(r){return r.replace(/(\r


	}

	if len(result) > 0 {
		conn.SetWriteDeadline(time.Now().Add(motan.DefaultWriteTimeout))
		_, err = conn.Write(result)
		if err != nil {
			vlog.Errorf("connection will close. conn: %s, err:%s", conn.RemoteAddr().String(), err.Error())
			conn.Close()
		}
	} else {
		vlog.Errorf("process v1 message fail: no result to send. conn: %s, req:%s, res:%s, result:%v, err: %v", conn.RemoteAddr().String(), motan.GetReqInfo(req), motan.GetResInfo(res), result, err)
	}
	if reqCtx != nil {
		reqCtx.ResponseSendTime = time.Now()
	}
	if res != nil {
		resCtx := res.GetRPCContext(true)
		resCtx.OnFinish()
	}
}

// SetHeartbeat true: enable heartbeat, false: disable heartbeat
func (m *MotanServer) SetHeartbeat(enabled bool) {
	m.heartbeatEnabled = enabled
}

func getRemoteIP(address string) string {
	var ip string
	index := strings.Index(address, ":")
	if index > 0 {
		ip = address[:index]
	} else {
		ip = address
	}
	return ip
}

func setV1Attachments(req motan.Request) {
	// fill v2 attachment
	if req.GetAttachment(mpro.MGroup) == "" {
		req.SetAttachment(mpro.MGroup, req.GetAttachment(mpro.V1Group))
	}
	if req.GetAttachment(mpro.MVersion) == "" {
		req.SetAttachment(mpro.MVersion, req.GetAttachment(mpro.V1Version))
	}
	if req.GetAttachment(mpro.MSource) == "" {
		req.SetAttachment(mpro.MSource, req.GetAttachment(mpro.V1Application))
	}
}
package filter

import (
	"fmt"
	mpro "github.com/weibocom/motan-go/protocol"
	"strconv"
	"strings"
	"time"

	"github.com/juju/ratelimit"
	"github.com/weibocom/motan-go/core"
	"github.com/weibocom/motan-go/log"
)

const (
	capacityKey        = "capacity"
	methodConfigPrefix = "rateLimit."
	defaultTimeout     = 1000
	maxCapacity        = 5000
	minCapacity        = 1000
)

type RateLimitFilter struct {
	switcher           *core.Switcher
	serviceBucket      *ratelimit.Bucket //limit service
	serviceMaxDuration time.Duration
	methodBuckets      map[string]*ratelimit.Bucket //limit method
	next               core.EndPointFilter
	url                *core.URL
}

func (r *RateLimitFilter) GetRuntimeInfo() map[string]interface{} {
	return GetFilterRuntimeInfo(r)
}

func (r *RateLimitFilter) NewFilter(url *core.URL) core.Filter {
	ret := &RateLimitFilter{}
	//init bucket
	rlp := url.GetParam(RateLimit, "")
	if rlp == "" {
		vlog.Warningf("[rateLimit] limit rate config is empty, service %s initialize failed", RateLimit)
	} else {
		if rate, err := strconv.ParseFloat(rlp, 64); err == nil {
			if rate <= 0 {
				vlog.Warningf("[rateLimit] %s: service rateLimit config invalid, rate: %f", url.GetIdentity(), rate)
			} else {
				capacity := getCapacity(url, rate)
				ret.serviceBucket = ratelimit.NewBucketWithRate(rate, capacity)
				ret.serviceMaxDuration = url.GetTimeDuration(core.TimeOutKey, time.Millisecond,


using System.ComponentModel.DataAnnotations;
using Endatix.Infrastructure.Identity.Authentication;

/// <summary>
/// Configuration options for Endatix JWT authentication provider
/// </summary>
public class EndatixJwtOptions : JwtAuthProviderOptions
{
    private const string DEFAULT_ISSUER = "endatix-api";

    /// <summary>
    /// The key used to sign the JWT token
    /// </summary>
    [Required]
    public string SigningKey { get; set; } = string.Empty;

    /// <summary>
    /// The expiration time of the JWT access token in minutes


x6y6, cx6y6, alpha;
--:-:-:-:0      FMUL shuffle_x7y6, cx7y6, alpha;
--:-:-:-:1      STS.128 [writeCs+4x<2*64 + 00>], shuffle_x0y6;
--:-:-:-:1      FMUL shuffle_x0y7, cx0y7, alpha;
--:-:-:-:1      FMUL shuffle_x1y7, cx1y7, alpha;
--:-:-:-:1      FMUL shuffle_x2y7, cx2y7, alpha;
--:-:-:-:0      FMUL shuffle_x3y7, cx3y7, alpha;
--:-:-:-:1      STS.128 [writeCs+4x<2*64 + 32>], shuffle_x4y6;
--:-:-:-:1      FMUL shuffle_x4y7, cx4y7, alpha;
--:-:-:-:1      FMUL shuffle_x5y7, cx5y7, alpha;
--:-:-:-:1      FMUL shuffle_x6y7, cx6y7, alpha;
--:-:-:-:0      FMUL shuffle_x7y7, cx7y7, alpha;
--:-:-:-:4      STS.128 [writeCs+4x<3*64 + 00>], shuffle_x0y7;
--:-:-:-:1      STS.128 [writeCs+4x<3*64 + 32>], shuffle_x4y7;
--:-:-:-:5      BAR.SYNC 0;

--:-:-:-:5      CAL STORE_C;
--:-:-:-:5      CAL STORE_C;

--:-:-:-:5      EXIT;

STORE_C:

[+
    our $vec;
    return $vec ? q{
--:-:1:-:1  @P0 LDG.E.64 loadC, [C];
    } : q{
--:-:-:-:0 @!P0 MOV loadC0, RZ;
--:-:-:-:1  @P0 LDG.E.CI.U16 loadC0, [C + 2x<0>];
--:-:-:-:0 @!P1 MOV loadC1, RZ;
--:-:-:-:1  @P1 LDG.E.CI.U16 loadC1, [C + 2x<1>];
--:-:-:-:0 @!P2 MOV loadC2, RZ;
--:-:-:-:1  @P2 LDG.E.CI.U16 loadC2, [C + 2x<2>];
--:-:-:-:0 @!P3 MOV loadC3, RZ;
--:-:1:-:1  @P3 LDG.E.CI.U16 loadC3, [C + 2x<3>];
    };
+]

// Restore output preds
--:-:-:-:1  @P4 R2P PR, preds, 0x0f;
--:-:-:-:1 @!P4 R2P PR, RZ,    0x0f;

--:-:-:-:1      LDS.U.128 part0C, [readCs + 4x< 0*64>];
--:-:2:-:1      LDS.U.128 part1C, [readCs + 4x<16*64>];
--:-:-:-:1      LDS.U.128 part2C, [readCs + 4x<32*64>];
--:-:3:-:1      LDS.U.128 part3C, [readCs + 4x<48*64>];

<SCHEDULE_BLOCK>
02:-:-:-:1  @P0 FADD part0C0, part0C0, part1C0;
--:-:-:-:1  @P1 FADD part0C1, part0C1, part1C1


目标数据 的 Result
     */
    @NonNull
    public <U, V> Result<V> ifSucceededMerge(@NonNull final U mergeValue,
                                             @NonNull
                                             final Merger<? super T, ? super U, V> merger) {
        if (value != null) {
            return success(merger.merge(value, mergeValue));
        }
        return sameFailure();
    }

    /**
     * Returns the result of a follow-up attempt to merge the output value encapsulated in this
     * result with the given {@code mergeValue} using the {@code attemptMerger}, or if this is the
     * result of a {@link #failed} attempt, returns the {@link #sameFailure}.
     *
     * 如果 成功 了
     * 可以用 Merger 进行数据合并 后（ 这里规定 合并目标类型必须为 Result<U> ）
     * 构造一个 合并目标数据（ （ 这里规定 合并目标类型必须为 Result<U> ） ） 的 Result<Result<U>>
     */
    @NonNull
    public <U, V> Result<V> ifSucceededAttemptMerge(@NonNull final U mergeValue,
                                                    @NonNull
                                                    final Merger<? super T, ? super U, Result<V>> attemptMerger) {
        if (value != null) {
            return attemptMerger.merge(value, mergeValue);
        }
        return sameFailure();
    }

    /**
     * Returns a {@link Result} wrapping the result of merging the output value encapsulated in
     * this
     * result with the value from the given {@code mergeValueSupplier} using the {@code merger}, or
     * if
     * this is the result of a {@link #failed} attempt, returns the {@link #sameFailure}.
     *
     * 如果 成功 了
     * 可以用 Merger 进行 结果值 与 Supplier 提供数据 的合并
     * 构造一个 合并目标数据 的 Result
     */
    @NonNull
    public <U, V> Result<V> ifSucceededMergeFrom(@NonNull final Supplier<U> mergeValueSupplier,
                                                 @NonNull
                                                 final Merger<? super T, ? super U, V> merger) {
        if (value != null) {
            return success(merger.merge(value, mergeValueSupplier.get()));
        }
        return sameFailure();
    }

    /**
     * Returns the result of a follow-up attempt to merge the output value encapsulated in this
     * result with the value from the given {@code mergeValueSupplier} using the
     * {@code attemptMerger}, or if this is the result of a {@link #failed} attempt, returns the
     * {@link #sameFailure}.
     *
     * <p>This method is agnostic of the value type of the {@code mergeValueSupplier}. If it is
     * also
     * fallible, the {@code attemptMerger} has the responsibility to interpret the result should
     * the
     * supplier fail. The merger may choose to, for example, return the {@code sameFailure()} if
     * this
     * happens.
     *
     * 如果 成功 了
     * 可以用 Merger 进行 结果值 与 Supplier 提供数据 的合并 后（ 这里规定 合并目标类型必须为 Result<V> ）
     * 构造一个 合并目标数据（ （ 这里规定 合并目标类型必须为 Result<V> ） ） 的 Result<Result<V>>
     */
    @NonNull
    public <U, V> Result<V> ifSucceededAttemptMergeFrom(
        @NonNull final Supplier<U> mergeValueSupplier,
        @NonNull final Merger<? super T, ? super U, Result<V>> attemptMerger) {
        if (value != null) {
            return a


Response> {
    return await this.request(
      "get",
      `/upload/${uploadID}/upgrade/${currentBuildID}`,
      sprinkleDownloadKey(downloadKey, { v: 2 }),
    );
  }

  /**
   * Download a given build
   */
  async downloadBuild(
    downloadKey: IDownloadKey,
    uploadID: number,
    buildID: number,
  ): Promise<IDownloadBuildResult> {
    return await this.request(
      "get",
      `/upload/${uploadID}/download/builds/${buildID}`,
      sprinkleDownloadKey(downloadKey, { v: 2 }),
    );
  }

  /**
   * Returns the itchfs URL of a given build
   */
  downloadBuildURL(
    downloadKey: IDownloadKey,
    uploadID: number,
    buildID: number,
    fileType: BuildFileType,
    extras: IDownloadBuildFileExtras = {},
  ): string {
    const path = `/upload/${uploadID}/download/builds/${buildID}/${fileType}`;

    return this.itchfsURL(path, sprinkleDownloadKey(downloadKey, extras));
  }

  async subkey(gameID: number, scope: string) {
    return await this.request("post", "/credentials/subkey", {
      game_id: gameID,
      scope,
    });
  }
}

/**
 * if not an array, return the empty array, otherwise identity
 * cf. https://github.com/itchio/itchio-app/issues/48
 * this works around the fact that, in lua, empty object and empty array both
 * serialize to empty object
 */
export function ensureArray(v: any): any[] {
  if (!v || !v.length) {
    return [];
  }
  return v;
}

/**
 * if downloadKey isn't null, add its id to the parameters
 */
function sprinkleDownloadKey(
  downloadKey: IDownloadKey | null,
  params: any,
): any {
  if (!downloadKey) {
    return params;
  }

  return {
    ...params,
    download_key_id: downloadKey.id,
  };
}

/**
 * An set of errors returned by the itch.io API. Those aren't
 * localized, so string matching is an option.
 */
export class ApiError extends Error {
  errors: string[];

  constructor(errors: string[]) {
    super(errors.join(", "));
    this.errors = errors;
  }

  toString() {
    return `API Error: ${this.errors.join(", ")}`;
  }
}
import {Distances} from "./distances";

interface CellNeighbors {
    north?: Cell | null;
    south?: Cell | null;
    east?: Cell | null;
    west?: Cell | null;
}

class Cell implements CellNeighbors {
    public north: Cell | null;
    public south: Cell | null;
    public east: Cell | null;
    public west: Cell | null;

    public row: number;
    public column: number;

    private linkedCells: Map<Cell, boolean>;

    public constructor({row, column}: { row: number; column: number }) {
        this.row = row;
        this.column = column;

        this.linkedCells = new Map();

        this.north = null;
        this.south = null;
        this.east = null;
        this.west = null;
    }

    public link(cell: Cell, biDirectional = true): void {
        this.linkedCells.set(cell, true);
        if (biDirectional) {
            cell.link(this, false);
        }
    }

    public unlink(cell: Cell, biDirectional = true): void {
        this.linkedCells.delete(cell);
        if (biDirectional) {
            cell.unlink(this, false);
        }
    }

    public links(): Array<Cell> {
        return [...this.linkedCells.keys()];
    }

    public isLinkedToCell(cell: Cell): boolean {
        return this.linkedCells.has(cell);
    }

    public neighbors(): CellNeighbors {
        let neighbors = {};
        if (this.north) {
            neighbors = {north: this.north};
        }
        if (this.south) {
            neighbors = {...neighbors,


;
import cool.scx.live_room_watcher.impl.tiktok_hack.TikTokHackLiveRoomWatcher;

import static cool.scx.live_room_watcher.test.DouYinHackLiveRoomWatcherTest.nowTimeStr;

public class TikTokHackLiveRoomWatcherTest {

    public static void main(String[] args) {
        tes1();
    }

    //    @Test
    public static void tes1() {
        var liveRoomWatcher = new TikTokHackLiveRoomWatcher("https://www.tiktok.com/@74azp/live",Proxy.of("127.0.0.1",17890));

        liveRoomWatcher.onChat(chat -> {
            Ansi.ansi().brightGreen(nowTimeStr() + "[消息] ").defaultColor(chat.user().nickname() + " : ").brightWhite(chat.content()).println();
        }).onUser(user -> {
            Ansi.ansi().brightMagenta(nowTimeStr() + "[来了] ").defaultColor(user.nickname()).println();
        }).onLike(like -> {
            Ansi.ansi().brightYellow(nowTimeStr() + "[点赞] ").defaultColor(like.user().nickname() + " x " + like.count()).println();
        }).onFollow(follow -> {
            Ansi.ansi().brightCyan(nowTimeStr() + "[关注] ").defaultColor(follow.user().nickname()).println();
        }).onGift(gift -> {
            Ansi.ansi().brightBlue(nowTimeStr() + "[礼物] ").defaultColor(gift.user().nickname() + " : ").brightWhite(gift.name() + " x " + gift.count()).println();
        });

        liveRoomWatcher.startWatch();

    }

}
package cool.scx.live_room_watcher.impl.douyin;

import com.fasterxml.jackson.core.JsonProcessingException;
import cool.scx.common.util.ObjectUtils;
import cool.scx.http.media_type.ScxMediaType;
import cool.scx.http.method.HttpMethod;
import cool.scx.http.uri.ScxURI;
import cool.scx.live_room_watcher.AbstractLiveRoomWatcher;
import cool.scx.live_room_watcher.impl.douyin.message.DouYinChat;
import cool.scx.live_room_watcher.impl.douyin.message.DouYinGift;
import cool.scx.live_room_watcher.impl.douyin.message.DouYinLike;
import cool.scx.object.ScxObject;
import cool.scx.object.node.ObjectNode;
import cool.scx.reflect.TypeReference;

import java.io.IOException;
import java.util.Map;

import static cool.scx.http.method.HttpMethod.GET;
import static cool.scx.http.method.HttpMethod.POST;
import static cool.scx.http.media_type.MediaType.APPLICATION_JSON;
import static cool.scx.http.x.ScxHttpClientHelper.request;
import static cool.scx.live_room_watcher.impl.douyin.DouYinApi.*;
import static cool.scx.live_room_watcher.impl.douyin.DouYinHelper.checkDouYinData;
import static cool.scx.live_room_watcher.impl.douyin.DouYinMsgType.*;
import static cool.scx.object.ScxObject.toJson;
import static java.nio.charset.StandardCharsets.UTF_8;

/**
 * 官方的获取方式 需要在抖音进行回调时手动调用 call xxx }
 *
 * @author scx567888
 * @version 0.0.1
 */
public class DouYinLiveRoomWatcher extends AbstractLiveRoomWatcher {

    public final Map<String, String> giftNameMap;
    private final String appID;
    private final String appSecret;
    private final String commentDataSecret;
    private final String giftDataSecret;
    private final String likeDataSecret;
    private final DouYinAccessTokenManager accessTokenManager;

    public DouYinLiveRoomWatcher(String appID, String appSecret, String commentDataSecret, String giftDataSecret, String likeDataSecret, Map<String, String> giftNameMap) {
        t


    fun initAmPm(isEng: Boolean): Pair<String, String> {
        return if (isEng) "AM" to "PM" else "ق.ظ" to "ب.ظ"
    }

    private val leapYears = listOf(
        1403,
        1407,
        1411,
        1415,
        1419,
        1423,
        1427,
        1431,
        1435,
        1439
    )

    /**
     * Returns true if the given jalali year is a leap year.
     * */
    fun Int.isLeap(): Boolean = this in leapYears

    /**
     * Returns a list of integers representing the days in a month
     * */

    fun initMonthDays(monthNumber: Int, year: Int): List<Int> {
        val days29 = (1..29).map { it }
        val days30 = (1..30).map { it }
        val days31 = (1..31).map { it }

        return when (monthNumber) {
            in 1..6 -> days31
            in 7..11 -> days30
            12 -> if (year.isLeap()) days30 else days29
            else -> emptyList()
        }

    }

    fun gregorianToJalali(gy: Int, gm: Int, gd: Int): IntArray {
        val g_d_m: IntArray = intArrayOf(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334)
        val gy2: Int = if (gm > 2) (gy + 1) else gy
        var days: Int =
            355666 + (365 * gy) + ((gy2 + 3) / 4) - ((gy2 + 99) / 100) + ((gy2 + 399) / 400) + gd + g_d_m[gm - 1]
        var jy: Int = -1595 + (33 * (days / 12053))
        days %= 12053
        jy += 4 * (days / 1461)
        days %= 1461
        if (days > 365) {
            jy += ((days - 1) / 365)
            days = (days - 1) % 365
        }
        var jm: Int;
        var jd: Int;
        if (days < 186) {
            jm = 1 + (days / 31)
            jd = 1 + (days % 31)
        } else {
            jm = 7 + ((days - 186) / 30)
            jd = 1 + ((days - 186) % 30)
        }
        return intArrayOf(jy, jm, jd)
    }

    /**
     * Returns the Gregorian date corresponding to the given Jalali date.
     * */

    fun jalaliToGregorian(jy: Int, jm: Int, jd: Int): IntArray {
        val jy1: Int = jy + 1595
        var days: Int =
            -355668 + (365 * jy1) + ((jy1 / 33) * 8) + (((jy1 % 33) + 3) / 4) + jd + (if (jm < 7) ((jm - 1) * 31) else (((jm - 7) * 30) + 186))
        var gy: Int = 400 * (days / 146097)
        days %= 146097
        if (days > 36524) {
            gy += 100 * (--days / 36524)
            days %= 36524
            if (days >= 365) days++
        }
        gy += 4 * (days / 1461)
        days %= 1461
        if (days > 365) {
            gy += ((days - 1) / 365)
            days = (days - 1) % 365
        }
        var gd: Int = days + 1
        val sal_a: IntArray = intArrayOf(
            0,
            31,
            if ((gy % 4 == 0 && gy % 100 != 0) || (gy % 400 == 0)) 29 else 28,
            31,
            30,
            31,
            30,
            31,
            31,
            30,
            31,
            30,
            31
        )
        var gm = 0
        while (gm < 13 && gd > sal_a[gm]) gd -= sal_a[gm++]
        return intArrayOf(gy, gm, gd)
    }

}package com.hshamkhani.article_details.composables

import android.content.Context
import android


45deg) translate(0.5em, 0.4em);
    -o-transform: rotate(45deg) translate(0.5em, 0.4em);
    transform: rotate(45deg) translate(0.5em, 0.4em); }
    .click_to_close_sidebar_tmp .bar:after {
      -webkit-transform: rotate(-45deg) translate(0.4em, -0.3em);
      -moz-transform: rotate(-45deg) translate(0.4em, -0.3em);
      -ms-transform: rotate(-45deg) translate(0.4em, -0.3em);
      -o-transform: rotate(-45deg) translate(0.4em, -0.3em);
      transform: rotate(-45deg) translate(0.4em, -0.3em); }
body {
  padding: 0;
  margin: 0;
  font-family: 'PT Sans', "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, Hiragino Sans GB, Microsoft YaHei, sans-serif;
  font-size: 16px;
  line-height: 2.1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* {
  outline: none;
}
.keyword1, .keyword2 {
  color: indianred;
}

/* link */
a, a:link, a:visited {
  color: #137ed1;
  text-decoration: none;
}
a:hover {
  color: #0b4674;
  text-decoration: none;
}
.header {
  background-size: cover;
  background-position: center;
  height: 130px; /*300px*/
  position: relative;
}
.header .particles-js-canvas-el {
  position: absolute;
  top: 0;
  left: 0;
}
.header #search_bar {
  z-index: 99;
  height: 60px;
  top: 35px; /*100px*/
  text-align: center;
  width: 80%;
  margin: 0 auto;
  position: relative;
}
.header #search_bar input {
  height: 60px;
  font-size: 18px;
  width: 100%;
  padding: 0 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
}
.header #search_bar input:focus {
  background: rgba(255, 255, 255, 0.95);
}
.header #search_bar .search_in_html_button {
  position: absolute;
  right: -20px;
  top: 0;
  background: #137ed1;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  margin-left: -3px;
  text-align: center;
  display: inline-block;
  width: 80px;
  height: 60px;
  line-height: 60px;
  font-size: 24px;
  color: white;
}
.homepage_categories {
  max-width: 1280px;
  margin: 5em auto 3em auto;
}
.homepage_categories .category {
  display: block;
  margin: 25px 15px;
  font-weight: normal;
}
.homepage_categories .category .category_body {
  border-radius: 5px;
  border: 1px solid transparent;
  height: 200px;
  text-align: center;
  padding-top: 10px;
  margin-top: 20px;
  cursor: pointer;
}
.homepage_categories .category .category_body i.icon {
  font-size: 3.2em;
  color: #137ed1;
  display: block;
  margin: 20px 0 15px 0;
}
.homepage_categories .category .category_body h2 {
  color: #333;
  line


Bitmap);
    _front.addChild(iconBitmap);
    _front.addTo(this);

    _back.addChild(backBitmap);
    _back.addTo(this);

    perspectiveProjection = PerspectiveProjection.none();
    mouseChildren = false;
  }

  //---------------------------------------------------------------------------

  @override
  void render(RenderState renderState) {
    var isForwardFacing = this.isForwardFacing;
    _front.visible = isForwardFacing;
    _back.visible = !isForwardFacing;

    super.render(renderState);
  }
}
part of escape;

class MessageBox extends Sprite {
  ResourceManager _resourceManager;
  Juggler _juggler;

  DelayedCall _showTimeout;
  Function _doneFunction;

  MessageBox(ResourceManager resourceManager, Juggler juggler, String text) {
    _resourceManager = resourceManager;
    _juggler = juggler;

    var background = Bitmap(_resourceManager.getBitmapData('MessageBox'));
    addChild(background);

    var textFormat =
        TextFormat('Arial', 24, 0xFFFFFF, bold: true, align: TextFormatAlign.CENTER);

    var textField = TextField();
    textField.defaultTextFormat = textFormat;
    textField.width = 240;
    textField.height = 200;
    textField.wordWrap = true;
    //textField.selectable = false;
    textField.text = text;
    textField.x = 47;
    textField.y = 130 - textField.textHeight / 2;
    //textField.filters = [GlowFilter(0x000000, 0.7, 3, 3)];   // ToDo
    textField.mouseEnabled = false;
    addChild(textField);

    _showTimeout = null;

    addEventListener(MouseEvent.CLICK, _onClick);

    filters.add(DropShadowFilter(16, math.pi / 4, 0x80000000, 8, 8, 2));
  }

  //----------------------------------------------------------------------
  //----------------------------------------------------------------------

  void show(Function doneFunction) {
    parent.addChild(this); // move to top
    x = -width;
    y = 150;

    _doneFunction = doneFunction;

    var tween = Tween(this, 0.3, Transition.easeOutCubic);
    tween.animate.x.to(110);
    tween.onComplete = () => _showTimeout = _juggler.delayCall(_hide, 10);

    _juggler.add(tween);
  }

  //----------------------------------------------------------------------

  void _hide() {
    if (_showTimeout != null) {
      _juggler.remove(_showTimeout);
      _showTimeout = null;

      _doneFunction();

      var tween = Tween(this, 0.4, Transition.easeInCubic);
      tween.animate.x.to(800);
      tween.onComplete = () => parent.removeChild(this);

      _juggler.add(tween);
    }
  }

  //----------------------------------------------------------------------

  void _onClick(MouseEvent me) {
    _hide();
  }
}
library piano;

import 'dart:html' as html;
import 'package:stagexl/stagexl.dart';

part 'source/karaoke.dart';
part 'source/piano.dart';
part 'source/piano_event.dart';
part 'source/piano_key.dart';
part 'source/songs.dart';

Stage stage;
RenderLoop renderLoop;
ResourceManager resourceManager;

void main() {
  //------------------------------------------------------------------
  // Initialize the Display List
  //------------------------------------------------------------------

  stage = Stage(html.querySelector('#stage'));
  renderLoop = RenderLoop();
  renderLoop.addStage(stage);

  //------------------------------------------------------------------
  // Load images and sounds
  //------------------------


,244,0.7),rgba(63,81,181,0.5));background-image:-moz-linear-gradient(164deg,rgba(3,169,244,0.7),rgba(63,81,181,0.5));background-image:-o-linear-gradient(164deg,rgba(3,169,244,0.7),rgba(63,81,181,0.5));background-image:-ms-linear-gradient(164deg,rgba(3,169,244,0.7),rgba(63,81,181,0.5));background-image:linear-gradient(164deg,rgba(3,169,244,0.7),rgba(63,81,181,0.5));-pie-background:linear-gradient(to 164deg,rgba(3,169,244,0.7),rgba(63,81,181,0.5));color:#fff;display:inline-block;}.appbox{overflow:hidden;padding:0px 10px 0 0;}.appbox .appline{width:100%;margin-bottom:10px;line-height:20px;overflow:hidden;}.appbox .appline .left{float:left;width:80px;text-align:right;padding-right:14px;}.appbox .appline .right{float:left;}.appbox .appline input{margin-right:5px;}.appbox .appline label{display:inline-block;margin-left:-10px;padding:0 5px;}.appbox .appline input[type=text],.appbox .appline textarea{width:275px;padding:0px 5px;border:1px solid #ddd;background:#fff;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,0.08);-webkit-transition:all ease-in-out .168s;-moz-transition:all ease-in-out .168s;-o-transition:all ease-in-out .168s;-ms-transition:all ease-in-out .168s;transition:all ease-in-out .168s;height:28px;border-radius:3px;}.appbox .appline input[type=text]:hover,.appbox .appline textarea:hover{border-color:#75A1F0;}.appbox .appline input[type=text]:focus,.appbox .appline textarea:focus{border-color:#75A1F0;outline:none;box-shadow:0 0 0 3px rgba(117,161,240,0.3);}.appbox .appline input[type=text].w30{width:50px;}.appbox .appline input[type=text].w20{width:30px;}.appbox .appline textarea{height:100px;}.appbox .appline.icon input{width:232px;}.appbox .appline.icon a{padding:2px 4px;top:0px;border:1px solid #CCC;}.appbox .appline.icon .open{margin-left:-12px;cursor:pointer;margin-top:-4px;font-size:14px;padding:3px 1em 4px 1em;}.appbox .appline.icon a img{width:20px;height:20px;}.zip-view-dialog .aui-content{min-width:400px;position:relative;}.zip-view-dialog .aui-title{height:90px;}.zip-view-dialog .zip-view-content{position:absolute;left:0;right:0;bottom:0;top:0px;margin:0px;min-width:400px;border:none;}.zip-view-dialog .zip-view-content .header{height:90px;background-color:#2c41b3;background-image:linear-gradient(to bottom,#2c41b3 0,#222b5d 100%);color:#fff;position:relative;}.zip-view-dialog .zip-view-content .header .bg{background:url("../../../images/common/banner/fly.png") 100px -300px;width:100%;height:100%;position:absolute;}.zip-view-dialog .zip-view-content .header .icon{width:56px;height:56px;position:absolute;left:20px;top:20px;}.zip-view-dialog .zip-view-content .header .name,.zip-view-dialog .zi


color: #fff;
	}

.fc-state-disabled,
.fc-state-disabled .fc-button-inner {
	color: #999;
	border-color: #ddd;
	}

.fc-state-disabled {
	cursor: default;
	}

.fc-state-disabled .fc-button-effect {
	display: none;
	}

/* Global Event Styles
------------------------------------------------------------------------*/

.fc-event {
	border-style: solid;
	border-width: 0;
	font-size: .85em;
	cursor: default;
	}

a.fc-event,
.fc-event-draggable {
	cursor: pointer;
	}

a.fc-event {
	text-decoration: none;
	}

.fc-rtl .fc-event {
	text-align: right;
	}

.fc-event-skin {
	border-color: #36c;     /* default BORDER color */
	background-color: #36c; /* default BACKGROUND color */
	color: #fff;            /* default TEXT color */
	}

.fc-event-inner {
	position: relative;
	width: 100%;
	height: 100%;
	border-style: solid;
	border-width: 0;
	overflow: hidden;
	}

.fc-event-time,
.fc-event-title {
	padding: 0 1px;
	}

.fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anymore, change class ***/
	display: block;
	position: absolute;
	z-index: 99999;
	overflow: hidden; /* hacky spaces (IE6/7) */
	font-size: 300%;  /* */
	line-height: 50%; /* */
	}

/* Horizontal Events
------------------------------------------------------------------------*/

.fc-event-hori {
	border-width: 1px 0;
	margin-bottom: 1px;
	}

/* resizable */

.fc-event-hori .ui-resizable-e {
	top: 0           !important; /* importants override pre jquery ui 1.7 styles */
	right: -3px      !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: e-resize;
	}

.fc-event-hori .ui-resizable-w {
	top: 0           !important;
	left: -3px       !important;
	width: 7px       !important;
	height: 100%     !important;
	cursor: w-resize;
	}

.fc-event-hori .ui-resizable-handle {
	_padding-bottom: 14px; /* IE6 had 0 height */
	}

/* Fake Rounded Corners (for buttons and events)
------------------------------------------------------------*/

.fc-corner-left {
	margin-left: 1px;
	}

.fc-corner-left .fc-button-inner,
.fc-corner-left .fc-event-inner {
	margin-left: -1px;
	}

.fc-corner-right {
	margin-right: 1px;
	}

.fc-corner-right .fc-button-inner,
.fc-corner-right .fc-event-inner {
	margin-right: -1px;
	}

.fc-corner-top {
	margin-top: 1px;
	}

.fc-corner-top .fc-event-inner {
	margin-top: -1px;
	}

.fc-corner-bottom {
	margin-bottom: 1px;
	}

.fc-corner-bottom .fc-event-inner {
	margin-bottom: -1px;
	}

/* Fake Rounded Corners SPECIFICALLY FOR EVENTS
-----------------------------------------------------------------*/

.fc-corner-left .fc-event-inner {
	border-left-width: 1px;
	}

.fc-corner-right .fc


:DXImageTransform.Microsoft.gradient( startColorstr='#ff3232', endColorstr='#ff3232',GradientType=0 ); /* IE6-8 */
}

.calendarpicker-christmas .touchtreegrid-footer {
    background: #ff3232; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2ZmMzIzMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZjMyMzIiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top,  #ff3232 1%, #ff0000 50%, #ff3232 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ff3232), color-stop(50%,#ff0000), color-stop(100%,#ff3232)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #ff3232 1%,#ff0000 50%,#ff3232 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #ff3232 1%,#ff0000 50%,#ff3232 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #ff3232 1%,#ff0000 50%,#ff3232 100%); /* IE10+ */
background: linear-gradient(to bottom,  #ff3232 1%,#ff0000 50%,#ff3232 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff3232', endColorstr='#ff3232',GradientType=0 ); /* IE6-8 */

    max-height: 2.5em;
    min-height: 2.5em;
}

.calendarpicker-christmas .x-button.x-button-pressing,
.calendarpicker-christmas .x-button.x-button-pressing:after,
.calendarpicker-christmas .x-button.x-button-pressed,
.calendarpicker-christmas .x-button.x-button-pressed:af


h 46767
IE1hc3RlcnM= 46768
Vm90ZQ== 46769
IGFjZXNz 46770
IGNvbnNjaW91c25lc3M= 46771
TG9jYXRvcg== 46772
IHRo4bq/ 46773
IENUeXBl 46774
IFNlbGVjdGVk 46775
IERvbmU= 46776
4LSv4LS/4LSy4LWN 46777
INmF2YbYp9iz 46778
ICMrIw== 46779
SVBQ 46780
IGRpc2NoYXJnZQ== 46781
IGV4Y3VzZQ== 46782
VGVycg== 46783
CXNw 46784
dnJv 46785
4KSf4KSw 46786
IG11c2lxdWU= 46787
X2FmdGVy 46788
Q09NUA== 46789
IEp1Z2VuZA== 46790
IE5vcnRod2VzdA== 46791
INC+0Lw= 46792
IGFmdGVyd2FyZHM= 46793
dGVw 46794
X3RyYW5zZm9ybQ== 46795
IGluY3Vy 46796
IERI 46797
IHZvbHZlcg== 46798
ODc4 46799
IOCmleCmvuCm 46800
JzsKCgo= 46801
IExpbmQ= 46802
IHNlbnNhdGlvbg== 46803
5pSv5LuY 46804
IGZvcm1hdG8= 46805
2LHYqNi5 46806
kas= 46807
IHBpcGVz 46808
IHRyYXRhcg== 46809
0ZjQuA== 46810
b3dhbmlh 46811
w6lydA== 46812
INC70LjQsdC+ 46813
IGFjY3JlZGl0ZWQ= 46814
IGhvbWVsZXNz 46815
cm9sb2d5 46816
IHB5bg== 46817
b2xpZQ== 46818
IHN1ZmljaWVudGU= 46819
YnVzaW5lc3M= 46820
aW55ZQ== 46821
IGN1YmU= 46822
VWI= 46823
PG1ldGE= 46824
INGF0L7RgNC+0YjQvg== 46825
RmFjYWRl 46826
NjM0 46827
NjYz 46828
IGxhd3N1aXQ= 46829
IFdlJ2xs 46830
INCy0YHRgtGA0LXRhw== 46831
YXRpZWY= 46832
NTg0 46833
IGluZGljYXRpb24= 46834
IGVuZXJnw61h 46835
dXBo 46836
IHNuYWNrcw== 46837
IHJvbGxz 46838
dWJybw== 46839
Y2Np 46840
IHRyYWlucw== 46841
IEhlbmQ= 46842
IEZhaWxlZA== 46843
4LCm4LC/ 46844
ewovLw== 46845
ZW50YXM= 46846
IFZlcmI= 46847
IFBob3Rvc2hvcA== 46848
IC0tLS0= 46849
OTY2 46850
IGRhaGVy 46851
IGxlZ2FsbHk= 46852
aWNrbmVzcw== 46853
INGA0LDQtNC4 46854
IHDDqXJpb2Rl 46855
aW1vbmlhbA== 46856
L3NlYXJjaA== 46857
INin2YbbgQ== 46858
k7A= 46859
NzE3 46860
IGNhdGVnb3JpYQ== 46861
w6RjaHN0 46862
5L6G 46863
IEdhcmFnZQ== 46864
DQoK 46865
X3V0aWw= 46866
IGRpc3B1dGU= 46867
dmFsb3I= 46868


790
/* 8020678C 002023EC  7C 63 D2 14 */	add r3, r3, r26
lbl_80206790:
/* 80206790 002023F0  90 7D 00 40 */	stw r3, 0x40(r29)
/* 80206794 002023F4  38 00 00 00 */	li r0, 0
/* 80206798 002023F8  80 7D 00 44 */	lwz r3, 0x44(r29)
/* 8020679C 002023FC  2C 03 00 00 */	cmpwi r3, 0
/* 802067A0 00202400  41 82 00 10 */	beq lbl_802067B0
/* 802067A4 00202404  7C 03 F0 40 */	cmplw r3, r30
/* 802067A8 00202408  40 80 00 08 */	bge lbl_802067B0
/* 802067AC 0020240C  38 00 00 01 */	li r0, 1
lbl_802067B0:
/* 802067B0 00202410  2C 00 00 00 */	cmpwi r0, 0
/* 802067B4 00202414  41 82 00 08 */	beq lbl_802067BC
/* 802067B8 00202418  7C 63 D2 14 */	add r3, r3, r26
lbl_802067BC:
/* 802067BC 0020241C  90 7D 00 44 */	stw r3, 0x44(r29)
/* 802067C0 00202420  38 00 00 00 */	li r0, 0
/* 802067C4 00202424  80 7D 00 48 */	lwz r3, 0x48(r29)
/* 802067C8 00202428  2C 03 00 00 */	cmpwi r3, 0
/* 802067CC 0020242C  41 82 00 10 */	beq lbl_802067DC
/* 802067D0 00202430  7C 03 F0 40 */	cmplw r3, r30
/* 802067D4 00202434  40 80 00 08 */	bge lbl_802067DC
/* 802067D8 00202438  38 00 00 01 */	li r0, 1
lbl_802067DC:
/* 802067DC 0020243C  2C 00 00 00 */	cmpwi r0, 0
/* 802067E0 00202440  41 82 00 08 */	beq lbl_802067E8
/* 802067E4 00202444  7C 63 D2 14 */	add r3, r3, r26
lbl_802067E8:
/* 802067E8 00202448  90 7D 00 48 */	stw r3, 0x48(r29)
/* 802067EC 0020244C  80 1D 00 00 */	lwz r0, 0(r29)
/* 802067F0 00202450  54 00 05 AD */	rlwinm. r0, r0, 0, 0x16, 0x16
/* 802067F4 00202454  41 82 00 B0 */	beq lbl_802068A4
/* 802067F8 00202458  38 60 00 80 */	li r3, 0x80
/* 802067FC 0020245C  4B FD 42 35 */	bl __nw__FUl
/* 80206800 00202460  2C 03 00 00 */	cmpwi r3, 0
/* 80206804 00202464  7C 74 1B 78 */	mr r20, r3
/* 80206808 00202468  41 82 00 0C */	beq lbl_80206814
/* 8020680C 0020246C  48 02 EC 69 */	bl func_80235474
/* 80206810 00202470  7C 74 1B 78 */	mr r20, r3
lbl_80206814:
/* 80206814 00202474  2C 14 00 00 */	cmpwi r20, 0
/* 80206818 0020


class SimpleJavaScriptPrintingContext extends JavaScriptPrintingContext {
  final StringBuffer buffer = StringBuffer();

  @override
  void emit(String string) {
    buffer.write(string);
  }

  String getText() => buffer.toString();
}

// TODO(ochafik): Inline the body of [TypeScriptTypePrinter] here if/when it no
// longer needs to share utils with [ClosureTypePrinter].
class Printer implements NodeVisitor {
  final JavaScriptPrintingOptions options;
  final JavaScriptPrintingContext context;
  final bool shouldCompressOutput;
  final DanglingElseVisitor danglingElseVisitor;
  final LocalNamer localNamer;

  bool inForInit = false;
  bool atStatementBegin = false;
  bool inNewTarget = false;
  bool pendingSemicolon = false;
  bool pendingSpace = false;

  // The current indentation level.
  int _indentLevel = 0;
  // A cache of all indentation strings used so far.
  final List<String> _indentList = [''];

  /// Whether the next call to [indent] should just be a no-op.
  bool _skipNextIndent = false;

  static final identifierCharacterRegExp = RegExp(r'^[a-zA-Z_0-9$]');
  static final expressionContinuationRegExp = RegExp(r'^[-+([]');

  Printer(this.options, this.context, {LocalNamer? localNamer})
      : shouldCompressOutput = options.shouldCompressOutput,
        danglingElseVisitor = DanglingElseVisitor(context),
        localNamer = determineRenamer(localNamer, options) {
    context.printer = this;
  }

  static LocalNamer determineRenamer(
      LocalNamer? localNamer, JavaScriptPrintingOptions options) {
    if (localNamer != null) return localNamer;
    return (options.shouldCompressOutput && options.minifyLocalVariables)
        ? MinifyRenamer()
        : IdentityNamer();
  }

  // The current indentation string.
  String get indentation {
    // Lazily add new indentation strings as required.
    while (_indentList.length <= _indentLevel) {
      _indentList.add('${_indentList.last}  ');
    }
    return _indentList[_indentLevel];
  }

  void indentMore() {
    _indentLevel++;
  }

  void indentLess() {
    _indentLevel--;
  }

  /// Always emit a newline, even under `enableMinification`.
  void forceLine() {
    out('\n');
  }

  /// Emits a newline for readability.
  void lineOut() {
    if (!shouldCompressOutput) forceLine();
  }

  void spaceOut() {
    if (!shouldCompressOutput) out(' ');
  }

  String lastAddedString = '\u0000';

  int get lastCharCode {
    assert(lastAddedString.isNotEmpty);
    return lastAddedString.codeUnitAt(lastAddedString.length - 1);
  }

  void out(String str) {
    if (str != '') {
      if (pendingSemicolon) {
        if (!shouldCompressOutput) {
          context.emit(';');
        } else if (str != '}') {
          // We want to output newline instead of semicolon because it makes
          // the raw stack traces much easier to read and it also makes line-
          // based tools like diff work much better.  JavaScript will
          // automatically insert the semicolon at the newline if it means a
          // parsing error is avoided, so we can only do this trick if the
          // next line is not something that can be glued onto a valid
          // expression to make a new valid expression.

          // If we're using the new emitter where most pretty printed code
          // is escaped in strings, it is a lot easier to deal with semicolons
          // than newlines


social-login {
    margin-bottom: 20px;
    padding-bottom: 25px;
    border-bottom: 1px solid #cccccc;
}

.login2 .login-wrapper .social-login > .btn {
    width: 49%;
    margin: 0;
}

.login2 .login-wrapper .social-login .facebook {
    background-color: #335397;
    border-color: #335397;
}

.login2 .login-wrapper .social-login .facebook:hover {
    background-color: transparent;
    color: #335397;
}

.login2 .login-wrapper .social-login .twitter {
    background-color: #00c7f7;
    border-color: #00c7f7;
}

.login2 .login-wrapper .social-login .twitter:hover {
    background-color: transparent;
    color: #00c7f7;
}
html {
	--accent-colour: #0060df;
	--colour-0: hsl(0, 0%, 100%);
	--colour-1: hsl(240, 10%, 95%);
	--colour-1-5: hsl(240, 13%, 97.5%);
	--colour-2: hsl(240, 10%, 90%);
	--colour-3: hsl(240, 10%, 85%);
	--colour-4: hsl(240, 10%, 80%);
	--colour-5: hsl(240, 10%, 75%);
	--link-colour-active: #054096;
	--link-colour-hover: #0250bb;
	--link-colour-normal: #0060df;
	--text-colour-normal: hsl(0, 0%, 0%);
	--text-colour-secondary: hsl(0, 0%, 20%);
	--transparent-0: hsla(0, 0%, 0%, 10%);
	--transparent-1: hsla(0, 0%, 0%, 15%);
	--transparent-2: hsla(0, 0%, 0%, 20%);
	--transparent-3: hsla(0, 0%, 0%, 25%);
	--transparent-4: hsla(0, 0%, 0%, 30%);
	--transparent-5: hsla(0, 0%, 0%, 35%);
	font-family: sans-serif;
	font-size: 14px;
}

@media (prefers-color-scheme: dark) {
	html {
		--accent-colour: #00ddff;
		--colour-0: hsl(248, 11%, 15%);
		--colour-1: hsl(248, 11%, 20%);
		--colour-1-5: hsl(248, 11%, 17.5%);
		--colour-2: hsl(248, 11%, 25%);
		--colour-3: hsl(248, 11%, 30%);
		--colour-4: hsl(248, 11%, 35%);
		--colour-5: hsl(248, 11%, 40%);
		--link-colour-active: #aaf2ff;
		--link-colour-hover: #80ebff;
		--link-colour-normal: #00ddff;
		--text-colour-normal: hsl(0, 0%, 100%);
		--text-colour-secondary: hsl(0, 0%, 80%);
		--transparent-0: hsla(0, 0%, 100%, 10%);
		--transparent-1: hsla(0, 0%, 100%, 15%);
		--transparent-2: hsla(0, 0%, 100%, 20%);
		--transparent-3: hsla(0, 0%, 100%, 25%);
		--transparent-4: hsla(0, 0%, 100%, 30%);
		--transparent-5: hsla(0, 0%, 100%, 0.35);
	}
}

#reinstall-tip {
	animation-delay: 5s;
	animation-duration: 0s;
	animation-fill-mode: forwards;
	animation-name: appear;
	opacity: 0;
	overflow-wrap: break-word;
	white-space: normal;
}

@keyframes appear {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

#template,
.hidden {
	display: none !important;
}

.disabled {
	opacity: 0.5;
	pointer-events: none;
	* {
		pointer-events:


,0,0.15),inset 1px 0 0 rgba(0,0,0,0.15),inset -1px 0 0 rgba(0,0,0,0.15);height:115px;max-width:170px}.HyperLinkPreview.is_not_expanded .hyperlink_text_wrapper{padding-right:8px}.HyperLinkPreview.is_not_expanded .hyperlink_title{padding-bottom:8px}.HyperLinkPreview.is_expanded .hyperlink_image{box-shadow:inset 0 1px 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);padding-top:56.25%}.HyperLinkPreview .hyperlink_image{display:block;background-size:cover;background-position:center}.HyperLinkPreview:hover .hyperlink_title{text-decoration:underline}.HyperLinkPreview .hyperlink_title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-weight:bold;line-height:1.3;color:#333;font-size:18px}.HyperLinkPreview .hyperlink_description{color:#333;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;word-break:break-word}.HyperLinkPreview .hyperlink_info_compact{font-size:13px}.HyperLinkPreview .hyperlink_info_compact,.HyperLinkPreview .hyperlink_info_compact a{color:#949494}.HyperLinkPreview .hyperlink_info_compact .link_timestamp:hover{text-decoration:underline}.HyperLinkPreview .hyperlink_info .hyperlink_publisher{font-size:15px;line-height:1.4;font-family:Georgia,Times,"Times New Roman",serif;color:#333}.HyperLinkPreview .hyperlink_info .link_timestamp{font-size:13px;color:#949494;display:inline-block}.HyperLinkPreview .hyperlink_info .EventModalLink{font-size:13px;color:#949494;display:inline-block}.HyperLinkPreview .hyperlink_info .link_timestamp:hover{text-decoration:underline}.HyperLinkPreview .link_timestamp,.HyperLinkPreview .EventModalLink{position:relative;z-index:2}.HyperLinkPreview .link_overlay{position:absolute;z-index:1;top:0;left:0;right:0;bottom:0}.hyperlink_footer_link{margin:16px -16px -16px;border-top:1px solid #e2e2e2}.HyperLinkPreviewCompact.is_not_expanded .hyperlink_image{border-radius:0 15px 15px 0;min-height:125px;height:auto;width:125px}.HyperLinkPreviewCompact.is_not_expanded .hyperlink_title{padding-bottom:0;margin-bottom:4px;font-size:15px;line-height:1.4}.HyperLinkPreviewCompact.is_not_expanded .link_video .qtext_embed{z-index:50}.HyperLinkPreviewCompact .link_content_with_image{border:1px solid #e2e2e2;border-radius:15px 0 0 15px;padding:8px;padding-left:16px;overflow:auto}.HyperLinkPreviewCompact .link_content_without_image{border:1px solid #e2e2e2;border-radius:15px;padding:8px;overflow:auto}.HyperLinkPreviewCompact .hyperlink_description{font-size:15px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.HyperLinkPreviewCompact:hover{background-color:#fafafa}.HyperLinkPreviewCompact:hover .hyperlink_title{text-decoration:none}.HyperLinkPreviewCompact.not_linked:hover{background-color:#fff;cursor:default}.HyperLinkPreviewCompact.with_extra.is_not_expanded .hyperlink_image{border-radius:15px 0 0 0}.HyperLinkPreviewCompact.with_extra .link_content_with_image{border-radius:0 15px 0 0}.Hyp


Web;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'dart:typed_data';
import 'package:flutter_onnxruntime/flutter_onnxruntime.dart';

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();

  group('OrtValue Tests', () {
    group('Round-trip tests', () {
      testWidgets('Float32 round-trip test', (WidgetTester tester) async {
        final inputData = Float32List.fromList([1.1, 2.2, 3.3, 4.4]);
        final shape = [2, 2]; // 2x2 matrix

        final tensor = await OrtValue.fromList(inputData, shape);
        expect(tensor.dataType, OrtDataType.float32);
        expect(tensor.shape, shape);

        final retrievedData = await tensor.asFlattenedList();
        expect(retrievedData.length, 4);
        for (int i = 0; i < inputData.length; i++) {
          expect(retrievedData[i], closeTo(inputData[i], 1e-5));
        }

        await tensor.dispose();
      });

      testWidgets('Int32 round-trip test', (WidgetTester tester) async {
        final inputData = Int32List.fromList([1, 2, 3, 4, 5, 6]);
        final shape = [2, 3]; // 2x3 matrix

        final tensor = await OrtValue.fromList(inputData, shape);
        expect(tensor.dataType, OrtDataType.int32);
        expect(tensor.shape, shape);

        final retrievedData = await tensor.asFlattenedList();
        expect(retrievedData.length, 6);
        for (int i = 0; i < inputData.length; i++) {
          expect(retrievedData[i], inputData[i]);
        }

        await tensor.dispose();
      });

      testWidgets('Int64 round-trip test', (WidgetTester tester) async {
        // Skip the test for web platform as BigInt64Array required by ONNX Runtime Web for int64 tensors
        // is not supported in all browsers
        if (kIsWeb) {
          return;
        }
        // Use numbers outside the range of Int32 (e.g., greater than 2^31 - 1)
        final inputData = Int64List.fromList([2147483648, -2147483649, 9223372036, -9223372036]);
        final shape = [2, 2]; // 2x2 matrix

        final tensor = await OrtValue.fromList(inputData, shape);
        expect(tensor.dataType, OrtDataType.int64);
        expect(tensor.shape, shape);

        final retrievedData = await tensor.asFlattenedList();
        expect(retrievedData.length, 4);
        for (int i = 0; i < inputData.length; i++) {
          expect(retrievedData[i], inputData[i]);
        }
        await tensor.dispose();
      });

      testWidgets('Uint8 round-trip test', (WidgetTester tester) async {
        final inputData = Uint8List.fromList([10, 20, 30, 40]);
        final shape = [4]; // 1D array

        final tensor = await OrtValue.fromList(inputData, shape);
        expect(tensor.dataType, OrtDataType.uint8);
        expect(tensor.shape, shape);

        final retrievedData = await tensor.asFlattenedList();
        expect(retrievedData.length, 4);
        for (int i = 0; i < inputData.length; i++) {
          expect(retrievedData[i], inputData[i]);
        }

        await tensor.dispose();
      });

      testWidgets('Boolean round-trip test', (WidgetTester tester) async {
        final inputData = [true, false, true, false];
        final shape = [2, 2]; // 2x2 matrix

        final tensor = await OrtValue.fromList(inputData, shape);
        expect(tensor.dataType, OrtDataType.bool);
        expect(tensor.shape, shape);


 r5
	ldr     r4, [pc, #0x2c] @ 0x2226578, (=0xedb88320)
	mov     r0, #0x0
	add     r3, #0xff
.thumb
branch_2226550: @ 2226550 :thumb
	mov     r7, r0
	mov     r2, #0x0
.thumb
branch_2226554: @ 2226554 :thumb
	mov     r6, r7
	tst     r6, r5
	beq     branch_2226562
	lsr     r6, r7, #1
	mov     r7, r6
	eor     r7, r4
	b       branch_2226564
@ 0x2226562

.thumb
branch_2226562: @ 2226562 :thumb
	lsr     r7, r7, #1
.thumb
branch_2226564: @ 2226564 :thumb
	.hword  0x1c52 @ add r2, r2, #0x1
	cmp     r2, #0x8
	blt     branch_2226554
	.hword  0x1c40 @ add r0, r0, #0x1
	stmia   r1!, {r7}
	cmp     r0, r3
	blt     branch_2226550
	pop     {r4-r7}
	bx      lr
@ 0x2226576

.align 2

.word 0xedb88320 @ 0x2226578
.thumb
Function_222657c: @ 222657c :thumb
	push    {r3-r7,lr}
	add     sp, #-0x10
	mov     r5, r1
	mov     r7, r0
	lsr     r0, r5, #31
	add     r0, r5, r0
	asr     r0, r0, #1
	str     r2, [sp, #0x4]
	str     r3, [sp, #0x8]
	bl      Function_22246c4
	mov     r6, r0
	bne     branch_222659e
	mov     r0, #0x0
	add     sp, #0x10
	mvn     r0, r0
	pop     {r3-r7,pc}
@ 0x222659e

.thumb
branch_222659e: @ 222659e :thumb
	mov     r0, r5
	bl      Function_22246c4
	str     r0, [sp, #0xc]
	cmp     r0, #0x0
	bne     branch_22265b8
	mov     r0, r6
	bl      Function_22246d4
	mov     r0, #0x0
	add     sp, #0x10
	mvn     r0, r0
	pop     {r3-r7,pc}
@ 0x22265b8

.thumb
branch_22265b8: @ 22265b8 :thumb
	mov     r4, #0x0
.thumb
branch_22265ba: @ 22265ba :thumb
	ldr     r0, [sp, #0x8]
	ldr     r3, [sp, #0x4]
	str     r0, [sp, #0x0]
	mov     r0, r4
	mov     r1, r6
	mov     r2, r5
	bl      Function_22265f8
	mov     r0, r6
	mov     r1, r7
	mov     r2, r5
	bl      Function_222662c
	ldr     r2, [sp, #0xc]
	mov     r0, r7
	mov     r1, r5
	bl      Function_2226650
	.hword  0x1c64 @ add r4, r4, #0x1
	cmp     r4


ewsCancelButton(
    modifier: Modifier = Modifier,
    text: String,
    onClick: () -> Unit
) {
    Button(
        onClick = onClick,
        contentPadding = PaddingValues(
            horizontal = 20.dp,
            vertical = 4.dp
        ),
        colors = ButtonDefaults.buttonColors(
            containerColor = MaterialTheme.colorScheme.secondaryContainer,
            contentColor = MaterialTheme.colorScheme.onSecondaryContainer
        ),
        shape = RoundedCornerShape(size = 32.dp),
        elevation = ButtonDefaults.elevatedButtonElevation(
            defaultElevation = 2.dp, // 设置按钮的默认阴影高度
            pressedElevation = 8.dp // 设置按钮在被按下时的阴影高度
        ),
        modifier = Modifier.then(modifier)
    ) {
        Text(
            text = text,
            style = MaterialTheme.typography.bodyMedium.copy(
                fontWeight = FontWeight.Medium,
                fontSize = 13.sp
            ),
            color = MaterialTheme.colorScheme.onSecondaryContainer,
            maxLines = 1,
            overflow = TextOverflow.Ellipsis
        )
    }
}

@Composable
fun NewsTextButton(
    modifier: Modifier = Modifier,
    text: String,
    onClick: () -> Unit = {}
) {
    TextButton(
        onClick = onClick,
        shape = RoundedCornerShape(size = 32.dp),
        modifier = Modifier.then(modifier)
    ) {
        Text(
            text = text,
            style = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.Medium),
            color = MaterialTheme.colorScheme.primary
        )
    }
}

@Composable
fun NewsCancelTextButton(
    modifier: Modifier = Modifier,
    text: String,
    onClick: () -> Unit
) {
    TextButton(
        onClick = onClick,
        shape = RoundedCornerShape(size = 32.dp),
        colors = ButtonDefaults.textButtonColors().copy(
            contentColor = MaterialTheme.colorScheme.error
        ),
        modifier = Modifier.then(modifier)
    ) {
        Text(
            text = text,
            style = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.Medium),
            color = MaterialTheme.colorScheme.error
        )
    }
}

@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, name = "Light")
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, name = "Dark")
@Composable
private fun NewsTextButtonPreview() {
    NinTheme {
        Column {
            NewsTextButton(
                text = "TextButton",
                onClick = {}
            )

            NewsButton(
                text = "NewsButton",
                onClick = {}
            )

            NewsCancelTextButton(
                text = "TextButton",
                onClick = {}
            )

            NewsCancelButton(
                text = "NewsButton",
                onClick = {}
            )
        }
    }
}package me.qcuncle.nowinnews.presentation.hot.compoments

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import


, typename InstructionShape , typename EpilogueOutputOp , typename ThreadblockSwizzle , int InterleavedK, bool SplitKSerial, typename Operator , bool IsBetaZero>

          using cutlass::gemm::kernel::DefaultGemm< ElementA, layout::ColumnMajorInterleaved< InterleavedK >, kAlignmentA, ElementB, layout::RowMajorInterleaved< InterleavedK >, kAlignmentB, ElementC, layout::ColumnMajorInterleaved< InterleavedK >, int32_t, arch::OpClassTensorOp, arch::Sm75, ThreadblockShape, WarpShape, InstructionShape, EpilogueOutputOp, ThreadblockSwizzle, 2, SplitKSerial, Operator, IsBetaZero >::ElementAccumulator =  int32_t

template<typename ElementA , int kAlignmentA, typename ElementB , int kAlignmentB, typename ElementC , typename ThreadblockShape , typename WarpShape , typename InstructionShape , typename EpilogueOutputOp , typename ThreadblockSwizzle , int InterleavedK, bool SplitKSerial, typename Operator , bool IsBetaZero>

          using cutlass::gemm::kernel::DefaultGemm< ElementA, layout::ColumnMajorInterleaved< InterleavedK >, kAlignmentA, ElementB, layout::RowMajorInterleaved< InterleavedK >, kAlignmentB, ElementC, layout::ColumnMajorInterleaved< InterleavedK >, int32_t, arch::OpClassTensorOp, arch::Sm75, ThreadblockShape, WarpShape, InstructionShape, Epilogue


to	move	(a3)+,d1	* Offset Y
	move	(a3)+,d0	* Speed Y

	move.l	8(a7),a2
	add	d0,(a2)
	move	(a2)+,d0
	move.l	a2,8(a7)

	tst	d0
	beq.s	goto_z	* On va pas perdre pleins de cycles
			* pour rien

	CMP	#360,D0
	BMI.S	GO_mYy
	sub	#360,-2(A2)
go_myy
	tst	d0
	bpl.s	noaddym
	add	#360,d0
noaddym	add	d0,d0
	move	(a1,d0),d0	* Sin
	muls	d0,d1
	add.l	d1,d1
	add.l	d1,d1
	swap	d1
	move	d1,(a6)+
	bra.s	zltob

goto_z	addq	#2,a6
zltob	move	(a4)+,d1	* Offset Z
	move	(a4)+,d0	* Speed Z
	move.l	12(a7),a2
	add	d0,(a2)
	move	(a2)+,d0
	move.l	a2,12(a7)

	tst	d0
	beq.s	end	* On va pas perdre pleins de cycles
			* pour rien

	CMP	#360,D0
	BMI.S	GO_mYz
	sub	#360,-2(A2)
go_myz
	tst	d0
	bpl.s	noaddzm
	add	#360,d0
noaddzm	add	d0,d0
	move	(a1,d0),d0	* Sin
	muls	d0,d1
	add.l	d1,d1
	add.l	d1,d1
	swap	d1
	move	d1,(a6)+
	bra.s	zltoc

end	addq	#2,a6
zltoc	move.l	(a7)+,a2

	dbra	d7,mut_bucl

	lea	12(a7),a7
	rts

sincos
* On recupere la chose avec lsl #2 et swap d2
	tst	d0
	bpl.s	noadd
	add	#360,d0
noadd	move	d0,d1
	move	d0,d2

	add	d1,d1
	move	(a0,d1),d1	* Sin

	cmp	#270,d0
	blt.s	plus9
	sub	#270,d0
	bra.s	gosin
plus9	add	#90,d0
gosin	add	d0,d0
	move	(a0,d0),d0	* Cos

	rts

************************
* MY LATEST SCROLLROUT *
************************
scroll	move.l	scro_a,a0
	move.l	scro_b,scro_a
	move.l	a0,scro_b
	lea	(a0),a3

	subq	#1,nxt_let
	bne.s	no_let

	LEA	message,a1
	lea	font_adress,a2
	moveq	#0,d0
refetch	move	point_txt,d0
	move.b	(a1,d0),d0
	EXT	D0
	CMP.B	#$FF,d0	* Fin de message
	bNE.s	z_tetx
	clr	point_txt
	bra.S	refetch