;

    let revoc_config = json!({"max_cred_num": max_creds, "issuance_type": REVOCATION_REGISTRY_TYPE}).to_string();

    anoncreds::issuer_create_and_store_revoc_reg(get_wallet_handle(), issuer_did, None, tag, cred_def_id, &revoc_config, writer)
        .await
        .map_err(VcxError::from)
}

pub async fn libindy_create_and_store_credential_def(issuer_did: &str,
                                               schema_json: &str,
                                               tag: &str,
                                               sig_type: Option<&str>,
                                               config_json: &str) -> VcxResult<(String, String)> {
    anoncreds::issuer_create_and_store_credential_def(get_wallet_handle(),
                                                      issuer_did,
                                                      schema_json,
                                                      tag,
                                                      sig_type,
                                                      config_json)
        .await
        .map_err(VcxError::from)
}

pub async fn libindy_issuer_create_credential_offer(cred_def_id: &str) -> VcxResult<String> {
    if settings::indy_mocks_enabled() {
        let rc = LibindyMock::get_result();
        if rc != 0 { return Err(VcxError::from(VcxErrorKind::InvalidState)); };
        return Ok(LIBINDY_CRED_OFFER.to_string());
    }
    anoncreds::issuer_create_credential_offer(get_wallet_handle(),
                                              cred_def_id)
        .await
        .map_err(VcxError::from)
}

async fn blob_storage_open_reader(base_dir: &str) -> VcxResult<i32> {
    let tails_config = json!({"base_dir": base_dir,"uri_pattern": ""}).to_string();
    blob_storage::open_reader("default", &tails_config)
        .await
        .map_err(VcxError::from)
}

pub async fn libindy_issuer_create_credential(cred_offer_json: &str,
                                        cred_req_json: &str,
                                        cred_values_json: &str,
                                        rev_reg_id: Option<String>,
                                        tails_file: Option<String>) -> VcxResult<(String, Option<String>, Option<String>)> {
    if settings::indy_mocks_enabled() { return Ok((utils::constants::CREDENTIAL_JSON.to_owned(), None, None)); }

    let revocation = rev_reg_id.as_ref().map(String::as_str);

    let blob_handle = match tails_file {
        Some(x) => blob_storage_open_reader(&x).await?,
        None => -1,
    };
    anoncreds::issuer_create_credential(get_wallet_handle(),
                                        cred_offer_json,
                                        cred_req_json,
                                        cred_values_json,
                                        revocation,
                                        blob_handle)
        .await
        .map_err(VcxError::from)
}

pub async fn libindy_prover_create_proof(proof_req_json: &str,
                                   requested_credentials_json: &str,
                                   master_secret_id: &str,
                                   schemas_json: &str,
                                   credential_defs_json: &str,
                                   revoc_states_json: Option<&str>) -> VcxResult<String> {


}
				else
				{
					pSCRAMBLE_TEAM = GetTeam(SCRAMBLE_TEAM_DEFENCE);
					if( pSCRAMBLE_TEAM && guildID == pSCRAMBLE_TEAM->guildID )
					{
						pSCRAMBLE_SEAL_INFO->eState = TOBJECT_STATE_TYPE_C_DEFENCE_TEAM;
					}
				}

				CNtlSLEventGenerator::DojoEventNotify(DOJO_EVENT_SCRAMBLE_CHANGE_SEAL_OWNER, pEvent->uiParam, pEvent->pExData, pEvent->pExData2, pEvent->pExData3);
				break;
			}
		default:
			{
				CNtlSLEventGenerator::DojoEventNotify(pEvent->byDojoEvent, pEvent->uiParam, pEvent->pExData, pEvent->pExData2, pEvent->pExData3);
				break;
			}
		}
	}
	else if( msg.Id == g_EventDojoState )
	{
		SNtlEventDojoMessage* pEvent = reinterpret_cast<SNtlEventDojoMessage*>( msg.pData );

		RwBool bClearScrambleInfo = FALSE;

		if( m_ScrambleInfo.uiScrambleDojoTableIndex == pEvent->uiDojoTableIndex )
		{
			if( eDBO_DOJO_STATUS_NORMAL != m_ScrambleInfo.eDojoState )
			{
				if( eDBO_DOJO_STATUS_NORMAL == (eDBO_DOJO_STATUS)pEvent->byDojoState )
					bClearScrambleInfo = TRUE;
			}

			m_ScrambleInfo.eDojoState	= (eDBO_DOJO_STATUS)pEvent->byDojoState;
			m_ScrambleInfo.fLeftTime	= (RwReal)(pEvent->ui64time - GetNtlSLGlobal()->GetServerTime());
		}

		CNtlSLEventGenerator::DojoStateNotify(pEvent->uiDojoTableIndex, pEvent->byDojoState, pEvent->ui64time);

		if( bClearScrambleInfo )
		{
			ClearScrambleInfo();

			// Ż ̰ܼ Ż  忡 ִ Ŀ ؼ
			if( GetNtlWorldConcept()->IsActivePlayConcept(WORLD_PLAY_DOJO_SCRAMBLE) )
				GetNtlWorldConcept()->DeleteGradeWorldPlayConcept(WORLD_CONCEPT_FIRST_GRADE);
		}
	}
	else if( msg.Id == g_EventScrambleDefaultInfo )
	{
		SNtlEventScrambleDefaultInfo* pEvent = reinterpret_cast<SNtlEventScrambleDefaultInfo*>( msg.pData );

		if( m_pScrambleTeam[SCRAMBLE_TEAM_OFFENCE] || m_pScrambleTeam[SCRAMBLE_TEAM_DEFENCE] )
		{
			DBO_FAIL("Already exist scramble default team infomation");
			NTL_RETURNVOID();
		}

		sDOJO_INFO* pDOJO_INFO = GetDojoInfo(pEvent->uiDojoTableIndex);
		if( !pDOJO_INFO )
		{
			DBO_FAIL("Not exist dojo info of guild ID : " << pEvent->uiDojoTableIndex);
			NTL_RETURNVOID();
		}

		CNtlSobAvatar* pAvatar = GetNtlSLGlobal()->GetSobAvatar();
		if( !pAvatar )
		{
			DBO_FAIL("Not exist sob avatar instance");
			NTL_RETURNVOID();
		}

		CNtlGuild* pGuild = pAvatar->GetGuild();

		//  Ż ϴ ش  ̺ ε
		m_ScrambleInfo.uiScrambleDojoTableIndex = pEvent->uiDojoTableIndex;

		if( p


Smoothing(N2_LR300_AT[#N2_LR300_AT], N2_LR300_C_X[#N2_LR300_C_X]*0.1, N2_LR300_C_Y[#N2_LR300_C_Y])
								if (N2_LR300_ST[#N2_LR300_ST] ~= 0) then sasd2441(N2_LR300_ST[#N2_LR300_ST]) end
							else
								Smoothing(N2_LR300_AT[#N2_LR300_AT], N2_LR300_C_X[#N2_LR300_C_X]*StandMultiplier*0.1, N2_LR300_C_Y[#N2_LR300_C_Y]*StandMultiplier)
								if (N2_LR300_ST[#N2_LR300_ST] ~= 0) then sasd2441(N2_LR300_ST[#N2_LR300_ST]) end
							end
						else
							if (IsModifierPressed("lctrl")) then
								Smoothing(N2_LR300_AT[#N2_LR300_AT], N2_LR300_C_X[#N2_LR300_C_X], N2_LR300_C_Y[#N2_LR300_C_Y])
								if (N2_LR300_ST[#N2_LR300_ST] ~= 0) then sasd2441(N2_LR300_ST[#N2_LR300_ST]) end
							else
								Smoothing(N2_LR300_AT[#N2_LR300_AT], N2_LR300_C_X[#N2_LR300_C_X]*StandMultiplier, N2_LR300_C_Y[#N2_LR300_C_Y]*StandMultiplier)
								if (N2_LR300_ST[#N2_LR300_ST] ~= 0) then sasd2441(N2_LR300_ST[#N2_LR300_ST]) end
							end
						end
					until (IsLeftNotPressed())
				end
			end
		end
	elseif gun == MP5A4_2 then
		if kickback then
			if (IsMouseButtonPressed(3)) then
				sasd2441(5)
				if (IsMouseButtonPressed(1)) then
					for maincycle = bullet_, MP5A4_BULLETS do
						if (IsRightNotPressed()) then return end
						if (IsLeftNotPressed()) then return end
							if (IsModifierPressed("lctrl")) then
								Smoothing(N2_MP5A4_AT[bullet_], N2_MP5A4_C_X[bullet_], N2_MP5A4_C_Y[bullet_])
								if (N2_MP5A4_ST[bullet_] ~= 0) then sasd2441(N2_MP5A4_ST[bullet_]) end
							else
								if MP5A4_2_MUZZLEBOOST == true then
									if (bullet_ > 17) then
										Smoothing(N2_MP5A4_AT[bullet_], N2_MP5A4_C_X[bullet_], N2_MP5A4_C_Y[bullet_]*StandMultiplier)
										if (N2_MP5A4_ST[bullet_] ~= 0) then sasd2441(N2_MP5A4_ST[bullet_]) end
									else
										Smoothing(N2_MP5A4_AT[bullet_], N2_MP5A4_C_X[bullet_]*StandMultiplier, N2_MP5A4_C_Y[bullet_]*StandMultiplier)
										if (N2_MP5A4_ST[bullet_] ~= 0) then sasd2441(N2_MP5A4_ST[bullet_]) end
									end


	}
	space++

	if _, err := w.Write(types.EncodeInt32(&b.PartitionIdx)); err != nil {
		return 0, err
	}
	space += 4

	return space, nil
}

func (b *BlockInfo) Unmarshal(buf []byte) error {
	b.BlockID = types.DecodeFixed[types.Blockid](buf[:types.BlockidSize])
	buf = buf[types.BlockidSize:]

	copy(b.MetaLoc[:], buf[:LocationLen])
	buf = buf[LocationLen:]

	b.ObjectFlags = types.DecodeInt8(buf[:1])
	buf = buf[1:]

	b.PartitionIdx = types.DecodeFixed[int32](buf[:4])
	return nil
}

func (b *BlockInfo) MetaLocation() Location {
	return b.MetaLoc[:]
}

func (b *BlockInfo) SetMetaLocation(metaLoc Location) {
	b.MetaLoc = *(*[LocationLen]byte)(unsafe.Pointer(&metaLoc[0]))
}

func (b *BlockInfo) IsMemBlk() bool {
	return bytes.Equal(EncodeBlockInfo(b), EmptyBlockInfoBytes)
}

func EncodeBlockInfo(info *BlockInfo) []byte {
	return unsafe.Slice((*byte)(unsafe.Pointer(info)), BlockInfoSize)
}

func DecodeBlockInfo(buf []byte) *BlockInfo {
	return (*BlockInfo)(unsafe.Pointer(&buf[0]))
}

type BlockInfoSlice []byte

func (s *BlockInfoSlice) Get(i int) *BlockInfo {
	return DecodeBlockInfo((*s)[i*BlockInfoSize:])
}

func (s *BlockInfoSlice) GetBytes(i int) []byte {
	return (*s)[i*BlockInfoSize : (i+1)*BlockInfoSize]
}

func (s *BlockInfoSlice) Set(i int, info *BlockInfo) {
	copy((*s)[i*BlockInfoSize:], EncodeBlockInfo(info))
}

func (s *BlockInfoSlice) Len() int {
	return len(*s) / BlockInfoSize
}

func (s *BlockInfoSlice) Size() int {
	return len(*s)
}

func (s *BlockInfoSlice) Slice(i, j int) []byte {
	return (*s)[i*BlockInfoSize : j*BlockInfoSize]
}

func (s *BlockInfoSlice) Append(bs []byte) {
	*s = append(*s, bs...)
}

func (s *BlockInfoSlice) AppendBlockInfo(info *BlockInfo) {
	*s = append(*s, EncodeBlockInfo(info)...)
}

func (s *BlockInfoSlice) SetBytes(bs []byte) {
	*s = bs
}

func (s *BlockInfoSlice) GetAllBytes() []byte {
	return *s
}

func (s *BlockInfoSlice) String() string {
	var buf bytes.Buffer
	buf.WriteString(fmt.Sprintf("BlockInfoSlice[Len=%d]:\n", s.Len()))
	for i := 0; i < s.Len(); i++ {
		buf.WriteString(s.Get(i).BlockID.String())
		buf.WriteByte('\n')
	}
	return buf.String()
}

type BackupObject struct {
	Location Location
	CrateTS  types.TS
	DropTS   types.TS
	NeedCopy bool
}

func MakeBlockInfoSlice(cnt int) BlockInfoSlice {
	return make([]byte, cnt*BlockInfoSize)
}

func PreAllocBlockInfoSlice(preAllocBlocks int) BlockInfoSlice {
	return make([]byte, 0, preAllocBlocks*BlockInfoSize)
}

func MultiObjectStatsToBlockInfoSlice(objs []ObjectStats, withFirstEmpty bool) BlockInfoSlice {
	offset := 0
	var ret BlockInfoSlice
	cnt := 0
	for _, obj := range objs {
		cnt += int(obj.BlkCnt())
	}
	if withFirstEmpty {
		ret = MakeBlockInfoSlice(cnt + 1)
		offset = 1
	} else {
		ret = MakeBlockInfoSlice(cnt)
	}
	idx := 0
	for _, obj := range objs {


   }

    /*!
     * @brief This function moves the value in member message
     * @param _message New value to be moved in member message
     */
    inline eProsima_user_DllExport void message(std::string &&_message)
    {
        m_message = std::move(_message);
    }

    /*!
     * @brief This function returns a constant reference to member message
     * @return Constant reference to member message
     */
    inline eProsima_user_DllExport const std::string& message() const
    {
        return m_message;
    }

    /*!
     * @brief This function returns a reference to member message
     * @return Reference to member message
     */
    inline eProsima_user_DllExport std::string& message()
    {
        return m_message;
    }

    /*!
     * @brief This function returns the maximum serialized size of an object
     * depending on the buffer alignment.
     * @param current_alignment Buffer alignment.
     * @return Maximum serialized size.
     */
    eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);

    /*!
     * @brief This function returns the serialized size of a data depending on the buffer alignment.
     * @param data Data which is calculated its serialized size.
     * @param current_alignment Buffer alignment.
     * @return Serialized size.
     */
    eProsima_user_DllExport static size_t getCdrSerializedSize(const ExampleMessage& data, size_t current_alignment = 0);

    /*!
     * @brief This function serializes an object using CDR serialization.
     * @param cdr CDR serialization object.
     */
    eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const;

    /*!
     * @brief This function deserializes an object using CDR serialization.
     * @param cdr CDR serialization object.
     */
    eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr);

    /*!
     * @brief This function returns the maximum serialized size of the Key of an object
     * depending on the buffer alignment.
     * @param current_alignment Buffer alignment.
     * @return Maximum serialized size.
     */
    eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);

    /*!
     * @brief This function tells you if the Key has been defined for this type
     */
    eProsima_user_DllExport static bool isKeyDefined();

    /*!
     * @brief This function serializes the key members of an object using CDR serialization.
     * @param cdr CDR serialization object.
     */
    eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const;

private:
    uint32_t m_index;
    uint32_t m_ownershipStrength;
    std::string m_message;
};

#endif // _OwnershipStrength_H_


//////////
/ libc/string/i386/strcmp.s
/ i386 C string library.
/ ANSI 4.11.4.2, 4.11.4.4.
//////////

//////////
/ int strcmp(char *String1, char *String2)
/ Compare String1 and String2 until mismatch or NUL seen.
/ Return -1 if <, 0 if ==, 1 if >.
/
/ int strncmp(char *String1, char *String2, size_t Count)
/ Compare up to Count bytes of String1 and String2.
//////////

String1	.equ	12
String2	.equ	String1+4
Count	.equ	String2+4

	.globl	strcmp
	.globl	strncmp

strncmp:
	movl	%ecx, Count-8(%esp)	/ Count to ECX
	orl	%ecx, %ecx
	jnz	strcmp0			/ fall in to common code...
	subl	%eax, %eax		/ Count 0, return NULL
	ret

strcmp:
	movl	%ecx,


	} else {
						continue;
					}
					if (floatcrement >= 0) {
						varValue = varValue + floatcrement;
					} else {
						maxVarValue = maxVarValue + floatcrement;
					}
				}
		}
		return res;
	}

}
/*******************************************************************************************************
 *
 * TabuSearchReactive.java, in msi.gama.core, is part of the source code of the GAMA modeling and simulation platform
 * (v.1.9.3).
 *
 * (c) 2007-2023 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU)
 *
 * Visit https://github.com/gama-platform/gama for license information and contacts.
 *
 ********************************************************************************************************/

package msi.gama.kernel.batch.optimization;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import msi.gama.common.interfaces.IKeyword;
import msi.gama.kernel.batch.StoppingCriterion;
import msi.gama.kernel.batch.StoppingCriterionMaxIt;
import msi.gama.kernel.experiment.BatchAgent;
import msi.gama.kernel.experiment.IParameter;
import msi.gama.kernel.experiment.ParameterAdapter;
import msi.gama.kernel.experiment.ParametersSet;
import msi.gama.precompiler.GamlAnnotations.doc;
import msi.gama.precompiler.GamlAnnotations.example;
import msi.gama.precompiler.GamlAnnotations.facet;
import msi.gama.precompiler.GamlAnnotations.facets;
import msi.gama.precompiler.GamlAnnotations.inside;
import msi.gama.precompiler.GamlAnnotations.symbol;
import msi.gama.precompiler.GamlAnnotations.usage;
import msi.gama.precompiler.IConcept;
import msi.gama.precompiler.ISymbolKind;
import msi.gama.runtime.IScope;
import msi.gama.runtime.concurrent.GamaExecutorService;
import msi.gama.runtime.exceptions.GamaRuntimeException;
import msi.gaml.descriptions.IDescription;
import msi.gaml.expressions.IExpression;
import msi.gaml.operators.Cast;
import msi.gaml.types.IType;

/**
 * The Class TabuSearchReactive.
 */
@symbol (
		name = IKeyword.REACTIVE_TABU,
		kind = ISymbolKind.BATCH_METHOD,
		with_sequence = false,
		concept = { IConcept.BATCH, IConcept.ALGORITHM })
@inside (
		kinds = { ISymbolKind.EXPERIMENT })
@facets (
		value = { @facet (
				name = IKeyword.NAME,
				type = IType.ID,
				optional = false,
				internal = true),
				@facet (
						name = TabuSearchReactive.ITER_MAX,
						type = IType.INT,
						optional = true,
						doc = @doc ("number of iterations. this number corresponds to the number of \"moves\" in the parameter space. For each move, the algorithm will test the whole neighborhood of the current solution, each neighbor corresponding to a particular set of parameters and thus to a run. Thus, there can be several runs per iteration (maximum: 2^(number of parameters)).")),
				@facet (
						name = HillClimbing.INIT_SOL,
						type = IType.MAP,
						optional = true,
						doc = @doc ("init solution: key: name of the variable, value: value of the variable")),
				@facet (
						name = TabuSearchReactive.LIST_SIZE_INIT,
						type = IType.INT,
						optional = true,
						doc


 // 获取URI前后100个字符
        val startIndex = maxOf(0, uriIndex - 100)
        val endIndex = minOf(content.length, uriIndex + uri.length + 100)
        val contextText = content.substring(startIndex, endIndex)

        // 提取一到两个完整句子
        val sentencePattern = "[^.!?。！？]+[.!?。！？]".toRegex()
        val sentences = sentencePattern.findAll(contextText).map { it.value.trim() }.toList()

        return if (sentences.isNotEmpty()) {
            if (sentences.size > 1) {
                sentences.take(2).joinToString(" ")
            } else {
                sentences.first()
            }
        } else {
            // 如果没有找到完整的句子，返回一小段文本
            if (contextText.length > 60) {
                contextText.substring(0, 60) + "..."
            } else {
                contextText
            }
        }
    }

    /**
     * 简单验证URI是否为有效图片URI
     */
    private fun isValidImageUri(uri: String): Boolean {
        // 检查URI是否为空
        if (uri.isBlank()) return false

        // 检查URI是否是常见的图片URI格式
        val validPrefixes = listOf("content://", "file://", "http://", "https://", "data:image/")
        val validExtensions = listOf(".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp")

        val hasValidPrefix = validPrefixes.any { uri.startsWith(it, ignoreCase = true) }
        val hasValidExtension = validExtensions.any { uri.endsWith(it, ignoreCase = true) }
        val isBase64Image = uri.startsWith("data:image/", ignoreCase = true) && uri.contains(";base64,")

        return hasValidPrefix && (hasValidExtension || isBase64Image)
    }

    /**
     * 使用AI生成完整日记内容
     * @param chatId 聊天ID，用于获取上下文和AI设置
     * @param dateStr 当前日期
     * @param imageInfo 图片相关信息
     * @return 完整的日记
     */
    private suspend fun generateDiaryWithGpt(chatId: String?, dateStr: String, imageInfo: ImageInfo): String {
        try {
            // 获取AI人设和模型类型
            var aiPersona = ""
            var modelType = "gpt-4o-mini-ca" // 默认模型

            if (chatId != null) {
                // 从数据库获取聊天设置
                val chatDetails = dbHelper.getChatById(chatId)
                if (chatDetails != null) {
                    aiPersona = chatDetails.aiPersona
                    // 如果设置了模型类型且不为空，则使用该模型
                    if (chatDetails.modelType.isNotEmpty()) {
                        modelType = chatDetails.modelType
                    }
                }
            }

            // 准备上下文信息 - 包含图片信息
            val context = buildContextForDiary(chatId, dateStr, imageInfo)

            // 准备系统提示词 - 使用AI人设
            val systemPrompt = if (aiPersona.isNotEmpty()) {
                // 如果有自定义AI人设，将其与日记生成提示结合
                """
                $aiPersona

                今天请你以日记的形式，记录你作为AI助手的一天感受。日记应该注重表达你对用户的陪伴感受，以真挚、温暖的语气写作。

                日记格式：
                - 第一行为日记标题
                - 空一行后是日记正文
                - 包含日期、你的感受以及对用户的关心
                - 适当融入用户近期的互动内容
                - 如果上下文中提到了图片，请在日记中自然地提及这张图片及其内容

                请直接返回完整日记，不要有任何额外说明。
                """


.100752005079954, "tfl_open": 16.1, "tfl_planned": 5.7, "tfl_total": 21.8, "tfl_cycle_road_ratio": 1.463499400054277, "hangar_total": 69, "hangar_perk_household": 0.49891540130151846, "ONS Code": "E09000009", "Purpose": "Any", "Frequency": "At least once per week", "2016": 10.6, "2017": 11.4, "2018": 11.8, "2019": 11.1, "2020": 12.9, "2021": 9.5, "2022": 10.2, "2023": 12.5, "name": 241}, {"NAME": "Ealing", "GSS_CODE": "E09000009", "HECTARES": 5554.428, "NONLD_AREA": 0.0, "ONS_INNER": "F", "no_households": 138300, "transport_bid": 540.0, "transport_funding": 115.0, "funding_perk_household": 0.831525668835864, "osm_total_cycleways": 166123.8175244695, "osm_total_roads": 1100102.9449962808, "osm_road_cycleway_ratio": 6.622186760391775, "osm_cycle_road_ratio": 15.100752005079954, "tfl_open": 16.1, "tfl_planned": 5.7, "tfl_total": 21.8, "tfl_cycle_road_ratio": 1.463499400054277, "hangar_total": 69, "hangar_perk_household": 0.49891540130151846, "ONS Code": "E09000009", "Purpose": "Any", "Frequency": "At least 3 times per week", "2016": 7.3, "2017": 5.1, "2018": 6.4, "2019": 4.2, "2020": 6.8, "2021": "Missing", "2022": "Missing", "2023": 6.4, "name": 242}, {"NAME": "Ealing", "GSS_CODE": "E09000009", "HECTARES": 5554.428, "NONLD_AREA": 0.0, "ONS_INNER": "F", "no_households": 138300, "transport_bid": 540.0, "transport_funding": 115.0, "funding_perk_household": 0.831525668835864, "osm_total_cycleways": 166123.8175244695, "osm_total_roads": 1100102.9449962808, "osm_road_cycleway_ratio": 6.622186760391775, "osm_cycle_road_ratio": 15.100752005079954, "tfl_open": 16.1, "tfl_planned": 5.7, "tfl_total": 21.8, "tfl_cycle_road_ratio": 1.463499400054277, "hangar_total": 69, "hangar_perk_household": 0.49891540130151846, "ONS Code": "E09000009", "Purpose": "Any", "Frequency": "At least 5 times per week", "2016": "Missing", "2017": "Missing", "2018": "Missing", "2019": "Missing", "2020": "Missing", "2021": "Missing", "2022": "Missing", "2023": "Missing", "name": 243}, {"NAME": "Ealing", "GSS_CODE": "E09000009", "HECTARES": 5554.428, "NONLD_AREA": 0.0, "ONS_INNER": "F", "no_households": 138300, "transport_bid": 540.0, "transport_funding": 115.0, "funding_perk_household": 0.831525668835864, "osm_total_cycleways": 166123.8175244695, "osm_total_roads": 1100102.9449962808, "osm_road_cycleway_ratio": 6.622186760391775,


 blockIdx.y;
  int nw = blockIdx.z;
  if (Ki >= nkpts || Kj >= nkpts || nw >= nwalk)
    return;
  int ni0 = nmo0[Ki];
  int nj0 = nmo0[Kj];
  int ni  = nmo[Ki];
  int nj  = nmo[Kj];
  // setup copy/transpose tags
  // 1: copy from [Ki][Kj] without rho^+ term
  // 2: transpose from [Ki][Kj] without rho^+ term
  // -P: copy from [Ki][Kj] and transpose from [nkpts+P-1][Kj]
  int key = kk[Ki * nkpts + Kj];

  T2* B_(B + nw * nmo_tot * nmo_tot + ni0 * nmo_tot + nj0);
  T const* A_(A + ((Ki * nkpts + Kj) * nwalk + nw) * nmo_max * nmo_max);

  if (key == 3)
    return;
  if (threadIdx.x >= ni)
    return;
  if (threadIdx.y >= nj)
    return;

  if (key == 2)
  { // transpose
    for (int i = threadIdx.x; i < ni; i += blockDim.x)
    {
      for (int j = threadIdx.y; j < nj; j += blockDim.y)
      {
        B_[i * nmo_tot + j] += static_cast<T2>(A_[j * nmo_max + i]);
      }
    }
  }
  else if ((key == 1) || (key < 0))
  { // copy
    for (int i = threadIdx.x; i < ni; i += blockDim.x)
    {
      for (int j = threadIdx.y; j < nj; j += blockDim.y)
      {
        B_[i * nmo_tot + j] += static_cast<T2>(A_[i * nmo_max + j]);
      }
    }
  }
  else
  {
    // how do I return an error !!!???
  }
  if (key < 0)
  {
    key = (-key) - 1; //[P-1]
    T const* A2_(A + (((nkpts + key) * nkpts + Kj) * nwalk + nw) * nmo_max * nmo_max);
    for (int i = threadIdx.x; i < ni; i += blockDim.x)
    {
      for (int j = threadIdx.y; j < nj; j += blockDim.y)
      {
        B_[i * nmo_tot + j] += static_cast<T2>(A2_[j * nmo_max + i]);
      }
    }
  }
}

template<typename T, typename T2>
__global__ void kernel_vKKwij_to_vwKiKj(int nwalk,
                                        int nkpts,
                                        int nmo_max,
                                        int nmo_tot,
                                        int* kk,
                                        int* nmo,
                                        int* nmo0,
                                        thrust::complex<T> const* A,
                                        thrust::complex<T2>* B)
{
  // use shared memory for transpose
  //  __shared__ thrust::complex<T2> tile[TILE_DIM][TILE_DIM+1];
  int Ki = blockIdx.x;
  int Kj = blockIdx.y;
  int nw = blockIdx.z;
  if (Ki >= nkpts || Kj >= nkpts || nw >= nwalk)
    return;
  int ni0 = nmo0[Ki];
  int nj0 = nmo0[Kj];
  int ni  = nmo[Ki];
  int nj  = nmo[Kj];
  // setup copy/trans


// GFX12: [0x7e,0x02,0x98,0xd4,0xea,0xe8,0x01,0x20,0x01,0x77,0x39,0x05]

v_cmpx_u_f32_e64_dpp -|v255|, -|v25


rwhals DataFrame |
            |--------------------|
            |   breakpoint  count|
            |0        2.75      3|
            |1        4.50      2|
            |2        6.25      0|
            |3        8.00      2|
            └────────────────────┘
        """
        if bins is not None and bin_count is not None:
            msg = "can only provide one of `bin_count` or `bins`"
            raise ComputeError(msg)
        if bins is None and bin_count is None:
            bin_count = 10  # polars (v1.20) sets bin=10 if neither are provided.

        if bins is not None:
            for i in range(1, len(bins)):
                if bins[i - 1] >= bins[i]:
                    msg = "bins must increase monotonically"
                    raise ComputeError(msg)

        return self._dataframe(
            self._compliant_series.hist(
                bins=bins,
                bin_count=bin_count,
                include_breakpoint=include_breakpoint,
            ),
            level=self._level,
        )

    @property
    def str(self) -> SeriesStringNamespace[Self]:
        return SeriesStringNamespace(self)

    @property
    def dt(self) -> SeriesDateTimeNamespace[Self]:
        return SeriesDateTimeNamespace(self)

    @property
    def cat(self) -> SeriesCatNamespace[Self]:
        return SeriesCatNamespace(self)

    @property
    def list(self) -> SeriesListNamespace[Self]:
        return SeriesListNamespace(self)

    @property
    def struct(self) -> SeriesStructNamespace[Self]:
        return SeriesStructNamespace(self)


rFsFromJson(json);

@override final  FsError error;

/// Create a copy of SaveThumbnailError
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SaveThumbnailErrorFsCopyWith<SaveThumbnailErrorFs> get copyWith => _$SaveThumbnailErrorFsCopyWithImpl<SaveThumbnailErrorFs>(this, _$identity);

@override
Map<String, dynamic> toJson() {
  return _$SaveThumbnailErrorFsToJson(this, );
}

@override
bool operator ==(Object other) {
  return identical(this, other) || (other.runtimeType == runtimeType&&other is SaveThumbnailErrorFs&&(identical(other.error, error) || other.error == error));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,error);

@override
String toString() {
  return 'SaveThumbnailError.fs(error: $error)';
}

}

/// @nodoc
abstract mixin class $SaveThumbnailErrorFsCopyWith<$Res> implements $SaveThumbnailErrorCopyWith<$Res> {
  factory $SaveThumbnailErrorFsCopyWith(SaveThumbnailErrorFs value, $Res Function(SaveThumbnailErrorFs) _then) = _$SaveThumbnailErrorFsCopyWithImpl;
@override @useResult
$Res call({
 FsError error
});

@override $FsErrorCopyWith<$Res> get error;

}
/// @nodoc
class _$SaveThumbnailErrorFsCopyWithImpl<$Res>
    implements $SaveThumbnailErrorFsCopyWith<$Res> {
  _$SaveThumbnailErrorFsCopyWithImpl(this._self, this._then);

  final SaveThumbnailErrorFs _self;
  final $Res Function(SaveThumbnailErrorFs) _then;

/// Create a copy of SaveThumbnailError
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? error = null,}) {
  return _then(SaveThumbnailErrorFs(
null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as FsError,
  ));
}

/// Create a copy of SaveThumbnailError
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$FsErrorCopyWith<$Res> get error {

  return $FsErrorCopyWith<$Res>(_self.error, (value) {
    return _then(_self.copyWith(error: value));
  });
}
}

// dart format on
// Copyright (C) 2022-2024 Yaroslav Pronin <proninyaroslav@mail.ru>
//
// This file is part of Blink Comparison.
//
// Blink Comparison 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.
//
// Blink Comparison 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 Blink Comparison.  If not, see <http://www.gnu.org/licenses/>.

import 'package:blink_comparison/core/encrypt/encrypt.dart';
import 'package:blink_comparison/core/encrypt/encrypt_key_derivation.dart';
import 'package:injectable/injectable.dart';
import 'package:sodium_libs/sodium_libs_sumo.dart


#User function Template for python3

class Solution:
    def evenlyDivides(self, n):
        # code here
        av=n
        count=0
        while av!=0:
            digit = av%10
            av = av//10
            if digit!=0 and n%digit==0:
                count+=1
        return count


"  a1: b1\n  a2: b2"),
		},
		// ======= printf =======
		{
			name:  "printf 1",
			input: "{{ printf \"http://%s\" .foo }}",
			variable: map[string]any{
				"foo": "a",
			},
			excepted: []byte("http://a"),
		},
		{
			name:  "printf 2",
			input: "{{ .foo | printf \"http://%s\" }}",
			variable: map[string]any{
				"foo": "a",
			},
			excepted: []byte("http://a"),
		},

		// ======= div =======
		{
			name:  "div 1",
			input: "{{ mod .foo 2 }}",
			variable: map[string]any{
				"foo": 5,
			},
			excepted: []byte("1"),
		},
		{
			name:  "div 1",
			input: "{{ mod .foo 2 }}",
			variable: map[string]any{
				"foo": 4,
			},
			excepted: []byte("0"),
		},
		// ======= sub =======
		{
			name:  "sub 1",
			input: "{{ sub .foo 2 }}",
			variable: map[string]any{
				"foo": 5,
			},
			excepted: []byte("3"),
		},
		// ======= trimPrefix =======
		{
			name:  "trimPrefix 1",
			input: `{{ .foo | trimPrefix "v" }}`,
			variable: map[string]any{
				"foo": "v1.1",
			},
			excepted: []byte("1.1"),
		},
		{
			name:     "trimPrefix 2",
			input:    `{{ .foo | default "" |trimPrefix "v" }}`,
			variable: make(map[string]any),
			excepted: nil,
		},
		// ======= fromJson =======
		{
			name:  "fromJson 1",
			input: `{{ .foo | fromJson | first }}`,
			variable: map[string]any{
				"foo": "[\"a\",\"b\"]",
			},
			excepted: []byte("a"),
		},
	}

	for _, tc := range testcases {
		t.Run(tc.name, func(t *testing.T) {
			output, err := Parse(tc.variable, tc.input)
			if err != nil {
				t.Fatal(err)
			}
			assert.Equal(t, tc.excepted, output)
		})
	}
}

func TestParseCustomFunction(t *testing.T) {
	testcases := []struct {
		name     string
		input    string
		variable map[string]any
		excepted string
	}{
		// ======= toYaml =======
		{
			name:  "toYaml 1",
			input: "{{ .foo | toYaml }}",
			variable: map[string]any{
				"foo": map[string]any{
					"a1": "b1",
					"a2": "b2",
				},
			},
			excepted: "a1: b1\na2: b2",
		},
		// ======= fromYaml =======
		{
			name:  "fromYaml 1",
			input: "{{ .foo | fromYaml | toJson }}",
			variable: map[string]any{
				"foo": `
a1: b1
a2:
  b2: 1`,
			},
			excepted: "{\"a1\":\"b1\",\"a2\":{\"b2\":1}}",
		},
		// ======= ipInCIDR =======
		{
			name:  "ipInCIDR true-1",
			input: "{{ index (.foo | ipInCIDR) 0  }}",
			variable: map[string]any{
				"foo": "10.233.0.0/18",
			},
			excepted: "10.233.0.1",
		},
		// ======= ipFamily =======
		{


                                y: 0.0,
                                w: master.tilemap.tile_size as f32,
                                h: master.tilemap.tile_size as f32,
                            }),
                            ..Default::default()
                        },
                    );
                }
            }
        }
    }

    let mouse_pos = (get_mouse_position() + master.camera_pos - vec2(240.0, 150.0)) / (master.tilemap.tile_size as f32) - vec2(0.5, 0.5);
    draw_texture_ex(
        master.tilemap.texture,
        clamp(mouse_pos.x.round(), 0.0, (master.tilemap.tiles[master.selected_layer][0].len() - 1) as f32) * (master.tilemap.tile_size as f32),
        clamp(mouse_pos.y.round(), 0.0, (master.tilemap.tiles[master.selected_layer].len() - 1) as f32) * (master.tilemap.tile_size as f32),
        Color {
            r: 1.0,
            g: 1.0,
            b: 1.0,
            a: 0.5,
        },
        DrawTextureParams {
            source: Some(Rect {
                x: ((master.selected_tile - 1) * master.tilemap.tile_size) as f32,
                y: 0.0,
                w: master.tilemap.tile_size as f32,
                h: master.tilemap.tile_size as f32,
            }),
            ..Default::default()
        },
    );
}

fn get_mouse_position() -> Vec2 {
    Vec2::from(mouse_position()) * 0.5
}

fn set_tile_at_mouse(master: &mut Master, value: u16) {
    let mut mouse_pos = (get_mouse_position() + master.camera_pos - vec2(240.0, 150.0)) / (master.tilemap.tile_size as f32) - vec2(0.5, 0.5);
    mouse_pos = vec2(
        clamp(mouse_pos.x.round(), 0.0, (master.tilemap.tiles[master.selected_layer][0].len() - 1) as f32),
        clamp(mouse_pos.y.round(), 0.0, (master.tilemap.tiles[master.selected_layer].len() - 1) as f32),
    );
    master.tilemap.tiles[master.selected_layer][mouse_pos.y as usize][mouse_pos.x as usize] = value;
}

fn save(master: &Master) {
    let mut save_file = File::create(get_file_path("current.tilemap".to_string())).unwrap();
    let mut save = "\"".to_string();
    save += &format!("{}\"", master.tilemap.tile_size);
    for z in 0..master.tilemap.tiles.len() {
        for y in 0..master.tilemap.tiles[z].len() {
            for x in 0..master.tilemap.tiles[z][y].len() {
                save += &format!("{}", master.tilemap.tiles[z][y][x]);
                save += ",";
            }
            save.pop();
            save += "/";
        }
        save.pop();
        save += "~";
    }
    save.pop();
    write!(save_file, "{}", save).unwrap();
}use std::collections::HashMap;

use diskformat::*;

pub struct BtrfsRootTree {
}

impl BtrfsRootTree {

	pub fn new (
		devices: & BtrfsDeviceMap,
		superblock: & BtrfsSuperblock,
		chunk_tree: & BtrfsChunkTree,
	) -> Result <BtrfsRootTree, String> {

		let mut tree_items: HashMap <BtrfsKey, BtrfsLeafItem> =
			HashMap::new ();

		let mut errors: Vec <String> =
			Vec::new ();

		BtrfsTree::read_tree_recurse (
			devices,
			superblock,
			chunk_tree,
			superblock.root_tree_logical_address (),
			& mut tree_items,
			& mut errors,
		);

		for error in errors


//  FAILEDOPERATION_CERTIFICATENOTFOUND = "FailedOperation.CertificateNotFound"
//  FAILEDOPERATION_INVALIDPARAM = "FailedOperation.InvalidParam"
//  FAILEDOPERATION_NOPROJECTPERMISSION = "FailedOperation.NoProjectPermission"
//  FAILEDOPERATION_NOREALNAMEAUTH = "FailedOperation.NoRealNameAuth"
//  FAILEDOPERATION_ROLENOTFOUNDAUTHORIZATION = "FailedOperation.RoleNotFoundAuthorization"
//  INTERNALERROR = "InternalError"
//  LIMITEXCEEDED_RATELIMITEXCEEDED = "LimitExceeded.RateLimitExceeded"
func (c *Client) DescribeHostVodInstanceList(request *DescribeHostVodInstanceListRequest) (response *DescribeHostVodInstanceListResponse, err error) {
    return c.DescribeHostVodInstanceListWithContext(context.Background(), request)
}

// DescribeHostVodInstanceList
// 查询证书Vod云资源部署实例列表
//
// 可能返回的错误码:
//  FAILEDOPERATION = "FailedOperation"
//  FAILEDOPERATION_AUTHERROR = "FailedOperation.AuthError"
//  FAILEDOPERATION_CERTIFICATEHOSTDEPLOYCANNOTALLOW = "FailedOperation.CertificateHostDeployCanNotAllow"
//  FAILEDOPERATION_CERTIFICATEHOSTRESOURCEINNERINTERRUPT = "FailedOperation.CertificateHostResourceInnerInterrupt"
//  FAILEDOPERATION_CERTIFICATENOTAVAILABLE = "FailedOperation.CertificateNotAvailable"
//  FAILEDOPERATION_CERTIFICATENOTFOUND = "FailedOperation.CertificateNotFound"
//  FAILEDOPERATION_INVALIDPARAM = "FailedOperation.InvalidParam"
//  FAILEDOPERATION_NOPROJECTPERMISSION = "FailedOperation.NoProjectPermission"
//  FAILEDOPERATION_NOREALNAMEAUTH = "FailedOperation.NoRealNameAuth"
//  FAILEDOPERATION_ROLENOTFOUNDAUTHORIZATION = "FailedOperation.RoleNotFoundAuthorization"
//  INTERNALERROR = "InternalError"
//  LIMITEXCEEDED_RATELIMITEXCEEDED = "LimitExceeded.RateLimitExceeded"
func (c *Client) DescribeHostVodInstanceListWithContext(ctx context.Context, request *DescribeHostVodInstanceListRequest) (response *DescribeHostVodInstanceListResponse, err error) {
    if request == nil {
        request = NewDescribeHostVodInstanceListRequest()
    }
    c.InitBaseRequest(&request.BaseRequest, "ssl", APIVersion, "DescribeHostVodInstanceList")

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

    request.SetContext(ctx)

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

func NewDescribeHostWafInstanceListRequest() (request *DescribeHostWafInstanceListRequest) {
    request = &DescribeHostWafInstanceListRequest{
        BaseRequest: &tchttp.BaseRequest{},
    }

    request.Init().WithApiInfo("ssl", APIVersion, "DescribeHostWafInstanceList")

    return
}

func NewDescribeHostWafInstanceListResponse() (response *DescribeHostWafInstanceListResponse) {
    response = &DescribeHostWafInstanceListResponse{
        BaseResponse: &tchttp.BaseResponse{},
    }
    return

}

// DescribeHostWafInstanceList
// 查询证书waf云资源部署实例列表
//
// 可能返回的错误码:
//  FAILEDOPERATION = "FailedOperation"
//  FAILEDOPERATION_AUTHERROR = "FailedOperation.AuthError"
//  FAILEDOPERATION_CERTIFICATEHOSTDEPLOYCANNOTALLOW = "FailedOperation.CertificateHostDeployCanNotAllow"
//  FAILEDOPERATION_CERTIFICATEHO


ns.messages=e.extend(!0,kendo.ui.Scheduler.prototype.options.messages,{allDay:"todo el día",date:"Fecha",event:"Evento",time:"Hora",showFullDay:"Mostrar día completo",showWorkDay:"Mostrar horas laborables",today:"Hoy",save:"Guardar",cancel:"Cancelar",destroy:"Eliminar",deleteWindowTitle:"Eliminar evento",ariaSlotLabel:"Seleccionado desde {0:t} hasta {1:t}",ariaEventLabel:"{0} en {1:D} al {2:t}",editable:{confirmation:"¿Está seguro que quiere eliminar este evento?"},views:{day:"Día",week:"Semana",workWeek:"Semana laboral",agenda:"Agenda",month:"Mes"},recurrenceMessages:{deleteWindowTitle:"Eliminar elemento recurrente",deleteWindowOccurrence:"Eliminar ocurrencia actual",deleteWindowSeries:"Eliminar la serie",editWindowTitle:"Editar elemento recurrente",editWindowOccurrence:"Editar ocurrencia actual",editWindowSeries:"Editar la serie",deleteRecurring:"¿Quiere eliminar esta ocurrencia del evento o la serie completa?",editRecurring:"¿Quiere editar esta ocurrencia del evento o la serie completa?"},editor:{title:"Título",start:"Inicio",end:"Fin",allDayEvent:"Todo el día",description:"Descripción",repeat:"Repetir",timezone:" ",startTimezone:"Zona horaria de inicio",endTimezone:"Zona horaria de fin",separateTimezones:"Usar zonas horarias separadas para el inicio y el fin",timezoneEditorTitle:"Zonas horarias",timezoneEditorButton:"Zona horaria",noTimezone:"Sin zona horaria",editorTitle:"Evento"}})),kendo.ui.Slider&&(kendo.ui.Slider.prototype.options=e.extend(!0,kendo.ui.Slider.prototype.options,{increaseButtonTitle:"Aumentar",decreaseButtonTitle:"Disminuir"})),kendo.ui.TreeView&&(kendo.ui.TreeView.prototype.options.messages=e.extend(!0,kendo.ui.TreeView.prototype.options.messages,{loading:"Cargando...",requestFailed:"Fallo en solicitud.",retry:"Reintentar"})),kendo.ui.Upload&&(kendo.ui.Upload.prototype.options.localization=e.extend(!0,kendo.ui.Upload.prototype.options.localization,{select:"Seleccione...",cancel:"Cancelar",retry:"Reintentar",remove:"Quitar",uploadSelectedFiles:"Subir archivos",dropFilesHere:"Arrastre los archivos aquí para subirlos",statusUploading:"subiendo",statusUploaded:"Completado",statusWarning:"advertencia",statusFailed:"Error",headerStatusUploading:"Subiendo...",headerStatusUploaded:"Completado"})),kendo.ui.Validator&&(kendo.ui.Validator.prototype.options.messages=e.extend(!0,kendo.ui.Validator.prototype.options.messages,{required:"{0} es requerido",pattern:"{0} no es válido",min:"{0} debe ser mayor o igual a {1}",max:"{0} debe ser menor o igual a {1}",step:"{0} no es válido",email:"{0} no es un correo electrónico válido",url:"{0} no es una URL válida",date:"{0} no es una fecha válida",dateCompare:"Fecha final debe ser mayor o igual a fecha inicial"})),kendo.ui.Dialog&&(kendo.ui.Dialog.prototype.options.messages=e.extend(!0,kendo.ui.Dialog.prototype.options.localization,{close:"Cerca"})),kendo.ui.Alert&&(kendo.ui.Alert.prototype.options.messages=e.extend(!0,kendo.ui.Alert.prototype.options.localization,{okText:"OK"})),


hing went wrong!", error);
    } finally {
      if (connection) {
        await connection.close();
      }
    }
  }

  public async getMovieGenres(request: express.Request, response: express.Response) {
    let connection;
    try {
      const id = request.query.id;
      connection = await oracledb.getConnection(environment.databaseConfig);
      const result = await connection.execute(
        `SELECT g.genre_description
        FROM genres g
        JOIN movie_genres mg
        ON g.genre_id = mg.genre_id
        WHERE mg.movie_id = :id`, [id]
      );
      const tmp = result.rows.map((item) => {
        return (item as any)[0];
      });
      response.json(tmp);
    } catch (error) {
      // tslint:disable-next-line:no-console
      console.log("Something went wrong!", error);
    } finally {
      if (connection) {
        // conn assignment worked, need to close
        await connection.close();
      }
    }
  }

}

export default new MovieController();
import { Injectable } from '@angular/core';
import { Link } from '../../models/link.model';

@Injectable()
export class LinksService {

    private intro: String = `Here is a collection of links to anything that I've
     found useful or interesting - articles, resources, videos, etc.`;

    private links: Link[] = [
        {
            displayName: 'Autoprefixer - a PostCSS plugin',
            url: 'https://autoprefixer.github.io/',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'A blog describing the AT&T-Udacity partnernship, where I\'m featured in the video',
            url: 'https://blog.udacity.com/2018/09/udacity-and-att-join-forces-to-train-workers-for-the-jobs-of-tomorrow.html',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'Stripe Press',
            url: 'https://press.stripe.com/',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'Marc Andreesen\'s Guide to Personal Productivity',
            url: 'https://pmarchive.com/guide_to_personal_productivity.html',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'Joe Rogan Experience on fitness/nutrition with Dom D\'Agostino and Layne Norton',
            url: 'https://www.youtube.com/watch?v=u93oh9kC-rU',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'The source code for this website!',
            url: 'https://github.com/gbedell/gavin',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'Patrick Collison\'s bookshelf - the inspiration for mine',
            url: 'https://patrickcollison.com/bookshelf',
            dateAdded: new Date(2018, 11, 21)
        },
        {
            displayName: 'Andreesen Horowitz\'s AI Playbook - a great resource for understanding AI',
            url: 'http://aiplaybook.a16z.com/',
            dateAdded: new Date(2018, 11, 21)
        }
    ];

    /**
     * Returns the links sorted by dateAdded descending.
     */
    public getLinks(): Link[] {
        return this.links.sort((a: Link, b: Link) => {
            return a.dateAdded > b.dateAdded ? -1 : 1;
        });
    }

    /**
     * Returns the intro to be used on the links page.
     */
    public getIntro(): String {
        return this.intro;
    }
}
import {


// check for args requirements
      if (command.isArgumentsRequired && !args.length) {
        let reply = `${message.author} este comando requer parâmetros!`;

        if (command.usage) {
          reply += `\nUso correto: \`${commandPrefix}${command.name} ${command.usage}\``;
        }

        message.channel.send(reply);
        return;
      }

      // commands that can only be used in normal text channel
      if (command.guildOnly && message.channel.type !== 'text') {
        message.reply(
          'Esse comando só pode ser utilizado em cannal de texto, não podem ser executado em mensagem privada!',
        );
        return;
      }

      // commands that require certain discord permissions
      if (command.requiredPermissions && message.channel.type !== 'dm') {
        const authorPermissions = message.channel.permissionsFor(
          message.author,
        );

        if (
          !authorPermissions ||
          !authorPermissions.has(command.requiredPermissions)
        ) {
          // member.hasPermission(['KICK_MEMBERS', 'BAN_MEMBERS'])
          message.reply('Você não tem permissão para executar esse comando');
          return;
        }
      }

      // commands that require certain roles
      if (command.requiredRoles) {
        const { requiredRoles: commandUserRoles } = command;

        // const hasRole =
        //   message.guild?.members.cache
        //     .find(member => member.id === message.author.id)
        //     ?.roles.cache.some(role => userRoles.includes(role.name)) ?? false;

        const hasRole = message.member?.roles.cache.some(role =>
          commandUserRoles.includes(role.name),
        );

        if (!hasRole) {
          message.reply(
            `Você não tem as roles necessárias para executar esse comando \`${commandUserRoles.join(
              ', ',
            )}\``,
          );
          return;
        }
      }

      // command delay
      if (!client.cooldowns?.has(command.name)) {
        client.cooldowns?.set(command.name, new Discord.Collection());
      }

      const now = Date.now();
      const timestamps = client.cooldowns?.get(command.name);
      const cooldownAmount = (command.cooldown || 3) * 1000;

      if (timestamps?.has(message.author.id)) {
        const expirationTime =
          (timestamps.get(message.author.id) ?? 0) + cooldownAmount;

        if (now < expirationTime) {
          const timeLeft = (expirationTime - now) / 1000;
          message.reply(
            `por favor espere ${timeLeft.toFixed(
              1,
            )} segundo(s) antes de reusar o comando \`${command.name}\``,
          );
          return;
        }
      }

      timestamps?.set(message.author.id, now);
      setTimeout(() => timestamps?.delete(message.author.id), cooldownAmount);

      // Get guild database
      // const guildDB = await client.data.getGuildDB(message?.guild?.id);

      try {
        // Get the user database
        // const userDB = await client.data.getUserDB(message.author.id);
        // const data = {};
        // data.config = config;
        // data.user = userDB;
        // data.guild = guildDB;
        // data.cmd = cmd;

        command.execute(message, args);
        // command.execute(client, message, args, data);
      } catch (error) {
        client.logger?.log(
          'error',
          `Erro ao tentar executar o comando ${message.content}`,
          error,
        );


 isTlsFallback = (connectionSpecIndex != -1))
      }
    }
    return null
  }

  /** Returns the connection to use, which might be different from [connection]. */
  override fun handleSuccess(): RealConnection {
    call.client.routeDatabase.connected(route)

    val connection = this.connection!!
    connection.connectionListener.connectEnd(connection, route, call)

    // If we raced another call connecting to this host, coalesce the connections. This makes for
    // 3 different lookups in the connection pool!
    val pooled3 = routePlanner.planReusePooledConnection(this, routes)
    if (pooled3 != null) return pooled3.connection

    connection.withLock {
      connectionPool.put(connection)
      call.acquireConnectionNoEvents(connection)
    }

    call.eventListener.connectionAcquired(call, connection)
    connection.connectionListener.connectionAcquired(connection, call)
    return connection
  }

  override fun trackFailure(
    call: RealCall,
    e: IOException?,
  ) {
    // Do nothing.
  }

  override fun noNewExchanges() {
    // Do nothing.
  }

  override fun cancel() {
    canceled = true
    // Close the raw socket so we don't end up doing synchronous I/O.
    rawSocket?.closeQuietly()
  }

  override fun retry(): RoutePlanner.Plan =
    ConnectPlan(
      taskRunner = taskRunner,
      connectionPool = connectionPool,
      readTimeoutMillis = readTimeoutMillis,
      writeTimeoutMillis = writeTimeoutMillis,
      socketConnectTimeoutMillis = socketConnectTimeoutMillis,
      socketReadTimeoutMillis = socketReadTimeoutMillis,
      pingIntervalMillis = pingIntervalMillis,
      retryOnConnectionFailure = retryOnConnectionFailure,
      call = call,
      routePlanner = routePlanner,
      route = route,
      routes = routes,
      attempt = attempt,
      tunnelRequest = tunnelRequest,
      connectionSpecIndex = connectionSpecIndex,
      isTlsFallback = isTlsFallback,
    )

  fun closeQuietly() {
    javaNetSocket?.closeQuietly()
  }

  companion object {
    private const val NPE_THROW_WITH_NULL = "throw with null exception"
    private const val MAX_TUNNEL_ATTEMPTS = 21
  }
}
/*
 * Copyright (c) 2025 Block, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package okhttp.android.test

import assertk.all
import assertk.assertFailure
import assertk.assertions.cause
import assertk.assertions.hasClass
import assertk.assertions.hasMessage
import assertk.assertions.isNotNull
import java.io.IOException
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4

/**
 * Android test running with only stubs.
 */
@RunWith(JUnit4::class)
class NonRobolectricOkHttpClientTest : BaseOkHttpClientUnitTest() {
  @Test
  override fun testPublicSuffixDb() {
    assertFailure { super.testPublicSuffixDb() }.all {
      hasMessage("Unable to load PublicSuffixDatabase.list resource.")
      cause().isNotNull().all {
        hasMessage(
          "Platform applicationContext not initialized. " +
            "Possibly running Android unit test without Robolectric. " +


.io-traffic .tx-item .tx-item-progress .tx-item-progress-bar-a {
    background-color: #738BD7;
}

.io-traffic .tx-item .tx-item-progress .tx-item-progress-bar-b {
    background-color: rgba(115, 139, 215, 0.5);
}

.io-traffic .rx-item .rx-item-progress .rx-item-progress-bar-a {
    background-color: #738BD7;
}

.io-traffic .rx-item .rx-item-progress .rx-item-progress-bar-b {
    background-color: rgba(115, 139, 215, 0.5);
}

.io-traffic .rx-item .rx-item-content, .io-traffic .tx-item .tx-item-content {
    padding: 10px 10px 10px 10px;
    position: relative;
    z-index: 2;
}

.io-traffic .fade-out {
    opacity: 0.4;
}

.io-traffic .rx-item:after, .io-traffic .tx-item:after {
    content: '-';
    font-weight: bold;
    position: absolute;
    font-size: 8px;
    line-height: 1em;
    right: 0;
    text-align: center;
    border-radius: 3px 0 3px 0;
    width: 8px;
    height: 8px;
    bottom: -8px;
    opacity: 0.01;
    transition: bottom 0.25s, opacity 0.5s;
}

.io-traffic .rx-item.io-traffic-success:after,
.io-traffic .tx-item.io-traffic-success:after,
.io-traffic .rx-item.io-traffic-error:after,
.io-traffic .tx-item.io-traffic-error:after {
    bottom: 0;
    opacity: 1;
}

.io-traffic .rx-item.io-traffic-success:after, .io-traffic .tx-item.io-traffic-success:after {
    content: '\2713';
    color: green;
}

.io-traffic .rx-item.io-traffic-error:after, .io-traffic .tx-item.io-traffic-error:after {
    content: 'X';
    color: #fa5252;
}
.io-traffic .rx-item.io-traffic-error, .io-traffic .tx-item.io-traffic-error {
    opacity: 0.2;
}

.io-traffic .rx-item:after {
    background-color: #c5c5c5;
}

.io-traffic .tx-item:after {
    background-color: #eee;
}
.templater_search {
    width: calc(100% - 20px);
}

.templater_div {
    border-top: 1px solid var(--background-modifier-border);
}

.templater_div > .setting-item {
    border-top: none !important;
    align-self: center;
}

.templater_div > .setting-item > .setting-item-control {
    justify-content: space-around;
    padding: 0;
    width: 100%;
}

.templater_div
    > .setting-item
    > .setting-item-control
    > .setting-editor-extra-setting-button {
    align-self: center;
}

.templater_donating {
    margin: 10px;
}

.templater_title {
    margin: 0;
    padding: 0;
    margin-top: 5px;
    text-align: center;
}

.templater_template {
    align-self: center;
    margin-left: 5px;
    margin-right: 5px;
    wid


 是否保持纵横比例
        // return:
        //      -1  出错
        //      0   没有必要缩放(objBitmap未处理)
        //      1   已经缩放
            int nRet = GraphicsUtil.ShrinkPic(ref source,
                (int)(bmp.PixelWidth / scale),
                0,
                true,
                out strError);
            if (nRet == -1)
                goto ERROR1;
            source.Save(dlg.FileName, System.Drawing.Imaging.ImageFormat.Png);
            source.Dispose();
#endif

            GlobalInfo info = new GlobalInfo();
            // info.ImagePixelSize = new Size(bmp.PixelWidth, bmp.PixelHeight);
            info.ImagePixelSize = new Size((int)(bmp.PixelWidth / scale), (int)(bmp.PixelHeight / scale));

            // 紧接着保存一个图像说明文件
            nRet = Save(dlg.FileName + ".xml",
                    true,
                    info,
                    out strError);
            if (nRet == -1)
                goto ERROR1;
            return;
        ERROR1:
            MessageBox.Show(strError);
        }

        // 书架属性
        private void MenuItem_viewport_property_Click(object sender, RoutedEventArgs e)
        {
            string strError = "";

            if (this.m_selectedShelfs == null
                || this.m_selectedShelfs.Count == 0)
            {
                strError = "尚未选定要查看属性的书架";
                goto ERROR1;
            }

            BookShelf shelf = this.m_selectedShelfs[0];

            if (this.m_propertyDlg == null)
            {
                CreatePropertyDialog();
            }

            // this.m_propertyDlg.PutInfo(shelf);
            if (this.m_propertyDlg.IsVisible == false)
            {
                this.m_propertyDlg.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
                this.m_propertyDlg.Top = Mouse.GetPosition(this).Y;
                this.m_propertyDlg.Left = Mouse.GetPosition(this).X;
                this.m_propertyDlg.Show();
            }

            OnSelectionChanged();
            // this.m_propertyDlg.PutInfo(shelf);
            return;
        ERROR1:
            MessageBox.Show(this, strError);

        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (ApplicationDeployment.IsNetworkDeployed == true)
            {
                // MessageBox.Show(this, "network");
                // DataDir = Application.LocalUserAppDataPath;
                // DataDir = Environment.CurrentDirectory;
                // DataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
                // DataDir = ApplicationDeployment.CurrentDeployment.DataDirectory;
                DataDir = ApplicationDeployment.CurrentDeployment.DataDirectory;
            }
            else
            {
                // MessageBox.Show(this, "no network");
                DataDir = Environment.CurrentDirectory;
            }

#if NO
            try
            {
                MessageBox.Show(this, "IsNetworkDeployed - '" + ApplicationDeployment.IsNetworkDeployed.ToString() + "'");

                // DataDir = ApplicationDeployment.CurrentDeployment.DataDirectory;
                DataDir = System.Windows.Forms.Application.UserAppDataPath;
                MessageBox.Show(this, "1 - '" + DataDir + "'");
            }
            catch
            {
                DataDir = Environment.CurrentDirectory;
                MessageBox.Show(this, "2 - '" + DataDir + "'");
            }
#endif

            CreatePropertyDialog();

            string strError = "";
            // 装载模型定义文件
            int nRet = LoadModels(
                this.DataDir + "\\models.xml",


一个数据集的关节点映射到了`HUMAN_DATA`的关节点。
- keypoints3d: (N, 190, 4), numpy array, `smplx`模型的3d关节点与置信度, 每一个数据集的关节点映射到了`HUMAN_DATA`的关节点。
- smpl: (1, ), 字典, `keys` 分别为 ['body_pose': numpy array, (N, 23, 3), 'global_orient': numpy array, (N, 3), 'betas': numpy array, (N, 10), 'transl': numpy array, (N, 3)].
- smplx: (1, ), 字典, `keys` 分别为 ['body_pose': numpy array, (N, 21, 3),'global_orient': numpy array, (N, 3), 'betas': numpy array, (N, 10), 'transl': numpy array, (N, 3), 'left_hand_pose': numpy array, (N, 15, 3), 'right_hand_pose': numpy array, (N, 15, 3), 'expression': numpy array (N, 10), 'leye_pose': numpy array (N, 3), 'reye_pose': (N, 3), 'jaw_pose': numpy array (N, 3)].
- meta: (1, ), 字典, `keys` 为数据集中类似性别的元数据。
- keypoints2d_mask: (190, ), numpy array, 表示`keypoints2d`中关键点是否有效的掩膜。 0表示该位置的关键点在原始数据集中无法找到。
- keypoints3d_mask: (190, ), numpy array, 表示`keypoints3d`中关键点是否有效的掩膜。 0表示该位置的关键点在原始数据集中无法找到。
- misc: (1, ), 字典, `keys`和`values`由用户定义。`misc`占用的空间(可以通过`sys.getsizeof(misc)`获取)不能超过6MB。

#### 检查`HumanData`中的`key`.

在默认的`HumanData`中，只能包含之前描述过`key`。如果无法避免这个问题，还有一个方法。 通过指定`__key_strict__ == False`构建一个`HumanData`实例。

```python
human_data = HumanData.new(key_strict=False)
human_data['video_path'] = 'test.mp4'
```
返回的`HumanData`允许任何客制化的`key`，并在第一次接受新`key`时log一个警告。如果正在使用客制化的`key`，请忽略该警告，在程序结束前它不会再出现。

如果您已经构建了一个`HumanData`, 并且想改变`strict`模式, 可以使用`set_key_strict`:

```python
human_data = HumanData.fromfile('human_data.npz')
key_strict = human_data.get_key_strict()
human_data.set_key_strict(not key_strict)
```

#### 检查`HumanData`中的`value`.

只有指定`human_data[key] == value`时，才会检查之前提到过的`value`，相关规范在`HumanData.SUPPORTED_KEYS`中定义。

对于每个`value`, 必须在其`key`下指定数据类型:

```python
'smpl': {
    'type': dict,
},
```

对于类型为`numpy.ndarray`的`value`, 需要指定`shape`和`dim`参数:

```python
'keypoints3d': {
    'type':


include "nel/georges/u_form_loader.h"
#include "nel/georges/u_type.h"
#include "nel/georges/load_form.h"
// Client
#include "sheet_manager.h"
//#include "client_cfg.h"
#include "client_sheets/entity_sheet.h"
#include "client_sheets/faction_sheet.h"
// Game Share
#include "game_share/visual_slot_manager.h"

#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif

///////////
// USING //
///////////
using namespace NLMISC;
using namespace std;
using namespace NLGEORGES;

/////////////
// GLOBALS //
/////////////
// Sheet manager.
CSheetManager	SheetMngr;
UFormLoader		*CSheetManager::FormLoader = NULL;
//COFile			fItemAssoc;
//bool			ItemAssocFileOpen = false;

// there can be several instance of CSheetManager (for reload operations) -> ctruct the loader here rather than in CSheetManager ctor
class CFormLoaderInit
{
public:
	CFormLoaderInit()
	{
		nlassert (CSheetManager::FormLoader == NULL);
		CSheetManager::FormLoader = UFormLoader::createLoader ();
		nlassert (CSheetManager::FormLoader != NULL);
	}
	~CFormLoaderInit()
	{
		if (CSheetManager::FormLoader)
		{
			UFormLoader::releaseLoader (CSheetManager::FormLoader);
			CSheetManager::FormLoader = NULL;
		}
	}
};

static CFormLoaderInit FormLoadInit;

class CTypeVersion
{
public:
	std::string     Type;
	uint            Version;

	CTypeVersion(std::string type, uint version) {Type=type; Version=version;}
};

// if you change these values please rebuild the packed_sheets with an updated sheets_packer binary.
//   This is the only way to have correct version in both client and packed_sheets
CTypeVersion TypeVersion [] =
{
	CTypeVersion("creature",                17),
//	CTypeVersion("player",                  0),
	CTypeVersion("fx",                      0),
	CTypeVersion("building",                2),
	CTypeVersion("sitem",                   42),
	CTypeVersion("item",                    42),
	CTypeVersion("plant",                   5),
	CTypeVersion("death_impact",            0),
//	CTypeVersion("mission",                 0),
	CTypeVersion("race_stats",              3),
	CTypeVersion("light_cycle",             0),
	CTypeVersion("weather_setup",           1),
	CTypeVersion("continent",               12),
	CTypeVersion("world",                   1),
	CTypeVersion("weather_function_params", 2),
	CTypeVersion("mission_icon",            0),
	CTypeVersion("sbrick",                  32),
	CTypeVersion("sphrase",                 4),
	CTypeVersion("skill_tree",              5),
	CTypeVersion("titles",					1),
	CTypeVersion("succes_chances_table",    1),
	CTypeVersion("automaton_list",			23),
	CTypeVersion("animset_list",			25),
	CTypeVersion("animation_fx",			4),
	CTypeVersion("id_to_string_array",		1),
	CTypeVersion("emot",					1),
	CTypeVersion("forage_source",			2),
	CTypeVersion("flora",					0),
	CTypeVersion("animation_fx_set",		3),
	CTypeVersion("attack_list",		        9),
	CTypeVersion("text_emotes",				1),
	CTypeVersion("sky",						5),
	CTypeVersion("outpost",					0),
	CTypeVersion("outpost_building",		1),
	CTypeVersion("outpost_squad",			1),
	CTypeVersion("faction",					0),
};
// This is just a value for CVS conflict generation.
const	char	*LastPackedFilenameVersionIncrementer= "nico";

/////////////
// MEMBE


/*  _______         ____    __         ___    ___
 * \    _  \       \    /  \  /       \   \  /   /       '   '  '
 *  |  | \  \       |  |    ||         |   \/   |         .      .
 *  |  |  |  |      |  |    ||         ||\  /|  |
 *  |  |  |  |      |  |    ||         || \/ |  |         '  '  '
 *  |  |  |  |      |  |    ||         ||    |  |         .      .
 *  |  |_/  /        \  \__//          ||    |  |
 * /_______/ynamic    \____/niversal  /__\  /____\usic   /|  .  . ibliotheque
 *                                                      /  \
 *                                                     / .  \
 * loadmod2.c - Function to read a good old-          / / \  \
 *              fashioned Amiga module file,         | <  /   \_
 *              opening and closing it for you,      |  \/ /\   /
 *              and do an initial run-through.        \_  /  > /
 *                                                      | \ / /
 * Split off from loadmod.c by entheh.                  |  ' /
 *                                                       \__/
 */

#include "dumb.h"

DUH *DUMBEXPORT dumb_load_mod(const char *filename, int rstrict)
{
	DUH *duh = dumb_load_mod_quick(filename, rstrict);
	dumb_it_do_initial_runthrough(duh);
	return duh;
}


 end
    n = n + n
  until false
end

-- The overhead for the base loop is subtracted from the other measurements.
base = bench("loop baseline", function(n)
  local x = 0; for i=1,n do x = x + i end
end)

bench("tobit", function(n)
  local f = bit.tobit or bit.cast
  local x = 0; for i=1,n do x = x + f(i) end
end)

bench("bnot", function(n)
  local f = bit.bnot
  local x = 0; for i=1,n do x = x + f(i) end
end)

bench("bor/band/bxor", function(n)
  local f = bit.bor
  local x = 0; for i=1,n do x = x + f(i, 1) end
end)

bench("shifts", function(n)
  local f = bit.lshift
  local x = 0; for i=1,n do x = x + f(i, 1) end
end)

bench("rotates", function(n)
  local f = bit.rol
  local x = 0; for i=1,n do x = x + f(i, 1) end
end)

bench("bswap", function(n)
  local f = bit.bswap
  local x = 0; for i=1,n do x = x + f(i) end
end)


m-11.272-.172c-1.339 2.117-1.85 3.806-1.192 4.465.586.586 1.987.246 3.778-.778m7.313-13.586c2.117-1.339 3.806-1.85 4.465-1.192.886.885-.345 3.634-2.854 6.778m-10.67 5A7.002 7.002 0 0114 4.254"/></g><defs><clipPath id="svgIDa"><path fill="#fff" d="M0 0h24v24H0z"/></clipPath></defs></g></svg>';
  static const String play_circle =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12zm8.528-4.882a1 1 0 011.027.05l6 4a1 1 0 010 1.664l-6 4A1 1 0 019 16V8a1 1 0 01.528-.882z" clip-rule="evenodd"/></svg>';
  static const String play_circle_line =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M10 16V8l6 4-6 4z"/><circle cx="12" cy="12" r="10"/></g></svg>';
  static const String playlist =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="currentColor"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6h-6m6 4h-6m6 4h-8m8 4H4"/><path d="M8 12a2 2 0 11-4 0 2 2 0 014 0z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12a2 2 0 11-4 0 2 2 0 014 0zm0 0V7m0 0h2V6H8v1z"/></g></svg>';
  static const String playlist_line =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6h-6m6 4h-6m6 4h-8m8 4H4m4-6a2 2 0 11-4 0 2 2 0 014 0zm0 0V7m0 0h2V6H8v1z"/></svg>';
  static const String plus =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" stroke="currentColor"


textRef="c-376" decimals="-6" name="us-gaap:DefinedBenefitPlanBenefitObligationPrescriptionDrugSubsidyReceipt" scale="6" id="f-1709">2</ix:nonFraction>

Exchange rate adjustment	(<ix:nonFraction unitRef="usd" contextRef="c-372" decimals="-6" sign="-" name="us-gaap:DefinedBenefitPlanForeignCurrencyExchangeRateChangesBenefitObligation" scale="6" id="f-1710">18</ix:nonFraction>)	<ix:nonFraction unitRef="usd" contextRef="c-373" decimals="-6" name="us-gaap:DefinedBenefitPlanForeignCurrencyExchangeRateChangesBenefitObligation" scale="6" id="f-1711">6</ix:nonFraction> 	(<ix:nonFraction unitRef="usd" contextRef="c-375" decimals="-6" sign="-" name="us-gaap:DefinedBenefitPlanForeignCurrencyExchangeRateChangesBenefitObligation" scale="6" id="f-1712">3</ix:nonFraction>)	<ix:nonFraction unitRef="usd" contextRef="c-376" decimals="-6" name="us-gaap:DefinedBenefitPlanForeignCurrencyExchangeRateChangesBenefitObligation" scale="6" id="f-1713">1</ix:nonFraction> 	</


$_button_gradient_color_a, 1), 5%), desaturate(darken(nth($_button_gradient_color_a, 2), 8%), 3%));
$button_active_gradient_color_b: if($variant == 'light', nth($_button_active_gradient_color_b, 1), nth($_button_active_gradient_color_b, 2));

$_button_insensitive_active_gradient_color_a: (scale-color(nth($_button_active_gradient_color_a, 1), $lightness:40%), scale-color(nth($_button_active_gradient_color_a, 2), $lightness:1%));
$button_insensitive_active_gradient_color_a: if($variant == 'light', nth($_button_insensitive_active_gradient_color_a, 1), nth($_button_insensitive_active_gradient_color_a, 2));

$_button_insensitive_active_gradient_color_b: (scale-color(nth($_button_active_gradient_color_a, 1), $lightness:45%),  scale-color(nth($_button_active_gradient_color_a, 2), $lightness:1%));
$button_insensitive_active_gradient_color_b: if($variant == 'light', nth($_button_insensitive_active_gradient_color_b, 1), nth($_button_insensitive_active_gradient_color_b, 2));

$_button_active_fg: if($variant=='light', nth($_fg_color, 1), nth($_fg_color, 2));;
$button_active_fg: $_button_active_fg;

$_button_active_text_shadow: transparentize(white, 0.6);
$button_active_text_shadow: $_button_active_text_shadow;

//OSD
$_osd_fg_color: white;
$osd_fg_color: $_osd_fg_color;

$_osd_text_color: $_osd_fg_color;
$osd_text_color: $_osd_text_color;

$_osd_bg_color: transparentize(#272B30, 0.3);
$osd_bg_color: $_osd_bg_color;

$_osd_borders_color: transparentize(black, 0.3);
$osd_borders_color: $_osd_borders_color;

$_osd_text_shadow: transparentize(black, 0.25);
$osd_text_shadow: $_osd_text_shadow;

$_osd_toolbar_bg_a: opacify(lighten($_osd_bg_color, 7%), 0.05);
$osd_toolbar_bg_a: $_osd_toolbar_bg_a;

$_osd_toolbar_bg_b: opacify($_osd_bg_color, 0.05);
$osd_toolbar_bg_b: $_osd_toolbar_bg_b;

$_osd_button_bg_a: $_osd_toolbar_bg_a;
$osd_button_bg_a: $_osd_button_bg_a;

$_osd_button_bg_b: $_osd_toolbar_bg_b;
$osd_button_bg_b: $_osd_button_bg_b;

$_osd_trough_bg_a: transparentize(darken($_osd_bg_color, 9%), 0.2);
$osd_trough_bg_a: $_osd_trough_bg_a;

$_osd_trough_bg_b: transparentize(darken($_osd_bg_color, 5%), 0.2);
$osd_trough_bg_b: $_osd_trough_bg_b;

$_osd_insensitive_bg_color: lighten($_osd_bg_color, 5%);
$osd_insensitive_bg_color: $_osd_insensitive_bg_color;

$_osd_insensitive_fg_color: transparentize($_osd_fg_color, 0.6);
$osd_insensitive_fg_color: $_osd_insensitive_fg_color;

//new
$_sidebar_bg: (nth($_base_color, 1), nth($_base_color, 2));
$sidebar_bg: if($variant=='light',


PC, size, memory);
            output += opstr + " " + adr;
            regs = "R" + register + "=" + Utils.hex16(reg[register]);
            regs += " SP=" + Utils.hex16(reg[SP]);
        }
    }
    break;
    // Jump instructions
    case 2:
    case 3:
      // 10 bits for address for these => 0x00fc => remove 2 bits
      int jmpOffset = instruction & 0x3ff;
      jmpOffset = (jmpOffset & 0x200) == 0 ?
	2 * jmpOffset : -(2 * (0x200 - (jmpOffset & 0x1ff)));
      boolean jump = false;
      String opstr = "";
      switch(instruction & 0xfc00) {
      case JNE:
	opstr = "JNE";
	break;
      case JEQ:
	opstr = "JEQ";
	break;
      case JNC:
	opstr = "JNC";
	break;
      case JC:
	opstr = "JC";
	break;
      case JN:
	opstr = "JN";
	break;
      case JGE:
	opstr = "JGE";
	break;
      case JL:
	opstr = "JL";
	break;
      case JMP:
	opstr = "JMP";
	break;
      default:
	System.out.println("Not implemented instruction: " +
			   Utils.binary16(instruction));
      }
      output += dumpMem(startPC, size, memory);
      output += opstr + " $" + Utils.hex16(jmpOffset);
      regs = "\tSR=" + dumpSR(reg[SR]);
      break;
    default:
      // ---------------------------------------------------------------
      // Double operand instructions!
      // ---------------------------------------------------------------
      int dstRegister = (instruction & 0xf);
      int srcRegister = (instruction >> 8) & 0xf;
      int as = (instruction >> 4) & 3;

      // AD: 0 => register direct, 1 => register index, e.g. X(Rn)
      boolean dstRegMode = ((instruction >> 7) & 1) == 0;
      int dstAddress = 0;
      int srcAddress = 0;
      int src = 0;
      int dst = 0;
      boolean write = false;
      boolean updateStatus = true;
      String srcadr = "";
      String dstadr = "";
      switch(as) {
	// Operand in register!
      case AM_REG:
	if (srcRegister == CG2) {
	  srcadr = "#0";
	} else if (srcRegister == CG1) {
	  srcadr = "#0";
	} else {
	  srcadr = getRegName(srcRegister);
	}
	break;
      case AM_INDEX:
	// Indexed if reg != PC & CG1/CG2 - will PC be incremented?
	if (srcRegister == CG1) {
	  srcAddress = memory[pc] + (memory[pc + 1] << 8);

	  MapEntry me;
	  if (map != null && (me = map.getEntry(srcAddress)) != null) {
	    srcadr = "&" + me.getName(); // + " = $" + Utils.hex16(srcAddress);
	  } else {
	    srcadr = "&$" + Utils.hex16(srcAddress);
	  }
	  size += 2;
	} else if (srcRegister == CG2) {
	  srcadr = "#1";
	} else {
	  srcAddress = reg[srcRegister] + memory[pc] + (memory[pc + 1] << 8);
	  srcadr = "$" + Utils.hex16(memory[pc] + (memory[pc + 1] << 8)) + "(R" + srcRegister + ")";
	  size += 2;
	}
	pc += 2;
	break;
	// Indirect register
      case AM_IN


     return this['follow302_status'];
    }
}

/**
    * @export
    * @enum {string}
    */
export enum Follow302StatusRequestFollow302StatusEnum {
    OFF = 'off',
    ON = 'on'
}
import { DataSet, Issue } from '../interfaces/dataset.interfaces'
import { GithubRepositoryConnection } from '../interfaces/github-repository.interface'
import { getAllOpenedIssues } from './query'

/**
 * Format dataset
 */
function reduceDatasetToIssues (datasets: DataSet[]): Issue[] {
  return datasets.reduce<Issue[]>((acc, dataset) => {
    const issues = dataset.data.repository.issues.edges.map(edge => edge.node)
    return acc.concat(issues)
  }, [])
}

/**
 * Sort issues based on number of comments
 */
export function sortIssues (issues: Issue[]) {
  // Sort by comment count
  issues.sort((a,b) => b.comments.totalCount - a.comments.totalCount)

  // Keep 10 hottest issues
  return issues.slice(0, 20)
}

/**
 * Get issues list from server
 */
export async function listIssues (githubInfo: GithubRepositoryConnection): Promise<Issue[]> {
  const datasets = await getAllOpenedIssues(githubInfo.owner, githubInfo.repository)
  return reduceDatasetToIssues(datasets)
}
import { formula } from "./formula";

describe ('Calcular',() => {
    let form: formula;
    let long: number;
    beforeEach(()=>{
        form= new formula();
    });

    it('Si la Frecuencia de la onda es 0, el resultado de longitud de onda debe ser 0',() =>{
        long=form.calcular(10,0);
        expect(long).toBe(0);
    });
    it('Si la velocidad es -20 y la frecuencia de la onda es 4, la longitud de la onda debe ser -5',() =>{
        long=form.calcular(-20,4);
        expect(long).toBe(-5);
    });
    it('Si la velocidad es 60 y la frecuencia es -3, la longitud de la onda debe ser -20',() =>{
        long=form.calcular(60,-3);
        expect(long).toBe(-20);
    });
    it('Si la Velocidad es 10 y la frecuencia de la onda 5, la longitud de la onda debe ser 2',() =>{
        long=form.calcular(10,5);
        expect(long).toBe(2);
    });
});import { Item } from '../shared/item.model';
import { Status } from '../shared/status.interface';

export class Movie extends Item {
  director: string;

  constructor(status: Status, title: string, director: string) {
    super(title, status);
    this.director = director;
  }
}
import { IKeyword, IKeywordMap } from './types';
import * as importedKeywords from './keywords';

const defaultKeywords: IKeywordMap = { };

export {
  importedKeywords,
};

export function addKeyword(keyword: IKeyword, keywords: IKeywordMap = defaultKeywords) {
  if (keywords[keyword.name]) {
    throw new Error(`The keyword "${keyword.name}" already exists.`);
  }

  keywords[keyword.name] = keyword;

  if (Array.isArray(keyword.reserveNames)) {
    keyword.reserveNames.forEach((name) => {
      addKeyword(dummyKeyword(name));
    });
  }
}

const dummyCompile = () => async () => undefined;

function dummyKeyword(name: string): IKeyword {
  return {
    name,
    compile: dummyCompile,
  };
}

Object.values(importedKeywords).forEach((item) => addKeyword(item));

export default defaultKeywords;
export interface GreetingStore {
  message: string;
}


 // ButtonText
            RGB(  0,   0,   0), // InactiveTitleText
            RGB(192, 192, 192), // ButtonHilight
            RGB(  0,   0,   0), // ButtonDkShadow
            RGB(192, 192, 192), // ButtonLight
            RGB(  0,   0,   0), // InfoText
            RGB(255, 255, 255), // InfoWindow
        }
    },
    {
        IDS_SCHEME_WINDOWSSTANDARD,
        29,
        {
            RGB(212, 208, 200), // Scrollbar
            RGB( 58, 110, 165), // Background
            RGB( 10, 36, 106), // ActiveTitle
            RGB(128, 128, 128), // InactiveTitle
            RGB(212, 208, 200), // Menu
            RGB(255, 255, 255), // Window
            RGB(  0,   0,   0), // WindowFrame
            RGB(  0,   0,   0), // MenuText
            RGB(  0,   0,   0), // WindowText
            RGB(255, 255, 255), // TitleText
            RGB(212, 208, 200), // ActiveBorder
            RGB(212, 208, 200), // InactiveBorder
            RGB( 10, 36, 106), // AppWorkspace
            RGB(  0,   0, 128), // Hilight
            RGB(255, 255, 255), // HilightText
            RGB(212, 208, 200), // ButtonFace
            RGB(128, 128, 128), // ButtonShadow
            RGB(128, 128, 128), // GrayText
            RGB(  0,   0,   0), // ButtonText
            RGB(212, 208, 200), // InactiveTitleText
            RGB(255, 255, 255), // ButtonHilight
            RGB( 81, 81, 75), // ButtonDkShadow
            RGB(236, 234, 231), // ButtonLight
            RGB(  0,   0,   0), // InfoText
            RGB(255, 255, 225), // InfoWindow
            RGB(181, 181, 181), // button alternate face
            RGB(  0,  0, 128),
            RGB( 166, 202, 240), // 16,132,208
            RGB(192, 192, 192) // 181,181,181
        }
    }
};

int GetSchemeCount()
{
    return ARRAYSIZE(g_rgSchemeData);
}

void GetSchemeName(int nIndex, LPTSTR lpszName, int nLen) // JMC: HACK - You must allocate enough space
{
    _ASSERTE(nIndex < ARRAYSIZE(g_rgSchemeData));
    LoadString(g_hInstDll, g_rgSchemeData[nIndex].nNameStringId, lpszName, nLen);
}

SCHEMEDATALOCAL &GetScheme(int nIndex)
{
    _ASSERTE(nIndex < ARRAYSIZE(g_rgSchemeData));
    return g_rgSchemeData[nIndex];
}

#endif // READSCHEMESFROMREGISTRY

////

////
// Below this point in the file, we have the old way we use
// to enumerate fonts and schemes.

////
//  Old way of enumerating fonts
#ifdef ENUMERATEFONTS

// Global Variables
static ENUMLOGFONTEX g_rgFonts[200]; // JMC: HACK - At Most 200 Fonts
static int g_nFontCount = 0;
static BOOL bFontsAlreadyInit = FALSE;

void Font_Init();

int GetFontCount()
{
    if(!bFontsAlreadyInit)
        Font_Init();
    return g_nFontCount;
}

void GetFontLogFont(int nIndex, LOGFONT *pLogFont)
{
    if(!bFontsAlreadyInit)
        Font_Init();
    *pLogFont = g_rgFonts[nIndex].elfLogFont;
}

int CALLBACK EnumFontFamExProc(
    ENUMLOGFONTEX *lpelfe,    // pointer to logical-font data
    NEWTEXTMETRICEX *lpntme,    // pointer to physical-font data
    int FontType,    // type of font
    LPARAM lParam    // application-defined data
   )
{
    if(g_nFontCount>200)


(fos, "    cpu->reg[op->rm].u32 = cpu->reg[op->reg].u32;");
        } else {
            out(fos, "    U32 address = eaa(cpu, op);");
            out(fos, "    U32 tmp = readd(address);");
            out(fos, "    writed(address, cpu->reg[op->reg].u32);");
        }
        out(fos, "    cpu->reg[op->reg].u32 = tmp;");
        out(fos, "    NEXT();");
        out(fos, "}");

        out(fos_init, "INIT_CPU("+enumName+", "+functionName+")");

        out(fos32, "void dynamic_"+functionName+"(DynamicData* data, DecodedOp* op) {");
        if (reg) {
            out(fos32, "    movToRegFromCpu(DYN_DEST, CPU_OFFSET_OF(reg[op->rm].u32), DYN_32bit);");
            out(fos32, "    movToCpuFromCpu(CPU_OFFSET_OF(reg[op->rm].u32), CPU_OFFSET_OF(reg[op->reg].u32), DYN_32bit, DYN_SRC, true);");
            out(fos32, "    movToCpuFromReg(CPU_OFFSET_OF(reg[op->reg].u32), DYN_DEST, DYN_32bit, true);");
        } else {
            out(fos32, "    calculateEaa(op, DYN_ADDRESS);");
            out(fos32, "    movFromMem(DYN_32bit, DYN_ADDRESS, false);");
            out(fos32, "    movToRegFromCpu(DYN_DEST, CPU_OFFSET_OF(reg[op->reg].u32), DYN_32bit);");
            out(fos32, "    movToCpuFromReg(CPU_OFFSET_OF(reg[op->reg].u32), DYN_CALL_RESULT, DYN_32bit, true);");
            out(fos32, "    movToMemFromReg(DYN_ADDRESS, DYN_DEST, DYN_32bit, true, true);");
        }
        out(fos32, "    INCREMENT_EIP(op->len);");
        out(fos32, "}");
    }

    public void cmpxchg16(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fosOps_h, FileOutputStream fosOps_cpp, FileOutputStream fos32, String functionName, String enumName, boolean address) throws IOException {
        out(fosOps_h, "void common_"+functionName+"(CPU* cpu, "+(address?"U32 address":"U32 dstReg")+", U32 srcReg);");
        out(fosOps_cpp, "void common_"+functionName+"(CPU* cpu, "+(address?"U32 address":"U32 dstReg")+", U32 srcReg){");
        out(fosOps_cpp, "    cpu->dst.u16 = AX;");
        out(fosOps_cpp, "    cpu->src.u16 = "+(address?"readw(address)":"cpu->reg[dstReg].u16")+";");
        out(fosOps_cpp, "    cpu->result.u16 = cpu->dst.u16 - cpu->src.u16;");
        out(fosOps_cpp, "    cpu->lazyFlags = FLAGS_CMP16;");
        out(fosOps_cpp, "    if (AX == cpu->src.u16) {");
        if (address)
            out(fosOps_cpp, "        writew(address, cpu->reg[srcReg].u16);");
        else
            out(fosOps_cpp, "        cpu->reg[dstReg].u16 = cpu->reg[srcReg].u16;");
        out(fosOps_cpp, "    } else {");
        out(fosOps_cpp, "        AX = cpu->src.u16;");
        out(fosOps_cpp, "    }");
        out(fosOps_cpp, "}");

        out(fos, "v


含所有软件包源码地址的目录。为了方便下载，我们需要手动将所有地址更改为使用代理，即

    https://github.com/xxx/xxx

改为

    https://ghproxy.com/https://github.com/xxx/xxx

这一步可以自动替换完成。完成后，从该目录进行init

    wstool init src melodic-desktop-wet.rosinstall

如果出现update complete.说明下载完成。配置正确的话该过程耗时不会超过5分钟。

接下来，安装依赖包

    cd ~/ros_catkin_ws
    rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:buster

如果正确配置镜像源，该过程耗时约30分钟，需要耐心等待。如果出现

    #All required rosdeps installed successfully

说明安装完成。

#### 3.1.4 ROS编译

在编译之前，可以扩展一下交换区，避免内存不足。

    sudo nano /etc/dphys-swapfile

然后编辑 CONF_SWAPSIZE  变量：从100增加到2048

重新启动交换服务:

    sudo /etc/init.d/dphys-swapfile stop
    sudo /etc/init.d/dphys-swapfile start

开始编译！

    sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic

该过程需要1-2h左右，需要耐心等待。

编译成功后，添加ROS环境变量至bash。

    source /opt/ros/melodic/setup.bash
    echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc

一定要记着把交换区设置改回来

    sudo nano /etc/dphys-swapfile

然后编辑 CONF_SWAPSIZE 变量：从2048减小到100

重新启动交换服务:

    sudo /etc/init.d/dphys-swapfile stop
    sudo /etc/init.d/dphys-swapfile start

最后，尝试运行ros_core和rviz，确认安装成功。

    roscore
    rosrun rviz rviz

编译完成后，ros_catkin_ws下的build_isolated和devel_isolated可以打包备份一下，然后删除。

### 3.2 ROS基本知识

#### 3.2.1 catkin工作空间

Catkin工作空间是创建、修改、编译catkin软件包的目录。catkin的工作空间，直观的形容就是一个仓库，里面装载着ROS的各种项目工程，便于系统组织管理调用。

catkin的结构十分清晰，它包括了src、build、devel三个路径，在有些编译选项下也可能包括其他。但这三个文件夹是catkin编译系统默认的。它们的具体作用如下：

+ src/: ROS的catkin软件包（源代码包）
+ build/: catkin（CMake）的缓存信息和中间文件
+ devel/: 生成的目标文件（包括头文件，动态链接库，静态链接库，可执行文件等）、环境变量

#### 3.2.2 软件包

Package不仅是Linux上的软件包，也是catkin


case log := <-it.logs:
		it.Event = new(RewardmanagerAutoClaimEnabled)
		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
			it.fail = err
			return false
		}
		it.Event.Raw = log
		return true

	case err := <-it.sub.Err():
		it.done = true
		it.fail = err
		return it.Next()
	}
}

// Error returns any retrieval or parsing error occurred during filtering.
func (it *RewardmanagerAutoClaimEnabledIterator) Error() error {
	return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *RewardmanagerAutoClaimEnabledIterator) Close() error {
	it.sub.Unsubscribe()
	return nil
}

// RewardmanagerAutoClaimEnabled represents a AutoClaimEnabled event raised by the Rewardmanager contract.
type RewardmanagerAutoClaimEnabled struct {
	Receiver common.Address
	Raw      types.Log // Blockchain specific contextual infos
}

// FilterAutoClaimEnabled is a free log retrieval operation binding the contract event 0xd1f03cfccc13e9f522e155a39beed6bd9b54c9cbb956c81d56f9a0e93d3a09e9.
//
// Solidity: event AutoClaimEnabled(address indexed receiver)
func (_Rewardmanager *RewardmanagerFilterer) FilterAutoClaimEnabled(opts *bind.FilterOpts, receiver []common.Address) (*RewardmanagerAutoClaimEnabledIterator, error) {

	var receiverRule []interface{}
	for _, receiverItem := range receiver {
		receiverRule = append(receiverRule, receiverItem)
	}

	logs, sub, err := _Rewardmanager.contract.FilterLogs(opts, "AutoClaimEnabled", receiverRule)
	if err != nil {
		return nil, err
	}
	return &RewardmanagerAutoClaimEnabledIterator{contract: _Rewardmanager.contract, event: "AutoClaimEnabled", logs: logs, sub: sub}, nil
}

// WatchAutoClaimEnabled is a free log subscription operation binding the contract event 0xd1f03cfccc13e9f522e155a39beed6bd9b54c9cbb956c81d56f9a0e93d3a09e9.
//
// Solidity: event AutoClaimEnabled(address indexed receiver)
func (_Rewardmanager *RewardmanagerFilterer) WatchAutoClaimEnabled(opts *bind.WatchOpts, sink chan<- *RewardmanagerAutoClaimEnabled, receiver []common.Address) (event.Subscription, error) {

	var receiverRule []interface{}
	for _, receiverItem := range receiver {
		receiverRule = append(receiverRule, receiverItem)
	}

	logs, sub, err := _Rewardmanager.contract.WatchLogs(opts, "AutoClaimEnabled", receiverRule)
	if err != nil {
		return nil, err
	}
	return event.NewSubscription(func(quit <-chan struct{}) error {
		defer sub.Unsubscribe()
		for {
			select {
			case log := <-logs:
				// New log arrived, parse the event and forward to the user
				event := new(RewardmanagerAutoClaimEnabled)
				if err := _Rewardmanager.contract.UnpackLog(event, "AutoClaimEnabled", log); err != nil {
					return err
				}
				event.Raw = log

				select {
				case sink <- event:
				case err := <-sub.Err():
					return err
				case <-quit:
					return nil
				}
			case err := <-sub.Err():
				return err
			case <-quit:
				return nil
			}
		}
	}), nil
}

// ParseAutoClaimEnabled is a log parse operation binding the contract event 0xd1f03cfccc13e9f522e155a39beed6bd9b54c9cbb956c81d56f9a0e93d3a09e9.
//
// Solidity: event AutoClaimEnabled(address indexed receiver)
func (_Rewardmanager *RewardmanagerFilterer) ParseAutoClaimEnabled(log types.Log) (*RewardmanagerAutoClaimEnabled, error) {
	event := new(RewardmanagerAutoClaimEnabled)
	if err := _Rewardmanager.contract.UnpackLog(


coroutines.delay
import kotlinx.coroutines.launch
import org.apache.tuweni.devp2p.eth.EthRequestsManager
import org.apache.tuweni.eth.BlockHeader
import org.apache.tuweni.eth.repository.BlockchainRepository
import org.apache.tuweni.ethclient.EthereumPeerRepository
import org.apache.tuweni.units.bigints.UInt256
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import kotlin.coroutines.CoroutineContext

const val BEST_PEER_DELAY: Long = 5000
const val HEADERS_RESPONSE_TIMEOUT: Long = 10000

/**
 * This synchronizer strategy will use the best known header, and keep asking new block headers
 * from there, until the response comes back with just one header.
 */
class FromBestBlockHeaderSynchronizer(
  executor: ExecutorService = Executors.newSingleThreadExecutor(),
  coroutineContext: CoroutineContext = executor.asCoroutineDispatcher(),
  repository: BlockchainRepository,
  client: EthRequestsManager,
  peerRepository: EthereumPeerRepository,
  from: UInt256?,
  to: UInt256?
) : Synchronizer(executor, coroutineContext, repository, client, peerRepository, from, to) {

  override fun start() {
    launch {
      repository.indexing = false
      delay(BEST_PEER_DELAY)
      askNextBestHeaders(repository.retrieveChainHeadHeader())
    }
  }

  override fun stop() {
    executor.shutdown()
  }

  private fun askNextBestHeaders(header: BlockHeader) {
    if ((null != from && header.number < from) || (null != to && header.number > to)) {
      return
    }
    launch {
      if (peerRepository.activeConnections().count() == 0L) {
        askNextBestHeaders(header)
        return@launch
      }
      logger.info("Request headers away from best known header ${header.number.toLong()} ${header.hash}")
      var replied = false
      client.requestBlockHeaders(header.hash, HEADER_REQUEST_SIZE, 0L, false).thenAccept { headers ->
        replied = true
        addHeaders(headers)
        if (headers.size > 1) {
          askNextBestHeaders(headers.last())
        } else {
          logger.info("Done requesting headers")
          launch {
            repository.indexing = true
            repository.reIndexTotalDifficulty()
          }
        }
      }
      delay(HEADERS_RESPONSE_TIMEOUT)
      if (!replied) {
        askNextBestHeaders(header)
      }
    }
  }
}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.tuweni.eth.precompiles

import com.sun.jna.ptr.IntByReference
import org.apache.tuweni.bytes.Bytes
import org.apache.tuweni.bytes.Bytes32
import org.apache.tuweni.bytes.Muta


month_string = "June";
        break;
        case 6:
        this.month_string = "July";
        break;
        case 7:
        this.month_string = "August";
        break;
        case 8:
        this.month_string = "September";
        break;
        case 9:
        this.month_string = "October";
        break;
        case 10:
        this.month_string = "November";
        break;
        case 11:
        this.month_string = "December";
        break;
    }
  }

  setDayOfWeek(x:number):void {
    switch(x){
      case 0:
        this.day_of_week = "Sunday";
        break;
        case 1:
        this.day_of_week = "Monday";
        break;
        case 2:
        this.day_of_week = "Tuesday";
        break;
        case 3:
        this.day_of_week = "Wednesday";
        break;
        case 4:
        this.day_of_week = "Thursday";
        break;
        case 5:
        this.day_of_week = "Friday";
        break;
        case 6:
        this.day_of_week = "Saturday";
        break;
    }
  }
}
import * as vscode from 'vscode';
import { AZSymbolInformation } from '../../symbollibraries/azSymbolInformation';
import { AZSymbolKind } from '../../symbollibraries/azSymbolKind';
import { ALSymbolsBasedWizard } from './alSymbolsBasedWizard';
import { FileBuilder } from '../fileBuilder';
import { ALSyntaxWriter } from '../../allanguage/alSyntaxWriter';
import { DevToolsExtensionContext } from '../../devToolsExtensionContext';

export class ALSymbolsBasedPageWizard extends ALSymbolsBasedWizard {

    constructor(context: DevToolsExtensionContext) {
        super(context);
    }

    //#region Wizards with UI

    async showWizard(tableSymbols: AZSymbolInformation[], pageType: string) {
        if (tableSymbols.length == 1)
            await this.showPageWizard(tableSymbols[0], pageType);
        else
            await this.showMultiPageWizard(tableSymbols, pageType);
    }

    async showMultiPageWizard(tableSymbols: AZSymbolInformation[], pageType: string) {
        if (!FileBuilder.checkCrsExtensionFileNamePatternRequired())
            return;

        const objType : AZSymbolKind = AZSymbolKind.PageObject;
        let relativeFileDir: string | undefined = await this.getRelativeFileDir(objType);

        let startObjectId: number = await this.getObjectId(relativeFileDir, "page", `Please enter a starting ID for the ${pageType} pages.`, 0);
        if (startObjectId < 0) {
            return;
        }

        for (let i = 0; i < tableSymbols.length; i++) {
            let tableSymbol = tableSymbols[i];
            let objectId: number = startObjectId + i;
            let objectName : string = this.getDefaultPageName(tableSymbol, pageType);

            await this.createAndShowNewPage(tableSymbol, objType, objectId, objectName, pageType, relativeFileDir);
        }
    }

    async showPageWizard(tableSymbol : AZSymbolInformation, pageType: string) {
        if (!FileBuilder.checkCrsFileNamePatternRequired())
            return;

        const objType : AZSymbolKind = AZSymbolKind.PageObject;
        let relativeFileDir = await this.getRelativeFileDir(objType);

        let objectId : number = await this.getObjectId(relativeFileDir, "page", `Please enter an ID for the ${pageType} page.`, 0);
        if (objectId < 0) {
            return;
        }

        let objectName : string | undefined = this.getDefaultPageName(tableSymbol, pageType);
        objectName = await this.getObjectName(`Please enter a name for the ${pageType} page.`, objectName);

        if (!objectName) {
            return;
        }

        await this.createAndShowNewPage(tableSymbol, objType, objectId, objectName, pageType, relativeFileDir);
    }

    private async createAndShowNewPage(tableSymbol: AZSymbolInforma


 in storage
 */

export async function setChunk(data: IWorldChunkLoad) {
	const height = data.height > 0 ? data.height : 1;

	if (data.compressed) {
		// Decompress
		let x = 32 * 32 * 32 * height;
		data.data = await inflate(data.data, x);
	}

	let array = new Uint16Array(data.data.buffer, data.data.byteOffset);

	// Creates chunk, used for breaking it into 32x32x32 ones
	const chunk = new ndarray(array, [32, 32 * height, 32]);

	for (var yoff = 0; yoff < height; yoff++) {
		const noaChunk = new ndarray(new Uint16Array(32 * 32 * 32), [32, 32, 32]);

		const localID = [data.x, data.y + yoff, data.z].join('|');

		for (let x = 0; x < 32; x++) {
			for (let z = 0; z < 32; z++) {
				for (let y = 0; y < 32; y++) {
					const block = chunk.get(x, y + yoff * 32, z);
					noaChunk.set(x, y, z, block);
				}
			}
		}
		const a = new Uint8Array(32 * 32 * 32);
		const lightChunk = new ndarray(a.fill(100, 0, a.length), [32, 32, 32]);
		const sc: StoredChunk = { chunk: noaChunk, light: lightChunk };

		event.emit(`load`, [data.x, data.y + yoff, data.z], sc);
		chunkStorage[localID] = sc;
	}
}

/*
 * Removes chunk from storage
 */
export function removeChunk(id: string) {
	delete chunkStorage[id];
}

/*
 * Returns chunk (if exist) or null
 */

export function getChunkSync(id: string): StoredChunk | null {
	if (chunkStorage[id] != undefined && chunkStorage[id].chunk != null && chunkStorage[id].light != null) {
		return {
			chunk: new ndarray(chunkStorage[id].chunk.data.subarray(0), [...chunkStorage[id].chunk.shape]),
			light: new ndarray(chunkStorage[id].light.data.subarray(0), [...chunkStorage[id].light.shape]),
		};
	} else return null;
}

/*
 * Checks if chunk exist
 */

export function chunkExist(id) {
	return chunkStorage[id] != undefined;
}

/*
 * Sets blocks in chunks
 */

export function chunkSetBlock(id: number, x: number, y: number, z: number, light: number) {
	const cid = [Math.floor(x / 32), Math.floor(y / 32), Math.floor(z / 32)].join('|');

	if (chunkStorage[cid] == undefined) return;

	let xl = x % 32;
	let yl = y % 32;
	let zl = z % 32;

	if (xl < 0) xl = xl + 32;
	if (yl < 0) yl = yl + 32;
	if (zl < 0) zl = zl + 32;

	chunkStorage[cid].chunk.set(xl, yl, zl, id);
	chunkStorage[cid].light.set(xl, yl, zl, light);
}

/*
 * Removes all stored chunks
 */

export function clearStorage() {
	chunkStorage = {};
}

/*
 * Setups noa for chunk loading
 */

export function setupWorld(noa) {
	noa.world.on('worldDataNeeded', async (id: string) => {
		const ida = id.split('|');

		const chunk = getChunkSync(`${ida[0]}|${ida[1]}|${ida[2]}`);
		if (chunk != null) {
			noa.world.setChunkData(id, chunk.chunk, {}, chunk.light