 implements CompletionHandler<Integer, ByteBuffer> {
    private AsynchronousSocketChannel channel;

    public ReadCompletionHandler(AsynchronousSocketChannel channel){
        this.channel=channel;
    }

    @Override
    public  void completed(Integer result,ByteBuffer attachment){
        attachment.flip();
        byte[]body = new byte[attachment.remaining()];
        attachment.get(body);
        try {
            String req = new String(body,"UTF-8");
            System.out.println("the time server seceive order : "+req);
            String currentTime = "QUERY TIME ORDER".equalsIgnoreCase(req)? new Date(
                    System.currentTimeMillis()
            ).toString():"BAD ORDER";
            doWrite(currentTime);
        }catch (UnsupportedEncodingException e){
            e.printStackTrace();
        }
    }

    private void doWrite(String currentTime){
        if(currentTime != null&&currentTime.trim().length()>0){
            byte[]bytes=(currentTime).getBytes();
            ByteBuffer writeBuffer = ByteBuffer.allocate(bytes.length);
            writeBuffer.put(bytes);
            writeBuffer.flip();
            channel.write(writeBuffer, writeBuffer,
                    new CompletionHandler<Integer, ByteBuffer>() {
                        public void completed(Integer result, ByteBuffer attachment) {
                            // 如果没有发送完成，则继续发送
                            if(attachment.hasRemaining())
                                channel.write(attachment,attachment,this);
                        }

                        public void failed(Throwable exc, ByteBuffer attachment) {
                            try {
                                channel.close();
                            }catch (IOException e){}
                        }
                    });
        }
    }

    @Override
    public void failed(Throwable exc,ByteBuffer attachment){
        try {
            this.channel.close();
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}
package Netty.Server;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;

import java.util.Date;

/**
 * Created by Idea 14 whih "netty"
 *
 * @Auhor: karl.zhao
 * @Email: karl.zhao@qq.com
 * @Date: 2015-11-28
 * @Time: 16:13
 */
public class TimeServerHandler extends ChannelHandlerAdapter{
    // 用于网络的读写操作
    @Override
    public void channelRead(ChannelHandlerContext ctx,Object msg)
            throws Exception{
        ByteBuf buf = (ByteBuf)msg;
        byte[]req = new byte[buf.readableBytes()];
        buf.readBytes(req);
        String body = new String(req,"UTF-8");
        System.out.println("the time server order : " + body);

        String currentTime = "QUERY TIME ORDER".equalsIgnoreCase(body)?new Date(
                System.currentTimeMillis()).toString():"BAD ORDER";
        ByteBuf resp = Unpooled.copiedBuffer(currentTime.getBytes());
        ctx.write(resp);
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx)throws Exception{
        ctx.flush();   // 它的作用是把消息发送队列中的消息写入SocketChannel中发送给对方
        // 为了防止频繁的唤醒Selector进行消息发送，Netty的


       Self: Plug<F> + Plug<B>,
        F: Fn(unplug!(Self, A)) -> plug!(Self[B]);
}

impl<A> Monad for Box<A> {
    fn bind<F, B>(f: F, s: Self) -> plug!(Self[B])
    where
        Self: Plug<F> + Plug<B>,
        F: Fn(unplug!(Self, A)) -> plug!(Self[B]),
    {
        f(*s)
    }
}

impl<A: Clone> Monad for Vec<A> {
    fn bind<F, B>(f: F, s: Self) -> plug!(Self[B])
    where
        F: Fn(unplug!(Self, A)) -> plug!(Self[B]),
    {
        let res: Vec<B> = s.into_iter().map(|x| f(x)).flatten().collect();
        res
    }
}

impl<A> Monad for Option<A> {
    fn bind<F, B>(f: F, s: Self) -> plug!(Self[B])
    where
        F: Fn(unplug!(Self, A)) -> plug!(Self[B]),
    {
        match s {
            Some(x) => f(x),
            None => None,
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    ///wew lad
    fn higher_poly_demo<'a, M: Monad, A: 'a + Clone, B: 'a + Clone, F>(m: M, f: F) -> plug!(M[B])
    where
        M: Plug<A> + Plug<B> + Unplug<A = A>, //+Plug<F>+Plug<Fn(A)->plug!(M[B])>,
        M: Plug<Box<Fn(A) -> plug!(M[B])>>,
        M: Plug<F>,
        F: 'static,
        unplug!(M, F): Plug<A> + Plug<B>,
        plug!(M[B]): Monad + Unplug<A = B> + 'a,
        unplug!(plug!(M[B]), F): Plug<B>,
        F: Fn(A) -> B + 'a,
        //F:Fn(A) -> plug!(M[B]) + Clone,
    {
        let cl = Box::new(move |x| Applicative::pure(f(x)));
        Monad::bind::<Box<Fn(A) -> _>, B>(cl as Box<Fn(A) -> _>, m)
    }

    #[test]
    fn use_higher_poly() {
        let f = |x| x + 1;
        let p1 = Some(5);
        let p2 = vec![5];
        let p3 = Box::new(5);
        assert!(higher_poly_demo(p1, f) == Some(6));
        assert!(higher_poly_demo(p2, f) == vec![6]);
        assert!(higher_poly_demo(p3, f) == Box::new(6));
    }
}
mod targets;
mod menu;
mod info;

// Apps
mod home;
mod profiles;
mod settings;

use std::io::{stdin, stdout, Write};
use termion::event::Key;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use std::sync::atomic::{Ordering};

fn main() {
    //printing welcoming message, clearing the screen and going to left top corner with the cursor
    menu::banner();

    watchKeys();
}

fn watchKeys() {
    // gets the screen ready
    menu::resetScreen();
    let stdin = stdin();
    let mut stdout = stdout().into_raw_mode().unwrap();

    targets::open_app("home");

    // Gets the list of avalible apps
    let mut counter = 0;
    let mut in_menu = false;
    let apps = targets::getApps().len();

    //detecting keydown events
    for c in stdin.keys() {
        targets::THREAD_ALIVE.store(false, Ordering::Relaxed);
        match c.unwrap() {


lued input.
 * @return the inverse tangent function using \f[ \text{atan}(x) = \dfrac{x}{1 + \dfrac{x^2}{3 + \dfrac{4x^2}{5 + \dfrac{9x^2}{7 + \ddots}}}} \f]
 */

template<typename T>
constexpr
return_t<T>
atan(const T x)
noexcept
{
    return internal::atan_check( static_cast<return_t<T>>(x) );
}

#endif
/*################################################################################
  ##
  ##   Copyright (C) 2011-2018 Keith O'Hara
  ##
  ##   This file is part of the R package BMR.
  ##
  ##   The R package BMR is free software: you can redistribute it and/or modify
  ##   it under the terms of the GNU General Public License as published by
  ##   the Free Software Foundation, either version 2 of the License, or
  ##   (at your option) any later version.
  ##
  ##   The R package BMR is distributed in the hope that it will be useful,
  ##   but WITHOUT ANY WARRANTY; without even the implied warranty of
  ##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ##   GNU General Public License for more details.
  ##
  ##   You should have received a copy of the GNU General Public License
  ##   along with BMR. If not, see <http://www.gnu.org/licenses/>.
  ##
  ################################################################################*/

#include "bmpp.hpp"
#include "dsge_R.hpp"

RCPP_EXPOSED_CLASS(uhlig_R)

RCPP_MODULE(dsge_uhlig_module)
{
    using namespace Rcpp ;

    class_<bm::dsge<bm::uhlig>>( "dsge_uhlig_cpp" )
        .default_constructor()

        // basic objects
        .field( "estim_data", &bm::dsge<bm::uhlig>::estim_data )
        .field( "filter_choice", &bm::dsge<bm::uhlig>::filter_choice )

        .field_readonly( "prior_form", &bm::dsge<bm::uhlig>::prior_form )
        .field_readonly( "prior_pars", &bm::dsge<bm::uhlig>::prior_pars )

        .field_readonly( "lower_bounds", &bm::dsge<bm::uhlig>::lower_bounds )
        .field_readonly( "upper_bounds", &bm::dsge<bm::uhlig>::upper_bounds )

        .field_readonly( "dsge_draws", &bm::dsge<bm::uhlig>::dsge_draws )
    ;

    class_<dsge_uhlig_R>( "dsge_uhlig" )
        .derives<bm::dsge<bm::uhlig>>( "dsge_uhlig_cpp" )
        // .constructor<Rcpp::Function>()
        .default_constructor()

        .field( "opt_initial_lb", &dsge_uhlig_R::opt_initial_lb )
        .field( "opt_initial_ub", &dsge_uhlig_R::opt_initial_ub )
        .field( "mcmc_initial_lb", &dsge_uhlig_R::mcmc_initial_lb )
        .field( "mcmc_initial_ub", &dsge_uhlig_R::mcmc_initial_ub )

        .property( "lrem", &dsge_uhlig_R::get_lrem_R, &dsge_uhlig_R::set_lrem_R )
        // .property( "model", &dsge_uhlig_R::get_model_fn


,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1)}.envcontainer-top .row{margin:0!important}.envcontainer-top .active{background-color:#546478}.envcontainer dl dd.active{background-color:#546478;color:#fff}.current-env{display:block;padding:0;font-size:14px;margin:0 0 5px;text-align:center}.current-env a{color:#666;text-decoration:none}.product-nav-title{height:70px;line-height:70px;margin:0;text-align:center;padding:0;font-size:14px;background:#d9dee4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333}.console-title{padding:16px 0}.topbar-nav-item-title{margin:0 0 10px 31px;color:#666;font-weight:700}.dl{height:100%;width:125px;overflow:auto;margin:0 15px 15px 0}.dd{height:24px;line-height:24px;overflow-x:hidden;padding-left:12px;margin-left:20px}.active{color:#fff}.dd:hover{cursor:pointer;opacity:.7;filter:70}.cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:700;color:#5a5cad}.cm-s-xq-light span.cm-atom{color:#6c8cd5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-type,.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080ff;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7ea656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3f7f7f}.cm-s-xq-light span.cm-attribute{color:#7f007f}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-xq-light .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important;background:#ff0}.CodeMirror{border:1px solid #eee}.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9999}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px 4px 4px 4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transi


gress) GetAliOSS() *AliOSSUpload {
	if x != nil {
		if x, ok := x.Output.(*AutoTrackEgress_AliOSS); ok {
			return x.AliOSS
		}
	}
	return nil
}

type isAutoTrackEgress_Output interface {
	isAutoTrackEgress_Output()
}

type AutoTrackEgress_S3 struct {
	S3 *S3Upload `protobuf:"bytes,2,opt,name=s3,proto3,oneof"`
}

type AutoTrackEgress_Gcp struct {
	Gcp *GCPUpload `protobuf:"bytes,3,opt,name=gcp,proto3,oneof"`
}

type AutoTrackEgress_Azure struct {
	Azure *AzureBlobUpload `protobuf:"bytes,4,opt,name=azure,proto3,oneof"`
}

type AutoTrackEgress_AliOSS struct {
	AliOSS *AliOSSUpload `protobuf:"bytes,6,opt,name=aliOSS,proto3,oneof"`
}

func (*AutoTrackEgress_S3) isAutoTrackEgress_Output() {}

func (*AutoTrackEgress_Gcp) isAutoTrackEgress_Output() {}

func (*AutoTrackEgress_Azure) isAutoTrackEgress_Output() {}

func (*AutoTrackEgress_AliOSS) isAutoTrackEgress_Output() {}

var File_livekit_egress_proto protoreflect.FileDescriptor

const file_livekit_egress_proto_rawDesc = "" +
	"\n" +
	"\x14livekit_egress.proto\x12\alivekit\x1a\x14livekit_models.proto\"\xd5\x06\n" +
	"\x1aRoomCompositeEgressRequest\x12\x1b\n" +
	"\troom_name\x18\x01 \x01(\tR\broomName\x12\x16\n" +
	"\x06layout\x18\x02 \x01(\tR\x06layout\x12\x1d\n" +
	"\n" +
	"audio_only\x18\x03 \x01(\bR\taudioOnly\x127\n" +
	"\faudio_mixing\x18\x0f \x01(\x0e2\x14.livekit.AudioMixingR\vaudioMixing\x12\x1d\n" +
	"\n" +
	"video_only\x18\x04 \x01(\bR\tvideoOnly\x12&\n" +
	"\x0fcustom_base_url\x18\x05 \x01(\tR\rcustomBaseUrl\x124\n" +
	"\x04file\x18\x06 \x01(\v2\x1a.livekit.EncodedFileOutputB\x02\x18\x01H\x00R\x04file\x123\n" +
	"\x06stream\x18\a \x01(\v2\x15.livekit.StreamOutputB\x02\x18\x01H\x00R\x06stream\x12>\n" +
	"\bsegments\x18\n" +
	" \x01(\v2\x1c.livekit.SegmentedFileOutputB\x02\x18\x01H\x00R\bsegments\x128\n" +
	"\x06preset\x18\b \x01(\x0e2\x1e.livekit.EncodingOptionsPresetH\x01R\x06preset\x126\n" +
	"\badvanced\x18\t \x01(\v2\x18.livekit.EncodingOptionsH\x01R\badvanced\x12=\n" +
	"\ffile_outp


�，但未修补的系统仍然容易受到通过武器化图像或文档的路过式攻击。

“虽然没有观察到野外漏洞利用，但漏洞利用的简单性需要立即修补，”研究人员警告说。企业应该：
- 部署网络入侵系统以阻止具有无效 CLUT 偏移量的 ICC 配置文件。

- 审计依赖 sips 进行批量图像处理的工作流程。

- 对处理不受信任的映像文件的 macOS 设备进行分段，直到应用更新。

此披露凸显了安全性不足的映像解析工具的风险，这是现代作系统中常见的攻击面。

随着 HDR 和广色域显示器的色彩管理变得越来越复杂，对图形子系统的严格验证对于防止内存损坏漏洞变得至关重要。

**免责声明**
：

本公众号所载文章为本公众号原创或根据网络搜索下载编辑整理，文章版权归原作者所有，仅供读者学习、参考，禁止用于商业用途。因转载众多，无法找到真正来源，如标错来源，或对于文中所使用的图片、文字、链接中所包含的软件/资料等，如有侵权，请跟我们联系删除，谢谢！

![图片](https://mmbiz.qpic.cn/mmbiz_jpg/1QIbxKfhZo5lNbibXUkeIxDGJmD2Md5vKicbNtIkdNvibicL87FjAOqGicuxcgBuRjjolLcGDOnfhMdykXibWuH6DV1g/640?wx_fmt=other&from=appmsg&wxfrom=5&wx_lazy=1&wx_co=1&tp=webp "")

#  poc | Windows 远程桌面网关 (RD Gateway) CVE-2025-21297介绍
唐天闻  独眼情报   2025-05-19 02:35

文章地址为：https://v-v.space/2025/05/15/CVE-2025-21297/
已取得大佬转载同意，赛博昆仑的大佬是真滴多啊。 对作者敢兴趣的可以关注大佬的 x ，@vv474172261

时隔多月, 也是时候分享一个RDG的案例了. 这是一个全局变量初始化竞争导致的UAF问题. 在azure的挖掘中, 我渐渐熟悉了在开源软件里发现竞争性漏洞的感觉, 在这个case里, 我在binary程序中也找到了发现竞争漏洞的感觉.
## 配置RDG环境
1. 准备虚拟机, 安装未修补漏洞的windows server.

1. 安装 RDG 服务

![1724930738398](https://mmbiz.qpic.cn/sz_mmbiz_png/KgxDGkACWnTBw7JOXtTaU1HZXHoanhEtUP8YqKJ4ibMcHKwAoKe3tod8jwgcllcODTyojtlQibTgtF6pSqX9aOKg/640?wx_fmt=png&from=appmsg "")

1724930738398

![1724930805655](https://mmbiz.qpic.cn/sz_mmbiz_png/KgxDGkACWnTBw7JOXtTaU1HZXHoanhEtmyTlL


0x03, 0x04, 0x00, 0x00, 0x01, 0xcd, 0x00, 0x00, 0x00, 0x6b
                };

                GumpButtonClick gumpButtonClick = new GumpButtonClick();

                try
                {
                    gumpButtonClick.Parse( packet, packet.Length, PacketDirection.Outgoing );
                }
                catch ( Exception )
                {
                    Assert.Fail();
                    throw;
                }
            } );
        }

        [TestMethod]
        public void LegacyCastSpellRequest()
        {
            Engine.ClientVersion = new Version( 6, 0, 14, 1 ); // before the packet switch

            CastSpell classUnderTest = new CastSpell( 32 ); // Recall

            // 0x33, 0x32, 0x00 = "32"
            byte[] expectedCastRecallPacket = new byte[] { 0x12, 0x00, 0x07, 0x56, 0x33, 0x32, 0x00 };

            CollectionAssert.AreEqual( expectedCastRecallPacket, classUnderTest.ToArray() , "The produced legacy cast spell packet was not as expected.");

            string result = classUnderTest.Parse( expectedCastRecallPacket, 7,
                PacketDirection.Outgoing );

            Assert.AreEqual( "Cast(\"Recall\")\r\n", result, "The parsed legacy cast spell packet did not produce the correct textual representation." );
        }

        //[TestMethod]
        //public void WillWaitForGumpUncompressedGumps()
        //{
        //    AppDomain appDomain = AppDomain.CreateDomain( "WillWaitForGumpUncompressedGumps",
        //        AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.SetupInformation );

        //    appDomain.DoCallBack( () =>
        //    {
        //        byte[] packet =
        //        {
        //            0xB0, 0x03, 0x1F, 0x03, 0x2F, 0x5E, 0xBC, 0xF1, 0xA5, 0xFA, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00,
        //            0x00, 0x00, 0x32, 0x01, 0xB4, 0x7B, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x30, 0x20, 0x7D, 0x7B,
        //            0x20, 0x72, 0x65, 0x73, 0x69, 0x7A, 0x65, 0x70, 0x69, 0x63, 0x20, 0x34, 0x30, 0x20, 0x34, 0x30,
        //            0x20, 0x35, 0x31, 0x37, 0x30, 0x20, 0x33, 0x36, 0x30, 0x20, 0x33, 0x32, 0x35, 0x20, 0x7D, 0x7B,


					Name:   "foo",
					Tenant: testTenant,
				},
				Spec: storage.VolumeAttachmentSpec{
					Attacher: "valid-attacher",
					Source: storage.VolumeAttachmentSource{
						PersistentVolumeName: &invalidPVName,
					},
					NodeName: "valid-node",
				},
			},
			false,
			true,
		},
		{
			"invalid attacher name",
			&storage.VolumeAttachment{
				ObjectMeta: metav1.ObjectMeta{
					Name:   "foo",
					Tenant: testTenant,
				},
				Spec: storage.VolumeAttachmentSpec{
					Attacher: "invalid!@#$%^&*()",
					Source: storage.VolumeAttachmentSource{
						PersistentVolumeName: &validPVName,
					},
					NodeName: "valid-node",
				},
			},
			false,
			true,
		},
		{
			"invalid volume attachment",
			&storage.VolumeAttachment{
				ObjectMeta: metav1.ObjectMeta{
					Name:   "foo",
					Tenant: testTenant,
				},
				Spec: storage.VolumeAttachmentSpec{
					Attacher: "invalid!@#$%^&*()",
					Source: storage.VolumeAttachmentSource{
						PersistentVolumeName: nil,
					},
					NodeName: "valid-node",
				},
			},
			true,
			true,
		},
	}

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {

			testValidation := func(va *storage.VolumeAttachment, apiVersion string) field.ErrorList {
				ctx := genericapirequest.WithRequestInfo(genericapirequest.NewContext(), &genericapirequest.RequestInfo{
					APIGroup:   "storage.k8s.io",
					APIVersion: apiVersion,
					Resource:   "volumeattachments",
				})
				return Strategy.Validate(ctx, va)
			}

			v1Err := testValidation(test.volumeAttachment, "v1")
			if len(v1Err) > 0 && !test.expectV1Error {
				t.Errorf("Validation of v1 object failed: %+v", v1Err)
			}
			if len(v1Err) == 0 && test.expectV1Error {
				t.Errorf("Validation of v1 object unexpectedly succeeded")
			}

			betaErr := testValidation(test.volumeAttachment, "v1beta1")
			if len(betaErr) > 0 && !test.expectBetaError {
				t.Errorf("Validation of v1beta1 object failed: %+v", betaErr)
			}
			if len(betaErr) == 0 && test.expectBetaError {
				t.Errorf("Validation of v1beta1 object unexpectedly succeeded")
			}
		})
	}
}
/*
Copyright 2018 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package polymorphichelpers

import (
	"errors"
	"fmt"
	"time"

	appsv1 "k8s.io/api/apps/v1"
	appsv1beta1 "k8s.io/api/apps/v1beta1"
	appsv1beta2 "k8s.io/api/apps/v1beta2"
	extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/kubernetes/pkg/kubectl/scheme"
)

func defaultObjectRestarter(obj runtime


#####
# Now, comes the main part of dataset simulation. We create an in-memory
# observation and an empty dataset. We then predict the number of counts
# for the given model, and Poisson fluctuate it using ``fake()`` to make
# a simulated counts maps. Keep in mind that it is important to specify
# the ``selection`` of the maps that you want to produce
#

# Create an in-memory observation
location = observatory_locations["ctao_south"]
obs = Observation.create(
    pointing=pointing, livetime=livetime, irfs=irfs, location=location
)
print(obs)

# Make the MapDataset
maker = MapDatasetMaker(selection=["exposure", "background", "psf", "edisp"])

maker_safe_mask = SafeMaskMaker(methods=["offset-max"], offset_max=4.0 * u.deg)

dataset = maker.run(empty, obs)
dataset = maker_safe_mask.run(dataset, obs)
print(dataset)

# Add the model on the dataset and Poisson fluctuate
dataset.models = models
dataset.fake()
# Do a print on the dataset - there is now a counts maps
print(dataset)

######################################################################
# Now use this dataset as you would in all standard analysis. You can plot
# the maps, or proceed with your custom analysis. In the next section, we
# show the standard 3D fitting as in :doc:`/tutorials/analysis-3d/analysis_3d`
# tutorial.
#

# To plot, eg, counts:
dataset.counts.smooth(0.05 * u.deg).plot_interactive(add_cbar=True, stretch="linear")
plt.show()

######################################################################
# Fit
# ---
#
# In this section, we do a usual 3D fit with the same model used to
# simulated the data and see the stability of the simulations. Often, it
# is useful to simulate many such datasets and look at the distribution of
# the reconstructed parameters.
#

models_fit = models.copy()

# We do not want to fit the background in this case, so we will freeze the parameters
models_fit["dataset-simu-bkg"].spectral_model.norm.frozen = True
models_fit["dataset-simu-bkg"].spectral_model.tilt.frozen = True

dataset.models = models_fit
print(dataset.models)

fit = Fit(optimize_opts={"print_level": 1})
result = fit.run(datasets=[dataset])

dataset.plot_residuals_spatial(method="diff/sqrt(model)", vmin=-0.5, vmax=0.5)
plt.show()

######################################################################
# Compare the injected and fitted models:
#

print(
    "True model: \n",
    model_simu,
    "\n\n Fitted model: \n",
    models_fit["model-simu"],
)

######################################################################
# Get the errors on the fitted parameters from the parameter table
#

display(result.parameters.to_table())


element vector.
 * @private
 */
Utils.normalizeVector = function(v) {
  let n = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
  if (n > exports.EPSILON_FLOAT) {
    n = 1 / n;
    v[0] *= n;
    v[1] *= n;
    v[2] *= n;
  }
  return v;
};

/**
 * Cross-product between two 3-d vectors.
 * @param {Float32Array} a 3-element vector.
 * @param {Float32Array} b 3-element vector.
 * @return {Float32Array}
 * @private
 */
Utils.crossProduct = function(a, b) {
  return [
    a[1] * b[2] - a[2] * b[1],
    a[2] * b[0] - a[0] * b[2],
    a[0] * b[1] - a[1] * b[0],
  ];
};

module.exports = Utils;

---
title: Resonance Audio Wwise Plugin Reference
layout: default
exclude_from_menu: true
---
<!DOCTYPE html>

  <title>WwiseResonanceAudio Class Reference</title>
  <link rel="stylesheet" href="/resonance-audio/css/default.css"/>

WwiseResonanceAudio

This is the main Resonance Audio class that communicates with the Wwise Unity integration.

Summary

Native functions of the system can only be called through this class to preserve the internal system functionality.

Public attributes

        maxGainDb = 24.0f

          const float

Maximum allowed gain value in decibels.

        maxReflectivity = 2.0f

          const float

Maximum allowed reflectivity multiplier of a room surface material.

        maxReverbBrightness = 1.0f

          const float

Maximum allowed reverb brightness modifier value.

        maxReverb


// Copyright 2021 The XLS Authors
//
// 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.

#ifndef XLS_NOC_CONFIG_NG_NODE_OPTIONS_PROTO_BUILDER_H_
#define XLS_NOC_CONFIG_NG_NODE_OPTIONS_PROTO_BUILDER_H_

#include <cstdint>
#include <string_view>

#include "xls/noc/config_ng/coordinate_options_proto_builder.h"
#include "xls/noc/config_ng/topology_options_network_config_builder.pb.h"

namespace xls::noc {

// A builder to aid in constructing a node options proto.
class NodeOptionsProtoBuilder {
 public:
  // Constructor storing the proto pointer as a class member.
  // proto_ptr cannot be nullptr. Does not take ownership of the proto_ptr. The
  // proto_ptr must refer to a valid object that outlives this object.
  explicit NodeOptionsProtoBuilder(NodeOptionsProto* proto_ptr);

  // Constructor storing the proto pointer as a class member and sets the fields
  // of the proto to default_proto.
  // proto_ptr cannot be nullptr. Does not take ownership of the proto_ptr. The
  // proto_ptr must refer to a valid object that outlives this object.
  NodeOptionsProtoBuilder(NodeOptionsProto* proto_ptr,
                          const NodeOptionsProto& default_proto);

  // Copy the field values of the proto message object from another builder
  // to the builder.
  NodeOptionsProtoBuilder& CopyFrom(const NodeOptionsProtoBuilder& builder);

  // Sets the name of the node options.
  NodeOptionsProtoBuilder& SetName(std::string_view name);

  // Sets the send port count of the node options.
  NodeOptionsProtoBuilder& SetSendPortCount(int64_t send_port_count);

  // Sets the recv port count of the node options.
  NodeOptionsProtoBuilder& SetRecvPortCount(int64_t recv_port_count);

  // Adds the coordinate to the node options.
  NodeOptionsProtoBuilder& AddCoordinate(
      const CoordinateOptionsProtoBuilder& builder);
  CoordinateOptionsProtoBuilder AddCoordinate();

 private:
  NodeOptionsProto* proto_ptr_;
};

}  // namespace xls::noc

#endif  // XLS_NOC_CONFIG_NG_NODE_OPTIONS_PROTO_BUILDER_H_


Color(pressColor: Int) {
        this.pressColor = pressColor
    }

    /**
     * set radius
     *
     * @param radius
     */
    fun setRadius(radius: Int) {
        this.radius = radius
        invalidate()
    }

    /**
     * set shape,1 is circle, 2 is rectangle
     *
     * @param shapeType
     */
    fun setShapeType(shapeType: Int) {
        this.shapeType = shapeType
        invalidate()
    }

    companion object {
        // default bitmap config
        private val BITMAP_CONFIG = Bitmap.Config.ARGB_8888
        private const val COLORDRAWABLE_DIMENSION = 1
    }
}package com.knight.kotlin.library_widget

import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.BitmapShader
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.Paint
import android.graphics.Path
import android.graphics.Region
import android.graphics.Shader
import android.util.AttributeSet
import android.view.View
import androidx.annotation.DrawableRes

/**
 * @author created by luguian
 * @organize
 * @Date 2025/6/18 17:23
 * @descript:
 */
class InfiniteScrollImageView @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null
) : View(context, attrs) {

    private var bitmap: Bitmap? = null
    private var shader: BitmapShader? = null
    private val paint = Paint(Paint.ANTI_ALIAS_FLAG)
    private val matrix = Matrix()
    private var offset = 0f
    var scrollSpeed = 1f

    private val frameDelay = 16L

    // === 避让区域 ===
    private var avoidCx = -1f
    private var avoidCy = -1f
    private var avoidRadius = -1f
    private val path = Path()

    private val scrollRunnable = object : Runnable {
        override fun run() {
            offset += scrollSpeed
            invalidate()
            postDelayed(this, frameDelay)
        }
    }

    fun setBitmapResource(@DrawableRes resId: Int) {
        bitmap = BitmapFactory.decodeResource(resources, resId)
        bitmap?.let {
            shader = BitmapShader(it, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP)
            paint.shader = shader
        }
    }

    /**
     * 设置要避开的圆形区域
     */
    fun setAvoidCircle(cx: Float, cy: Float, radius: Float) {
        avoidCx = cx
        avoidCy = cy
        avoidRadius = radius
        invalidate()
    }

    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
        shader?.let {
            matrix.setTranslate(-offset, 0f)
            it.setLocalMatrix(matrix)
            paint.shader = it

            canvas.save()

            // 如果设置了避让圆，则剪掉这部分区域
            if (avoidCx > 0 && avoidCy > 0 && avoidRadius > 0) {
                path.reset()
                path.addCircle(avoidCx, avoidCy, avoidRadius, Path.Direction.CCW)

                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
                    canvas.clipOutPath(path)
                } else {
                    @Suppress("DEPRECATION")
                    canvas.clipPath(path, Region.Op.DIFFERENCE)
                }
            }

            // 绘制云图
            canvas.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paint)

            canvas.restore()
        }
    }

    fun startScroll() {
        removeCallbacks(scrollRunnable)
        post(scrollRunnable)
    }

    fun stopScroll() {
        removeCallbacks(scrollRunnable)
    }

    override fun onDetachedFromWindow() {
        super.


csv
    ## 3                     2014-02-26_BRAFWTNEGASSAY_FFPEDNA-CRC-1-41_D08.csv
    ## 4             2014-03-05_BRAFWTNEGASSAY_FFPEDNA-CRC-REPEAT_platefile.csv
    ## 5                         2016-04-01_BRAFWTNEGASSAY_FFPEDNA-CRC-1-41.csv

Inconsistent file names
-----------------------

``` r
path <- system.file("examples", "dataset_2", package = "dirdf")
dir(path)
```

    ## [1] "2011-12-16_OTHERASSAY_FFPEDNA-CRC-1-41_D08.csv"
    ## [2] "2013-06-26_OTHERASSAY_Plasmid-Cellline-100-1MutantFraction_B02.csv"
    ## [3] "2014-03-05_OTHERASSAY_FFPEDNA-CRC-REPEAT_platefile.csv"
    ## [4] "2014-07-06_OTHERASSAY_Plasmid-Cellline-100-1MutantFraction_B01.csv"
    ## [5] "2016-01-11_OTHERASSAY_FFPEDNA-CRC-2-41.csv"

``` r
dirdf::dirdf(path, template = "date_assay_experiment_well.ext")
```

    ## Error in dirdf_parse(pathnames, template = template, colnames = colnames, : Unexpected path(s) found:
    ## 2016-01-11_OTHERASSAY_FFPEDNA-CRC-2-41.csv

``` r
dirdf::dirdf(path, template = "date_assay_experiment_well?.ext")
```

    ##         date      assay                           experiment      well ext
    ## 1 2011-12-16 OTHERASSAY                     FFPEDNA-CRC-1-41       D08 csv
    ## 2 2013-06-26 OTHERASSAY Plasmid-Cellline-100-1MutantFraction       B02 csv
    ## 3 2014-03-05 OTHERASSAY                   FFPEDNA-CRC-REPEAT platefile csv
    ## 4 2014-07-06 OTHERASSAY Plasmid-Cellline-100-1MutantFraction       B01 csv
    ## 5 2016-01-11 OTHERASSAY                     FFPEDNA-CRC-2-41      <NA> csv
    ##                                                             pathname
    ## 1                     2011-12-16_OTHERASSAY_FFPEDNA-CRC-1-41_D08.csv
    ## 2 2013-06-26_OTHERASSAY_Plasmid-Cellline-100-1MutantFraction_B02.csv
    ## 3             2014-03-05_OTHERASSAY_FFPEDNA-CRC-REPEAT_platefile.csv
    ## 4 2014-07-06_OTHERASSAY_Plasmid-Cellline-100-1MutantFraction_B01.csv
    ## 5                         2016-01-11_OTHERASSAY_FFPEDNA-CRC-2-41.csv

Metadata in directory and path names
------------------------------------

``` r
> dir("examples/", recursive = TRUE)
 [1] "LabA,2016/2013-06-26_BRAFWTNEG_Plasmid-Cellline-100_A01.csv"
 [2] "LabA,2016/2013-06-26_BRAFWTNEG_Plasmid-Cellline-100_A02.csv"
 [3] "LabA,2016/2014-02-26_BRAFWTNEG_FFPEDNA-CRC-1-41_D08.csv"
 [4] "LabA,2016/2014-03-05_BRAFWTNEG_FFPEDNA-CRC-REPEAT_H03.csv"
 [5] "LabA,2016/2016-04-01_BRAFWTNEG_FFPEDNA-CRC-1-


77bb4', '#e0773c', '#a98d63'],
	Concourse6 = ['#2da2bf', '#da1f28', '#eb641b', '#39639d', '#474b78', '#7d3c4a'],
	Couture6 = ['#9e8e5c', '#a09781', '#85776d', '#aeafa9', '#8d878b', '#6b6149'],
	Crop6 = ['#8c8d86', '#e6c069', '#897b61', '#8dab8e', '#77a2bb', '#e28394'],
	Damask6 = ['#9ec544', '#50bea3', '#4a9ccc', '#9a66ca', '#c54f71', '#de9c3c'],
	Depth6 = ['#41aebd', '#97e9d5', '#a2cf49', '#608f3d', '#f4de3a', '#fcb11c'],
	Dividend6 = ['#4d1434', '#903163', '#b2324b', '#969fa7', '#66b1ce', '#40619d'],
	Droplet6 = ['#2fa3ee', '#4bcaad', '#86c157', '#d99c3f', '#ce6633', '#a35dd1'],
	Elemental6 = ['#629dd1', '#297fd5', '#7f8fa9', '#4a66ac', '#5aa2ae', '#9d90a0'],
	Equity6 = ['#d34817', '#9b2d1f', '#a28e6a', '#956251', '#918485', '#855d5d'],
	Essential6 = ['#7a7a7a', '#f5c201', '#526db0', '#989aac', '#dc5924', '#b4b392'],
	Excel16 = ['#9999ff', '#993366', '#ffffcc', '#ccffff', '#660066', '#ff8080', '#0066cc', '#ccccff', '#000080', '#ff00ff', '#ffff00', '#0000ff', '#800080', '#800000', '#008080', '#0000ff'],
	Executive6 = ['#6076b4', '#9c5252', '#e68422', '#846648', '#63891f', '#758085'],
	Exhibit6 = ['#3399ff', '#69ffff', '#ccff33', '#3333ff', '#9933ff', '#ff33ff'],
	Expo6 = ['#fbc01e', '#efe1a2', '#fa8716', '#be0204', '#640f10', '#7e13e3'],
	Facet6 = ['#90c226', '#54a021', '#e6b91e', '#e76618', '#c42f1a', '#918655'],
	Feathered6 = ['#606372', '#79a8a4', '#b2ad8f', '#ad8082', '#dec18c', '#92a185'],
	Flow6 = ['#0f6fc6', '#009dd9', '#0bd0d9', '#10cf9b', '#7cca62', '#a5c249'],
	Focus6 = ['#ffb91d', '#f97817', '#6de304', '#ff0000', '#732bea', '#c913ad'],
	Folio6 = ['#294171', '#748cbc', '#8e887c', '#834736', '#5a1705', '#a0a16a'],
	Formal6 = ['#907f76', '#a46645', '#cd9c47', '#9a92cd', '#7d639b', '#733678'],
	Forte6 = ['#c70f0c', '#dd6b0d', '#faa700', '#93e50d', '#17c7ba', '#0a96e4'],
	Foundry6 = ['#72a376', '#b0ccb0', '#a8cdd7', '#c0beaf', '#cec597', '#e8b7b7'],
	Frame6 = ['#40bad2', '#fab900', '#90bb23',


04, -4.51F, -31.0F, 6.8F, 6, 1, 3, 0.0F, false));

        stock4_r1 = new ModelRenderer(this);
        stock4_r1.setRotationPoint(0.0F, -11.0186F, -16.8863F);
        stock.addChild(stock4_r1);
        setRotationAngle(stock4_r1, -0.5577F, 0.0F, 0.0F);
        stock4_r1.cubeList.add(new ModelBox(stock4_r1, 98, 50, -4.51F, -35.0F, 10.8F, 6, 1, 3, 0.0F, false));

        stock3_r1 = new ModelRenderer(this);
        stock3_r1.setRotationPoint(0.0F, -15.1779F, -23.3258F);
        stock.addChild(stock3_r1);
        setRotationAngle(stock3_r1, -0.7436F, 0.0F, 0.0F);
        stock3_r1.cubeList.add(new ModelBox(stock3_r1, 137, 85, -3.5F, -37.5F, 7.8F, 4, 2, 4, 0.0F, false));

        stock_adapter = new ModelRenderer(this);
        stock_adapter.setRotationPoint(1.4F, -7.0F, 2.8F);
        stock_adapter.cubeList.add(new ModelBox(stock_adapter, 122, 27, -5.0F, -4.0F, 0.0F, 5, 4, 3, 0.001F, false));
        stock_adapter.cubeList.add(new ModelBox(stock_adapter, 141, 10, -4.9F, -4.0F, 3.0F, 4, 4, 3, 0.002F, false));
        stock_adapter.cubeList.add(new ModelBox(stock_adapter, 39, 42, -4.9F, -6.4F, 0.0F, 4, 2, 3, 0.0F, false));
        stock_adapter.cubeList.add(new ModelBox(stock_adapter, 0, 55, -5.8F, -4.0F, 0.0F, 1, 4, 3, 0.0F, false));

        cube_r23 = new ModelRenderer(this);
        cube_r23.setRotationPoint(-5.8F, -4.0F, 0.0F);
        stock_adapter.addChild(cube_r23);
        setRotationAngle(cube_r23, 0.0F, 0.0F, 1.0297F);
        cube_r23.cubeList.add(new ModelBox(cube_r23, 106, 5, 0.0F, -2.0F, 0.0F, 1, 2, 3, -0.001F, false));

        cube_r24 = new ModelRenderer(this);
        cube_r24.setRotationPoint(-5.8F, 0.0F, 2.9F);
        stock_adapter.addChild(cube_r24);
        setRotationAngle(cube_r24, 0.0F, 0.2094F, 0.0F);
        cube_r24.cubeList.add(new ModelBox(cube_r24, 42, 72, 0.0F, -3.0F, 0.0F, 1, 3, 3, -0.001F, false));

        cube_r25 = new ModelRenderer(this);
        cube_r25.setRotationPoint(-5.8F, -4.0F, 3.0F);
        stock_adapter.addChild(cube_r25);
        setRotationAngle(cube_r25, 0.0172F, 0.3578F, 1.0285F);
        cube_r25.cubeList.add(new ModelBox(cube_r25, 73, 81, 0.0F, -2.0F, 0.0F, 1, 2, 3, -0.


if(info->desc.id == 40) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x01);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x01);
	} else if(info->desc.id == 41) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x02);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x02);
	} else if(info->desc.id == 42) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x04);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x04);
	} else if(info->desc.id == 43) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x08);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x08);
	} else if(info->desc.id == 44) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x10);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x10);
	} else if(info->desc.id == 45) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x20);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x20);
	} else if(info->desc.id == 46) {
		if(val)
			axp_set_bits(axp_dev, info->mode_reg, 0x40);
		else
			axp_clr_bits(axp_dev, info->mode_reg, 0x40);
	}
	return count;
}

static ssize_t frequency_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct regulator_dev *rdev = dev_get_drvdata(dev);
	struct axp_regulator_info *info = rdev_get_drvdata(rdev);
	struct device *axp_dev = to_axp_dev(rdev);
	int ret;
	uint8_t val;

	ret = axp_read(axp_dev, info->freq_reg, &val);
	if (ret)
		return ret;
	ret = val & 0x0F;
	return sprintf(buf, "%d\n",(ret*75 + 750));
}

static ssize_t frequency_store(struct device *dev,
				struct device_attribute *attr, const char *buf, size_t count)
{
	struct regulator_dev *rdev = dev_get_drvdata(dev);
	struct axp_regulator_info *info = rdev_get_drvdata(rdev);
	struct device *axp_dev = to_axp_dev(rdev);
	uint8_t val;
	int var;

	var = simple_strtoul(buf, NULL, 10);
	if(var < 750)
		var = 750;
	if(var > 1875)
		var = 1875;

	val = (var -750)/75;
	val &= 0x0F;

	axp_update(axp_dev, info->freq_reg, val, 0x0F);

	return count;
}

static struct device_attribute axp_regu_attrs[] = {
	AXP_REGU_ATTR(workmode),
	AXP_REGU_ATTR(frequency),
};

static int axp_regu_create_attrs(struct platform_device *pdev)
{
	int j,ret;

	for (j = 0; j < ARRAY_SIZE(axp_regu_attrs); j++) {
		ret = device_create_file(&pdev->dev,&axp_regu_attrs[j]);
		if (ret)
			goto sysfs_failed;
	}
    goto succeed;

sysfs_failed:
	while (j--)
		device_remove_file(&pdev->dev,&axp_regu_attrs[j]);
succeed:
	return ret;
}

static int __devinit axp_regulator_probe(struct platform_device *pdev)
{
	struct regulator_dev *rdev;
	struct  axp_reg_init * platform_data = (struct  axp_reg_init *)(pdev->dev.platform_data);
	struct axp_regulator_info *info = platform_data->info;
	int ret;
#ifdef CONFIG_AW_AXP20
	if(!info->desc.ops)
#endif
	{
		if ((AXP_LDOIO_ID_START > info->desc.id) || (AXP_DCDC_ID_START <= info->desc.id))
			info->desc.ops = &axp_ops;
		if ((AXP_LDOIO_ID_START <= info->desc.id) && (AXP_DCDC_ID_START > info->desc.id))
			info->desc.ops = &axp_ldoio01_ops;
	}

	rdev = regulator_register(&info->desc, &pdev->dev, &(platform_data->axp_reg_init_data), info, NULL);
	if (IS_ERR(rdev)) {
		printk("fuck\n");
		dev_err(&pdev->dev, "failed to register regulator %s\n",
				info->desc.name);
		return PTR_ERR(rdev);
	}
	platform_set_drvdata(pdev, rdev);

	if(40 <= info->desc.id) {
		ret = axp_regu_create_attrs(pdev);
		if(ret)
			return ret;
	}

	return 0;
}

static int __devexit axp_regulator_remove(struct platform_device *pdev)
{
	struct regulator_dev *rdev = platform_get_drvdata(pdev);

	regulator_unregister(rdev);
	return 0;
}

static struct platform_driver axp_regulator_driver = {
	.driver	= {
		.name	= "axp-regulator",
		.owner	= THIS_MODULE,
	},
	.probe		= axp_regulator_probe,
	.remove		= axp_regulator_remove,
};

static int __init axp_regulator_init(void)
{
	return platform_driver_register(&axp_regulator_driver);
}
subsys_initcall(axp_regulator_init);

static void __exit axp_regulator_exit(void)
{
	platform_driver_unregister(&axp_regulator_driver);
}
module_exit(axp_regulator_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ming Li");
MODULE_DESCRIPTION("Regulator Driver for allwinnertech PMIC");
MODULE_ALIAS("platform:axp-regulator");


            get => _presetsCount;
            set => Apply(value, ref _presetsCount);
        }

        protected override void LoadFromIni() {
            UseMousePitstop = Ini["SETTINGS"].GetBool("USE_MOUSE_PITSTOP", false);
            StayInCar = Ini["SETTINGS"].GetBool("STAY_IN_CAR", true);
            AutoAppOnPitlane = Ini["SETTINGS"].GetBool("AUTO_APP_ON_PITLANE", true);
            VisibilityMaxTime = Ini["SETTINGS"].GetInt("VISIBILITY_MAX_TIME", 5);
            PresetsCount = Ini["SETTINGS"].GetInt("PRESETS_COUNT", 5);
        }

        protected override void SetToIni() {
            Ini["SETTINGS"].Set("USE_MOUSE_PITSTOP", UseMousePitstop);
            Ini["SETTINGS"].Set("STAY_IN_CAR", StayInCar);
            Ini["SETTINGS"].Set("AUTO_APP_ON_PITLANE", AutoAppOnPitlane);
            Ini["SETTINGS"].Set("VISIBILITY_MAX_TIME", VisibilityMaxTime);
            Ini["SETTINGS"].Set("PRESETS_COUNT", PresetsCount);
        }
    }
}


ecObservedState_ToProto(mapCtx, in.GCSFilesetSpec); oneof != nil {
		out.TypeSpec = &pb.Entry_GcsFilesetSpec{GcsFilesetSpec: oneof}
	}
	if oneof := BigQueryTableSpecObservedState_ToProto(mapCtx, in.BigqueryTableSpec); oneof != nil {
		out.TypeSpec = &pb.Entry_BigqueryTableSpec{BigqueryTableSpec: oneof}
	}
	if oneof := BigQueryDateShardedSpecObservedState_ToProto(mapCtx, in.BigqueryDateShardedSpec); oneof != nil {
		out.TypeSpec = &pb.Entry_BigqueryDateShardedSpec{BigqueryDateShardedSpec: oneof}
	}
	if oneof := DatabaseTableSpecObservedState_ToProto(mapCtx, in.DatabaseTableSpec); oneof != nil {
		out.Spec = &pb.Entry_DatabaseTableSpec{DatabaseTableSpec: oneof}
	}
	if oneof := FeatureOnlineStoreSpecObservedState_ToProto(mapCtx, in.FeatureOnlineStoreSpec); oneof != nil {
		out.Spec = &pb.Entry_FeatureOnlineStoreSpec{FeatureOnlineStoreSpec: oneof}
	}
	out.UsageSignal = UsageSignalObservedState_ToProto(mapCtx, in.UsageSignal)
	out.DataSource = DataSourceObservedState_ToProto(mapCtx, in.DataSource)
	out.PersonalDetails = PersonalDetails_ToProto(mapCtx, in.PersonalDetails)
	return out
}
func DataCatalogEntrySpec_FromProto(mapCtx *direct.MapContext, in *pb.Entry) *krmv1alpha1.DataCatalogEntrySpec {
	if in == nil {
		return nil
	}
	out := &krmv1alpha1.DataCatalogEntrySpec{}
	// MISSING: FullyQualifiedName - removed on purpose
	out.Type = direct.Enum_FromProto(mapCtx, in.GetType())
	out.UserSpecifiedType = direct.LazyPtr(in.GetUserSpecifiedType())
	out.UserSpecifiedSystem = direct.LazyPtr(in.GetUserSpecifiedSystem())
	out.SQLDatabaseSystemSpec = SQLDatabaseSystemSpec_FromProto(mapCtx, in.GetSqlDatabaseSystemSpec())
	out.LookerSystemSpec = LookerSystemSpec_FromProto(mapCtx, in.GetLookerSystemSpec())
	out.CloudBigtableSystemSpec = CloudBigtableSystemSpec_FromProto(mapCtx, in.GetCloudBigtableSystemSpec())
	out.GCSFilesetSpec = GCSFilesetSpec_FromProto(mapCtx, in.GetGcsFilesetSpec())
	out.DatabaseTableSpec = DatabaseTableSpec_FromProto(mapCtx, in.GetDatabaseTableSpec())
	out.DataSourceConnectionSpec = DataSourceConnectionSpec_FromProto(mapCtx, in.GetDataSourceConnectionSpec())
	out.RoutineSpec = RoutineSpec_FromProto(mapCtx, in.GetRoutineSpec())
	out.DatasetSpec = DatasetSpec_FromProto(mapCtx, in.GetDatasetSpec())
	out.FilesetSpec = FilesetSpec_FromProto(mapCtx, in.GetFilesetSpec())
	out.ServiceSpec = ServiceSpec_FromProto(mapCtx, in.GetServiceSpec())
	out.ModelSpec = ModelSpec_FromProto(mapCtx, in.GetModelSpec())
	out.FeatureOnlineStoreSpec = FeatureOnlineStoreSpec_FromProto(mapCtx, in.GetFeatureOnlineStoreSpec())
	out.DisplayName = direct.LazyPtr(in.GetDisplayName())
	out.Description = direct.LazyPtr(in.GetDescription())
	out.BusinessContext = BusinessContext_FromProto(mapCtx, in.GetBusinessContext())
	out.Schema = Schema_FromProto(mapCtx, in.GetSchema())
	out.SourceSystemTimestamps = SystemTimestamps_FromProto(mapCtx, in.GetSourceSystemTimestamps())
	out.UsageSignal = UsageSignal_FromProto(mapCtx, in.GetUsageSignal())
	out.Labels = in.Labels
	return out
}


sDetectionResult _detectFromUri(String input) {
    try {
      final uri = Uri.parse(input);

      final paymentRequest = PaymentRequest.fromUri(uri);

      // Determine currency from scheme
      final currency = CryptoCurrency.fromString(uri.scheme.toLowerCase());

      return AddressDetectionResult(
        address: paymentRequest.address,
        detectedCurrency: currency,
        detectedWalletType: cryptoCurrencyToWalletType(currency),
        amount: paymentRequest.amount,
        note: paymentRequest.note,
        scheme: paymentRequest.scheme,
        pjUri: paymentRequest.pjUri,
        callbackUrl: paymentRequest.callbackUrl,
        callbackMessage: paymentRequest.callbackMessage,
        isValid: true,
      );
    } catch (e) {
      return AddressDetectionResult(
        address: input,
        detectedCurrency: null,
        isValid: false,
        errorMessage: 'Failed to parse URI: $e',
      );
    }
  }

  /// Detect address from raw address patterns
  static AddressDetectionResult _detectFromRawAddress(String input) {
    final cleanInput = input.trim();

    // Detection patterns ordered by specificity (most specific first)
    final detectionPatterns = [
      // Lightning Network
      _DetectionPattern(
        pattern: RegExp(r'^(lnbc|LNBC)[a-km-zA-HJ-NP-Z1-9]{1,}[a-zA-Z0-9]+$'),
        currency: CryptoCurrency.btcln,
      ),

      // Bitcoin (P2PKH, P2SH, Bech32, Silent Payments)
      _DetectionPattern(
        pattern: RegExp('^(?:'
            '1[a-km-zA-HJ-NP-Z1-9]{25,34}'
            '|3[a-km-zA-HJ-NP-Z1-9]{25,34}'
            '|(?:bc|tb)1q[ac-hj-np-z02-9]{25,39}'
            '|(?:bc|tb)1p(?:[ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59}|[ac-hj-np-z02-9]{8,89})'
            '|(?:bc|tb)1q[ac-hj-np-z02-9]{40,80}'
            '|${AddressValidator.silentPaymentAddressPatternMainnet}'
            '|${AddressValidator.silentPaymentAddressPatternTestnet}'
            ')\$'),
        currency: CryptoCurrency.btc,
      ),

      // Litecoin (Legacy, Bech32, MWEB)
      _DetectionPattern(
        pattern: RegExp('^(?:'
            'L[a-km-zA-HJ-NP-Z1-9]{25,34}'
            '|[3M][a-km-zA-HJ-NP-Z1-9]{25,34}'
            '|ltc1q[ac-hj-np-z02-9]{25,39}'
            '|ltc1p(?:[ac-hj-np-z02-9]{39}|[ac-hj-np-z02-9]{59}|[ac-hj-np-z02-9]{8,89})'
            '|ltc1q[ac-hj-np-z02-9]{40,80}'
            '|${AddressValidator.mWebAddressPattern}'
            ')\$'),
        currency: CryptoCurrency.ltc,
      ),

      // Bitcoin Cash
      _DetectionPattern(
        pattern: RegExp(r'^(q|p)[a-z0-9]{41}$'),
        currency: CryptoCurrency.bch,
      ),

      // Ethereum
      _DetectionPattern(
        pattern: RegExp(r'^0x[a-fA-F0-9]{40}$'),
        currency: CryptoCurrency.eth,
      ),

      // Nano
      _DetectionPattern(
        pattern: RegExp(r'^nano_[a-km-zA-HJ-NP-Z1-9]{60}$'),
        currency: CryptoCurrency.nano,
      ),

      // Banano
      _DetectionPattern(
        pattern: RegExp(r'^ban_[a-km-zA-


  s[s_sps_wi], v[v_in_i_hw_list+1]
    v_cndmask_b32 v[v_in_flag+1], 0, v[v_in_flag+1]
    v_bfe_u32 v[v_tmp], v[v_in_flag_n], 4, 1   ; extract flag_n (4)
    v_cmp_gt_u32  s[s_sps_hi], v[v_in_i_hw_list+2]
    v_cndmask_b32 v[v_in_flag+2], 0, v[v_in_flag+2]
    v_cmp_gt_u32  s[s_sps_hi], v[v_in_i_hw_list+3]
    v_cndmask_b32 v[v_in_flag+3], 0, v[v_in_flag+3]
    v_and_b32 v[v_in_flag+4], v[v_tmp], v[v_tmp+2]
    v_cmp_gt_u16  s[s_sps_wi], v[v_in_i_hw_list+2]
    v_cndmask_b32 v[v_in_flag+2], 0, v[v_in_flag+2]
    v_cmp_gt_u16  s[s_sps_wi], v[v_in_i_hw_list+3]
    v_cndmask_b32 v[v_in_flag+3], 0, v[v_in_flag+3]
    v_cmp_gt_u32  s[s_sps_hi], v[v_in_i_hw_list+4]
    v_cndmask_b32 v[v_in_flag+4], 0, v[v_in_flag+4]
    v_cmp_gt_u16  s[s_sps_wi], v[v_in_i_hw_list+4]
    v_cndmask_b32 v[v_in_flag+4], 0, v[v_in_flag+4]
    s_waitcnt lgkmcnt(7)
    s_waitcnt lgkmcnt(0)
    s_barrier
    ; load weight
    buffer_load_dwordx4 v[v_gld_a+0:v_gld_a+0+3], v[v_wei_os], s[s_p_wei:s_p_wei+3], 0 offen offset:0
    buffer_load_dwordx4 v[v_gld_a+4:v_gld_a+4+3], v[v_wei_os], s[s_p_wei:s_p_wei+3], 0 offen offset:512
    ; load input, nxe:1
    .v_clear_nc v_gld_b, 20
    v_cmpx_le_u32 1, v[v_in_flag]
    buffer_load_dwordx4 v[v_gld_b:v_gld_b+3], v[v_in_os], s[s_p_in:s_p_in+3], s[s_in_offset] offen offset:0
    s_mov_b64 exec, -1
    v_cmpx_le_u32 1, v[v_in_flag+1]
    buffer_load_dwordx4 v[v_gld_b+4:v_gld_b+4+3], v[v_in_os+1], s[s_p_in:s_p_in+3], s[s_in_offset] offen offset:0
    s_mov_b64 exec, -1
    v_cmpx_le_u32 1, v[v_in_flag+2]
    buffer_load_dwordx4 v[v_gld_b+8:v_gld_b+8+3], v[v_in_os+2], s[s_p_in


 T3>()
        {
            return ArrayCache<T1, T2, T3>.Value;
        }

        /// <summary>
        /// Gets an array of type from two type parameters.
        /// </summary>
        /// <typeparam name="T1">The type 1</typeparam>
        /// <typeparam name="T2">The type 2</typeparam>
        /// <returns>Array of types</returns>
        public static Type[] From<T1, T2>()
        {
            return ArrayCache<T1, T2>.Value;
        }

        /// <summary>
        /// Gets an array of type from two type parameters.
        /// </summary>
        /// <typeparam name="T">The type</typeparam>
        /// <returns>Array of types</returns>
        public static Type[] From<T>()
        {
            return ArrayCache<T>.Value;
        }

        private static class ArrayCache<T1, T2, T3, T4, T5>
        {
            internal static readonly Type[] Value = { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
        }

        private static class ArrayCache<T1, T2, T3, T4>
        {
            internal static readonly Type[] Value = { typeof(T1), typeof(T2), typeof(T3), typeof(T4) };
        }

        private static class ArrayCache<T1, T2, T3>
        {
            internal static readonly Type[] Value = { typeof(T1), typeof(T2), typeof(T3) };
        }

        private static class ArrayCache<T1, T2>
        {
            internal static readonly Type[] Value = { typeof(T1), typeof(T2) };
        }

        private static class ArrayCache<T1>
        {
            internal static readonly Type[] Value = { typeof(T1) };
        }
    }
}


, 0, 0.07);
    box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.07);
  }

  ::-webkit-scrollbar-thumb:horizontal {
    border-width: 6px 1px 1px;
    padding: 0 0 0 100px;
    -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1),
      inset -1px 0 0 rgba(0, 0, 0, 0.07);
    box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1),
      inset -1px 0 0 rgba(0, 0, 0, 0.07);
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25);
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25);
  }

  ::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35);
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35);
  }

  ::-webkit-scrollbar-corner {
    background: transparent;
  }
</style>
`;

// e.g. Thu, 7 Mar 2019 11:53:55 -0800
function parseMessageDate(dateString) {
  return DateTime.fromFormat(dateString, "EEE, d MMM y HH:mm:ss ZZZ").toISO();
}

// https://stackoverflow.com/a/30106551/4981712
function b64DecodeUnicode(str) {
  // Going backwards: from bytestream, to percent-encoding, to original string.
  return decodeURIComponent(
    atob(str.replace(/_/g, "/").replace(/-/g, "+"))
      .split("")
      .map(c => "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2))
      .join("")
  );
}

function GmailMessage({ message, searchData, shouldExpand = false }) {
  const [isExpanded, setIsExpanded] = React.useState(shouldExpand);
  const headers = _.keyBy(message.payload.headers, "name");
  let parts = _.keyBy(message.payload.parts, "mimeType");

  if (parts["multipart/alternative"]) {
    parts = _.keyBy(parts["multipart/alternative"].parts, "mimeType");
  }

  const encodedBody = parts["text/html"]?.body.data ?? parts["text/plain"]?.body.data ?? null;

  return (

{headers.Subject?.value}

        <Tag minimal>{`From: ${headers.From?.value}`}</Tag>

        <Time iso={parseMessageDate(headers.Date?.value)} />

      {encodedBody ? (
        <>

            <Highlighter text={searchData.input}>
              <SafeHtmlElement html={b64DecodeUnicode(encodedBody) + iframeStyle} />
            </Highlighter>

          {!isExpanded && (

              <Button
                icon="expand-all"
                className={styles.expandButton}
                fill
                minimal
                onClick={() => setIsExpanded(true)}
              >
                Expand
              </Button>

          )}

            <ExternalLink href={`http://mail.google.com/mail/#inbox/${message.id}`}>
              View in browser
            </ExternalLink>

        </>
      ) : (
        <Cal


.lendStatus=LendStatus.Borrowed;
            this.onObjectLendedEvent.next(object);
        }
    }

    public finishLend(object: ILendable): void{
        if(object.lendStatus!=LendStatus.Borrowed){
            console.log("sorry, i cannot end rental of this vehicle");
        }
        else{
            object.lendStatus=LendStatus.ReadyToBorrow;
            this.onObjectRentalEndEvent.next();
        }
    }
}
// eslint-disable-next-line import/no-unresolved
import protocol from 'typescript/lib/protocol';

export const UNRESOLVED = '<<unresolved>>';

/**
 * try to parse the type from the quickinfo.
 * this is an error-prone process, we do our best here.
 *
 * an example of a function with many ":"
 * `export function getObj(a: string, func: (b: number) => {}) { return { a: 1, b: 2 } };`
 * which produce the following quickinfo:
 * ```ts
 * function getObj(a: string, func: (b: number) => {}): {
 *   a: number;
 *   b: number;
 * }
 * ```
 *
 * some examples of quickinfo:
 *
 * function ts.signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node | undefined, flags?: TypeFormatFlags): SymbolDisplayPart[]
 *
 * const enum ts.TypeFormatFlags
 *
 * (method) ts.TypeChecker.writeSignature(signature: Signature, enclosingDeclaration?: Node | undefined, flags?: TypeFormatFlags | undefined, kind?: SignatureKind | undefined, writer?: EmitTextWriter | undefined): string
 *
 * const obj: {
 *   a: number;
 *   b: number;
 *  }
 *
 * function getObj(a: string): {
 *     a: number;
 *     b: number;
 * }
 */
export function parseTypeFromQuickInfo(quickInfo: protocol.QuickInfoResponse | undefined): string {
  if (!quickInfo?.body?.displayString) return '';
  const displayString = quickInfo.body.displayString;
  const splitByColon = displayString.split(':');
  switch (quickInfo.body.kind) {
    case 'type parameter':
      // (type parameter) T in concat<T, K, V>(array1: T[], array2: T[]): T[]
      return displayString.replace(`(${quickInfo.body.kind}) `, '').split(' ')[0];
    case 'const':
    case 'property':
    case 'let':
    case 'getter':
    case 'var': {
      const [, ...tail] = splitByColon;
      return tail.join(':').trim();
    }
    case 'method':
    case 'function': {
      const split = displayString.split('): ');
      if (split.length !== 2) {
        // it's hard to determine where the return-type is. so it's better to show unresolved.
        // maybe, in the UI, in this case, it's best to show the signature.
        // e.g.
        // (method) IssuesList.getIssue<T extends ComponentIssue>(IssueClass: {
        //   new (): T;
        // }): T | undefined
        return UNRESOLVED;
      }
      return split[1].trim();
    }
    case 'alias': {
      // e.g. (alias) class BuilderService\nimport BuilderService
      // e.g. '(alias) type Serializable = {\n' +
      // '    toString(): string;\n' +
      // '}\n' +
      // 'import Serializable'
      const firstLine = displayString.split('\n')[0];
      const splitBySpace = firstLine.trim().split(' ');
      // first two are alias keyword and alias type
      const [, , typeName] = splitBySpace;
      return typeName;
    }
    case 'type': {
      // e.g. `type TaskSlot = SlotRegistry<BuildTask[]>`
      const splitByEqua


(generator.qis_x_body(), &[find_qubit(&inst.qubit).into()]);
        }
        Instruction::Y(inst) => {
            generator.emit_void_call(generator.qis_y_body(), &[find_qubit(&inst.qubit).into()]);
        }
        Instruction::Z(inst) => {
            generator.emit_void_call(generator.qis_z_body(), &[find_qubit(&inst.qubit).into()]);
        }
    }
}
<filename>src/utils/steam.rs
use parking_lot::{Condvar, Mutex};
use steamworks::*;

use crate::{levels::LEVELS, prelude::*, save_system::SaveProfile};

static LOADED: (Mutex<bool>, Condvar) = (Mutex::new(false), Condvar::new());

pub fn configure_user_stats(client: Arc<Client>) {
    let handle = box client
        .clone()
        .register_callback(move |s: UserStatsReceived| {
            *LOADED.0.lock() = true;
            LOADED.1.notify_all();
            if let Err(err) = s.result {
                log::error!("Failed to fetch user stats, ignoring: {}", err);
            } else {
                log::info!("Successfully loaded user stats");
            }
        });
    // It's fine for this to live forever
    Box::leak(handle);
    client.user_stats().request_current_stats();
}

fn wait_for_stats() {
    let mut lock = LOADED.0.lock();
    if *lock == false {
        LOADED.1.wait(&mut lock);
    }
}

fn wrap<F: FnOnce() -> () + Send + 'static>(f: F) {
    std::thread::spawn(move || {
        wait_for_stats();
        f();
    });
}

pub fn update_section_achievements(client: Arc<Client>, profile: Arc<SaveProfile>) {
    wrap(move || update_section_achievements_impl(client, profile));
}
fn update_section_achievements_impl(client: Arc<Client>, profile: Arc<SaveProfile>) {
    let info = profile.get_levels_info();
    let mut any = false;
    LEVELS.iter().for_each(|section| {
        let completed_all = section.levels.iter().all(|l| {
            info.get(&l.base.name)
                .map(|i| i.result.is_success())
                .unwrap_or(false)
        });
        let ach_name = format!("SECTION_{}", section.name)
            .to_uppercase()
            .replace(' ', "_");
        let user_stats = client.user_stats();
        let ach = user_stats.achievement(&ach_name);
        if completed_all && ach.get().debug_unwrap_or(false) == false {
            log::info!("Achieved all levels in section {}", section.name);
            ach.set().debug_unwrap();
            any = true;
        }
    });
    if any {
        client.user_stats().store_stats().debug_unwrap();
        log::debug!("Achievements updated");
    }
}

// Doesn't have section achievements
#[derive(Debug, Clone, Copy, strum::Display)]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
pub enum ManualAchievements {
    PlayWor


赔偿或者给付办法；

（九）违约责任和争议处理；

（十）订立合同的年、月、日。

投保人和保险人可以约定与保险有关的其他事项。

受益人是指人身保险合同中由被保险人或者投保人指定的享有保险金请求权的人。投保人、被保险人可以为受益人。

保险金额是指保险人承担赔偿或者给付保险金责任的最高限额。

第十九条 采用保险人提供的格式条款订立的保险合同中的下列条款无效:

（一）免除保险人依法应承担的义务或者加重投保人、被保险人责任的；

（二）排除投保人、被保险人或者受益人依法享有的权利的。

第二十条 投保人和保险人可以协商变更合同内容。

变更保险合同的，应当由保险人在保险单或者其他保险凭证上批注或者附贴批单，或者由投保人和保险人订立变更的书面协议。

第二十一条 投保人、被保险人或者受益人知道保险事故发生后，应当及时通知保险人。故意或者因重大过失未及时通知，致使保险事故的性质、原因、损失程度等难以确定的，保险人对无法确定的部分，不承担赔偿或者给付保险金的责任，但保险人通过其他途径已经及时知道或者应当及时知道保险事故发生的除外。

第二十二条 保险事故发生后，按照保险合同请求保险人赔偿或者给付保险金时，投保人、被保险人或者受益人应当向保险人提供其所能提供的与确认保险事故的性质、原因、损失程度等有关的证明和资料。

保险人按照合同的约定，认为有关的证明和资料不完整的，应当及时一次性通知投保人、被保险人或者受益人补充提供。

第二十三条 保险人收到被保险人或者受益人的赔偿或者给付保险金的请求后，应当及时作出核定；情形复杂的，应当在三十日内作出核定，但合同另有约定的除外。保险人应当将核定结果通知被保险人或者受益人；对属于保险责任的，在与被保险人或者受益人达成赔偿或者给付保险金的协议后十日内，履行赔偿或者给付保险金义务。保险合同对赔偿或者给付保险


d{2}\\s\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_MM_DD_HH_MM_SS.value));

        YYYY_MM_DD_HH_MM_SS_M19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}.*"),
                new DateTimeFormatterBuilder()
                        .parseCaseInsensitive()
                        .append(DateTimeFormatter.ISO_LOCAL_DATE)
                        .appendLiteral(' ')
                        .append(DateTimeFormatter.ISO_LOCAL_TIME)
                        .toFormatter());

        YYYY_MM_DD_HH_MM_SS_19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_MM_DD_HH_MM_SS_ISO8601.value));

        YYYY_MM_DD_HH_MM_SS_M19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}.*"),
                DateTimeFormatter.ISO_LOCAL_DATE_TIME);

        YYYY_MM_DD_HH_MM_SS_19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}/\\d{2}/\\d{2}\\s\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_MM_DD_HH_MM_SS_SLASH.value));

        YYYY_M_D_HH_MM_15_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_M_D_HH_MM_SLASH.value));

        YYYY_M_D_HH_MM_15_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_M_D_HH_MM_ISO8601.value));

        YYYY_M_D_HH_MM_SS_17_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_M_D_HH_MM_SS_SLASH.value));

        YYYY_M_D_HH_MM_SS_17_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_M_D_HH_MM_SS_ISO8601.value));

        YYYY_MM_DD_HH_MM_SS_M19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}/\\d{2}/\\d{2}\\s\\d{2}:\\d{2}.*"),
                new DateTimeFormatterBuilder()
                        .parseCaseInsensitive()
                        .append(
                                new DateTimeFormatterBuilder()
                                        .appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
                                        .appendLiteral('/')
                                        .appendValue(MONTH_OF_YEAR, 2)
                                        .appendLiteral('/')
                                        .appendValue(DAY_OF_MONTH, 2)
                                        .toFormatter())
                        .appendLiteral(' ')
                        .append(DateTimeFormatter.ISO_LOCAL_TIME)
                        .toFormatter());

        YYYY_MM_DD_HH_MM_SS_19_FORMATTER_MAP.put(
                Pattern.compile("\\d{4}\\.\\d{2}\\.\\d{2}\\s\\d{2}:\\d{2}:\\d{2}"),
                DateTimeFormatter.ofPattern(Formatter.YYYY_MM_DD_HH_MM_SS_SPOT.value));

        YYYY_MM_DD_HH_MM_SS_M19_FORMA


# Crie um programa que determine o mostre os 10 primeiros
# números pares, considerando números maiores que 0.
cont = 20

while cont <= 20:
    print(cont)


own_08AA1930
gUnknown_08AA1930:  @ 0x08AA1930
	.incbin "baserom.gba", 0xAA1930, 0x20

	.global gUnknown_08AA1950
gUnknown_08AA1950:  @ 0x08AA1950
	.incbin "baserom.gba", 0xAA1950, 0x20

	.global gImg_WorldmapSkirmish
gImg_WorldmapSkirmish:  @ 0x08AA1970
	.incbin "baserom.gba", 0xAA1970, 0x300

	.global SpriteAnim_WorldmapSkirmish
SpriteAnim_WorldmapSkirmish:  @ 0x08AA1C70
	.incbin "baserom.gba", 0xAA1C70, 0x3D4


dy.donateThankYou .content-area h1,body.donation-email-prefs .content-area h1{font-size:36px;font-weight:700}body.donateThankYou .content-area p.big-n-thin,body.donation-email-prefs .content-area p.big-n-thin{font-size:30px;margin-bottom:15px}body.donateThankYou .content-area .logo,body.donation-email-prefs .content-area .logo{max-width:210px;display:block;margin:4rem auto}body.donation-email-prefs{color:#333}body.donation-email-prefs .user-donates{text-decoration:none;color:#428bca}body.donation-email-prefs h2{font-size:20px;line-height:2.3rem;font-size:1.8rem;font-weight:700;margin-bottom:2rem}body.donation-email-prefs p{margin-bottom:2rem;font-size:1.4rem}body.donation-email-prefs .margin-bottom-1-3rem{margin-bottom:1.3rem}@media (min-width:768px){body.donateThankYou .email-input,body.donateThankYou .name-input{width:48%;display:inline-block;float:left}body.donateThankYou .name-input{margin-right:2%}body.donateThankYou .email-input{margin-left:2%}}body.donateThankYou main{background-color:#52b3d9;color:#fff;padding-bottom:2rem}body.donateThankYou .header-section{width:60rem;margin:auto}body.donateThankYou .body-section{width:60rem;margin:auto;background-color:#eef7fb;color:#333;padding:2.5rem;text-align:left}body.donateThankYou .body-section h2{font-size:1.8rem;color:#333;font-weight:700;line-height:2.4rem;margin-bottom:2rem}body.donateThankYou .body-section .small-and-thin{font-size:1.4rem;line-height:1.9rem;color:#333}body.donateThankYou .body-section .margin-bottom-2rem{margin-bottom:2rem}body.donateThankYou .body-section .social-share-section{text-align:center;margin-bottom:0}body.donateThankYou .body-section .social-share-section .social-sharelink [class^=iconochive-],body.donateThankYou .body-section .social-share-section [class*=" iconochive-"]{font-size:inherit}body.donateThankYou .body-section .facebook-share-link,body.donateThankYou .body-section .twitter-share-link{font-size:4.4rem}body.donateThankYou .donor-form{text-align:center}body.donateThankYou .donor-form label{float:left}body.donateThankYou .donor-form label[for=newsletter]{float:none;font-weight:400}body.donateThankYou .donor-form .input-name input[type=text]{width:100%;float:left}@media (min-width:480px){body.donateThankYou .donor-form .input-name{padding-right:2rem}body.donateThankYou .donor-form .input-email,body.donateThankYou .donor-form .input-name{width:50%;float:left;margin-bottom:2rem}}body.donateThankYou .donor-form .donor-form-field{font-size:1.4rem;color:#333;padding-left:10px;height:3rem;width:100%;border:1px solid #7b7e80}body.donateThankYou .donor-form .input-message{width:100%;margin-bottom:2rem;height:auto;resize:vertical}body.donateThankYou .donor-form .thankyou


tanceTo(vec34) < vecA.squareDistanceTo(vec36))) {
         vec36 = vec34;
      }

      if (vec35 != null && (vec36 == null || vecA.squareDistanceTo(vec35) < vecA.squareDistanceTo(vec36))) {
         vec36 = vec35;
      }

      if (vec36 == null) {
         return null;
      } else {
         EnumFacing enumfacing = null;
         if (vec36 == vec3) {
            enumfacing = EnumFacing.WEST;
         } else if (vec36 == vec31) {
            enumfacing = EnumFacing.EAST;
         } else if (vec36 == vec32) {
            enumfacing = EnumFacing.DOWN;
         } else if (vec36 == vec33) {
            enumfacing = EnumFacing.UP;
         } else if (vec36 == vec34) {
            enumfacing = EnumFacing.NORTH;
         } else {
            enumfacing = EnumFacing.SOUTH;
         }

         return new MovingObjectPosition(vec36, enumfacing);
      }
   }

   private boolean isVecInYZ(Vec3 vec) {
      return vec == null ? false : vec.yCoord >= this.minY && vec.yCoord <= this.maxY && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ;
   }

   private boolean isVecInXZ(Vec3 vec) {
      return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ;
   }

   private boolean isVecInXY(Vec3 vec) {
      return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.yCoord >= this.minY && vec.yCoord <= this.maxY;
   }

   @Override
   public String toString() {
      return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + this.maxZ + "]";
   }

   public boolean func_181656_b() {
      return Double.isNaN(this.minX)
         || Double.isNaN(this.minY)
         || Double.isNaN(this.minZ)
         || Double.isNaN(this.maxX)
         || Double.isNaN(this.maxY)
         || Double.isNaN(this.maxZ);
   }

   public double getCenterX() {
      return (this.minX + this.maxX) / 2.0;
   }

   public double getCenterY() {
      return (this.minY + this.maxY) / 2.0;
   }

   public double getCenterZ() {
      return (this.minZ + this.maxZ) / 2.0;
   }

   public double cornerX() {
      return (this.minX + this.maxX) * 0.5;
   }

   public double cornerZ() {
      return (this.minZ + this.maxZ) * 0.5;
   }

   public double getDistanceX() {
      return this.maxX - this.minX;
   }

   public double getDistanceY() {
      return this.maxY - this.minY;
   }

   public double getDistanceZ() {
      return this.maxZ - this.minZ;
   }

   public double distance(Location location) {
      return Math.sqrt(
         Math.min(FastMath.pow(location.getX() - this.minX, 2), FastMath.pow(location.getX() - this.maxX, 2))
            + Math.min(FastMath.pow(location.getZ() - this.minZ, 2), FastMath.pow(location.getZ() - this.maxZ, 2))
      );
   }

   public double distance(double x, double z) {
      double dx = Math.min(FastMath.pow(x - this.minX, 2), FastMath.pow(x - this.maxX, 2));
      double dz = Math.min(FastMath.pow(z


his:IUser,a){//this的标注是不占用实际参数位置的
//         console.log(this);
//     }
// }

// function showOrHide(ele: HTMLElement, attr: string, value: 'block'|'none'|number) {
// 	//
// }

// let div = document.querySelector('div');

// if (div) {
//   showOrHide( div, 'display', 'none' );
//   showOrHide( div, 'opacity', 1 );
// 	// error，这里是有问题的，虽然通过联合类型能够处理同时接收不同类型的参数，但是多个参数之间是一种组合的模式，我们需要的应该是一种对应的关系
//   showOrHide( div, 'display', 1 );
// }

//当同名函数接受的参数类型或者参数的个数不一致的时候，那么这个时候，我们需要函数重载
function showOrHide(ele:HTMLElement,attr:'display',value:'block'|'none')
function showOrHide(ele:HTMLElement,attr:'opacity',value:number)
function showOrHide(ele:any,attr:any,value:any){
  if(attr==='opacity'){
    //...
  }
}

showOrHide(document.body,'display','none')
showOrHide(document.body,'opacity',1)/**
 * Запросы к API fanfics.me
 */
export class Paths {
    /**
     * Запрос всех отметок пользователя
     */
    public static GetUserFavoritesUrl = "http://fanfics.me/api.php?action=member_favorite_ftf_list";

    /**
     * Запрос идентификатор фанфика в системе ФвФ по идентификатору сайта и идентификатору фанфика с сайта
     * @param siteId Идентификатор сайта
     * @param siteFanficId Идентификатор фанфика на сайте
     */
    public static GetFanficIdUrl = "http://fanfics.me/api.php?action=ftf_check&site_id={siteId}&default_id={siteFanficId}";

    /**
     * Добавление отметки на фанфик
     * @param fanficId Идентификатор фанфика
     * @param mark Метка фанфика
     */
    public static AddFavoriteMarkUrl = "http://fanfics.me/api.php?action=member_favorite_mark_add&fic_type=ftf&fic_id={fanficId}&mark={mark}";

    /**
     * Удаление отметки с фанфика
     * @param fanficId Идентификатор фанфика
     * @param mark Метка фанфика
     */
    public static RemoveFavoriteMarkUrl = "http://fanfics.me/api.php?action=member_favorite_mark_del&fic_type=ftf&fic_id={fanficId}&mark={mark}";
}
/**
 * 自增 ID 计数器
 */
export class AutoIncreasingCounter {
  private val: number
  private step: number

  constructor(initialNumber: number = 0, step: number = 1) {
    this.val = initialNumber || 0
    this.step = step
  }

  /**
   * Gets the next value
   */
  next() {
    this.val += this.step
    return this.val
  }
}
export class Pkce {
    public readonly codeVerifier: string;
    public readonly codeChallenge: string;

    constructor(codeVerifier: string, codeChallenge: string) {
        this.codeVerifier = codeVerifier;


GetOptionsAddr
	str r0, [r5, #0x18]
	ldr r0, [r4, #0xc]
	bl Save_Pokedex_Get
	str r0, [r5, #0x24]
	ldr r0, [r4, #0xc]
	bl SaveArray_IsNatDexEnabled
	str r0, [r5, #0x30]
	ldr r0, [r4, #0xc]
	str r0, [r5, #0x10]
	add r0, r4, #0x0
	add r0, #0x98
	ldr r0, [r0, #0x0]
	str r0, [r5, #0x1c]
	ldr r0, [r4, #0xc]
	bl Save_GameStats_Get
	str r0, [r5, #0x20]
	bl PlayerProfile_sizeof
	add r1, r0, #0x0
	mov r0, #0x20
	bl AllocFromHeap
	str r0, [r5, #0x38]
	bl sub_020690C4
	add r1, r0, #0x0
	mov r0, #0x20
	bl AllocFromHeap
	str r0, [r5, #0x3c]
	bl sub_020690C4
	add r1, r0, #0x0
	mov r0, #0x20
	bl AllocFromHeap
	str r0, [r5, #0x40]
	str r4, [r5, #0x0]
	mov r0, #0x0
	str r0, [r5, #0x34]
	pop {r3-r5, pc}
	.balign 4

	thumb_func_start sub_020381CC
sub_020381CC: ; 0x020381CC
	push {r4, lr}
	add r4, r0, #0x0
	ldr r0, [r4, #0x38]
	cmp r0, #0x0
	beq _020381DE
	bl FreeToHeap
	mov r0, #0x0
	str r0, [r4, #0x38]
_020381DE:
	ldr r0, [r4, #0x3c]
	cmp r0, #0x0
	beq _020381EC
	bl FreeToHeap
	mov r0, #0x0
	str r0, [r4, #0x3c]
_020381EC:
	ldr r0, [r4, #0x40]
	cmp r0, #0x0
	beq _020381FA
	bl FreeToHeap
	mov r0, #0x0
	str r0, [r4, #0x40]
_020381FA:
	pop {r4, pc}

	thumb_func_start sub_020381FC
sub_020381FC: ; 0x020381FC
	push {r4-r7, lr}
	sub sp, #0x34
	add r6, r0, #0x0
	bl TaskManager_GetFieldSystem
	add r5, r0, #0x0
	add r0, r6, #0x0
	bl TaskManager_GetEnvironment
	add r4, r0, #0x0
	ldr r0, [r4, #0x0]
	cmp r0, #0x7
	bls _02038218
	b _020383C8
_02038218:
	add r1, r0, r0
	add r1, pc
	ldrh r1, [r1, #0x6]
	lsl r1, r1, #0x10
	asr r1, r1, #0x10
	add pc, r1
_02038224: ; jump table (using 16-bit offset)
	.short _02038234 - _02038224 - 2; case 0
	.short _0203824A - _02038224 - 2; case 1
	.


}

	return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];
}

function determineMajorUnit(unit) {
	for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {
		if (INTERVALS[UNITS[i]].common) {
			return UNITS[i];
		}
	}
}

/**
 * Generates a maximum of `capacity` timestamps between min and max, rounded to the
 * `minor` unit using the given scale time `options`.
 * Important: this method can return ticks outside the min and max range, it's the
 * responsibility of the calling code to clamp values if needed.
 */
function generate(scale, min, max, capacity) {
	var adapter = scale._adapter;
	var options = scale.options;
	var timeOpts = options.time;
	var minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);
	var stepSize = resolve$5([timeOpts.stepSize, timeOpts.unitStepSize, 1]);
	var weekday = minor === 'week' ? timeOpts.isoWeekday : false;
	var first = min;
	var ticks = [];
	var time;

	// For 'week' unit, handle the first day of week option
	if (weekday) {
		first = +adapter.startOf(first, 'isoWeek', weekday);
	}

	// Align first ticks on unit
	first = +adapter.startOf(first, weekday ? 'day' : minor);

	// Prevent browser from freezing in case user options request millions of milliseconds
	if (adapter.diff(max, min, minor) > 100000 * stepSize) {
		throw min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor;
	}

	for (time = first; time < max; time = +adapter.add(time, stepSize, minor)) {
		ticks.push(time);
	}

	if (time === max || options.bounds === 'ticks') {
		ticks.push(time);
	}

	return ticks;
}

/**
 * Returns the start and end offsets from edges in the form of {start, end}
 * where each value is a relative width to the scale and ranges between 0 and 1.
 * They add extra margins on the both sides by scaling down the original scale.
 * Offsets are added when the `offset` option is true.
 */
function computeOffsets(table, ticks, min, max, options) {
	var start = 0;
	var end = 0;
	var first, last;

	if (options.offset && ticks.length) {
		first = interpolate$1(table, 'time', ticks[0], 'pos');
		if (ticks.length === 1) {
			start = 1 - first;
		} else {
			start = (interpolate$1(table, 'time', ticks[1], 'pos') - first) / 2;
		}
		last = interpolate$1(table, 'time', ticks[ticks.length - 1], 'pos');
		if (ticks.length === 1) {
			end = last;
		} else {
			end = (last - interpolate$1(table, 'time', ticks[ticks.length - 2], 'pos')) / 2;
		}
	}

	return {start: start, end: end, factor: 1 / (start + 1 + end)};
}

function setMajorTicks(scale, ticks, map, majorUnit) {
	var adapter = scale._adapter;
	var first = +adapter.startOf(ticks[0].value, majorUnit);
	var last = ticks[ticks.length - 1].value;
	var major, index;

	for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {
		index = map[major];
		if (index >= 0) {
			ticks[index].major = true;
		}
	}
	return ticks;
}

function ticksFromTimestamps(scale, values, majorUnit) {
	var ticks = [];
	var map = {};
	var ilen = values.length;
	var i, value;

	for (i = 0; i < ilen; ++i) {
		value = values


' height='16' fill='%23002E9A' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.01 1.696L2 1.707 14.072 13.78l-.696.697-2.078-2.078A9.232 9.232 0 018 13c-3.636 0-6.742-2.073-8-5 .647-1.505 1.783-2.784 3.228-3.672L1 2.1l.707-.707zM5 8c0-.546.146-1.058.4-1.5l4.1 4.1A3 3 0 015 8zM5.151 3.444l1.76 1.76a3 3 0 013.885 3.885l2.344 2.344C14.41 10.561 15.41 9.375 16 8c-1.258-2.927-4.364-5-8-5-.999 0-1.958.156-2.849.444z'/%3e%3c/svg%3e");}.action-link--icon-hide.action-link--danger::before{background-image:url("data:image/svg+xml,%3csvg fill-rule='evenodd' height='16' fill='%23D72222' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.01 1.696L2 1.707 14.072 13.78l-.696.697-2.078-2.078A9.232 9.232 0 018 13c-3.636 0-6.742-2.073-8-5 .647-1.505 1.783-2.784 3.228-3.672L1 2.1l.707-.707zM5 8c0-.546.146-1.058.4-1.5l4.1 4.1A3 3 0 015 8zM5.151 3.444l1.76 1.76a3 3 0 013.885 3.885l2.344 2.344C14.41 10.561 15.41 9.375 16 8c-1.258-2.927-4.364-5-8-5-.999 0-1.958.156-2.849.444z'/%3e%3c/svg%3e");}.action-link--icon-hide.action-link--danger:hover::before{background-image:url("data:image/svg+xml,%3csvg fill-rule='evenodd' height='16' fill='%23C11F1F' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.01 1.696L2 1.707 14.072 13.78l-.696.697-2.078-2.078A9.232 9.232 0 018 13c-3.636 0-6.742-2.073-8-5 .647-1.505 1.783-2.784 3.228-3.672L1 2.1l.707-.707zM5 8c0-.546.146-1.058.4-1.5l4.1 4.1A3 3 0 015 8zM5.151 3.444l1.76 1.76a3 3 0 013.885 3.885l2.344 2.344C14.41 10.561 15.41 9.375 16 8c-1.258-2.927-4.364-5-8-5-.999 0-1.958.156-2.849.444z'/%3e%3c/svg%3e");}.action-link--icon-hide.action-link--danger:active::before{background-image:url("data:image/svg+xml,%3csvg fill-rule='evenodd' height='16' fill='%23AB1B1B' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.01 1.696L2 1.707 14.072 13.78l-.696.697-2.078-2.078A9


sn(opcode, owner, name, descriptor)
        }
    }

    override fun visitMethodInsn(
        opcode: Int,
        owner: String,
        name: String,
        descriptor: String,
        isInterface: Boolean
    ) {
        val find = config.instructions.find {
            it.owner == owner && it.name == name && (it.descriptor.isEmpty() || it.descriptor == descriptor)
        }
        val mOpcode: Int
        val mOwner: String
        val mDescriptor: String
        if (find != null) {
            mOwner = replacePeriodWithSlash(className = find.proxyOwner)
            if (opcode == Opcodes.INVOKEVIRTUAL) {
                mOpcode = Opcodes.INVOKESTATIC
                mDescriptor = insetAsFirstArgument(descriptor = descriptor, owner = owner)
            } else {
                mOpcode = opcode
                mDescriptor = descriptor
            }
            LogPrint.normal(tag = config.extensionName) {
                "${classNode.name} 发现符合规则的指令：$owner $name $descriptor , 替换为 $mOwner $name $mDescriptor ，完成处理..."
            }
        } else {
            mOpcode = opcode
            mOwner = owner
            mDescriptor = descriptor
        }
        super.visitMethodInsn(mOpcode, mOwner, name, mDescriptor, isInterface)
    }

    private fun insetAsFirstArgument(descriptor: String, owner: String): String {
        val argumentsDescriptor = descriptor.substringAfter('(').substringBefore(')')
        val arguments = argumentsDescriptor.split(";").toMutableList().apply {
            add(0, "L${owner}")
        }.joinToString(separator = ";")
        return "(${arguments})" + descriptor.substringAfter(')')
    }

}/*
 * Copyright (c) 2024 Adevinta
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.adevinta.spark.lint

import com.adevinta.spark.lint.StringResourceAnnotationDetector.Companion.EMPTY_ANNOTATION_VARIABLE_ISSUE
import com.adevinta.spark.lint.StringResourceAnnotationDetector.Companion.UNKNOWN_ANNOTATION_ATTRIBUTE_NAME_ISSUE
import com.adevinta.spark.lint.StringResourceAnnotationDetector.Companion.UNSUPPORTED_ANNOTATION_ATTRIBUTE_VALUE_ISSUE
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.checks.infrastructure.TestMode.Companion.SUPPRESSIBLE
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

@RunWith(JUnit4::class)
public class StringResourceAnnotationDetectorTest : LintDetectorTest() {

    override fun getDetector(): Detector = StringResourceAnnotationDetector()
    override fun getIssues(): List<Issue> = listOf(
        UNKNOWN_ANNOTATION_ATTRIBUTE_NAME_ISSUE,
        UNSUPPORTED_ANNOTATION_ATTRIBUTE_VALUE_ISSUE,
        EMPTY_ANNOTATION_VARIABLE_ISSUE,
    )

    @Test
    public fun `unknown attribute name`() = lint()
        .files(
            xml(
                "res/values/strings.xml",
                """
                    <resources>
                        <string name="example"><annotation unknown="neutral">Example</annotation></string>
                    </resources>
                 """,
            ),
        )


_start) / MI_DATA_WIDTH + 1;

	xtlm::aximm_payload* t_trans = mem_manager->get_payload();
	t_trans->acquire();
	t_trans->deep_copy_from(*m_rd_trans);
	t_trans->set_address(si_addr);
    auto data_new = t_trans->create_and_get_data_ptr(mi_len * MI_DATA_WIDTH);
	t_trans->set_burst_size(MI_DATA_WIDTH);
	t_trans->set_burst_length(mi_len);
	m_upsize_rd_payld_queue.push(t_trans);
	m_response_mapper_upsize[t_trans] = m_rd_trans;

    m_log_msg = "Upsizing input Txn ";
    std::string payload_log;
    m_rd_trans->get_log(payload_log, PAYLOAD_LOG_LEVEL);
    m_log_msg += payload_log;
    XSC_REPORT_INFO_VERB(m_logger, "DWIDTH::004",m_log_msg.c_str(), DEBUG);

    m_log_msg = "Upsized output Txn ";
    t_trans->get_log(payload_log, PAYLOAD_LOG_LEVEL);
    m_log_msg += payload_log;
    XSC_REPORT_INFO_VERB(m_logger, "DWIDTH::004",m_log_msg.c_str(), DEBUG);

    event_upsize_trig_txn_sender.notify();
}

void axi_dwidth_converter::m_upsize_interface_txn_sender() {
	sc_core::sc_time zero_delay = SC_ZERO_TIME;
	if (wr_initiator_util->is_slave_ready()
			&& (m_upsize_wr_payld_queue.size() != 0)) {

        m_log_msg = "Sending Write transaction " +
            std::to_string(m_upsize_wr_payld_queue.front()->get_address());
        XSC_REPORT_INFO_VERB(m_logger, "DWIDTH::005",m_log_msg.c_str(), DEBUG);

        wr_initiator_util->send_transaction(*m_upsize_wr_payld_queue.front(),
				zero_delay);
		m_upsize_wr_payld_queue.pop();
	}

	//For Read transaction
	zero_delay = SC_ZERO_TIME;
	if (rd_initiator_util->is_slave_ready()
			&& (m_upsize_rd_payld_queue.size() != 0)) {

        m_log_msg = "Sending Read transaction " +
            std::to_string(m_upsize_rd_payld_queue.front()->get_address());
        XSC_REPORT_INFO_VERB(m_logger, "DWIDTH::005",m_log_msg.c_str(), DEBUG);

        rd_initiator_util->send_transaction(*m_upsize_rd_payld_queue.front(),
				zero_delay);
		m_upsize_rd_payld_queue.pop();
	}

}
void axi_dwidth_converter::m_upsize_interface_response_sender() {
	if (ratio > 1)
		return;
	if (wr_initiator_util->is_resp_available()
			&& (m_response_mapper_upsize.size() != 0)
			&& (wr_target_util->is_master_ready())) {
		xtlm::aximm_payload* response_payld = wr_initiator_util->get_resp();
        m_log_msg = "Sampled Response for Write : " + std::to_string(response_payld->get_address());
        XSC_REPORT_INFO_VERB(m_logger, "DWIDTH::006",m_log_msg.c_str(), DEBUG);

		std::map<xtlm::aximm_payload*, xtlm::aximm_payload*>::iterator itr;
		itr = (m_response_mapper_upsize.find(response_payld));
		if (itr != m_response_mapper_


ell = false;
    this.addImprovement = false;
    this.addItem = false;
  }

  toggleOwned() {
    this.addOwned = !this.addOwned;
  }

  toggleRed() {
    this.addRed = !this.addRed;
  }

  toggleBlue() {
    this.addBlue = !this.addBlue;
  }

  toggleGreen() {
    this.addGreen = !this.addGreen;
  }

  toggleBlack() {
    this.addBlack = !this.addBlack;
  }

  toggleHero() {
    this.addHero = !this.addHero;
  }

  toggleCreep() {
    this.addCreep = !this.addCreep;
  }

  toggleSpell() {
    this.addSpell = !this.addSpell;
  }

  toggleImprovement() {
    this.addImprovement = !this.addImprovement;
  }

  toggleItem() {
    this.addItem = !this.addItem;
  }
  //End Filter Methods

  cardIsInCollection(cardId) {
    const tempId = cardId.toString();
    const cardIndex = this.collection.indexOf(tempId);
    if (cardIndex !== -1) { //Card Found
      return true;
    }
    else {
      return false;
    }
  }
}
/**
 * Returns a promise that resolves after the given duration.
 * @param ms Milliseconds to delay.
 * @return A promise resolved after the specified delay.
 */
export const delay = (ms: number): Promise<void> =>
  new Promise((resolve) => setTimeout(() => resolve(), ms));

type AsyncCallback<R> = (error?: Error | null, result?: R) => void;

/**
 * Wraps a function with an async callback in a promise.
 * @param fn The function to promisify.
 */
export const promisified = <R>(fn: (cb: AsyncCallback<R>) => R): Promise<R> =>
  new Promise((resolve, reject) => {
    fn((err, data) => (err ? reject(err) : resolve(data)));
  });
type ColorType = 'success' | 'info' | 'error' | 'warning' | keyof typeof COLORS;

export default function colorLog(message: string, type?: ColorType): void {
	let color: string = type || COLORS.FgBlack;

	switch (type) {
		case 'success':
			color = COLORS.FgGreen;
			break;
		case 'info':
			color = COLORS.FgBlue;
			break;
		case 'error':
			color = COLORS.FgRed;
			break;
		case 'warning':
			color = COLORS.FgYellow;
			break;
	}

	console.log(color, message);
}

const COLORS = {
	Reset: '\x1b[0m',
	Bright: '\x1b[1m',
	Dim: '\x1b[2m',
	Underscore: '\x1b[4m',
	Blink: '\x1b[5m',
	Reverse: '\x1b[7m',
	Hidden: '\x1b[8m',
	FgBlack: '\x1b[30m',
	FgRed: '\x1b[31m',
	FgGreen: '\x1b[32m',
	FgYellow: '\x1b[33m',
	FgBlue: '\x1b[34m',
	FgMagenta: '\x1b[35m',
	FgCyan: '\x1b[36m',
	FgWhite: '\x1b[37m',
	BgBlack: '\x1b[40m',
	BgRed: '\x1b[41m',
	BgGreen: '\x1b[42m',
	BgYellow: '\x1b[43m',
	BgBlue: '\x1b[44m',
	BgMagenta: '\x1b[45m',
	BgCyan: '\x1b[46m',
	BgWhite: '\x1b[47m',
} as const;
import { MarkupElement } from './markup';
import { template_lib } from './templates/lib';
import config from './config.json';

const [tpl] = template_lib[config.default].doc;

export interface markup_document {
    name: string;
    attributes?: object;
    doctype?: boolean;
    children?: markup_document[];
    text?: string | string[]
}

export const defaultDoc: markup_document = {
    name: tpl.name,
    attributes


u-text;
}

#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
	color: $menu-submenu-focus-text;
}

#wpadminbar #wp-admin-bar-user-info .username {
	color: $menu-submenu-text;
}

/* Pointers */

.wp-pointer .wp-pointer-content h3 {
	background-color: $highlight-color;
	border-color: darken( $highlight-color, 5% );
}

.wp-pointer .wp-pointer-content h3:before {
	color: $highlight-color;
}

.wp-pointer.wp-pointer-top .wp-pointer-arrow,
.wp-pointer.wp-pointer-top .wp-pointer-arrow-inner,
.wp-pointer.wp-pointer-undefined .wp-pointer-arrow,
.wp-pointer.wp-pointer-undefined .wp-pointer-arrow-inner {
	border-bottom-color: $highlight-color;
}

/* Media */

.media-item .bar,
.media-progress-bar div {
	background-color: $highlight-color;
}

.details.attachment {
	box-shadow:
		inset 0 0 0 3px #fff,
		inset 0 0 0 7px $highlight-color;
}

.attachment.details .check {
	background-color: $highlight-color;
	box-shadow: 0 0 0 1px #fff, 0 0 0 2px $highlight-color;
}

.media-selection .attachment.selection.details .thumbnail {
	box-shadow: 0 0 0 1px #fff, 0 0 0 3px $highlight-color;
}

/* Themes */

.theme-browser .theme.active .theme-name,
.theme-browser .theme.add-new-theme a:hover:after,
.theme-browser .theme.add-new-theme a:focus:after {
	background: $highlight-color;
}

.theme-browser .theme.add-new-theme a:hover span:after,
.theme-browser .theme.add-new-theme a:focus span:after {
	color: $highlight-color;
}

.theme-section.current,
.theme-filter.current {
	border-bottom-color: $menu-background;
}

body.more-filters-opened .more-filters {
	color: $menu-text;
	background-color: $menu-background;
}

body.more-filters-opened .more-filters:before {
	color: $menu-text;
}

body.more-filters-opened .more-filters:hover,
body.more-filters-opened .more-filters:focus {
	background-color: $menu-highlight-background;
	color: $menu-highlight-text;
}

body.more-filters-opened .more-filters:hover:before,
body.more-filters-opened .more-filters:focus:before {
	color: $menu-highlight-text;
}

/* Widgets */

.widgets-chooser li.widgets-chooser-selected {
	background-color: $menu-highlight-background;
	color: $menu-highlight-text;
}

.widgets-chooser li.widgets-chooser-selected:before,
.widgets-chooser li.widgets-chooser-selected:focus:before {
	color: $menu-highlight-text;
}

/* Responsive Component */

div#wp-responsive-toggle a:before {
	color: $menu-icon;
}

.wp-responsive-open div#wp-responsive-toggle a {
	// ToDo: make inset border
	border-color: transparent;
	background: $menu-highlight-background;
}

.wp-responsive-open #wpadminbar #wp-admin-bar-menu-toggle a {
	background: $menu-submenu-background;
}

.wp-


[1]]=-2

        p=FastPriorityQueue()
        add_jump_point(start)

        # Main loop: iterate through queue
        while not p.isEmpty():
            pX,pY=p.get()
            expanded[pX][pY]=True

            try:
                add_jump_point(cardinal((pX,pY),(1,0)))
                add_jump_point(cardinal((pX,pY),(-1,0)))
                add_jump_point(cardinal((pX,pY),(0,1)))
                add_jump_point(cardinal((pX,pY),(0,-1)))

                add_jump_point(diagonal((pX,pY),(1,1)))
                add_jump_point(diagonal((pX,pY),(1,-1)))
                add_jump_point(diagonal((pX,pY),(-1,1)))
                add_jump_point(diagonal((pX,pY),(-1,-1)))

            except FoundPath:
                return self.construct(sources,start,goal)

        raise ValueError('No path found')


.currentSizeEstimate = b.estimatedSize()
	b.state = builderStateDirty

	return streamID, nil
}

// labelsEstimate estimates the size of a set of labels in bytes.
func labelsEstimate(ls labels.Labels) int {
	var (
		keysSize   int
		valuesSize int
	)

	ls.Range(func(l labels.Label) {
		keysSize += len(l.Name)
		valuesSize += len(l.Value)
	})

	// Keys are stored as columns directly, while values get compressed. We'll
	// underestimate a 2x compression ratio.
	return keysSize + valuesSize/2
}

// Append buffers a stream to be written to a data object. Append returns an
// error if the stream labels cannot be parsed or [ErrBuilderFull] if the
// builder is full.
//
// Once a Builder is full, call [Builder.Flush] to flush the buffered data,
// then call Append again with the same entry.
func (b *Builder) ObserveLogLine(tenantID string, path string, section int64, streamIDInObject int64, streamIDInIndex int64, ts time.Time, uncompressedSize int64) error {
	// Check whether the buffer is full before a stream can be appended; this is
	// tends to overestimate, but we may still go over our target size.
	//
	// Since this check only happens after the first call to Append,
	// b.currentSizeEstimate will always be updated to reflect the size following
	// the previous append.

	newEntrySize := 4 // ints and times compress well so we just need to make an estimate.

	if b.state != builderStateEmpty && b.currentSizeEstimate+newEntrySize > int(b.cfg.TargetObjectSize) {
		return ErrBuilderFull
	}

	timer := prometheus.NewTimer(b.metrics.appendTime)
	defer timer.ObserveDuration()

	tenantPointers, ok := b.pointers[tenantID]
	if !ok {
		tenantPointers = pointers.NewBuilder(b.metrics.pointers, int(b.cfg.TargetPageSize), b.cfg.MaxPageRows)
		tenantPointers.SetTenant(tenantID)
		b.pointers[tenantID] = tenantPointers
	}
	tenantPointers.ObserveStream(path, section, streamIDInObject, streamIDInIndex, ts, uncompressedSize)

	b.currentSizeEstimate = b.estimatedSize()
	b.state = builderStateDirty
	return nil
}

// Append buffers a stream to be written to a data object. Append returns an
// error if the stream labels cannot be parsed or [ErrBuilderFull] if the
// builder is full.
//
// Once a Builder is full, call [Builder.Flush] to flush the buffered data,
// then call Append again with the same entry.
func (b *Builder) AppendColumnIndex(tenantID string, path string, section int64, columnName string, columnIndex int64, valuesBloom []byte) error {
	// Check whether the buffer is full before a stream can be appended; this is
	// tends to overestimate, but we may still go over our target size.
	//
	// Since this check only happens after the first call to Append,
	// b.currentSizeEstimate will always be updated to reflect the size following
	// the previous append.

	newEntrySize := len(columnName) + 1 + 1 + len(valuesBloom) + 1

	if b.state != builderStateEmpty && b.currentSizeEstimate+newEntrySize > int(b.cfg.TargetObjectSize) {
		return ErrBuilderFull
	}

	timer := prometheus.NewTimer(b.metrics.appendTime)
	defer timer.ObserveDuration()

	tenantPointers, ok := b.pointers[tenantID]
	if !ok {
		tenantPointers = pointers.NewBuilder(b.metr


XBRL">17,957</ix:nonFraction>

					)

				<colgroup width="62.500000%"/>
				<colgroup width="7.500000%"/>
				<colgroup width="20.000000%"/>
				<colgroup width="7.500000%"/>
				<colgroup width="2.500000%"/>

				<colgroup width="38.750000%"/>
				<colgroup width="31.250000%"/>
				<colgroup width="1.250000%"/>
				<colgroup width="26.250000%"/>
				<colgroup width="1.250000%"/>
				<colgroup width="1.250000%"/>

TOTAL ASSETS LESS CURRENT

LIABILITIES

<ix:nonFraction contextRef="cfwd_31_03_2018" decimals="0" format="ixt2:numdotdecimal" name="ns5:TotalAssetsLessCurrentLiabilities" scale="0" unitRef="GBP" xmlns:ix="http://www.xbrl.org/2013/inlineXBRL">77,866</ix:nonFraction>

<ix:nonFraction contextRef="cfwd_31_03_2017" decimals="0" format="ixt2:numdotdecimal" name="ns5:TotalAssetsLessCurrentLiabilities" scale="0" unitRef="GBP" xmlns:ix="http://www.xbrl.org/2013/inlineXBRL">45,493</ix:nonFraction>

<colgroup width="100%"/>

				<colgroup width="100.000000%"/>

CREDITORS

				<colgroup width="37.500000%"/>
				<colgroup width="32.500000%"/>
				<colgroup width="1.250000%"/>
				<colgroup width="26.250000%"/>
				<colgroup width="1.250000%"/>
				<colgroup width="1.2500


				}
				return res
			})
		case "buildToProvisionedNetwork":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._Build_buildToProvisionedNetwork(ctx, field, obj)
				if res == graphql.Null {
					atomic.AddUint32(&invalids, 1)
				}
				return res
			})
		case "buildToTeam":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._Build_buildToTeam(ctx, field, obj)
				if res == graphql.Null {
					atomic.AddUint32(&invalids, 1)
				}
				return res
			})
		case "buildToPlan":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._Build_buildToPlan(ctx, field, obj)
				if res == graphql.Null {
					atomic.AddUint32(&invalids, 1)
				}
				return res
			})
		case "BuildToLatestBuildCommit":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._Build_BuildToLatestBuildCommit(ctx, field, obj)
				return res
			})
		case "BuildToBuildCommits":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._Build_BuildToBuildCommits(ctx, field, obj)
				if res == graphql.Null {
					atomic.AddUint32(&invalids, 1)
				}
				return res
			})
		default:
			panic("unknown field " + strconv.Quote(field.Name))
		}
	}
	out.Dispatch()
	if invalids > 0 {
		return graphql.Null
	}
	return out
}

var buildCommitImplementors = []string{"BuildCommit"}

func (ec *executionContext) _BuildCommit(ctx context.Context, sel ast.SelectionSet, obj *ent.BuildCommit) graphql.Marshaler {
	fields := graphql.CollectFields(ec.OperationContext, sel, buildCommitImplementors)

	out := graphql.NewFieldSet(fields)
	var invalids uint32
	for i, field := range fields {
		switch field.Name {
		case "__typename":
			out.Values[i] = graphql.MarshalString("BuildCommit")
		case "id":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {
				defer func() {
					if r := recover(); r != nil {
						ec.Error(ctx, ec.Recover(ctx, r))
					}
				}()
				res = ec._BuildCommit_id(ctx, field, obj)
				if res == graphql.Null {
					atomic.AddUint32(&invalids, 1)
				}
				return res
			})
		case "type":
			field := field
			out.Concurrently(i, func() (res graphql.Marshaler) {