/*
 *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
 *
 *  Copyright (c) 1997-2024 ircd-hybrid development team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 *  USA
 */

#ifndef INCLUDED_nuh_h
#define INCLUDED_nuh_h
#include <stddef.h>

/**
 * @struct nuh_split
 * @brief Represents the parsed components of an IRC `nick!user@host` mask.
 *
 * The nuh_split structure is used to store the components of an IRC mask
 * after parsing. It contains pointers to the nickname, username, and hostname,
 * as well as the sizes of the respective buffers.
 */
struct nuh_split
{
  char *nuhmask;  /**< The input IRC mask string to be parsed (e.g., "nick!user@host"). */
  char *nickptr;  /**< Pointer to the buffer for storing the parsed nickname. */
  char *userptr;  /**< Pointer to the buffer for storing the parsed username. */
  char *hostptr;  /**< Pointer to the buffer for storing the parsed hostname. */

  size_t nicksize;  /**< Size of the buffer for the nickname. */
  size_t usersize;  /**< Size of the buffer for the username. */
  size_t hostsize;  /**< Size of the buffer for the hostname. */
};

extern void nuh_split(struct nuh_split *const);
#endif  /* INCLUDED_nuh_h */


byte {
	i++
	return 'a' + i - 1
}
func gint() byte {
	i++
	return i - 1
}
func x() (byte, byte) {
	i++
	return 'a' + i - 1, 'a' + i - 1
}
func e1(c chan byte, expected byte) chan byte {
	if i != expected {
		println("e1: got", i, "expected", expected)
		panic("fail")
	}
	i++
	return c
}

type Empty interface{}
type I interface {
	Get() byte
}
type S1 struct {
	i byte
}

func (p S1) Get() byte { return p.i }

type S2 struct {
	i byte
}

func e2(p Empty, expected byte) Empty {
	if i != expected {
		println("e2: got", i, "expected", expected)
		panic("fail")
	}
	i++
	return p
}
func e3(p *I, expected byte) *I {
	if i != expected {
		println("e3: got", i, "expected", expected)
		panic("fail")
	}
	i++
	return p
}

func main() {
	for i := range a {
		a[i] = ' '
	}

	// 0     1     2     3        4        5
	*f(), *f(), *f() = gbyte(), gbyte(), gbyte()

	// 6     7     8
	*f(), *f() = x()

	m := make(map[byte]byte)
	m[10] = 'A'
	var p1, p2 bool
	// 9           10
	*f(), p1 = m[gint()]
	// 11          12
	*f(), p2 = m[gint()]
	a[11] += '0'
	if !p1 || p2 {
		println("bad map check", i, p1, p2)
		panic("fail")
	}

	m[13] = 'B'
	//  13        14
	delete(m, gint())
	gbyte()
	if _, present := m[13]; present {
		println("bad map removal")
		panic("fail")
	}

	c := make(chan byte, 1)
	c <- 'C'
	// 15          16
	*f(), p1 = <-e1(c, 16)
	close(c)
	// 17          18
	*f(), p2 = <-e1(c, 18)
	a[17] += '0'
	if !p1 || p2 {
		println("bad chan check", i, p1, p2)
		panic("fail")
	}

	s1 := S1{'D'}
	s2 := S2{'E'}
	var iv I
	// 19                20
	*e3(&iv, 19), p1 = e2(s1, 20).(I)
	// 21                22
	*e3(&iv, 21), p2 = e2(s2, 22).(I)
	if !p1 || p2 {
		println("bad interface check", i, p1, p2)
		panic("fail")
	}

	s := string(a[0:i])
	if s != "def   ii A 0   C 0     " {
		println("bad array results:", s)
		panic("fail")
	}
}
// run

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Issue 7044: bad AMOVFD and AMOVDF assembly generation on
// arm for registers above 7.

package main

import (
	"fmt"
	"reflect"
)

func f() [16]float32 {
	f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15 :=
		float32(1), float32(1), float32(1), float32(1), float32(1), float32(1), float32(1), float32(1),


self);
        }
    }

    private onRequestFlop(e:egret.Event) {
        let index = e.data;
        this.flop(index);
    }

    /**
     * 投降
     */
    public surrender() {

    }

    // 未翻开的棋子数量
    getClosedCount() {
        let count = 0;
        for (let i = 0, len = this.chessboard.length; i < len; i++) {
            let obj = this.getChess(i);
            if (obj && !obj.open) {
                count++;
            }
        }
        return count;
    }

    // 是否在范围内
    inAreaByXY(x:number, y:number) {
        return x >= 0 && x < 4 && y >= 0 && y < 8;
    }

    // 是否在范围内
    inArea(index:number) {
        return index >= 0 && index < 32;
    }

    // 获取棋盘上的棋子
    getChess(index:number) {
        return this.chessboard[index];
    }

    // 获取棋盘上的棋子
    getChessByXY(x:number, y:number) {
        let index = y * this.col + x;
        return this.getChess(index);
    }

    // 棋盘上位置是否为空
    isEmpty(index:number) {
        return this.chessboard[index] == null;
    }
}import { User } from "../../Types/User";

import { EmptyEmailError, EmptyPasswordError } from "./errors"

export default function validation({ email, password }: User) {
    if (email === "") {
        throw new EmptyEmailError()
    }
    if (password === "") {
        throw new EmptyPasswordError()
    }
}export class FizzBuzzMaker {
  createAFizzBuzz(listlength: number) {
    let listfizzbuzz: string[] = []

    for (let i = 1; i <= listlength; i++) {
      listfizzbuzz = this.addFizzBuzz(i, listfizzbuzz)
    }
    return listfizzbuzz
  }

  private addFizzBuzz(value: number, listfizzbuzz: string[]) {
    let copy = [...listfizzbuzz]

    let option = this.getCase(value)

    switch (option) {
      case 'divBy15':
        copy.push('FizzBuzz')
        break

      case 'divBy3':
        copy.push('Fizz')
        break

      case 'divBy5':
        copy.push('Buzz')
        break
      default:
        copy.push(value.toString())
        break
    }

    return copy
  }

  getCase(value: number) {
    let res = ''

    let isdivBy3 = !(value % 3)
    let isdivBy5 = !(value % 5)
    let isdivBy3N5 = isdivBy3 && isdivBy5

    if (isdivBy3N5) {
      res = 'divBy15'
    }
    if ((isdivBy5 || isdivBy3) && !isdivBy3N5) {
      res = isdivBy5 ? 'divBy5' : 'divBy3'
    }

    return res
  }
}
declare module "parenthesis" {
    namespace parens {
        // One entry in the returned nested array
        type Node = string | ArrayTree;
        // A nested array of strings
        interface ArrayTree extends Array<Node> {}
        // Second-argument options used by the function
        interface Opts {
            // Single brackets string or list of strings to detect brackets. Can be repeating brackets eg. "" or ''.
            brackets?: string | string[],
            // Escape prefix for flat references.
            escape?: string,
            // `flat` is a boolean but since it affects return type, it's explicitly specified below
        }

        // Parse parentheses from a string, return folded arrays
        function parse(
            str: string,
            opts?: string | string[] | (parens.Opts & { flat?: false })
        ): pa


SAC.get(), StorageSacRenderer::new);
		event.registerBlockEntityRenderer(ModBlockEntities.MAW_HOPPER.get(), MawHopperRenderer::new);

		event.registerEntityRenderer(ModEntityTypes.HUNGRY_FLESH_BLOB.get(), FleshBlobRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.FLESH_BLOB.get(), FleshBlobRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.LEGACY_FLESH_BLOB.get(), LegacyFleshBlobRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.PRIMORDIAL_FLESH_BLOB.get(), PrimordialFleshBlobRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.PRIMORDIAL_HUNGRY_FLESH_BLOB.get(), PrimordialFleshBlobRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.FLESH_COW.get(), FleshCowRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.FLESH_SHEEP.get(), FleshSheepRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.FLESH_PIG.get(), FleshPigRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.FLESH_CHICKEN.get(), FleshChickenRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.CHROMA_SHEEP.get(), ChromaSheepRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.THICK_FUR_SHEEP.get(), ThickFurSheepRenderer::new);

		event.registerEntityRenderer(ModEntityTypes.CORROSIVE_ACID_PROJECTILE.get(), AcidProjectileRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.TOOTH_PROJECTILE.get(), ThrownItemRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.BLOOMBERRY_PROJECTILE.get(), BloomberryProjectileRenderer::new);
		event.registerEntityRenderer(ModEntityTypes.ACID_BLOB_PROJECTILE.get(), AcidBlobProjectileRenderer::new);
	}

	@SuppressWarnings("removal")
	private static void setBlockRenderLayers() {
		ItemBlockRenderTypes.setRenderLayer(ModBlocks.FLESH_IRIS_DOOR.get(), RenderType.cutout());
		ItemBlockRenderTypes.setRenderLayer(ModBlocks.FLESH_DOOR.get(), RenderType.cutout());
		ItemBlockRenderTypes.setRenderLayer(ModBlocks.FULL_FLESH_DOOR.get(), RenderType.cutout());

		ItemBlockRenderTypes.setRenderLayer(ModFluids.ACID.get(), RenderType.translucent());
		ItemBlockRenderTypes.setRenderLayer(ModFluids.FLOWING_ACID.get(), RenderType.translucent());

		//block with "glowing" overlay texture, also needs a overlay model see onModelBakeEvent() in ClientSetupHandler
		//ItemBlockRenderTypes.setRenderLayer(ModBlocks.FOOBAR.get(), renderType -> renderType == RenderType.getCutout() || renderType == RenderType.getTranslucent());
	}

	@SubscribeEvent
	public static void registerParticles(final RegisterParticleProvidersEvent event) {
		event.registerSpriteSet(ModParticleTypes.BLOODY_CLAWS_ATTACK.get(), AttackSweepParticle.Provider::new);
		event.registerSpriteSet(ModParticleTypes.FALLING_BLOOD.get(), BloodDripParticle.FallingBloodFactory::new);
		event.registerSpriteSet(ModParticleTypes.LANDING_BLOOD.get(), BloodDripParticle.LandingBloodFactory::new);
		event.registerSpriteSet(ModParticleTypes.CORROSIVE_SWIPE_ATTACK.get(), AttackSweepParticle.Provider::new);
		event.registerSpriteSet(ModParticleTypes.DRIPPING_ACID.get(), ParticleProviders.AcidHangProvider::new);
		event.registerSpriteSet(ModParticleTypes.FALLING_AC


于14字符的密码的格式一样。缺少salt意味着任何需要密钥的操作能够直接地使用密码的散列版本，而不是使用实际的密码。这听上去像大家耳熟能详的“pass-the-hash”攻击的根本原因。

从一个攻击者的角度出发，如果能够提取该域的密码散列值，也就可以利用KRBTGT散列值来伪造TGT。虽然提取散列值看似难以实现，然而实际上，大部分渗透人员认为在普通的企业环境中这并不是一件困难的事情。我们会在白皮书下面的一个章节中作全面深入的解析。

利用思路

在微软活动目录中颁发的TGT是可移植的。由于Kerberos的无状态特性，TGT中并没有关于票据来源的标识信息。这意味着可以从某台计算机上导出一个有效的TGT，然后导入到该环境中其他的计算机上。新导入的票据可以用于域的身份认证，并拥有票据中指定用户的权限来访问网络资源。这种特别的攻击方法被称为“pass-the-ticket”攻击。

Pass-The-Tickets攻击思路

2. 问题二：长期不变的密码

krbtgt 密码的另一个问题是：它是整个活动目录中唯一的不会自动更新的密码。查看几个活跃网络中KRBTGT账户的年龄，账户已有五年或更多没更改密码的情况并不少见。在下面的例子中，此krbtgt密码是最后设置于2005年4月。

<img src="http://image.3001.net/images/20140930/14120877849667.jpg!small" title="QQ截图20140930223504.jp


Result.Failure, message: QueueMessage.ExecutorMessage) {
    val updatedMessage = message.copy(maxFailureRetry = message.maxFailureRetry - 1)
    if (message.maxFailureRetry <= 0) {
      queueClient.push(updatedMessage, QueueType.DEAD_LETTER)
      logger.error("[MESSAGE PUSHED TO DLQ] --- max retry exceeded | result : $result")

    } else {
      queueClient.push(updatedMessage)
      logger.warn("[ACTION FAILED | RETRYING (${updatedMessage.maxFailureRetry})] --- result : ${result.reason}")
    }
    tasksRepo.updateStatus(message.taskId, TaskStatus.FAILURE, Instant.ofEpochMilli(result.timestamp))
    pushErrorLog(message, result)
    MetricsManager.taskFailedExecutionCount.inc()
  }

  /**
   * Pushes an error log to the repository.
   *
   * @param message The message containing task details.
   * @param result The failed executor result.
   */
  private suspend fun pushErrorLog(message: QueueMessage.ExecutorMessage, result: ExecutorResult.Failure) = ErrorLog(
    planId = message.planId,
    error = result.reason,
    type = ErrorLogType.ExecutorErrorLog(taskId = message.taskId),
    timestamp = result.timestamp
  ).let { errorLogsRepo.push(it) }

  /**
   * Measures and records the latency of the task execution.
   *
   * @param startTime The time at which the task was started.
   */
  private fun measureAndRecordMarkTaskComplete(startTime: Instant) {
    val taskMarkedCompletedAt = Instant.now()
    val latency = Duration.between(startTime, taskMarkedCompletedAt).toMillis()
    MetricsManager.taskExecutionLatencySummary.observe(latency.toDouble())
  }
}
package karya.docs.samples

import karya.client.configs.KaryaClientConfig
import karya.client.di.KaryaClientFactory
import karya.core.entities.Action
import karya.core.entities.Hook
import karya.core.entities.PlanType
import karya.core.entities.enums.Trigger
import karya.core.entities.requests.CreateUserRequest
import karya.core.entities.requests.SubmitPlanRequest

/**
 * Main function to demonstrate making a delay API call with a completion hook.
 */
suspend fun main() {
  // Create a Karya client instance using the development configuration
  val client = KaryaClientFactory.create(KaryaClientConfig.Dev)
  // Create a new user with the name "Jinx"
  val user = client.createUser(CreateUserRequest("Jinx"))

  // Define a completion hook that triggers on completion and makes a REST API request
  val completionHook = Hook(
    trigger = Trigger.ON_COMPLETION,
    action = Action.RestApiRequest(baseUrl = "http://localhost:35423"),
    maxRetry = 1
  )

  // Create a plan request with a delay API call and the defined completion hook
  val planRequest = SubmitPlanRequest(
    userId = user.id,
    description = "Delay API call with completion hook",
    periodTime = "PT15S",
    planType = PlanType.OneTime,
    action = Action.RestApiRequest(
      baseUrl = "eox7wbcodh9parh.m.pipedream.net",
    ),
    hooks = listOf(
      completionHook
    )
  )

  // Submit the plan request and print the result
  client.submitPlan(planRequest).also { plan -> println(plan) }

  // Close the client
  client.close()
}
package karya.data.psql.repos.tasks

import karya.core.entities.Task
import karya.core.entities.enums.TaskStatus
import karya.core.repos.TasksRepo
import karya.core.repos.entitie


--
-- =====================================================================================
--
--  OpenMiner
--
--  Copyright (C) 2018-2020 Unarelith, Quentin Bazin <openminer@unarelith.net>
--  Copyright (C) 2019-2020 the OpenMiner contributors (see CONTRIBUTORS.md)
--
--  This file is part of OpenMiner.
--
--  OpenMiner is free software; you can redistribute it and/or
--  modify it under the terms of the GNU Lesser General Public
--  License as published by the Free Software Foundation; either
--  version 2.1 of the License, or (at your option) any later version.
--
--  OpenMiner 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
--  Lesser General Public License for more details.
--
--  You should have received a copy of the GNU Lesser General Public License
--  along with OpenMiner; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
--
-- =====================================================================================
--

mod:block {
	id = "dirt",
	name = "Dirt",
	tiles = "dirt.png",
	groups = {
		om_material_dirt = 1,
	},
}

mod:block {
	id = "cobblestone",
	name = "Cobblestone",
	tiles = "cobblestone.png",

	hardness = 2,
	harvest_requirements = Capability.Pickaxe,
}

mod:block {
	id = "grass",
	name = "Grass",
	tiles = {"grass_block_top.png", "dirt.png", "grass_block_side.png"},
	color_multiplier = {129, 191, 91, 255},
	groups = {
		om_material_dirt = 1,
	},

	item_drop = {
		id = mod:id()..":dirt",
		amount = 1
	}
}

mod:block {
	id = "oak_leaves",
	name = "Oak Leaves",
	tiles = "oak_leaves.png",
	color_multiplier = {106, 173, 51, 255},
	hardness = 0,
	draw_type = "leaves",
	-- is_opaque = false, -- FIXME
}

mod:block {
	id = "oak_wood",
	name = "Oak Wood",
	tiles = {"oak_log_top.png", "oak_log.png"},
	groups = {
		om_material_wood = 1,
	}
}

mod:block {
	id = "stone",
	name = "Stone",
	tiles = "stone.png",
	hardness = 1.5,
	harvest_requirements = Capability.Pickaxe,
	item_drop = {
		id = mod:id()..":cobblestone",
		amount = 1
	},
}

mod:block {
	id = "sand",
	name = "Sand",
	tiles = "sand.png",
	groups = {
		om_material_sand = 1
	}
}

mod:block {
	id = "water",
	name = "Water",

	tiles = "water.png",
	color_multiplier = {51, 115, 255, 217},

	draw_type = "liquid",
	is_opaque = false,

	fog_depth = 20.0,
	fog_color = {0


 encryptedMsg = encrypt(m,e,n);
    string  decryptedMsg = decrypt(encryptedMsg,d,n);
    cout<<"Encrypted Message - ";
    for(int i=0;i<encryptedMsg.size();i++)
    {
        cout<<long(encryptedMsg[i])<<" ";
    }
    cout<<endl;
    cout<<"Decrypted Message - "<<decryptedMsg<<endl;
    return 0;

}
// 2018331045 - 2018331057
#include <bits/stdc++.h>
using namespace std;

string message;

struct char_freq
{
    char ch;
    int cnt;
    double per;
};

bool cmp(char_freq a, char_freq b)
{
    return (a.per > b.per);
}

void char_substitution(char prev, char cur)
{
    int n, i;
    n = message.size();
    for (i = 0; i < n; i++)
    {
        if (message[i] == prev)
            message[i] = cur;
    }
    return;
}

int main()
{
    int n, i, j, idx;
    int frequency[27];
    char_freq char_frequency[27];

    double x, y, z, per, freq;
    string cipher;
    char ch;
    cipher = "af p xpkcaqvnpk pfg, af ipqe qpri, gauuikifc tpw, ceiri udvk tiki afgarxifrphni cd eaowvmd popkwn, hiqpvri du ear jvaql vfgikrcpfgafm du cei xkafqaxnir du xrwqedearcdkw pfg du ear aopmafpcasi xkdhafmr afcd fit pkipr. ac tpr qdoudkcafm cd lfdt cepc au pfwceafm epxxifig cd ringdf eaorinu hiudki cei opceiopcaqr du cei uaing qdvng hi qdoxnicinw tdklig dvcpfg edt rndtnw ac xkdqiigig, pfg edt odvfcpafdvr cei dhrcpqnirceiki tdvng pc niprc kiopaf dfi mddg oafg cepc tdvng qdfcafvi cei kiripkqe";

    n = cipher.size();

    cout << cipher << "\n";
    cout << n << "\n";

    memset(frequency, 0, sizeof(frequency));
    int cnt = 0;
    for (i = 0; i < n; i++)
    {
        if (cipher[i] >= 'a' && cipher[i] <= 'z')
        {
            idx = cipher[i] - 'a';
            frequency[idx] += 1;
            cnt++;
        }
    }

    cout << cnt << "\n\n";
    y = (double)cnt;

    for (i = 0; i < 26; i++)
    {
        ch = 'a' + i;
        x = (double)frequency[i];
        per = (x / y) * 100.0;
        char_frequency[i].ch = ch;
        char_frequency[i].cnt = frequency[i];
        char_frequency[i].per = per;
    }

    cout << "--------- " << "\n";
    sort(char_frequency, char_frequency + 26, cmp);
    for (i = 0; i < 26; i++)
    {

        ch = char_frequency[i].ch;
        freq = char_frequency[i].cnt;
        per = char_frequency[i].per;

        cout << ch << "    " << freq << "    " << per << "\n";
    }

    // Initial mapping based on frequency distribution
    cout << "


r a 100-continue response. This parameter
                        expects a value of type java.lang.Integer. If this
                        parameter is not set HttpClient will wait 3 seconds for a confirmation
                        before resuming the transmission of the request body.

Prev 	 	 Next

Preface 	Home	 Chapter 2. Connection management

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
CookieRestrictionViolationException (HttpComponents Client 4.3-alpha1 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.http.cookie.CookieRestrictionViolationException class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 <A HREF="../../../../org/apache/http/cookie/CookiePathComparator.html" title="class in org.apache


es/@angular/material/fesm2022/core.mjs
var import_rxjs5 = __toESM(require_cjs(), 1);
var import_operators4 = __toESM(require_operators(), 1);
var _c0 = ["*", [["mat-option"], ["ng-container"]]];
var _c1 = ["*", "mat-option, ng-container"];
var _c2 = ["text"];
var _c3 = [[["mat-icon"]], "*"];
var _c4 = ["mat-icon", "*"];
function MatOption_Conditional_0_Template(rf, ctx) {
  if (rf & 1) {
    ɵɵelement(0, "mat-pseudo-checkbox", 1);
  }
  if (rf & 2) {
    const ctx_r0 = ɵɵnextContext();
    ɵɵproperty("disabled", ctx_r0.disabled)("state", ctx_r0.selected ? "checked" : "unchecked");
  }
}
function MatOption_Conditional_5_Template(rf, ctx) {
  if (rf & 1) {
    ɵɵelement(0, "mat-pseudo-checkbox", 3);
  }
  if (rf & 2) {
    const ctx_r0 = ɵɵnextContext();
    ɵɵproperty("disabled", ctx_r0.disabled);
  }
}
function MatOption_Conditional_6_Template(rf, ctx) {
  if (rf & 1) {
    ɵɵelementStart(0, "span", 4);
    ɵɵtext(1);
    ɵɵelementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = ɵɵnextContext();
    ɵɵadvance();
    ɵɵtextInterpolate1("(", ctx_r0.group.label, ")");
  }
}
var _c5 = ["mat-internal-form-field", ""];
var _c6 = ["*"];
var VERSION2 = new Version("18.2.0");
var _AnimationCurves = class _AnimationCurves {
};
_AnimationCurves.STANDARD_CURVE = "cubic-bezier(0.4,0.0,0.2,1)";
_AnimationCurves.DECELERATION_CURVE = "cubic-bezier(0.0,0.0,0.2,1)";
_AnimationCurves.ACCELERATION_CURVE = "cubic-bezier(0.4,0.0,1,1)";
_AnimationCurves.SHARP_CURVE = "cubic-bezier(0.4,0.0,0.6,1)";
var AnimationCurves = _AnimationCurves;
var _AnimationDurations = class _AnimationDurations {
};
_AnimationDurations.COMPLEX = "375ms";
_AnimationDurations.ENTERING = "225ms";
_AnimationDurations.EXITING = "195ms";
var AnimationDurations = _AnimationDurations;
function MATERIAL_SANITY_CHECKS_FACTORY() {
  return true;
}
var MATERIAL_SANITY_CHECKS = new InjectionToken("mat-sanity-checks", {
  providedIn: "root",
  factory: MATERIAL_SANITY_CHECKS_FACTORY
});
var _MatCommonModule = class _MatCommonModule {
  constructor(highContrastModeDetector, _sanityChecks, _document) {
    this._sanityChecks = _sanityChecks;
    this._document = _document;
    this._hasDoneGlobalChecks = false;
    highContrastModeDetector._applyBodyHighContrastModeCssClasses();
    if (!this._hasDoneGlobalChecks) {
      this._hasDoneGlobalChecks = true;
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        const platform = inject(Platform, {
          optional: true
        });
        if (this._checkIsEnabled("doctype")) {
          _checkDoctypeIsDefined(this._document);
        }
        if (this._checkIsEnabled("theme")) {
          _checkThemeIsPresent(this._document, !!platform?.isBrowser);
        }


// Skip usage tracking for ollama as it's not in models.dev
		if provider != "ollama" {
			registry := models.GetGlobalRegistry()
			if modelInfo, err := registry.ValidateModel(provider, model); err == nil {
				// Check if OAuth credentials are being used for Anthropic models
				isOAuth := false
				if provider == "anthropic" {
					_, source, err := auth.GetAnthropicAPIKey(opts.ProviderAPIKey)
					if err == nil && strings.HasPrefix(source, "stored OAuth") {
						isOAuth = true
					}
				}

				usageTracker := NewUsageTracker(modelInfo, provider, 80, isOAuth) // Will be updated with actual width
				cli.SetUsageTracker(usageTracker)
			}
		}
	}

	fmt.Println("")

	// Display model info
	if provider != "unknown" && model != "unknown" {
		cli.DisplayInfo(fmt.Sprintf("Model loaded: %s (%s)", provider, model))
	}

	// Display loading message if available (e.g., GPU fallback info)
	if loadingMessage := opts.Agent.GetLoadingMessage(); loadingMessage != "" {
		cli.DisplayInfo(loadingMessage)
	}

	// Display tool count
	tools := opts.Agent.GetTools()
	cli.DisplayInfo(fmt.Sprintf("Loaded %d tools from MCP servers", len(tools)))

	// Display usage information (for both streaming and non-streaming)
	if !opts.Quiet && cli != nil {
		cli.DisplayUsageAfterResponse()
	}

	return cli, nil
}
package ui

import (
	"testing"

	"github.com/mark3labs/mcphost/internal/models"
)

func TestUsageTracker_OAuthCosts(t *testing.T) {
	// Create a mock model info with costs
	modelInfo := &models.ModelInfo{
		ID:   "claude-3-5-sonnet-20241022",
		Name: "Claude 3.5 Sonnet v2",
		Cost: models.Cost{
			Input:  3.0,
			Output: 15.0,
		},
	}

	// Test with regular API key (costs should be calculated)
	regularTracker := NewUsageTracker(modelInfo, "anthropic", 80, false)
	regularTracker.UpdateUsage(1000, 500, 0, 0) // 1000 input, 500 output tokens

	stats := regularTracker.GetLastRequestStats()
	if stats == nil {
		t.Fatal("Expected stats to be non-nil")
	}

	// Check that costs are calculated for regular API key
	expectedInputCost := float64(1000) * 3.0 / 1000000          // $0.003
	expectedOutputCost := float64(500) * 15.0 / 1000000         // $0.0075
	expectedTotalCost := expectedInputCost + expectedOutputCost // $0.0105

	if stats.InputCost != expectedInputCost {
		t.Errorf("Expected input cost %f, got %f", expectedInputCost, stats.InputCost)
	}
	if stats.OutputCost != expectedOutputCost {
		t.Errorf("Expected output cost %f, got %f", expectedOutputCost, stats.OutputCost)
	}
	if stats.TotalCost != expectedTotalCost {
		t.Errorf("Expected total cost %f, got %f", expectedTotalCost, stats.TotalCost)
	}

	// Test with OAuth credentials (costs should be $0)
	oauthTracker := NewUsageTracker(modelInfo, "anthropic", 80, true)
	oauthTracker.UpdateUsage(1000, 500, 0, 0) // Same token usage

	oauthStats := oauthTracker.GetLastRequestStats()
	if oauthStats == nil {
		t.Fatal("Expected OAuth stats to be non-nil")
	}

	// Check that all costs are $0 for OAuth
	if oauthStats.InputCost != 0.0 {
		t.Errorf("Expected OAuth input cost to be $0, got %f", oauthStats.InputCost)
	}
	if oauthStats.OutputCost != 0.0 {
		t.Errorf("Expected OAuth


opment activities in the Occupied Palestinian Territory is also from Nambour.[38]

Mike Chapman, an Australian record producer and songwriter who was a major force in the British pop music industry in the 1970s was born in Nambour in 1947.

Daniel Keighran was born in Nambour in 1983. In 2012, he was awarded Australia's military highest honour, the Victoria Cross for Australia for bravery during the Battle of Derapet in Afghanistan in 2010.

Education

Nambour Special School is located on Windsor Drive and is for children aged 5 to 18 years.[39]

The following primary schools are in, or near to, Nambour:

Nambour State School is located on Coronation Avenue.[40]

Burnside State School is located on Blaxland Road.[41]

Blackall Range Independent School is located on Mapleton Road, Kureelpa.[42]

St Joseph's Primary School is located on Currie Street.[43]

The following secondary schools are in, or near to, Nambour:

Nambour State High School is located on Carroll Street.[44]

Burnside State High School is located on Blaxland Road.[45]

St John's College is located on Perwillowen Road.[46]

Nambour Christian College is located on McKenzie Road, Woombye.[47]

Suncoast Christian College is located on the corner of Schubert and Kiel Mountain Roads, Woombye.<a href


x,t[--c]=x,t[--c]=v,t[d++]=v,t[d++]=E,t[--f]=E,t[--f]=b}{const p=r,m=n+o,g=e+p,y=e-p,b=s+m,v=s-m;t[u++]=g,t[u++]=b,t[--f]=v,t[--f]=g,r&&(t[u++]=y,t[u++]=b,t[--f]=v,t[--f]=y)}},triangulate(i,t){const e=i.points,s=t.points,r=t.indices;if(e.length===0)return;let n=s.length/2;const a=n;let o,h;if(i.type!==pt.RREC){const u=i.shape;o=u.x,h=u.y}else{const u=i.shape;o=u.x+u.width/2,h=u.y+u.height/2}const l=i.matrix;s.push(i.matrix?l.a*o+l.c*h+l.tx:o,i.matrix?l.b*o+l.d*h+l.ty:h),n++,s.push(e[0],e[1]);for(let u=2;u<e.length;u+=2)s.push(e[u],e[u+1]),r.push(n++,a,n);r.push(a+1,a,n)}};function Ml(i,t=!1){const e=i.length;if(e<6)return;let s=0;for(let r=0,n=i[e-2],a=i[e-1];r<e;r+=2){const o=i[r],h=i[r+1];s+=(o-n)*(h+a),n=o,a=h}if(!t&&s>0||t&&s<=0){const r=e/2;for(let n=r+r%2;n<e;n+=2){const a=e-n-2,o=e-n-1,h=n,l=n+1;[i[a],i[h]]=[i[h],i[a]],[i[o],i[l]]=[i[l],i[o]]}}}const Nn={build(i){i.points=i.shape.points.slice()},triangulate(i,t){let e=i.points;const s=i.holes,r=t.points,n=t.indices;if(e.length>=6){Ml(e,!1);const a=[];for(let l=0;l<s.length;l++){const u=s[l];Ml(u.points,!0),a.push(e.length/2),e=e.concat(u.points)}const o=Sa(e,a,2);if(!o)return;const h=r.length/2;for(let l=0;l<o.length;l+=3)n.push(o[l]+h),n.push(o[l+1]+h),n.push(o[l+2]+h);for(let l=0;l<e.length;l++)r.push(e[l])}}},Dl={build(i){const t=i.shape,e=t.x,s=t.y,r=t.width,n=t.height,a=i.points;a.length=0,r>=0&&n>=0&&a.push(e,s,e+r,s,e+r,s+n,e,s+n)},triangulate(i,t){const e=i.points,s=t.points;if(e.length===0)return;const r=s.length/2;s.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},Ol={build(i){Ls.build(i)},triangulate(i,t){Ls.triangulate(i


rtProvider> Provider { get; private set; }

        public ProgressCallback ProgressCallback { get; init; }

        public bool HasPermission { get; set; }

        public IList<int> EntitiesToExport { get; set; } = new List<int>();

        public string ActionOrigin { get; set; }

        public IDictionary<string, object> CustomData { get; private set; } = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);

        public IQueryable<Product> ProductQuery { get; set; }

        Task OnProgress(int value, int max, string msg)
        {
            return Task.CompletedTask;
        }
    }
}


{
		id = 39065,
		base = 39060,
		ammo_info = {
			{
				6,
				50045
			},
			{
				5,
				52245
			},
			{
				5,
				52165
			}
		},
		weapon_id = {
			39065
		}
	},
	[39066] = {
		id = 39066,
		base = 39060,
		ammo_info = {
			{
				6,
				50046
			},
			{
				5,
				52246
			},
			{
				5,
				52166
			}
		},
		weapon_id = {
			39066
		}
	},
	[39067] = {
		id = 39067,
		base = 39060,
		ammo_info = {
			{
				6,
				50047
			},
			{
				5,
				52247
			},
			{
				5,
				52167
			}
		},
		weapon_id = {
			39067
		}
	},
	[39068] = {
		id = 39068,
		base = 39060,
		ammo_info = {
			{
				6,
				50048
			},
			{
				5,
				52248
			},
			{
				5,
				52168
			}
		},
		weapon_id = {
			39068
		}
	},
	[39069] = {
		id = 39069,
		base = 39060,
		ammo_info = {
			{
				6,
				50049
			},
			{
				5,
				52249
			},
			{
				5,
				52169
			}
		},
		weapon_id = {
			39069
		}
	},
	[39070] = {
		id = 39070,
		base = 39060,
		ammo_info = {
			{
				6,
				50050
			},
			{
				5,
				52250
			},
			{
				5,
				52170
			}
		},
		weapon_id = {
			39070
		}
	},
	[39071] = {
		anti_siren = 100,
		base = 39060,
		id = 39071,
		ammo_info = {
			{
				6,
				50051
			},
			{
				5,
				52251
			},
			{
				5,
				52171
			}
		},
		weapon_id = {
			39071
		}
	},
	[39100] = {
		name = "Suisei",
		type = 9,
		speciality = "Bomber",
		rarity = 3,
		tech = 1,
		descrip = "No description",
		value_2 = 12,
		icon = "39100",
		attribute_2 = "air",
		nationality = 3,
		ammo = 5,
		value_3 = 0,
		id = 39100,
		torpedo_ammo = 0,
		property_rate = {},
		ammo_icon = {},
		ammo_info = {
			{
				6,
				50000
			},
			{
				5,
				52600
			},
			{
				5,
				52100
			}
		},
		equip_info = {
			6,
			7,
			8,
			9
		},
		weapon_id = {
			39100
		},
		skill_id = {},
		part_main = {
			6,
			7
		},
		part_sub = {
			6,
			7
		},
		equip_parameters = {},
		label = {
			"IJN",
			"CV",
			"DB"
		}
	},
	[39101] = {
		id = 39101,
		base = 39100,
		ammo_info = {
			{
				6,
				50001
			},


      numPatches++;
    }
  }

  for (patch = (MAX_STRETCH_HBE - 1); patch < numPatches; patch++) {
    patchBands = xOverQmf[patch + 1] - xOverQmf[patch];
    target = xOverQmf[patch];
    sourceBands = xOverQmf[MAX_STRETCH_HBE - 1] - xOverQmf[MAX_STRETCH_HBE - 2];

    while (patchBands > 0) {
      int numBands = sourceBands;
      int startBand = xOverQmf[MAX_STRETCH_HBE - 1] - 1;
      if (target + numBands >= xOverQmf[patch + 1]) {
        numBands = xOverQmf[patch + 1] - target;
      }
      if ((((target + numBands - 1) % 2) +
           ((xOverQmf[MAX_STRETCH_HBE - 1] - 1) % 2)) %
          2) {
        if (numBands == sourceBands) {
          numBands--;
        } else {
          startBand--;
        }
      }
      if (keepStatesSynced == KEEP_STATES_SYNCED_OUTDIFF) {
        for (col = slotOffset; col < overlap + LPC_ORDER; col++) {
          i = 0;
          for (band = numBands; band > 0; band--) {
            if ((target + band - 1 < 64) &&
                (target + band - 1 < xOverQmf[patch + 1])) {
              ppqmfReal[col][target + band - 1] = ppqmfReal[col][startBand - i];
              ppqmfImag[col][target + band - 1] = ppqmfImag[col][startBand - i];
              i++;
            }
          }
        }
      } else {
        for (col = slotOffset; col < noCols; col++) {
          i = 0;
          for (band = numBands; band > 0; band--) {
            if ((target + band - 1 < 64) &&
                (target + band - 1 < xOverQmf[patch + 1])) {
              ppqmfReal[col][target + band - 1] = ppqmfReal[col][startBand - i];
              ppqmfImag[col][target + band - 1] = ppqmfImag[col][startBand - i];
              i++;
            }
          }
        }
      }
      target += numBands;
      patchBands -= numBands;
    }
  }
}

/*!
  \brief      SBR decoder core function for one channel

  \image html  BufferMgmtDetailed-1632.png

  Besides the filter states of the QMF filter bank and the LPC-states of
  the LPP-Transposer, processing is mainly based on four buffers:
  #timeIn, #timeOut, #WorkBuffer2 and #OverlapBuffer. The #WorkBuffer2
  is reused for all channels and might be used by the core decoder, a
  static overlap buffer is required for each channel. Due to in-place
  processing, #timeIn and #timeOut point to identical locations.

  The spectral data is organized in so-called slots. Each slot
  contains 64 bands of complex data. The number of slots per frame
  depends on the frame size. For mp3PRO, there are 18 slots per frame
  and 6 slots per #OverlapBuffer. It is not necessary to have the slots
  in located consecutive address ranges.

  To optimize memory usage and to minimize the number of memory
  accesses, the memory management is organized as follows (slot numbers
  based on mp3PRO):

  1.) Input time domain signal is located in #timeIn. The last slots
  (0..5) of the spectral data of the previous frame are located in the
  #OverlapBuffer. In addition, #frameData of the current frame resides
  in the upper part of #timeIn.

  2.) During the cplxAnalysisQmfFiltering(), 32 samples from #timeIn are
  transformed into a slot of up to 32 complex spectral low ba


the GNU General Public License
    along with dnSpy.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace dnSpy.Contracts.Hex.Editor {
	/// <summary>
	/// Creates <see cref="HexKeyProcessor"/>s
	/// </summary>
	public abstract class HexKeyProcessorProvider {
		/// <summary>
		/// Constructor
		/// </summary>
		protected HexKeyProcessorProvider() { }

		/// <summary>
		/// Creates a <see cref="HexKeyProcessor"/> or returns null
		/// </summary>
		/// <param name="wpfHexView">Hex view</param>
		/// <returns></returns>
		public abstract HexKeyProcessor? GetAssociatedProcessor(WpfHexView wpfHexView);
	}
}


ompleted(PamResult.Error)` will be emitted after this event.
	void error(PamError::Enum error);

	/// Emitted whenever pam sends a new message, after the change signals for
	/// `message`, `messageIsError`, and `responseRequired`.
	void pamMessage();

	void activeChanged();
	void configChanged();
	void configDirectoryChanged();
	void userChanged();
	void messageChanged();
	void messageIsErrorChanged();
	void responseRequiredChanged();
	void responseVisibleChanged();

private slots:
	void onCompleted(PamResult::Enum result);
	void onError(PamError::Enum error);
	void onMessage(QString message, bool isError, bool responseRequired, bool responseVisible);

private:
	PamConversation* conversation = nullptr;

	bool postInit = false;
	bool mTargetActive = false;
	QString mConfig = "login";
	QString mConfigDirectory = "/etc/pam.d";
	QString mUser;
	QString mMessage;
	bool mMessageIsError = false;
	bool mIsResponseRequired = false;
	bool mIsResponseVisible = false;
};
/*
 *  This file is part of libqbox
 *  Copyright (c) 2023 Qualcomm Innovation Center, Inc.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <systemc>

#include <virtio_gpu_gl_pci.h>

#include <libqemu/config-host.h>

virtio_gpu_gl_pci::virtio_gpu_gl_pci(const sc_core::sc_module_name& name, sc_core::sc_object* o, sc_core::sc_object* t)
    : virtio_gpu_gl_pci(name, *(dynamic_cast<QemuInstance*>(o)), (dynamic_cast<qemu_gpex*>(t)))
{
}
virtio_gpu_gl_pci::virtio_gpu_gl_pci(const sc_core::sc_module_name& name, QemuInstance& inst, qemu_gpex* gpex)
    : QemuVirtioGpu(name, inst, _device_type, gpex, std::string(name).append(".").append(_device_type).c_str())
    , p_hostmem_mb("hostmem_mb", 2048, "MB to allocate for host visible shared memory")

{
#ifndef __APPLE__
#ifdef HAVE_VIRGL_RESOURCE_BLOB
    // Create memory object for host visible shared memory only if blob
    // resources are available in virgl otherwise it is not needed.
    // Also we can NOT enable it on MacOS as it does not have memfd support.
    m_inst.add_arg("-object");
    auto memory_object = "memory-backend-memfd,id=mem1,size=" + std::to_string(p_hostmem_mb.get_value()) + "M";
    m_inst.add_arg(memory_object.c_str());
    m_inst.add_arg("-machine");
    m_inst.add_arg("memory-backend=mem1");
#endif // HAVE_VIRGL_RESOURCE_BLOB
#endif // NOT __APPLE__
}

void virtio_gpu_gl_pci::before_end_of_elaboration()
{
    QemuVirtioGpu::before_end_of_elaboration();

#ifndef __APPLE__
#ifdef HAVE_VIRGL_RESOURCE_BLOB
    // Enable blob resources and host visible shared memory only if
    // available in virgl and we are NOT on MacOS as it does not have
    // /dev/udmabuf support.
    get_qemu_dev().set_prop_bool("blob", true);
    get_qemu_dev().set_prop_int("hostmem", p_hostmem_mb);
#endif // HAVE_VIRGL_RESOURCE_BLOB
    get_qemu_dev().set_prop_bool("context_init", true);
#endif // NOT __APPLE__
}

void module_register() {
    GSC_MODULE_REGISTER_C(virtio_gpu_gl_pci, sc_core::sc_object*, sc_core::sc_object*);
}
/*
 * This file is part of libqemu-cxx
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
 * Author: GreenSocs 2021
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <libqemu-cxx/libqemu-cxx.h>
#include


 = ''): TrendingMoviesResponse => {
  const page = getDataElement(trendingMovies, 'page', 0);
  const totalPages = getDataElement(trendingMovies, 'total_pages', 0);

  return {
    movies: mapMovies(getDataElement(trendingMovies, 'results', [])),
    page,
    totalPages,
    searchValue
  };
};
import { addSeconds, format } from 'date-fns'

export const formatTime = (timeInSeconds: number) => {
  return format(addSeconds(new Date(0), timeInSeconds), 'mm:ss')
}

export const timeToSliderValue = (currentTime: number | undefined, duration: number | undefined) => {
  return currentTime && duration && (currentTime * 100) / duration
}

export const sliderValueToTime = (value: number, duration: number | undefined) => {
  return value && duration && (value * duration) / 100
}
import { useEffect, useState } from 'react'
import { useWalletWeb3React } from './web3'
import { Contract } from '@ethersproject/contracts'
import { useContract, useActiveWeb3React } from './web3'
import { NFT_ADDRESSES, NFT_ABI } from '../constants'

function useNFTContract(): Contract | null {
  const { chainId } = useActiveWeb3React()
  return useContract(
    chainId ? NFT_ADDRESSES[chainId] : undefined,
    NFT_ABI,
    true
  )
}

export function useUserNFT() {
  const [nft, setNFT] = useState<any>(null)
  const { account } = useWalletWeb3React()
  const contract = useNFTContract()

  useEffect(() => {
    const loadNFT = () => {
      contract && contract.addressToNFT(account).then(async (id) => {
        if (id.toString() !== '0') {
          const name = await contract.nftName(id)
          setNFT({ id: id.toString(), name })
        } else {
          setNFT(null)
        }
      })
    }
    loadNFT();

    const timeout = setInterval(loadNFT, 5000)

    return () => clearInterval(timeout)
  }, [account, contract])

  return nft;
}

export function useNFTPrice() {
  const contract = useNFTContract()
  const [price, setPrice] = useState<any>({
    price: null,
    token: null,
    contract: contract.address,
    remaining: null,
  })

  useEffect(() => {
    contract && Promise.all([
      contract.purchasePrice(),
      contract.paymentToken(),
      contract.totalSupply(),
      contract.numberOfTickets(),
    ])
      .then(([price, token, supply, total]) => setPrice((p: any) => ({
        ...p,
        price,
        token,
        remaining: total.toString() - supply.toString(),
      })))
  }, [contract])

  return price;
}

export function usePurchase() {
  const { account } = useWalletWeb3React()
  const contract = useNFTContract()

  return async (name: string) => {
    const tx = await contract.purchase(account, name)
    await tx.wait()
  }
}

export function useRename(id: string) {
  const contract = useNFTContract()

  if (!id) {
    return async () => null
  }

  return async (newName: string) => {
    const tx = await contract.rename(id, newName)
    await tx.wait()
  }
}
/* import { createServer } from "http";
import { Server, Socket } from "socket.io";

import { SYSTEM } from "./config";

const httpServer = createServer();
const io = new Server(httpServer);

interface ISocket extends Socket {
  username: string;
}

const DEFAULT_USERNAME = "anonymous";

io.on("


＝デジ", "Gheorghe Gheorghiu-Dej", "格奥尔基・乔治乌-德治"],
    [1955, 1961, "eur/chivu-stoica", "キヴ・ストイカ", "Chivu Stoica", "基伏・斯托伊卡"],
    [1961, 1974, "eur/ion-maurer", "$", "Ion Gheorghe Maurer", "扬・格奥尔基・毛雷尔"],
    [1974, 1979, "eur/manea-manescu", "$", "Manea Mănescu", "马尼亚・曼内斯库"],
    [1979, 1982, "eur/ilie-verdet", "$", "Ilie Verdeţ", "伊利耶・维尔德茨"],
    [1982, 1989, "eur/constantin-dascalescu", "コンスタンティン・ダスカレスク", "Constantin Dăscălescu", "康斯坦丁・德斯克列斯库"],
    ["首相", "Prime Minister", "总理"],
    [1989, 1991, "eur/petre-roman", "ペトレ・ロマン", "Petre Roman", "彼得・罗曼"],
    [1991, 1992, "eur/teodor-stolojan", "テオドー儿・ストロヤン", "Theodor Stolojan", "特奥多尔・杜米特鲁・斯托洛然"],
    [1992, 1996, "eur/nicolae-vacaroiu", "ニコラエ・ヴァカロイウ", "Nicolae Văcăroiu", "尼古拉・沃克罗尤"],
    [1996, 1998, "eur/victor-ciorbea", "ヴィクト儿・チョ儿ベア", "Victor Ciorbea", "维克托・乔尔贝亚"],
    [1998, 1999, "eur/radu-vasile", "$", "Radu Vasile", "拉杜・瓦西里"],
    [1999, 2000, "eur/mugur-isarescu", "ムグ儿・イサレスク", "Mugur Isărescu", "穆古尔・伊萨雷斯库"],
    [2000, 2004, "eur/adrian-nastase", "アドリアン・ナスターセ", "Adrian Năstase", "阿德里安・讷斯塔塞"],
    [2004, 2008, "eur/popescu-tariceanu", "カリン・ポペスク・タリチェアヌ", "Călin Popescu-Tăriceanu", "克林・波佩斯库-特里恰努"],
    [2008, 2012, "eur/emil-boc", "エミー儿・ボック", "Emil Boc", "埃米尔・博克"],
    [2012, 9999, "eur/victor-ponta", "ヴィクト儿・ポンタ", "Victor Ponta", "维克托・蓬塔"],
  ],
  [null, 1347, 1686,
    [1336, 1482, null, "バフマニー朝", "Bahmani Sultanate", "巴赫曼尼苏丹国", "バフマニー", "Bahmanid", "巴赫曼尼", 2560, 720, 0],
    [1482, 1649, null, "アーディ儿・シャー朝（ビジャープ儿王国）", "Adil Shahi dynasty", "阿迪勒・沙阿王朝", "ビジャープ儿", "Bijapur", "阿迪勒沙阿王朝", 2540, 710


ingHandler:
    def __init__(self, event_handler: BaseEventHandler):
        self.event_handler = event_handler

    def create_msg_stream(self, id: str, event_type: str, **kwargs) -> Generator:
        return self.event_handler.generate_message_stream(
            id=id,
            event_type=event_type,
            **kwargs
        )

    def create_retrieval_stream(self, id: str, event_type: str, **kwargs) -> Generator:
        return self.event_handler.generate_retrieval_stream(
            id=id,
            event_type=event_type,
            **kwargs
        )

    def create_sensitive_stream(self, id: str, event_type: str, **kwargs) -> Generator:
        return self.event_handler.generate_sensitive_stream(
            id=id,
            event_type=event_type,
            **kwargs
        )

    def create_error_stream(self, id: str, event_type: str, **kwargs) -> Generator:
        return self.event_handler.generate_error_stream(
            id=id,
            event_type=event_type,
            **kwargs
        )

    def create_done(self):
        return self.event_handler.yield_event("done", "[DONE]")


>Population : 10324"
          }
        },
        "town-83148": {
          value: "10312",
          latitude: 43.427222222222,
          longitude: 6.4319444444444,
          href: "#",
          tooltip: {
            content: "Vidauban (83148)
Population : 10312"
          }
        },
        "town-76216": {
          value: "10286",
          latitude: 49.469722222222,
          longitude: 1.0497222222222,
          href: "#",
          tooltip: {
            content: "DÃ©ville-lÃ¨s-Rouen (76216)
Population : 10286"
          }
        },
        "town-24520": {
          value: "10279",
          latitude: 44.89,
          longitude: 1.2166666666667,
          href: "#",
          tooltip: {
            content: "Sarlat-la-CanÃ©da (24520)
Population : 10279"
          }
        },
        "town-37195": {
          value: "10279",
          latitude: 47.389166666667,
          longitude: 0.66055555555556,
          href: "#",
          tooltip: {
            content: "La Riche (37195)
Population : 10279"
          }
        },
        "town-86041": {
          value: "10269",
          latitude: 46.5975,
          longitude: 0.34916666666667,
          href: "#",
          tooltip: {
            content: "Buxerolles (86041)
Population : 10269"
          }
        },
        "town-35210": {
          value: "10240",
          latitude: 48.147777777778,
          longitude: -1.7738888888889,
          href: "#",
          tooltip: {
            content: "PacÃ© (35210)
Population : 10240"
          }
        },
        "town-54159": {
          value: "10239",
          latitude: 48.625,
          longitude: 6.3497222222222,
          href: "#",
          tooltip: {
            content: "Dombasle-sur-Meurthe (54159)
Population : 10239"
          }
        },
        "town-59426": {
          value: "10223",
          latitude: 50.746666666667,
          longitude: 3.1580555555556,
          href: "#",
          tooltip: {
            content: "Neuville-en-Ferrain (59426)
Population : 10223"
          }
        },
        "town-91216": {
          value: "10222",
          latitude: 48.673888888889,
          longitude: 2.3272222222222,
          href: "#",
          tooltip: {
            content: "Ã‰pinay-sur-Orge (91216)
Population : 10222"
          }
        },
        "town-16374": {
          value: "10216",
          latitude: 45.640277777778,
          longitude: 0.19777777777778,
          href: "#",
          tooltip: {
            content: "Soyaux (16374)
Population : 10216"
          }
        },
        "town-62516": {
          value: "10189",
          latitude: 50.563611111111,
          longitude: 2.4819444444444,
          href: "#",
          tooltip: {


                   Utc,
                    )
                }),
            )
        })
        .unwrap_or(HtpStreamState::ERROR)
}

/// Process a chunk of outbound (server or response) data.
///
/// timestamp is optional.
/// Returns HTP_STREAM_STATE_OK on state change, HTP_STREAM_STATE_ERROR on error, or HTP_STREAM_STATE_DATA when more data is needed
#[no_mangle]
pub unsafe extern "C" fn htp_connp_response_data(
    connp: *mut ConnectionParser,
    timestamp: *const libc::timeval,
    data: *const libc::c_void,
    len: libc::size_t,
) -> HtpStreamState {
    connp
        .as_mut()
        .map(|connp| {
            connp.response_data(
                Data::from((data as *const u8, len)),
                timestamp.as_ref().map(|val| {
                    DateTime::<Utc>::from_utc(
                        NaiveDateTime::from_timestamp(val.tv_sec, val.tv_usec as u32),
                        Utc,
                    )
                }),
            )
        })
        .unwrap_or(HtpStreamState::ERROR)
}

/// Get the number of transactions processed on this connection.
///
/// Returns the number of transactions or -1 on error.
#[no_mangle]
pub unsafe extern "C" fn htp_connp_tx_size(connp: *const ConnectionParser) -> isize {
    connp
        .as_ref()
        .map(|connp| isize::try_from(connp.tx_size()).unwrap_or(-1))
        .unwrap_or(-1)
}

/// Get a transaction.
///
/// Returns the transaction or NULL on error.
#[no_mangle]
pub unsafe extern "C" fn htp_connp_tx(
    connp: *mut ConnectionParser,
    tx_id: usize,
) -> *const Transaction {
    connp
        .as_ref()
        .map(|connp| {
            connp
                .tx(tx_id)
                .map(|tx| {
                    if tx.is_started() {
                        tx as *const Transaction
                    } else {
                        std::ptr::null()
                    }
                })
                .unwrap_or(std::ptr::null())
        })
        .unwrap_or(std::ptr::null())
}

/// Retrieves the pointer to the active response transaction. In connection
/// parsing mode there can be many open transactions, and up to 2 active
/// transactions at any one time. This is due to HTTP pipelining. Can be NULL.
#[no_mangle]
pub unsafe extern "C" fn htp_connp_get_response_tx(
    connp: *mut ConnectionParser,
) -> *const Transaction {
    connp
        .as_mut()
        .map(|connp| connp.response() as *const Transaction)
        .unwrap_or(std::ptr::null())
}

/// Retrieves the pointer to the active request transaction. In connection
/// parsing mode there can be many open transactions, and up to 2 active
/// transactions at any one time. This is due to HTTP pipelining. Call be NULL.
#[no_mangle]
pub unsafe extern "C" fn htp_connp_get_request_tx(
    connp: *mut ConnectionParser,
) -> *const Transaction {
    connp
        .as_mut()
        .map(|connp| connp.request() as *const Transaction)
        .unwrap_or(std::ptr::null())
}

/// Invoke the transaction complete callback for each incomplete transaction.
/// The transactions passed to the callback will not have their request and
/// response state set to complete - they will simply be passed with the state
/// they have within the parser at the time of the call.
///
/// This function is intended


 zmm6	 # AVX512BW
	vpmovwb	YMMWORD PTR [edx+4064], zmm6	 # AVX512BW Disp8
	vpmovwb	YMMWORD PTR [edx+4096], zmm6	 # AVX512BW
	vpmovwb	YMMWORD PTR [edx-4096], zmm6	 # AVX512BW Disp8
	vpmovwb	YMMWORD PTR [edx-4128], zmm6	 # AVX512BW
	vpmovswb	YMMWORD PTR [ecx], zmm6	 # AVX512BW
	vpmovswb	YMMWORD PTR [ecx]{k7}, zmm6	 # AVX512BW
	vpmovswb	YMMWORD PTR [esp+esi*8-123456], zmm6	 # AVX512BW
	vpmovswb	YMMWORD PTR [edx+4064], zmm6	 # AVX512BW Disp8
	vpmovswb	YMMWORD PTR [edx+4096], zmm6	 # AVX512BW
	vpmovswb	YMMWORD PTR [edx-4096], zmm6	 # AVX512BW Disp8
	vpmovswb	YMMWORD PTR [edx-4128], zmm6	 # AVX512BW
	vpmovuswb	YMMWORD PTR [ecx], zmm6	 # AVX512BW
	vpmovuswb	YMMWORD PTR [ecx]{k7}, zmm6	 # AVX512BW
	vpmovuswb	YMMWORD PTR [esp+esi*8-123456], zmm6	 # AVX512BW
	vpmovuswb	YMMWORD PTR [edx+4064], zmm6	 # AVX512BW Disp8
	vpmovuswb	YMMWORD PTR [edx+4096], zmm6	 # AVX512BW
	vpmovuswb	YMMWORD PTR [edx-4096], zmm6	 # AVX512BW Disp8
	vpmovuswb	YMMWORD PTR [edx-4128], zmm6	 # AVX512BW
	vmovdqu8	ZMMWORD PTR [ecx], zmm6	 # AVX512BW
	vmovdqu8	ZMMWORD PTR [ecx]{k7}, zmm6	 # AVX512BW
	vmovdqu8	ZMMWORD PTR [esp+esi*8-123456], zmm6	 # AVX512BW
	vmovdqu8	ZMMWORD PTR [edx+8128], zmm6	 # AVX512BW Disp8
	vmovdqu8	ZMMWORD PTR [edx+8192], zmm6	 # AVX512BW
	vmovdqu8	ZMMWORD PTR [edx-8192], zmm6	 # AVX512BW Disp8
	vmovdqu8	ZMMWORD PTR [edx-8256], zmm6	 # AVX512BW
	vmovdqu16	ZMMWORD PTR [ecx], zmm6	 # AVX512BW
	vmovdqu16	ZMMWORD PTR [ecx]{k7}, zmm6	 # AVX512BW
	vmovdqu16	ZMMWORD PTR [esp+esi*8-123456], zmm6	 # AVX512BW
	vmovdqu16	ZMMWORD PTR [edx+8128], zmm6	 # AVX512BW Disp8
	vmovdqu16	ZMMWORD PTR [edx+8192], zmm6	 # AVX512BW
	vmovdqu16	ZMMWORD PTR [edx-8192], zmm6	 # AVX512BW Disp8
	vmovdqu16	ZMMWORD PTR [edx-8256], zmm


 | ${3} | ${0}         | ${3}
    ${0.5} | ${-1} | ${0} | ${0.5}       | ${0}
    ${0.5} | ${0}  | ${1} | ${-Infinity} | ${Infinity}
    ${0.5} | ${0}  | ${0} | ${-Infinity} | ${NaN}
    ${0}   | ${0}  | ${0} | ${NaN}       | ${NaN}
    `(`Test of initGeneralForm`, ({A, B, C, a, b}) => {

      describe(`f.initGeneralForm(${A}, ${B}, ${C})`, () => {
        const f = new Linear();
        f.initGeneralForm(A, B, C);

        it(`f.a = ${a}`, () => { expect(f.a).toBe(a); })
        it(`f.b = ${b}`, () => { expect(f.b).toBe(b); })
      })
    })

    describe.each`
    a | x | y | b
    ${3}  | ${1} | ${-2} | ${-5}
    ${2}  | ${3} | ${1}  | ${-5}
    ${-3} | ${2} | ${1}  | ${7}
    ${5}  | ${2} | ${4}  | ${-6}
    `(`Test of initBySlopeAndPoint`, ({a, x, y, b}) => {

      describe(`f.initBySlopeAndPoint(${a}, ${x}, ${y}, ${b})`, () => {
        const f = new Linear();
        f.initBySlopeAndPoint(a, x, y);

        it(`f.a = ${a}`, () => { expect(f.a).toBe(a); })
        it(`f.b = ${b}`, () => { expect(f.b).toBe(b); })
      })
    })

    describe.each`
     x1 | y1 | x2 | y2 | a | b
    ${2} | ${6}  | ${4} | ${14}  | ${4}  | ${-2}
    ${1} | ${3}  | ${3} | ${11}  | ${4}  | ${-1}
    ${2} | ${-1} | ${4} | ${-13} | ${-6} | ${11}
    `(`Test of initBy2Point`, ({x1, y1, x2, y2, a,  b}) => {

      describe(`f.initBy2Point(${x1}, ${y1}, ${x2}, ${y2})`, () => {
        const f = new Linear();
        f.initBy2Point(x1, y1, x2, y2);

        it(`f.a = ${a}`, () => { expect(f.a).toBe(a); })
        it(`f.b = ${b}`, () => { expect(f.b).toBe(b); })
      })
    })

  })

  //---------------------------------------------------------------------------
  // 状態
  //---------------------------------------------------------------------------
  describe.each`
  a            | b | invalid
  ${0}         | ${0}         | ${false}
  ${1}         | ${0}         | ${false}
  ${-1}        | ${0}         | ${false}
  ${Infinity}  | ${0}         | ${true}
  ${-Infinity} | ${0}         | ${true}
  ${NaN}       | ${0}         | ${true}
  ${0}         | ${1}         | ${false}
  ${0}         | ${-1}        | ${false}
  ${0}         | ${Infinity}  | ${true}
  ${0}         | ${-Infinity} | ${true}
  ${0}         | ${NaN}       | ${true}
  `(`Test of isInvalid`, ({a, b, invalid}) => {

    const f = new Linear();
    f.a = a; f.b = b;

    it(`${f.toString()}.isInvalid = ${invalid}`, () => {
      expect(f.isInvalid).toBe(invalid);
    })
  })

  describe.each`
  a | b | result
  ${{a:1, b:0}}   | ${{a:-1, b:0}}   | ${true}
  ${{a:1, b:0}}   | ${{a:-1, b:2}}   | ${true}
  ${{a:1, b:1}}   | ${{a: 1, b:2}}   | ${false}
  ${{a:NaN, b:1}} | ${{a: 1, b:2}}   | ${false}
  ${{a:1, b:1}}   | ${{


alue = value == BucketHelper.Null ? default! : (T)value;
                    if (check(castValue))
                    {
                        yield return castValue;
                    }
                }
            }
        }

        public IEnumerable<KeyValuePair<int, T>> WhereIndexed(Predicate<T> check)
        {
            if (check == null)
            {
                throw new ArgumentNullException(nameof(check));
            }

            return WhereExtracted();

            IEnumerable<KeyValuePair<int, T>> WhereExtracted()
            {
                var index = 0;
                foreach (var value in _bucketCore)
                {
                    var castValue = value == BucketHelper.Null ? default! : (T)value;
                    if (!check(castValue))
                    {
                        continue;
                    }

                    yield return new KeyValuePair<int, T>(index, castValue);

                    index++;
                }
            }
        }
    }
}


 `json:"message,omitempty"`
	StartTime int    `json:"start_time,omitempty"`
	EndTime   int    `json:"end_time,omitempty"`
}

const numHealthChecks = 60 // Number of times to check for endpoint health per app.

var tr *runner.TestRunner

func TestMain(m *testing.M) {
	utils.SetupLogs("hellodapr")
	utils.InitHTTPClient(true)

	// This test shows how to deploy the multiple test apps, validate the side-car injection
	// and validate the response by using test app's service endpoint

	// These apps will be deployed for hellodapr test before starting actual test
	// and will be cleaned up after all tests are finished automatically
	testApps := []kube.AppDescription{
		{
			AppName:           "hellobluedapr",
			DaprEnabled:       true,
			ImageName:         "e2e-hellodapr",
			Replicas:          1,
			IngressEnabled:    true,
			DaprMemoryLimit:   "200Mi",
			DaprMemoryRequest: "100Mi",
			AppMemoryLimit:    "200Mi",
			AppMemoryRequest:  "100Mi",
		},
		{
			AppName:           "hellogreendapr",
			DaprEnabled:       true,
			ImageName:         "e2e-hellodapr",
			Replicas:          1,
			IngressEnabled:    true,
			DaprMemoryLimit:   "200Mi",
			DaprMemoryRequest: "100Mi",
			AppMemoryLimit:    "200Mi",
			AppMemoryRequest:  "100Mi",
		},
		{
			AppName:           "helloenvtestdapr",
			DaprEnabled:       true,
			ImageName:         "e2e-hellodapr",
			Replicas:          1,
			IngressEnabled:    true,
			DaprMemoryLimit:   "200Mi",
			DaprMemoryRequest: "100Mi",
			AppMemoryLimit:    "200Mi",
			AppMemoryRequest:  "100Mi",
		},
	}

	// Append test apps for Dapr versions N-2 and N-1 if present
	// These are used to detect regressions in the control plane
	if os.Getenv("DAPR_TEST_N_MINUS_2_IMAGE") != "" {
		testApps = append(testApps, kube.AppDescription{
			AppName:           "hellon2dapr",
			DaprEnabled:       true,
			ImageName:         "e2e-hellodapr",
			SidecarImage:      os.Getenv("DAPR_TEST_N_MINUS_2_IMAGE"),
			Replicas:          1,
			IngressEnabled:    true,
			DaprMemoryLimit:   "200Mi",
			DaprMemoryRequest: "100Mi",
			AppMemoryLimit:    "200Mi",
			AppMemoryRequest:  "100Mi",
		})
	}
	if os.Getenv("DAPR_TEST_N_MINUS_1_IMAGE") != "" {
		testApps = append(testApps, kube.AppDescription{
			AppName:           "hellon1dapr",
			DaprEnabled:       true,
			ImageName:         "e2e-hellodapr",
			SidecarImage:      os.Getenv("DAPR_TEST_N_MINUS_1_IMAGE"),
			Replicas:          1,
			IngressEnabled:    true,
			DaprMemoryLimit:   "200Mi",
			DaprMemoryRequest: "100Mi",
			AppMemoryLimit:    "200Mi",
			AppMemoryRequest:  "100Mi",
		})
	}

	tr = runner.NewTestRunner("hellodapr", testApps, nil, nil)
	os.Exit(tr.Start(m))
}

func TestHelloDapr(t *testing.T) {
	helloAppTests := []struct {
		testName         string
		app              string
		testCommand      string
		expectedResponse


、距离、时间关系

#### 新增概念（5个）
- **折扣**：商品价格减少的计算
  - 定义：折扣是商品价格的减少，通常以百分比或分数表示
  - 性质：折扣率≤1，折扣价格<原价
  - 运算：折扣价格=原价×折扣率，原价=折扣价格÷折扣率
  - 常见错误：折扣率理解错误，计算方向错误

- **利润**：商业利润计算
  - 定义：利润是收入减去成本后的剩余
  - 性质：可正可负，利润率=利润÷成本
  - 运算：利润=收入-成本，利润率=利润÷成本×100%
  - 常见错误：正负号错误，利润率计算错误

- **平均数**：统计平均值计算
  - 定义：平均数是所有数值的总和除以数值的个数
  - 性质：介于最大值和最小值之间，受极值影响
  - 运算：平均数=总和÷个数，总和=平均数×个数
  - 常见错误：忘记除以个数，权重错误

- **比例**：比例关系计算
  - 定义：比例表示两个量之间的比值关系
  - 性质：可以约分，可以交叉相乘
  - 运算：a:b=c:d等价于a×d=b×c
  - 常见错误：交叉相乘错误，约分错误

- **方程**：方程求解
  - 定义：方程是含有未知数的等式
  - 性质：等式两边相等，可以移项
  - 运算：移项变号，合并同类项，系数化为1
  - 常见错误：移项错误，符号错误

### 2. 解题策略库扩展

#### 原有策略（4个）
- 逆向思维：从结果倒推
- 分类讨论：分情况讨论
- 数形结合：结合图形分析
- 等量代换：等价表达式替换

#### 新增策略（4个）
- **设未知数**：引入未知数建立方程
  - 适用：应用题、几何问题、行程问题
  - 步骤：识别未知量→设未知数→建立方程→求解验证

- **列表法**：通过列表整理信息
  - 适用：排列组合、概率问题、逻辑推理
  - 步骤：列出所有可能→分析规律→排除不可能→确定答案

- **假设法**：通过假设验证答案
  - 适用：选择题、验证题、逻辑题
  - 步骤：提出假设→验证假设→调整假设→确定答案

- **整体思想**：将问题作为整体考虑
  - 适用：复杂计算、分数问题、比例问题
  - 步骤：识别整体→简化计算→整体求解→验证结果

### 3. 智能识别算法改进

#### 概念识别增强
- 使用关键词映射表，提高识别准确性
- 支持多种表达方式（如"打折"、"折"、"优惠"都识别为折扣）
- 避免误识别（如"方程"不会误识别为"体积"）

#### 策略推荐增强
- 基于关键词和概念的智能推荐
- 支持多策略组合推�


containsKey(tp) &&
        _assignOps[tp]!.containsKey(op)) {
      return _assignOps[tp]![op]!;
    }
    return <DartType>{};
  }

  bool hasConstructor(DartType tp) {
    tp = tp.toNonNullable();
    return _constructors.containsKey(tp);
  }

  Set<String> constructors(DartType tp) {
    tp = tp.toNonNullable();
    if (_constructors.containsKey(tp)) {
      return _constructors[tp]!.keys.toSet();
    }
    return <String>{};
  }

  List<DartType> constructorParameters(DartType tp, String constructor) {
    tp = tp.toNonNullable();
    if (_constructors.containsKey(tp) &&
        _constructors[tp]!.containsKey(constructor)) {
      return _constructors[tp]![constructor]!;
    }
    throw "NotFound";
  }

  Set<DartType> get allTypes {
    return _allTypes;
  }

''');

  print("  static const VOID = DartType._withName('void', false);");
  print("  static const VOID_NULLABLE = VOID;");
  var instTypes = <String>{};

  // Generate one static DartType instance for all instantiable types.
  // TODO (felih): maybe add void type?
  allTypes.forEach((baseType) {
    var constName = typeConstName(baseType);
    instTypes.add(constName);
    if (!subclass) {
      print(
        '  static const $constName = '
        "DartType._withName('${baseType.asCode}', false);",
      );
      print(
        '  static const ${constName}_NULLABLE = '
        "DartType._withName('${baseType.asCode}', true);",
      );
    }
  });

  if (!subclass) {
    // Generate one static DartType instance for all non instantiable types.
    // These are required to resolve interface relations, but should not be
    // used directly to generate dart programs.
    print('');
    print(
      '  // NON INSTANTIABLE'
      '',
    );
    interfaceRels.keys.forEach((constName) {
      if (instTypes.contains(constName)) return;
      print(
        '  static const $constName = '
        "DartType._withName('__$constName', false);",
      );
      print(
        '  static const ${constName}_NULLABLE = '
        "DartType._withName('__$constName', true);",
      );
    });
  }

  // Generate a list of all instantiable types.
  print('');
  print('''
  // All types extracted from analyzer.
  static const _allTypes = {''');
  filterTypesSet(instTypes, fp: fp, flatTp: flatTp).forEach((constName) {
    print("    ${subclass ? "DartType." : ""}$constName,");
    print("    ${subclass ? "DartType." : ""}${constName}_NULLABLE,");
  });
  print('  };');

  print('');
  print('''
  // All List<E> types: LIST_INT, LIST_STRING, etc.''');
  printTypeSet('_listTypes', listTypes, fp: fp, flatTp: flatTp);

  print('');
  print('''
  // All Set types: SET_INT, SET_STRING, etc.''');
  printTypeSet('_setTypes', setTypes, fp: fp, flatTp: flatTp);

  print('');
  print('''
  // All Map<K, V> types: MAP_INT_STRING, MAP_DOUBLE_BOOL, etc.''');
  printTypeSet('_mapTypes', mapTypes, fp: fp, flatTp: flatTp);

  print('');
  print('''
  // All collection types: list, map and set types.''');
  printTypeSet(
    '_collectionTypes',
    {...listTypes, ...setTypes, ...mapTypes},
    fp: fp,
    flatTp: flatTp,
  );

  print('


#!/usr/bin/env python
# coding: utf-8

import argparse
import pandas as pd
import time
parser = argparse.ArgumentParser(description='文件位置')
parser.add_argument('--new_paper_dir',default='new_about/20241112',type=str,required=False)
parser.add_argument('--date',type=str,required=True)
args=parser.parse_args()
try:
    t = pd.read_csv("./new_about/dines.tsv",sep='\t',header = None)

    l = list(t.iloc[:,0].values)
    num_list = ['di'+str(i) for i in range(len(l))]
    # name_dict = dict(zip(num_list,l))
    name_list_f = dict(zip(l,num_list))

    t1 = pd.read_csv("./new_about/genes.tsv",sep='\t',header = None)
    l1 = list(t1.iloc[:,0].values)
    num_list1 = ['ge'+str(i) for i in range(len(l1))]
    # name_dict = dict(zip(num_list,l))
    name_list_f1 = dict(zip(l1,num_list1))

    spo = pd.read_csv(args.new_paper_dir+'/di_ge_data.tsv',sep='\t')
    spo['date']=args.date
    di = spo["start"].unique().tolist()
    ge = spo["end"].unique().tolist()

    # date = time.strftime('%Y%m%d',time.localtime(time.time()))

    # diids = ['di'+date+'-'+str(a) for a in range(len(di))]
    # geids = ['ge'+date+'-'+str(a) for a in range(len(ge))]
    diids = [name_list_f[a] for a in di]
    geids = [name_list_f1[a] for a in ge]

    dinodes = pd.DataFrame({":ID":diids,":TYPE":'Disease','name':di})
    genodes = pd.DataFrame({":ID":geids,":TYPE":'Gene','name':ge})
    spo_encoded=spo.copy()
    spo_encoded['start'] = spo['start'].map(lambda x :dinodes[dinodes['name']==x][':ID'].iloc[0] )
    spo_encoded['end'] = spo['end'].map(lambda x :genodes[genodes['name']==x][':ID'].iloc[0] )

    spo_encoded.to_csv('./new_about/di_ge/edges_encoded.csv',index=None)
    spo.to_csv('./new_about/di_ge/edges.csv',index=None)
    nodes = pd.concat([dinodes,genodes],ignore_index=True)
    nodes.to_csv('./new_about/di_ge/nodes.csv',index=None)
except:
    pd.DataFrame([]).to_csv('./new_about/di_ge/edges.csv',index=None)
    pd.DataFrame([]).to_csv('./new_about/di_ge/nodes.csv',index=None)
    print('done')
print('done')


showcase .ratio>*{position:relative;top:unset;left:unset}.avatar-showcase .add-friend .d-block{margin:8px 0}.badge{padding-top:5px;font-family:"Roboto",sans-serif,sans-serif;font-weight:500}.badge+.badge{margin-left:5px}.badge svg{width:15px;height:15px;padding-top:3px}.pill-badge-primary{background-color:var(--theme-deafult);-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(var(--theme-deafult), 0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(var(--theme-deafult), 0.25);color:#fff;border-radius:0}.pill-badge-secondary{background-color:#89d4df;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(137,212,223,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(137,212,223,0.25);color:#fff;border-radius:0}.pill-badge-success{background-color:#7dc006;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(125,192,6,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(125,192,6,0.25);color:#fff;border-radius:0}.pill-badge-danger{background-color:#e52727;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(229,39,39,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(229,39,39,0.25);color:#fff;border-radius:0}.pill-badge-info{background-color:#1d97ff;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(29,151,255,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(29,151,255,0.25);color:#fff;border-radius:0}.pill-badge-light{background-color:#f4f4f4;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(244,244,244,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(244,244,244,0.25);color:#fff;border-radius:0}.pill-badge-dark{background-color:#2c323f;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(44,50,63,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(44,50,63,0.25);color:#fff;border-radius:0}.pill-badge-warning{background-color:#ff8819;-webkit-box-shadow:-0.5px 4.33px 16px 0px rgba(255,136,25,0.25);box-shadow:-0.5px 4.33px 16px 0px rgba(255,136,25,0.25);color:#fff;border-radius:0}.pill-badge-primary{background-color:var(--theme-deafult)}.pill-badge-secondary{background-color:var(--theme-secondary)}.round-badge-primary{border-radius:6px;background-color:var(--theme-deafult);-webkit-box-shadow:-0.5px -6.67px 14px 0px rgba(var(--theme-deafult), 0.18);box-shadow:-0.5px -6.67px 14px 0px rgba(var(--theme-deafult), 0.18);color:#fff !important}.round-badge-secondary{border-radius:6px;background-color:#89d4df;-webkit-box-shadow:-0.5px -6.67px 14px 0px rgba(137,212,223,0.18);box-shadow:-0.5px -6.67px 14px 0px rgba(137,212,223,0.18);color:#fff !important}.round-ba


\":[{\"@id\":\"d3f:DiskErasure\",\"d3f:d3fend-id\":\"D3-DKE\",\"d3f:definition\":\"Disk Erasure is the process of securely deleting all data on a disk to ensure that it cannot be recovered by any means.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Disk Erasure\"},{\"@id\":\"d3f:DiskPartitioning\",\"d3f:d3fend-id\":\"D3-DKP\",\"d3f:definition\":\"Disk Partitioning is the process of dividing a disk into multiple distinct sections, known as partitions.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Disk Partitioning\"}],\"d3f:d3fend-id\":\"D3-DKF\",\"d3f:definition\":\"Disk Formatting is the process of preparing a data storage device, such as a hard drive, solid-state drive, or USB flash drive, for initial use.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Disk Formatting\"},{\"@id\":\"d3f:DNSCacheEviction\",\"d3f:d3fend-id\":\"D3-DNSCE\",\"d3f:definition\":\"Flushing DNS to clear any IP addresses or other DNS records from the cache.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"DNS Cache Eviction\"},{\"@id\":\"d3f:RegistryKeyDeletion\",\"d3f:d3fend-id\":\"D3-RKD\",\"d3f:definition\":\"Delete a registry key.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Registry Key Deletion\"}],\"d3f:d3fend-id\":\"D3-OE\",\"d3f:definition\":\"Terminate or remove an object from a host machine. This is the broadest class for object eviction.\",\"rdfs:label\":\"Object Eviction\"},{\"@id\":\"d3f:ProcessEviction\",\"children\":[{\"@id\":\"d3f:ProcessTermination\",\"d3f:d3fend-id\":\"D3-PT\",\"d3f:definition\":\"Terminating a running application process on a computer system.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"2\"},\"rdfs:label\":\"Process Termination\"},{\"@id\":\"d3f:ProcessSuspension\",\"d3f:d3fend-id\":\"D3-PS\",\"d3f:definition\":\"Suspending a running process on a computer system.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Process Suspension\"},{\"@id\":\"d3f:HostShutdown\",\"children\":[{\"@id\":\"d3f:HostReboot\",\"d3f:d3fend-id\":\"D3-HR\",\"d3f:definition\":\"Initiating a host's reboot sequence to terminate all running processes.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Host Reboot\"}],\"d3f:d3fend-id\":\"D3-HS\",\"d3


BigEndian.PutUint64(key[14:], id)

	return key
}

func ParseDeviceColumnKey(key []byte) (id uint64, columnName [2]byte, err error) {
	if len(key) != TableDevice.Size {
		err = fmt.Errorf("device: invalid key length, keyLen: %d", len(key))
		return
	}
	id = binary.BigEndian.Uint64(key[4:])
	columnName[0] = key[12]
	columnName[1] = key[13]
	return
}

func ParseDeviceSecondIndexKey(key []byte) (columnValue uint64, id uint64, err error) {
	if len(key) != TableDevice.SecondIndexSize {
		err = fmt.Errorf("device: second index invalid key length, keyLen: %d", len(key))
		return
	}
	columnValue = binary.BigEndian.Uint64(key[6:])
	id = binary.BigEndian.Uint64(key[14:])
	return
}

// ---------------------- Subscriber ----------------------

func NewSubscriberColumnKey(channelId string, channelType uint8, id uint64, columnName [2]byte) []byte {
	key := make([]byte, TableSubscriber.Size)
	channelHash := channelToNum(channelId, channelType)
	key[0] = TableSubscriber.Id[0]
	key[1] = TableSubscriber.Id[1]
	key[2] = dataTypeTable
	key[3] = 0
	binary.BigEndian.PutUint64(key[4:], channelHash)
	binary.BigEndian.PutUint64(key[12:], id)
	key[20] = columnName[0]
	key[21] = columnName[1]
	return key
}

// NewSubscriberIndexKey 创建一个唯一索引的 key
func NewSubscriberIndexKey(channelId string, channelType uint8, indexName [2]byte, primaryKey uint64) []byte {
	key := make([]byte, TableSubscriber.IndexSize)
	key[0] = TableSubscriber.Id[0]
	key[1] = TableSubscriber.Id[1]
	key[2] = dataTypeIndex
	key[3] = 0
	key[4] = indexName[0]
	key[5] = indexName[0]

	channelHash := channelToNum(channelId, channelType)
	binary.BigEndian.PutUint64(key[6:], channelHash)
	binary.BigEndian.PutUint64(key[14:], primaryKey)
	return key
}

func NewSubscriberSecondIndexKey(channelId string, channelType uint8, indexName [2]byte, columnValue uint64, id uint64) []byte {
	key := make([]byte, TableSubscriber.SecondIndexSize)
	key[0] = TableSubscriber.Id[0]
	key[1] = TableSubscriber.Id[1]
	key[2] = dataTypeSecondIndex
	key[3] = 0
	key[4] = indexName[0]
	key[5] = indexName[1]

	channelHash := channelToNum(channelId, channelType)
	binary.BigEndian.PutUint64(key[6:], channelHash)
	binary.BigEndian.PutUint64(key[14:], columnValue)
	binary.BigEndian.PutUint64(key[22:], id)
	return key
}

func ParseSubscriberSecondIndexKey(key []byte) (columnValue uint64, id uint64, err error) {
	if len(key) != TableSubscriber.SecondIndexSize {
		err = fmt.Errorf("subscriber: second index invalid key length, keyLen: %d", len(key))
		return
	}
	columnValue = binary.BigEndian.Uint64(key[14:])
	id = binary.BigEndian.Uint64(key[22:])
	return
}

func ParseSubscriberColumnKey(key []byte) (id uint64, columnName [2]byte, err error) {
	if len(key) != T


key));
    memset(&data, 0, sizeof(data));
    key.data  = hello; key.size=strlen(hello)+1;
    data.data = there; data.size=strlen(there)+1;
    int r=db->put(db, tid, &key, &data, 0);
    if (r!=0) printf("%s:%d i=%d r=%d (%s)\n", __FILE__, __LINE__, i, r, strerror(r));
    assert(r==0);
}

static void delete_a_random_item (DB *db, DB_TXN *tid, DB_TXN *bookx) {
    if (n_keys_mentioned==0) return;
    int ridx = myrandom()%n_keys_mentioned;
    int randv = random_keys_mentioned[ridx];
    DBT keyd;
    DBT vald;
    //printf("Delete %u\n", randv);
    dbt_init(&keyd, &randv, sizeof(randv));
    dbt_init(&vald, &randv, sizeof(randv));

    pending_i->del(pending_i, bookx, &keyd, 0);
    delete_in_mem(randv, &peni_count, peni_data);

    pending_d->put(pending_d, bookx, &keyd, &vald, 0);
    insert_in_mem(randv, randv, &pend_count, pend_data);

    db->del(db, tid, &keyd, DB_DELETE_ANY);
}

static void commit_items (DB_ENV *env, int UU(i)) {
    //printf("commit_items %d\n", i);
    DB_TXN *txn;
    int r=env->txn_begin(env, 0, &txn, 0); assert(r==0);
    DBC  *cursor;
    r = pending_i->cursor(pending_i, txn, &cursor, 0); assert(r==0);
    DBT k,v;
    memset(&k,0,sizeof(k));
    memset(&v,0,sizeof(v));
    //printf("%d items in peni\n", peni_count);
    while (cursor->c_get(cursor, &k, &v, DB_FIRST)==0) {
	assert(k.size==4);
	assert(v.size==4);
	int ki=*(int*)k.data;
	int vi=*(int*)v.data;
	//printf(" put %u %u\n", ki, vi);
	r=committed->put(committed, txn, dbt_init(&k, &ki, sizeof(ki)), dbt_init(&v, &vi, sizeof(vi)), 0);
	insert_in_mem(ki, vi, &com_count, com_data);
	assert(r==0);
	r=pending_i->del(pending_i, txn, &k, 0);
	assert(r==0);
    }
    r=cursor->c_close(cursor);
    assert(r==0);

    r = pending_d->cursor(pending_d, txn, &cursor, 0); assert(r==0);
    memset(&k,0,sizeof(k));
    memset(&v,0,sizeof(v));
    while (cursor->c_get(cursor, &k, &v, DB_FIRST)==0) {
	assert(k.size==4);
	assert(v.size==4);
	int ki=*(int*)k.data;
	int vi=*(int*)v.data;
	assert(ki==vi);
	//printf(" del %u\n", ki);
	committed->del(committed, txn, dbt_init(&k, &ki, sizeof(ki)), 0);
	delete_in_mem(ki, &com_count, com_data);
	// ignore result from that del
	r=pending_d->del(pending_d, txn, &k, 0);
	assert(r==0);
    }


$doc.bind("mouseup",g.proxy(this._eventHandler,this));this.root().show();this.trigger("aftershow")},hide:function(){this.root().unbind("mousedown",g.proxy(this._eventHandler,
this));this.defaultOpt.$doc.unbind("mouseup",g.proxy(this._eventHandler,this));this.root().hide();this.trigger("afterhide")},attachTo:function(a){var b=a.offset(),c=this.root(),d=this.defaultOpt.$wrap,e=d.offset();this.data("$scaleTarget",a);this.root().css({position:"absolute",width:a.width(),height:a.height(),left:b.left-e.left-parseInt(d.css("border-left-width"))-parseInt(c.css("border-left-width")),top:b.top-e.top-parseInt(d.css("border-top-width"))-parseInt(c.css("border-top-width"))})},getScaleTarget:function(){return this.data("$scaleTarget")[0]}});
UM.ui.define("colorpicker",{tpl:function(a){for(var b="ffffff 000000 eeece1 1f497d 4f81bd c0504d 9bbb59 8064a2 4bacc6 f79646 f2f2f2 7f7f7f ddd9c3 c6d9f0 dbe5f1 f2dcdb ebf1dd e5e0ec dbeef3 fdeada d8d8d8 595959 c4bd97 8db3e2 b8cce4 e5b9b7 d7e3bc ccc1d9 b7dde8 fbd5b5 bfbfbf 3f3f3f 938953 548dd4 95b3d7 d99694 c3d69b b2a2c7 92cddc fac08f a5a5a5 262626 494429 17365d 366092 953734 76923c 5f497a 31859b e36c09 7f7f7f 0c0c0c 1d1b10 0f243e 244061 632423 4f6128 3f3151 205867 974806 c00000 ff0000 ffc000 ffff00 92d050 00b050 00b0f0 0070c0 002060 7030a0 ".split(" "),
c='<div unselectable="on" onmousedown="return false" class="edui-colorpicker<%if (name){%> edui-colorpicker-<%=name%><%}%>" >

'+a.lang_themeColor+'

',d=0;d<b.length;d++)d&&0===d%10&&(c+="
"+(60==d?'
'+a.lang_standardColor+"
":"")+"
"),c+=70>d?'d||60<=d?"border-width:1px;":10<=d&&20>d?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'">	':"";return c+"

"},init:function(a){var b=this;b.root(g(g.parseTmpl(b.supper.mergeTpl(b.tpl(a)),a)));b.root().on("click",function(a){b.trigger("pickcolor",g(a.target).data("color"))})}},"popup");(function(){UM.ui.define("combobox",function(){return{tpl:'<ul class="dropdown-menu


ng, bus_id);
	if (!new_bus)
		return -ENODEV;

	ret = of_mdiobus_register(new_bus, pdev->dev.of_node);
	if (ret)
		mdio_gpio_bus_deinit(&pdev->dev);

	return ret;
}

static int mdio_gpio_remove(struct platform_device *pdev)
{
	mdio_gpio_bus_destroy(&pdev->dev);

	return 0;
}

static const struct of_device_id mdio_gpio_of_match[] = {
	{ .compatible = "virtual,mdio-gpio", },
	{ .compatible = "microchip,mdio-smi0" },
	{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mdio_gpio_of_match);

static struct platform_driver mdio_gpio_driver = {
	.probe = mdio_gpio_probe,
	.remove = mdio_gpio_remove,
	.driver		= {
		.name	= "mdio-gpio",
		.of_match_table = mdio_gpio_of_match,
	},
};

module_platform_driver(mdio_gpio_driver);

MODULE_ALIAS("platform:mdio-gpio");
MODULE_AUTHOR("Laurent Pinchart, Paulius Zaleckas");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Generic driver for MDIO bus emulation using GPIO");


 returns

; ======================================================== _sigskp()
	.global	__sigskp
__sigskp:
;	repair_regs
; -------------------------------------------------------- repair_regs
	mtsrim	cr, 4-1
	loadm	0, 0, gr96, msp
	mtsr	ipc, gr96
	mtsr	ipa, gr97
	mtsr	ipb, gr98
	mtsr	q, gr99
;					 "pop" registers stack support
	mtsrim	cr, 2-1
	add	gr99, msp, 2*4
	loadm	0, 0, gr96, gr99
	add	lr1, gr96, 0
	add	rfb, gr97, 0
;					  "pop" remaining global registers
	mtsrim	cr, 25-1		; gr100-gr124
	add	gr96, msp, (4+2)*4
	loadm	0, 0, gr100, gr96
	add	msp, msp, (4+2+25)*4	; repair msp to save_regs entry value
; -------------------------------------------------------- end repair
	const	tav, 325		; HIF _sigskp
	asneq	69, gr1,gr1
	halt				; commit suicide if returns

; ======================================================== _sendsig()
; lr2 = signal number
	.global _raise
	.global	__sendsig
_raise:
__sendsig:
	const	tav, 326		; HIF sendsig
	asneq	69, gr1,gr1
	jmpi	lr0
	 nop

;
; ======================================================== signal()
;	lr2 = signal number
;	lr3 = handler address
	.global	_signal
_signal:
; the memory variable WindowSize must be initalised at the
; start when rfb and rab are a window size apart.
	const	v0, WindowSize		; get register cache size
	consth	v0, WindowSize
	load	0, 0, v1, v0
	cpeq	v1, v1, 0
	jmpf	v1, WindowSizeOK
	 sub	v1, rfb, rab		; rfb-rab = WINDOW_SIZE
	store	0, 0, v1, v0
WindowSizeOK:
	const	v1, SigEntry
	consth	v1, SigEntry
	sub	v3, lr2, 1		; get handler index
	sll	v3, v3, 2		; pointer to addresses
	add	v1, v1, v3
	store	0,0, lr3, v1		; save new handler

	const	lr2, sigcode
	consth	lr2, sigcode
	;Fall through to __signal
; ======================================================== _signal()
	.global	__signal
__signal:
	const	tav, 321		; HIF signal
	asneq	69, gr1,gr1
	jmpi	lr0
	 nop


eg));
  }

  if (divisor == -1) {  // Nice shortcut, not needed for correctness.
    __ Dsubu(result, zero_reg, dividend);
    return;
  }
  uint16_t shift = WhichPowerOf2Abs(divisor);
  if (shift == 0) {
    __ Move(result, dividend);
  } else if (shift == 1) {
    __ dsrl32(result, dividend, 31);
    __ Daddu(result, dividend, Operand(result));
  } else {
    __ dsra32(result, dividend, 31);
    __ dsrl32(result, result, 32 - shift);
    __ Daddu(result, dividend, Operand(result));
  }
  if (shift > 0) __ dsra(result, result, shift);
  if (divisor < 0) __ Dsubu(result, zero_reg, result);
}

void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
  Register dividend = ToRegister(instr->dividend());
  int32_t divisor = instr->divisor();
  Register result = ToRegister(instr->result());
  DCHECK(!dividend.is(result));

  if (divisor == 0) {
    DeoptimizeIf(al, instr->environment());
    return;
  }

  // Check for (0 / -x) that will produce negative zero.
  HDiv* hdiv = instr->hydrogen();
  if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
    DeoptimizeIf(eq, instr->environment(), dividend, Operand(zero_reg));
  }

  __ TruncatingDiv(result, dividend, Abs(divisor));
  if (divisor < 0) __ Subu(result, zero_reg, result);

  if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
    __ Dmul(scratch0(), result, Operand(divisor));
    __ Dsubu(scratch0(), scratch0(), dividend);
    DeoptimizeIf(ne, instr->environment(), scratch0(), Operand(zero_reg));
  }
}

// TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI.
void LCodeGen::DoDivI(LDivI* instr) {
  HBinaryOperation* hdiv = instr->hydrogen();
  Register dividend = ToRegister(instr->dividend());
  Register divisor = ToRegister(instr->divisor());
  const Register result = ToRegister(instr->result());

  // On MIPS div is asynchronous - it will run in the background while we
  // check for special cases.
  __ Ddiv(result, dividend, divisor);

  // Check for x / 0.
  if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
    DeoptimizeIf(eq, instr->environment(), divisor, Operand(zero_reg));
  }

  // Check for (0 / -x) that will produce negative zero.
  if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) {
    Label left_not_zero;
    __ Branch(&left_not_zero, ne, dividend, Operand(zero_reg));
    DeoptimizeIf(lt, instr->environment(), divisor, Operand(zero_reg));
    __ bind(&left_not_zero);
  }

  // Check for (kMinInt / -1).
  if (hdiv->CheckFlag(HValue::kCanOverflow) &&
      !hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
    Label left_not_min_int;
    __ Branch(&left_not_min_int, ne, dividend, Operand(kMinInt));
    DeoptimizeIf(eq, instr->environment(), divisor, Operand(-1));
    __ bind(&left_not_min_int);
  }

  if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
    // Calculate remainder.
    Register remainder = ToRegister(instr->temp());
    if (kArchVariant != kM


/*
 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using Geocoding.ViewModels;
using System;

namespace Geocoding.Tizen.Wearable.Services
{


r(err).Error("failed to refresh RBAC cache")
	}
	return nil
}

func (s *service) Get(parameters apiInterface.Parameters) (*v1.Role, error) {
	return s.dao.Get(parameters.Project, parameters.Name)
}

func (s *service) List(q *role.Query, params apiInterface.Parameters) ([]*v1.Role, error) {
	query, err := manageQuery(q, params)
	if err != nil {
		return nil, err
	}
	return s.dao.List(query)
}

func (s *service) RawList(q *role.Query, params apiInterface.Parameters) ([]json.RawMessage, error) {
	query, err := manageQuery(q, params)
	if err != nil {
		return nil, err
	}
	return s.dao.RawList(query)
}

func (s *service) MetadataList(q *role.Query, params apiInterface.Parameters) ([]api.Entity, error) {
	query, err := manageQuery(q, params)
	if err != nil {
		return nil, err
	}
	return s.dao.MetadataList(query)
}

func (s *service) RawMetadataList(q *role.Query, params apiInterface.Parameters) ([]json.RawMessage, error) {
	query, err := manageQuery(q, params)
	if err != nil {
		return nil, err
	}
	return s.dao.RawMetadataList(query)
}

func manageQuery(q *role.Query, params apiInterface.Parameters) (*role.Query, error) {
	// Query is copied because it can be modified by the toolbox.go: listWhenPermissionIsActivated(...) and need to `q` need to keep initial value
	query, err := deep.Copy(q)
	if err != nil {
		return nil, fmt.Errorf("unable to copy the query: %w", err)
	}
	if len(query.Project) == 0 {
		query.Project = params.Project
	}
	return query, nil
}
// Copyright 2024 The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package config

import (
	"context"
	"encoding/base64"
	"fmt"
	"net"
	"net/http"
	"time"

	"github.com/perses/perses/pkg/client/perseshttp"
	"github.com/perses/perses/pkg/client/transport"
	"github.com/perses/perses/pkg/model/api"
	"github.com/perses/perses/pkg/model/api/v1/common"
	"github.com/perses/perses/pkg/model/api/v1/secret"
	"golang.org/x/oauth2"
	"golang.org/x/oauth2/clientcredentials"
)

const connectionTimeout = 30 * time.Second

// PublicRestConfigClient is the struct that should be used when printing the config
type PublicRestConfigClient struct {
	URL        *common.URL             `json:"url" yaml:"url"`
	NativeAuth *api.PublicAuth         `json:"native_auth,omitempty" yaml:"native_auth,omitempty"`
	Oauth      *secret.PublicOAuth     `json:"oauth_config,omitempty" yaml:"oauth_config,omitempty"`
	BasicAuth  *secret.PublicBasicAuth `json:"basic_auth,omitempty" yaml:"basic_auth,omitempty"`
	// The HTTP authorization credentials for the targets.
	Authorization *secret.PublicAuthorization `json:"authorization,omitempty" yaml


Unmarshal(t *testing.T) {
	for _, tx := range dsUnmarshalTests {
		var out dsTest
		if ret := runTestUnmarshal(&out, tx.Input, &tx.Output, tx.HasError); ret != "" {
			t.Error(ret)
		}
	}
}

// generalized test functions

func runTestMarshal(input any, output string, hasError bool) (ret string) {
	var (
		buf    bytes.Buffer
		failed bool
	)

	err := json.NewEncoder(&buf).Encode(input)

	out := strings.TrimSpace(buf.String())

	failed = failed || (err == nil && hasError)
	failed = failed || (out != output)

	if failed {
		ret = fmt.Sprintf("Marshal(%s) => '%s', 'err != nil => %v'; expected '%s', 'err != nil => %v'.", input, out, err != nil, output, hasError)
	}

	return
}

func runTestUnmarshal(out eq, input string, output eq, hasError bool) (ret string) {
	err := json.NewDecoder(strings.NewReader(input)).Decode(&out)

	failed := false
	failed = failed || (err == nil && hasError)
	failed = failed || (!out.Equal(output))

	if failed {
		ret = fmt.Sprintf("Unmarshal(%s) => '%s', 'err != nil => %v'; expected '%s', 'err != nil => %v'.", input, out, err != nil, output, hasError)
	}

	return
}

// test structures

type dtTest struct {
	Date DateTime `json:"dt"`
}

func (dt *dtTest) Equal(i interface{}) bool {
	o, ok := i.(*dtTest)
	return ok && time.Time(dt.Date).Equal(time.Time(o.Date))
}

type eq interface {
	Equal(i interface{}) bool
}

type dsTest struct {
	Duration DurationSec `json:"ds"`
}

func (ds *dsTest) Equal(i interface{}) bool {
	o, ok := i.(*dsTest)
	return ok && time.Duration(ds.Duration) == time.Duration(o.Duration)
}
package ari

// Logging represents a communication path to an
// Asterisk server for working with logging resources
type Logging interface {
	// Create creates a new log.  The levels are a comma-separated list of
	// logging levels on which this channel should operate.  The name of the
	// channel should be the key's ID.
	Create(key *Key, levels string) (*LogHandle, error)

	// Data retrives the data for a logging channel
	Data(key *Key) (*LogData, error)

	// Data retrives the data for a logging channel
	Get(key *Key) *LogHandle

	// List the logs
	List(filter *Key) ([]*Key, error)

	// Rotate rotates the log
	Rotate(key *Key) error

	// Delete deletes the log
	Delete(key *Key) error
}

// LogData represents the log data
type LogData struct {
	// Key is the cluster-unique identifier for this logging channel
	Key *Key `json:"key"`

	// Name is the name of the logging channel
	Name string `json:"channel"`

	// Levels is a comma-separated list of logging levels for this channel
	Levels string `json:"levels"`

	// Type indicates the type of logs for this channel
	Types string `json:"types"`

	// Status indicates whether this logging channel is enabled
	Status string `json:"status"`
}

// NewLogHandle builds a new log handle given the `Key` and `Logging` client
func NewLogHandle(key *Key, l Logging) *LogHandle {
	return &LogHandle{
		key: key,
		c:   l,
	}
}

// LogHandle provides an interface to manipulate a logging channel
type LogHandle struct {
	key *Key
	c   Logging
}

// ID returns the ID (name) of the logging channel
func (l *LogHandle) ID()


erHostIDs := make([]int64, 0)
	var innerModuleID int64
	transferToNormalPlans := make(map[string]*metadata.HostsModuleRelation)
	for _, plan := range transferPlans {
		// do not need to transfer, skip
		if len(plan.ToAddToModules) == 0 && len(plan.ToRemoveFromModules) == 0 {
			delete(svcInstMap, plan.HostID)
			continue
		}

		// transfer to inner modules
		if plan.IsTransferToInnerModule {
			innerModuleID = plan.FinalModules[0]
			transferToInnerHostIDs = append(transferToInnerHostIDs, plan.HostID)
			if len(svcInstMap[plan.HostID]) != 0 {
				delete(svcInstMap, plan.HostID)
			}
			continue
		}

		var transKey string
		var isIncrement bool
		var moduleIDs []int64

		if len(plan.ToRemoveFromModules) == 0 {
			isIncrement = true
			moduleIDs = plan.ToAddToModules
		} else {
			isIncrement = false
			moduleIDs = plan.FinalModules
		}

		if isRemoveFromAll || isRemoveFromNone {
			transKey = sameKey
		} else {
			// we use is increment and sorted module ids to aggregate hosts with the same transfer option
			sort.Slice(moduleIDs, func(i, j int) bool { return moduleIDs[i] < moduleIDs[j] })
			transKey = fmt.Sprintf("%v%v", isIncrement, moduleIDs)
		}

		if _, exists := transferToNormalPlans[transKey]; !exists {
			transferToNormalPlans[transKey] = &metadata.HostsModuleRelation{
				ApplicationID:            bizID,
				HostID:                   []int64{plan.HostID},
				DisableAutoCreateSvcInst: true,
				IsIncrement:              isIncrement,
				ModuleID:                 moduleIDs,
			}
		} else {
			transferToNormalPlans[transKey].HostID = append(transferToNormalPlans[transKey].HostID, plan.HostID)
		}

		// the mark here is to adapt to the host transfer scenario, the user does not need the attributes of the host
		// dimension to be automatically applied.
		transferToNormalPlans[transKey].DisableTransferHostAutoApply = !changed
		for moduleID := range svcInstMap[plan.HostID] {
			if !util.InArray(moduleID, plan.FinalModules) {
				delete(svcInstMap[plan.HostID], moduleID)
			}
		}
	}

	var transToInnerOpt *metadata.TransferHostToInnerModule
	if len(transferToInnerHostIDs) > 0 {
		transToInnerOpt = &metadata.TransferHostToInnerModule{ApplicationID: bizID, HostID: transferToInnerHostIDs,
			ModuleID: innerModuleID}
	}

	return transToInnerOpt, transferToNormalPlans
}

func (s *Service) transferHostWithAutoClearServiceInstance(
	kit *rest.Kit,
	bizID int64,
	option metadata.TransferHostWithAutoClearServiceInstanceOption,
	transToInnerOpt *metadata.TransferHostToInnerModule,
	transToNormalPlans map[string]*metadata.HostsModuleRelation,
	svcInstMap map[int64]map[int64][]metadata.ProcessInstanceDetail,
	hostIDs []int64) error {

	audit := auditlog.NewHostModuleLog(s.CoreAPI.CoreService(), option.HostIDs)
	if err := audit.WithPrevious(kit); err != nil {
		blog.Errorf("generate host transfer audit failed, err: %v, HostIDs: %+v, rid: %s", err, option.HostIDs, kit.Rid)


units.Units
import edu.wpi.first.units.measure.Angle
import edu.wpi.first.units.measure.Voltage
import edu.wpi.first.wpilibj2.command.Command
import edu.wpi.first.wpilibj2.command.Commands
import edu.wpi.first.wpilibj2.command.SubsystemBase
import edu.wpi.first.wpilibj2.command.button.Trigger
import org.littletonrobotics.junction.AutoLogOutput
import org.littletonrobotics.junction.Logger
import org.littletonrobotics.junction.networktables.LoggedNetworkNumber

class Gripper(private val io: GripperIO) : SubsystemBase() {
    private val kV = 6
    var rollerAngle: Angle = Units.Rotations.zero()
    private val tuningVoltage =
        LoggedNetworkNumber("/Tuning/Gripper/Voltage", 0.0)

    @AutoLogOutput
    val hasCoral: Trigger =
        Trigger { io.inputs.sensorDistance < DISTANCE_THRESHOLD }
            .debounce(
                DEBOUNCE_TIME.`in`(Units.Seconds),
                Debouncer.DebounceType.kBoth
            )

    @AutoLogOutput
    val autoHasCoral: Trigger = Trigger {
        io.inputs.sensorDistance < DISTANCE_THRESHOLD
    }

    @AutoLogOutput
    val hasAlgae: Trigger =
        Trigger { io.inputs.current > ALGAE_CURRENT }
            .debounce(
                DEBOUNCE_TIME.`in`(Units.Seconds),
                Debouncer.DebounceType.kBoth
            )

    private fun setVoltage(voltage: Voltage): Command =
        startEnd({ io.setVoltage(voltage) }, { io.setVoltage(STOP_VOLTAGE) })

    private fun getVoltage(): Double {
        return io.inputs.appliedVoltage.`in`(Units.Volts)
    }
    fun tuningVoltage(): Command =
        setVoltage(Units.Volts.of(tuningVoltage.get()))
            .withName("Gripper/Tuning")

    fun intake(): Command =
        setVoltage(INTAKE_VOLTAGE).withName("Gripper/Intake")

    fun slowOuttake(reversed: Boolean = false): Command =
        setVoltage(
                if (reversed) -SLOW_OUTTAKE_VOLTAGE else SLOW_OUTTAKE_VOLTAGE
            )
            .withName("Gripper/SlowOuttake")

    fun outtake(reversed: Boolean = false): Command =
        setVoltage(if (reversed) -OUTTAKE_VOLTAGE else OUTTAKE_VOLTAGE)
            .withName("Gripper/Outtake")

    fun outtakeL3(): Command =
        setVoltage(OUTTAKE_L3).withName("Gripper/L3Outtake")

    fun fastOuttake(): Command =
        setVoltage(FAST_OUTTAKE_VOLTAGE).withName("Gripper/FastOuttake")

    fun removeAlgae(): Command =
        setVoltage(REMOVE_ALGAE_VOLTAGE).withName("Gripper/RemoveAlgae")

    fun intakeAlgae(): Command =
        Commands.runOnce({ io.setVoltage(INTAKE_ALGAE_VOLTAGE) })
            .withName("Gripper/IntakeAlgae")

    fun outtakeAlgae(): Command =
        setVoltage(OUTTAKE_ALGAE_VOLTAGE).withName("Gripper/OuttakeAlgae")

    override fun periodic() {
        rollerAngle += Units.Rotations.of(getVoltage() * kV * 0.02)
        io.updateInputs()


tor:
                final_res_batch[i] = res

            assert all(final_res is not None for final_res in final_res_batch)

            final_res_batch_checked = cast(list[PoolingRequestOutput],
                                           final_res_batch)

            response = self.request_output_to_pooling_response(
                final_res_batch_checked,
                request_id,
                created_time,
                model_name,
                request.encoding_format,
            )
        except asyncio.CancelledError:
            return self.create_error_response("Client disconnected")
        except ValueError as e:
            # TODO: Use a aphrodite-specific Validation Error
            return self.create_error_response(str(e))

        return response

    def request_output_to_pooling_response(
        self,
        final_res_batch: list[PoolingRequestOutput],
        request_id: str,
        created_time: int,
        model_name: str,
        encoding_format: Literal["float", "base64"],
    ) -> PoolingResponse:
        items: list[PoolingResponseData] = []
        num_prompt_tokens = 0

        for idx, final_res in enumerate(final_res_batch):
            item = PoolingResponseData(
                index=idx,
                data=_get_data(final_res.outputs, encoding_format),
            )
            prompt_token_ids = final_res.prompt_token_ids

            items.append(item)
            num_prompt_tokens += len(prompt_token_ids)

        usage = UsageInfo(
            prompt_tokens=num_prompt_tokens,
            total_tokens=num_prompt_tokens,
        )

        return PoolingResponse(
            id=request_id,
            created=created_time,
            model=model_name,
            data=items,
            usage=usage,
        )