18
	bl ov57_0223B1A4
	pop {r4, pc}
	thumb_func_end ov57_0223B2EC

	thumb_func_start ov57_0223B308
ov57_0223B308: ; 0x0223B308
	push {r4, lr}
	add r4, r0, #0
	bl ov57_0223B12C
	ldr r0, _0223B328 ; =0x0000040C
	ldr r0, [r4, r0]
	cmp r0, #0
	bne gApp_MainMenu_SelectOption_ConnectToRanger
	add r0, r4, #0
	bl ov57_0223B3F8
	pop {r4, pc}
gApp_MainMenu_SelectOption_ConnectToRanger:
	add r0, r4, #0
	bl ov57_0223B45C
	pop {r4, pc}
	.balign 4, 0
_0223B328: .word 0x0000040C
	thumb_func_end ov57_0223B308

	thumb_func_start ov57_0223B32C
ov57_0223B32C: ; 0x0223B32C
	push {r4, lr}
	add r4, r0, #0
	mov r0, #0x3f
	lsl r0, r0, #4
	ldr r2, [r4, r0]
	sub r0, r0, #4
	ldr r3, [r4, r0]
	cmp r3, r2
	bne _0223B340
	mov r1, #0
_0223B340:
	cmp r1, #0
	beq _0223B36E
	add r0, r4, #0
	add r1, r3, #0
	bl ov57_022394D8
	mov r1, #1
	add r0, r4, #0
	add r2, r1, #0
	bl ov57_0223B504
	add r4, #0xec
	add r0, r4, #0
	mov r1, #0
	mov r2, #0xb
	mov r3, #1
	bl ov57_02239728
	ldr r0, _0223B39C ; =0x000005DC
	bl PlaySE
	mov r0, #2
	pop {r4, pc}
_0223B36E:
	mov r0, #0x32
	lsl r0, r0, #4
	ldr r0, [r4, r0]
	mov r1, #0
	bl ManagedSprite_SetDrawFlag
	mov r0, #0xc7
	lsl r0, r0, #2
	ldr r0, [r4, r0]
	mov r1, #0
	bl ManagedSprite_SetAnim
	mov r1, #0
	add r0, r4, #0
	add r2, r1, #0
	bl ov57_0223B504
	ldr r0, _0223B3A0 ; =0x000005DD
	bl PlaySE
	mov r0, #3
	pop {r4, pc}
	nop
_0223B39C: .word 0x000005DC
_0223B3A0: .word 0x000005DD
	thumb_func_end ov57_0223B32C

	thumb_func_start ov57_0223B3A4
ov57_0223B3A4: ; 0x0223B3A4
	push {r4, lr}
	add r4, r0, #0
	cmp r1, #0xc
	beq _0223B3B2
	cmp r1, #0xd
	beq _0223B3BA
	b _0223B3C2
_0223B3


LevelA1ID sql.NullInt64
	LevelA1   *LevelA1
	LevelA2ID sql.NullInt64
	LevelA2   *LevelA2
}

func TestNestedPreload10(t *testing.T) {
	DB.Migrator().DropTable(&LevelA3{}, &LevelA2{}, &LevelA1{})
	if err := DB.AutoMigrate(&LevelA1{}, &LevelA2{}, &LevelA3{}); err != nil {
		t.Error(err)
	}

	levelA1 := &LevelA1{Value: "foo"}
	if err := DB.Save(levelA1).Error; err != nil {
		t.Error(err)
	}

	want := []*LevelA2{
		{
			Value: "bar",
			LevelA3s: []*LevelA3{
				{
					Value:   "qux",
					LevelA1: levelA1,
				},
			},
		},
		{
			Value:    "bar 2",
			LevelA3s: []*LevelA3{},
		},
	}
	for _, levelA2 := range want {
		if err := DB.Save(levelA2).Error; err != nil {
			t.Error(err)
		}
	}

	var got []*LevelA2
	if err := DB.Preload("LevelA3s.LevelA1").Find(&got).Error; err != nil {
		t.Error(err)
	}

	if !reflect.DeepEqual(toJSONString(got), toJSONString(want)) {
		t.Errorf("got %s; want %s", toJSONString(got), toJSONString(want))
	}
}

type LevelB1 struct {
	ID       uint
	Value    string
	LevelB3s []*LevelB3
}

type LevelB2 struct {
	ID    uint
	Value string
}

type LevelB3 struct {
	ID        uint
	Value     string
	LevelB1ID sql.NullInt64
	LevelB1   *LevelB1
	LevelB2s  []*LevelB2 `gorm:"many2many:levelb1_levelb3_levelb2s" json:",omitempty"`
}

func TestNestedPreload11(t *testing.T) {
	DB.Migrator().DropTable(&LevelB3{}, &LevelB2{}, &LevelB1{})
	if err := DB.AutoMigrate(&LevelB1{}, &LevelB2{}, &LevelB3{}); err != nil {
		t.Error(err)
	}

	levelB1 := &LevelB1{Value: "foo"}
	if err := DB.Create(levelB1).Error; err != nil {
		t.Error(err)
	}

	levelB3 := &LevelB3{
		Value:     "bar",
		LevelB1ID: sql.NullInt64{Valid: true, Int64: int64(levelB1.ID)},
		LevelB2s:  []*LevelB2{},
	}
	if err := DB.Create(levelB3).Error; err != nil {
		t.Error(err)
	}
	levelB1.LevelB3s = []*LevelB3{levelB3}

	want := []*LevelB1{levelB1}
	var got []*LevelB1
	if err := DB.Preload("LevelB3s.LevelB2s").Find(&got).Error; err != nil {
		t.Error(err)
	}

	if !reflect.DeepEqual(toJSONString(got), toJSONString(want)) {
		t.Errorf("got %s; want %s", toJSONString(got), toJSONString(want))
	}
}

type LevelC1 struct {
	ID        uint
	Value     string
	LevelC2ID uint
}

type LevelC2 struct {
	ID      uint
	Value   string
	LevelC1 LevelC1
}

type LevelC3 struct {
	ID        uint
	Value     string
	LevelC2ID uint
	LevelC2   LevelC2
}

func TestNestedPreload12(t *testing.T) {
	DB.Migrator().DropTable(&LevelC3{}, &LevelC2{}, &Level


	priv = netdev_priv(net_dev);

#ifdef CONFIG_DEBUG_FS
	dpaa2_dbg_remove(priv);
#endif

	unregister_netdev(net_dev);
	rtnl_lock();
	dpaa2_eth_disconnect_mac(priv);
	rtnl_unlock();

	dpaa2_eth_dl_port_del(priv);
	dpaa2_eth_dl_traps_unregister(priv);
	dpaa2_eth_dl_unregister(priv);

	if (priv->do_link_poll)
		kthread_stop(priv->poll_thread);
	else
		fsl_mc_free_irqs(ls_dev);

	dpaa2_eth_free_rings(priv);
	free_percpu(priv->sgt_cache);
	free_percpu(priv->percpu_stats);
	free_percpu(priv->percpu_extras);

	dpaa2_eth_del_ch_napi(priv);
	dpaa2_eth_free_rx_xdp_rxq(priv);
	dpaa2_eth_free_dpbp(priv);
	dpaa2_eth_free_dpio(priv);
	dpaa2_eth_free_dpni(priv);
	if (priv->onestep_reg_base)
		iounmap(priv->onestep_reg_base);

	fsl_mc_portal_free(priv->mc_io);

	destroy_workqueue(priv->dpaa2_ptp_wq);

	dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);

	free_netdev(net_dev);

	return 0;
}

static const struct fsl_mc_device_id dpaa2_eth_match_id_table[] = {
	{
		.vendor = FSL_MC_VENDOR_FREESCALE,
		.obj_type = "dpni",
	},
	{ .vendor = 0x0 }
};
MODULE_DEVICE_TABLE(fslmc, dpaa2_eth_match_id_table);

static struct fsl_mc_driver dpaa2_eth_driver = {
	.driver = {
		.name = KBUILD_MODNAME,
		.owner = THIS_MODULE,
	},
	.probe = dpaa2_eth_probe,
	.remove = dpaa2_eth_remove,
	.match_id_table = dpaa2_eth_match_id_table
};

static int __init dpaa2_eth_driver_init(void)
{
	int err;

	dpaa2_eth_dbg_init();
	err = fsl_mc_driver_register(&dpaa2_eth_driver);
	if (err) {
		dpaa2_eth_dbg_exit();
		return err;
	}

	return 0;
}

static void __exit dpaa2_eth_driver_exit(void)
{
	dpaa2_eth_dbg_exit();
	fsl_mc_driver_unregister(&dpaa2_eth_driver);
}

module_init(dpaa2_eth_driver_init);
module_exit(dpaa2_eth_driver_exit);


}

    /**
     * 继承后重写可替换为你需要的布局
     *
     * @return
     */
    @Override
    public int getLayoutId() {
        return R.layout.video_layout_standard;
    }

    /**
     * 显示wifi确定框
     */
    @Override
    public void startPlayLogic() {
        if (mVideoAllCallBack != null) {
            Debuger.printfLog("onClickStartThumb");
            mVideoAllCallBack.onClickStartThumb(mOriginUrl, mTitle, StandardGSYVideoPlayer.this);
        }
        prepareVideo();
        startDismissControlViewTimer();
    }

    /**
     * 显示wifi确定框，如需要自定义继承重写即可
     */
    @Override
    protected void showWifiDialog() {
        if (!NetworkUtils.isAvailable(mContext)) {
            //Toast.makeText(mContext, getResources().getString(R.string.no_net), Toast.LENGTH_LONG).show();
            startPlayLogic();
            return;
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivityContext());
        builder.setMessage(getResources().getString(R.string.tips_not_wifi));
        builder.setPositiveButton(getResources().getString(R.string.tips_not_wifi_confirm), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                startPlayLogic();
            }
        });
        builder.setNegativeButton(getResources().getString(R.string.tips_not_wifi_cancel), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        builder.create().show();
    }

    /**
     * 触摸显示滑动进度dialog，如需要自定义继承重写即可，记得重写dismissProgressDialog
     */
    @Override
    @SuppressWarnings("ResourceType")
    protected void showProgressDialog(float deltaX, String seekTime, int seekTimePosition, String totalTime, int totalTimeDuration) {
        if (mProgressDialog == null) {
            View localView = LayoutInflater.from(getActivityContext()).inflate(getProgressDialogLayoutId(), null);
            if (localView.findViewById(getProgressDialogProgressId()) instanceof ProgressBar) {
                mDialogProgressBar = ((ProgressBar) localView.findViewById(getProgressDialogProgressId()));
                if (mDialogProgressBarDrawable != null) {
                    mDialogProgressBar.setProgressDrawable(mDialogProgressBarDrawable);
                }
            }
            if (localView.findViewById(getProgressDialogCurrentDurationTextId()) instanceof TextView) {
                mDialogSeekTime = ((TextView) localView.findViewById(getProgressDialogCurrentDurationTextId()));
            }
            if (localView.findViewById(getProgressDialogAllDurationTextId()) instanceof TextView) {
                mDialogTotalTime = ((TextView) localView.findViewById(getProgressDialogAllDurationTextId()));
            }
            if (localView.findViewById(getProgressDialogImageId()) instanceof ImageView) {
                mDialogIcon = ((ImageView) localView.findViewById(getProgressDialogImageId()));
            }
            mProgressDialog = new Dialog(getActivityContext(), R.style.video_style_dialog_progress);
            mProgressDialog.setContentView(localView);
            mProgressDialog.getWindow().addFlags(Window.FEATURE_ACTION_BAR);
            mProgressDialog.getWindow().addFlags(32);
            mProgressDialog.getWindow().addFlags(16);
            mProgressDialog.getWindow().setLayout(getWidth(), getHeight());
            if (mDialogProgressNormalColor != -11 && mDialogTotalTime != null) {
                mDialogTotalTime.setTextColor(mDialogProgressNormalColor);
            }
            if (mDialogProgressHighLightColor != -11 && mDialogSeekTime != null) {
                mDialogSeekTime.setTextCo


= 0x34,
        /// <summary>
        /// 粤标主动安全-高级驾驶辅助系统
        /// Advanced driver assistance system
        /// </summary>
        adas = 0x64,
        /// <summary>
        /// 粤标主动安全-驾驶状态监控系统
        /// Driving condition monitoring system
        /// </summary>
        dsm = 0x65,
        /// <summary>
        /// 粤标主动安全-胎压监测系统
        /// tire pressure monitoring system
        /// </summary>
        tpms = 0x66,
        /// <summary>
        /// 粤标主动安全-盲点监测系统
        /// Blind Spot Monitoring system
        /// </summary>
        bsd = 0x67,
    }
}


INTERNALERROR = "InternalError"
//  INVALIDPARAMETER = "InvalidParameter"
//  INVALIDPARAMETERVALUE = "InvalidParameterValue"
//  UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (c *Client) DescribeHeadTailTemplatesWithContext(ctx context.Context, request *DescribeHeadTailTemplatesRequest) (response *DescribeHeadTailTemplatesResponse, err error) {
    if request == nil {
        request = NewDescribeHeadTailTemplatesRequest()
    }
    c.InitBaseRequest(&request.BaseRequest, "vod", APIVersion, "DescribeHeadTailTemplates")

    if c.GetCredential() == nil {
        return nil, errors.New("DescribeHeadTailTemplates require credential")
    }

    request.SetContext(ctx)

    response = NewDescribeHeadTailTemplatesResponse()
    err = c.Send(request, response)
    return
}

func NewDescribeImageProcessingTemplatesRequest() (request *DescribeImageProcessingTemplatesRequest) {
    request = &DescribeImageProcessingTemplatesRequest{
        BaseRequest: &tchttp.BaseRequest{},
    }

    request.Init().WithApiInfo("vod", APIVersion, "DescribeImageProcessingTemplates")

    return
}

func NewDescribeImageProcessingTemplatesResponse() (response *DescribeImageProcessingTemplatesResponse) {
    response = &DescribeImageProcessingTemplatesResponse{
        BaseResponse: &tchttp.BaseResponse{},
    }
    return

}

// DescribeImageProcessingTemplates
// 获取图片处理模板列表，支持根据条件，分页查询。
//
// 可能返回的错误码:
//  FAILEDOPERATION = "FailedOperation"
//  FAILEDOPERATION_INVALIDVODUSER = "FailedOperation.InvalidVodUser"
//  INTERNALERROR = "InternalError"
//  INVALIDPARAMETER = "InvalidParameter"
//  INVALIDPARAMETERVALUE_DEFINITIONS = "InvalidParameterValue.Definitions"
//  INVALIDPARAMETERVALUE_LIMIT = "InvalidParameterValue.Limit"
//  RESOURCENOTFOUND_TEMPLATENOTEXIST = "ResourceNotFound.TemplateNotExist"
//  UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (c *Client) DescribeImageProcessingTemplates(request *DescribeImageProcessingTemplatesRequest) (response *DescribeImageProcessingTemplatesResponse, err error) {
    return c.DescribeImageProcessingTemplatesWithContext(context.Background(), request)
}

// DescribeImageProcessingTemplates
// 获取图片处理模板列表，支持根据条件，分页查询。
//
// 可能返回的错误码:
//  FAILEDOPERATION = "FailedOperation"
//  FAILEDOPERATION_INVALIDVODUSER = "FailedOperation.InvalidVodUser"
//  INTERNALERROR = "InternalError"
//  INVALIDPARAMETER = "InvalidParameter"
//  INVALIDPARAMETERVALUE_DEFINITIONS = "InvalidParameterValue.Definitions"
//  INVALIDPARAMETERVALUE_LIMIT = "InvalidParameterValue.Limit"
//  RESOURCENOTFOUND_TEMPLATENOTEXIST = "ResourceNotFound.TemplateNotExist"
//  UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (c *Client) DescribeImageProcessingTemplatesWithContext(ctx context.Context, request *DescribeImageProcessingTemplatesRequest) (response *DescribeImageProcessingTemplatesResponse, err error) {
    if request == nil {
        request = NewDescribeImageProcessingTemplatesRequest()
    }
    c.InitBaseRequest(&request.BaseRequest, "vod", APIVersion, "DescribeImageProcessingTemplates")

    if c.GetCredential() == nil {
        return nil, errors.New("Describe


e found in the LICENSE file.

/**
 * @description Tests that Number.prototype.toLocaleString throws the same exceptions as Intl.NumberFormat.
 * @author Norbert Lindenberg
 */

var locales = [null, [NaN], ["i"], ["de_DE"]];
var options = [
    {localeMatcher: null},
    {style: "invalid"},
    {style: "currency"},
    {style: "currency", currency: "ßP"},
    {maximumSignificantDigits: -Infinity}
];

locales.forEach(function (locales) {
    var referenceError, error;
    try {
        var format = new Intl.NumberFormat(locales);
    } catch (e) {
        referenceError = e;
    }
    if (referenceError === undefined) {
        $ERROR("Internal error: Expected exception was not thrown by Intl.NumberFormat for locales " + locales + ".");
    }

    try {
        var result = (0).toLocaleString(locales);
    } catch (e) {
        error = e;
    }
    if (error === undefined) {
        $ERROR("Number.prototype.toLocaleString didn't throw exception for locales " + locales + ".");
    } else if (error.name !== referenceError.name) {
        $ERROR("Number.prototype.toLocaleString threw exception " + error.name +
            " for locales " + locales + "; expected " + referenceError.name + ".");
    }
});

options.forEach(function (options) {
    var referenceError, error;
    try {
        var format = new Intl.NumberFormat([], options);
    } catch (e) {
        referenceError = e;
    }
    if (referenceError === undefined) {
        $ERROR("Internal error: Expected exception was not thrown by Intl.NumberFormat for options " +
            JSON.stringify(options) + ".");
    }

    try {
        var result = (0).toLocaleString([], options);
    } catch (e) {
        error = e;
    }
    if (error === undefined) {
        $ERROR("Number.prototype.toLocaleString didn't throw exception for options " +
            JSON.stringify(options) + ".");
    } else if (error.name !== referenceError.name) {
        $ERROR("Number.prototype.toLocaleString threw exception " + error.name +
            " for options " + JSON.stringify(options) + "; expected " + referenceError.name + ".");
    }
});

// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @description Tests that compare function is bound to its Intl.Collator.
 * @author Norbert Lindenberg
 */

$INCLUDE("testIntl.js");

var strings = ["d", "O", "od", "oe", "of", "ö", "o\u0308", "X", "y", "Z", "Z.", "𠮷野家", "吉野家", "!A", "A", "b", "C"];
var locales = [undefined, ["de"], ["de-u-co-phonebk"], ["en"], ["ja"], ["sv"]];
var options = [
    undefined,
    {usage: "search"},
    {sensitivity: "base", ignorePunctuation: true}
];

locales.forEach(function (locales) {
    options.forEach(function (options) {
        var collatorObj = new Intl.Collator(locales, options);
        var compareFunc = collatorObj.compare;
        var referenceSorted = strings.slice();
        referenceSorted.sort(function (a, b) { return collatorObj.compare(a, b); });
        var sorted = strings;
        sorted.sort(compareFunc);
        try {
            testArraysAreSame(referenceSorted, sorted);
        } catch (e) {
            e.message += " (Testing with locales " + locales + "; options " +
                (options ? JSON.stringify(options) : options) + ".)";
            throw e;
        }
    });


trim() .split("\t")
        .map(|s| s.to_string()) .collect::<Vec<String>>() })
        .collect::<Vec<Vec<String>>>();
    // Set the page
    context.set_page(A4,  Portrait);
    // Load Fonts
    context.set_font_dir_and_name( "assets\\fonts\\Roboto\\static" ,  "Roboto_Condensed");
    context.set_font_dir_and_name( "assets\\fonts\\Roboto\\static\\bold" ,  "Roboto_CondensedBold" ) ;
    // Set the font
    context.set_font_size( 12) ;
    // Set the position
    context.footer_vpos = 265.0;
    context.cur_vpos = 0.0;
    context.cur_line = 0;
    // Set the sum_work
    context.sum_work.insert( " g1amtcum" . to_string( ) ,  serde_json::Value::from( 0.0 as f64));
    context.sum_work.insert( " g2amtcum" . to_string( ) ,  serde_json::Value::from( 0.0 as f64));
    context.sum_work.insert( " g1hrcum" . to_string( ) ,  serde_json::Value::from( 0.0 as f64));
    context.sum_work.insert( " g2hrcum" . to_string( ) ,  serde_json::Value::from( 0.0 as f64));
    context.sum_work.insert( " g2item" . to_string( ) ,  serde_json::Value::from( 0.0 as f64));
    //add the structs
    context.detail.push(Box::new(MyDetail {}));
    context.page_header.push(Box::new(MyPageHeader {}));
    context.group_header.push(Box::new(MyGroupHeader {}));
    context.summary.push(Box::new(MySummary {}));
    context.footor.push( Box:: new( MyFooter {}));
        // Set maximum level
    context.max_level = 2;
        // Process the report definition
    context.exec();
    // Convert to PDF
    context.convert();
    // Save the PDF
context.save("myreport. pdf" ) ;
}

```
## サンプル追加
![Sample simple1.jpeg](https://raw.githubusercontent.com/mikeshimura/rustreport/refs/heads/master/jpeg/simple1_page-0001.jpg
)
![Sample simple1.jpeg](https://raw.githubusercontent.com/mikeshimura/rustreport/refs/heads/master/jpeg/simple1_page-0002.jpg
)
![Sample medium1.jpeg](https://raw.githubusercontent.com/mikeshimura/rustreport/refs/heads/master/jpeg/medium1_page-0001.jpg
)
![Sample medium1.jpeg](https://raw.githubusercontent.com/mikeshimura/rustreport/refs/heads/master/jpeg/medium1_page-0002.jpg
)
![Sample complex1.jpeg](https://raw.githubusercontent.com/mikeshimura/rustreport/refs/heads/master/jpeg/complex1_page-0001.jpg
)
![Sample complex1.jpeg](https://raw.githubusercontent.com/


dA2, loadA2;\n",
                j10c25 => "--:-:6:-:1  \@P6 F2F.F32.F16 loadA3, loadA3;\n",
            )
        ),

        j15c31 => "--:-:-:Y:5  \@P0 BRA.U LOOP;\n" .
                  "--:-:-:Y:5  \@P1 BRA.U REMAINDER;\n"
    );
    return '';
</CODE>

<INCLUDE file="hgemm_common_32x128.sass"/>

# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# 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.
# ******************************************************************************

[-
    our $int16;
    our $prefix = 'h';
    our $shareI = 64;
    our $shareF = 128;
    our $stepI  = 32;
    our $stepF  = 64;
    our $remapF = 1;
    our $convert = $int16 ? 'I2F.F32.S16' : 'F2F.F32.F16';
    sub convert {return $convert;}
-]

<INCLUDE file="xconv_xprop_common.sass"/>

<CONSTANT_MAPPING>
    addr_zero : 4x<64*8*2 + 128*8*2 + 0>
    szShareF  : (128*8)
    szShareI  : (64*8)

    addr_zero  : 4x<64*8*2 + 128*8*2 + 0>
    addr_mpqk  : 4x<64*8*2 + 128*8*2 + 4>
    addr_m     : 4x<64*8*2 + 128*8*2 + 4>
    addr_p     : 4x<64*8*2 + 128*8*2 + 5>
    addr_q     : 4x<64*8*2 + 128*8*2 + 6>
    addr_k     : 4x<64*8*2 + 128*8*2 + 7>
    addr_szLut : 4x<64*8*2 + 128*8*2 + 8>
    addr_lut   : 4x<64*8*2 + 128*8*2 + 10>

[+ params() +]

</CONSTANT_MAPPING>

<REGISTER_MAPPING>

     3, 2,11,10,19,18,27,26 : cx<0-7>y0
     7, 6,15,14,23,22,31,30 : cx<0-7>y1
     1, 0, 9, 8,17,16,25,24 : cx<0-7>y2
     5, 4,13,12,21,20,29,28 : cx<0-7>y3
    35,34,43,42,51,50,59,58 : cx<0-7>y4
    39,38,47,46,55,54,63,62 : cx<0-7>y5
    33,32,41,40,49,48,57,56 : cx<0-7>y6
    37,36,45,44,53,52,61,60 : cx<0-7>y7

       0


()
        .withPathSensitivity(PathSensitivity.RELATIVE)

    val projectName = project.displayName

    doLast {
        val pluginVersionsMap =
            settingsGradleKtsInput.asFile.useLines { lines ->
                lines
                    .dropWhile { it != "plugins {" }
                    .takeWhile { it != "}" }
                    .filter { it.startsWith("    id(") }
                    .associate {
                        val id = it.substringAfter("id(\"")
                            .substringBefore("\")")
                        val version = it.substringAfter("version \"")
                            .substringBefore("\"")
                        id to version
                    }
            }

        val result = buildString {
            fun checkVersion(id: String, version: String) {
                val actualVersion = pluginVersionsMap[id]
                when {
                    actualVersion == null ->
                        appendLine("plugin $id: missing")

                    actualVersion != version ->
                        appendLine("plugin $id: expected $version, actual $actualVersion")
                }
            }

            checkVersion("com.gradle.develocity", develocityVersion.get())
            checkVersion("com.gradle.common-custom-user-data-gradle-plugin", customUserDataVersion.get())
            checkVersion("org.gradle.toolchains.foojay-resolver-convention", foojayToolchainsVersion.get())
        }

        check(result.isEmpty()) {
            """
            $projectName - inconsistent plugin versions:
            ${result.prependIndent()}
            """.trimIndent()
        }
    }
}

tasks.compileKotlin {
    // pick a task that always runs to depend on the check, to make sure it always runs
    dependsOn(checkBuildSettingsLogicPluginConsistency)
}

//endregion
@file:Suppress("NOTHING_TO_INLINE")

package gln

import glm_.vec2.Vec2
import glm_.vec2.Vec2i
import glm_.vec3.Vec3
import glm_.vec3.Vec3i
import glm_.vec4.Vec4
import glm_.vec4.Vec4bool
import glm_.vec4.Vec4i
import org.lwjgl.opengl.*
import java.awt.Color
import java.nio.Buffer
import java.nio.ByteBuffer
import java.nio.IntBuffer
import java.nio.ShortBuffer

inline fun glViewport(size: Vec2i) = GL11.glViewport(0, 0, size.x, size.y)
inline fun glViewport(width: Int, height: Int) = GL11.glViewport(0, 0, width, height)
inline fun glViewport(viewport: Vec4i) = GL11.glViewport(viewport.x, viewport.y, viewport.z, viewport.w)

inline fun glScissor(size: Vec2i) = GL11.glScissor(0, 0, size.x, size.y)
inline fun glScissor(scissor: Vec4i) = GL11.glScissor(scissor.x, scissor.y, scissor.z, scissor.w)

inline fun glBlitFramebuffer(size: Vec2i) = GL30.glBlitFramebuffer(
        0, 0, size.x, size.y,
        0, 0, size.x, size.y,
        GL11.GL_COLOR_BUFFER_BIT, GL11.GL_LINEAR)

// TODO move to `gl`
inline fun glClearColor() = GL11.glClearColor(0f, 0f, 0f, 1f)
inline fun glClearColor(float: Float) = GL11.glClearColor(float, float, float, float)
inline fun glClearColor(color: Color) = GL11.glClearColor(color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 2


void OnMinColumnWidthOverridePropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            ((FastGridControl)dependencyObject).OnMinColumnWidthOverrideChanged();
        }

        #endregion

        #region MaxRowHeaderWidth

        public int? MaxRowHeaderWidth
        {
            get { return (int?)this.GetValue(MaxRowHeaderWidthProperty); }
            set { this.SetValue(MaxRowHeaderWidthProperty, value); }
        }

        public static readonly DependencyProperty MaxRowHeaderWidthProperty = DependencyProperty.Register(
            "MaxRowHeaderWidth", typeof(int?), typeof(FastGridControl), new PropertyMetadata(null, OnMaxRowHeaderWidthPropertyChanged));

        private static void OnMaxRowHeaderWidthPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            ((FastGridControl)dependencyObject).OnMaxRowHeaderWidthChanged();
        }

        #endregion

        #region RowHeightReserve

        public int RowHeightReserve
        {
            get { return (int)this.GetValue(RowHeightReserveProperty); }
            set { this.SetValue(RowHeightReserveProperty, value); }
        }

        public static readonly DependencyProperty RowHeightReserveProperty = DependencyProperty.Register(
            "RowHeightReserve", typeof(int), typeof(FastGridControl), new PropertyMetadata(5, OnRowHeightReservePropertyChanged));

        private static void OnRowHeightReservePropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            ((FastGridControl)dependencyObject).OnRowHeightReserveChanged();
        }

        #endregion

        #region WideColumnsLimit

        public int WideColumnsLimit
        {
            get { return (int)this.GetValue(WideColumnsLimitProperty); }
            set { this.SetValue(WideColumnsLimitProperty, value); }
        }

        public static readonly DependencyProperty WideColumnsLimitProperty = DependencyProperty.Register(
            "WideColumnsLimit", typeof(int), typeof(FastGridControl), new PropertyMetadata(250, OnWideColumnsLimitPropertyChanged));

        private static void OnWideColumnsLimitPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            ((FastGridControl)dependencyObject).OnWideColumnsLimitChanged();
        }

        #endregion

        private void OnAlternatingColorsChanged()


2.6 0-4.8-2.2-4.8-4.83a.5.5 0 1 1 1 0 3.87 3.87 0 0 0 3.8 3.83c2.05 0 3.87-1.8 3.87-3.88a3.88 3.88 0 0 0-3.87-3.79h-3.43z"></path></symbol>
<symbol id="icon-action-unfavourite-inner" viewBox="0 0 32 32"><path d="M14.14 20.8l6.96-6.96.96.16c.26.05.37.37.18.56l-2.77 2.83.57 3.9a.33.33 0 0 1-.48.34L16 19.9l-1.86.91zm7.59-9.46L11.06 21.98l-.28.28-.94-.94 2.46-2.46.22-1.48-2.77-2.83a.33.33 0 0 1 .18-.56l3.91-.67 1.86-3.49a.33.33 0 0 1 .58 0l1.75 3.3 3.29-3.3.94.95-.54.55z"></path></symbol>
<symbol id="icon-action-yes-inner" viewBox="0 0 32 32"><path d="M16 12.06a3.85 3.85 0 0 0-3.12-1.61 3.94 3.94 0 0 0-3.88 4c0 3.6 4.69 8.13 7 8.13 2.31 0 7-4.53 7-8.14 0-2.2-1.74-3.99-3.88-3.99-1.24 0-2.4.6-3.12 1.61z"></path></symbol>
<symbol id="icon-apple" viewBox="0 0 32 32"><path d="M23.37 15.48a5.98 5.98 0 0 0 3.63 5.5c-.02.1-.55 1.97-1.89 3.87-1.1 1.68-2.27 3.31-4.12 3.34-1.8.04-2.4-1.06-4.46-1.06-2.08 0-2.72 1.03-4.44 1.1-1.76.07-3.1-1.78-4.26-3.44-2.3-3.39-4.1-9.54-1.69-13.73a6.59 6.59 0 0 1 5.55-3.4c1.77-.05 3.4 1.19 4.49 1.19 1.06 0 3.08-1.48 5.17-1.26.87.03 3.35.35 4.95 2.7-.13.08-2.96 1.75-2.93 5.2zm-7.4-8.2c-.2-1.55.56-3.2 1.41-4.2A6.15 6.15 0 0 1 21.37 1a6.12 6.12 0 0 1-1.39 4.37c-.96 1.14-2.5 2.02-4.02 1.91z"></path></symbol>
<symbol id="icon-arrow-l" viewBox="0 0 32 32"><path d="M21.3 25.7l-9.9-10 9.9-9.4 1.4 1.4-8.5 8 8.5 8.6z"></path></symbol>
<symbol id="icon-arrow-left-light" viewBox="0 0 32 32"><path d="M23.66 1.48L22.29 0 5.54 15.99 22.3 32l1.37-1.48L8.46 15.99z"></path></symbol>
<symbol id="icon-arrow-r" viewBox="0 0 32 32"><path class="st0" d="M12.8 25.7l-1.4-1.4 8.5-8.6-8.5-8 1.4-1.4 9.9 9.4z"></path></symbol>
<symbol id="icon-arrow-


19>\x0b\x0cQ\x82\xda\xef\
\x87\xb3Z\xd9\x87)\x1c\x83\x8b\xc15\xd3w\x06\x07&\
p\x14\xa1\xd2hi%\xc2a\x9c\x80\x92\xcc\xd3\x84\xe1\
\x8a+)g\x181\xb45\xdf\x0f\x87\xd2D\xf4\xf6p\
\x84\x03\x7f\x9eH{\x93\xa33n\xe6\xa2+K\x22\x8c\
\x86U\x15\xbd\xcc\x0bL-\xffzv\xa7(tR,\
\x04\x05\xd2X\x86\xec\x84&\x1a\xe1y\x98\x97\xa0-J\
\xcd\x01\x9d\x12QZ\x7f?<\xc5\x9cnM\xcd\x8eK\
\xc1\xc0\xdc\x97f\xa9\xa9f\xa1\xd9\xa1\xdb\xb4\xda\x99\x1d\
7D+\x81t$\x11\xca\x18ng\x8a0F\xdf\xa0\
Y\x0fz\xb5\x12jbv\xe8\xfa,\xbb;\x9fd\xcf\
\x98\x1dG7$\xa5\xf3\xd8\x1c\xa1H\xeb\x01\xc7\xb5\xb5\
\xdcX\x98\x01\xb1V\xbf\xc9'\xe9\xd59\x87-\xf19\
\xc0\xef\x0b\x8e>\x13\xce\x10\x08(eZ\xcd\xa1\x98\xd2\
2\xf0$\x01\x00j4*\x8e@o\xfe\x16\x974\x08\
\xd1=\x1b-85\x82\xc2\x9d\xb1\x99\x063\x81\xeb\x08\
RQ8X\x95\xa4Zx\x18\xfd\xad\xe4\xad\xc7A\x13\
\xa0o\xa1\x13\xab\xd5\x8a\x9b\x89Yq\xaa4h{_\
t\xd4\xd4\xac0?cF\x00\x13.\xd4\x0b\x22\x85\xb5\
hj\xe8\xbb\x1933\x97\x11Q\xfe\xa6<\xe8\x1c\x1c\
\x0b\x98\x16\xda{\xd3\x9c\xa9?\x16\x8cH\x83.\xc7\x05\
z\x8c\xfa\x9a\x0b/\xb0\xc4\x89J\xe6rD.\xd5\x1b\
\xd8\xacV\x0fz\xear\xb4\xa5\x02\x1fwg\xc1JN\
C9\xba\x1cj,m\x15\x07\xc3:\x9a\x98\x17{\x94\
pJ5`\x06M\x91\x13S\x9ep\x89\x11\x00\xe2\xd2\
D\x02\xa6\x91\xaf\x0b\xde\xe2\x96\x5c\xb8\x9f\xe8\x163\x18\
\x0f\xa4\xb8/~\xe3\x8c\xf0\x10\xec\x01]\x11\x97\xac\xcd\
\xb1-n\x98\x8c\xf6\x0c\x0e_*\x8d\xfb'\xd0c\xe4\
\xb7@\xa31E\x95\x8c\xde[4\x83`\xaa\x5c\x9c\x11\
\x83y\xa2ry\x22\x07\x224\xaa\x12\xaa\x94\x01\x85y\
\xa3S\x1d\x8b\xbc\xdebz&9cz\x9cr\xce-\
\xbb\x1d\x9f8\xab\xe2|x\xd6P\xb9\xa3\xacQ\x88r\
\x07I\xb8\x157\x84\xc3x\x9b\xea\xce\x9f\x98s\xc8\xd2\
\x1as\x0e\x1d\x8eU]\x85\xa0\x1f\xdb7\x89(\xf6\x9a\
\xc8\x0d\x1d\xf4\xd5 0\xa5\x03n' \xb8Bg\x81\
\x9eE^\x02\x11\x5cg-\xd7\xa0\xc04\x19\x93\xc1\xf7\
G\x81!\x87+P\xafQ\x886\xe95\xe3dw\x84\
\xe2vZa\x1f\x9c^\xbc?\x0a\xee\xfc\xa3\xe6\x13\x14\
\x18d\xa8\xe0\x82_Dq\xdd^\xf2:\x03\x99\x9e\xe8\
\xbc\x07\x0a\xb7k\xc6\xa4~\xe2)\x0c\x12\xb2Z\xb2\x8b\
(\xe4\xcdP\x9c\xdbe\xbf\x0b\x0a\xe9\x0e\x8d\xe05\x0a\
\xccb\x99K\xf7/\xa3\xe0\xb7cq7\x16\x82\xbb=\
\x09\xf25\x0b\xcc\xd1\xacB}\xb9\x18@\x02\xc5nh\
\x22\xd3\x84\xf6]\x1c'\xc3-\x8d\x99\xe8\x85\xc0\x8d\x1e\
\xees\xc6y\xfe\x88\xc5u\xe7\x07\xd7\xa0\xa0\xd4\x9d\xb6\
\xbc?\x0a`DY5\x89!\x80)\x95\xb0\xc0.\xab\
\xc5u\xfb\x9akPD\xf6>\x1c'\xe6\xd8\xb8\xf8v\
\xe28)nH\xa4\xa4\x973\x0b\xb8a\x14q(\xee\
A/\xd0D8\xb3\x13w\x81\xa9\xb6\xa1F\x8c\xc3\xcb\
+\x18\xf4\x860Lr\x0f0\xb8{\x17\xc4\xa70\xd0\
v\x84\x80o\xd8\xc8\x0d\x1d\xc6\xbd\xa4\x17\x5c\x13#\xd8\
\xc4HPV\x03\xd3\x97C*\xdc0\x01_\xad\xd2\xbb\
\xd8\x8b0K(\xc8s\xf9\x85\x00\xa9\xd4\xe5\x04\x1cn\
\x98\x82\xff\xc5\x91\xe4V;\xf8\xf1\x8c\x0f{x\x8b{\
6}x\xd7\xc3\x0d1\x16\x84\x17\xb8c4\xa5p_\
\x1fH\xc2@|k\x0f\xdf\x1a\xc4\x9f\xb3\x98\x9b\xef\xe1\
\x17\xe1\xba\xffB\x01q\xf4\x83\x1d\x0e\xb5}\x996Z\
O\x8a6d%\x08\xc9Oyb{\x8dG\xcb\x89\x91\
Z\x80`r2\xae\xaa\xdc\x15\xddT\xafx\x97w\xa2\
\xe8V\xc5\x8dT\xc0\xf0p\xa0\xfb\x04I\xb87\x03\xd2\
\x0cj\xfa\xaf\x91\xa6UN\xd5\xddq\x9a\xa6\xc3\x94\xe9\
p\x5c\xa1\x08\xb3\xc3W\xc0U[L\xc0(-O_\
~\xb4\xf0\x16\xee\x83\x0c\xfc\xff\x0f\x91\x19%\xb1\
\x00\x00\x07y\
<\
?xml version=\x221.\
0\x22 encoding=\x22UTF\
-8\x22 standalone=\x22\
no\x22?>\x0d\x0a<svg\x0d\x0a   \
xmlns:dc=\x22http:/\
/purl.org/dc/ele\
ments/1.1/\x22\x0d\x0a   \
xmlns:cc=\x22http:/\
/creativecommons\
.org/ns#\x22\x0d\x0a   xm\
lns:rdf=\x22http://\
www.w3.org/1999/\
02/22-rdf-syntax\
-ns#\x22\x0d\x0a   xmlns:\
svg=\x22http://www.\
w3.org/2000/svg\x22\
\x0d\x0a   xmlns=\x22http\
://www.w3.org/20\
00/svg\x22\x0d\x0a   xmln\
s:sodipodi=\x22http\
://sodipodi.sour\
ceforge.net/DTD/\
sodipodi-0.dtd\x22\x0d\
\x0a   xmlns:inksca\
pe=\x22http://www.i\
nkscape.org/name\
spaces/inkscape\x22\
\x0d\x0a   width=\x2248\x22\x0d\
\x0a   height=\x2248\x22\x0d\
\x0a   viewBox=\x220 0\
 48 48\x22\x0d\x0a   vers\
ion=\x221.1\x22\x0d\x0a   id\
=\x22svg6\x22\x0d\x0a   sodi\
podi:docname=\x22ru\
n_cascade_step.s\
vg\x22\x0d\x0a   inkscape\
:version=\x220.92.2\
 (5c3e80d, 2017-\
08-06)\x22>\x0d\x0a  <met\
adata\x0d\x0a     id=\x22\
metadata12\x22>\x0d\x0a  \
  <rdf:RDF>\x0d\x0a   \
   <cc:Work\x0d\x0a   \
      rdf:about=\
\x22\x22>\x0d\x0a        <dc\
:format>image/sv\
g+xml</dc:format\
>\x0d\x0a        <dc:t\
ype\x0d\x0a           \
rdf:resource=\x22ht\
tp://purl.org/dc\
/dcmitype/StillI\
mage\x22 />\x0d\x0a      \
  <dc:title />\x0d\x0a\
      </cc:Work>\
\x0d\x0a    </rdf:RDF>\
\x0d\x0a  </metadata>\x0d\
\x0a  <defs\x0d\x0a     i\
d=\x22defs10\x22 />\x0d\x0a \
 <sodipodi:named\
view\x0d\x0a     pagec\
olor=\x22#ffffff\x22\x0d\x0a\
     bordercolo


RegExpFormatReplaceAction(matcher, replace))
}
package lexer

import "unicode"
import "github.com/c9s/c6/ast"

/*
Lexing expression with interpolation support.
*/
func lexExpr(l *Lexer) stateFn {
	var leadingSpaces = l.ignoreSpaces()

	var r, r2 = l.peek2()
	var lastToken = l.lastToken()

	// avoid double literal concat
	if lastToken != nil && lastToken.Type != ast.T_LITERAL_CONCAT {
		if leadingSpaces == 0 && lastToken != nil && lastToken.Type == ast.T_INTERPOLATION_END {
			l.emit(ast.T_LITERAL_CONCAT)
		} else if leadingSpaces == 0 && l.Offset > 0 && r == '#' && r2 == '{' {
			l.emit(ast.T_LITERAL_CONCAT)
		}
	}

	if l.matchKeywordList(ast.ExprTokenList) != nil {

	} else if l.matchKeywordList(ast.FlagTokenList) != nil {

	} else if l.matchKeywordList(ast.ForRangeKeywordTokenList) != nil {

	} else if r == 'U' && r2 == '+' {

		lexUnicodeRange(l)

	} else if unicode.IsLetter(r) {

		lexIdentifier(l)

	} else if r == '.' && r2 == '.' {

		l.next()
		l.next()
		l.emit(ast.T_RANGE)

	} else if r == '.' && unicode.IsDigit(r2) {

		// lexNumber may return lexNumber unit
		if fn := lexNumber(l); fn != nil {
			fn(l)
		}

	} else if unicode.IsDigit(r) {

		if fn := lexNumber(l); fn != nil {
			fn(l)
		}

	} else if r == '+' {

		l.next()
		l.emit(ast.T_PLUS)

	} else if r == '-' {

		if r2 == 'n' && !unicode.IsLetter(l.peekBy(3)) {

			l.next()
			l.emit(ast.T_MINUS)

			l.accept("n")
			l.emit(ast.T_N)

		} else if unicode.IsLetter(r2) {
			// XXX: Works for '-moz' or '-webkit-..' but we should move this to property lexing...
			//    like:
			//         background-image: -moz-linear-gradient(top, #81a8cb, #4477a1);

			l.next()
			lexIdentifier(l)

		} else {

			l.next()
			l.emit(ast.T_MINUS)

		}

	} else if r == '*' {

		l.next()
		l.emit(ast.T_MUL)

	} else if r == '&' {

		// '&' is allowed in expression, to make sure there is a parent selector
		l.next()
		l.emit(ast.T_PARENT_SELECTOR)

	} else if r == '%' {

		// TODO: placeholders start with '%'
		l.next()
		l.emit(ast.T_MOD)

	} else if r == '/' {

		if r2 == '*' {
			// don't emit the comment inside the expression
			lexComment(l, false)
		} else {
			l.next()
			l.emit(ast.T_DIV)
		}

	} else if r == ':' { // a port of map

		l.next()
		l.emit(ast.T_COLON)

	} else if r == ',' { // a part of map or list

		l.next()
		l.emit(ast.T_COMMA)

	} else if r == '(' {

		l.next()
		l.emit(ast.T_PAREN_OPEN)

	} else if r == ')' {

		l.next()
		l.emit(ast.T


/*
 * SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * SPDX-FileContributor: 2022-2023 Espressif Systems (Shanghai) CO LTD
 */
#include <string.h>
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/snmp.h"
#include "lwip/ethip6.h"
#include "netif/etharp.h"

#include "esp_netif.h"
#include "esp_netif_net_stack.h"

#define IFNAME0 't'
#define IFNAME1 'p'

static err_t
low_level_output(struct netif *netif, struct pbuf *p)
{
    esp_netif_t *esp_netif = esp_netif_get_handle_from_netif_impl(netif);
    char buf[1518]; /* max packet size including VLAN excluding CRC */

    if (p->tot_len > sizeof(buf)) {
        MIB2_STATS_NETIF_INC(netif, ifoutdiscards);
        LWIP_DEBUGF(NETIF_DEBUG, ("tapif: packet too large"));
        return ERR_IF;
    }

    /* initiate transfer(); */
    pbuf_copy_partial(p, buf, p->tot_len, 0);

    int ret = esp_netif_transmit(esp_netif, buf, p->tot_len);
    /* Check error */
    if (likely(ret == ESP_OK)) {
        return ERR_OK;
    }
    if (ret == ESP_ERR_NO_MEM) {
        return ERR_MEM;
    }
    return ERR_IF;
}

static void
low_level_init(struct netif *netif)
{

    /* Obtain MAC address from network interface. */
    netif->hwaddr[0] = 0x02;
    netif->hwaddr[1] = 0x12;
    netif->hwaddr[2] = 0x34;
    netif->hwaddr[3] = 0x56;
    netif->hwaddr[4] = 0x78;
    netif->hwaddr[5] = 0xab;
    netif->hwaddr_len = 6;

    /* device capabilities */
    netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP;
}

err_t lwip_tapif_init(struct netif *netif)
{
    LWIP_ASSERT("Tried to initialize tapif with NULL netif", netif != NULL);
    netif->name[0] = IFNAME0;
    netif->name[1] = IFNAME1;
#if LWIP_IPV4
    netif->output = etharp_output;
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
    netif->output_ip6 = ethip6_output;
#endif /* LWIP_IPV6 */
    netif->linkoutput = low_level_output;
    netif->mtu = 1500;

    low_level_init(netif);
    netif_set_link_up(netif);
    return ERR_OK;
}

void lwip_tapif_input(void *h, void *buffer, size_t len, void *l2_buff)
{
    struct netif *netif = h;
    struct pbuf *p;
    LWIP_ASSERT("running tapif input with NULL netif", netif != NULL);

    p = pbuf_alloc(PBUF_RAW, len, PBUF_RAM);
    if (p == NULL) {
        return;
    }
    memcpy(p->payload, buffer, len);

    /* full packet send to tcpip_thread to process */
    if (unlikely(netif->input(p, netif) != ERR_OK)) {
        LWIP_DEBUGF(NETIF_DEBUG, ("tapif_input: IP input error\n"));
        pbuf_free(p);
    }
}


currentHashMap<Any, Entry>()

  @Suppress("UNCHECKED_CAST")
  operator fun <R: Any> invoke(key: Any, block: () -> R): R =
    store.computeIfAbsent(key) { Entry(block()) }.data as R

  class Entry(val data: Any, val createdAt: Long = currentTimeMillis())
}
package app

import com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL
import com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.typesafe.config.Config
import io.jooby.Environment
import io.jooby.Kooby
import io.jooby.json.JacksonModule
import io.jooby.put
import java.net.http.HttpClient
import java.time.Duration.ofSeconds

val objectMapper = JacksonModule.create().disable(WRITE_DATES_AS_TIMESTAMPS).setSerializationInclusion(NON_NULL)
  .configure(FAIL_ON_UNKNOWN_PROPERTIES, false).registerModule(KotlinModule())!!

val httpClient = HttpClient.newBuilder().connectTimeout(ofSeconds(5)).build()

fun Kooby.registerDependencies() {
  services.put(Environment::class.java, environment)
  services.put(Config::class.java, config)
  services.put(HttpClient::class, httpClient)
  services.put(ObjectMapper::class, objectMapper)
  install(JacksonModule(objectMapper))
}
@file:JvmName("poo")

package com.github.angrypotato.kotato

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.NoRunCliktCommand
import com.github.ajalt.clikt.core.context
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.output.CliktHelpFormatter
import com.github.ajalt.clikt.output.HelpFormatter
import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.mordant.TermColors
import com.github.angrypotato.kotato.Parser
import com.github.angrypotato.kotato.Converter
import java.io.File
import com.google.gson.Gson
import com.google.gson.GsonBuilder as poo
import com.google.gson.reflect.TypeToken.*

class Empty {}

class InitOrderDemoa constructor(name: String) {
    val firstProperty = "First property: $name".also(::println)

    init {
        println("First initializer block that prints ${name}")
    }

    val secondProperty = "Second property: ${name.length}".also(::println)

    init {
        println("Second initializer block that prints ${name.length}")
    }
}

class ColorHelpFormatter : CliktHelpFormatter() {
    private val tc = TermColors(TermColors.Level.ANSI16)

    override fun renderTag(tag: String, value: String) = tc.green(super.renderTag(tag, value))
    override fun renderOptionName(name: String) = tc.yellow(super.renderOptionName(name))
    override fun renderArgumentName(name: String) = tc.yellow(super.renderArgumentName(name))
    override fun renderSubcommandName(name: String) = tc.yellow(super.renderSubcommandName(name))
    override fun renderSectionTitle(title: String) = (tc.bold + tc.underline)(super.renderSectionTitle(title))
    override fun optionMetavar(option: HelpFormatter.ParameterHelp.Option) = tc.green(super.optionMetavar(option))
}

class Kotato : NoRunCliktCommand(help =


SSLSocket(java.lang.String,%20int,%20java.net.InetAddress,%20int))
        // ///
        // /// Required features: "java-lang-String", "java-net-InetAddress"
        // #[cfg(any(feature = "all", all(feature = "java-lang-String", feature = "java-net-InetAddress")))]
        // fn new<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String>>, arg1: i32, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::net::InetAddress>>, arg3: i32) -> __jni_bindgen::std::result::Result<__jni_bindgen::Local<'env, crate::javax::net::ssl::SSLSocket>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
        //     // class.path == "javax/net/ssl/SSLSocket", java.flags == PROTECTED, .name == "<init>", .descriptor == "(Ljava/lang/String;ILjava/net/InetAddress;I)V"
        //     unsafe {
        //         let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2.into()), __jni_bindgen::AsJValue::as_jvalue(&arg3)];
        //         let (__jni_class, __jni_method) = __jni_env.require_class_method("javax/net/ssl/SSLSocket\0", "<init>\0", "(Ljava/lang/String;ILjava/net/InetAddress;I)V\0");
        //         __jni_env.new_object_a(__jni_class, __jni_method, __jni_args.as_ptr())
        //     }
        // }

        // // Not emitting: Non-public method
        // /// [SSLSocket](https://developer.android.com/reference/javax/net/ssl/SSLSocket.html#SSLSocket(java.net.InetAddress,%20int,%20java.net.InetAddress,%20int))
        // ///
        // /// Required features: "java-net-InetAddress"
        // #[cfg(any(feature = "all", all(feature = "java-net-InetAddress")))]
        // fn new<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::net::InetAddress>>, arg1: i32, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::net::InetAddress>>, arg3: i32) -> __jni_bindgen::std::result::Result<__jni_bindgen::Local<'env, crate::javax::net::ssl::SSLSocket>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
        //     // class.path == "javax/net/ssl/SSLSocket", java.flags == PROTECTED, .name == "<init>", .descriptor == "(Ljava/net/InetAddress;ILjava/net/InetAddress;I)V"
        //     unsafe {
        //         let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2.into()), __jni_bindgen::AsJValue::as_jvalue(&arg


 Arity1<A5, A6>, i: Arity1<A4, A5>, h: Arity1<A3, A4>, g: Arity1<A2, A3>, f: Arity1<A1, A2>): Arity1<A1, A7>;
export function compose<A1, A2, A3, A4, A5, A6, A7, A8>(c: Arity1<A7, A8>, p: Arity1<A6, A7>, j: Arity1<A5, A6>, i: Arity1<A4, A5>, h: Arity1<A3, A4>, g: Arity1<A2, A3>, f: Arity1<A1, A2>): Arity1<A1, A8>;
export function compose<A1, A2, A3, A4, A5, A6, A7, A8, A9>(u: Arity1<A8, A9>, c: Arity1<A7, A8>, p: Arity1<A6, A7>, j: Arity1<A5, A6>, i: Arity1<A4, A5>, h: Arity1<A3, A4>, g: Arity1<A2, A3>, f: Arity1<A1, A2>): Arity1<A1, A9>;
export function compose<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>(y: Arity1<A9, A10>, u: Arity1<A8, A9>, c: Arity1<A7, A8>, p: Arity1<A6, A7>, j: Arity1<A5, A6>, i: Arity1<A4, A5>, h: Arity1<A3, A4>, g: Arity1<A2, A3>, f: Arity1<A1, A2>): Arity1<A1, A10>;

/** So, if you need more than 10 arguments for composition, you are strange ;-) */

/**
 * Composes single-argument functions from right to left.
 *
 * compose(f, g, h) => (...args) => f(g(h(...args)))
 *
 * @param funcs functions to compose
 */

export function compose(...funcs: any[]) {
    if (funcs.length === 0) {
        return (arg: any) => arg;
    }

    if (funcs.length === 1) {
        return funcs[0];
    }

    return funcs.reduce((a, b) => (...args: any[]) => a(b(...args)));
}
import { Provider, Storable } from "./provider";
import { EventStream } from "./reactor";

export interface ControllerHost {
  addController(controller: BaseController): void;
}

export interface SyncPropOptions {
  provider: Provider;
  keyProp: string;
  syncProp: string;
}

export interface Doc extends EventStream {
  collection: Collection;
  key: any;
  cache: Map<string, Storable>;

  constructor(collection: Collection, key: any): Doc;

  get(key: string): Storable;
  set(key: string, val: Storable): void;
  update(props: Object): void;
  update(props: Map<string, Storable>): void;
  has(key: string): boolean;

  save(options: any): Promise<Doc>;
  load(options: any): Promise<Doc>;
  delete(options: any): Promise<Doc>;
}

export interface Collection extends EventStream {
  changes: EventStream;
  provider: any;
  filter: any;
  cache: Map<string, Doc>;

  constructor(): Collection;
}

export class BaseController {
  _host: ControllerHost;

  constructor(host: ControllerHost) {
    this._host = host;
    this._host.addController(this);
  }

  hostConnected(): void {}
  hostDisconnected(): void {}
  hostUpdate(changedProps: Map<string, any>): void {}
  hostUpdated(changedProps: Map<string, any>): void {}
}

export class DocController extends BaseController {
  _provider: Provider;
  _keyProp: string;

  constructor(host: ControllerHost, provider: Provider, keyProp: string) {


gth; i--;) {
                if (wysihtml5.dom.contains(uneditables[i], endContainer)) {
                  isInUneditable = true;
                }
              }

              if (!isInUneditable) dom.autoLink(endContainer.parentNode, [that.config.uneditableContainerClassname]);
            });
          }
        });

        dom.observe(this.element, "blur", function() {
          dom.autoLink(that.element, [that.config.uneditableContainerClassname]);
        });
      }

      // Assuming we have the following:
      //  http://www.google.de
      // If a user now changes the url in the innerHTML we want to make sure that
      // it's synchronized with the href attribute (as long as the innerHTML is still a url)
      var // Use a live NodeList to check whether there are any links in the document
          links           = this.sandbox.getDocument().getElementsByTagName("a"),
          // The autoLink helper method reveals a reg exp to detect correct urls
          urlRegExp       = dom.autoLink.URL_REG_EXP,
          getTextContent  = function(element) {
            var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim();
            if (textContent.substr(0, 4) === "www.") {
              textContent = "http://" + textContent;
            }
            return textContent;
          };

      dom.observe(this.element, "keydown", function(event) {
        if (!links.length) {
          return;
        }

        var selectedNode = that.selection.getSelectedNode(event.target.ownerDocument),
            link         = dom.getParentElement(selectedNode, { nodeName: "A" }, 4),
            textContent;

        if (!link) {
          return;
        }

        textContent = getTextContent(link);
        // keydown is fired before the actual content is changed
        // therefore we set a timeout to change the href
        setTimeout(function() {
          var newTextContent = getTextContent(link);
          if (newTextContent === textContent) {
            return;
          }

          // Only set href when new href looks like a valid url
          if (newTextContent.match(urlRegExp)) {
            link.setAttribute("href", newTextContent);
          }
        }, 0);
      });
    },

    _initObjectResizing: function() {
      this.commands.exec("enableObjectResizing", true);

      // IE sets inline styles after resizing objects
      // The following lines make sure that the width/height css properties
      // are copied over to the width/height attributes
      if (browser.supportsEvent("resizeend")) {
        var properties        = ["width", "height"],
            propertiesLength  = properties.length,
            element           = this.element;

        dom.observe(element, "resizeend", function(event) {
          var target = event.target || event.srcElement,
              style  = target.style,
              i      = 0,
              property;

          if (target.nodeName !== "IMG") {
            return;
          }

          for (; i<propertiesLength; i++) {
            property = properties[i];
            if (style[property]) {
              target.setAttribute(property, parseInt(style[property], 10));
              style[property] = "";
            }
          }

          // After resizing IE sometimes forgets to remove the old resize handles
          wysihtml5.quirks.redraw(element);
        });
      }
    },

    _initUndoManager: function() {
      this.undoManager = new wysihtml5.UndoManager(this.parent);
    },

    _initLineBreaking: function() {
      var that                              = this,
          USE_NATIVE_LINE_BREAK_INSIDE_TAGS = ["LI", "P", "H1", "H2", "H3", "H4", "H5",


Update` will be removed during the patch operation.

Patch your Deployment again with this new patch:
-->
使用此 patch，我们表达了希望只保留 `strategy` 对象的 `type` 键。
这样，在 patch 操作期间 `rollingUpdate` 会被删除。

使用新的 patch 重新修补 Deployment：

```shell
kubectl patch deployment retainkeys-demo --type strategic --patch-file patch-file-retainkeys.yaml
```

<!--
Examine the content of the Deployment:
-->
检查 Deployment 的内容：

```shell
kubectl get deployment retainkeys-demo --output yaml
```

<!--
The output shows that the strategy object in the Deployment does not contain the `rollingUpdate` key anymore:
-->
输出显示 Deployment 中的 `strategy` 对象不再包含 `rollingUpdate` 键：

```yaml
spec:
  strategy:
    type: Recreate
  template:
```

<!--
### Notes on the strategic merge patch using the retainKeys strategy

The patch you did in the preceding exercise is called a *strategic merge patch with retainKeys strategy*. This method introduces a new directive `$retainKeys` that has the following strategies:

- It contains a list of strings.
- All fields needing to be preserved must be present in the `$retainKeys` list.
- The fields that are present will be merged with live object.
- All of the missing fields will be cleared when patching.
- All fields in the `$retainKeys` list must be a superset or the same as the fields present in the patch.
-->
### 关于使用 retainKeys 策略的策略合并 patch 操作的说明    {#notes-on-the-strategic-merge-patch-using-the-retainkeys-strategy}

在前文练习中所执行的称作 **带 `retainKeys` 策略的策略合并 patch（Strategic Merge
Patch with retainKeys Strategy）**。
这种方法引入了一种新的 `$retainKey` 指令，具有如下策略：

- 其中包含一个字符串列表；
- 所有需要被保留的字段必须在 `$retainKeys` 列表中给出；
- 对于已有的字段，会和对象上对应的内容合并；
- 在修补操作期间，未找到的字段都会被清除；
- 列表 `$retainKeys` 中的所有字段必须 patch 操作所给字段的超集，或者与之完全一致。

<!--
The `retainKeys` strategy does not work for all objects. It only works when the value of the `patchStrategy` key in a field tag in the Kubernetes source code contains `retainKeys`. For example, the `Strategy` field of the `DeploymentSpec` struct has a `patchStrategy` of `retainKeys`:
-->
策略 `retainKeys` 并不能对所有对象都起作用。它仅对那些 Kubernetes 源码中
`patchStrategy` 字段标志值包含 `retainKeys` 的字段有用。
例如 `DeploymentSpec` 结构的 `Strategy` 字段就包含了 `patchStrategy` 为
`retainKeys` 的标志。

```go
type DeploymentSpec struct {
  ...
  // +patchStrategy=retainKeys
  Strategy DeploymentStrategy `json:"strategy,omitempty" patchStrategy:"retainKeys" ...`
  ...
}
```

<!--
You can also see the `retainKeys` strategy in the [OpenApi spec](https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json):
-->
你也可以查看
[OpenAPI 规范](https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json)中的
`retainKeys` 策略：

```yaml
"io.k8s


 {z0.d-z1.d}, pn7/z, [x0, x0, lsl #3]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

ldnt1d {z0.d-z1.d}, pn8/m, [x13, #-8, mul vl]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: expecting 'z' predication
// CHECK-NEXT: ldnt1d {z0.d-z1.d}, pn8/m, [x13, #-8, mul vl]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

ldnt1d {z0.d-z1.d}, pn8.d, [x13, #-8, mul vl]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate-as-counter register expected pn8..pn15
// CHECK-NEXT: ldnt1d {z0.d-z1.d}, pn8.d, [x13, #-8, mul vl]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

// --------------------------------------------------------------------------//
// Invalid immediate range

ldnt1d {z0.d-z3.d}, pn8/z, [x0, #-9, mul vl]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [-32, 28]
// CHECK-NEXT: ldnt1d {z0.d-z3.d}, pn8/z, [x0, #-9, mul vl]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

ldnt1d {z0.d-z3.d}, pn8/z, [x0, #-36, mul vl]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [-32, 28]
// CHECK-NEXT: ldnt1d {z0.d-z3.d}, pn8/z, [x0, #-36, mul vl]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

ldnt1d {z0.d-z3.d}, pn8/z, [x0, #32, mul vl]
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [-32, 28]
// CHECK-NEXT: ldnt1d {z0.d-z3.d}, pn8/z, [x0, #32, mul vl]
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:


c]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618818-initwithdevice?language=objc
func NewImageThresholdTruncateWithDeviceThresholdValueLinearGrayColorTransform(device metal.PDevice, thresholdValue float32, transform *float32) ImageThresholdTruncate {
	instance := ImageThresholdTruncateClass.Alloc().InitWithDeviceThresholdValueLinearGrayColorTransform(device, thresholdValue, transform)
	instance.Autorelease()
	return instance
}

func (ic _ImageThresholdTruncateClass) Alloc() ImageThresholdTruncate {
	rv := objc.Call[ImageThresholdTruncate](ic, objc.Sel("alloc"))
	return rv
}

func (ic _ImageThresholdTruncateClass) New() ImageThresholdTruncate {
	rv := objc.Call[ImageThresholdTruncate](ic, objc.Sel("new"))
	rv.Autorelease()
	return rv
}

func NewImageThresholdTruncate() ImageThresholdTruncate {
	return ImageThresholdTruncateClass.New()
}

func (i_ ImageThresholdTruncate) Init() ImageThresholdTruncate {
	rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("init"))
	return rv
}

func (i_ ImageThresholdTruncate) InitWithDevice(device metal.PDevice) ImageThresholdTruncate {
	po0 := objc.WrapAsProtocol("MTLDevice", device)
	rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("initWithDevice:"), po0)
	return rv
}

//	[Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsunaryimagekernel/2866332-initwithdevice?language=objc
func NewImageThresholdTruncateWithDevice(device metal.PDevice) ImageThresholdTruncate {
	instance := ImageThresholdTruncateClass.Alloc().InitWithDevice(device)
	instance.Autorelease()
	return instance
}

func (i_ ImageThresholdTruncate) CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdTruncate {
	po1 := objc.WrapAsProtocol("MTLDevice", device)
	rv := objc.Call[ImageThresholdTruncate](i_, objc.Sel("copyWithZone:device:"), zone, po1)
	return rv
}

// Makes a copy of this kernel object for a new device. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpskernel/1618912-copywithzone?language=objc
func ImageThresholdTruncate_CopyWithZoneDevice(zone unsafe.Pointer, device metal.PDevice) ImageThresholdTruncate {
	instance := ImageThresholdTruncateClass.Alloc().CopyWithZoneDevice(zone, device)
	instance.Autorelease()
	return instance
}

// The threshold value used to initialize the threshold filter. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618882-thresholdvalue?language=objc
func (i_ ImageThresholdTruncate) ThresholdValue() float32 {
	rv := objc.Call[float32](i_, objc.Sel("thresholdValue"))
	return rv
}

// The color transform used to initialize the threshold filter. [Full Topic]
//
// [Full Topic]: https://developer.apple.com/documentation/metalperformanceshaders/mpsimagethresholdtruncate/1618787-transform?language=objc
func (i_ ImageThresholdTruncate) Transform() *float32 {
	rv := objc.Call[*float32](i_, objc.Sel("transform"))
	return rv
}
// Code generated by DarwinKit. DO NOT EDIT.

package mps

import (
	"unsafe"

	"github.com/progrium/darwinkit/macos/metal


      case kDriverVersion:
        return;
    }
    *rv = value;
  }
  void* AllocDataSpace(Device dev, size_t nbytes, size_t alignment, DLDataType type_hint) final {
    ROCM_CALL(hipSetDevice(dev.device_id));
    ICHECK_EQ(256 % alignment, 0U) << "ROCM space is aligned at 256 bytes";
    void* ret;
    ROCM_CALL(hipMalloc(&ret, nbytes));
    return ret;
  }

  void FreeDataSpace(Device dev, void* ptr) final {
    ROCM_CALL(hipSetDevice(dev.device_id));
    ROCM_CALL(hipFree(ptr));
  }

  void CopyDataFromTo(const void* from, size_t from_offset, void* to, size_t to_offset, size_t size,
                      Device dev_from, Device dev_to, DLDataType type_hint,
                      TVMStreamHandle stream) final {
    hipStream_t hip_stream = static_cast<hipStream_t>(stream);
    from = static_cast<const char*>(from) + from_offset;
    to = static_cast<char*>(to) + to_offset;
    if (dev_from.device_type == kDLROCM && dev_to.device_type == kDLROCM) {
      ROCM_CALL(hipSetDevice(dev_from.device_id));
      if (dev_from.device_id == dev_to.device_id) {
        GPUCopy(from, to, size, hipMemcpyDeviceToDevice, hip_stream);
      } else {
        hipMemcpyPeerAsync(to, dev_to.device_id, from, dev_from.device_id, size, hip_stream);
      }
    } else if (dev_from.device_type == kDLROCM && dev_to.device_type == kDLCPU) {
      ROCM_CALL(hipSetDevice(dev_from.device_id));
      GPUCopy(from, to, size, hipMemcpyDeviceToHost, hip_stream);
    } else if (dev_from.device_type == kDLCPU && dev_to.device_type == kDLROCM) {
      ROCM_CALL(hipSetDevice(dev_to.device_id));
      GPUCopy(from, to, size, hipMemcpyHostToDevice, hip_stream);
    } else {
      LOG(FATAL) << "expect copy from/to GPU or between GPU";
    }
  }

  void StreamSync(Device dev, TVMStreamHandle stream) final {
    ROCM_CALL(hipSetDevice(dev.device_id));
    ROCM_CALL(hipStreamSynchronize(static_cast<hipStream_t>(stream)));
  }

  void SetStream(Device dev, TVMStreamHandle stream) final {
    ROCMThreadEntry::ThreadLocal()->stream = static_cast<hipStream_t>(stream);
  }

  void* AllocWorkspace(Device dev, size_t size, DLDataType type_hint) final {
    return ROCMThreadEntry::ThreadLocal()->pool.AllocWorkspace(dev, size);
  }

  void FreeWorkspace(Device dev, void* data) final {
    ROCMThreadEntry::ThreadLocal()->pool.FreeWorkspace(dev, data);
  }

  static ROCMDeviceAPI* Global() {
    static ROCMDeviceAPI* inst = new ROCMDeviceAPI();
    return inst;
  }

 private:
  static void GPUCopy(const void* from, void* to, size_t size, hipMemcpyKind kind,
                      hipStream_t stream) {
    if (stream != 0) {
      ROCM_CALL(hipMemcpyAsync(to, from, size, kind, stream));
    } else {
      ROCM_CALL(hipMemcpy(to, from, size, kind));
    }
  }
};

typedef dmlc::ThreadLocalStore<ROCMThreadEntry> ROCMThreadStore;

ROCMThreadEntry::ROCMThreadEntry() : pool(kDLROCM, ROCMDeviceAPI::Global()) {}

ROCMThreadEntry* ROCMThreadEntry::ThreadLocal() { return ROCMThreadS


:4px><input id=wgname style=float:right;width:240px maxlength=16 onkeyup=AddWatchdogUpdate()>
' + "名前" + '

';
            x += '
<input id=wgguid style=float:right;width:240px maxlength=36 onkeyup=AddWatchdogUpdate()>
' + addLink("デバイスID", 'GenerateWatchdogGuid()') + '

';
            x += '
<input id=wgstart style=float:right;width:240px maxlength=8 placeholder=3600 onkeyup=AddWatchdogUpdate()>
' + "起動（秒）" + '

';
            x += '
<input id=wgtimeout style=float:right;width:240px maxlength=8 placeholder=60 onkeyup=AddWatchdogUpdate()>
' + "タイムアウト（秒）" + '

';
            setDialogMode(11, "ウォッチドッグを追加", 3, AddWatchdogOk, x);
            AddWatchdogUpdate();
        }

        function GenerateWatchdogGuid() {
            var i, guid = '';
            for (i = 0; i < 16; i++) { guid += String.fromCharCode(random(255)); }
            Q('wgguid').value = guidToStr(rstr2hex(guid));
            AddWatchdogUpdate();
        }

        function AddWatchdogUpdate() {
            var ok = (Q('wgstart').value == '' || parseInt(Q('wgstart').value) > 0) && (Q('wgtimeout').value == '' || parseInt(Q('wgtimeout').value) > 0);
            var gc = 0, g = Q('wgguid').value.toLowerCase();
            for (var i = 0; i < g.length; i++) {
                var c = g.charCodeAt(i);
                if (c == 45) continue;
                if ((c >= 48 && c <= 57) || (c >= 97 && c <= 102)) { gc++; } else { ok = false; }
            }
            if (gc != 32) ok = false;
            QE('dlgOkButton', ok);
        }

        function AddWatchdogOk() {
            var timeout = Q('wgtimeout').value, startup = Q('wgstart').value;
            if (timeout == '') timeout = 60;
            if (startup == '') startup = 3600;
            var guid = btoa(hex2rstr(guidToStr(Q('wgguid').value.replace(/-/g, '')).replace(/-/g, '')));
            var wdog = { 'CreationClassName': 0, 'DeviceID': guid, 'StartupInterval': startup, 'SystemCreationClassName': 0, 'SystemName': 0, 'TimeoutInterval': timeout, 'MonitoredEntityDescription': Q('wgname').value };
            amtstack.Create('AMT_AgentPresenceWatchdog', wdog, AddWatchdogOk2);
        }

        function AddWatchdogOk2(stack, name, responses, status) {
            if (status != 200) {
                messagebox("番犬", "ウォッチドッグを追加できません、エラー＃" + status);
            } else {
                PullWatchdog();
            }
        }

        function addWatchdogAction(e, i) {
            var w = xxWatchdog['AMT_AgentPresenceWatchdog'].responses[i];
            var x = '
';
            x += '' + "から" + '
'
            for (var i in amtstack.WatchdogCurrentStates) {
                x += '<input id=wgsa' + i + ' type=checkbox onclick=addWatchdogActionUpdate()>


;
		case PathIterator.SEG_CUBICTO:
			generalPath.curveTo(controlPoint[0], controlPoint[1],
					controlPoint[2], controlPoint[3], controlPoint[4],
					controlPoint[5]);
			break;
		case PathIterator.SEG_CLOSE:
			generalPath.closePath();
			break;
		}
	}

	/**
	 * 將線段前部份切掉一小部份以利路徑圓滑工具使用。
	 *
	 * @return 新的啟始點
	 */
	public Point2DWithVector cutHead()
	{
		reverse();
		Point2DWithVector point2dWithVector = cutTail();
		reverse();
		return point2dWithVector;
	}

	/**
	 * 將線段後部份切掉一小部份以利路徑圓滑工具使用。
	 *
	 * @return 新的結束點
	 */
	public Point2DWithVector cutTail()
	{
		System.out.println("cut~~");
		Point2DWithVector newEnd = null;
		Point2DWithVector tailSlope = getSlope(1.0);
		if (tailSlope != null)
		{
			double newT = 1 - getLengthRatio()/* / tailSlope.getLength() */;
			// TODO 不一定《1

			Point2DWithVector headSlope = getSlope(0.0);
			System.out.println("newT=" + newT);
			CurveInformation curveInformation = new CurveInformation();
			switch (type)
			{
			case PathIterator.SEG_MOVETO:
				break;
			case PathIterator.SEG_LINETO:
				newEnd = curveInformation.getLinePoint(currentPoint.getX(),
						currentPoint.getY(), controlPoint[0], controlPoint[1],
						newT);
				controlPoint[0] = newEnd.getX();
				controlPoint[1] = newEnd.getY();
				break;
			case PathIterator.SEG_QUADTO:
				newEnd = curveInformation.getQuadPoint(currentPoint.getX(),
						currentPoint.getY(), controlPoint[0], controlPoint[1],
						controlPoint[2], controlPoint[3], newT);
				controlPoint[2] = newEnd.getX();
				controlPoint[3] = newEnd.getY();
				// TODO
				// controlPoint[0]＝controlPoint[2]－A*newSlope.x=currentPoint+B*headSlope.x
				// controlPoint[1]＝controlPoint[3]－A*newSlope.y=currentPoint+B*headSlope.y

				// controlPoint[2]-currentPoint=A*newSlope.x+B*headSlope.x
				// controlPoint[3]-currentPoint=A*newSlope.y+B*headSlope.y

				// controlPoint[2]-currentPoint=A*newSlope.x+B*headSlope.x X
				// headSlope.y
				// controlPoint[3]-currentPoint=A*newSlope.y+B*headSlope.y X
				// headSlope.x

				Point2DWithVector newSlope = curveInformation.getQuadSlope(
						currentPoint.getX(), currentPoint.getY(),
						controlPoint[0], controlPoint[1], controlPoint[2],
						controlPoint[3], newT);
				double A = ((controlPoint[2] - currentPoint.getX()) * headSlope
						.getY())
						- (controlPoint[3] - currentPoint.getY())
						* headSlope.getX();
				A /= newSlope.getX() * headSlope.getY() - newSlope.getY()
						* headSlope.getX(); // TODO DIVIDE 0
				controlPoint[0] = controlPoint[2] - A * newSlope.getX();
				controlPoint[1] = controlPoint[3] - A * new


nsert(
            TableHelper.t_like, like.toMap()) > 0){
          result++;
        }
    }

    return result;
  }

  ///获取所有未读点赞通知
  Future<int> getLikeNoticeCount() async {
    var dbClient = await _sql.db;

    if(Global.profile.user != null) {
      int? result = await Sqflite.firstIntValue(
          await dbClient.rawQuery("SELECT count(*) FROM t_like WHERE  "
              " touid=${Global.profile.user!.uid} and isread=0 "));
      if (result != null)
        return result;
      else
        return 0;
    }
    return 0;
  }

  //获取所有点赞
  Future<List<Like>> getThumbUps(int current, int offset ) async {
    var dbClient = await _sql.db;
    List<Map> maps = await dbClient.rawQuery("SELECT * FROM ${TableHelper.t_like} where  "
        "touid=${Global.profile.user!.uid} order by createtime desc limit ${current},${offset}");
    if (maps == null || maps.length == 0) {
      return [];
    }

    List<Like> list = [];
    maps.forEach((it){
      list.add(Like.fromMap(it as Map<String, dynamic>));
    });

    return list;
  }

  ///获取聊天关系中最大的sequence_id
  Future<int> getMaxReplyid(ReplyMsgType type) async {
    var dbClient = await _sql.db;
    int? result = await Sqflite.firstIntValue(await dbClient.rawQuery("SELECT replyid FROM Comment_Reply_table WHERE  "
        " touid=${Global.profile.user!.uid} and type='${type.toString()}' "
        "ORDER BY replyid desc LIMIT 1"));

    return result == null ? 0 : result;
  }

  ///获取聊天关系中最大的sequence_id
  Future<int> getMaxLikeID(int type) async {
    var dbClient = await _sql.db;
    int? result = await Sqflite.firstIntValue(await dbClient.rawQuery("SELECT likeid FROM t_like WHERE  "
        " touid=${Global.profile.user!.uid} and liketype=${type} "
        "ORDER BY likeid desc LIMIT 1"));
    return result == null ? 0 : result;
  }

  ///获取未读关注
  Future<int> getMaxFollowid() async {
    var dbClient = await _sql.db;
    int? result = await Sqflite.firstIntValue(await dbClient.rawQuery("SELECT id FROM t_Follow WHERE  "
        " uid=${Global.profile.user!.uid} "
        "ORDER BY id desc LIMIT 1"));
    return result == null ? 0 : result;
  }
  //保存未读关注
  Future<int> saveFollow(List<Follow> follows) async {
    var dbClient = await _sql.db;
    var result = 0;

    for(Follow follow in follows) {
      var tem = await Sqflite.firstIntValue(await dbClient.rawQuery("SELECT COUNT(*) FROM ${TableHelper.t_Follow} "
          "WHERE id=${follow.id} and uid=${Global.profile.user!.uid} " ));
      if(tem == 0 )
        if(await dbClient.insert(
            TableHelper.t_Follow, follow.toMap(follow)) > 0){
          result++;
        }
    }
    if(Global.isInDebugMode)
      print("follow save : ${result}" );
    return result;

  }

  ///获取本地未读留言与回复
  Future<int> getCommentReplysCount() async {
    var dbClient = await _sql.db;
    if(Global.profile.user != null) {
      int? result = await Sqflite.firstIntValue(await dbClient.rawQuery(
          "SELECT count(*) FROM Comment_Reply_table WHERE  "
              " touid=${Global.profile


// Copyright (c) 2021 <NAME> <<EMAIL>>
// All rights reserved.
//
// This software and the accompanying materials are made available under
// the terms of the ISC License which is available in the project root as LICENSE-ISC, AND/OR
// the terms of the MIT License which is available at in the project root as LICENSE-MIT, AND/OR
// the terms of the Apache License, Version 2.0 which is available in the project root as LICENSE-APACHE.
//
// You have to accept AT LEAST one of the aforementioned licenses to use, copy, modify, and/or distribute this software.
// At your will you may redistribute the software under the terms of only one, two, or all three of the aforementioned licenses.

#![forbid(unsafe_code)]
#![warn(missing_docs)]

//! TODO: doc

pub use convert_js_impl::{convert_js, Error, Exit, Result};
pub use convert_js_macros::convert_js;
<reponame>Dewyer/kado
use diesel::prelude::*;
use rocket::request::FromRequest;
use rocket::{request, Request};

use crate::crud_repo;
use crate::db::pagination::*;
use crate::db::transaction_manager::ITransaction;
use crate::errors::ServiceError;
use crate::models::team::Team;
use crate::models::user::db::{NewUser, User};
use crate::models::utils::PaginationOptions;
use crate::schema::teams;
use crate::schema::users;
use diesel::dsl::count_star;

crud_repo!(UserCrudRepo, DbUserCrudRepo, users, User, NewUser, "Users");
pub type IUserCrudRepo = Box<dyn UserCrudRepo>;

pub const DEFAULT_USER_PAGE_SIZE: usize = 25;

pub trait UserRepo {
    fn crud(&self) -> &IUserCrudRepo;

    fn create(&self, user: &NewUser, tr: &ITransaction) -> anyhow::Result<User>;

    fn find_by_email_or_username(
        &self,
        email: &str,
        username: &str,
        tm: &ITransaction,
    ) -> anyhow::Result<User>;

    fn save(&self, user: &User, td: &ITransaction) -> anyhow::Result<User>;

    fn list_leaderboard_participating_paginated_with_teams(
        &self,
        pagination: &PaginationOptions,
        td: &ITransaction,
    ) -> anyhow::Result<(Vec<(User, Option<Team>)>, usize)>;

    fn find_leaderboard_rank_of_user(
        &self,
        user: &User,
        td: &ITransaction,
    ) -> anyhow::Result<usize>;
}

pub struct DbUserRepo {
    crud: IUserCrudRepo,
}

impl DbUserRepo {
    pub fn new() -> Self {
        Self {
            crud: Box::new(DbUserCrudRepo {}),
        }
    }
}

impl UserRepo for DbUserRepo {
    fn crud(&self) -> &IUserCrudRepo {
        &self.crud
    }

    fn create(&self, user: &NewUser, tr: &ITransaction) -> anyhow::Result<User> {
        diesel::insert_into(users::table)
            .values(user)
            .get_result::<User>(tr.get_db_connection())
            .map_err(|er| anyhow::Error::from(er))
    }

    fn find_by_email_or_username(
        &self,
        email: &str,
        username: &str,
        tr: &ITransaction,
    ) -> anyhow::Result<User> {
        users::table
            .select(users::all_columns)
            .filter(users::email.eq(email))
            .or_filter(users::username.eq(username))
            .first::<User>(tr.get_db_connection())
            .map_err(|er| anyhow::Error::from(er


   %r0(%rp)
        .procend
#elif defined(__powerpc64__)
# warning IMPLEMENT ME FOR PPC64!!
	.globl flush_cache
flush_cache:
	lwz    11,  0(1)  ;
	lwz     0,  4(11) ;
	mtlr    0         ;
	lwz    31, -4(11) ;
	mr      1, 11     ;
	blr
#elif defined(__powerpc__)
# warning IMPLEMENT ME FOR PPC32!!
	.globl flush_cache
flush_cache:
	lwz    11,  0(1)  ;
	lwz     0,  4(11) ;
	mtlr    0         ;
	lwz    31, -4(11) ;
	mr      1, 11     ;
	blr
#elif defined(__arm__)
	.text
	.globl flush_cache
flush_cache:
	bx    lr
#elif defined(__tilegx__)
        .text
        .globl flush_cache
flush_cache:

        andi r0, r0, -64
1:      {
         flush r0 ;
         addi  r0, r0, 64
        }
        {
         bgtz r1, 1b ;
         addi r1, r1, -64
        }
        jrp   lr
#else
# error Need flush_cache code for this architecture.
#endif

#if defined ( __linux__) && !defined (__arm__)
        /* We do not need executable stack.  */
        .section        .note.GNU-stack,"",@progbits
#endif

#endif


 = yield props.mitoAPI.editSimpleImport([filePath]);
            if ("error" in result) {
              setImportState({
                screen: "csv_import_config",
                fileName: file.name,
                filePath,
                error: result.error
              });
            }
          })
        }
      );
    } else if (importState.screen == "csv_import_config") {
      return /* @__PURE__ */ react_default.createElement(
        CSVImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          error: importState.error,
          setScreen: setImportState
        }
      );
    } else if (importState.screen == "xlsx_import_config") {
      return /* @__PURE__ */ react_default.createElement(
        XLSXImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          setImportState
        }
      );
    } else {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
  }
  var FileImportTaskpane_default = FileImportTaskpane;

  // src/mito/components/taskpanes/FillNa/FillNaTaskpane.tsx
  init_react();
  var BOOLEAN_STRINGS = ["True", "true", "False", "false"];
  var getDefaultParams5 = (sheetDataArray, sheetIndex, defaultFillMethod, startingColumnIDs) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    const sheetData = sheetDataArray[sheetIndex];
    let finalFillMethod = defaultFillMethod || { type: "value", "value": 0 };
    if (finalFillMethod.type === "mean" || finalFillMethod.type === "median") {
      const onlyMeanAndMedianColumnSelected = Object.values(sheetData.columnDtypeMap).map((columnDtype) => isNumberDtype(columnDtype) || isDatetimeDtype(columnDtype) || isTimedeltaDtype(columnDtype)).every((hasDefinedMeanAndMedian) => hasDefinedMeanAndMedian === true);
      if (!onlyMeanAndMedianColumnSelected) {
        finalFillMethod = { type: "value", "value": 0 };
      }
    }
    const columnIDs = startingColumnIDs === void 0 ? Object.keys(sheetData.columnIDsMap) : intersection(Object.keys(sheetData.columnIDsMap), startingColumnIDs);
    return {
      sheet_index: sheetIndex,
      column_ids: columnIDs,
      fill_method: finalFillMethod
    };
  };
  var getButtonMessage4 = (sheetData, columnIDs) => {
    if (columnIDs.length === 0) {
      return "Select columns to fill NaN values";
    }
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 25);
    if (numOtherColumnHeaders === 0) {
      return `Fill NaNs in ${columnHeadersString}`;
    } else {
      return `Fill NaNs in ${columnHeadersString} and ${numOtherColumnHeaders} others`;
    }
  };
  var getSuccessMessage3 = (sheetData, columnIDs) => {
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeader


fun getTokenHighlights(tokenType: IElementType?): Array<out TextAttributesKey> {
    return pack(map(tokenType))
  }

  override fun getHighlightingLexer(): Lexer = HtlHighlightingLexer()

  private fun map(tokenType: IElementType?) = when (tokenType) {
    HtlTypes.TRUE,
    HtlTypes.FALSE -> HtlColors.BOOLEAN

    HtlTypes.SINGLE_QUOTE,
    HtlTypes.DOUBLE_QUOTE,
    HtlTypes.STRING_CONTENT -> HtlColors.STRING

    HtlTypes.VALID_STRING_ESCAPE_TOKEN -> HtlColors.VALID_ESCAPE_SEQUENCE

    HtlTypes.INVALID_CHARACTER_ESCAPE_TOKEN,
    HtlTypes.INVALID_UNICODE_ESCAPE_TOKEN -> HtlColors.INVALID_ESCAPE_SEQUENCE

    HtlTypes.INTEGER,
    HtlTypes.FLOAT -> HtlColors.NUMBER

    HtlTypes.NULL_LITERAL_TOKEN -> HtlColors.NULL

    HtlTypes.VARIABLE_NAME -> HtlColors.VARIABLE

    HtlTypes.AT -> HtlColors.DELIMITER

    HtlTypes.LBRACE,
    HtlTypes.EL_START,
    HtlTypes.RBRACE -> HtlColors.DELIMITER

    HtlTypes.LBRACKET,
    HtlTypes.RBRACKET -> HtlColors.PARENTHESES

    HtlTypes.GT,
    HtlTypes.LT,
    HtlTypes.GTE,
    HtlTypes.LTE,
    HtlTypes.AND_AND,
    HtlTypes.OR_OR,
    HtlTypes.IN -> HtlColors.OPERATOR

    HtlTypes.VAR_NAME -> HtlColors.IDENTIFIER

    HtlTypes.LSQRBRACKET,
    HtlTypes.RSQRBRACKET -> HtlColors.BRACKET

    else -> null
  }
}
package com.aemtools.lang.htl.psi.pattern

import com.aemtools.common.constant.const
import com.aemtools.common.constant.const.htl.DATA_SLY_CALL
import com.aemtools.common.constant.const.htl.DATA_SLY_INCLUDE
import com.aemtools.common.constant.const.htl.DATA_SLY_LIST
import com.aemtools.common.constant.const.htl.DATA_SLY_REPEAT
import com.aemtools.common.constant.const.htl.DATA_SLY_RESOURCE
import com.aemtools.common.constant.const.htl.DATA_SLY_SET
import com.aemtools.common.constant.const.htl.DATA_SLY_TEMPLATE
import com.aemtools.common.constant.const.htl.DATA_SLY_TEST
import com.aemtools.common.constant.const.htl.DATA_SLY_UNWRAP
import com.aemtools.common.constant.const.htl.DATA_SLY_USE
import com.aemtools.common.constant.const.htl.HTL_ATTRIBUTES
import com.aemtools.lang.htl.psi.HtlArrayLiteral
import com.aemtools.lang.htl.psi.HtlExpression
import com.aemtools.lang.htl.psi.HtlHtlEl
import com.aemtools.lang.htl.psi.HtlStringLiteral
import com.aemtools.lang.htl.psi.HtlTypes.ACCESS_IDENTIFIER
import com.aemtools.lang.htl.psi.HtlTypes.ARRAY_LIKE_ACCESS
import com.aemtools.lang.htl.psi.HtlTypes.ASSIGNMENT
import com.aemtools.lang.htl.psi.HtlTypes.ASSIGNMENT_VALUE
import com.aemtools.lang.htl.psi.HtlTypes.CONTEXT_EXPRESSION
import com.aemtools.lang.htl.psi.HtlTypes.EL_START
import com.aemtools.lang.htl.psi.HtlTypes.STRING_LITERAL
import com.aemtools.lang.htl.psi.HtlTypes.VARIABLE_NAME
import com.aemtools.lang.ht


 iterable_removable_queue_test.dart
// Tests for `IterableRemovableQueue`.
//
// 2023 April 21
// Author: Max Korbel <max.korbel@intel.com>

import 'package:rohd/src/collections/iterable_removable_queue.dart';
import 'package:test/test.dart';

class LateRemovable {
  bool doRemove = false;
  final int i;
  LateRemovable(this.i);
}

void main() {
  group('iterable removable queue', () {
    const numItems = 100;
    IterableRemovableQueue<int> buildQueue(
        {bool Function(int item)? removeWhere}) {
      final q = IterableRemovableQueue<int>(removeWhere: removeWhere);
      for (var i = 0; i < numItems; i++) {
        q.add(i);
      }
      return q;
    }

    int getCount<T>(IterableRemovableQueue<T> q) {
      var count = 0;
      q.iterate(action: (item) {
        count++;
      });
      return count;
    }

    group('forEach', () {
      test('no removal', () {
        final q = buildQueue();
        expect(getCount(q), numItems);
        expect(q.isEmpty, false);
      });

      test('remove even', () {
        final q = buildQueue(removeWhere: (i) => i.isEven)..iterate();
        expect(getCount(q), numItems / 2);
        expect(q.isEmpty, false);
      });

      test('remove odd', () {
        final q = buildQueue(removeWhere: (i) => i.isOdd)..iterate();
        expect(getCount(q), numItems / 2);
        expect(q.isEmpty, false);
      });

      test('remove all', () {
        final q = buildQueue(removeWhere: (i) => true)..iterate();
        expect(getCount(q), 0);
        expect(q.isEmpty, true);
      });
    });

    // clear
    test('clear', () {
      final q = buildQueue()..clear();
      expect(getCount(q), 0);
      expect(q.isEmpty, true);
    });

    // takeAll
    test('takeAll', () {
      final q1 = buildQueue();
      final q2 = buildQueue();
      q1.takeAll(q2);
      expect(getCount(q1), numItems * 2);
      expect(q2.isEmpty, true);
    });

    test('size', () {
      final q = buildQueue();
      expect(getCount(q), numItems);
      expect(q.size, numItems);
    });

    group('patrol', () {
      test('patrol removes even when added', () {
        final q = buildQueue(removeWhere: (i) => i.isEven);
        expect(q.size, numItems / 2);
        expect(q.isEmpty, false);
      });

      test('patrol removes later when status changes', () {
        final q = IterableRemovableQueue<LateRemovable>(
          removeWhere: (item) => item.doRemove,
        );
        final items = <LateRemovable>[];
        for (var i = 0; i < numItems; i++) {
          final item = LateRemovable(i);
          items.add(item);
          q.add(item);
        }

        q.iterate();

        expect(getCount(q), numItems);
        expect(q.isEmpty, false);
        expect(q.size, numItems);

        // Now change the status of all items to be removed.
        for (final item in items) {
          if (item.i % 3 == 0) {
            item.doRemove = true;
          }
        }

        // now add more, and make sure patrol is removing things too
        for (var i = numItems; i < numItems * 2; i++) {
          final item = LateRemo


em) => item.path,
              itemToYtId: (item) {
                if (item.ytID != null) return item.ytID;
                var filename = item.path.getFilename;
                if (filename.length >= 11) return filename.substring(0, 11);
                return null;
              },
              itemToSubtitle: (item, itemSize) => "${item.resolution}p • ${item.framerate}fps - ${itemSize.fileSizeFormatted}",
              confirmDialogText: cacheManager.getDeleteSizeSubtitleText,
              onDeleteFiles: (itemsToDelete) async {
                setState(() => totalSize = -1);
                for (final video in itemsToDelete) {
                  await [
                    File(video.path).tryDeleting(),
                    File('${video.path}.metadata').tryDeleting(),
                  ].wait;
                  if (video.ytID != null) VideoController.inst.removeNVFromCacheMap(video.ytID!, video.path);
                }
                _fillSizes();
              },
              includeLocalTracksListens: true,
              tempFilesSize: cacheManager.getTempVideosSize,
              onDeleteTempFiles: () => cacheManager.deleteTempVideos().then((_) => _fillSizes()),
            );
          },
          onDeleteEVERYTHING: () async {
            await cacheManager.deleteAllVideos();
            VideoController.inst.clearCachedVideosMap();
            if (mounted) setState(() => totalSize = 0);
          },
        );
      },
    );
  }
}

class _ClearImageCacheListTile extends StatefulWidget {
  final Color? bgColor;

  const _ClearImageCacheListTile({this.bgColor});

  @override
  State<_ClearImageCacheListTile> createState() => __ClearImageCacheListTileState();
}

class __ClearImageCacheListTileState extends State<_ClearImageCacheListTile> {
  final mainDirs = {
    AppDirs.ARTWORKS,
    AppDirs.THUMBNAILS,
    AppDirs.ARTWORKS_ARTISTS,
    AppDirs.ARTWORKS_ALBUMS,
    AppDirs.YT_THUMBNAILS,
    AppDirs.YT_THUMBNAILS_CHANNELS,
  };

  final dirsMap = <String, int>{}.obs;

  final dirsChoosen = <String>[].obs;

  int get totalBytes => dirsMap.values.fold(0, (previousValue, element) => previousValue + element);

  @override
  void initState() {
    super.initState();
    dirsChoosen.addAll([
      AppDirs.YT_THUMBNAILS,
      AppDirs.YT_THUMBNAILS_CHANNELS,
    ]);
    _fillSizes();
  }

  @override
  void dispose() {
    dirsMap.close();
    dirsChoosen.close();
    super.dispose();
  }

  void _fillSizes() async {
    final res = await _fillSizesIsolate.thready(mainDirs);
    dirsMap.value = res;
  }

  static Map<String, int> _fillSizesIsolate(Set<String> dirs) {
    final map = <String, int>{};
    for (final d in dirs) {
      map[d] = Directory(d).listSyncSafe().fold(0, (previousValue, element) => previousValue + (element is File ? element.fileSizeSync() ?? 0 : 0));
    }
    return map;
  }

  @override
  Widget build(BuildContext context) {
    return Obx(
      (context) => CustomListTile(
        bgColor: widget.bgColor,
        leading: const StackedIcon(
          baseIcon: Broken.image,
          secondaryIcon: Broken.close_circle,
        ),
        title: lang.CLEAR_IMAGE_CACHE,
        trailingText: dirsMap.isEmpty ? '?' : totalBytes.fileSizeFormatted,
        onTap: () {
          NamidaNavigator.inst.navigateDialog(
            dialog: CustomBlurryDialog(
              title: lang.CONFIGURE,
              normalTitleStyle


rial with 84, 31);
ioctl!(none tiocssoftcar with 84, 26);
ioctl!(none tiocsti with 84, 18);
ioctl!(none tiocswinsz with 84, 20);
ioctl!(none tiocvhangup with 84, 55);
// ioctl!(write ubi_iocatt with UBI_CTRL_IOC_MAGIC, 64; /*struct*/ ubi_attach_req);
ioctl!(write ubi_iocdet with UBI_CTRL_IOC_MAGIC, 65; i32);
ioctl!(write ubi_iocebch with UBI_VOL_IOC_MAGIC, 2; i32);
ioctl!(write ubi_ioceber with UBI_VOL_IOC_MAGIC, 1; i32);
ioctl!(read ubi_iocebismap with UBI_VOL_IOC_MAGIC, 5; i32);
// ioctl!(write ubi_iocebmap with UBI_VOL_IOC_MAGIC, 3; /*struct*/ ubi_map_req);
ioctl!(write ubi_iocebunmap with UBI_VOL_IOC_MAGIC, 4; i32);
// ioctl!(write ubi_iocmkvol with UBI_IOC_MAGIC, 0; /*struct*/ ubi_mkvol_req);
ioctl!(write ubi_iocrmvol with UBI_IOC_MAGIC, 1; i32);
// ioctl!(write ubi_iocrnvol with UBI_IOC_MAGIC, 3; /*struct*/ ubi_rnvol_req);
// ioctl!(write ubi_iocrsvol with UBI_IOC_MAGIC, 2; /*struct*/ ubi_rsvol_req);
// ioctl!(write ubi_iocsetvolprop with UBI_VOL_IOC_MAGIC, 6; /*struct*/ ubi_set_vol_prop_req);
// ioctl!(write ubi_iocvolcrblk with UBI_VOL_IOC_MAGIC, 7; /*struct*/ ubi_blkcreate_req);
ioctl!(none ubi_iocvolrmblk with UBI_VOL_IOC_MAGIC, 8);
ioctl!(write ubi_iocvolup with UBI_VOL_IOC_MAGIC, 0; i64);
// ioctl!(readwrite usbdevfs_ioctl with b'U', 18; /*struct*/ usbdevfs_ioctl);
// ioctl!(readwrite usbdevfs_ioctl32 with b'U', 18; /*struct*/ usbdevfs_ioctl32);
ioctl!(none usbtmc_ioctl_abort_bulk_in with USBTMC_IOC_NR, 4);
ioctl!(none usbtmc_ioctl_abort_bulk_out with USBTMC_IOC_NR, 3);
ioctl!(none usbtmc_ioctl_clear with USBTMC_IOC_NR, 2);
ioctl!(none usbtmc_ioctl_clear_in_halt with USBTMC_IOC_NR, 7);
ioctl!(none usbtmc_ioctl_clear_out_halt with USBTMC_IOC_NR, 6);
ioctl!(none usbtmc_ioctl_indicator_pulse with USBTMC_IOC_NR, 1);
// ioctl!(readwrite uvcioc_ctrl_map with b'u', 0x20; /*struct*/ uvc_xu_control_mapping);
// ioctl!(readwrite uvcioc_ctrl_query with b'u', 0x21; /*struct*/ uvc_xu_control_query);
// ioctl!(read vfat_ioctl_readdir_both with b'r', 1; [/*struct*/ __fat_dirent; 2]);
// ioctl!(read vfat_ioctl_readdir_short with b'r', 2; [/*struct*/ __fat_dirent; 2]);
// ioctl!(readwrite vidioc_create_bufs with b'V', 92; /*struct*/ v4l2_create_buffers);
// ioctl!(readwrite vidioc_cropcap with b'V', 58; /*struct*/ v4l2_cropcap);
// ioctl!(readwrite vidioc_dbg_g_chip_info with b'V', 102; /*struct*/ v4l2_dbg_chip_info);
// ioctl!(read


       // c += z1
	MOVD   R6, (R10)(R3)	// Store z[i]
	ADD    $8, R3
	BC  16, 0, loop		// bdnz

done:
	MOVD R4, c+56(FP)
	RET

// func divWW(x1, x0, y Word) (q, r Word)
TEXT ·divWW(SB), NOSPLIT, $0
	MOVD x1+0(FP), R4
	MOVD x0+8(FP), R5
	MOVD y+16(FP), R6

	CMPU R4, R6
	BGE  divbigger

	// from the programmer's note in ch. 3 of the ISA manual, p.74
	DIVDEU R6, R4, R3
	DIVDU  R6, R5, R7
	MULLD  R6, R3, R8
	MULLD  R6, R7, R20
	SUB    R20, R5, R10
	ADD    R7, R3, R3
	SUB    R8, R10, R4
	CMPU   R4, R10
	BLT    adjust
	CMPU   R4, R6
	BLT    end

adjust:
	MOVD $1, R21
	ADD  R21, R3, R3
	SUB  R6, R4, R4

end:
	MOVD R3, q+24(FP)
	MOVD R4, r+32(FP)

	RET

divbigger:
	MOVD $-1, R7
	MOVD R7, q+24(FP)
	MOVD R7, r+32(FP)
	RET

TEXT ·divWVW(SB), NOSPLIT, $0
	BR ·divWVW_g(SB)


(dom<=monthLen) {
                    return new LocalDate(year, month, (int) dom);
                }

                // 进入下一个月
                if(month<12) {
                    return new LocalDate(year, month + 1, (int) (dom - monthLen));
                }

                YEAR.checkValidValue(year + 1);

                // 进入下一年
                return new LocalDate(year + 1, 1, (int) (dom - monthLen));
            }
        }

        // 返回当前时间量的纪元天
        long epochDay = toEpochDay();

        // 加上daysToAdd
        long mjDay = Math.addExact(epochDay, daysToAdd);

        // 根据给定的纪元天构造"本地日期"
        return LocalDate.ofEpochDay(mjDay);
    }

    /*▲ 增加 ████████████████████████████████████████████████████████████████████████████████┛ */

    /*▼ 减少 ████████████████████████████████████████████████████████████████████████████████┓ */

    /**
     * Returns a copy of this date with the specified amount subtracted.
     *

     * This returns a {@code LocalDate}, based on this one, with the specified amount subtracted.
     * The amount is typically {@link Period} but may be any other type implementing
     * the {@link TemporalAmount} interface.
     *

     * The calculation is delegated to the amount object by calling
     * {@link TemporalAmount#subtractFrom(Temporal)}. The amount implementation is free
     * to implement the subtraction in any way it wishes, however it typically
     * calls back to {@link #minus(long, TemporalUnit)}. Consult the documentation
     * of the amount implementation to determine if it can be successfully subtracted.
     *

     * This instance is immutable and unaffected by this method call.
     *
     * @param amountToSubtract the amount to subtract, not null
     *
     * @return a {@code LocalDate} based on this date with the subtraction made, not null
     *
     * @throws DateTimeException   if the subtraction cannot be made
     * @throws ArithmeticException if numeric overflow occurs
     */
    /*
     * 对当前时间量的值与参数中的"时间段"求差
     *
     * 如果求差后的值与当前时间量的值相等，则直接返回当前时间量对象。
     * 否则，需要构造"求差"后的新对象再返回。
     */
    @Override
    public LocalDate minus(TemporalAmount amountToSubtract) {
        Objects.requireNonNull(amountToSubtract, "amountToSubtract");

        if(amountToSubtract instanceof Period) {
            Period periodToSubtract = (Period) amountToSubtract;
            return minusMonths(periodToSubtract.toTotalMonths()).minusDays(periodToSubtract.getDays());
        }

        return (LocalDate) amountToSubtract.subtractFrom(this);
    }

    /**
     * Returns a copy of this date with the specified amount subtracted.
     *

     * This returns a {@code LocalDate}, based on this one, with the amount
     * in terms of the unit subtracted. If it is not possible to subtract the amount,
     * because the unit is not supported or for some other reason, an exception is thrown.
     *

     * This method is equivalent to {@link #plus(long, TemporalUnit)} with the amount negated.
     * See that method for a full description of how addition, and thus subtraction, works.
     *

     * This instance is immutable and unaffected by this


from __future__ import division
import torch
from torch import nn
import numpy as np

def compute_errors_test(gt, pred):
    gt = gt.numpy()
    pred = pred.numpy()
    thresh = np.maximum((gt / pred), (pred / gt))
    a1 = (thresh < 1.25   ).mean()
    a2 = (thresh < 1.25 ** 2).mean()
    a3 = (thresh < 1.25 ** 3).mean()

    rmse = (gt - pred) ** 2
    rmse = np.sqrt(rmse.mean())

    rmse_log = (np.log(gt) - np.log(pred)) ** 2
    rmse_log = np.sqrt(rmse_log.mean())

    abs_diff = np.mean(np.abs(gt - pred))
    abs_rel = np.mean(np.abs(gt - pred) / gt)

    sq_rel = np.mean(((gt - pred)**2) / gt)

    return abs_rel, abs_diff, sq_rel, rmse, rmse_log, a1, a2, a3

def compute_errors_train(gt, pred, valid):
    abs_diff, abs_rel, sq_rel, a1, a2, a3 = 0,0,0,0,0,0
    batch_size = gt.size(0)

    for current_gt, current_pred, current_valid in zip(gt, pred, valid):
        valid_gt = current_gt[current_valid]
        valid_pred = current_pred[current_valid]

        if len(valid_gt) == 0:
            continue
        else:
            thresh = torch.max((valid_gt / valid_pred), (valid_pred / valid_gt))
            a1 += (thresh < 1.25).float().mean()
            a2 += (thresh < 1.25 ** 2).float().mean()
            a3 += (thresh < 1.25 ** 3).float().mean()

            abs_diff += torch.mean(torch.abs(valid_gt - valid_pred))
            abs_rel += torch.mean(torch.abs(valid_gt - valid_pred) / valid_gt)

            sq_rel += torch.mean(((valid_gt - valid_pred)**2) / valid_gt)

    return [metric / batch_size for metric in [abs_rel, abs_diff, sq_rel, a1, a2, a3]]


16 sequence is unfinished.
};

void init_wordbreak(void);
void set_wordbreaks_utf8 (const utf8_t  *s, size_t len, const char* lang, char *brks);
void set_wordbreaks_utf16(const utf16_t *s, size_t len, const char* lang, char *brks);
void set_wordbreaks_utf32(const utf32_t *s, size_t len, const char* lang, char *brks);

enum {
	GRAPHEMEBREAK_BREAK       = 0,
	GRAPHEMEBREAK_NOBREAK     = 1,
	GRAPHEMEBREAK_INSIDEACHAR = 2,
};
void init_graphemebreak(void);
void set_graphemebreaks_utf8 (const utf8_t  *s, size_t len, const char *lang, char *brks);
void set_graphemebreaks_utf16(const utf16_t *s, size_t len, const char *lang, char *brks);
void set_graphemebreaks_utf32(const utf32_t *s, size_t len, const char *lang, char *brks);

utf32_t ub_get_next_char_utf8 (const utf8_t  *s, size_t len, size_t *ip);
utf32_t ub_get_next_char_utf16(const utf16_t *s, size_t len, size_t *ip);
utf32_t ub_get_next_char_utf32(const utf32_t *s, size_t len, size_t *ip);

]]


s](https://github.com/arlimus))
- split of mock into transport and connection [\#7](https://github.com/inspec/train/pull/7) ([arlimus](https://github.com/arlimus))
- bugfix: add docker dependency to gemspec [\#6](https://github.com/inspec/train/pull/6) ([arlimus](https://github.com/arlimus))
- move train/plugins/common to train/extras [\#2](https://github.com/inspec/train/pull/2) ([arlimus](https://github.com/arlimus))
- add Travis [\#1](https://github.com/inspec/train/pull/1) ([arlimus](https://github.com/arlimus))

**Fixed bugs:**

- bugfix: prevent debugging info to stdout on winrm [\#22](https://github.com/inspec/train/pull/22) ([arlimus](https://github.com/arlimus))
- bugfix: fail ssh connections correctly [\#17](https://github.com/inspec/train/pull/17) ([arlimus](https://github.com/arlimus))
- bugfix: initialize mock transport to correct family [\#14](https://github.com/inspec/train/pull/14) ([arlimus](https://github.com/arlimus))

**Merged pull requests:**

- bump train version to 0.9.0 [\#24](https://github.com/inspec/train/pull/24) ([chris-rock](https://github.com/chris-rock))# CD-TM-AT-AD-L3-01-代码级单元自动化测试设计文档

能力项  [自动化测试]

# 前言

软件测试的定义是：在规定的条件下对程序进行操作，以发现程序错误，衡量软件质量，并对其是否能满足设计要求进行评估的过程。自动化测试是使用软件工具和既定程序，对软件所进行的测试活动。

面临需求时间跨度长的困难，如果有自动化测试约束，则其演变一定是一个受控的过程。这恰恰说明了实施自动化测试有非常重要的意义。相对于热补技术这种事后补救技术，自动化测试才是更根本性的质量保障手段。

根据测试金字塔分层模型最底层是单元测试，然后是API接口测试，最后是业务流程自动化测试。其中单元测试是单元软件测试的基础，通过提升单元测试的质量和覆盖率，可以帮助提升软件质量和开发效率。

# 目的

单元测试是在软件开发过程中要进行的最低级别的测试活动，在单元测试活动中，软件的独立单元将在与程序的其他部分相隔离的情况下进行测试。无论是敏捷开发、持续交付，还是测试驱动开发（TDD）都把单元测试作为实现的基石。

本文描述单元测试的要求、特点以及设计方法和工具。

# 金字塔分层模型

在敏捷方法中，持续集成是其基石，持续集成的核心是自动化测试。测试金字塔的概念来自Mike Cohn，在他的书《Succeeding with Agile》中有详细描述：测试金字塔最底层是单元测试，然后是业务逻辑测试，最后是端到端的测试（GUI或CLI）。

<img alt="Testing Layer" src="../../docs/imgs/DevOps流程/Testing_Layer.png"

这个比喻非常形象，它让你一眼就知道测试是需要分层的。


ar(--grey-silver);
    font: 1.25em/1 "kpn-ui-icons";
    position: absolute;
    right: 0
}

.sort::before {
    content: "";
    top: -0.1em
}

.sort::after {
    bottom: -0.1em;
    content: ""
}

.sort.sort--ascending::before {
    color: var(--grey-dark)
}

.sort.sort--descending::after {
    color: var(--grey-dark)
}

.tile {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: block;
    background-color: var(--grey-white);
    display: block;
    font-size: 16px;
    margin-bottom: 16px
}

.tile.tile--stretch {
    height: calc(100% - 16px)
}

.tile .tile__body {
    padding: 32px 16px;
    text-align: center
}

.tile .tile__body>:last-child {
    margin-bottom: 0
}

.tile .tile__icon {
    margin-bottom: 16px;
    color: var(--green);
    font-size: 48px
}

.tile .tile__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--grey-dark);
    font-family: "kpn-metric", "Arial", "Helvetica";
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 8px
}

.tile .p {
    font-size: inherit
}

.tooltip {
    position: relative
}

.tooltip.tooltip--active .tooltip__trigger::before {
    content: ""
}

.tooltip.tooltip--active .tooltip__body {
    border: 1px solid var(--grey-light-silver);
    box-sizing: border-box;
    display: block;
    margin-bottom: 8px;
    margin-top: 8px;
    padding: 8px 8px 8px 12px;
    position: relative
}

.tooltip.tooltip--active .tooltip__body::before {
    background-color: var(--blue);
    content: "";
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: 0;
    width: 4px
}

.tooltip .tooltip__trigger {
    align-items: center;
    background-color: transparent;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    justify-content: center;
    margin: 0;
    outline: none;
    padding: 0;
    text-decoration: none;
    user-select: none;
    color: var(--blue);
    display: inline-block;
    font: 18px "kpn-ui-icons";
    vertical-align: sub
}

.tooltip .tooltip__trigger:hover {
    color: var(--blue-dark)
}

.tooltip .tooltip__trigger::before {
    content: ""
}

.tooltip .tooltip__body {
    display: none
}

.backdrop {
    background-color: rgba(var(--grey-dark), 0.5);
    display: none;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 200
}

.backdrop.backdrop--active {
    display: block
}

.banner {
    padding: 24px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-sizing: border