�取
    $.ajax({
        type: "POST",
        url: reqUrl,
        success: function(res){

            // 表头
            var $thead_HTML = $(
                '
' +
                '   来源渠道	' +
                '   来源设备	' +
                '   来源IP	' +
                '   来源时间	' +
                '   访问量	' +
                '   操作	' +
                '
'
            );
            $("#right .data-list thead").html($thead_HTML);

            // 设置面包屑的标题
            $("#channel_title").text(res.channel_title);

            // 200状态码
            if(res.code == 200){

                // 如果有数据
                // 遍历数据
                for (var i=0; i<res.channelDataList.length; i++) {

                    // 将清空数据按钮显示出来
                    $('#CleanAllChannelDataBtn').html('<button class="default-btn">数据列表</button><button class="tint-btn" data-toggle="modal" data-target="#CleanAllChannelData" onclick="askCleanAllChannelData('+channelid+');" style="margin-left:10px;float:right;">清空数据</button>');

                    // （1）序号
                    var xuhao = i+1;

                    // （2）数据来源
                    var data_referer = res.channelDataList[i].data_referer;
                    if(data_referer == '微信') {

                        var data_referer_icon = 'weixin.png';
                    }else if (data_referer == '微博') {

                        var data_referer_icon = 'weibo.png';
                    }else if (data_referer == '微博') {

                        var data_referer_icon = 'weibo.png';
                    }else if (data_referer == '哔哩哔哩') {

                        var data_referer_icon = 'bilibili.png';
                    }else if (data_referer == 'QQ') {

                        var data_referer_icon = 'qq.png';
                    }else if (data_referer == '支付宝') {

                        var data_referer_icon = 'alipay.png';
                    }else if (data_referer == '百度') {

                        var data_referer_icon = 'baidu.png';
                    }else if (data_referer == '钉钉') {

                        var data_referer_icon = 'dingding.png';
                    }else if (data_referer == 'QQ浏览器') {

                        var data_referer_icon = 'QQBroswer.png';
                    }else if (data_referer == '小米浏览器') {

                        var data_referer_icon = 'xiaomi.png';
                    }else if (data_referer == 'vivo浏览器') {

                        var data_referer_icon = 'vivo.png';
                    }else if (data_referer == '华为浏览器') {

                        var data_referer_icon = 'huawei.png';
                    }else if (data_referer == 'OPPO浏览器') {

                        var data_referer_icon = 'oppo.png';
                    }else if (data_referer == '荣耀浏览器') {

                        var data_referer_icon = 'honor.png';
                    }else if (data_referer == '一加浏览器') {

                        var data_referer_icon = 'oneplus.png';
                    }else if (data_referer == '红米浏览器') {

                        var


ndex = (currentSceneIndex + 1) % sceneIndices.Length;
        PlayerPrefs.SetInt("LastSceneIndex", currentSceneIndex); // Store new index
        Debug.Log("New index after increment: " + currentSceneIndex + ", Loading scene: " + sceneIndices[currentSceneIndex]);

        SceneManager.LoadScene(sceneIndices[currentSceneIndex]);
    }

    public void GoToPreviousScene()
    {
        Debug.Log("GoToPreviousScene called. Current index before: " + currentSceneIndex);

        currentSceneIndex = (currentSceneIndex - 1 + sceneIndices.Length) % sceneIndices.Length;
        PlayerPrefs.SetInt("LastSceneIndex", currentSceneIndex); // Store new index
        Debug.Log("New index after decrement: " + currentSceneIndex + ", Loading scene: " + sceneIndices[currentSceneIndex]);

        SceneManager.LoadScene(sceneIndices[currentSceneIndex]);
    }

    public void ShowPopUp()
    {
        if (popupPanel != null)
        {
            popupPanel.SetActive(true);
        }
    }

    public void GoToHome()
    {
        Debug.Log("GoToHome() called - Switching to Home scene");
        SceneManager.LoadScene(1);
    }
}


   "predictions": datasets.Value("string", id="sequence"),
                        "references": datasets.Value("string", id="sequence"),
                    }
                ),
            ],
            codebase_urls=["https://github.com/google-research/google-research/tree/master/rouge"],
            reference_urls=[
                "https://en.wikipedia.org/wiki/ROUGE_(metric)",
                "https://github.com/google-research/google-research/tree/master/rouge",
            ],
        )

    def _compute(
        self, predictions, references, rouge_types=None, use_aggregator=True, use_stemmer=False, tokenizer=None
    ):
        if rouge_types is None:
            rouge_types = ["rouge1", "rouge2", "rougeL", "rougeLsum"]

        multi_ref = isinstance(references[0], list)

        if tokenizer is not None:
            tokenizer = Tokenizer(tokenizer)

        scorer = rouge_scorer.RougeScorer(rouge_types=rouge_types, use_stemmer=use_stemmer, tokenizer=tokenizer)
        if use_aggregator:
            aggregator = scoring.BootstrapAggregator()
        else:
            scores = []

        for ref, pred in zip(references, predictions):
            if multi_ref:
                score = scorer.score_multi(ref, pred)
            else:
                score = scorer.score(ref, pred)
            if use_aggregator:
                aggregator.add_scores(score)
            else:
                scores.append(score)

        if use_aggregator:
            result = aggregator.aggregate()
            for key in result:
                result[key] = result[key].mid.fmeasure

        else:
            result = {}
            for key in scores[0]:
                result[key] = list(score[key].fmeasure for score in scores)

        return result


j2store-navbar .navbar-nav .dropdown-menu {
        position: relative;
        background-color: #263c59;
    }
    #j2store-navbar .dropdown-backdrop{
        position: static;
    }
}
.com_j2store #adminForm {
    padding-top: 18px;
}
.com_j2store  .input-prepend input{
    position: static;

}
/* navbar content */
.com_j2store .alert-block,.com_j2store #j-main-container .apps,.com_j2store #j-main-container .nav{
    margin: 10px 0px;
}

/*dual-list-box */
.com_j2store  #dual-list-box .bootstrap-duallistbox-container .col-md-6{
    flex: 0 0 auto;
    width: 50%;
}
.com_j2store  #dual-list-box .row{
    --gutter-x: 2rem;
    --gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(var(--gutter-x)*-.5);
    margin-right: calc(var(--gutter-x)*-.5);
    margin-top: calc(var(--gutter-y)*-1);
}
.com_j2store .form-horizontal,.com_j2store .view-taxprofile,.com_j2store.task-createOrder .form-horizontal {
    padding: 10px 36px;
}
.com_j2store.view-product .radio input[type="radio"]{
    float: none;
    margin-left: unset ;
    min-width: auto ;
}
.form-horizontal .controls:first-child {
    margin-left: auto ;
}/*! UIkit 3.16.19 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */html{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px;font-weight:400;line-height:1.5;-webkit-text-size-adjust:100%;background:#fff;color:#666}body{margin:0}.gsl-link,a{color:#1e87f0;text-decoration:none;cursor:pointer}.gsl-link-toggle:hover .gsl-link,.gsl-link:hover,a:hover{color:#0f6ecd;text-decoration:underline}abbr[title]{text-decoration:underline dotted;-webkit-text-decoration-style:dotted}b,strong{font-weight:bolder}:not(pre)>code,:not(pre)>kbd,:not(pre)>samp{font-family:Consolas,monaco,monospace;font-size:.875rem;color:#f0506e;white-space:nowrap;padding:2px 6px;background:#f8f8f8}em{color:#f0506e}ins{background:#ffd;color:#666;text-decoration:none}mark{background:#ffd;color:#666}q{font-style:italic}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio,canvas,iframe,img,svg,video{vertical-align:middle}canvas,img,svg,video{max-width:100%;height:auto;box-sizing:border-box}img:not([src]){visibility:hidden;min-w


from __future__ import annotations

import pytest

from pybind11_tests import class_sh_disowning as m

def is_disowned(obj):
    try:
        obj.get()
    except ValueError:
        return True
    return False

def test_same_twice():
    while True:
        obj1a = m.Atype1(57)
        obj1b = m.Atype1(62)
        assert m.same_twice(obj1a, obj1b) == (57 * 10 + 1) * 100 + (62 * 10 + 1) * 10
        assert is_disowned(obj1a)
        assert is_disowned(obj1b)
        obj1c = m.Atype1(0)
        with pytest.raises(ValueError):
            # Disowning works for one argument, but not both.
            m.same_twice(obj1c, obj1c)
        assert is_disowned(obj1c)
        return  # Comment out for manual leak checking (use `top` command).

def test_mixed():
    first_pass = True
    while True:
        obj1a = m.Atype1(90)
        obj2a = m.Atype2(25)
        assert m.mixed(obj1a, obj2a) == (90 * 10 + 1) * 200 + (25 * 10 + 2) * 20
        assert is_disowned(obj1a)
        assert is_disowned(obj2a)

        # The C++ order of evaluation of function arguments is (unfortunately) unspecified:
        # https://en.cppreference.com/w/cpp/language/eval_order
        # Read on.
        obj1b = m.Atype1(0)
        with pytest.raises(ValueError):
            # If the 1st argument is evaluated first, obj1b is disowned before the conversion for
            # the already disowned obj2a fails as expected.
            m.mixed(obj1b, obj2a)
        obj2b = m.Atype2(0)
        with pytest.raises(ValueError):
            # If the 2nd argument is evaluated first, obj2b is disowned before the conversion for
            # the already disowned obj1a fails as expected.
            m.mixed(obj1a, obj2b)

        # Either obj1b or obj2b was disowned in the expected failed m.mixed() calls above, but not
        # both.
        is_disowned_results = (is_disowned(obj1b), is_disowned(obj2b))
        assert is_disowned_results.count(True) == 1
        if first_pass:
            first_pass = False
            ix = is_disowned_results.index(True) + 1
            print(f"\nC++ function argument {ix} is evaluated first.")

        return  # Comment out for manual leak checking (use `top` command).

def test_overloaded():
    while True:
        obj1 = m.Atype1(81)
        obj2 = m.Atype2(60)
        with pytest.raises(TypeError):
            m.overloaded(obj1, "NotInt")
        assert obj1.get() == 81 * 10 + 1  # Not disowned.
        assert m.overloaded(obj1, 3) == (81 * 10 + 1) * 30 + 3
        with pytest.raises(TypeError):
            m.overloaded(obj2, "NotInt")
        assert obj2.get() == 60 * 10 + 2  # Not disowned.
        assert m.overloaded(obj2, 2) == (60 * 10 + 2) * 40 + 2
        return  # Comment out for manual leak checking (use `top` command).


include("sh_mapvote.lua")
util.AddNetworkString("MapvoteUpdateMapList")
util.AddNetworkString("MapvoteSendAllMaps")
util.AddNetworkString("MapvoteSetActive")
util.AddNetworkString("MapvoteSyncNominations")

MV.MapList = {}
MV.Players = {} -- store each player's vote - {Player, Map}
MV.PlayerNominations = {}
MV.Nominations = {}

MV.Active = false
MV.TimeLeft = MV.VotingTime

MV.LoadTime = CurTime()

local defaultFlags = FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_NOTIFY + FCVAR_ARCHIVE

if not file.Exists("map_statistics.txt", "DATA") then
	file.Write("map_statistics.txt","[]")
end

MV.MapStats = util.JSONToTable( file.Read("map_statistics.txt", "DATA") )

hook.Add("DeathrunBeginPrep", "RecordMapStats", function() -- increment stats by 1 each time a round is played on the map
	local map = game.GetMap()
	MV.MapStats[map] = MV.MapStats[map] or #player.GetAllPlaying()
	MV.MapStats[map] = MV.MapStats[map] + #player.GetAllPlaying()
	file.Write("map_statistics.txt", util.TableToJSON( MV.MapStats ) )
end)

--commands
concommand.Add("mapvote_list_maps", function(ply, cmd, args)

	if DR:CanAccessCommand(ply, cmd) then

		net.Start("MapvoteSendAllMaps")
		net.WriteTable({
			maps = MV:GetGoodMaps(),
			action = "openlist"
		})
		net.Send( ply )

	end

end)

DR:AddChatCommand("nominate", function( ply )
	ply:ConCommand( "mapvote_list_maps" )
end)
DR:AddChatCommandAlias("nominate", "maps")

function MV:SyncMapList()
	net.Start( "MapvoteUpdateMapList" )
	net.WriteTable( MV.MapList )
	net.Broadcast()
end

function MV:GetGoodMaps()
	-- get a list of maps
	local mapfiles = file.Find("maps/*.bsp", "GAME", "nameasc")

	-- cleanup the names
	for i = 1, #mapfiles do
		mapfiles[i] = string.sub( mapfiles[i], 1, -5 )
	end

	-- remove files that don't have the right prefix
	local goodmaps = {}
	for k,map in ipairs( mapfiles ) do
		for _, filter in ipairs( MV.Filter ) do
			local length = string.len( filter )
			local mapname = string.sub( map, 1, length )

			if mapname == filter then
				if not table.HasValue( goodmaps, map ) then -- ignore duplicates
					table.insert(goodmaps, map)
				end
			end
		end
	end

	return goodmaps
end

function MV:UpdateMapVote()

	net.Start("MapvoteUpdateMapList")
	net.WriteTable( MV.MapList )
	net.Broadcast()
end

function MV:BeginMapVote() -- initiates the mapvote, and syncs the maps once

	mapfiles = MV:GetGoodMaps()

	-- populate the maplist
	MV.MapList = {}

	for i = 1, MV.MaxMaps do -- add nominations
		if MV.Nominations[i] then
			MV.MapList[ MV.Nominations[i] ] = 0
		end
	end

	--print(#MV.MapList, MV.MaxMaps, #mapfiles)
	local totalloops = 0
	local numMaps = 0
	for k,v in pairs(MV.MapList) do
		numMaps = numMaps + 1
	end


id":"ref-for-valdef-text-orientation-sideways\u2463"}],"title":"6.3. \nLine-relative Directions"}],"url":"#valdef-text-orientation-sideways"},
"valdef-text-orientation-sideways-right": {"dfnID":"valdef-text-orientation-sideways-right","dfnText":"sideways-right","external":false,"refSections":[],"url":"#valdef-text-orientation-sideways-right"},
"valdef-text-orientation-upright": {"dfnID":"valdef-text-orientation-upright","dfnText":"upright","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-text-orientation-upright"}],"title":"4.2. \nText Baselines"},{"refs":[{"id":"ref-for-valdef-text-orientation-upright\u2460"}],"title":"5. \nIntroduction to Vertical Text Layout"},{"refs":[{"id":"ref-for-valdef-text-orientation-upright\u2461"},{"id":"ref-for-valdef-text-orientation-upright\u2462"}],"title":"5.1. \nOrienting Text: the text-orientation property"},{"refs":[{"id":"ref-for-valdef-text-orientation-upright\u2463"},{"id":"ref-for-valdef-text-orientation-upright\u2464"}],"title":"5.1.3. \nObsolete: the SVG1.1 glyph-orientation-vertical property"},{"refs":[{"id":"ref-for-valdef-text-orientation-upright\u2465"}],"title":"6.4. \nAbstract-to-Physical Mappings"}],"url":"#valdef-text-orientation-upright"},
"valdef-unicode-bidi-bidi-override": {"dfnID":"valdef-unicode-bidi-bidi-override","dfnText":"bidi-override","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-unicode-bidi-bidi-override"},{"id":"ref-for-valdef-unicode-bidi-bidi-override\u2460"},{"id":"ref-for-valdef-unicode-bidi-bidi-override\u2461"},{"id":"ref-for-valdef-unicode-bidi-bidi-override\u2462"},{"id":"ref-for-valdef-unicode-bidi-bidi-override\u2463"}],"title":"2.2. \nEmbeddings and Overrides: the unicode-bidi property"},{"refs":[{"id":"ref-for-valdef-unicode-bidi-bidi-override\u2464"}],"title":"2.4.3. \nBidi Treatment of Atomic Inlines"}],"url":"#valdef-unicode-bidi-bidi-override"},
"valdef-unicode-bidi-embed": {"dfnID":"valdef-unicode-bidi-embed","dfnText":"embed","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-unicode-bidi-embed"},{"id":"ref-for-valdef-unicode-bidi-embed\u2460"}],"title":"2.2. \nEmbeddings and Overrides: the unicode-bidi property"},{"refs":[{"id":"ref-for-valdef-unicode-bidi-embed\u2461"}],"title":"2.4.3. \nBidi Treatment of Atomic Inlines"}],"url":"#valdef-unicode-bidi-embed"},
"valdef-unicode-bidi-isolate": {"dfnID":"valdef-unicode-bidi-isolate","dfnText":"isolate","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-unicode-bidi-isolate"},{"id":"ref-for-valdef-unicode-bidi-isolate\u2460"},{"id":"ref-for-valdef-unicode-bidi-isolate\u2461"},{"id":"ref-for-valdef-unicode-bidi-isolate\u2462"},{"id":"ref-for-valdef-unicode-bidi-isolate\u2463"}],


ev.platform_data)
		platform_device_register(&omap_spi2);
}

#else
static inline void omap_init_spi100k(void)
{
}
#endif

#define OMAP1_CAMERA_BASE	0xfffb6800
#define OMAP1_CAMERA_IOSIZE	0x1c

static struct resource omap1_camera_resources[] = {
	[0] = {
		.start	= OMAP1_CAMERA_BASE,
		.end	= OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= INT_CAMERA,
		.flags	= IORESOURCE_IRQ,
	},
};

static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32);

static struct platform_device omap1_camera_device = {
	.name		= "omap1-camera",
	.id		= 0, /* This is used to put cameras on this interface */
	.dev		= {
		.dma_mask		= &omap1_camera_dma_mask,
		.coherent_dma_mask	= DMA_BIT_MASK(32),
	},
	.num_resources	= ARRAY_SIZE(omap1_camera_resources),
	.resource	= omap1_camera_resources,
};

void __init omap1_camera_init(void *info)
{
	struct platform_device *dev = &omap1_camera_device;
	int ret;

	dev->dev.platform_data = info;

	ret = platform_device_register(dev);
	if (ret)
		dev_err(&dev->dev, "unable to register device: %d\n", ret);
}

/*-------------------------------------------------------------------------*/

static inline void omap_init_sti(void) {}

#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)

static struct platform_device omap_pcm = {
	.name	= "omap-pcm-audio",
	.id	= -1,
};

OMAP_MCBSP_PLATFORM_DEVICE(1);
OMAP_MCBSP_PLATFORM_DEVICE(2);
OMAP_MCBSP_PLATFORM_DEVICE(3);

static void omap_init_audio(void)
{
	platform_device_register(&omap_mcbsp1);
	platform_device_register(&omap_mcbsp2);
	if (!cpu_is_omap7xx())
		platform_device_register(&omap_mcbsp3);
	platform_device_register(&omap_pcm);
}

#else
static inline void omap_init_audio(void) {}
#endif

/*-------------------------------------------------------------------------*/

/*
 * This gets called after board-specific INIT_MACHINE, and initializes most
 * on-chip peripherals accessible on this board (except for few like USB):
 *
 *  (a) Does any "standard config" pin muxing needed.  Board-specific
 *	code will have muxed GPIO pins and done "nonstandard" setup;
 *	that code could live in the boot loader.
 *  (b) Populating board-specific platform_data with the data drivers
 *	rely on to handle wiring variations.
 *  (c) Creating platform devices as meaningful on this board and
 *	with this kernel configuration.
 *
 * Claiming GPIOs, and setting their direction and initial values, is the
 * responsibility of the device drivers.  So is responding to probe().
 *
 * Board-specific knowledge like creating devices or pin setup is to be
 * kept out of drivers as much as possible.  In particular, pin setup
 * may be handled by the boot loader, and drivers should expect it will
 * normally have been done by the time they're probed.
 */
static int __init omap1_init_devices(void)
{
	if (!cpu_class_is_omap1())
		return -ENODEV;

	/* please keep these calls, and their implementations above,
	 * in alphabetical order so they're easier to sort through.
	 */

	omap_init_mbox();
	omap_init_rtc();
	omap_init_spi100k();
	omap_init_sti();
	omap_init_audio();

	return 0;
}
arch_initcall(omap1_init_devices);

#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)

static struct resource wdt_resources[] = {
	{
		.start		= 0xfffeb000,
		.end		= 0xfffeb07F,
		.flags		= IORESOURCE_MEM,
	},
};

static struct platform_device omap_wdt_device = {
	.name	   = "omap_wdt",
	.id	     = -1,
	.num_resources	= ARRAY_SIZE(wdt_resources),
	.resource	= wdt_resources,
};

static int __init omap_init_wdt(void)
{
	if (!cpu_is_omap16xx())
		return -ENODEV;

	return platform_device_register(&omap_wdt_device);
}
subsys_initcall(omap_init_wdt);
#endif


┼───────┤
│ 1 │ Unformatted(File) │ 35    │    │ 1 │ src/cmd_builder.rs       │ true   │ 4     │
├───┼───────────────────┼───────┤    ├───┼──────────────────────────┼────────┼───────┤
│ 2 │ Unformatted(Line) │ 45    │    │ 2 │ src/cmd_parser.rs        │ true   │ 35    │
├───┼───────────────────┼───────┤    ├───┼──────────────────────────┼────────┼───────┤
│ 3 │ Clippy(Warn)      │ 10    │    │ 3 │ src/d2_generator.rs      │ true   │ 5     │
╰───┴───────────────────┴───────╯    ├───┼──────────────────────────┼────────┼───────┤
                                     │ 4 │ src/lib.rs               │ true   │ 39    │
                                     ├───┼──────────────────────────┼────────┼───────┤
                                     │ 5 │ src/main.rs              │ true   │ 2     │
                                     ├───┼──────────────────────────┼────────┼───────┤
                                     │ 6 │ src/mermaid_generator.rs │ true   │ 5     │
                                     ╰───┴──────────────────────────┴────────┴───────╯

// 示例：arceos 的 axnet 统计结果
axnet counts on kind               axnet counts on file (1 outer file: 100%)
╭───┬───────────────┬───────╮      ╭───┬────────────────────────────────┬────────┬───────╮
│   │ kind          │ count │      │   │ file                           │ inside │ count │
├───┼───────────────┼───────┤      ├───┼────────────────────────────────┼────────┼───────┤
│ 1 │ Clippy(Error) │ 4     │      │ 1 │ OUTER/driver_common/src/lib.rs │ false  │ 4     │
╰───┴───────────────┴───────╯      ╰───┴────────────────────────────────┴────────┴───────╯
// 经我检查，是由于其依赖项 arceos 的 driver_common 库 `#[const_trait]` 代码损坏导致的错误
```

3. 代码库来源除了支持来自 github 的 `user/repo`，还支持本地路径 `file://...` 和任何 git repo url。示例：

```yaml
# 本地路径以 file:// 开头，支持绝对路径和相对路径
file:///path/to/os-checker-test-suite:
  all: true
file://repos/arceos:
  all: true

# 任何 git repo url
https://github.com/os-checker/os-checker.git:
  all: true

# 对于 github git repo url，简化成 user/repo
os-checker/os-checker:
  all: true
```

## code diff/stat

diff view: <https://github.com/os-checker/os-checker/compare/7bc4462..main>

```shell
$ git diff --stat 7bc4462 ae2088e
...
28 files changed, 4384 insertions(+), 407 deletions(-)

# 排除测试文件和其他一些文件
$ git diff --stat


 0.2} {
			src := NewMemColumn(typ, BatchSize())
			RandomVec(rng, typ, 8 /* bytesFixedLength */, src, BatchSize(), nullProbability)
			for _, bc := range benchCases {
				bc.args.Src = src
				bc.args.ColType = typ
				bc.args.SrcEndIdx = BatchSize()
				dest := NewMemColumn(typ, BatchSize())
				b.Run(fmt.Sprintf("%s/%s/NullProbability=%.1f", typ, bc.name, nullProbability), func(b *testing.B) {
					b.SetBytes(8 * int64(BatchSize()))
					for i := 0; i < b.N; i++ {
						dest.Copy(bc.args)
						if typ == coltypes.Bytes {
							// We need to reset flat bytes so that we could copy into it
							// (otherwise it'll panic on the second copy due to maxSetIndex
							// being not zero).
							dest.Bytes().Reset()
						}
					}
				})
			}
		}
	}
}
// Copyright 2019 The Cockroach Authors.
// Copyright (c) 2022-present, Shanghai Yunxi Technology Co, Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This software (KWDB) is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.

package coldata

import (
	"os"
	"testing"

	"gitee.com/kwbasedb/kwbase/pkg/util/randutil"
)

func TestMain(m *testing.M) {
	randutil.SeedForTests()
	os.Exit(m.Run())
}
// Copyright 2019 The Cockroach Authors.
// Copyright (c) 2022-present, Shanghai Yunxi Technology Co, Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This software (KWDB) is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.

package colserde

import (
	"encoding/binary"
	"io"

	"gitee.com/kwbasedb/kwbase/pkg/col/colserde/arro


ਿਖਾਉਂਦਾ ਹੈ।

**ਹੱਲ:**

1. ਪਹਿਲਾਂ ਪ੍ਰੀ-ਫਲਾਈਟ ਪਾਸ ਹੋਣ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ (ਸੈਲ 20)।
2. ਸੈਲ 22 ਦੁਬਾਰਾ ਚਲਾਓ - ਮਾਡਲ ਨੂੰ ਪਹਿਲੀ ਬੇਨਤੀ 'ਤੇ ਗਰਮ ਹੋਣ ਦੀ ਲੋੜ ਹੋ ਸਕਦੀ ਹੈ।
3. ਦੋਵੇਂ ਮਾਡਲ ਲੋਡ ਹੋਣ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ: `foundry model ls`

---

## ਸੈਸ਼ਨ 05 ਨਾਲ ਸੰਬੰਧਿਤ ਸਮੱਸਿਆਵਾਂ

### ਏਜੰਟ ਗਲਤ ਮਾਡਲ ਵਰਤ ਰਿਹਾ ਹੈ

**ਸਮੱਸਿਆ:** ਏਜੰਟ ਉਮੀਦ ਕੀਤੇ ਮਾਡਲ ਦੀ ਵਰਤੋਂ ਨਹੀਂ ਕਰ ਰਿਹਾ।

**ਹੱਲ:**

ਕਨਫਿਗਰੇਸ਼ਨ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ:
```python
# Check which models are assigned
print(f"Researcher: {researcher.model_id}")
print(f"Editor: {editor.model_id}")
```

ਜੇ ਮਾਡਲ ਗਲਤ ਹਨ ਤਾਂ ਕਰਨਲ ਰੀਸਟਾਰਟ ਕਰੋ।

---

### ਮੈਮਰੀ ਕਨਟੈਕਸਟ ਓਵਰਫਲੋ

**ਸਮੱਸਿਆ:** ਸਮੇਂ ਦੇ ਨਾਲ ਏਜੰਟ ਦੇ ਜਵਾਬ ਖਰਾਬ ਹੋ ਰਹੇ ਹਨ।

**ਹੱਲ:** ਇਹ ਪਹਿਲਾਂ ਹੀ ਆਟੋਮੈਟਿਕ ਤੌਰ 'ਤੇ ਹੱਲ ਕੀਤਾ ਗਿਆ ਹੈ - ਏਜੰਟ ਮੈਮਰੀ ਵਿੱਚ ਸਿਰਫ਼ ਪਿਛਲੇ 6 ਸੁਨੇਹੇ ਰੱਖਦੇ ਹਨ।

---

## ਸੈਸ਼ਨ 06 ਨਾਲ ਸੰਬੰਧਿਤ ਸਮੱਸਿਆਵਾਂ

### CPU vs GPU ਮਾਡਲ ਦਾ ਗੁੰਝਲ

**ਸਮੱਸਿਆ:** ਡਿਫਾਲਟ ਕਨਫਿਗਰੇਸ਼ਨ ਵਰਤਦੇ ਸਮੇਂ CUDA ਐਰਰ ਆ ਰਹੇ ਹਨ।

**ਹੱਲ


import sys
sys.setrecursionlimit(100000)
input=lambda:sys.stdin.readline().strip()
sint = lambda: int(input())
mint = lambda: map(int, input().split())
lint = lambda: list(map(int, input().split()))
from collections import *
# from heapq import heapify,heappush,heappop
# from bisect import bisect_left,bisect,insort
from math import inf,sqrt,gcd,lcm,pow,ceil,floor,log,log2,log10,pi,sin,cos,tan,asin,acos,atan
import copy
n, m = mint()
grid = []
cnt = defaultdict(int)
for i in range(m):
	a = lint()
	grid.append(a)
for i in range(n):
	for j in range (m):
		cnt[grid[i][j]] += 1
mm = 0
for k, v in cnt.items():
	mm = max(v, mm)
if mm < 3:
	print(0)
grid_copy = copy.deepcopy(grid)#用来记录是否访问过
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
def dfs1(i, j, pre):
	if i < 0 or i >= n or j < 0 or j >= m or grid_copy[i][j] == 0 or grid[i][j] != pre:
		return
	grid_copy[i][j] = 0 #标记为访问过
	ans = 1
	for k in range(4):
		ans += dfs1(i + dx[k], j + dy[k], pre)
	return ans
def check():
	ans = 0
	for i in range(n):
		for j in range(m):
			ans = dfs1(i, j, grid[i][j])
			if ans > 3:
				return True
	return False

def dfs2(i, j):
	if check():
		return
	ans = 0

	ans += dfs1(i, j, grid[i][j])

for i in range(i):
	for j in range(j):


 validMoves sa na planszy
  }
  public isOutOfBoard(e:Square): boolean{
    return (e.row < 8 && e.column < 8) && (e.row >= 0 && e.column >= 0);
  }

}
import { IJsArray, IJsObject } from "../../js/schema";
import { Writer } from "./writer";

interface IStringifier {
    Stringify(js: IJsObject | IJsArray): string;
}

class Stringifier implements IStringifier {
    public Stringify(js: IJsObject | IJsArray): string {
        if (js === undefined) {
            return undefined;
        }

        if (js === null) {
            return "null";
        }

        const w = new Writer();
        js.Accept(w);

        return w.getText();
    }
}

function stringify(js: IJsObject | IJsArray): string {
    const s: IStringifier = new Stringifier();
    return s.Stringify(js);
}

export {
    IStringifier,
    Stringifier,
    stringify,
};
import Engine = Random.Engine;
import MersenneTwisterEngine = Random.MT19937;

class CustomType {}
const customTypeArray = [new CustomType(), new CustomType(), new CustomType()];

// APIs taken from the documentation at https://github.com/ckknight/random-js

// Basic engine types (https://github.com/ckknight/random-js#engines)
let engine: Engine = Random.engines.nativeMath;
engine = Random.engines.browserCrypto;

// All engines can be used to generate numbers
let generated: number = engine();

// Mersenne Twister API (https://github.com/ckknight/random-js#mersenne-twister-api)
let mersenneTwister: MersenneTwisterEngine = Random.engines.mt19937();
generated = mersenneTwister();

mersenneTwister = mersenneTwister.seed(0x9a0b1d43);
mersenneTwister = mersenneTwister.seedWithArray([0x12345678, 0x90abcdef]);
mersenneTwister = mersenneTwister.autoSeed();
mersenneTwister = mersenneTwister.discard(10);
const useCount: number = mersenneTwister.getUseCount();

// Static "Distributions" API (https://github.com/ckknight/random-js#distributions)
let numeric: number = Random.integer(0, 99)(engine);
numeric = Random.real(0, 10)(engine);
numeric = Random.real(0, 10, true)(engine);

let bool: boolean = Random.bool()(engine);
bool = Random.bool(20)(engine);
bool = Random.bool(1, 2)(engine);

let chosen: CustomType = Random.pick(engine, customTypeArray);
chosen = Random.pick(engine, customTypeArray, 0);
chosen = Random.pick(engine, customTypeArray, 0, 2);
chosen = Random.picker(customTypeArray);
chosen = Random.picker(customTypeArray, 0);
chosen = Random.picker(customTypeArray, 0, 2);

let shuffled: CustomType[] = Random.shuffle(engine, customTypeArray);
let sampled: CustomType[] = Random.sample(engine, customTypeArray, 2);

numeric = Random.die(5)(engine);
let dieValues: number[] = Random.dice(5, 2)(engine);

let uuid: string = Random.uuid4(engine);

let str: string = Random.string()(engine);
str = Random.string()(engine);
str = Random.string()(engine, 10);
str = Random.string('abc')(engine);
str = Random.string('abc')(engine, 2);

let hex: string = Random.hex()(engine);
hex = Random.hex()(engine, 5);
hex = Random.hex(false)(engine);
hex = Random.hex(false)(engine, 5);
hex = Random.hex(true)(engine);
hex = Random.hex(true)(engine, 5);

let date: Date = Random.date(new Date(), new Date())(e


: #ffcc66;
}

.hljs-tag .hljs-title,
.hljs-rules .hljs-property,
.django .hljs-tag .hljs-keyword,
.clojure .hljs-title .hljs-built_in {
  font-weight: bold;
}

.hljs-attribute,
.clojure .hljs-title {
  color: #81a2be;
}

.hljs-preprocessor,
.hljs-pragma,
.hljs-pi,
.hljs-shebang,
.hljs-symbol,
.hljs-symbol .hljs-string,
.diff .hljs-change,
.hljs-special,
.hljs-attr_selector,
.hljs-important,
.hljs-subst,
.hljs-cdata {
  color: #f99157;
}

.hljs-deletion {
  color: #dc322f;
}

.tex .hljs-formula {
  background: #eee8d5;
}
a
{
	text-decoration:none;
	padding: 2px 4px 4px 6px;
	display : block;
	border-width: 1px;
	border-style: solid;
	margin : 0px;
}

a.cke_scayt_toogle:hover,
a.cke_scayt_toogle:focus,
a.cke_scayt_toogle:active
{
	border-color: #316ac5;
	background-color: #dff1ff;
	color : #000;
	cursor: pointer;
	margin : 0px;
}
a.cke_scayt_toogle {
	color : #316ac5;
	border-color: #fff;
}
.scayt_enabled a.cke_scayt_item {
	color : #316ac5;
	border-color: #fff;
	margin : 0px;
}
.scayt_disabled a.cke_scayt_item {
	color : gray;
	border-color : #fff;
}
.scayt_enabled a.cke_scayt_item:hover,
.scayt_enabled a.cke_scayt_item:focus,
.scayt_enabled a.cke_scayt_item:active
{
	border-color: #316ac5;
	background-color: #dff1ff;
	color : #000;
	cursor: pointer;
}
.scayt_disabled a.cke_scayt_item:hover,
.scayt_disabled a.cke_scayt_item:focus,
.scayt_disabled a.cke_scayt_item:active
{
	border-color: gray;
	background-color: #dff1ff;
	color : gray;
	cursor: no-drop;
}
.cke_scayt_set_on, .cke_scayt_set_off
{
	display: none;
}
.scayt_enabled .cke_scayt_set_on
{
	display: none;
}
.scayt_disabled .cke_scayt_set_on
{
	display: inline;
}
.scayt_disabled .cke_scayt_set_off
{
	display: none;
}
.scayt_enabled  .cke_scayt_set_off
{
	display: inline;
}
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.cke_balloon.cke_balloontoolbar span:last-child a:last-child::after,
.cke_balloon.cke_balloontoolbar span:last-child a:last-child:hover::after,
.cke_balloon.cke_balloontoolbar span:last-child::after
{
	border-right: 0;
}

.cke_balloon.cke_balloontoolbar .cke_combo
{
	margin-bottom: 0;
	margin-right: 2px;
}

.cke_balloon.cke_balloontoolbar .cke_combo:first-child a.cke_combo_button
{
	margin-left: 0;
}

.cke_balloon.cke_balloontoolbar .cke_combo:la


CoinsToSingleAsset(&p, ctx, tokenOut, tc.tokensIn[0].Denom, osmomath.ZeroDec())
				require.NoError(t, err)
				tokenOut = sdk.NewCoins(sdk.NewCoin(tc.tokensIn[0].Denom, tokenOutAmt))
			}

			// if single asset join, we expect output token swapped into the input denom
			// to be smaller by swap ratio * 2
			var expectedTokenOut sdk.Coins
			if len(tc.tokensIn) == 1 {
				oneMinusSingleSpreadFactor := osmomath.OneDec().Sub((swapRatio.Mul(tc.spreadFactor)))
				expectedAmt := (tc.tokensIn[0].Amount.ToLegacyDec().Mul(oneMinusSingleSpreadFactor)).TruncateInt()
				expectedTokenOut = sdk.NewCoins(sdk.NewCoin(tc.tokensIn[0].Denom, expectedAmt))
			} else {
				expectedTokenOut = tc.tokensIn
			}

			finalPoolLiquidity := p.GetTotalPoolLiquidity(ctx)
			require.True(t, tokenOut.IsAllLTE(expectedTokenOut), "token out %v, expected <= %v", tokenOut, expectedTokenOut)
			require.True(t, finalPoolLiquidity.IsAllGTE(tc.poolAssets))
			require.NoError(t, err)
		})
	}
}

func TestExitPool(t *testing.T) {
	tenPercentOfTwoPoolCoins := sdk.NewCoins(sdk.NewCoin("foo", osmomath.NewInt(int64(1000000000/10))), sdk.NewCoin("bar", osmomath.NewInt(int64(1000000000/10))))
	tenPercentOfThreePoolCoins := sdk.NewCoins(sdk.NewCoin("asset/a", osmomath.NewInt(1000000/10)), sdk.NewCoin("asset/b", osmomath.NewInt(1000000/10)), sdk.NewCoin("asset/c", osmomath.NewInt(1000000/10)))
	tenPercentOfUnevenThreePoolCoins := sdk.NewCoins(sdk.NewCoin("asset/a", osmomath.NewInt(1000000/10)), sdk.NewCoin("asset/b", osmomath.NewInt(2000000/10)), sdk.NewCoin("asset/c", osmomath.NewInt(3000000/10)))
	type testcase struct {
		sharesIn              osmomath.Int
		initialPoolLiquidity  sdk.Coins
		scalingFactors        []uint64
		expectedPoolLiquidity sdk.Coins
		expectedTokenOut      sdk.Coins
		expectPass            bool
	}
	tests := map[string]testcase{
		"basic two-asset pool exit on even pool": {
			sharesIn:              types.InitPoolSharesSupply.Quo(osmomath.NewInt(10)),
			initialPoolLiquidity:  twoEvenStablePoolAssets,
			scalingFactors:        defaultTwoAssetScalingFactors,
			expectedPoolLiquidity: twoEvenStablePoolAssets.Sub(tenPercentOfTwoPoolCoins...),
			expectedTokenOut:      tenPercentOfTwoPoolCoins,
			expectPass:            true,
		},
		"basic three-asset pool exit on even pool": {
			sharesIn:              types.InitPoolSharesSupply.Quo(osmomath.NewInt(10)),
			initialPoolLiquidity:  threeEvenStablePoolAssets,
			scalingFactors:        defaultThreeAssetScalingFactors,
			expectedPoolLiquidity: threeEvenStablePoolAssets.Sub(tenPercentOfThreePoolCoins...),
			expectedTokenOut:      tenPercentOfThreePoolCoins,
			expectPass:            true,
		},
		"basic three-asset pool exit on uneven pool": {
			sharesIn:              types.InitPoolSharesSupply.Quo(osmomath.


param properties  The collection of properties
      @param save        Indicates whether to set the 'save' tag for
                         this property
    */
    void insert(const Properties& properties, bool save);

    /**
      Marks the property with the given MD5 as being removed.

      @param md5  The md5 of the property to remove
    */
    void removeMD5(const std::string& md5);

    /**
      Get the number of properties in the collection.

      @return  The number of properties in the collection
    */
    uInt32 size() const;

    /**
      Prints the contents of the PropertiesSet as a flat file.
    */
    void print() const;

  private:
    struct TreeNode {
      Properties* props;
      TreeNode* left;
      TreeNode* right;
      bool save;
      bool valid;
    };

    /**
      Insert a node in the bst, keeping the tree sorted.

      @param node        The current subroot of the tree
      @param properties  The collection of properties
      @param save        Indicates whether to set the 'save' tag for
                         this property
    */
    void insertNode(TreeNode* &node, const Properties& properties, bool save);

    /**
      Deletes a node from the bst.  Does not preserve bst sorting.

      @param node  The current subroot of the tree
    */
    void deleteNode(TreeNode *node);

    /**
      Save current node properties to the specified output stream

      @param out   The output stream to use
      @param node  The current subroot of the tree
    */
    void saveNode(std::ostream& out, TreeNode* node) const;

    /**
      Prints the current node properties

      @param node  The current subroot of the tree
    */
    void printNode(TreeNode* node) const;

  private:
    // The parent system for this object
    OSystem* myOSystem;

    // The root of the BST
    TreeNode* myRoot;

    // The size of the properties bst (i.e. the number of properties in it)
    uInt32 mySize;
};

} // namespace ale

#endif
//============================================================================
//
//   SSSS    tt          lll  lll
//  SS  SS   tt           ll   ll
//  SS     tttttt  eeee   ll   ll   aaaa
//   SSSS    tt   ee  ee  ll   ll      aa
//      SS   tt   eeeeee  ll   ll   aaaaa  --  "An Atari 2600 VCS Emulator"
//  SS  SS   tt   ee      ll   ll  aa  aa
//   SSSS     ttt  eeeee llll llll  aaaaa
//
// Copyright (c) 1995-2007 by Bradford W. Mott and the Stella team
//
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Event.cxx,v 1.11 2007/01/01 18:04:47 stephena Exp $
//============================================================================

#include "Event.hxx"
#include "EventStreamer.hxx"

using namespace ale;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event::Event(EventStreamer* ev)
  : myNumberOfTypes(Event::LastType)
//ALE     myEventStreamer(ev)
{
  // Set all of the events to 0 / false to start with,
  // including


     if field_val is None or field_val == "":
                    field_val = "-"
                elif isinstance(field_val, str):
                    field_val = field_val.strip()
                else:
                    field_val = str(field_val)
                field_vals.append(field_val)
        table.add_row(*field_vals)

    footers = []
    # 打印分页信息
    if paging_result:
        is_last_page = paging_result.page_no == paging_result.total_page
        table.__setattr__(
            "__paging_info__",
            f"当前第{paging_result.page_no}页, 共{paging_result.total_page}页, "
            f"每页{paging_result.page_size}条."
            f'{" [已经是最后一页]" if is_last_page else ""}',
        )
    if footer:
        footers.append(footer)

    table.__setattr__("__t_footer__", footers)

    return table


xelsPerUnit = chunk.getInt4(0);
        int yPixelsPerUnit = chunk.getInt4(4);
        int unitSpecifier = chunk.getInt1(8);

        if (encodeParam != null) {
            encodeParam.setPhysicalDimension(xPixelsPerUnit,
                                             yPixelsPerUnit,
                                             unitSpecifier);
        }
        if (emitProperties) {
            properties.put("x_pixels_per_unit", new Integer(xPixelsPerUnit));
            properties.put("y_pixels_per_unit", new Integer(yPixelsPerUnit));
            properties.put("pixel_aspect_ratio",
                           new Float((float)xPixelsPerUnit/yPixelsPerUnit));
            if (unitSpecifier == 1) {
                properties.put("pixel_units", "Meters");
            } else if (unitSpecifier != 0) {
                // Error -- unit specifier must be 0 or 1
                throw new RuntimeException(JaiI18N.getString("PNGImageDecoder12"));
            }
        }
    }

    private void parse_sBIT_chunk(PNGChunk chunk) {
        if (colorType == PNG_COLOR_PALETTE) {
            significantBits = new int[3];
        } else {
            significantBits = new int[inputBands];
        }
        for (int i = 0; i < significantBits.length; i++) {
            int bits = (int)chunk.getByte(i);
            int depth = (colorType == PNG_COLOR_PALETTE) ? 8 : bitDepth;
            if (bits <= 0 || bits > depth) {
                // Error -- significant bits must be between 0 and
                // image bit depth.
                throw new RuntimeException(JaiI18N.getString("PNGImageDecoder13"));
            }
            significantBits[i] = bits;
        }

        if (encodeParam != null) {
            encodeParam.setSignificantBits(significantBits);
        }
        if (emitProperties) {
            properties.put("significant_bits", significantBits);
        }
    }

    private void parse_sRGB_chunk(PNGChunk chunk) {
        sRGBRenderingIntent = chunk.getByte(0);

        // The presence of an sRGB chunk implies particular
        // settings for gamma and chroma.
        fileGamma = 45455/100000.0F;

        chromaticity = new float[8];
        chromaticity[0] = 31270/10000.0F;
        chromaticity[1] = 32900/10000.0F;
        chromaticity[2] = 64000/10000.0F;
        chromaticity[3] = 33000/10000.0F;
        chromaticity[4] = 30000/10000.0F;
        chromaticity[5] = 60000/10000.0F;
        chromaticity[6] = 15000/10000.0F;
        chromaticity[7] =  6000/10000.0F;

        if (performGammaCorrection) {
            // File gamma is 1/2.2
            float gamma = fileGamma*(displayExponent/userExponent);
            if (encodeParam != null) {
                encodeParam.setGamma(gamma);
                encodeParam.setChromaticity(chromaticity);
            }
            if (emitProperties) {
                properties.put("gamma", new Float(gamma));
                properties.put("white_point_x", new Float(chromaticity[0]));
                properties.put("white_point_y", new Float(chromaticity[1]));
                properties.put("red_x", new Float(chromaticity[2]));
                properties.put("red_y", new Float(chromaticity[3]));
                properties.put("green_x", new Float(chromaticity[4]));
                properties.put("green_y", new Float(chromaticity[5]));
                properties.put("blue_x", new Float(chromaticity[6]));
                properties.put("blue_y", new Float(chromaticity


"code":    code,
			"message": "dots or key param is empty",
		})
		_, _ = fmt.Fprintf(w, string(bt))
		return
	}

	cacheDataByte := cache.ReadCache(key)
	if len(cacheDataByte) == 0 {
		bt, _ := json.Marshal(map[string]interface{}{
			"code":    code,
			"message": "illegal key",
		})
		_, _ = fmt.Fprintf(w, string(bt))
		return
	}
	src := strings.Split(dots, ",")

	var dct map[int]*click.Dot
	if err := json.Unmarshal(cacheDataByte, &dct); err != nil {
		bt, _ := json.Marshal(map[string]interface{}{
			"code":    code,
			"message": "illegal key",
		})
		_, _ = fmt.Fprintf(w, string(bt))
		return
	}

	chkRet := false
	if (len(dct) * 2) == len(src) {
		for i := 0; i < len(dct); i++ {
			dot := dct[i]
			j := i * 2
			k := i*2 + 1
			sx, _ := strconv.Atoi(src[j])
			sy, _ := strconv.Atoi(src[k])

			chkRet = click.Validate(sx, sy, dot.X, dot.Y, dot.Width, dot.Height, 5)
			if !chkRet {
				break
			}
		}
	}

	if chkRet {
		code = 0
		cache.SetCacheOk(key, true)
	}

	bt, _ := json.Marshal(map[string]interface{}{
		"code": code,
	})
	_, _ = fmt.Fprintf(w, string(bt))
	return
}
package captdata

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"project/src/services/go-captcha/internal/cache"
	"project/src/services/go-captcha/internal/helper"

	"github.com/wenlng/go-captcha-assets/resources/imagesv2"
	"github.com/wenlng/go-captcha-assets/resources/shapes"

	"github.com/wenlng/go-captcha/v2/base/option"
	"github.com/wenlng/go-captcha/v2/click"
)

var shapeCapt click.Captcha

func init() {
	builder := click.NewBuilder(
		click.WithRangeLen(option.RangeVal{Min: 3, Max: 6}),
		click.WithRangeVerifyLen(option.RangeVal{Min: 2, Max: 3}),
		click.WithRangeThumbBgDistort(1),
		click.WithIsThumbNonDeformAbility(true),
	)

	// shape
	// click.WithUseShapeOriginalColor(false) -> Random rewriting of graphic colors
	shapeMaps, err := shapes.GetShapes()
	if err != nil {
		log.Fatalln(err)
	}

	// background images
	imgs, err := imagesv2.GetImages()
	if err != nil {
		log.Fatalln(err)
	}

	// set resources
	builder.SetResources(
		click.WithShapes(shapeMaps),
		click.WithBackgrounds(imgs),
	)

	shapeCapt = builder.MakeShape()
}

// GetClickShapesCaptData .
func GetClickShapesCaptData(w http.ResponseWriter, r *http.Request) {
	captData, err := shapeCapt.Generate()
	if err != nil {
		log.Fatalln(err)
	}

	dotData := captData.GetData()
	if dotData == nil {
		bt, _ := json.Marshal(map[string]interface{}{
			"code":    1,
			"message": "gen captcha data failed",
		})
		_, _ = fmt.Fprintf(w, string(bt))
		return
	}

	var masterImageBase64, thumbImageBase64 string
	masterImageBase64, err = captData.GetMasterImage().ToBase64()
	if err != nil {
		bt, _ := json.Marshal(map[string


)
{
	walk_memory_blocks_func_t func;

	if (context == MEMINIT_HOTPLUG)
		func = register_mem_block_under_node_hotplug;
	else
		func = register_mem_block_under_node_early;

	walk_memory_blocks(PFN_PHYS(start_pfn), PFN_PHYS(end_pfn - start_pfn),
			   (void *)&nid, func);
	return;
}
#endif /* CONFIG_MEMORY_HOTPLUG */

int __register_one_node(int nid)
{
	int error;
	int cpu;

	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
	if (!node_devices[nid])
		return -ENOMEM;

	error = register_node(node_devices[nid], nid);

	/* link cpu under this node */
	for_each_present_cpu(cpu) {
		if (cpu_to_node(cpu) == nid)
			register_cpu_under_node(cpu, nid);
	}

	INIT_LIST_HEAD(&node_devices[nid]->access_list);
	node_init_caches(nid);

	return error;
}

void unregister_one_node(int nid)
{
	if (!node_devices[nid])
		return;

	unregister_node(node_devices[nid]);
	node_devices[nid] = NULL;
}

/*
 * node states attributes
 */

struct node_attr {
	struct device_attribute attr;
	enum node_states state;
};

static ssize_t show_node_state(struct device *dev,
			       struct device_attribute *attr, char *buf)
{
	struct node_attr *na = container_of(attr, struct node_attr, attr);

	return sysfs_emit(buf, "%*pbl\n",
			  nodemask_pr_args(&node_states[na->state]));
}

#define _NODE_ATTR(name, state) \
	{ __ATTR(name, 0444, show_node_state, NULL), state }

static struct node_attr node_state_attr[] = {
	[N_POSSIBLE] = _NODE_ATTR(possible, N_POSSIBLE),
	[N_ONLINE] = _NODE_ATTR(online, N_ONLINE),
	[N_NORMAL_MEMORY] = _NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY),
#ifdef CONFIG_HIGHMEM
	[N_HIGH_MEMORY] = _NODE_ATTR(has_high_memory, N_HIGH_MEMORY),
#endif
	[N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY),
	[N_CPU] = _NODE_ATTR(has_cpu, N_CPU),
	[N_GENERIC_INITIATOR] = _NODE_ATTR(has_generic_initiator,
					   N_GENERIC_INITIATOR),
};

static struct attribute *node_state_attrs[] = {
	&node_state_attr[N_POSSIBLE].attr.attr,
	&node_state_attr[N_ONLINE].attr.attr,
	&node_state_attr[N_NORMAL_MEMORY].attr.attr,
#ifdef CONFIG_HIGHMEM
	&node_state_attr[N_HIGH_MEMORY].attr.attr,
#endif
	&node_state_attr[N_MEMORY].attr.attr,
	&node_state_attr[N_CPU].attr.attr,
	&node_state_attr[N_GENERIC_INITIATOR].attr.attr,
	NULL
};

static const struct attribute_group memory_root_attr_group = {
	.attrs = node_state_attrs,
};

static const struct attribute_group *cpu_root_attr_groups[] = {
	&memory_root_attr_group,
	NULL,
};

void __init node_dev_init(void)
{
	int ret, i;

 	BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES);
 	BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES);

	ret = subsys_system_register(&node_subsys, cpu_root_attr_groups);
	if (ret)
		panic("%s() failed to register subsystem: %d\n", __func__, ret);

	/*
	 * Create all node devices, which will properly link the node
	 * to applicable memory block devices and already created cpu devices.
	 */
	for_each_online_node(i) {
		ret = register_one_node(i);
		if (ret)
			panic("%s() failed to add node: %d\n", __func__, ret);
	}
}


 byte ptr [rsi + rax + 31], 14
	mov	rax, qword ptr [rsp + 320]      # 8-byte Reload
	vpinsrb	xmm1, xmm1, byte ptr [rsi + rax + 30], 15
	vpinsrb	xmm7, xmm7, byte ptr [rsi + rax + 31], 15
	vinserti128	ymm0, ymm1, xmm0, 1
	vmovdqa	ymmword ptr [rsp + 288], ymm0   # 32-byte Spill
	vinserti128	ymm0, ymm7, xmm2, 1
	vmovdqa	ymmword ptr [rsp + 320], ymm0   # 32-byte Spill
	vmovdqa	ymm2, ymmword ptr [rsp + 512]   # 32-byte Reload
	vpcmpeqb	ymm0, ymm13, ymm2
	vpcmpeqb	ymm7, ymm2, ymmword ptr [rsp + 1216] # 32-byte Folded Reload
	vmovdqa	ymm5, ymmword ptr [rip + .LCPI4_0] # ymm5 = [2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
	vpandn	ymm7, ymm7, ymm5
	vpaddb	ymm0, ymm7, ymm0
	vpcmpeqb	ymm7, ymm2, ymmword ptr [rsp + 480] # 32-byte Folded Reload
	vmovdqa	ymm6, ymmword ptr [rip + .LCPI4_1] # ymm6 = [4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]
	vpandn	ymm7, ymm7, ymm6
	vpcmpeqb	ymm12, ymm2, ymmword ptr [rsp + 448] # 32-byte Folded Reload
	vmovdqa	ymm3, ymmword ptr [rip + .LCPI4_2] # ymm3 = [8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]
	vpandn	ymm12, ymm12, ymm3
	vpor	ymm7, ymm12, ymm7
	vpcmpeqb	ymm12, ymm14, ymm2
	vmovdqa	ymm8, ymmword ptr [rip + .LCPI4_3] # ymm8 = [16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]
	vpandn	ymm12, ymm12, ymm8
	vpor	ymm7, ymm12, ymm7
	vpcmpeqd	ymm1, ymm1, ymm1
	vpsubb	ymm0, ymm0, ymm1
	vpcmpeqd	ymm4, ymm4, ymm4
	vpor	ymm0, ymm0, ymm7
	vpcmpeqb	ymm7, ymm15, ymm2
	vmovdqa	ymm1, ymmword ptr [rip + .LCPI4_4] # ymm1 = [32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]
	vpandn	ymm7, ymm7, ymm1
	vpcmpeqb	ymm12, ymm2, ymmword ptr [rsp + 416] # 32-byte Folded Reload
	vmovdqa	ymm13, ymmword ptr [rip + .LCPI4_5] # ymm13 = [64,64,64,64,64


import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
import torch.optim as optim

def call_bn(bn, x):
    return bn(x)

class CNN(nn.Module):
    def __init__(self, input_channel=3, n_outputs=10, dropout_rate=0.25, momentum=0.1):
        self.dropout_rate = dropout_rate
        self.momentum = momentum
        super(CNN, self).__init__()
        self.c1=nn.Conv2d(input_channel, 64,kernel_size=3,stride=1, padding=1)
        self.c2=nn.Conv2d(64,64,kernel_size=3,stride=1, padding=1)
        self.c3=nn.Conv2d(64,128,kernel_size=3,stride=1, padding=1)
        self.c4=nn.Conv2d(128,128,kernel_size=3,stride=1, padding=1)
        self.c5=nn.Conv2d(128,196,kernel_size=3,stride=1, padding=1)
        self.c6=nn.Conv2d(196,16,kernel_size=3,stride=1, padding=1)
        self.linear1=nn.Linear(256, n_outputs)
        self.bn1=nn.BatchNorm2d(64, momentum=self.momentum)
        self.bn2=nn.BatchNorm2d(64, momentum=self.momentum)
        self.bn3=nn.BatchNorm2d(128, momentum=self.momentum)
        self.bn4=nn.BatchNorm2d(128, momentum=self.momentum)
        self.bn5=nn.BatchNorm2d(196, momentum=self.momentum)
        self.bn6=nn.BatchNorm2d(16, momentum=self.momentum)

    def forward(self, x,):
        h=x
        h=self.c1(h)
        h=F.relu(call_bn(self.bn1, h))
        h=self.c2(h)
        h=F.relu(call_bn(self.bn2, h))
        h=F.max_pool2d(h, kernel_size=2, stride=2)

        h=self.c3(h)
        h=F.relu(call_bn(self.bn3, h))
        h=self.c4(h)
        h=F.relu(call_bn(self.bn4, h))
        h=F.max_pool2d(h, kernel_size=2, stride=2)

        h=self.c5(h)
        h=F.relu(call_bn(self.bn5, h))
        h=self.c6(h)
        h=F.relu(call_bn(self.bn6, h))
        h=F.max_pool2d(h, kernel_size=2, stride=2)

        h = h.view(h.size(0), -1)
        logit=self.linear1(h)
        return logit

class MLPNet(nn.Module):
    def __init__(self):
        super(MLPNet, self).__init__()
        self.fc1 = nn.Linear(28 * 28, 256)
        self.fc2 = nn.Linear(256, 10)

    def forward(self, x):
        x = x.view(-1, 28 * 28)
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x


6 00 64 */	lhz r0, 0x64(r6)
/* 800A5988 000A15E8  B0 04 60 BC */	sth r0, 0x60bc(r4)
/* 800A598C 000A15EC  A0 06 00 66 */	lhz r0, 0x66(r6)
/* 800A5990 000A15F0  B0 04 60 BE */	sth r0, 0x60be(r4)
/* 800A5994 000A15F4  A0 06 00 68 */	lhz r0, 0x68(r6)
/* 800A5998 000A15F8  B0 04 60 C0 */	sth r0, 0x60c0(r4)
/* 800A599C 000A15FC  A0 06 00 6A */	lhz r0, 0x6a(r6)
/* 800A59A0 000A1600  B0 04 60 C2 */	sth r0, 0x60c2(r4)
/* 800A59A4 000A1604  A0 06 00 6C */	lhz r0, 0x6c(r6)
/* 800A59A8 000A1608  B0 04 60 C4 */	sth r0, 0x60c4(r4)
/* 800A59AC 000A160C  80 0D 82 38 */	lwz r0, lbl_8063D4F8-_SDA_BASE_(r13)
/* 800A59B0 000A1610  7C 80 3A 14 */	add r4, r0, r7
/* 800A59B4 000A1614  38 84 00 B4 */	addi r4, r4, 0xb4
/* 800A59B8 000A1618  4B F5 E6 49 */	bl memcpy
/* 800A59BC 000A161C  3B DE 00 01 */	addi r30, r30, 1
/* 800A59C0 000A1620  28 1E 00 03 */	cmplwi r30, 3
/* 800A59C4 000A1624  41 80 FF 88 */	blt lbl_800A594C
/* 800A59C8 000A1628  80 6D 82 38 */	lwz r3, lbl_8063D4F8-_SDA_BASE_(r13)
/* 800A59CC 000A162C  38 00 00 41 */	li r0, 0x41
/* 800A59D0 000A1630  B0 03 00 FC */	sth r0, 0xfc(r3)
/* 800A59D4 000A1634  48 00 0F 54 */	b lbl_800A6928
lbl_800A59D8:
/* 800A59D8 000A1638  80 6D 82 38 */	lwz r3, lbl_8063D4F8-_SDA_BASE_(r13)
/* 800A59DC 000A163C  38 80 00 08 */	li r4, 8
/* 800A59E0 000A1640  38 A0 00 01 */	li r5, 1
/* 800A59E4 000A1644  A8 63 00 5C */	lha r3, 0x5c(r3)
/* 800A59E8 000A1648  48 1A E4 09 */	bl func_80253DF0
/* 800A59EC 000A164C  80 6D 82 38 */	lwz r3, lbl_8063D4F8-_SDA_BASE_(r13)
/* 800A59F0 000A1650  38 80 00 08 */	li r4, 8
/* 800A59F4 000A1654  38 A0 00 01 */	li r5, 1
/* 800A59F8 000A1658  A8 63 00 5E */	lha r3, 0x5e(r3)
/* 800A59FC 000A165C  48 1A E3 F5 */	bl func_80253DF0
/* 800A5A00 000A1660  80 6D 82 38 */	lwz r3, lbl_8063D4F8-_SDA_BASE_(r13)
/* 800A5A04 000A1664  38


);
		VectorAdd( ent->s.origin, ent->r.maxs, ent->r.absmax );
	}

	// because movement is clipped an epsilon away from an actual edge,
	// we must fully check even when bounding boxes don't quite touch
	ent->r.absmin[0] -= 1;
	ent->r.absmin[1] -= 1;
	ent->r.absmin[2] -= 1;
	ent->r.absmax[0] += 1;
	ent->r.absmax[1] += 1;
	ent->r.absmax[2] += 1;

	// link to PVS leafs
	ent->r.num_clusters = 0;
	ent->r.areanum = ent->r.areanum2 = -1;

	// get all leafs, including solids
	num_leafs = trap_CM_BoxLeafnums( ent->r.absmin, ent->r.absmax,
									 leafs, MAX_TOTAL_ENT_LEAFS, &topnode );

	// set areas
	for( i = 0; i < num_leafs; i++ ) {
		clusters[i] = trap_CM_LeafCluster( leafs[i] );
		area = trap_CM_LeafArea( leafs[i] );
		if( area > -1 ) {
			// doors may legally straggle two areas,
			// but nothing should ever need more than that
			if( ent->r.areanum > -1 && ent->r.areanum != area ) {
				if( ent->r.areanum2 > -1 && ent->r.areanum2 != area ) {
					if( developer->integer ) {
						G_Printf( "Object %s touching 3 areas at %f %f %f\n",
								  ( ent->classname ? ent->classname : "" ),
								  ent->r.absmin[0], ent->r.absmin[1], ent->r.absmin[2] );
					}
				}
				ent->r.areanum2 = area;
			} else {
				ent->r.areanum = area;
			}
		}
	}

	if( num_leafs >= MAX_TOTAL_ENT_LEAFS ) {
		// assume we missed some leafs, and mark by headnode
		ent->r.num_clusters = -1;
		ent->r.headnode = topnode;
	} else {
		ent->r.num_clusters = 0;
		for( i = 0; i < num_leafs; i++ ) {
			if( clusters[i] == -1 ) {
				continue; // not a visible leaf
			}
			for( j = 0; j < i; j++ )
				if( clusters[j] == clusters[i] ) {
					break;
				}
			if( j == i ) {
				if( ent->r.num_clusters == MAX_ENT_CLUSTERS ) {
					// assume we missed some leafs, and mark by headnode
					ent->r.num_clusters = -1;
					ent->r.headnode = topnode;
					break;
				}
				ent->r.clusternums[ent->r.num_clusters] = clusters[i];
				ent->r.num_clusters++;
			}
		}
	}

	// if first time, make sure old_origin is valid
	if( !ent->linkcount ) {
		ent->olds = ent->s;
	}
	ent->linkcount++;
	ent->linked = true;

	GClip_LinkEntity_AreaGrid( &g_areagrid, ent );
}

/*
* GClip_SetAreaPortalState
*
* Finds an areaportal leaf entity is connected with,
* and also finds two leafs from different areas connected
* with the same entity.
*/
void GClip_SetAreaPortalState( edict_t *ent, bool open ) {
	// entity must touch at least two areas
	if( ent->r.areanum < 0 || ent->r.areanum2 < 0 ) {
		return;
	}

	// change


allMatches(raw)
      .map((e) {
        final valueStr = e.group(1) ?? '0';
        final value = double.tryParse(valueStr);
        if (value == null) {
          dprint('Warning: Failed to parse CPU percentage from "$valueStr"');
          return 0.0;
        }
        return value;
      })
      .toList();

  if (percents.length >= 3) {
    // Validate that percentages are reasonable (0-100 range)
    final validPercents = percents.where((p) => p >= 0 && p <= 100).toList();
    if (validPercents.length != percents.length) {
      Loggers.app.warning('BSD CPU fallback parsing found invalid percentages in: $raw');
    }

    init.add([
      SingleCpuCore(
        'cpu0',
        percents[0].toInt(), // user
        percents.length > 1 ? percents[1].toInt() : 0, // sys
        0, // nice
        percents.length > 2 ? percents[2].toInt() : 0, // idle
        0, // iowait
        0, // irq
        0, // softirq
      ),
    ]);
    return init;
  } else if (percents.isNotEmpty) {
    Loggers.app.warning(
      'BSD CPU fallback parsing found ${percents.length} percentages (expected at least 3) in: $raw',
    );
  } else {
    Loggers.app.warning('BSD CPU fallback parsing found no percentages in: $raw');
  }

  return init;
}
class Temperatures {
  final Map<String, double> _map = {};

  void parse(String type, String value) {
    final typeSplited = type.split('\n');
    final valueSplited = value.split('\n');
    for (var i = 0; i < typeSplited.length && i < valueSplited.length; i++) {
      final t = typeSplited[i];
      final v = valueSplited[i];
      if (t.isEmpty || v.isEmpty) {
        continue;
      }
      final name = t.split('/').last;
      final temp = double.tryParse(v);
      if (temp == null) {
        continue;
      }
      _map[name] = temp / 1000;
    }
  }

  double? get(String name) {
    return _map[name];
  }

  Iterable<String> get devices {
    return _map.keys;
  }

  bool get isEmpty {
    return _map.isEmpty;
  }

  double? get first {
    if (_map.isEmpty) {
      return null;
    }
    for (final key in _cpuTemp) {
      if (_map.containsKey(key)) {
        return _map[key];
      }
    }
    return _map.values.firstOrNull;
  }
}

/// soc: mobile phone
/// cpu_thermal / x86_pkg_temp / coretemp / zenpower: x86
const _cpuTemp = ['x86_pkg_temp', 'coretemp', 'zenpower', 'cpu_thermal', 'soc'];
import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/material.dart';
import 'package:hive_ce_flutter/adapters.dart';
import 'package:icons_plus/icons_plus.dart';
import 'package:server_box/core/extension/context/locale.dart';
import 'package:server_box/view/page/server/tab/tab.dart';
// import 'package:server_box/view/page/setting/entry.dart';
import 'package:server_box/view/page/snippet/list.dart';
import 'package:server_box/view/page/ssh/tab.dart';
import 'package:server_box/view/page/storage/local.dart';

part 'tab.g.dart';

@HiveType(typeId: 103)
enum AppTab {
  @HiveField(0)
  server,
  @HiveField(1)
  ssh,
  @HiveField(2)
  file,
  @HiveField(3)
  snippet
  //settings,
  ;

  Widget get page {
    return switch (this) {
      server =>


题以及面试后的感受和反思。                                                                                |
| 科技趋势预测                      | 针对当前科技领域的发展趋势，你认为未来哪些行业将得到颠覆性的变革？                                                                                |
| 食品安全问题                      | 近年来食品安全问题频发，请介绍几种常见的食品添加剂及其对人体的危害，以及如何防范食品中毒的方法。                                                                                |
| 职场沟通技巧                      | 在职场中，有效的沟通技巧是非常重要的，请分享你在工作中的沟通技巧，包括与同事、上司和下属之间的沟通方式以及如何处理冲突和负面情绪。                                                                               |
|天气查询|请问今天的天气如何？|
|餐馆推荐|能否给我推荐一家适合约会的餐馆？|
|健身建议|我想增肌，请问有哪些适合初学者的健身建议？|
|烹饪技巧|如何做出口感松软、味道美味的面包？|
|旅游攻略|如果明年去日本旅游，有哪些值得推荐的景点或活动？|
|投资建议|基于当前市场情况，您认为现在是买入股票的好时机吗？|
|求职建议|我正在寻找新的工作机会，您有什么求职建议可以给我吗？|
|文学创作|如何创作一个引人入胜的故事情节？|
|音乐制作|我想自己做一首电子音乐，您有哪些制作建议可以分享吗？|
|健康饮食|为了保持健康，应该避免哪些食物？|
| 美食推荐 | 你能不能给我推荐一些口感清爽、适合夏天吃的菜式？ |
| 旅游攻略 | 如果我打算在下个月去日本旅游，你有什么建议和注意事项吗？ |
| 文化知识 | 印度教和佛教有哪些不同之处？ |
| 时事新闻 | 最近发生了什么值得关注的科技事件？ |
| 学习方法 | 怎样才能提高英语口语水平？ |
| 娱乐八卦 | 最近有哪些明星因为绯闻或丑闻被大众关注了？ |
| 职场技能 | 在工作中，如何更好地与同事沟通合作？ |
| 健康养生 | 如何应对长时间使用电子设备对眼睛造成的伤害？ |
| 科学探究 | 什么是黑洞？它是如何形成的？ |
| 社会热点 | 近年来，你觉得社交媒体对人们的生活产生了哪些影响？ |
| 自然语言处理 | 如何使用自然语言处理技术对文本进行情感分析？ |
| 神经网络 | 什么是卷积神经网络？它们在计算机视觉中有什么应用？ |
| 机器学习 | 在分类问题中，如何使用支持向量机算法获得最佳决策边界？ |
| 数据挖掘 | 如何使用关联规则挖掘算法从大型数据集中发现频繁项集？ |
| 图像处理 | 如何使用霍夫变换算法从图像中检测出直线和圆形？ |
| 智能推荐 | 如何使用协同过滤算法为用户推荐商品或服务？ |
| 自动驾驶 | 无人驾驶汽车中的激光


_ACCESS|flag,&hKey)==ERROR_SUCCESS)
            {
                RegDeleteValue(hKey,(LPCTSTR)_T("Description"));
                RegDeleteValue(hKey,(LPCTSTR)_T("CLSID"));

                RegCloseKey(hKey);
            }
            else
            {
                debug("!! kxsetup: ASIO registry could not be written, need to re-launch with elevated priveleges\n");
                return -1;
            }

            debug("kxsetup: ASIO driver %d set to (none)\n",i);
        }
        else
            debug("kxsetup: ASIO driver %d unchanged (none)\n",i);

#if defined(_WIN64)
        if(flag==0)
        {
             flag=KEY_WOW64_32KEY;
             goto AGAIN;
        }
#endif
  }
 } // for

 return 0;
}


19.9872 8.00746 19.0785 10.3799 17.3514C8.98357 16.1421 7.7873 14.9348 6.6413 13.6078C5.92053 14.593 5.31133 15.56 4.85695 16.4688C3.79539 18.5909 3.9502 19.5881 4.18041 19.8183ZM19.1941 19.9872C19.4021 19.9872 19.6796 19.9581 19.8193 19.8183C20.0495 19.5881 20.2044 18.5919 19.1428 16.4688C18.6884 15.559 18.0792 14.592 17.3584 13.6078C16.2114 14.9358 15.0152 16.1431 13.6199 17.3514C15.9933 19.0785 18.0471 19.9872 19.1941 19.9872ZM14.0109 11.9984C14.0109 13.1088 13.1108 14.0089 12.0004 14.0089C10.89 14.0089 9.98984 13.1088 9.98984 11.9984C9.98984 10.888 10.89 9.98784 12.0004 9.98784C13.1108 9.98784 14.0109 10.888 14.0109 11.9984Z"]{d:path(var(--science))}[d="M16.781 2.27293L14.081 5.7126H9.919L7.219 2.27293L8.781 1L12 5.10008L15.219 1L16.781 2.27293ZM4 6.73175H20C21.1 6.73175 22 7.649 22 8.77007V18.9617C22 20.0828 21.1 21 20 21H4C2.9 21 2 20.0828 2 18.9617V8.77007C2 7.649 2.9 6.73175 4 6.73175ZM4 18.9617H16V8.77007H4V18.9617ZM18 16.4138C18 16.9764 18.448 17.4329 19 17.4329C19.552 17.4329 20 16.9764 20 16.4138C20 15.8512 19.552 15.3946 19 15.3946C18.448 15.3946 18 15.8512 18 16.4138ZM18 11.318C18 11.8806 18.448 12.3371 19 12.3371C19.552 12.3371 20 11.8806 20 11.318C20 10.7554 19.552 10.2988 19 10.2988C18.448 10.2988 18 10.7554 18 11.318Z"]{d:path(var(--entertainment))}[d="M12.5 22C11.1193 22 10 20.8807 10 19.5C10 18.1193 11.1193 17 12.5 17C13.8807 17 15 18.1193 15 19.5C15 20.8807 13.8807 22 12.5 22Z"]{d:path(var(--school-hub))}[d="M16.293 9.293L17.707 10.707L12 16.414L6.29297 10.707L7.70697 9.293L11 12.586V2H13V12.586L16.293 9.293ZM18 20V18H20V20C20 21.102 19.104 22 18 22H6C4.896 22 4 21.102 4 20V18H6V20H18Z"]{d:path(var(--download))}[d="M5,14H3v5a2,2,0,0,0,2,2h5V19H5Z"]{d:path(var(--maximize));transform-origin:center;transform:scale(0.95)}[d="M19,3H14V5h5v5h2V5A2,2,0,0,0,19,3Z"],[d="M19,19H14v2h5a2,2,0,0,0,2-2V14H19Z"],[d="M3,5v5H5V


rer that
            // draws ink as it "flows" from the stylus.
            dr = new DynamicRenderer();
            ip.AttachVisuals(dr.RootVisual, dr.DrawingAttributes);
            this.StylusPlugIns.Add(dr);
        }
        //</Snippet18>
    //<Snippet15>
    }
    //</Snippet15>
}

namespace snippets2
{
    class InkControl : Label
    {
        //<Snippet16>
        InkPresenter ip;

        public InkControl()
        {
            // Add an InkPresenter for drawing.
            ip = new InkPresenter();
            this.Content = ip;
        }
        //</Snippet16>
    }
}


* \brief Initialize mach_reg structs and reg array. This is done for each
 *  function (subprogram)
 */
void
mr_init()
{
  int i;

  aux.curr_entry->first_dr = reg[RATA_IR].mach_reg->first_global;
  aux.curr_entry->first_sp = reg[RATA_SP].mach_reg->first_global;
  aux.curr_entry->first_dp = reg[RATA_DP].mach_reg->first_global;
  aux.curr_entry->first_ar = reg[RATA_AR].mach_reg->first_global;

  for (i = 0; i < MR_UNIQ; i++) {
    mach_reg[i].next_global = mach_reg[i].first_global;
    mach_reg[i].nused = 0;
  }

  for (i = 0; i <= RATA_RTYPES_ACTIVE; i++) {
    reg[i].nused = 0;
    reg[i].rcand = 0;
  }

  /* for pic code, we need to reserve %ebx -- treat it like it
   * has already been assigned. Since it is register #1, this
   * is not too difficult.
   */
  if (XBIT(62, 8)) {
    mach_reg[0].next_global++;
    mach_reg[0].nused = 1;
    reg[RATA_IR].nused = 1;
    reg[RATA_AR].nused = 1;
  }

}

#ifdef FLANG_MACHREG_UNUSED
static int
mr_isxmm(int rtype)
{
#if DEBUG
  assert((rtype == RATA_SP || rtype == RATA_DP || rtype == RATA_CSP ||
          rtype == RATA_CDP),
         "mr_isxmm bad rtype", rtype, ERR_Severe);
#endif
  return (reg[rtype].mach_reg->Class == 'x');
}
#endif

void
mr_reset_numglobals(int reduce_by)
{
  mach_reg[0].last_global = mach_reg[0].end_global - reduce_by;
}

void
mr_reset_frglobals()
{
  /* effectively turn off fp global regs. */
  mach_reg[1].last_global = mach_reg[1].first_global - 1;
  mach_reg[2].last_global = mach_reg[2].first_global - 1;
}

/** \brief get a global register for a given register type (RATA_IR, etc.).
 *  NOTE that the global registers are allocated in increasing order.
 *  next_global locates the next available global register.  The range
 *  of global register values is from first_global to last_global,
 *  inclusive.
 */
int
mr_getreg(int rtype)
{
  int rg;

  rg = _mr_getreg(rtype);

  return rg;
}

static int
_mr_getreg(int rtype)
{
  register MACH_REG *mr;

  if (reg[rtype].nused >= reg[rtype].max)
    return NO_REG;

  mr = reg[rtype].mach_reg;
  if (mr->next_global > mr->last_global)
    return NO_REG;

  if (BIH_SMOVE(gbl.entbih) && mr->next_global > 1)
    return NO_REG;

  /* currently, only allow more than one floating point
   * global register if an xbit is set.
   */


ads and writes, from/to the
remote SFTP server, are split in
multiple concurrent requests and this
allows data to be transferred at a
faster rate, over high latency networks,
by overlapping round-trip times`)
	portableCmd.Flags().IntVar(&graceTime, graceTimeFlag, 0,
		`This grace time defines the number of
seconds allowed for existing transfers
to get completed before shutting down.
A graceful shutdown is triggered by an
interrupt signal.
`)
	addConfigFlags(portableCmd)
	rootCmd.AddCommand(portableCmd)
}

func parsePatternsFilesFilters() []sdk.PatternsFilter {
	var patterns []sdk.PatternsFilter
	for _, val := range portableAllowedPatterns {
		p, exts := getPatternsFilterValues(strings.TrimSpace(val))
		if p != "" {
			patterns = append(patterns, sdk.PatternsFilter{
				Path:            path.Clean(p),
				AllowedPatterns: exts,
				DeniedPatterns:  []string{},
			})
		}
	}
	for _, val := range portableDeniedPatterns {
		p, exts := getPatternsFilterValues(strings.TrimSpace(val))
		if p != "" {
			found := false
			for index, e := range patterns {
				if path.Clean(e.Path) == path.Clean(p) {
					patterns[index].DeniedPatterns = append(patterns[index].DeniedPatterns, exts...)
					found = true
					break
				}
			}
			if !found {
				patterns = append(patterns, sdk.PatternsFilter{
					Path:            path.Clean(p),
					AllowedPatterns: []string{},
					DeniedPatterns:  exts,
				})
			}
		}
	}
	return patterns
}

func getPatternsFilterValues(value string) (string, []string) {
	if strings.Contains(value, "::") {
		dirExts := strings.Split(value, "::")
		if len(dirExts) > 1 {
			dir := strings.TrimSpace(dirExts[0])
			exts := []string{}
			for e := range strings.SplitSeq(dirExts[1], ",") {
				cleanedExt := strings.TrimSpace(e)
				if cleanedExt != "" {
					exts = append(exts, cleanedExt)
				}
			}
			if dir != "" && len(exts) > 0 {
				return dir, exts
			}
		}
	}
	return "", nil
}

func getFileContents(name string) (string, error) {
	fi, err := os.Stat(name)
	if err != nil {
		return "", err
	}
	if fi.Size() > 1048576 {
		return "", fmt.Errorf("%q is too big %v/1048576 bytes", name, fi.Size())
	}
	contents, err := os.ReadFile(name)
	if err != nil {
		return "", err
	}
	return util.BytesToString(contents), nil
}

func convertFsProvider() string {
	switch portableFsProvider {
	case "osfs", "6": // httpfs (6) is not supported in portable mode, so return the default
		return "0"
	case "s3fs":
		return "1"
	case "gcsfs":
		return "2"
	case "azblobfs":
		return "3"
	case "cryptfs":
		return "4"
	case "sftpfs":
		return "5"
	default:
		return portableFsProvider
	}
}
// Copyright (C) 2019 Nicola Murino
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, version 3.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public


using ShadowSql;
using ShadowSql.Engines;
using ShadowSql.Engines.MsSql;
using ShadowSql.Identifiers;
using ShadowSql.Logics;

namespace ShadowSqlCoreTest.Logics;

public class OrLogicTests
{
    static readonly ISqlEngine _engine = new MsSqlEngine();
    //分数
    static readonly IColumn _score = Column.Use("Score");
    //年级
    static readonly IColumn _grade = Column.Use("Grade");
    //少先队员
    static readonly IColumn _pioneer = Column.Use("Pioneer");
    //爱好
    static readonly IColumn _hobby = Column.Use("Hobby");

    [Fact]
    public void Or2()
    {
        OrLogic or = new OrLogic(_score.GreaterEqualValue(90))
            .OrCore(_hobby.GreaterValue(0));
        var or2 = new OrLogic(_grade.GreaterValue(4))
            .OrCore(_pioneer.EqualValue(true));
        var logic = or.Or(or2);
        var sql = _engine.Sql(logic);
        Assert.Equal("[Score]>=90 OR [Hobby]>0 OR [Grade]>4 OR [Pioneer]=1", sql);
    }
    [Fact]
    public void OrAnd()
    {
        var or = new OrLogic(_score.GreaterEqualValue(90))
            .OrCore(_hobby.GreaterValue(0));
        var and = new AndLogic(_grade.GreaterValue(4))
            .AndCore(_pioneer.EqualValue(true));
        var logic = or.Or(and);
        var sql = _engine.Sql(logic);
        Assert.Equal("[Score]>=90 OR [Hobby]>0 OR ([Grade]>4 AND [Pioneer]=1)", sql);
    }
    [Fact]
    public void And()
    {
        var or = new OrLogic(_score.GreaterEqualValue(90))
            .OrCore(_hobby.GreaterValue(0));
        var logic = or.ToAndCore()
            .And(_pioneer.EqualValue(true));
        var sql = _engine.Sql(logic);
        Assert.Equal("[Pioneer]=1 AND ([Score]>=90 OR [Hobby]>0)", sql);
    }
    [Fact]
    public void MergeToOr()
    {
        var or = new OrLogic(_score.GreaterEqualValue(90))


=models.CASCADE)

    # 物品信息
    item_name = models.CharField(max_length=100, verbose_name='品名')
    package_type = models.CharField(max_length=50, verbose_name='包装')
    quantity = models.IntegerField(verbose_name='件数')
    weight = models.IntegerField(verbose_name='重量(kg)')
    volume = models.DecimalField(max_digits=6, decimal_places=2, verbose_name='体积(m³)')
    delivery_charge = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='送（提）货费')
    insurance_fee = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='保险费')
    packaging_fee = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='包装费')
    goods_value = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='货物价值')
    freight = models.DecimalField(max_digits=10, decimal_places=2, verbose_name='运费(元)')
    remarks = models.CharField(max_length=50, verbose_name='备注', default="无")

    def __str__(self):
        return f'{self.item_name} ({self.quantity} 件)'

    class Meta:
        verbose_name = '商品信息'
        verbose_name_plural = '商品信息'


icateKey(filePath = filePath, keys = jobs.keys, newKeys = newJob.keys)
            }
            jobMap.putAll(newJob)
        }
        preYamlObject.jobs = jobMap
    }

    private fun replaceSteps(
        steps: List<Map<String, Any>>,
        preYamlObject: PreScriptBuildYamlIParser,
        deepTree: TemplateDeepTreeNode
    ) {
        val stepList = mutableListOf<PreStep>()
        steps.forEach { step ->
            stepList.addAll(replaceStepTemplate(listOf(step), filePath, deepTree))
        }
        preYamlObject.steps = stepList
    }

    private fun replaceFinally(
        finally: Map<String, Any>,
        preYamlObject: PreScriptBuildYamlIParser,
        deepTree: TemplateDeepTreeNode
    ) {
        // finally: 与jobs: 的结构相同
        val finallyMap = LinkedHashMap<String, PreJob>()
        finally.forEach { (key, value) ->
            // 检查根文件处job_id重复
            val newFinally = replaceJobTemplate(mapOf(key to value), filePath, deepTree)
            if (key == Constants.TEMPLATE_KEY) {
                TemplateYamlUtil.checkDuplicateKey(filePath = filePath, keys = finally.keys, newKeys = newFinally.keys)
            }
            finallyMap.putAll(newFinally)
        }
        preYamlObject.finally = finallyMap
    }

    // 进行模板替换
    private fun replaceVariableTemplate(
        variables: Map<String, Any>,
        fromPath: TemplatePath,
        deepTree: TemplateDeepTreeNode
    ): Map<String, Variable> {
        val variableMap = mutableMapOf<String, Variable>()
        variables.forEach { (key, value) ->
            // 如果是模板文件则进行模板替换
            if (key == Constants.TEMPLATE_KEY) {
                val toPathList =
                    YamlObjects.transValue<List<Map<String, Any>>>(fromPath, TemplateType.VARIABLE.text, value)
                toPathList.forEach { item ->
                    val toPath = TemplatePath(
                        item[Constants.OBJECT_TEMPLATE_PATH].toString(), item[Constants.REF]?.toString()
                    )
                    // 保存并检查是否存在循环引用模板
                    templateGraph.saveAndCheckCyclicTemplate(
                        fromPath.toString(), toPath.toString(), TemplateType.VARIABLE
                    )
                    // 获取需要替换的变量
                    val parameters = YamlObjects.transNullValue<Map<String, Any?>>(
                        file = fromPath,
                        type = Constants.PARAMETERS_KEY,
                        key = Constants.PARAMETERS_KEY,
                        map = item
                    )
                    // 对模板文件进行远程库和参数替换，并实例化
                    val templateObject = replaceResAndParam(
                        TemplateType.VARIABLE, toPath, parameters, fromPath,
                        deepTree
                    )
                    // 判断实例化后的模板文件中是否引用了模板文件，如果有，则递归替换
                    val newVar = replaceVariableTemplate(
                        variables = YamlObjects.transValue(
                            toPath, TemplateType.VARIABLE.text, templateObject[TemplateType.VARIABLE.content]
                        ),
                        fromPath = toPath,
                        deepTree = deepTree.add(toPath)
                    )
                    // 检测variable是否存在重复的key
                    TemplateYamlUtil.checkDuplicateKey(
                        filePath = filePath,
                        keys = variableMap.keys,
                        newKeys = newVar.keys,
                        toPath = toPath
                    )
                    variableMap.putAll(newVar


 = vertIndex(cx + 1, cz + 1)
            indicesList.add(vi0)
            indicesList.add(vi1)
            indicesList.add(vi3)

            indicesList.add(vi0)
            indicesList.add(vi3)
            indicesList.add(vi2)
        }
    }

    return Pair(verticesList, indicesList.toArray())
}package xyz.chunkstories.graphics.common.world

import org.joml.Matrix4f
import org.joml.Vector3f
import xyz.chunkstories.api.client.Client
import xyz.chunkstories.api.graphics.rendergraph.*
import xyz.chunkstories.api.graphics.structs.Camera
import xyz.chunkstories.api.util.kotlin.toVec3f
import xyz.chunkstories.api.world.World
import xyz.chunkstories.graphics.common.CommonGraphicsOptions
import xyz.chunkstories.graphics.common.getConditions
import xyz.chunkstories.graphics.common.structs.ShadowMappingInfo
import xyz.chunkstories.world.WorldImplementation

fun doShadowMapping(ctx: PassInstance, world: World) {
    val client = (world as WorldImplementation).gameInstance.engine as Client

    val mainCamera = ctx.taskInstance.camera

    val shadowCascades = client.configuration.getIntValue(CommonGraphicsOptions.shadowCascades)

    val extentPerCascadeCount = when(shadowCascades) {
        0 -> floatArrayOf()
        1 -> floatArrayOf(64f)
        2 -> floatArrayOf(128f, 32f)
        3 -> floatArrayOf(384f, 96f, 24f)
        4 -> floatArrayOf(768f, 256f, 64f, 16f)
        else -> throw Exception()
    }

    for(i in 0 until 4) {
        ctx.shaderResources.supplyImage("shadowBuffers", i, ImageInput().apply {
            source = ImageSource.AssetReference("/textures/logo.png")
            depthCompareMode = ImageInput.DepthCompareMode.GREATER_OR_EQUAL
        })
    }

    val shadowInfo = ShadowMappingInfo()
    shadowInfo.cascadesCount = shadowCascades
    for(i in 0 until shadowCascades) {
        val shadowMapDepthRange = 256f
        val shadowMapExtent = extentPerCascadeCount[i]

        val shadowMapContentsMatrix = Matrix4f().ortho(-shadowMapExtent, shadowMapExtent, -shadowMapExtent, shadowMapExtent, shadowMapDepthRange, -shadowMapDepthRange, true)
        val sunPosition = world.getConditions().sunPosition.toVec3f()

        val sunLookAt = Matrix4f().lookAt(sunPosition, Vector3f(0f), Vector3f(0f, 1f, 0f))

        val shadowMatrix = Matrix4f()
        shadowMatrix.mul(shadowMapContentsMatrix, shadowMatrix)
        shadowMatrix.mul(sunLookAt, shadowMatrix)

        shadowMatrix.translate(Vector3f(mainCamera.position.toVec3f()).negate())

        val sunCamera = Camera(viewMatrix = shadowMatrix, fov = 0f, position = mainCamera.position)

        shadowInfo.cameras[i] = sunCamera

        ctx.dispatchRenderTask("shadowmapCascade$i", sunCamera, "sunShadow", mapOf("shadowBuffer" to RenderTarget.RenderBufferReference("shadowBuffer$i"))) {
            //val node = it as VulkanFrameGraph.FrameGraphNode.VulkanRenderTaskInstance
            //println("RESOLVED DB: ${node.rootPassInstance.resolvedDepthBuffer}")
            //passContext.markRenderBufferAsInput(node.rootPassInstance.resolvedDepthBuffer)

            ctx.shaderResources.supplyImage("shadowBuffers", i, ImageInput().apply {
                source = renderBuffer("shadowBuffer$i")
                scalingMode = ImageInput.ScalingMode.LINEAR
                depthCompareMode = ImageInput.DepthCompareMode.GREATER_OR_EQUAL
            })
            //ctx.


          isOutlined: true,
            text: 'Jack Lee',
          ),
        ),
        const Gap(20),
        Write.header2('$c.4 自定义颜色'),
        Write.paragraph('你可以自己定义通知消息的颜色。'),
        const Gap(20),
        Center(
          child: SemanticButton(
            shrink: true,
            color: Colors.amber,
            onTap: () => NotifyToasts.showTopRight(
              context,
              color: Colors.amber,
              title: 'Custom color',
              message: 'The currently defined color is Colors.amber.',
            ),
            isOutlined: true,
            text: 'Custom color',
          ),
        ),
        const Gap(20),
        Write.header2('$c.5 自定义动画'),
        Write.paragraph(
            '你可以自定义动画，不过这里还是和以前一样推荐使用Widgets Easier组件库配套的flutter_easy_animations库中现成的动画效果。'),
        Write.paragraph(
            '默认情况下，NotifyToasts中的showTopRight方法和showBottomRight方法使用了AnimateStyles.slideInRight动画效果；showTopLeft方法和showBottomLeft方法使用了AnimateStyles.slideInLeft动画效果。'),
        Write.paragraph(
            '你可以通过NotifyToasts中任意一个静态方法的animationEffect参数指定动画效果。例如：'),
        const Gap(20),
        Center(
          child: SemanticButton(
            shrink: true,
            onTap: () => NotifyToasts.showTopRight(
              context,
              animationEffect: AnimateStyles.zoomInRight,
              title: 'Custom Animation',
              message: 'Use AnimateStyles.zoomInRight animation effect.',
            ),
            isOutlined: true,
            text: 'AnimateStyles.zoomInRight',
          ),
        ),
        const Gap(20),
        Write.paragraph(
            '需要注意的是，选择符合逻辑的动画能够让消息吐丝的进入和退出看起来更加自然。就比如这个例子中，showTopRight使用了zoomInRight动画，而不是zoomInLeft动画。'),
        Write.paragraph(
            '另外，如果有需要，你可以通过animationDuration参数来指定。如未指定，则采用默认的300毫秒。'),
        const Gap(20),
        Write.header2('$c.6 关闭按钮'),
        Write.paragraph(
            '默认情况下，每一条消息吐丝都带有一个关闭按钮。如果不显示关闭按钮，则可以指定showClose属性的值为flase。例如：'),
        const Gap(20),
        Center(
          child: SemanticButton(
            shrink: true,
            onTap: () => NotifyToasts.showTopRight(
              context,
              title: 'close icon button',
              showClose: false,
              message:
                  'You can disable the close icon button by specifying the value of the showClose property as flase.',
            ),
            isOutlined: true,
            text: 'close icon button',
          ),
        ),
        const Gap(20),
        Write.header2('$c.7 禁用自动移除'),
        Write.paragraph(
            '默认情况下，一旦到达指定时间则消息吐丝将被自动移除。不过如果指定了autoClose为false，则需要手动点击关闭按钮。例如：'),
        const Gap(20),
        Center(
          child: SemanticButton(
            shrink: true,
            onTap: () => NotifyToasts.showTopRight(
              context,
              title: 'Jack Lee',
              autoClose: false,
              icon: Picture(source: 'assets/jclee95.png'),
              message


   navigationRef.current.dispatch(action);
    }
  }

  static navigateTo(routeName: string, params?: any) {
    if (navigationRef?.current) {
      navigationRef.current.navigate(routeName, params);
    }
  }

  static push(routeName: string, params?: any) {
    if (navigationRef?.current) {
      const pushAction = StackActions.push(routeName, params);
      navigationRef.current.dispatch(pushAction);
    }
  }

  static getCurretRoute() {
    if (navigationRef?.current) {
      return navigationRef.current.getCurrentRoute();
    }
  }
}
export function validateElement(element) {
  if (!element) {
    throw new Error('Render method expected an element.')
  }
  if (typeof element === 'string') {
    throw new Error(
      "Invalid component element. Instead of passing string like 'text', pass a class or functional component. For example - <Document />",
    )
  }
  return true
}
import KLineSorter from "../../src/prices/pipeline/KLineSorter";
import {unorderedKlines} from "./klines/unorderedKlines";
import { expect } from 'chai';
import {IKLine} from "../../src/prices/KLine";
import {noVolumeRule} from "../../src/prices/pipeline/NoVolumeRule";
import {noVolumeKline} from "./klines/NoVolumesKlines";
import {wrongOpenCloseKlines} from "./klines/wrongOpenClosePriceKlines";
import {closePriceIsOpenPrice} from "../../src/prices/pipeline/closePriceIsOpenPrice";
import {newKline, nextKlineFactory} from "../factories/KLineFactory";

describe("KlineSorter", () => {
    it("Should sort from most recent to oldest", async () => {
        const klineSorter = new KLineSorter();
        const sorted = await klineSorter.process(unorderedKlines);
        expect(sorted[0].time).to.be.gt(sorted[1].time)
    })
})

describe("NoVolumeRule", () => {
    it("Should throw error if volume is zero and price change", () =>{
        const kline: IKLine = noVolumeKline;
        expect(() => noVolumeRule(kline)).to.throw(`Low (${kline.low}) greater than high (${kline.high})`)
    })
})

describe("closePriceIsOpenPrice", () => {
    it("Shoud change open price to equal last close price", () => {
        const klines: IKLine[] = wrongOpenCloseKlines;
        const kline = closePriceIsOpenPrice(klines[0], klines, 0);
        expect(kline.open).to.eq(klines[1].close);
    })

    it('should not change the open price if last price', function () {
        const klines: IKLine[] = wrongOpenCloseKlines;
        const kline = closePriceIsOpenPrice(klines[1], klines, 1);
        expect(kline.open).to.eq(klines[1].open);
    });

    it("Should handle wrong intra candle data", () => {
        const candle1: IKLine = newKline();
        candle1.isClose = false;
        const candle2: IKLine = nextKlineFactory(candle1, 1);
        candle2.open = -1;
        const kline = closePriceIsOpenPrice(candle2, [candle2, candle1], 0);
        expect(kline.open).eq(candle1.open);
    })
})
module.exports = app => {
    const { INTEGER, STRING, CHAR, ENUM } = app.Sequelize;

    // 横幅
    const Card = app.model.define('card', {
        // 生成6位数字的主键
        code: {
            type: CHAR(6),
            primaryKey: true,


   Assert.IsAssignableFrom(exType, ex);
    }

    [Theory]
    [InlineData("Data/Blacklist/cidr.txt", BlacklistFormat.CIDR)]
    [InlineData("Data/Blacklist/dat.txt", BlacklistFormat.DAT)]
    [InlineData("Data/Blacklist/p2p.txt", BlacklistFormat.P2P)]
    public async Task Load_Loads(string filename, BlacklistFormat format)
    {
        var bl = new Blacklist();
        var ex = await Record.ExceptionAsync(() => bl.Load(filename, format));

        Assert.Null(ex);

        // the test files are assumed to all contain 5 entries
        Assert.Equal(5, bl.Count);
    }

    [Theory]
    [InlineData("Data/Blacklist/cidr.txt", BlacklistFormat.CIDR)]
    public async Task Load_Then_Clear(string filename, BlacklistFormat format)
    {
        var bl = new Blacklist();
        var ex = await Record.ExceptionAsync(() => bl.Load(filename, format));

        Assert.Null(ex);

        // the test files are assumed to all contain 5 entries
        Assert.Equal(5, bl.Count);

        bl.Clear();

        Assert.Equal(0, bl.Count);
    }

    [Theory]
    [InlineData("Data/Blacklist/cidr.txt")]
    [InlineData("Data/Blacklist/dat.txt")]
    [InlineData("Data/Blacklist/p2p.txt")]
    public async Task Load_AutoDetects_And_Loads(string filename)
    {
        var bl = new Blacklist();
        var ex = await Record.ExceptionAsync(() => bl.Load(filename));

        Assert.Null(ex);

        // the test files are assumed to all contain 5 entries
        Assert.Equal(5, bl.Count);
    }

    [Theory]
    [InlineData("Data/Blacklist/cidr.txt")]
    [InlineData("Data/Blacklist/dat.txt")]
    [InlineData("Data/Blacklist/p2p.txt")]
    public async Task CIDR_Contains(string filename)
    {
        var bl = new Blacklist();
        await bl.Load(filename);

        foreach (var ip in IPs)
        {
            if (bl.Contains(IPAddress.Parse(ip.Item1)) != ip.Item2)
            {
                throw new Exception($"Expected contains for {ip.Item1} to be {ip.Item2} but it wasn't");
            }
        }
    }
}


nd
	d.Show()
	d.Entry.GrabFocus()

	d.Run()
}

type Dialog struct {
	*gtk.Dialog
	Entry *gtk.Entry   // in header
	List  *gtk.ListBox // in dialog

	state *ningen.State

	// callback functions
	OnGuild   func(discord.GuildID)
	OnChannel func(discord.ChannelID, discord.GuildID)
	OnFriend  func(discord.UserID)

	// reusable slices
	list []Entry

	visible []int // key to rows
	rows    map[int]*Row

	// TODO: cache guilds and channels into huge slices.
}

type Row struct {
	*gtk.ListBoxRow
	index int
}

type Entry struct {
	// | <Icon> <Primary> <Secondary>          <Right> |

	// Icon enum
	IconChar rune
	IconURL  string

	PrimaryText   string
	SecondaryText string
	RightText     string
	longString    string

	// enum
	GuildID   discord.GuildID
	ChannelID discord.ChannelID // could be DM, visible as one
	FriendID  discord.UserID    // only called if needed a new channel
}

func NewDialog(s *ningen.State) *Dialog {
	d := gtk.NewDialog()
	d.SetModal(true)
	d.SetTransientFor(&window.Window.Window)
	d.SetDefaultSize(500, 400)

	gtkutils.InjectCSS(d, "quickswitcher", "")

	d.Connect("response", func(_ *gtk.Dialog, resp gtk.ResponseType) {
		if resp == gtk.ResponseDeleteEvent {
			d.Destroy()
		}
	})

	// Header

	header := gtk.NewHeaderBar()
	header.Show()
	header.SetShowCloseButton(true)

	entry := gtk.NewEntry()
	entry.Show()
	entry.GrabFocus()
	entry.SetPlaceholderText("Search anything")
	entry.SetSizeRequest(400, -1)

	// Custom Title allows Entry to be centered.
	header.SetCustomTitle(entry)

	d.SetTitlebar(header)

	// Body

	sw := gtk.NewScrolledWindow(nil, nil)
	sw.Show()
	sw.SetSizeRequest(400, -1)
	sw.SetHAlign(gtk.AlignCenter)
	sw.SetVExpand(true)

	list := gtk.NewListBox()
	list.Show()
	list.SetVExpand(true)
	sw.Add(list)

	d.Remove(d.ContentArea())
	d.Add(sw)

	dialog := &Dialog{
		Dialog: d,
		Entry:  entry,
		List:   list,
		state:  s,
	}

	list.Connect("row-activated", dialog.onActivate)
	list.SetSelectionMode(gtk.SelectionSingle)

	entry.Connect("key-press-event", func(e *gtk.Entry, ev *gdk.Event) bool {
		if ev.AsType() != gdk.KeyPressType {
			return false
		}
		if len(dialog.list) == 0 {
			return false
		}

		switch ev.AsKey().Keyval() {
		case gdk.KEY_Up:
			dialog.Up()
			return true
		case gdk.KEY_Down:
			dialog.Down()
			return true
		}

		return false
	})
	entry.Connect("activate", func() {
		list.SelectedRow().Activate()
	})
	entry.Connect("changed", func() {
		t := entry.Text()
		dialog.onEntryChange(strings.ToLower(t))
	})

	dialog.populateEntries()

	return dialog
}

func (d *Dialog) Down() {
	if len(d.visible) == 0 {
		return


/*
 * Copyright (c) 2025 ETH Zürich, IT Services
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

using System;
using SafeExamBrowser.Settings.Applications;
using SafeExamBrowser.Settings.Browser;
using SafeExamBrowser.Settings.Logging;
using SafeExamBrowser.Settings.Monitoring;
using SafeExamBrowser.Settings.Proctoring;
using SafeExamBrowser.Settings.Security;
using SafeExamBrowser.Settings.Server;
using SafeExamBrowser.Settings.Service;
using SafeExamBrowser.Settings.System;
using SafeExamBrowser.Settings.SystemComponents;
using SafeExamBrowser.Settings.UserInterface;

namespace SafeExamBrowser.Settings
{
	/// <summary>
	/// Defines all settings for the application.
	/// </summary>
	[Serializable]
	public class AppSettings
	{
		/// <summary>
		/// All settings related to external applications.
		/// </summary>
		public ApplicationSettings Applications { get; set; }

		/// <summary>
		/// All audio-related settings.
		/// </summary>
		public AudioSettings Audio { get; set; }

		/// <summary>
		/// All browser-related settings.
		/// </summary>
		public BrowserSettings Browser { get; set; }

		/// <summary>
		/// The mode which determines the configuration behaviour.
		/// </summary>
		public ConfigurationMode ConfigurationMode { get; set; }

		/// <summary>
		/// All display-related settings.
		/// </summary>
		public DisplaySettings Display { get; set; }

		/// <summary>
		/// All keyboard-related settings.
		/// </summary>
		public KeyboardSettings Keyboard { get; set; }

		/// <summary>
		/// The global log severity to be


合适的动画等等方面。在应用开发中我们也会添加专门的介绍或引导页，一方面引导用户使用，另一方面也可以进行后台资源请求与处理；譬如我们往往会在应用启动时设置闪屏页(Splash)，记得最早在 Uber 见到以短视频为背景的闪屏页很有耳目一新的感觉。除此之外，我们常见的指示器还包括了进度指示与时间指示这两种。在进行数据请求或者数据处理等需要用户等待的场景中，我们往往会给用户以进度条方式地友好反馈，这种进度条就是典型地进度指示。常用的进度条设计有线性进度条、圆形进度条或者固定在页首或者页尾的进度条，有些设计中我们也会以背景投射地方式反馈当前进度，这种方式可能更具有视觉冲击力。而除了进度条之外，无限循环的加载效果、分页器或者步骤跟踪显示器也是常见的进度指示的表现形式之一。而所谓的时间指示即譬如界面上放置的拟物时钟或者电子时钟、常见于社交媒体上的时间轴或者日历效果以及倒计数效果等。

而输入器的典型代表则为按钮与文本输入，譬如我们除了常见的 Primary、Secondary 按钮之外，我们可能还会用到悬浮按钮、可扩展的按钮或者在喜欢与点赞时用到的具有一定动画效果的按钮。而文本输入系列的插件中，除了常见的文本框或者富文本编辑器，有时我们也需要去编写具有自动补全或者类似于密码、勾选之类的特殊格式的输入框。选择器也是我们常用到的输入器之一，譬如开关、单选按钮、勾选按钮、分段输入以及常用于两个列表互选的左右穿梭器等等。除了这些，搜索、菜单、解锁界面也是归属于输入器这个类别中。

## 列表、画廊与对话框

在这两个大类之外算得上最常用的插件的当属列表、网格与表单这个系列的控件；基本上每个应用都会包含列表或者网格布局，对于海量数据的列表渲染也是前端常见的挑战之一。Android 中内置的 RecycleView 与 iOS 中内置的 UITableView 都为我们提供了不错的懒加载、局部渲染的功能，而 Web 中我们往往需要自己定制或者寻求第三方库的帮助。对于列表的交互也是常见问题之一，除了允许用户正常的点击，我们还需要添加左滑右滑时的反馈、可伸缩或者允许排序、�


  }

  @Override
  public int length() {
    return length;
  }

  @Override
  public ZonedDateTime getElementAsDateTime(int index) {

    // Start with the years field, which is stored relative
    // to 1900
    int year = elementAt(years, index);
    if(isNA(year)) {
      return null;
    }

    // The month and day are not guaranteed to be in valid ranges, so we need to add them
    // in sequence

    LocalDate localDate = LocalDate.of(1900 + year, 1, 1);

    // add months, which is normally in the range [0-11],
    // but can also be NA, less than 0 or greater than 11
    int month = elementAt(monthsOfYear, index);
    if(isNA(month)) {
      return null;
    }

    localDate = localDate.plusMonths(month);

    // normalize day of month

    // This value is actually treated as an offset: POSIXlt vectors
    // may have values like 4, 5, indicating the 4th and 5th day
    // of the month, or values like 0, -15, 3000, or -233.
    int dayOfMonth = elementAt(daysOfMonth, index);
    if(isNA(dayOfMonth)) {
      return null;
    }

    // Since result is initialized to the first day of the month, we'll
    // treat this field as an offset relative to the first day of the month,
    // which means we have to subtract 1, so...
    // 1 -> 0 (already first day of the month, nothing to do)
    // 0 -> -1 (refers to one day before the first day, or last day of the previous month)
    int daysToAdd = dayOfMonth - 1;

    localDate = localDate.plusDays(daysToAdd);

    // Add time fields
    // These are all zero-based, so we can treat as an offset of the result so far
    int hourOfDay = elementAt(hours, index);
    int minuteOfHour = elementAt(minutes, index);
    double fractionalSecondOfMinute = doubleElementAt(seconds, index);

    if(isNA(hourOfDay) || isNA(minuteOfHour) || DoubleVector.isNA(fractionalSecondOfMinute)) {
      return null;
    }

    int secondOfMinute = (int) Math.floor(fractionalSecondOfMinute);
    int nanoOfSecond = (int)((fractionalSecondOfMinute - secondOfMinute) * 1e9);

    return localDate.atTime(hourOfDay, minuteOfHour, secondOfMinute, nanoOfSecond).atZone(timeZone);
  }

  private int elementAt(AtomicVector component, int index) {
    return component.getElementAsInt(index % component.length());
  }
  private double doubleElementAt(AtomicVector component, int index) {
    return component.getElementAsDouble(index % component.length());
  }

  public static class Builder {
    private ListVector.NamedBuilder list = new ListVector.NamedBuilder(0, 9);
    private DoubleArrayVector.Builder second = new DoubleArrayVector.Builder();
    private IntArrayVector.Builder minute = new IntArrayVector.Builder();
    private IntArrayVector.Builder hour = new IntArrayVector.Builder();
    private IntArrayVector.Builder dayOfMonth = new IntArrayVector.Builder();
    private IntArrayVector.Builder month = new IntArrayVector.Builder();
    private IntArrayVector.Builder year = new IntArrayVector.Builder();
    private IntArrayVector.Builder weekday = new IntArrayVector.Builder();
    private IntArrayVector.Builder dayOfYear = new IntArrayVector.Builder();
    private IntArrayVector.Builder dst = new IntArrayVector.Builder();
    private IntArrayVector.Builder gmtOffset = new IntArrayVector.Builder();
    private ZoneId zone;
    private StringVector zoneName;

    public Builder add(ZonedDateTime parse


from typing import Dict, List, Optional, Any
from pydantic import BaseModel, Field
from datetime import datetime, time
from enum import Enum

class NotificationChannel(str, Enum):
    EMAIL = "email"
    SMS = "sms"
    PUSH = "push"

class NotificationCategory(str, Enum):
    ACCOUNT = "account"
    MARKETING = "marketing"
    TRANSACTIONS = "transactions"
    UPDATES = "updates"
    ALERTS = "alerts"
    NEWS = "news"

class ChannelPreference(BaseModel):
    enabled: bool = True
    quiet_hours_start: Optional[time] = None
    quiet_hours_end: Optional[time] = None
    frequency_limit: Optional[int] = None  # Max notifications per day
    urgent_override: bool = True  # Allow urgent notifications during quiet hours

class CategoryPreference(BaseModel):
    enabled: bool = True
    channels: Dict[NotificationChannel, bool] = Field(
        default_factory=lambda: {
            NotificationChannel.EMAIL: True,
            NotificationChannel.SMS: True,
            NotificationChannel.PUSH: True
        }
    )

class UserPreferences(BaseModel):
    user_id: str
    channels: Dict[NotificationChannel, ChannelPreference] = Field(
        default_factory=lambda: {
            NotificationChannel.EMAIL: ChannelPreference(),
            NotificationChannel.SMS: ChannelPreference(),
            NotificationChannel.PUSH: ChannelPreference()
        }
    )
    categories: Dict[NotificationCategory, CategoryPreference] = Field(
        default_factory=lambda: {
            NotificationCategory.ACCOUNT: CategoryPreference(),
            NotificationCategory.MARKETING: CategoryPreference(),
            NotificationCategory.TRANSACTIONS: CategoryPreference(),
            NotificationCategory.UPDATES: CategoryPreference(),
            NotificationCategory.ALERTS: CategoryPreference(),
            NotificationCategory.NEWS: CategoryPreference()
        }
    )
    do_not_disturb: bool = False
    timezone: Optional[str] = "UTC"
    created_at: datetime = Field(default_factory=datetime.utcnow)
    updated_at: datetime = Field(default_factory=datetime.utcnow)

class PreferenceUpdateRequest(BaseModel):
    channels: Optional[Dict[NotificationChannel, ChannelPreference]] = None
    categories: Optional[Dict[NotificationCategory, CategoryPreference]] = None
    do_not_disturb: Optional[bool] = None
    timezone: Optional[str] = None

class PreferenceResponse(BaseModel):
    user_id: str
    preferences: UserPreferences
    message: Optional[str] = None