:mapping path="/user/**" />
        <mvc:mapping path="/test/**" />
        <bean class="com.alibaba.interceptor.CommonInterceptor"></bean>
    </mvc:interceptor>
    <!-- 当设置多个拦截器时，先按顺序调用preHandle方法，然后逆序调用每个拦截器的postHandle和afterCompletion方法 -->
</mvc:interceptors>
```

```
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.alibaba.util.RequestUtil;

public class CommonInterceptor extends HandlerInterceptorAdapter{
    private final Logger log = LoggerFactory.getLogger(CommonInterceptor.class);
    public static final String LAST_PAGE = "com.alibaba.lastPage";
    /*
     * 利用正则映射到需要拦截的路径

    private String mappingURL;

    public void setMappingURL(String mappingURL) {
               this.mappingURL = mappingURL;
    }
  */
    /**
     * 在业务处理器处理请求之前被调用
     * 如果返回false
     *     从当前的拦截器往回执行所有拦截器的afterCompletion(),再退出拦截器链
     * 如果返回true
     *    执行下一个拦截器,直到所有的拦截器都执行完毕
     *    再执行被拦截的Controller
     *    然后进入拦截器链,
     *    从最后一个拦截器往回执行所有的postHandle()
     *    接着再从最后一个拦截器往回执行所有的afterCompletion()
     */
    @Override
    public boolean preHandle(HttpServletRequest request,
            HttpServletResponse response, Object handler) throws Exception {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            RequestUtil.saveRequest();
        }
        log.info("==============执行顺序: 1、preHandle================");
        String requestUri = request.getRequestURI();
        String contextPath = request.getContextPath();
        String url = requestUri.substring(contextPath.length());

        log.info("requestUri:"+requestUri);
        log.info("contextPath:"+contextPath);
        log.info("url:"+url);

        String username =  (String)request.getSession().getAttribute("user");
        if(username == null){
            log.info("Interceptor：跳转到login页面！");
            request.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(request, response);
            return false;
        }else
            return true;
    }

    /**
     * 在业务处理器处理请求执行完成后,生成视图之前执行的动作
     * 可在modelAndView中加入数据，比如当前时间
     */
    @Override
    public void postHandle(HttpServletRequest request,
            HttpServletResponse response, Object handler,
            ModelAndView modelAndView) throws Exception {
        log.info("==============执行顺序: 2、postHandle================");
        if(modelAndView


7),M<4)return 0;for(var L=v,F=L+M-4,j=0;j<b.length;++j){var ee=b.charCodeAt(j);if(ee>=55296&&ee<=57343){var oe=b.charCodeAt(++j);ee=65536+((ee&1023)<<10)|oe&1023}if(Q[v>>2]=ee,v+=4,v+4>F)break}return Q[v>>2]=0,v-L},$Y=b=>{for(var v=0,M=0;M<b.length;++M){var L=b.charCodeAt(M);L>=55296&&L<=57343&&++M,v+=4}return v},ZY=(b,v,M)=>{M=Ri(M);var L,F,j,ee,oe;v===2?(L=zY,F=qY,ee=WY,j=()=>ie,oe=1):v===4&&(L=HY,F=jY,ee=$Y,j=()=>H,oe=2),Ds(b,{name:M,fromWireType:ye=>{for(var Se=H[ye>>2],Ae=j(),De,ke=ye+4,Ye=0;Ye<=Se;++Ye){var We=ye+4+Ye*v;if(Ye==Se||Ae[We>>oe]==0){var at=We-ke,Nr=L(ke,at);De===void 0?De=Nr:(De+=String.fromCharCode(0),De+=Nr),ke=We+v}}return as(ye),De},toWireType:(ye,Se)=>{typeof Se!="string"&&ti(`Cannot pass non-string to C++ string type ${M}`);var Ae=ee(Se),De=ya(4+Ae+v);return H[De>>2]=Ae>>oe,F(Se,De+4,Ae+v),ye!==null&&ye.push(as,De),De},argPackAdvance:ba,readValueFromPointer:fv,destructorFunction(ye){as(ye)}})},KY=(b,v)=>{v=Ri(v),Ds(b,{isVoid:!0,name:v,argPackAdvance:0,fromWireType:()=>{},toWireType:(M,L)=>{}})},QY=1,JY=()=>QY,e6=b=>{b>4&&(mi.get(b).refcount+=1)},t6=(b,v)=>{var M=xa[b];return M===void 0&&ti(v+" has unknown type "+gv(b)),M},r6=(b,v)=>{b=t6(b,"_emval_take_value");var M=b.readValueFromPointer(v);return Q0.toHandle(M)},bc=b=>b%4===0&&(b%100!==0||b%400===0),n6=[0,31,60,91,121,152,182,213,244,274,305,335],i6=[0,31,59,90,120,151,181,212,243,273,304,334],s6=b=>{var v=bc(b.getFullYear()),M=v?n6:i6,L=M[b.getMonth()]+b.getDate()-1;return L},bv=(b,v)=>(U(b==b>>>0||b==(b|0)),U(v===(v|0)),v+2097152>>>0<4194305-!!b?(b>>>0)+v*4294967296:NaN);function o6(b,v,M){var L=bv(b,v),F=new Date(L*1e3);Q[M>>2]=F.getSeconds(),Q[M+4>>2]=F.getMinutes(),Q[M+8>>2]=F.getHours(),Q[M+12>>2]=F.getDate(),Q[M+16>>2]=F.getMonth(),Q[M+20>>2]=F.getFullYear()-1900,Q[M+24>>2]=F.getDay();var j=s6(F)|0;Q[M+28>>2]=j,Q[M+36>>2]=-(F.getTimezoneOffset()*60);var ee=new Date(F.getFullYear(),0,1),oe=new Date(F.getFullYear(),6,1).getTimezoneOffset


/*	$NetBSD: ibcs2_utsname.h,v 1.2 1994/10/26 02:53:14 cgd Exp $	*/
/* $FreeBSD: release/9.1.0/sys/i386/ibcs2/ibcs2_utsname.h 139799 2005-01-06 23:22:04Z imp $ */

/*-
 * Copyright (c) 1994 Scott Bartram
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Scott Bartram.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef	_IBCS2_UTSNAME_H
#define	_IBCS2_UTSNAME_H

#ifndef IBCS2_UNAME_SYSNAME
#define IBCS2_UNAME_SYSNAME ostype
#endif

#ifndef IBCS2_UNAME_RELEASE
#define IBCS2_UNAME_RELEASE "3.2"
#endif

#ifndef IBCS2_UNAME_VERSION
#define IBCS2_UNAME_VERSION "2.0"
#endif

struct ibcs2_utsname {
	char	sysname[9];
	char	nodename[9];
	char	release[9];
	char	version[9];
	char	machine[9];
};
#define ibcs2_utsname_len	(sizeof(struct ibcs2_utsname))

#endif /* _IBCS2_UTSNAME_H */


ories:  nil,
			expectedIDs: []string{"critical1", "high1", "medium1"},
		},
		{
			name:        "all severities",
			minSeverity: Unknown,
			categories:  nil,
			expectedIDs: []string{"critical1", "high1", "medium1", "low1", "unknown1"},
		},
		{
			name:        "vuln category only",
			minSeverity: Unknown,
			categories:  []Category{CatVuln},
			expectedIDs: []string{"critical1", "high1"},
		},
		{
			name:        "multiple categories",
			minSeverity: Unknown,
			categories:  []Category{CatVuln, CatMisconfig},
			expectedIDs: []string{"critical1", "high1", "medium1"},
		},
		{
			name:        "high severity vuln category",
			minSeverity: High,
			categories:  []Category{CatVuln},
			expectedIDs: []string{"critical1", "high1"},
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			result, err := store.List("test-batch", tt.minSeverity, tt.categories, 10, "")
			assert.NoError(t, err)

			// Extract IDs from result
			actualIDs := make([]string, len(result.Findings))
			for i, finding := range result.Findings {
				actualIDs[i] = finding.ID
			}

			assert.ElementsMatch(t, tt.expectedIDs, actualIDs)
		})
	}
}

func TestStore_List_Pagination(t *testing.T) {
	store := NewStoreWithSize(10)

	// Create many findings
	var findings []Finding
	for i := 0; i < 20; i++ {
		findings = append(findings, Finding{
			ID:       fmt.Sprintf("f%d", i),
			Category: CatVuln,
			Severity: High,
		})
	}
	store.PutBatch("test-batch", findings)

	// Test pagination
	tests := []struct {
		name        string
		limit       float64
		token       string
		expectMore  bool
		expectCount int
	}{
		{"first page", 5, "", true, 5},
		{"second page", 5, "", false, 5},   // This would need proper cursor implementation
		{"large limit", 25, "", false, 20}, // Should return all findings
		{"zero limit", 0, "", false, 0},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			result, err := store.List("test-batch", Low, nil, tt.limit, tt.token)
			assert.NoError(t, err)

			if tt.limit > 0 {
				assert.LessOrEqual(t, len(result.Findings), int(tt.limit))
			}

			if tt.expectCount > 0 {
				assert.Equal(t, tt.expectCount, len(result.Findings))
			}
		})
	}
}

func TestStore_NewStore(t *testing.T) {
	// Test default constructor
	store := NewStore()
	assert.NotNil(t, store)

	len, capacity := store.CacheStats()
	assert.Equal(t, 0, len)
	assert.Greater(t, capacity, 0) // Should have some default capacity

	// Test with custom size
	store2 := NewStoreWithSize(100)
	assert.NotNil(t, store2)

	len2, capacity2 := store2.CacheStats()
	assert.Equal(t, 0, len2)
	assert.Equal(t, 100, capacity2)
}

func TestStore_CursorEncodingDecoding(t *testing.T) {
	tests := []struct {
		name    string
		cursor  pageCursor
		wantErr bool
	}{
		{
			name: "complete cursor",
			cursor: pageCursor{
				AfterID:    "test-id",


ficial doc says:
	* If your applications has threads that will access Mono, access Mono variables, point to Mono objects,
	* be called back by Mono, these threads must be registered with the Mono runtime using the mono_thread_attach
	*/
	mono_thread_attach(GetMonoDomain());
	OUTPUT_LOG("mono_thread_attach(thread id:%d) for state %s\n", ParaEngine::GetThisThreadID(), m_name.c_str());

	return true;
}

void CMonoScriptingState::DestroyState()
{
	ParaEngine::Lock lock_(g_mutex);
	// delete mono domain.
	if(GetMonoDomain()!=0)
	{
		mono_jit_cleanup(GetMonoDomain());
		OUTPUT_LOG("mono jit cleaned up(thread id:%d) for state %s\n", ParaEngine::GetThisThreadID(), m_name.c_str());
		s_mono_domain = NULL;
	}
}

void CMonoScriptingState::CreateAppDomain()
{
	/*
	* Load the default Mono configuration file, this is needed
	* if you are planning on using the dllmaps defined on the
	* system configuration
	*/
	if(s_mono_domain == NULL)
	{
#ifdef WIN32
		// In windows, mono .net library cannot be automatically found.
		string mono_lib_path = MONO_ROOT;
		mono_lib_path += "\\lib\\";
		for(int i=0;i<mono_lib_path.size(); i++)
		{
			if(mono_lib_path[i] == '/')
				mono_lib_path[i] = '\\';
		}

		string mono_etc_path = MONO_ROOT;
		mono_etc_path += "\\etc";
		for(int i=0;i<mono_etc_path.size(); i++)
		{
			if(mono_etc_path[i] == '/')
				mono_etc_path[i] = '\\';
		}

		OUTPUT_LOG("mono_set_dirs: \n   lib:%s\n   etc:%s\n", mono_lib_path.c_str(), mono_etc_path.c_str());
		mono_set_dirs(mono_lib_path.c_str(), mono_etc_path.c_str());
#else
		// for linux, mono/lib/ and mono/etc directories can be found automatically.
#endif
		mono_config_parse(NULL);

		const char* mono_jit_version_ = "v2.0.50727";
		/*
		* mono_jit_init() creates a domain: each assembly is
		* loaded and run in a MonoDomain with version 2.0.
		*/
		s_mono_domain = mono_jit_init_version ("NPLMono_Root", mono_jit_version_);

		// Set root mono domain in to which all assemblies are loaded.
		m_global_assemblies_pool->SetMonoDomain(s_mono_domain);

		// add all internal calls
		Init();

		// mono jit init version
		OUTPUT_LOG("mono_jit_init_version %s\n", mono_jit_version_);
	}
}

const char* CMonoScriptingState::GetName() const
{
	return m_name.c_str();
}

void CMonoScriptingState::SetNPLRuntimeState(NPL::INPLRuntimeState* pState)
{
	m_npl_runtime_state = pState;
}

NPL::INPLRuntimeState* CMonoScriptingState::GetNPLRuntimeState()
{
	return m_npl_runtime_state;
}

void CMonoScriptingState::Init()
{
	LoadNPLLib();
	LoadParaLib();
}

bool CMonoScriptingState::IsScriptFileLoaded(const string& filepath)
{
	return false;
}

bool CMonoScriptingState::LoadFile(const string& filePath, bool bReload)
{
	// never load files, we will only load at activation time.
	return true;
}

int CMonoScriptingState::DoString(const char* s


h);
    this.baseFs = defaultFsLayer;
  }
  mapToBase(p) {
    return p;
  }
  mapFromBase(p) {
    return p;
  }
}
const dynamicFsLayer = new DynamicFS();
let manager;
const defaultApi = Object.assign(makeApi(defaultRuntimeState, {
  fakeFs: dynamicFsLayer,
  pnpapiResolution: defaultPnpapiResolution
}), {
  makeApi: (_a) => {
    var _b = _a, {
      basePath = void 0,
      fakeFs = dynamicFsLayer,
      pnpapiResolution = defaultPnpapiResolution
    } = _b, rest = __objRest(_b, [
      "basePath",
      "fakeFs",
      "pnpapiResolution"
    ]);
    const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState;
    return makeApi(apiRuntimeState, __spreadValues({
      fakeFs,
      pnpapiResolution
    }, rest));
  },
  setup: (api) => {
    applyPatch(api || defaultApi, {
      fakeFs: defaultFsLayer,
      manager
    });
    dynamicFsLayer.baseFs = new NodeFS(fs__default.default);
  }
});
manager = makeManager(defaultApi, {
  fakeFs: dynamicFsLayer
});
if (module.parent && module.parent.id === `internal/preload`) {
  defaultApi.setup();
  if (module.filename) {
    delete require$$0__default.default._cache[module.filename];
  }
}
if (process.mainModule === module) {
  const reportError = (code, message, data) => {
    process.stdout.write(`${JSON.stringify([{code, message, data}, null])}
`);
  };
  const reportSuccess = (resolution) => {
    process.stdout.write(`${JSON.stringify([null, resolution])}
`);
  };
  const processResolution = (request, issuer) => {
    try {
      reportSuccess(defaultApi.resolveRequest(request, issuer));
    } catch (error) {
      reportError(error.code, error.message, error.data);
    }
  };
  const processRequest = (data) => {
    try {
      const [request, issuer] = JSON.parse(data);
      processResolution(request, issuer);
    } catch (error) {
      reportError(`INVALID_JSON`, error.message, error.data);
    }
  };
  if (process.argv.length > 2) {
    if (process.argv.length !== 4) {
      process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} <request> <issuer>
`);
      process.exitCode = 64;
    } else {
      processResolution(process.argv[2], process.argv[3]);
    }
  } else {
    let buffer = ``;
    const decoder = new StringDecoder__default.default.StringDecoder();
    process.stdin.on(`data`, (chunk) => {
      buffer += decoder.write(chunk);
      do {
        const index = buffer.indexOf(`
`);
        if (index === -1)
          break;
        const line = buffer.slice(0, index);
        buffer = buffer.slice(index + 1);
        processRequest(line);
      } while (true);
    });
  }
}

module.exports = defaultApi;
// Copyright 2019 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum 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 3 of the License, or
// (at your option) any later version.
//
// go-ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied


-- items: 12204, 5416, 8357, 8356, 5417
function event_say(e)
	if(e.message:findi("hail")) then
		e.self:Say("Welcome. Please stock up on provisions, especially if you are headed toward the lair of the vile gnolls. If so, I wish you much luck and many gnoll pelts!! I also have knowledge of a [powerful dog]. I pray you do not encounter him.");
	elseif(e.message:findi("powerful dog")) then
		e.self:Say("I have encountered a gnoll who spoke the common tongue. He dared to call himself Lord Elgnub. He swore that some day we would cross paths and he would snatch my infant son Joseph from our home. He would stand no chance against me and the mighty [Gnoll Slayer].");
	elseif(e.message:findi("gnoll slayer")) then
		e.self:Say("Gnoll Slayer is the mighty longsword which was passed down unto me through generations of Sayers. My days of battle are over, but I can still wield her with ferocity. The only thing more precious would be my son, Joseph Sayer. I would trade Gnoll Slayer only for him to be safe and sound at home.");
	elseif(e.message:findi("potential")) then
		e.self:Say("The true potential of Gnoll Slayer is an enchantment which was once imbedded into a gnoll's eye which was placed into the hilt of the blade. The spell would help you fight off disease and call forth a wolf to fight beside you. Alas, the gnoll eye was stolen from the blade by a great, one-eyed, white gnoll. Alone with the eye, the only book which explained how to return the enchantment was also stolen. I know not where this gnoll might be. If you can find the journal and the eye, return them with th


/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

#include "ble_gap_app.h"
#include "ble_serialization.h"
#include "app_util.h"

uint32_t ble_gap_appearance_get_req_enc(uint16_t const * const p_appearance,
                                        uint8_t * const        p_buf,
                                        uint32_t * const       p_buf_len)
{
    uint32_t index = 0;

    SER_ASSERT_NOT_NULL(p_buf);
    SER_ASSERT_NOT_NULL(p_buf_len);

    SER_ASSERT_LENGTH_LEQ(index + 1 + 1, *p_buf_len);

    p_buf[index++] = SD_BLE_GAP_APPEARANCE_GET;
    p_buf[index++] = (p_appearance == NULL) ? SER_FIELD_NOT_PRESENT : SER_FIELD_PRESENT;

    *p_buf_len = index;

    return NRF_SUCCESS;
}

uint32_t ble_gap_appearance_get_rsp_dec(uint8_t const * const p_buf,
                                        uint32_t              packet_len,
                                        uint16_t * const      p_appearance,
                                        uint32_t * const      p_result_code)
{
    SER_ASSERT_NOT_NULL(p_buf);
    SER_ASSERT_NOT_NULL(p_result_code);

    uint32_t index         = 0;
    uint32_t decode_result = ser_ble_cmd_rsp_result_code_dec(p_buf, &index, packet_len,
                                                             SD_BLE_GAP_APPEARANCE_GET,
                                                             p_result_code);

    if (decode_result != NRF_SUCCESS)
    {
        return decode_result;
    }

    if (*p_result_code != NRF_SUCCESS)
    {
        SER_ASSERT_LENGTH_EQ(index, packet_len);

        return NRF_SUCCESS;
    }

    SER_ASSERT_LENGTH_LEQ(index + sizeof (uint16_t), packet_len);

    uint16_dec(p_buf, packet_len, &index, p_appearance);

    SER_ASSERT_LENGTH_EQ(index, packet_len);

    return NRF_SUCCESS;
}


 static_cast<uint32_t>(siStripBadStrip.decode(value).flag);

      printError(ss, ((flag & FedErrorMask) == FedErrorMask), "Fed error, ");
      printError(ss, ((flag & DigiErrorMask) == DigiErrorMask), "Digi error, ");
      printError(ss, ((flag & ClusterErrorMask) == ClusterErrorMask), "Cluster error");
      ss << std::endl;

      if (printdebug_) {
        ss << " firstBadStrip " << siStripBadStrip.decode(value).firstStrip << "\t "
           << " NconsecutiveBadStrips " << siStripBadStrip.decode(value).range << "\t "  // << std::endl;
           << " flag " << siStripBadStrip.decode(value).flag << "\t "
           << " packed integer " << std::hex << value << std::dec << "\t " << std::endl;
      }
    }
    ss << std::endl;
  }
  edm::LogInfo("SiStripBadComponentsDQMServiceReader") << ss.str();
}

void SiStripBadComponentsDQMServiceReader::printError(std::stringstream& ss,
                                                      const bool error,
                                                      const std::string& errorText) {
  if (error) {
    ss << errorText << "\t ";
  } else {
    ss << "\t\t ";
  }
}

string SiStripBadComponentsDQMServiceReader::detIdToString(DetId detid, const TrackerTopology& tTopo) {
  std::string detector;
  int layer = 0;
  int stereo = 0;
  int side = -1;

  // Using the operator[] if the element does not exist it is created with the default value. That is 0 for integral types.
  switch (detid.subdetId()) {
    case StripSubdetector::TIB: {
      detector = "TIB";
      layer = tTopo.tibLayer(detid.rawId());
      stereo = tTopo.tibStereo(detid.rawId());
      break;
    }
    case StripSubdetector::TOB: {
      detector = "TOB";
      layer = tTopo.tobLayer(detid.rawId());
      stereo = tTopo.tobStereo(detid.rawId());
      break;
    }
    case StripSubdetector::TEC: {
      // is this module in TEC+ or TEC-?
      side = tTopo.tecSide(detid.rawId());
      detector = "TEC";
      layer = tTopo.tecWheel(detid.rawId());
      stereo = tTopo.tecStereo(detid.rawId());
      break;
    }
    case StripSubdetector::TID: {
      // is this module in TID+ or TID-?
      side = tTopo.tidSide(detid.rawId());
      detector = "TID";
      layer = tTopo.tidWheel(detid.rawId());
      stereo = tTopo.tidStereo(detid.rawId());
      break;
    }
  }
  std::string name(detector + "\t" + std::to_string(layer) + "\t" + std::to_string(stereo) + "\t");
  if (side == 1) {
    name += "-";
  } else if (side == 2) {
    name += "+";
  }
  //   if( side != -1 ) {
  //     name += std::to_string(side);
  //   }

  return name;
}

#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(SiStripBadComponentsDQMServiceReader);
#include "DQMOffline/CalibTracker/plugins/SiStripDQMPopConSourceHandler.h"
#include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"

/**
  @class SiStrip


=46;drc=1c705168ab5118c42e5831cd84871d51ff5176d1
            val glVersion = GLES20.glGetString(GLES20.GL_VERSION)
            val pattern = Pattern.compile("OpenGL ES ([0-9]+)\\.([0-9]+).*")
            val matcher = pattern.matcher(glVersion)
            if (matcher.find()) {
                val major = requireNotNull(matcher.group(1))
                val minor = requireNotNull(matcher.group(2))
                return "$major.$minor"
            }
            return VERSION_UNKNOWN
        }

    /**
     * Chooses the surface attributes for HDR 10bit.
     */
    fun chooseSurfaceAttrib(
        eglExtensions: String,
        dynamicRange: DynamicRangeProfile
    ): IntArray {
        var attribs = EMPTY_ATTRIBS
        if (dynamicRange.transferFunction == MediaFormat.COLOR_TRANSFER_HLG) {
            if (eglExtensions.contains("EGL_EXT_gl_colorspace_bt2020_hlg")) {
                attribs = HLG_SURFACE_ATTRIBS
            } else {
                Logger.w(
                    TAG, ("Dynamic range uses HLG encoding, but "
                            + "device does not support EGL_EXT_gl_colorspace_bt2020_hlg."
                            + "Fallback to default colorspace.")
                )
            }
        }
        // TODO(b/303675500): Add path for PQ (EGL_EXT_gl_colorspace_bt2020_pq) output for
        //  HDR10/HDR10+
        return attribs
    }

    /**
     * Generates framebuffer object.
     */
    fun generateFbo(): Int {
        val fbos = IntArray(1)
        GLES20.glGenFramebuffers(1, fbos, 0)
        checkGlErrorOrThrow("glGenFramebuffers")
        return fbos[0]
    }

    /**
     * Generates texture.
     */
    fun generateTexture(): Int {
        val textures = IntArray(1)
        GLES20.glGenTextures(1, textures, 0)
        checkGlErrorOrThrow("glGenTextures")
        return textures[0]
    }

    /**
     * Deletes texture.
     */
    fun deleteTexture(texture: Int) {
        val textures = intArrayOf(texture)
        GLES20.glDeleteTextures(1, textures, 0)
        checkGlErrorOrThrow("glDeleteTextures")
    }

    /**
     * Deletes framebuffer object.
     */
    fun deleteFbo(fbo: Int) {
        val fbos = intArrayOf(fbo)
        GLES20.glDeleteFramebuffers(1, fbos, 0)
        checkGlErrorOrThrow("glDeleteFramebuffers")
    }

    private fun getFragmentShaderSource(shaderProvider: ShaderProvider): String {
        // Throw IllegalArgumentException if the shader provider can not provide a valid
        // fragment shader.
        try {
            val source = shaderProvider.createFragmentShader(VAR_TEXTURE, VAR_TEXTURE_COORD)
            // A simple check to workaround custom shader doesn't contain required variable.
            // See b/241193761.
            require(
                !(source == null || !source.contains(VAR_TEXTURE_COORD) || !source.contains(
                    VAR_TEXTURE
                ))
            ) { "Invalid fragment shader" }
            return source
        } catch (t: Throwable) {
            if (t is IllegalArgumentException) {
                throw t
            }
            throw IllegalArgumentException("Unable retrieve fragment shader source", t)
        }
    }

    enum class InputFormat {
        /**
         * Input texture format is unknown.
         *
         *
         * When the input format is unknown, HDR content may require rendering blank frames
         * since we are not


'package:app_core/globals.dart';
import 'package:console_mixin/console_mixin.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:liso/features/joined_vaults/joined_vault.controller.dart';

class JoinedVaultsScreenController extends GetxController with ConsoleMixin {
  static JoinedVaultsScreenController get to => Get.find();

  // VARIABLES
  final formKey = GlobalKey<FormState>();
  final vaultIdController = TextEditingController();
  final cipherKeyController = TextEditingController();

  // PROPERTIES

  // PROPERTIES

  // GETTERS

  // INIT

  // FUNCTIONS
  @override
  void onReady() {
    // Fix stuck loading bug
    Future.delayed(1.seconds).then((value) {
      if (JoinedVaultsController.to.busy.value) {
        JoinedVaultsController.to.restart();
      }
    });

    super.onReady();
  }

  void _join() async {
    // TODO: temporary
    // if (!formKey.currentState!.validate()) return;
    // Get.backLegacy(); // close dialog

    // // check if already a member of the vault
    // final alreadyJoined = JoinedVaultsController.to.data
    //     .where((e) => e.docId == vaultIdController.text);

    // if (alreadyJoined.isNotEmpty) {
    //   return UIUtils.showSimpleDialog(
    //     'Already Joined This Vault',
    //     'You are already a member of this vault',
    //   );
    // }

    // final sharedVaultDoc = FirestoreService.to.sharedVaults.doc(
    //   vaultIdController.text,
    // );

    // final membersCol = sharedVaultDoc.collection(kVaultMembersCollection);

    // final statsSnapshot = await membersCol.doc(kStatsDoc).get();
    // final existingMembers = statsSnapshot.data()?['count'] ?? 0;
    // console.info('existingMembers: $existingMembers');

    // final sharedVaultSnapshot = await sharedVaultDoc.get();
    // final sharedVault = sharedVaultSnapshot.data();

    // if (sharedVault == null) {
    //   return UIUtils.showSimpleDialog(
    //     'Shared Vault Not Found',
    //     'The shared vault with ID: ${vaultIdController.text} does not exist.',
    //   );
    // }

    // final ownerDoc = FirestoreService.to.users.doc(sharedVault.userId);
    // final ownerSnapshot = await ownerDoc.get();
    // final owner = ownerSnapshot.data()!;

    // // obtain owner limits
    // var ownerLimits = ExtraLimitsConfig.free;

    // if (owner.limits == 'holder') {
    //   ownerLimits = ExtraLimitsConfig.holder;
    // } else if (owner.limits == 'staker') {
    //   ownerLimits = ExtraLimitsConfig.staker;
    // } else if (owner.limits == 'pro') {
    //   ownerLimits = ExtraLimitsConfig.pro;
    // }

    // if (existingMembers >= ownerLimits.sharedMembers) {
    //   return UIUtils.showSimpleDialog(
    //     'Unable To Join',
    //     'The owner of the shared vault reached the max members limit',
    //   );
    // }

    // // obtain vault object
    // final snapshot = await FirestoreService.to.sharedVaults
    //     .where(FieldPath.documentId, isEqualTo: vaultIdController.text)
    //     .get();

    // if (snapshot.docs.isEmpty) {
    //   return UIUtils.showSimpleDialog(
    //     'Shared Vault Not Found',
    //     'The shared vault with ID: ${vaultIdController.text} cannot be found',
    //   );
    // }

    // final vault = snapshot.docs.first.data();
    // console.info('${vault.name} -> ${vault.description}');

    // // check if we're joining our own vault
    // if (vault.userId == AuthService.to.userId) {
    //


nal simulation = SpringSimulation(
      SpringDescription.withDampingRatio(
        mass: 1.0,
        stiffness: 500.0,
        ratio: 0.5,
      ),
      _currentLeft,
      target,
      0.0, // 初始速度
    );
    _springController.animateWith(simulation);
  }

  void _handleTap(ThemeMode mode) {
    context.read<ThemeProvider>().setThemeMode(mode);
  }

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    _handleThemeChange();
  }

  void _handleThemeChange() {
    final width =
        context.width > 400
            ? 400 - 16 * 2 - 5 * 2
            : context.width - 16 * 2 - 5 * 2;
    // ThemeMode themeMode = context.select<AppData, ThemeMode>(
    //   (data) => data.themeMode,
    // );

    final themeMode = context.watch<ThemeProvider>().themeMode;
    int index = switch (themeMode) {
      ThemeMode.system => 0,
      ThemeMode.light => 1,
      ThemeMode.dark => 2,
    };

    final newTarget = width / 3 * index;

    if ((_targetLeft - newTarget).abs() > 0.1) {
      _targetLeft = newTarget;
      WidgetsBinding.instance.addPostFrameCallback((_) {
        _startSpringAnimation(_targetLeft);
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    // 因为constraints限制，最大宽度为400
    final width =
        context.width > 400
            ? 400 - 16 * 2 - 5 * 2
            : context.width - 16 * 2 - 5 * 2;
    return Container(
      width: double.infinity,
      height: 50,
      padding: const EdgeInsets.all(5.0),
      decoration: BoxDecoration(
        color: context.colorScheme.surfaceContainerHighest,
        borderRadius: BorderRadius.circular(99),
      ),
      child: Stack(
        children: [
          Positioned(
            left: _currentLeft,
            top: 0,
            bottom: 0,
            width: width / 3,
            child: Container(
              decoration: BoxDecoration(
                color: context.colorScheme.surface,
                borderRadius: BorderRadius.circular(99),
              ),
            ),
          ),
          Positioned.fill(
            child: Row(
              children: [
                Expanded(
                  child: InkWell(
                    onTap: () => _handleTap(ThemeMode.system),
                    child: Text(
                      'System',
                      style: context.textTheme.titleMedium,
                      textAlign: TextAlign.center,
                    ),
                  ),
                ),
                Expanded(
                  child: InkWell(
                    onTap: () => _handleTap(ThemeMode.light),
                    child: Text(
                      'Light',
                      style: context.textTheme.titleMedium,
                      textAlign: TextAlign.center,
                    ),
                  ),
                ),
                Expanded(
                  child: InkWell(
                    onTap: () => _handleTap(ThemeMode.dark),
                    child: Text(
                      'Dark',
                      style: context.textTheme.titleMedium,
                      textAlign: TextAlign.center,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/widgets.dart';
import 'package:haka_comic/database/images_helper.dart';
import 'package:haka_comic/network/models.dart';

mixin ComicListMixin<T extends StatefulWidget> on State<T> {
  @override
  dispose() {
    _preloadDebounceTimer?.cancel();
    super.dispose();
  }

  ///


,
	ICE_LINK_SPEED_20000MBPS,
	ICE_LINK_SPEED_25000MBPS,
	ICE_LINK_SPEED_40000MBPS,
	ICE_LINK_SPEED_50000MBPS,
	ICE_LINK_SPEED_100000MBPS,	/* BIT(10) */
	ICE_LINK_SPEED_200000MBPS,
};

/**
 * ice_get_link_speed - get integer speed from table
 * @index: array index from fls(aq speed) - 1
 *
 * Returns: u32 value containing integer speed
 */
u32 ice_get_link_speed(u16 index)
{
	if (index >= ARRAY_SIZE(ice_aq_to_link_speed))
		return ICE_LINK_SPEED_UNKNOWN;

	return ice_aq_to_link_speed[index];
}

/**
 * ice_fw_supports_fec_dis_auto
 * @hw: pointer to the hardware structure
 *
 * Checks if the firmware supports FEC disable in Auto FEC mode
 */
bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw)
{
	if (ice_is_e830(hw))
		return true;
	if (ice_is_e825c(hw))
		return true;
	return ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E810,
				 ICE_FW_FEC_DIS_AUTO_MAJ,
				 ICE_FW_FEC_DIS_AUTO_MIN,
				 ICE_FW_FEC_DIS_AUTO_PATCH) ||
	       ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E82X,
				 ICE_FW_FEC_DIS_AUTO_MAJ_E82X,
				 ICE_FW_FEC_DIS_AUTO_MIN_E82X,
				 ICE_FW_FEC_DIS_AUTO_PATCH_E82X);
}

/**
 * ice_is_fw_auto_drop_supported
 * @hw: pointer to the hardware structure
 *
 * Checks if the firmware supports auto drop feature
 */
bool ice_is_fw_auto_drop_supported(struct ice_hw *hw)
{
	if (hw->api_maj_ver >= ICE_FW_API_AUTO_DROP_MAJ &&
	    hw->api_min_ver >= ICE_FW_API_AUTO_DROP_MIN)
		return true;
	return false;
}


e130-\\x1e136\\x1e2ae\\x1e2ec-\\x1e2ef\\x1e4ec-\\x1e4ef"
            "\\x1e5ee\\x1e5ef\\x1e8d0-\\x1e8d6\\x1e944-\\x1e94a"
            "\\xe0100-\\xe01ef]";
    }

    static const char* Nd()
    {
        return "[\\x30-\\x39\\x660-\\x669\\x6f0-\\x6f9\\x7c0-\\x7c9"
            "\\x966-\\x96f\\x9e6-\\x9ef\\xa66-\\xa6f\\xae6-\\xaef\\xb66-\\xb6f"
            "\\xbe6-\\xbef\\xc66-\\xc6f\\xce6-\\xcef\\xd66-\\xd6f\\xde6-\\xdef"
            "\\xe50-\\xe59\\xed0-\\xed9\\xf20-\\xf29\\x1040-\\x1049"
            "\\x1090-\\x1099\\x17e0-\\x17e9\\x1810-\\x1819\\x1946-\\x194f"
            "\\x19d0-\\x19d9\\x1a80-\\x1a89\\x1a90-\\x1a99\\x1b50-\\x1b59"
            "\\x1bb0-\\x1bb9\\x1c40-\\x1c49\\x1c50-\\x1c59\\xa620-\\xa629"
            "\\xa8d0-\\xa8d9\\xa900-\\xa909\\xa9d0-\\xa9d9\\xa9f0-\\xa9f9"
            "\\xaa50-\\xaa59\\xabf0-\\xabf9\\xff10-\\xff19\\x104a0-\\x104a9"
            "\\x10d30-\\x10d39\\x10d40-\\x10d49\\x11066-\\x1106f"
            "\\x110f0-\\x110f9\\x11136-\\x1113f\\x111d0-\\x111d9"
            "\\x112f0-\\x112f9\\x11450-\\x11459\\x114d0-\\x114d9"
            "\\x11650-\\x11659\\x116c0-\\x116c9\\x116d0-\\x116e3"
            "\\x11730-\\x11739\\x118e0-\\x118e9\\x11950-\\x11959"
            "\\x11bf0-\\x11bf9\\x11c50-\\x11c59\\x11d50-\\x11d59"
            "\\x11da0-\\x11da9\\x11f50-\\x11f59\\x16130-\\x16139"
            "\\x16a60-\\x16a69\\x16ac0-\\x16ac9\\x16b50-\\x16b59"
            "\\x16d70-\\x16d79\\x1ccf0-\\x1ccf9\\x1d7ce-\\x1d7ff"
            "\\x1e140-\\x1e149\\x1e2f0-\\x1e2f9\\x1e4f0-\\x1e4f9"
            "\\x1e5f1-\\x1e5fa\\x1e950-\\x1e959\\x1fbf0-\\x1fbf9]";
    }

    static const char* Nl()
    {
        return "[\\x16ee-\\x16f0\\x2160-\\x2182\\x2185-\\x2188\\x3007"
            "\\x3021-\\x3029\\x3038-\\x303a\\xa6e6-\\xa6ef\\x10140-\\x10174"
            "\\x10341\


create_ipam_pool(
    input: &crate::input::CreateIpamPoolInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::SerializationError> {
    let mut out = String::new();
    #[allow(unused_mut)]
    let mut writer = aws_smithy_query::QueryWriter::new(&mut out, "CreateIpamPool", "2016-11-15");
    #[allow(unused_mut)]
    let mut scope_802 = writer.prefix("DryRun");
    if let Some(var_803) = &input.dry_run {
        scope_802.boolean(*var_803);
    }
    #[allow(unused_mut)]
    let mut scope_804 = writer.prefix("IpamScopeId");
    if let Some(var_805) = &input.ipam_scope_id {
        scope_804.string(var_805);
    }
    #[allow(unused_mut)]
    let mut scope_806 = writer.prefix("Locale");
    if let Some(var_807) = &input.locale {
        scope_806.string(var_807);
    }
    #[allow(unused_mut)]
    let mut scope_808 = writer.prefix("SourceIpamPoolId");
    if let Some(var_809) = &input.source_ipam_pool_id {
        scope_808.string(var_809);
    }
    #[allow(unused_mut)]
    let mut scope_810 = writer.prefix("Description");
    if let Some(var_811) = &input.description {
        scope_810.string(var_811);
    }
    #[allow(unused_mut)]
    let mut scope_812 = writer.prefix("AddressFamily");
    if let Some(var_813) = &input.address_family {
        scope_812.string(var_813.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_814 = writer.prefix("AutoImport");
    if let Some(var_815) = &input.auto_import {
        scope_814.boolean(*var_815);
    }
    #[allow(unused_mut)]
    let mut scope_816 = writer.prefix("PubliclyAdvertisable");
    if let Some(var_817) = &input.publicly_advertisable {
        scope_816.boolean(*var_817);
    }
    #[allow(unused_mut)]
    let mut scope_818 = writer.prefix("AllocationMinNetmaskLength");
    if let Some(var_819) = &input.allocation_min_netmask_length {
        scope_818.number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_819).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_820 = writer.prefix("AllocationMaxNetmaskLength");
    if let Some(var_821) = &input.allocation_max_netmask_length {
        scope_820.number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_821).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_822 = writer.prefix("AllocationDefaultNetmaskLength");
    if let Some(var_823) = &input.allocation_default_netmask_length {
        scope_822.number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_823).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_824 = writer.prefix("AllocationResourceTag");
    if let Some(var_825) = &input.allocation_resource_tags {
        let mut list_827 = scope_824.start_list(true, Some("item"));
        for item_82


 Logic(), Logic(width: 10));
      await mod.build();
      final vectors = [
        Vector({'a': 0, 'b': 0, 'd': 5},
            {'y': 0, 'z': 1, 'x': LogicValue.x, 'q': LogicValue.x}),
        Vector({'a': 0, 'b': 1, 'd': 6},
            {'y': 1, 'z': 0, 'x': LogicValue.x, 'q': 13}),
        Vector({'a': 1, 'b': 0, 'd': 7}, {'y': 1, 'z': 0, 'x': 0, 'q': 7}),
        Vector({'a': 1, 'b': 1, 'd': 8}, {'y': 1, 'z': 1, 'x': 1, 'q': 8}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
      final simResult = SimCompare.iverilogVector(mod, vectors);
      expect(simResult, equals(true));
    });

    test('iffblock comb', () async {
      final mod = IfBlockModule(Logic(), Logic());
      await mod.build();
      final vectors = [
        Vector({'a': 0, 'b': 0}, {'c': 0, 'd': 1}),
        Vector({'a': 0, 'b': 1}, {'c': 1, 'd': 0}),
        Vector({'a': 1, 'b': 0}, {'c': 1, 'd': 0}),
        Vector({'a': 1, 'b': 1}, {'c': 0, 'd': 1}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
      final simResult = SimCompare.iverilogVector(mod, vectors);
      expect(simResult, equals(true));
    });

    test('if invalid ', () async {
      final mod = IffModule(Logic(), Logic());
      await mod.build();
      final vectors = [
        Vector({'a': 1, 'b': 0}, {'c': 0}),
        Vector({'a': LogicValue.z, 'b': 1}, {'c': LogicValue.x}),
        Vector({'a': LogicValue.x, 'b': 0}, {'c': LogicValue.x}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
    });

    test('single iffblock comb', () async {
      final mod = SingleIfBlockModule(Logic());
      await mod.build();
      final vectors = [
        Vector({'a': 1}, {'c': 1}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
      final simResult = SimCompare.iverilogVector(mod, vectors);
      expect(simResult, equals(true));
    });

    test('elseifblock comb', () async {
      final mod = ElseIfBlockModule(Logic(), Logic());
      await mod.build();
      final vectors = [
        Vector({'a': 0, 'b': 0}, {'c': 0, 'd': 1}),
        Vector({'a': 0, 'b': 1}, {'c': 1, 'd': 0}),
        Vector({'a': 1, 'b': 0}, {'c': 1, 'd': 0}),
        Vector({'a': 1, 'b': 1}, {'c': 0, 'd': 1}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
      final simResult = SimCompare.iverilogVector(mod, vectors);
      expect(simResult, equals(true));
    });

    test('Conditional assign module with invalid inputs', () async {
      final mod = ConditionalAssignModule(Logic());
      await mod.build();
      final vectors = [
        Vector({'a': 1}, {'c': 1}),
        Vector({'a': 0}, {'c': 0}),
        Vector({'a': LogicValue.z}, {'c': LogicValue.x}),
        Vector({'a': LogicValue.x}, {'c': LogicValue.x}),
      ];
      await SimCompare.checkFunctionalVector(mod, vectors);
      // no SV run here, ROHD converts Z to X
    });

    test('Conditional assign module with invalid inputs wider than 1 bit',
        () async {
      final mod = ConditionalAssignModule(Logic(width: 8));
      await mod.build();
      final vectors = [
        Vector({'a': 0xa5}, {'c


h_internal_pressure")
    end

    if byte3 & 1 ~= 0 then
      table.insert(errors, "fuel_cell_temperature_variation")
    end
    telemetry["warning"] = warning
    telemetry["alerts"] = errors
  end

  if msg_id == 0x090 then
    local voltage, current = string.unpack(">I2>I2", data)
    telemetry["voltage"] = 0.0216 * voltage
    telemetry["current"] = (current - 2048) * 0.06105
  end

  if msg_id == 0x091 then
    local temperature, _, _, _, internal_h2_pressure, state = string.unpack("I1I1I1I1I1I1", data)
    telemetry["temperature"] = to7bits(temperature)
    telemetry["internal_h2_pressure"] = to7bits(internal_h2_pressure) / 10.0
    if state == 0 then
      telemetry["state"] = "auto_check"
    elseif state == 1 then
      telemetry["state"] = "h2_inlet_pressure"
    elseif state == 10 then
      telemetry["state"] = "waiting"
    elseif state >= 11 and state <= 14  then
      telemetry["state"] = "start-up"
    elseif state == 15  then
      telemetry["state"] = "idle"
    elseif state == 17  then
      telemetry["state"] = "operation"
    elseif state == 21  then
      telemetry["state"] = "switch_off"
    elseif state == 22  then
      telemetry["state"] = "locked_out"
    end
  end

end

function to7bits(data)
  local value = data & 0x7F
  local sign = data >> 7

  if sign == 1 then
    return value * (-1)
  else
    return value
  end
end

function start()
  local command = string.pack("BBBBBBBB",1,0,0,0,0,0,0,0)
  return can.send(0x001, command)
end

function stop()
  local command = string.pack("BBBBBBBB",0,1,0,0,0,0,0,0)
  return can.send(0x001, command)
end

enapter.register_command_handler("start", function(ctx)
  if start() ~= 0 then
    ctx.error("CAN failed")
  end
end)

enapter.register_command_handler("stop", function(ctx)
  if stop() ~= 0 then
    ctx.error("CAN failed")
  end
end)

main()


IC_DETAIL_SIZEOF_LLONG == 1
#define BOOST_ATOMIC_HAS_NATIVE_LLONG_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT8_IPC_WAIT_NOTIFY
#elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 2
#define BOOST_ATOMIC_HAS_NATIVE_LLONG_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT16_IPC_WAIT_NOTIFY
#elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 4
#define BOOST_ATOMIC_HAS_NATIVE_LLONG_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT32_IPC_WAIT_NOTIFY
#elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 8
#define BOOST_ATOMIC_HAS_NATIVE_LLONG_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT64_IPC_WAIT_NOTIFY
#else
#define BOOST_ATOMIC_HAS_NATIVE_LLONG_IPC_WAIT_NOTIFY 0
#endif
#endif

#ifndef BOOST_ATOMIC_HAS_NATIVE_POINTER_WAIT_NOTIFY
#if (BOOST_ATOMIC_DETAIL_SIZEOF_POINTER + 0) == 8
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT64_WAIT_NOTIFY
#elif (BOOST_ATOMIC_DETAIL_SIZEOF_POINTER + 0) == 4
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY
#else
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_WAIT_NOTIFY 0
#endif
#endif

#define BOOST_ATOMIC_HAS_NATIVE_ADDRESS_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_POINTER_WAIT_NOTIFY

#ifndef BOOST_ATOMIC_HAS_NATIVE_POINTER_IPC_WAIT_NOTIFY
#if (BOOST_ATOMIC_DETAIL_SIZEOF_POINTER + 0) == 8
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT64_IPC_WAIT_NOTIFY
#elif (BOOST_ATOMIC_DETAIL_SIZEOF_POINTER + 0) == 4
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT32_IPC_WAIT_NOTIFY
#else
#define BOOST_ATOMIC_HAS_NATIVE_POINTER_IPC_WAIT_NOTIFY 0
#endif
#endif

#define BOOST_ATOMIC_HAS_NATIVE_ADDRESS_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_POINTER_IPC_WAIT_NOTIFY

// We store bools in 1-byte storage in all backends
#ifndef BOOST_ATOMIC_HAS_NATIVE_BOOL_WAIT_NOTIFY
#define BOOST_ATOMIC_HAS_NATIVE_BOOL_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT8_WAIT_NOTIFY
#endif
#ifndef BOOST_ATOMIC_HAS_NATIVE_BOOL_IPC_WAIT_NOTIFY
#define BOOST_ATOMIC_HAS_NATIVE_BOOL_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT8_IPC_WAIT_NOTIFY
#endif

#ifndef BOOST_ATOMIC_HAS_NATIVE_FLAG_WAIT_NOTIFY
#define BOOST_ATOMIC_HAS_NATIVE_FLAG_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT32_WAIT_NOTIFY
#endif
#ifndef BOOST_ATOMIC_HAS_NATIVE_FLAG_IPC_WAIT_NOTIFY
#define BOOST_ATOMIC_HAS_NATIVE_FLAG_IPC_WAIT_NOTIFY BOOST_ATOMIC_HAS_NATIVE_INT32_IPC_WAIT_N


].name)
            views.setViewVisibility(R.id.widgetTimetableTitle, View.VISIBLE)
            // make the subtitle show current date for these lessons
            displayingDate?.let {
                when (Date.diffDays(it, Date.getToday())) {
                    0 -> views.setTextViewText(R.id.widgetTimetableSubtitle, app.getString(R.string.day_today_format, Week.getFullDayName(it.weekDay)))
                    1 -> views.setTextViewText(R.id.widgetTimetableSubtitle, app.getString(R.string.day_tomorrow_format, Week.getFullDayName(it.weekDay)))
                    else -> views.setTextViewText(R.id.widgetTimetableSubtitle, Week.getFullDayName(it.weekDay) + " " + it.formattedString)
                }
            }
        }

        // intent running when the header is clicked
        val headerIntent = Intent(app, MainActivity::class.java)
        headerIntent.action = "android.intent.action.MAIN"
        if (!unified) {
            // per-profile widget should redirect to it + correct day
            profileId?.let {
                headerIntent.putExtra("profileId", it)
            }
            displayingDate?.let {
                headerIntent.putExtra("timetableDate", it.stringY_m_d)
            }
        }
        headerIntent.putExtras("fragmentId" to NavTarget.TIMETABLE)
        val headerPendingIntent = PendingIntent.getActivity(app, appWidgetId, headerIntent, pendingIntentMutable())
        views.setOnClickPendingIntent(R.id.widgetTimetableHeader, headerPendingIntent)

        timetables!!.put(appWidgetId, models)

        // apply the list service to the list view
        val listIntent = Intent(app, WidgetTimetableService::class.java)
        listIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
        listIntent.data = Uri.parse(listIntent.toUri(Intent.URI_INTENT_SCHEME))
        views.setRemoteAdapter(R.id.widgetTimetableListView, listIntent)

        // create an intent used to display the lesson details dialog
        val itemIntent = Intent(app, LessonDialogActivity::class.java)
        itemIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK/* or Intent.FLAG_ACTIVITY_CLEAR_TASK*/)
        val itemPendingIntent = PendingIntent.getActivity(app, appWidgetId, itemIntent, pendingIntentMutable())
        views.setPendingIntentTemplate(R.id.widgetTimetableListView, itemPendingIntent)

        if (!unified)
            views.setScrollPosition(R.id.widgetTimetableListView, scrollPos)
    }

    override fun onDeleted(context: Context, appWidgetIds: IntArray) {
        val app = context.applicationContext as App
        val widgetConfigs = app.config.widgetConfigs
        appWidgetIds.forEach {
            widgetConfigs.remove(it.toString())
        }
        app.config.widgetConfigs = widgetConfigs
    }
}
/*
 * Copyright (c) Kuba Szczodrzyński 2022-10-22.
 */

package pl.szczodrzynski.edziennik.core.manager

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.withContext
import org.greenrobot.eventbus.EventBus
import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.BuildConfig
import pl.szczodrzynski.edziennik.R
import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update
import pl.szczodrzynski.edziennik.data.api.task.PostNotifications
import pl.szczodrzynski.edziennik.data.db.entity.Notification
import pl.szczodrzynski.edziennik.data.enums.NotificationType
import pl.szczodrzynski.edziennik.ext.concat
import pl.szczodrzynski.edziennik.ext.resolveStrin


require.Equal(t, contractID, res3.GetContractInfo().CodeID)
	queriedInitMsg, err := res3.GetContractInfo().InitMsg.MarshalJSON()
	require.NoError(t, err)
	require.Equal(t, initMsgBz, queriedInitMsg)
}
package keeper

import (
	"context"
	"fmt"

	"github.com/classic-terra/core/x/wasm/types"

	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

type msgServer struct {
	Keeper
}

// NewMsgServerImpl returns an implementation of the wasm MsgServer interface
// for the provided Keeper.
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
	return &msgServer{Keeper: keeper}
}

var _ types.MsgServer = msgServer{}

func (k msgServer) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*types.MsgStoreCodeResponse, error) {
	ctx := sdk.UnwrapSDKContext(goCtx)
	senderAddr, err := sdk.AccAddressFromBech32(msg.Sender)
	if err != nil {
		return nil, err
	}

	codeID, err := k.Keeper.StoreCode(ctx, senderAddr, msg.WASMByteCode)
	if err != nil {
		return nil, err
	}

	ctx.EventManager().EmitEvents(
		sdk.Events{
			sdk.NewEvent(
				types.EventTypeStoreCode,
				sdk.NewAttribute(types.AttributeKeySender, msg.Sender),
				sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", codeID)),
			),
			sdk.NewEvent(
				sdk.EventTypeMessage,
				sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
			),
		},
	)

	return &types.MsgStoreCodeResponse{
		CodeID: codeID,
	}, nil
}

func (k msgServer) MigrateCode(goCtx context.Context, msg *types.MsgMigrateCode) (*types.MsgMigrateCodeResponse, error) {
	ctx := sdk.UnwrapSDKContext(goCtx)
	senderAddr, err := sdk.AccAddressFromBech32(msg.Sender)
	if err != nil {
		return nil, err
	}

	err = k.Keeper.MigrateCode(ctx, msg.CodeID, senderAddr, msg.WASMByteCode)
	if err != nil {
		return nil, err
	}

	ctx.EventManager().EmitEvents(
		sdk.Events{
			sdk.NewEvent(
				types.EventTypeMigrateCode,
				sdk.NewAttribute(types.AttributeKeySender, msg.Sender),
				sdk.NewAttribute(types.AttributeKeyCodeID, fmt.Sprintf("%d", msg.CodeID)),
			),
			sdk.NewEvent(
				sdk.EventTypeMessage,
				sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
			),
		},
	)

	return &types.MsgMigrateCodeResponse{}, nil
}

func (k msgServer) InstantiateContract(goCtx context.Context, msg *types.MsgInstantiateContract) (*types.MsgInstantiateContractResponse, error) {
	ctx := sdk.UnwrapSDKContext(goCtx)
	senderAddr, err := sdk.AccAddressFromBech32(msg.Sender)
	if err != nil {
		return nil, err
	}

	adminAddr := sdk.AccAddress{}
	if len(msg.Admin) != 0 {
		adminAddr, err = sdk.AccAddressFromBech32(msg.Admin)
		if err != nil {
			return nil, err
		}
	}

	maxGas := k.MaxContractGas(ctx)
	remain := ctx.GasMeter().Limit() - ctx.GasMeter().GasConsumed()


****************************/
void USBDeviceCfg()
{
    USB_CTRL = 0x00;                                                           //清空USB控制寄存器
    USB_CTRL &= ~bUC_HOST_MODE;                                                //该位为选择设备模式
    USB_CTRL |=  bUC_DEV_PU_EN | bUC_INT_BUSY | bUC_DMA_EN;                    //USB设备和内部上拉使能,在中断期间中断标志未清除前自动返回NAK
    USB_DEV_AD = 0x00;                                                         //设备地址初始化
    //     USB_CTRL |= bUC_LOW_SPEED;
    //     UDEV_CTRL |= bUD_LOW_SPEED;                                                //选择低速1.5M模式
    USB_CTRL &= ~bUC_LOW_SPEED;
    UDEV_CTRL &= ~bUD_LOW_SPEED;                                             //选择全速12M模式，默认方式
    UDEV_CTRL = bUD_PD_DIS;  // 禁止DP/DM下拉电阻
    UDEV_CTRL |= bUD_PORT_EN;                                                  //使能物理端口
}
/*******************************************************************************
* Function Name  : USBDeviceIntCfg()
* Description    : USB设备模式中断初始化
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void USBDeviceIntCfg()
{
    USB_INT_EN |= bUIE_SUSPEND;                                               //使能设备挂起中断
    USB_INT_EN |= bUIE_TRANSFER;                                              //使能USB传输完成中断
    USB_INT_EN |= bUIE_BUS_RST;                                               //使能设备模式USB总线复位中断
    USB_INT_FG |= 0x1F;                                                       //清中断标志
    IE_USB = 1;                                                               //使能USB中断
    EA = 1;                                                                   //允许单片机中断
}
/*******************************************************************************
* Function Name  : USBDeviceEndPointCfg()
* Description    : USB设备模式端点配置，模拟兼容HID设备，除了端点0的控制传输，还包括端点2批量上下传
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void USBDeviceEndPointCfg()
{
    // TODO: Is casting the right thing here? What about endianness?
    UEP1_DMA = (uint16_t) Ep1Buffer;                                                      //端点1 发送数据传输地址
    UEP2_DMA = (uint16_t) Ep2Buffer;                                                      //端点2 IN数据传输地址
    UEP2_3_MOD = 0xCC;                                                         //端点2/3 单缓冲收发使能
    UEP2_CTRL = bUEP_AUTO_TOG | UEP_T_RES_NAK | UEP_R_RES_ACK;                 //端点2自动翻转同步标志位，IN事务返回NAK，OUT返回ACK

    UEP1_CTRL = bUEP_AUTO_TOG | UEP_T_RES_NAK;                                 //端点1自动翻转同步标志位，IN事务返回NAK
    UEP0_DMA = (uint16_t) Ep0Buffer;                                                      //端点0数据传输地址
    UEP4_1_MOD = 0X40;                                                         //端点1上传缓冲区；端点0单64字节收发缓冲区
    UEP0_CTRL = UEP_R_RES_ACK | UEP_T_RES_NAK;                                 //手动翻转，OUT事务返回ACK，IN事务返回NAK
}
/*******************************************************************************
* Function Name  : Config_Uart1(uint8_t *cfg_uart)
* Description    : 配置串口1参数
* Input          : 串口配置参数 四位波特率、停止位、校验、数据位
* Output         : None
* Return         : None
*******************************************************************************/
void Config_Uart1(uint8_t *cfg_uart)
{
    uint32_t uart1_buad = 0;
    *((uint8_t *)&uart1_buad) = cfg_uart[0];
    *((uint8_t *)&uart1_buad+1) = cfg_uart[1];
    *((uint8_t *)&uart1_buad+2) = cfg_uart[2];
    *((uint8_t *)&uart1_buad+3) = cfg_uart[3];
    SBAUD1 = 256 - FREQ_SYS/16/uart1_buad; //  SBAUD1 = 256 - Fsys / 16 / baud rate
    IE_UART1 = 1;
}
/*******************************************************************************
* Function Name  : DeviceInterrupt()
* Description    : CH559USB中断处理函数
*******************************************************************************/
void DeviceInterrupt(void) __interrupt (INT_NO_USB)                       //USB中断服务程序,使用寄存器组1
{
    uint16_t len;
    if(UIF_TRANSFER)                                                            //USB传输完成标志
    {
        switch (USB_INT_ST & (MASK_UIS_TOKEN | MASK_UIS_ENDP))
        {
        case UIS_TOKEN_IN | 1:                                                  //endpoint 1# 端点中断上传
            UEP1_T_LEN = 0;
            UEP1_CTRL = UEP1_CTRL & ~ MASK_UEP_T_RES | UEP_T_RES_NAK;           //默认应答NAK
            break;
        case UIS_TOKEN_IN | 2:


 DaemonSet: %s\n", err.Error())
				return err
			}
			return nil
		}

		backoffStrategy := backoff.NewExponentialBackOff()
		backoffStrategy.InitialInterval = 10 * time.Second
		backoffStrategy.MaxElapsedTime = 3 * time.Minute

		_ = backoff.Retry(operation, backoffStrategy)
	}()

	istioInstallCmd := "PATH=/opt/istio-" + istioVersion + "/bin:$PATH istioctl --kubeconfig /etc/kubernetes/admin.conf install -y -f " + istioFile
	if err := o.sshClient.Command(istioInstallCmd); err != nil {
		return err
	}

	logrus.Info("Istio operator is now ready!")
	return nil
}
/*
 * This file is part of the KubeVirt project
 *
 * 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.
 *
 * Copyright The KubeVirt Authors.
 *
 */
package revision

import (
	"k8s.io/client-go/tools/cache"

	"kubevirt.io/client-go/kubecli"
)

type revisionHandler struct {
	instancetypeStore        cache.Store
	clusterInstancetypeStore cache.Store
	preferenceStore          cache.Store
	clusterPreferenceStore   cache.Store
	virtClient               kubecli.KubevirtClient
}

func New(
	instancetypeStore,
	clusterInstancetypeStore,
	preferenceStore,
	clusterPreferenceStore cache.Store,
	virtClient kubecli.KubevirtClient,
) *revisionHandler {
	return &revisionHandler{
		instancetypeStore:        instancetypeStore,
		clusterInstancetypeStore: clusterInstancetypeStore,
		preferenceStore:          preferenceStore,
		clusterPreferenceStore:   clusterPreferenceStore,
		virtClient:               virtClient,
	}
}
/*
 * This file is part of the KubeVirt project
 *
 * 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.
 *
 * Copyright The KubeVirt Authors.
 *
 */
package apply

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	k8sfield "k8s.io/apimachinery/pkg/util/validation/field"

	virtv1 "kubevirt.io/api/core/v1"
	v1beta1 "kubevirt.io/api/instancetype/v1beta1"

	"kubevirt.io/kubevirt/pkg/instancetype/conflict"
	preferenceApply "kubevirt.io/kubevirt/pkg/instancetype/preference/apply"
)

type preferenceApplier interface {
	Apply(*v1beta1.VirtualMachinePreferenceSpec, *virtv1.VirtualMachineInstanceSpec, *metav1.ObjectMeta)
}

type vmiApplier struct {


  await render(ctx)

  expect(ctx.files[0].contents.toString()).toBe(`
    caz test
  `)
  expect(ctx.files[1].contents.toString()).toBe('bar')
  expect(ctx.files[2].contents).toBe(img)
  expect(ctx.files[3].contents).toBe(zip)
})

test('unit:init:render:metadata', async () => {
  const now = Date.now()

  const ctx = createContext({
    files: [
      { path: 'a.txt', contents: Buffer.from('<%= now %>') }
    ]
  }, {
    metadata: { now }
  })

  await render(ctx)

  expect(ctx.files[0].contents.toString()).toBe(now.toString())
})

test('unit:init:render:helpers', async () => {
  const ctx = createContext({
    files: [
      { path: 'a.txt', contents: Buffer.from('<%= upper(\'caz\') %>') }
    ]
  }, {
    helpers: {
      upper: (i: string) => i.toUpperCase()
    }
  })

  await render(ctx)

  expect(ctx.files[0].contents.toString()).toBe('CAZ')
})
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class UserDetailsService {

  constructor() { }
  userDetails = [];
  facultyName: string;

  setUserDetails(details : any){
    this.userDetails = details;
  }

  getUserDetails(){
    return this.userDetails
  }

  clearUserDetails(){
    this.userDetails.length = 0
  }
  setFacultyName(fName: string) {
    this.facultyName = fName;
    console.log('current user faculty ' + fName);
  }
  getFacultyName() {
    console.log(this.facultyName)
    return this.facultyName;
  }
}
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class ComponentsCartService {

  cart = {};

  constructor() {
    if (window.localStorage && window.localStorage.getItem('cart') !== null) {
      this.cart = JSON.parse(window.localStorage.getItem('cart'));
    }
  }

  createCart(compId: string, initFn = (array) => { }) {
    if (!this.cart[compId]) {
      this.cart[compId] = [];
      this.saveCart();
    }
    initFn(this.cart[compId]);
  }

  getCart(compId: string) {
    if (!this.cart[compId]) {
      this.createCart(compId);
    }
    return this.cart[compId];
  }

  itemInCart(compId: string, item: any, equals: (it1, it2) => boolean) {
    const cart = this.getCart(compId);
    for (const cartItem of cart) {
      if (equals(cartItem, item)) {
        return true;
      }
    }
    return false;
  }

  indexOfItem(compId: string, item: any, equals: (it1, it2) => boolean) {
    const cart = this.getCart(compId);
    for (let i = 0; i < cart.length; i++) {
      if (equals(item, cart[i])) {
        return i;
      }
    }
    return -1;
  }

  addToCart(compId: string, item: any, equals: (it1, it2) => boolean) {
    if (!this.itemInCart(compId, item, equals)) {
      const cart = this.getCart(compId);
      cart.push(item);
      this.saveCart();
    }
  }

  removeFromCart(compId: string, item: any, equals: (it1, it2) => boolean) {
    const idx = this.indexOfItem(compId, item, equals);
    const cart = this.getCart(compId);
    if (idx !== -1) {
      cart.splice(idx, 1);
    }
    this.saveCart();
  }

  saveCart() {
    window.localStorage.setItem('cart', JSON.stringify(this.cart));
  }
}


"""
Fodder for module finalization tests in test_module.
"""

import shutil
import test.final_b

x = 'a'

class C:
    def __del__(self):
        # Inspect module globals and builtins
        print("x =", x)
        print("final_b.x =", test.final_b.x)
        print("shutil.rmtree =", getattr(shutil.rmtree, '__name__', None))
        print("len =", getattr(len, '__name__', None))

c = C()
_underscored = C()


using Newtonsoft.Json.Linq;

namespace PowerApps.Samples.Metadata.Messages
{
    // This class must be instantiated by either:
    // - The Service.SendAsync<T> method
    // - The HttpResponseMessage.As<T> extension in Extensions.cs

    /// <summary>
    /// Contains the response from the CanManyToMany action.
    /// </summary>
    public sealed class CanManyToManyResponse : HttpResponseMessage
    {
        // Cache the async content
        private string? _content;

        //Provides JObject for property getters
        private JObject _jObject
        {
            get
            {


import torch
from mmcv.core.bbox.builder import BBOX_ASSIGNERS
from mmcv.core.bbox.assigners import HungarianAssigner, AssignResult
try:
    from scipy.optimize import linear_sum_assignment
except ImportError:
    linear_sum_assignment = None

@BBOX_ASSIGNERS.register_module()
class LaneHungarianAssigner(HungarianAssigner):

    def assign(self,
               lane_pred,
               cls_pred,
               gt_lanes,
               gt_labels,
               img_meta,
               gt_lanes_ignore=None,
               eps=1e-7):
        assert gt_lanes_ignore is None, \
            'Only case when gt_lanes_ignore is None is supported.'
        num_gts, num_lanes = gt_lanes.size(0), lane_pred.size(0)

        # 1. assign -1 by default
        assigned_gt_inds = lane_pred.new_full((num_lanes, ),
                                              -1,
                                              dtype=torch.long)
        assigned_labels = lane_pred.new_full((num_lanes, ),
                                             -1,
                                             dtype=torch.long)
        if num_gts == 0 or num_lanes == 0:
            # No ground truth or boxes, return empty assignment
            if num_gts == 0:
                # No ground truth, assign all to background
                assigned_gt_inds[:] = 0
            return AssignResult(
                num_gts, assigned_gt_inds, None, labels=assigned_labels)

        # 2. compute the weighted costs
        # classification and lanecost.
        cls_cost = self.cls_cost(cls_pred, gt_labels)
        # regression L1 cost
        reg_cost = self.reg_cost(lane_pred, gt_lanes)
        # weighted sum of above three costs
        cost = cls_cost + reg_cost

        # 3. do Hungarian matching on CPU using linear_sum_assignment
        cost = torch.nan_to_num(cost)
        cost = cost.detach().cpu()
        matched_row_inds, matched_col_inds = linear_sum_assignment(cost)
        matched_row_inds = torch.from_numpy(matched_row_inds).to(
            lane_pred.device)
        matched_col_inds = torch.from_numpy(matched_col_inds).to(
            lane_pred.device)

        # 4. assign backgrounds and foregrounds
        # assign all indices to backgrounds first
        assigned_gt_inds[:] = 0
        # assign foregrounds based on matching results
        assigned_gt_inds[matched_row_inds] = matched_col_inds + 1
        assigned_labels[matched_row_inds] = gt_labels[matched_col_inds]
        return AssignResult(
            num_gts, assigned_gt_inds, None, labels=assigned_labels)


during/2)
				.to({scaleX:1 + amplitude, scaleY:1 + amplitude}, during/2)
				.call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools._shrink(obj, amplitude, during);
			});
		}

		private static _rotate(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({rotation:obj.rotation + 360}, during).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools._rotate(obj, during);
			});
		}

		private static _doop(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({scaleY:0.8,y:obj.y + 10}, during/4)
			   .to({y:obj.y - 30}, during/2)
			   .to({scaleY:1, y:obj.y}, during/4).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools._doop(obj, during);
			});
		}

		private static _rotateFan(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({rotation:obj.rotation - 360}, during).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools._rotateFan(obj, during);
			});
		}

		private static outAndIn(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({alpha:0}, during/2).to({alpha:1}, during/2).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools.outAndIn(obj, during);
			});
		}
		private static outAndInHalf(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({alpha:0.5}, during/2).to({alpha:1}, during/2).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools.outAndInHalf(obj, during);
			});
		}

		private static outAndInMoreHalf(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({alpha:0.5}, during/2).to({alpha:1}, during/2).wait(1000).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools.outAndInHalf(obj, during);
			});
		}

		private static outAndInAndScale(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({alpha:0, scaleX: 1.2, scaleY: 1.2}, during).call(function():void {
				obj.alpha = 1;
				obj.scaleX = 1;
				obj.scaleY = 1;
				egret.Tween.removeTweens(obj);
				TweenTools.outAndInAndScale(obj, during);
			});
		}

		private static outAndInAndRotation(obj:egret.DisplayObject, during:number):void {
			let tw = egret.Tween.get(obj, {loop:false});
			tw.to({alpha:0, rotation:obj.rotation + 180}, during/2).to({alpha:1, rotation:obj.rotation + 360}, during/2).call(function():void {
				egret.Tween.removeTweens(obj);
				TweenTools


predicatedTerminator(--I)) {
    if (LastInst->getOpcode() == NVPTX::GOTO) {
      TBB = LastInst->getOperand(0).getMBB();
      return false;
    } else if (LastInst->getOpcode() == NVPTX::CBranch) {
      // Block ends with fall-through condbranch.
      TBB = LastInst->getOperand(1).getMBB();
      Cond.push_back(LastInst->getOperand(0));
      return false;
    }
    // Otherwise, don't know what this is.
    return true;
  }

  // Get the instruction before it if it's a terminator.
  MachineInstr *SecondLastInst = I;

  // If there are three terminators, we don't know what sort of block this is.
  if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(--I))
    return true;

  // If the block ends with NVPTX::GOTO and NVPTX:CBranch, handle it.
  if (SecondLastInst->getOpcode() == NVPTX::CBranch &&
      LastInst->getOpcode() == NVPTX::GOTO) {
    TBB = SecondLastInst->getOperand(1).getMBB();
    Cond.push_back(SecondLastInst->getOperand(0));
    FBB = LastInst->getOperand(0).getMBB();
    return false;
  }

  // If the block ends with two NVPTX:GOTOs, handle it.  The second one is not
  // executed, so remove it.
  if (SecondLastInst->getOpcode() == NVPTX::GOTO &&
      LastInst->getOpcode() == NVPTX::GOTO) {
    TBB = SecondLastInst->getOperand(0).getMBB();
    I = LastInst;
    if (AllowModify)
      I->eraseFromParent();
    return false;
  }

  // Otherwise, can't handle this.
  return true;
}

unsigned NVPTXInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
  MachineBasicBlock::iterator I = MBB.end();
  if (I == MBB.begin())
    return 0;
  --I;
  if (I->getOpcode() != NVPTX::GOTO && I->getOpcode() != NVPTX::CBranch)
    return 0;

  // Remove the branch.
  I->eraseFromParent();

  I = MBB.end();

  if (I == MBB.begin())
    return 1;
  --I;
  if (I->getOpcode() != NVPTX::CBranch)
    return 1;

  // Remove the branch.
  I->eraseFromParent();
  return 2;
}

unsigned NVPTXInstrInfo::InsertBranch(
    MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB,
    const SmallVectorImpl<MachineOperand> &Cond, DebugLoc DL) const {
  // Shouldn't be a fall through.
  assert(TBB && "InsertBranch must not be told to insert a fallthrough");
  assert((Cond.size() == 1 || Cond.size() == 0) &&
         "NVPTX branch conditions have two components!");

  // One-way branch.
  if (!FBB) {
    if (Cond.empty()) // Unconditional branch
      BuildMI(&MBB, DL, get(NVPTX::GOTO)).addMBB(TBB);
    else // Conditional branch
      BuildMI(&MBB, DL, get(NVPTX::CBranch)).addReg(Cond[0].getReg())
          .addMBB(TBB);
    return 1;
  }

  // Two-way Conditional Branch.
  BuildMI(&MBB, DL, get(NVPTX::CBranch)).addReg(Cond[0].getReg()).addMBB(TBB);
  BuildMI(&MBB, DL, get(NVPTX::GOTO)).addMBB(FBB);
  return 2;
}
//==-- AArch64ExpandPseudoInsts.cpp - Expand pseudo instructions --*- C++ -*-=//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains a pass that expan


/**
 * Marlin 3D Printer Firmware
 * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */
#pragma once

/**
 * Assign custom or standard U8G device drivers
 */

#include <U8glib-HAL.h>

#include HAL_PATH(../.., u8g/LCD_defines.h)

#if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT
  uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
  #define U8G_COM_HAL_TFT_FN u8g_com_hal_tft_fn
#endif

// U8G_HAL_LINKS is defined for LPC1768/9 and Native envs by -DU8G_HAL_LINKS in platform.ini
#ifndef U8G_COM_HAL_SW_SPI_FN
  #define U8G_COM_HAL_SW_SPI_FN     TERN(U8G_HAL_LINKS, u8g_com_null_fn, u8g_com_arduino_std_sw_spi_fn)
#endif
#ifndef U8G_COM_HAL_HW_SPI_FN
  #define U8G_COM_HAL_HW_SPI_FN     TERN(U8G_HAL_LINKS, u8g_com_null_fn, u8g_com_arduino_hw_spi_fn)
#endif
#ifndef U8G_COM_ST7920_HAL_SW_SPI
  #define U8G_COM_ST7920_HAL_SW_SPI TERN(U8G_HAL_LINKS, u8g_com_null_fn, u8g_com_arduino_st7920_spi_fn)
#endif
#ifndef U8G_COM_ST7920_HAL_HW_SPI
  #define U8G_COM_ST7920_HAL_HW_SPI TERN(U8G_HAL_LINKS, u8g_com_null_fn, u8g_com_arduino_st7920_hw_spi_fn)
#endif
#ifndef U8G_COM_SSD_I2C_HAL
  #define U8G_COM_SSD_I2C_HAL       TERN(U8G_HAL_LINKS, u8g_com_null_fn, u8g_com_arduino_ssd_i2c_fn)
#endif
#ifndef U8G_COM_HAL_TFT_FN
  #define U8G_COM_HAL_TFT_FN        u8g_com_null_fn
#endif


2b

3:
        movrel          x5,  X(inv_dct_8h_x16_neon)
.irp i, 0, 8, 16, 24, 32, 40, 48, 56
        add             x6,  x0,  #(\i*2)
        add             x7,  x4,  #(\i*2)
        mov             x8,  #64*2
        bl              inv_txfm_add_vert_8x16_neon
.endr

        add             sp,  x4,  #64*16*2
        ret             x15
endfunc

function inv_txfm_add_dct_dct_16x64_16bpc_neon, export=1
        idct_dc         16,  64,  2

        mov             x15, x30

        sub_sp          16*32*2+64*8*2
        add             x5,  sp, #64*8*2

        movrel          x13, eob_16x32
        ldrh            w12, [x13], #2

        adr             x4,  inv_dct_4s_x16_neon
.irp i, 0, 4, 8, 12, 16, 20, 24, 28
        add             x6,  x5,  #(\i*16*2)
.if \i > 0
        mov             w8,  #(32 - \i)
        cmp             w3,  w12


 0 ].name.slice( 0, 6 ) !== '.bones' ) return;

					objects.looped = true;

				} );

			}

			objects.ikSolver = this._createCCDIKSolver( mesh );
			objects.grantSolver = this.createGrantSolver( mesh );

			return this;

		},

		_setupCameraAnimation: function ( camera, animation ) {

			var animations = Array.isArray( animation )
				? animation : [ animation ];

			var objects = this.objects.get( camera );

			objects.mixer = new THREE.AnimationMixer( camera );

			for ( var i = 0, il = animations.length; i < il; i ++ ) {

				objects.mixer.clipAction( animations[ i ] ).play();

			}

		},

		_setupMeshPhysics: function ( mesh, params ) {

			var objects = this.objects.get( mesh );

			// shared physics is experimental

			if ( params.world === undefined && this.sharedPhysics ) {

				var masterPhysics = this._getMasterPhysics();

				if ( masterPhysics !== null ) world = masterPhysics.world; // eslint-disable-line no-undef

			}

			objects.physics = this._createMMDPhysics( mesh, params );

			if ( objects.mixer && params.animationWarmup !== false ) {

				this._animateMesh( mesh, 0 );
				objects.physics.reset();

			}

			objects.physics.warmup( params.warmup !== undefined ? params.warmup : 60 );

			this._optimizeIK( mesh, true );

		},

		_animateMesh: function ( mesh, delta ) {

			var objects = this.objects.get( mesh );

			var mixer = objects.mixer;
			var ikSolver = objects.ikSolver;
			var grantSolver = objects.grantSolver;
			var physics = objects.physics;
			var looped = objects.looped;

			// alternate solution to save/restore bones but less performant?
			//mesh.pose();
			//this._updatePropertyMixersBuffer( mesh );

			if ( mixer && this.enabled.animation ) {

				this._restoreBones( mesh );

				mixer.update( delta );

				this._saveBones( mesh );

				if ( ikSolver && this.enabled.ik ) {

					mesh.updateMatrixWorld( true );
					ikSolver.update();

				}

				if ( grantSolver && this.enabled.grant ) {

					grantSolver.update();

				}

			}

			if ( looped === true && this.enabled.physics ) {

				if ( physics && this.configuration.resetPhysicsOnLoop ) physics.reset();

				objects.looped = false;

			}

			if ( physics && this.enabled.physics && ! this.sharedPhysics ) {

				this.onBeforePhysics( mesh );
				physics.update( delta );

			}

		},

		_animateCamera: function ( camera, delta ) {

			var mixer = this.objects.get( camera ).mixer;

			if ( mixer && this.enabled.cameraAnimation ) {

				mixer.update( delta );

				camera.updateProjectionMatrix();

				camera.up.set( 0, 1, 0 );
				camera.up.applyQuaternion( camera.quaternion );
				camera.lookAt( this.cameraTarget.position );

			}

		},

		_optimizeIK: function ( mesh, physicsEnabled ) {

			var iks = mesh.geometry.userData.MMD.iks;
			var bones = mesh.geometry.userData.MMD.bones;

			for ( var i = 0, il = iks.length; i < il; i ++ ) {

				var ik = iks[ i ];
				var links = ik.links;

				for ( var j = 0, jl = links.length; j < jl; j ++ ) {

					var link = links[ j ];

					if ( physicsEnabled === true ) {

						// disable IK of the bone the corresponding rigidBody type of which is 1 or 2
						// because its rotation will be overriden by physics
						link.enabled = bones[ link.index ].rigid


(SI)(AX*8), X0 // X0 = t[i:i+1]
	MOVUPS (DI)(AX*8), X1 // X1 = s[i:i+1]
	MOVAPS X0, X2
	SUBPD  X1, X0
	SUBPD  X2, X1
	MAXPD  X1, X0         // X0 = max( X0 - X1, X1 - X0 )
	ADDPD  X0, X3         // norm += X0
	ADDQ   $2, AX         // i += 2
	LOOP   l1_loop        // } while --CX > 0
	CMPQ   BX, $0         // if BX == 0 { return }
	JE     l1_end

l1_tail_start: // Reset loop registers
	MOVQ BX, CX // Loop counter: CX = BX
	PXOR X0, X0 // reset X0, X1 to break dependencies
	PXOR X1, X1

l1_tail:
	MOVSD  (SI)(AX*8), X0 // X0 = t[i]
	MOVSD  (DI)(AX*8), X1 // x1 = s[i]
	MOVAPD X0, X2
	SUBSD  X1, X0
	SUBSD  X2, X1
	MAXSD  X1, X0         // X0 = max( X0 - X1, X1 - X0 )
	ADDSD  X0, X3         // norm += X0

l1_end:
	MOVAPS X3, X2
	SHUFPD $1, X2, X2
	ADDSD  X3, X2         // X2 = X3[1] + X3[0]
	MOVSD  X2, ret+48(FP) // return X2
	RET


 mech {
	case "negotiate":
		credential.AuthMechanism = ""
	default:
		credential.AuthMechanism = mech
	}
	return runScramAuthTest(t, credential)
}

func runScramAuthTest(t *testing.T, credential options.Credential) error {
	t.Helper()
	topology := integtest.TopologyWithCredential(t, credential)
	server, err := topology.SelectServer(context.Background(), &serverselector.Write{})
	noerr(t, err)

	cmd := bsoncore.BuildDocument(nil, bsoncore.AppendInt32Element(nil, "dbstats", 1))
	return runCommand(server, integtest.DBName(t), cmd)
}

func createScramUsers(t *testing.T, s driver.Server, cases []scramTestCase) error {
	db := integtest.DBName(t)
	for _, c := range cases {
		var values []bsoncore.Value
		for _, v := range c.mechanisms {
			values = append(values, bsoncore.Value{Type: bsoncore.TypeString, Data: bsoncore.AppendString(nil, v)})
		}
		newUserCmd := bsoncore.BuildDocumentFromElements(nil,
			bsoncore.AppendStringElement(nil, "createUser", c.username),
			bsoncore.AppendStringElement(nil, "pwd", c.password),
			bsoncore.AppendArrayElement(nil, "roles", bsoncore.BuildArray(nil,
				bsoncore.Value{Type: bsoncore.TypeEmbeddedDocument, Data: bsoncore.BuildDocumentFromElements(nil,
					bsoncore.AppendStringElement(nil, "role", "readWrite"),
					bsoncore.AppendStringElement(nil, "db", db),
				)},
			)),
			bsoncore.AppendArrayElement(nil, "mechanisms", bsoncore.BuildArray(nil, values...)),
		)
		err := runCommand(s, db, newUserCmd)
		if err != nil {
			return fmt.Errorf("Couldn't create user '%s' on db '%s': %w", c.username, integtest.DBName(t), err)
		}
	}
	return nil
}
// Copyright (C) MongoDB, Inc. 2023-present.
//
// 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

package mnet

import (
	"context"
	"io"

	"go.mongodb.org/mongo-driver/v2/mongo/address"
	"go.mongodb.org/mongo-driver/v2/x/mongo/driver/description"
)

// ReadWriteCloser represents a Connection where server operations
// can read from, written to, and closed.
type ReadWriteCloser interface {
	Read(ctx context.Context) ([]byte, error)
	Write(ctx context.Context, wm []byte) error
	io.Closer
}

// Describer represents a Connection that can be described.
type Describer interface {
	Description() description.Server
	ID() string
	ServerConnectionID() *int64
	DriverConnectionID() int64
	Address() address.Address
	Stale() bool
	OIDCTokenGenID() uint64
	SetOIDCTokenGenID(uint64)
}

// Streamer represents a Connection that supports streaming wire protocol
// messages using the moreToCome and exhaustAllowed flags.
//
// The SetStreaming and CurrentlyStreaming functions correspond to the
// moreToCome flag on server responses. If a response has moreToCome set,
// SetStreaming(true) will be called and CurrentlyStreaming() should return
// true.
//
// CanStream corresponds to the exhaustAllowed flag. The operations layer will
// set exhaustAllowed on outgoing wire messages to inform the server that the
// driver supports streaming.
type Streamer interface {
	SetStreaming(bool)
	CurrentlyStreaming() bool
	SupportsStreaming() bool
}

// Compresso


/O error.
///
/// New since 1.3.0.
pub fn signed_encode(value: i64, writer: &mut dyn Writer) -> Result<()> {
    encode(encode_sign(value), writer)
}

/// Decodes a signed **ILInt** value.
///
/// Arguments:
/// * `reader`: The reader that contains the encoded
/// value;
///
/// Returns:
/// * `Ok(i64)`: On success, returns the value read.
/// * `Err(ErrorKind)`: In case of error.
///
/// New since 1.3.0.
pub fn signed_decode(reader: &mut dyn Reader) -> Result<i64> {
    let tmp = decode(reader)?;
    Ok(decode_sign(tmp))
}
<gh_stars>1-10
use crate::commands::CommandData;
use futures::{channel::mpsc::SendError, Sink, SinkExt};
use tracing::instrument;

pub struct Capability;

impl Capability {
    #[instrument(skip(self, lines, command_data))]
    pub async fn exec<S>(
        &self,
        lines: &mut S,
        command_data: &CommandData<'_>,
    ) -> color_eyre::eyre::Result<()>
    where
        S: Sink<String, Error = SendError> + std::marker::Unpin + std::marker::Send,
    {
        let capabilities = get_capabilities();
        lines.feed(format!("* {}", capabilities)).await?;
        lines
            .feed(format!("{} OK CAPABILITY completed", command_data.tag))
            .await?;
        lines.flush().await?;
        Ok(())
    }
}

pub const fn get_capabilities() -> &'static str {
    "CAPABILITY AUTH=PLAIN LOGINDISABLED UTF8=ONLY ENABLE IMAP4rev2 IMAP4rev1"
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::commands::{CommandData, Commands};
    use futures::{channel::mpsc, StreamExt};

    #[tokio::test]
    async fn test_get_capabilities() {
        let caps = Capability {};
        let cmd_data = CommandData {
            tag: "",
            command: Commands::Capability,
            arguments: &[],
        };
        let (mut tx, mut rx) = mpsc::unbounded();
        let res = caps.exec(&mut tx, &cmd_data).await;
        assert!(res.is_ok());
        assert_eq!(
            rx.next().await,
            Some(String::from(
                "* CAPABILITY AUTH=PLAIN LOGINDISABLED UTF8=ONLY ENABLE IMAP4rev2 IMAP4rev1"
            ))
        );
    }
}
<reponame>nappa85/serde_fix

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct OrdTypeRules {
	/// Number of order types
	#[serde(skip_serializing_if = "Option::is_none")]
	#[serde(rename = "1237")]
	pub ord_type_rules: Option<fix_common::RepeatingValues<OrdTypeRule>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct OrdTypeRule {
	/// Indicates order types that are valid for the specified market segment.
	#[serde(skip_serializing_if = "Option::is_none")]
	#[serde(rename = "40")]
	pub ord_type: Option<OrdType>,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
pub enum OrdType {
	/// Market
	#[serde(rename = "1")]
	Market,
	/// Limit
	#[serde(rename = "2")]
	Limit,
	/// Stop / Stop Loss
	#[serde(rename = "3")]
	StopStopLoss,
	/// Stop Limit
	#[serde(rename


		{
				cycles += 1;
			}

			// Check the values of the operation
			Assert.AreEqual(DataType.Number, result.Type);
			Assert.AreEqual(34, result.Number);

			// Check the autoyield actually triggered
			Assert.IsTrue(cycles > 10);
		}

	}
}


tDialog.validatorEmptyLink': return 'リンクを入力してください';
			case 'linkInputDialog.validatorNoIwaraLink': return ({required Object webName}) => '有効な${webName}リンクが検出されませんでした';
			case 'linkInputDialog.multipleLinksDetected': return '複数のリンクが検出されました。1つ選択してください：';
			case 'linkInputDialog.notIwaraLink': return ({required Object webName}) => '有効な${webName}リンクではありません';
			case 'linkInputDialog.linkParseError': return ({required Object error}) => 'リンク解析エラー: ${error}';
			case 'linkInputDialog.unsupportedLinkDialogTitle': return 'サポートされていないリンク';
			case 'linkInputDialog.unsupportedLinkDialogContent': return 'このリンクタイプは現在アプリ内で直接開くことができず、外部ブラウザを使用してアクセスする必要があります。\n\nブラウザでこのリンクを開きますか？';
			case 'linkInputDialog.openInBrowser': return 'ブラウザで開く';
			case 'linkInputDialog.confirmOpenBrowserDialogTitle': return 'ブラウザを開くことを確認';
			case 'linkInputDialog.confirmOpenBrowserDialogContent': return '次のリンクを外部ブラウザで開こうとしています：';
			case 'linkInputDialog.confirmContinueBrowserOpen': return '続行してもよろしいですか？';
			case 'linkInputDialog.browserOpenFailed': return 'リンクを開けませんでした';
			case 'linkInputDialog.unsupportedLink': return 'サポートされていないリンク';
			case 'linkInputDialog.cancel': return 'キャンセル';
			case 'linkInputDialog.confirm': return 'ブラウザで開く';
			case 'log.logManagement': return 'ログ管理';
			case 'log.enableLogPersistence': return 'ログ保存を有効にする';
			case 'log.enableLogPersistenceDesc': return 'ログをデータベースに保存して分析に使用';
			case 'log.logDatabaseSizeLimit': return 'ログデータベースサイズ上限';
			case 'log.logDatabaseSizeLimitDesc': return ({required Object size}) => '現在: ${size}';
			case 'log.exportCurrentLogs': return '現在のログをエクスポート';
			case 'log.exportCurrentLogsDesc': return '現在のアプリケーションログを開発者が診断に使用できるようにエクスポート';
			case 'log.exportHistoryLogs': return '履歴ログをエクスポート';
			case 'log.exportHistoryLogsDesc': return '指定された日付範囲内のログをエクスポート';
			case 'log.exportMergedLogs': return 'マージログをエクスポート';
			case 'log.exportMergedLogsDesc': return '指定された日付範囲内のマージログをエクスポート';
			case 'log.showLogStats': return 'ログ統計情報を表示';
			case 'log.logExportSuccess': return 'ログエクスポート成功';
			case 'log.logExportFailed': return ({required Object error}) => 'ログエクスポート失敗: ${error}';
			case 'log.showLogStatsDesc': return '様々なタイプのログの統計情報を表示';
			case 'log.logExtractFailed': return ({required Object error}) => 'ログ統計情報の取得に失�


ceFrame;
import us.ihmc.euclid.tools.EuclidCoreRandomTools;
import us.ihmc.euclid.tuple3D.Vector3D;
import us.ihmc.matrixlib.MatrixTestTools;
import us.ihmc.matrixlib.MatrixTools;
import us.ihmc.mecano.algorithms.CentroidalMomentumCalculator;
import us.ihmc.mecano.algorithms.CentroidalMomentumRateCalculator;
import us.ihmc.mecano.frames.CenterOfMassReferenceFrame;
import us.ihmc.mecano.multiBodySystem.RevoluteJoint;
import us.ihmc.mecano.multiBodySystem.RigidBody;
import us.ihmc.mecano.multiBodySystem.interfaces.JointBasics;
import us.ihmc.mecano.multiBodySystem.interfaces.RigidBodyBasics;
import us.ihmc.mecano.tools.JointStateType;
import us.ihmc.mecano.tools.MultiBodySystemRandomTools;
import us.ihmc.mecano.tools.MultiBodySystemRandomTools.RandomFloatingRevoluteJointChain;
import us.ihmc.mecano.tools.MultiBodySystemTools;
import us.ihmc.simulationConstructionSetTools.tools.RobotTools.SCSRobotFromInverseDynamicsRobotModel;
import us.ihmc.simulationconstructionset.UnreasonableAccelerationException;

public class CentroidalMomentumRateTermCalculatorSCSTest
{
   private static final double EPSILON = 1.0e-5;

   private static final ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame();

   private static final int NUMBER_OF_ITERATIONS = 10;

   private final double controlDT = 1.0e-8;

   private final DMatrixRMaj a = new DMatrixRMaj(0, 0);
   private final DMatrixRMaj aPrevVal = new DMatrixRMaj(0, 0);
   private final DMatrixRMaj aDot = new DMatrixRMaj(0, 0);
   private final DMatrixRMaj aTermCalculator = new DMatrixRMaj(0,0);

   private final DMatrixRMaj aDotVNumerical = new DMatrixRMaj(6, 1);
   private final DMatrixRMaj aDotVAnalytical = new DMatrixRMaj(6, 1);

	@Test
   public void chainTest() throws UnreasonableAccelerationException
   {
      Random random = new Random(12651L);

      ArrayList<RevoluteJoint> joints = new ArrayList<>();
      RigidBodyBasics elevator = new RigidBody("elevator", worldFrame);
      int numberOfJoints = 10;
      Vector3D[] jointAxes = new Vector3D[numberOfJoints];
      for (int i = 0; i < numberOfJoints; i++)
         jointAxes[i] = EuclidCoreRandomTools.nextVector3DWithFixedLength(random, 1.0);

      joints.addAll(MultiBodySystemRandomTools.nextRevoluteJointChain(random, "blop", elevator, jointAxes));
      SCSRobotFromInverseDynamicsRobotModel robot = new SCSRobotFromInverseDynamicsRobotModel("robot", elevator.getChildrenJoints().get(0));

      assertAAndADotV(random, joints, elevator, robot,numberOfJoints);
   }

	@Test
   public void treeTest() throws UnreasonableAccelerationException
   {
      Random random = new Random(12651L);

      ArrayList<RevoluteJoint> joints = new ArrayList<>();
      RigidBodyBasics elevator = new RigidBody("elevator", worldFrame);
      RevoluteJoint rootJoint = MultiBodySystemRandomTools.nextRevoluteJoint(random, "rootJoint", elevator); // Just to make sure there is only one root joint for the SCS robot
      RigidBodyBasics rootBody = MultiBodySystemRandomTools.nextRigidBody(random, "rootBody", rootJoint);

      int numberOfJoints = 10;
      joints.addAll(MultiBodySystemRandomTools.nextRevoluteJointTree(random, rootBody, numberOfJoints - 1));
      joints.add(0, rootJoint);
      SCSRobotFromInverseDynamicsRobotModel robot = new SCSRobotFromInverseDynamicsRobotModel("robot


 using var ms = new MemoryStream();
            var serializer = KVSerializer.Create(KVSerializationFormat.KeyValues1Text);

            serializer.Serialize(ms, obj);
            ms.Seek(0, SeekOrigin.Begin);

            Assert.That(
                () => serializer.Deserialize<SerializedType>(ms),
                Throws.InstanceOf<NotSupportedException>()
                .With.Message.EqualTo("Converting to DateTime is not supported. (key = Value, type = String)"));
        }

        class SerializedType
        {
            public DateTime Value { get; set; }
        }
    }
}


.normal pre,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code {
  /*

Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>

*/
  /* Solarized Green */
  /* Solarized Cyan */
  /* Solarized Blue */
  /* Solarized Yellow */
  /* Solarized Orange */
  /* Solarized Red */
  /* Solarized Violet */
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs {
  display: block;
  padding: 0.5em;
  background: #fdf6e3;
  color: #657b83;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc {
  color: #93a1a1;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request,
.book.color


B8000
glabel D_80A4FED8
 .word 0x3DCCCCCD
glabel D_80A4FEDC
 .word 0x3A83126F
glabel D_80A4FEE0
 .word 0x3A83126F
glabel D_80A4FEE4
 .word 0x43360B61
glabel D_80A4FEE8
 .word 0x43360B61
glabel D_80A4FEEC
 .word 0xBE99999A
glabel D_80A4FEF0
 .word 0x3A83126F
glabel D_80A4FEF4
 .word 0x3A83126F
glabel D_80A4FEF8
 .word 0x3F32B8C2
glabel D_80A4FEFC
 .word 0x3EB2B8C2
glabel D_80A4FF00
 .word 0x45638000
glabel D_80A4FF04
 .word 0x3A83126F
glabel D_80A4FF08
 .word 0x3A83126F
glabel D_80A4FF0C
 .word 0x3A83126F
glabel D_80A4FF10
 .word 0x3A83126F
glabel D_80A4FF14
 .word 0x3DCCCCCD
glabel D_80A4FF18
 .word 0x3C8EFA35
glabel D_80A4FF1C
 .word 0x3DCCCCCD
glabel D_80A4FF20
 .word 0x3C8EFA35
glabel jtbl_80A4FF24
.word L80A4F8F8
.word L80A4F8D4
.word L80A4F8B0
.word L80A4F88C
.word L80A4F868
glabel D_80A4FF38
 .word 0x38C90FDB
glabel D_80A4FF3C
 .word 0x38C90FDB
glabel D_80A4FF40
 .word 0x38C90FDB
glabel D_80A4FF44
 .word 0x38C90FDB
glabel D_80A4FF48
 .word 0x38C90FDB
glabel D_80A4FF4C
 .word 0x38C90FDB
glabel D_80A4FF50
 .word 0x3D4CCCCD
glabel D_80A4FF54
 .word 0xBD4CCCCD, 0x00000000, 0x00000000