cnt.Y = levRecInner.Y + bsU
				cntCompanion = pl.cnt
				cntCompanion.Y += bsU2
			}

			if mods.carrot {
				mrcarrot.rec = rl.NewRectangle(cntCompanion.X-mrcarrot.rec.Width/2, cntCompanion.Y-mrcarrot.rec.Width/2, mrcarrot.rec.Width, mrcarrot.rec.Width)
			}
			if mods.alien {
				mralien.rec = rl.NewRectangle(cntCompanion.X-mralien.rec.Width/2, cntCompanion.Y-mralien.rec.Width/2, mralien.rec.Width, mralien.rec.Width)
			}
			if mods.planty {
				mrplanty.rec = rl.NewRectangle(cntCompanion.X-mrplanty.rec.Width/2, cntCompanion.Y-mrplanty.rec.Width/2, mrplanty.rec.Width, mrplanty.rec.Width)
			}
		}
	}

	//TIMERS
	if pl.atkTimer > 0 {
		pl.atkTimer--
		if pl.atkTimer == 1 {
			pl.img.X = pl.imgWalkX
			pl.atk = false
		}
	}
}
func upPlayerRec() { //MARK:UP PLAYER REC CENTER CHANGED
	pl.rec = rl.NewRectangle(pl.cnt.X-pl.rec.Width/2, pl.cnt.Y-pl.rec.Width/2, pl.rec.Width, pl.rec.Width)
	pl.crec = rl.NewRectangle(pl.cnt.X-pl.crec.Width/2, pl.cnt.Y-pl.crec.Height/2, pl.crec.Width, pl.crec.Height)
	pl.arec = rl.NewRectangle(pl.cnt.X-pl.arec.Width/2, pl.cnt.Y-pl.arec.Height/2, pl.arec.Width, pl.arec.Height)
	pl.atkrec = rl.NewRectangle(pl.cnt.X-pl.atkrec.Width/2, pl.cnt.Y-pl.atkrec.Height/2, pl.atkrec.Width, pl.atkrec.Height)
}

// MARK:MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE MAKE
func makeaudio() { //MARK:MAKE AUDIO

	backMusic = append(backMusic, rl.LoadMusicStream("audio/1.ogg"))  //0
	backMusic = append(backMusic, rl.LoadMusicStream("audio/2.ogg"))  //1
	backMusic = append(backMusic, rl.LoadMusicStream("audio/16.ogg")) //2

	sfx = append(sfx, rl.LoadSound("audio/3.ogg"))  //0 PLAYER SWORD
	sfx = append(sfx, rl.LoadSound("audio/4.ogg"))  //1 ENEMY HIT1
	sfx = append(sfx, rl.LoadSound("audio/5.ogg"))  //2 ENEMY HIT2
	sfx = append(sfx, rl.LoadSound("audio/6.ogg"))  //3 SPRING
	sfx = append(sfx, rl.LoadSound("audio/7.ogg"))  //4 SPEAR
	sfx = append(sfx, rl.LoadSound("audio/8.ogg"))  //5 OIL BARREL BURN
	sfx = append(sfx, rl.LoadSound("audio/9.ogg"))  //6 POWER UP BLOCK DESTROY
	sfx = append(sfx, rl.LoadSound("audio/10.ogg")) //7 ENEMY DEATH
	sfx = append(sfx, rl.LoadSound("audio/11.ogg")) //8 ITEM PICKUP
	sfx = append(sfx, rl.LoadSound("audio/12.ogg")) //9 TELEPORT
	sfx = append(sfx, rl.LoadSound("audio/13.ogg")) //


iza el orbe de traslado que está en el Sagrario Interior de la Aguja Furia del Sol, en la Ciudad de Lunargenta para cruzar a Entrañas. Cuando llegues, utiliza el elevador hasta la ciudad. Usa tus mapas si necesitas orientación para encontrar el Barrio Real.",
    ["O"] = "Ve al Barrio Real, en Entrañas, y entrégale el collar de Sylvanas a Lady Sylvanas Brisaveloz.",
    ["T"] = "Viaje a Entrañas",
  },
  [9181] = {
    ["D"] = "Páguese al portador de esta libranza con una insignia de su elección, una vez completada la orden de trabajo contratada.$B$BOrden de trabajo BS-697:$B$B3 martillos volcánicos.$B$BTodas las órdenes completadas deben ser entregadas al maestro de manada Mazadura en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.$B$BEste contrato quedará anulado en caso de alteraciones o daños.$B$B-Comandante de envíos Metz, El Alba Argenta",
    ["O"] = "Entrega 3 martillos volcánicos y la libranza del artesano: martillo volcánico al maestro de manada Mazadura que está en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.",
    ["T"] = "Libranza del artesano: martillo volcánico",
  },
  [9182] = {
    ["D"] = "Páguese al portador de esta libranza con una insignia de su elección, una vez completada la orden de trabajo contratada.$B$BOrden de trabajo BS-6020:$B$B3 hachas de batalla de torio enormes.$B$BTodas las órdenes completadas deben ser entregadas al maestro de manada Mazadura en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.$B$BEste contrato quedará anulado en caso de alteraciones o daños.$B$B-Comandante de envíos Metz, El Alba Argenta",
    ["O"] = "Entrega 3 hachas de batalla de torio enormes y la libranza del artesano: hacha de batalla de torio enorme al maestro de manada Mazadura que está en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.",
    ["T"] = "Libranza del artesano: hacha de batalla de torio enorme",
  },
  [9183] = {
    ["D"] = "Páguese al portador de esta libranza con una insignia de su elección, una vez completada la orden de trabajo contratada.$B$BOrden de trabajo BS-80:$B$B3 aros radiantes.$B$BTodas las órdenes completadas deben ser entregadas al maestro de manada Mazadura en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.$B$BEste contrato quedará anulado en caso de alteraciones o daños.$B$B-Comandante de envíos Metz, El Alba Argenta",
    ["O"] = "Entrega 3 aros radiantes y la libranza del artesano: aro radiante al maestro de manada Mazadura que está en la Capilla de la Esperanza de la Luz, en las Tierras de la Peste del Este.",
    ["T"] = "Libranza del artesano: aro radiante",
  },
  [9184] = {
    ["D"] = "Páguese al portador de esta libranza con una insignia de su elección, una vez completada la orden de trabajo contratada.$B$BOrden de trabajo LW-971:$


i&&h.x>=i||(f.x>=i?f=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new t.default$1(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new t.default$1(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),c&&f.equals(c[c.length-1])||(c=[f],o.push(c)),c.push(h)))))}return o}(r.geometry,0,0,t.default$8,t.default$8);z<O.length;z+=1)for(var I=O[z],P=0,D=a(I,k,T,n.vertical||n.horizontal,i,24,_,e.overscaling,t.default$8);P<D.length;P+=1){var R=D[P],B=n.horizontal;B&&y(e,B.text,C,R)||L(I,R)}else if("Polygon"===r.type)for(var F=0,N=t.default$26(r.geometry,0);F<N.length;F+=1){var j=N[F],V=h(j,16);L(j[0],new t.default$25(V.x,V.y,0))}else if("LineString"===r.type)for(var U=0,q=r.geometry;U<q.length;U+=1){var H=q[U];L(H,new t.default$25(H[0].x,H[0].y,0))}else if("Point"===r.type)for(var G=0,W=r.geometry;G<W.length;G+=1)for(var Y=0,X=W[G];Y<X.length;Y+=1){var Z=X[Y];L([Z],new t.default$25(Z.x,Z.y,0))}}function m(e,r,n,i,a,o,s,l,c,u,f,h){var p=function(e,r,n,i,a,o){for(var s=n.layout.get("text-rotate").evaluate(a)*Math.PI/180,l=n.layout.get("text-offset").evaluate(a).map(function(t){return 24*t}),c=r.positionedGlyphs,u=[],f=0;f<c.length;f++){var h=c[f],p=o[h.glyph];if(p){var d=p.rect;if(d){var g=t.GLYPH_PBF_BORDER+1,v=p.metrics.advance/2,m=i?[h.x+v,h.y]:[0,0],y=i?[0,0]:[h.x+v+l[0],h.y+l[1]],x=p.metrics.left-g-v+y[0],b=-p.metrics.top-g+y[1],_=x+d.w,w=b+d.h,k=new t.default$1(x,b),M=new t.default$1(_,b),A=new t.default$1(x,w),T=new t.default$1(_,w);if(i&&h.vertical){var S=new t.default$1(-v,v),E=-Math.PI/2,C=new t.default$1(5,0);k._rotateAround(E,S)._add(C),M._rotateAround(E,S)._add(C),A._rotateAround(E,S)._add(C),T._rotateAround(E,S)._add(C)}if(s){var L=Math.sin(s),z=Math.cos(s),O=[z,-L,L,z];k._matMult(O),M._matMult(O),A._matMult(O),T._matMult


: Payload size different than expected") end
end

-- Flight log - Cb Press - 0x2772

f.cb_press_press = ProtoField.double ("dji_mavic_flyrec.cb_press_press", "Press", base.DEC)
f.cb_press_temp = ProtoField.double ("dji_mavic_flyrec.cb_press_temp", "Temp", base.DEC)

local function flightrec_cb_press_dissector(payload, pinfo, subtree)
    local offset = 0

    subtree:add_le (f.cb_press_press, payload(offset, 8))
    offset = offset + 8

    subtree:add_le (f.cb_press_temp, payload(offset, 8))
    offset = offset + 8

    if (offset ~= 16) then subtree:add_expert_info(PI_MALFORMED,PI_ERROR,"Cb Press: Offset does not match - internal inconsistency") end
    if (payload:len() ~= offset) then subtree:add_expert_info(PI_PROTOCOL,PI_WARN,"Cb Press: Payload size different than expected") end
end

-- Flight log - Air Compensate Data - 0x2774

f.air_compensate_data_air_vbx = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_air_vbx", "Air Vbx", base.DEC)
f.air_compensate_data_air_vby = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_air_vby", "Air Vby", base.DEC)
f.air_compensate_data_comp_alti = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_comp_alti", "Comp Alti", base.DEC)
f.air_compensate_data_wind_spd = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_wind_spd", "Wind Spd", base.DEC)
f.air_compensate_data_wind_x = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_wind_x", "Wind X", base.DEC)
f.air_compensate_data_wind_y = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_wind_y", "Wind Y", base.DEC)
f.air_compensate_data_motorspd = ProtoField.float ("dji_mavic_flyrec.air_compensate_data_motorspd", "Motorspd", base.DEC)
f.air_compensate_data_vel_level = ProtoField.uint8 ("dji_mavic_flyrec.air_compensate_data_vel_level", "Vel Level", base.HEX)

local function flightrec_air_compensate_data_dissector(payload, pinfo, subtree)
    local offset = 0

    subtree:add_le (f.air_compensate_data_air_vbx, payload(offset, 4))
    offset = offset + 4

    subtree:add_le (f.air_compensate_data_air_vby, payload(offset, 4))
    offset = offset + 4

    subtree:add_le (f.air_compensate_data_comp_alti, payload(offset, 4))
    offset = offset + 4

    subtree:add_le (f.air_compensate_data_wind_spd, payload(offset, 4))
    offset = offset + 4

    subtree:add_le (f.air_compensa


}

  XLS_ASSERT_OK_AND_ASSIGN(std::string generated, tb->GenerateVerilog());
  ExpectVerilogEqualToGoldenFile(GoldenFilePath(kTestName, kTestdataPath),
                                 generated);

  XLS_ASSERT_OK(tb->Run());

  EXPECT_THAT(output, ElementsAre(UBits(0, 16), UBits(0, 16), UBits(1, 16),
                                  UBits(2, 16), UBits(3, 16), UBits(4, 16),
                                  UBits(5, 16), UBits(5, 16), UBits(5, 16),
                                  UBits(5, 16)));
}

TEST_P(ModuleTestbenchTest, IdentityPipelineRepeatZeroTimes) {
  VerilogFile f = NewVerilogFile();
  XLS_ASSERT_OK_AND_ASSIGN(
      Module * m, MakeTwoStageIdentityPipelineWithReset(&f, /*width=*/16));
  XLS_ASSERT_OK_AND_ASSIGN(
      std::unique_ptr<ModuleTestbench> tb,
      ModuleTestbench::CreateFromVastModule(m, GetSimulator(), "clk"));
  XLS_ASSERT_OK_AND_ASSIGN(
      ModuleTestbenchThread * input_thread,
      tb->CreateThread(
          "input driver",
          {DutInput{.port_name = "reset", .initial_value = UBits(1, 1)},
           DutInput{.port_name = "in", .initial_value = UBits(0, 16)}}));
  {
    SequentialBlock& seq = input_thread->MainBlock();
    seq.Set("reset", 0).Set("in", 1).NextCycle();
    seq.Set("in", 2).NextCycle();
    seq.Set("in", 3).NextCycle();
    seq.Set("in", 4).NextCycle();
    seq.Set("in", 5).NextCycle();
  }

  std::vector<Bits> output;
  XLS_ASSERT_OK_AND_ASSIGN(ModuleTestbenchThread * output_thread,
                           tb->CreateThread("output capture",
                                            /*dut_inputs=*/{}));
  {
    SequentialBlock& seq = output_thread->MainBlock();
    SequentialBlock& loop = seq.Repeat(0);
    loop.AtEndOfCycle().CaptureMultiple("out", &output);
  }

  XLS_ASSERT_OK(tb->Run());

  EXPECT_TRUE(output.empty());
}

TEST_P(ModuleTestbenchTest, IdentityPipelineRepeatWithExpectations) {
  VerilogFile f = NewVerilogFile();
  XLS_ASSERT_OK_AND_ASSIGN(
      Module * m, MakeTwoStageIdentityPipelineWithReset(&f, /*width=*/16));
  XLS_ASSERT_OK_AND_ASSIGN(
      std::unique_ptr<ModuleTestbench> tb,
      ModuleTestbench::CreateFromVastModule(m, GetSimulator(), "clk"));
  XLS_ASSERT_OK_AND_ASSIGN(
      ModuleTestbenchThread * input_thread,
      tb->CreateThreadDrivingAllInputs("input driver",
                                       /*default_value=*/ZeroOrX::kZero));
  {
    SequentialBlock& seq = input_thread->MainBlock();
    seq.Set("reset", 0).Set("in", 42).NextCycle();
  }

  std::vector<Bits> output;
  XLS_ASSERT_OK_AND_ASSIGN(ModuleTestbenchThread * output_thread,
                           tb->CreateThread("output capture",
                                            /*dut_inputs=*/{}));
  {
    SequentialBlock& seq = output_thread->MainBlock();
    // Advance a couple cycles to wait for the initial values to drain.
    seq.AdvanceNCycles(2);
    SequentialBlock& loop = seq.Repeat(10);
    loop.AtEndOfCycle().ExpectEq("out", UBits(42, 16));
  }

  XLS_ASSERT_OK(tb->Run());

  EXPECT_TRUE(output.empty());
}

TEST_P(ModuleTestbenchTest, IdentityPipelineRepeatWithFailedExpectations) {
  Veril


#!/usr/bin/env python3
import random

from scal3.interval_utils import *
from scal3.event_lib import JdOccurSet
from scal3 import core

def parseIntervalList(st, doShuffle=False):
	ls = []
	for part in st.split(" "):
		pp = part.split("-")
		if len(pp) == 1:
			start = end = int(pp[0])
		elif len(pp) == 2:
			start = int(pp[0])
			end = int(pp[1])
		else:
			raise ValueError(f"bad IntervalList string {st!r}")
		ls.append((start, end))
	if doShuffle:
		random.shuffle(ls)  # in-place
	# log.debug(ls)
	return ls

def testnormalizeIntervalList():
	testDict = {
		"10-20 20": "10-20 20",
		"10-20 20 20": "10-20 20",
		"10-20 20-30": "10-30",
		"10-20 20-30 30-40": "10-40",
		"10-20 20-30 25-40": "10-40",
		"1-10 14 2-5 9-13 16-18 17-20 15-16 25-30": "1-13 14 15-20 25-30",
		"60-70 0-40 10-50 20-30 80-90 70-80 85-100 110 55": "0-50 55 60-100 110",
	}

	for inpStr, ansStr in testDict.items():
		inpList = parseIntervalList(inpStr, True)
		ansList = parseIntervalList(ansStr, False)
		resList = normalizeIntervalList(inpList)
		resList = humanizeIntervalList(resList)
		if resList == ansList:
			log.info("OK")
		else:
			log.error(f"Failed: {resList!r} != {ansList!r}")

def testIntersection():
	testDict = {
		(
			"0-20",
			"10-30",
		): "10-20",

		(
			"10-30 40-50 60-80",
			"25-45",
		): "25-30 40-45",

		(
			"10-30 40-50 60-80",
			"25-45 50-60",
		): "25-30 40-45",

		(
			"10-30 40-50 60-80",
			"25-45 50-60 60",
		): "25-30 40-45 60",

		(
			"10-30 40-50 60-80",
			"25-45 48-70 60",
		): "25-30 40-45 48-50 60-70",

		(
			"10-30 40-50 60-80",
			"25-45 48-70",
		): "25-30 40-45 48-50 60-70",

		(
			"0-10 20-30 40-50 60-70",
			"1-2 6-7 11-12 16-17 21-22 26-27 27",
		): "1-2 6-7 21-22 26-27 27",
		(
			"0-15 16 17 30-50 70-90 110-120",
			"10-35 40-75 80-100 110",
		): "10-15 16 17 30-35 40-50 70-75 80-90 110",
	}

	for (list1Str, list2Str), answerStr in testDict.items():
		list1 = parseIntervalList(list1Str, True)
		list2 = parseIntervalList(list2Str, True)
		answer = parseIntervalList(answerStr, False)  # no shuffle
		result = intersectionOfTwoIntervalList(list1, list2)
		if result == answer:
			log.info("OK")
		else:
			log.error("Failed")
			log.info((list1Str, list2Str))
			log.info(result)
			log.info()

def testJdRanges():
	from pprint import pprint
	pprint(JdOccurSet([
		1, 3, 4, 5, 7, 9, 10, 11, 12, 13, 14, 18,
	]).calcJdRanges())

def testSimplifyNumList():
	from pprint import pprint
	pprint(simplifyNumList([
		1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 17, 18, 19, 21, 22, 23, 24,
	]))

def testOverlapsSpeed():
	from random import normalvariate
	from time import time
	N = 2000000
	a0, b0 = -1, 1
	b_mean = 0
	b_sigma = 2

	def getRandomPair():
		return sorted(
			normalvariate(b_mean, b_sigma)
			for i in (0, 1)
		)
	###
	data = []
	for i in range(N):
		a, b = getRandomPair()
		data.append((a, b))
	t0 = time()
	for a, b in data:
		ab_overlaps(a0, b0, a, b)
	log.info(f"{time()-t0:.2f}")

if __name__ == "__main__":
	import pprint
	testnormalizeIntervalList()
	testIntersection()
	testJdRanges()
	testSimplifyNumList()
	core.stopRunningThreads()


.0.0/14`) from the RFC-1918 private networks (e.g.
  /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range
  /// to use. This field is deprecated due to the deprecation of 2VM TPU. The
  /// end of life date for 2VM TPU is 2025-04-25.
  @core.Deprecated(
    'Not supported. Member documentation may have more information.',
  )
  core.String? tpuIpv4CidrBlock;

  /// Whether alias IPs will be used for pod IPs in the cluster.
  ///
  /// This is used in conjunction with use_routes. It cannot be true if
  /// use_routes is true. If both use_ip_aliases and use_routes are false, then
  /// the server picks the default IP allocation mode
  core.bool? useIpAliases;

  /// Whether routes will be used for pod IPs in the cluster.
  ///
  /// This is used in conjunction with use_ip_aliases. It cannot be true if
  /// use_ip_aliases is true. If both use_ip_aliases and use_routes are false,
  /// then the server picks the default IP allocation mode
  core.bool? useRoutes;

  IPAllocationPolicy({
    this.additionalIpRangesConfigs,
    this.additionalPodRangesConfig,
    this.autoIpamConfig,
    this.clusterIpv4Cidr,
    this.clusterIpv4CidrBlock,
    this.clusterSecondaryRangeName,
    this.createSubnetwork,
    this.defaultPodIpv4RangeUtilization,
    this.ipv6AccessType,
    this.networkTierConfig,
    this.nodeIpv4Cidr,
    this.nodeIpv4CidrBlock,
    this.podCidrOverprovisionConfig,
    this.servicesIpv4Cidr,
    this.servicesIpv4CidrBlock,
    this.servicesIpv6CidrBlock,
    this.servicesSecondaryRangeName,
    this.stackType,
    this.subnetIpv6CidrBlock,
    this.subnetworkName,
    this.tpuIpv4CidrBlock,
    this.useIpAliases,
    this.useRoutes,
  });

  IPAllocationPolicy.fromJson(core.Map json_)
    : this(
        additionalIpRangesConfigs:
            (json_['additionalIpRangesConfigs'] as core.List?)
                ?.map(
                  (value) => AdditionalIPRangesConfig.fromJson(
                    value as core.Map<core.String, core.dynamic>,
                  ),
                )
                .toList(),
        additionalPodRangesConfig:
            json_.containsKey('additionalPodRangesConfig')
                ? AdditionalPodRangesConfig.fromJson(
                  json_['additionalPodRangesConfig']
                      as core.Map<core.String, core.dynamic>,
                )
                : null,
        autoIpamConfig:
            json_.containsKey('autoIpamConfig')
                ? AutoIpamConfig.fromJson(
                  json_['autoIpamConfig']
                      as core.Map<core.String, core.dynamic>,
                )
                : null,
        clusterIpv4Cidr: json_['clusterIpv4Cidr'] as core.String?,
        clusterIpv4CidrBlock: json_['clusterIpv4CidrBlock'] as core.String?,
        clusterSecondaryRangeName:
            json_['clusterSecondaryRangeName'] as core.String?,
        createSubnetwork: json_['createSubnetwork'] as core.bool?,
        defaultPodIpv4RangeUtilization:
            (json_['defaultPodIpv4RangeUtilization'] as core.num?)?.toDouble(),
        ipv6AccessType: json_['ipv6AccessType'] as core.String?,
        networkTierConfig:


&mut V, _i: Member) -> Member {
    match _i {
        Member::Named(_binding_0, ) => {
            Member::Named (
                _visitor.fold_ident(_binding_0),
            )
        }
        Member::Unnamed(_binding_0, ) => {
            Member::Unnamed (
                _visitor.fold_index(_binding_0),
            )
        }
    }
}
# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
    match _i {
        Meta::Word(_binding_0, ) => {
            Meta::Word (
                _visitor.fold_ident(_binding_0),
            )
        }
        Meta::List(_binding_0, ) => {
            Meta::List (
                _visitor.fold_meta_list(_binding_0),
            )
        }
        Meta::NameValue(_binding_0, ) => {
            Meta::NameValue (
                _visitor.fold_meta_name_value(_binding_0),
            )
        }
    }
}
# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
    MetaList {
        ident: _visitor.fold_ident(_i . ident),
        paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
        nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
    }
}
# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
    MetaNameValue {
        ident: _visitor.fold_ident(_i . ident),
        eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
        lit: _visitor.fold_lit(_i . lit),
    }
}
# [ cfg ( feature = "full" ) ]
pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
    MethodSig {
        constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
        unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
        abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
        ident: _visitor.fold_ident(_i . ident),
        decl: _visitor.fold_fn_decl(_i . decl),
    }
}
# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
    MethodTurbofish {
        colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
        lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
        args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
        gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
    }
}
# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
pub fn fold_nested


= status)
			ealg_list[i].available = status;
	}

	for (i = 0; i < calg_entries(); i++) {
		status = crypto_has_comp(calg_list[i].name, 0,
					 CRYPTO_ALG_ASYNC);
		if (calg_list[i].available != status)
			calg_list[i].available = status;
	}
}
EXPORT_SYMBOL_GPL(xfrm_probe_algs);

int xfrm_count_pfkey_auth_supported(void)
{
	int i, n;

	for (i = 0, n = 0; i < aalg_entries(); i++)
		if (aalg_list[i].available && aalg_list[i].pfkey_supported)
			n++;
	return n;
}
EXPORT_SYMBOL_GPL(xfrm_count_pfkey_auth_supported);

int xfrm_count_pfkey_enc_supported(void)
{
	int i, n;

	for (i = 0, n = 0; i < ealg_entries(); i++)
		if (ealg_list[i].available && ealg_list[i].pfkey_supported)
			n++;
	return n;
}
EXPORT_SYMBOL_GPL(xfrm_count_pfkey_enc_supported);

MODULE_LICENSE("GPL");


using FontAwesome5;
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace EQLogParser
{
  public partial class MessageWindow
  {
    public bool IsYes2Clicked;
    public bool IsYes1Clicked;
    public bool MergeOption;
    public enum IconType { Question, Save, Warn, Info }
    private readonly string _copyData;
    private readonly Func<Task> _yes1Callback;

    public MessageWindow(string text, string caption, string copyData, string yes1, Func<Task> yes1Callback) : this(text, caption, IconType.Info, yes1)
    {
      _copyData = copyData;
      _yes1Callback = yes1Callback;
      copyLink.Visibility = Visibility.Visible;
      cancelButton.Content = "Ok";
      UiUtil.SetClipboardText(copyData);
    }

    public MessageWindow(string text, string caption, IconType type = IconType.Warn, string yes1 = null, string yes2 = null,
      bool extra = false, bool noButtons = false)
    {
      MainActions.SetCurrentTheme(this);
      InitializeComponent();
      Owner = MainActions.GetOwner();
      textBox.Text = text;
      Title = caption;

      var brush = "";
      var image = EFontAwesomeIcon.None;
      if (type == IconType.Warn)
      {
        brush = "EQWarnForegroundBrush";
        image = EFontAwesomeIcon.Solid_ExclamationTriangle;
      }
      else if (type == IconType.Question)
      {
        brush = "EQMenuIconBrush";
        image = EFontAwesomeIcon.Regular_QuestionCircle;
      }
      else if (type == IconType.Save)
      {
        brush = "EQMenuIconBrush";
        image = EFontAwesomeIcon.Solid_Save;
      }
      else if (type == IconType.Info)
      {
        brush = "EQMenuIconBrush";
        image = EFontAwesomeIcon.Solid_InfoCircle;
      }

      cancelButton.Content = "Ok";

      if (noButtons)
      {
        cancelButton.Visibility = Visibility.Hidden;
      }

      if (!string.IsNullOrEmpty(yes1))
      {
        yesButton1.Content = yes1;
        yesButton1.Visibility = Visibility.Visible;
        cancelButto


s?__biz=MzIzMzE4NDU1OQ==&mid=2652034200&idx=2&sn=9ff01ca2f8852708ff185dcde817f959&chksm=f36ff8d8c41871ce4e5c6431bebc78d03b7053661fae9a3f984a855eaea00dcf3682bf0a196a&scene=58&subscene=0#rd)
  - [ ] [【安全圈】你接到的普通来电，可能是境外诈骗电话伪装](https://mp.weixin.qq.com/s?__biz=MzIzMzE4NDU1OQ==&mid=2652034200&idx=3&sn=57d9010053d2dd197e51f94f18b300af&chksm=f36ff8d8c41871ced9e055c1e9f37ec63d5f7496b5f60c7986cbb26e9e1976032757dc3d40b4&scene=58&subscene=0#rd)
  - [ ] [【安全圈】英国最大外包公司因勒索攻击损失1.75亿元，股价大跌](https://mp.weixin.qq.com/s?__biz=MzIzMzE4NDU1OQ==&mid=2652034200&idx=4&sn=34d23e85f35284410f9650b42b25646d&chksm=f36ff8d8c41871ce18d198a91a44114a99fcbccbbea8a02cad9433062d3e137253376d139dce&scene=58&subscene=0#rd)
- 中国信息安全
  - [ ] [关注 | 《公路水路关键信息基础设施安全保护管理办法》公布，今年6月1日起施行](https://mp.weixin.qq.com/s?__biz=MzA5MzE5MDAzOA==&mid=2664183744&idx=1&sn=be283cc490e158620dccf2b9d3e1167f&chksm=8b593539bc2ebc2f7acc8ee7477dc87d96141b5025991ec7f60ddc3afa66a7d5f887c586f10b&scene=58&subscene=0#rd)
  - [ ] [CNNVD | 关于微软多个安全漏洞的通报](https://mp.weixin.qq.com/s?__biz=MzA5MzE5MDAzOA==&mid=2664183744&idx=2&sn=16b2cd993f2a33ea858a9d9de489443b&chksm=8b593539bc2ebc2f58b8a664aff5e13a1afcdd82c794b59354190ce6e15b6240ecea2fd227d9&scene=58&subscene=0#rd)
  - [ ] [评论 | 警惕人工智能技术被滥用](https://mp.weixin.qq.com/s?__biz=MzA5MzE5MDAzOA==&mid=2664183744&idx=3&sn=201b69e273999ab0adc02e7edb571189&chksm=8b593539bc2ebc2f4950088757816263927b734180be6d346b9d2cad80bb6266280849dd6ff9&scene=58&subscene=0#rd)
  - [ ] [观点 | 数字经济视野下网络数据流动的


#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"
#include "Box2D.h"
#include "B2Sprite.h"

#define RATIO 48.0f

class HelloWorld : public cocos2d::CCLayer,public b2ContactListener
{
public:
    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();

    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static cocos2d::CCScene* scene();

    // a selector callback
    void menuCloseCallback(CCObject* pSender);

    // implement the "static node()" method manually
    CREATE_FUNC(HelloWorld);

    virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
    virtual void BeginContact(b2Contact* contact);

    virtual void update(float dt);

    b2World *world;
    B2Sprite *bird;
    CCSize screenSize;
    CCSprite *barContainer;

private:
    void addBird();
    void addGround();
    void initWorld();
    void addBar(float dt);
    void addBarContainer();
    void startGame(float dt);
    void stopGame();
};

#endif // __HELLOWORLD_SCENE_H__


__copyright__ = "Copyright (C) 2014-2017, 2019, 2024  Martin Blais"
__license__ = "GNU GPLv2"

import unittest

from beancount import loader

class TestLeafOnly(unittest.TestCase):
    @loader.load_doc(expect_errors=True)
    def test_leaf_only1(self, _, errors, __):
        """
        plugin "beancount.plugins.leafonly"

        2011-01-01 open Expenses:Food
        2011-01-01 open Expenses:Food:Restaurant
        2011-01-01 open Assets:Other

        2011-05-17 * "Something"
          Expenses:Food:Restaurant   1.00 USD
          Assets:Other              -1.00 USD

        2011-05-17 * "Something"
          Expenses:Food         1.00 USD ;; Offending posting.
          Assets:Other         -1.00 USD

        """
        self.assertEqual(1, len(errors))
        self.assertRegex(errors[0].message, "Expenses:Food")

    @loader.load_doc(expect_errors=True)
    def test_leaf_only2(self, _, errors, __):
        """
        plugin "beancount.plugins.leafonly"

        ;;; 2011-01-01 open Expenses:Food
        2011-01-01 open Expenses:Food:Restaurant
        2011-01-01 open Assets:Other

        2011-05-17 * "Something"
          Expenses:Food         1.00 USD ;; Offending posting.
          Assets:Other         -1.00 USD

        """
        # Issue #5: If you have a non-leaf posting on an account that doesn't
        # exist, the leafonly plugin raises an AttributeError if there is no
        # Open directive. The problem is that 'open_entry' is None.
        self.assertEqual(2, len(errors))
        for error in errors:
            self.assertRegex(error.message, "Expenses:Food")

    @loader.load_doc(expect_errors=False)
    def test_leaf_only3(self, _, errors, __):
        """
        plugin "beancount.plugins.leafonly"

        2011-01-01 open Expenses:Food
        2011-01-01 open Expenses:Food:Restaurant
        2011-01-01 open Assets:Other

        2011-05-17 * "Something"
          Expenses:Food:Restaurant   1.00 USD
          Assets:Other              -1.00 USD

        2011-05-18 balance Expenses:Food 1.00 USD  ;; Allowed balance posting.
        """
        self.assertEqual(0, len(errors))

if __name__ == "__main__":
    unittest.main()


2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%27 style=%27color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1


h2": "blocking",
               "s3-eth3": "forwarding",
               "s3-eth4": "forwarding", "s3-eth5": "forwarding"},
        "s4": {"s4-eth1": "forwarding", "s4-eth2": "blocking",
               "s4-eth3": "blocking",
               "s4-eth4": "forwarding", "s4-eth5": "forwarding"},
        "s10": {"s10-eth1": "forwarding", "s10-eth2": "blocking"},
        "s11": {"s11-eth1": "forwarding", "s11-eth2": "blocking"},
        "s12": {"s12-eth1": "forwarding", "s12-eth2": "blocking"},
        "s17": {"s17-eth1": "forwarding", "s17-eth2": "blocking"}
    },
    SpanningTreeHub.__name__: {
        "s3": {"s3-eth1": "forwarding", "s3-eth2": "forwarding",
               "s3-eth3": "forwarding"},
        "s6": {"s6-eth1": "forwarding", "s6-eth2": "forwarding",
               "s6-eth3": "forwarding"},
        "s10": {"s10-eth1": "forwarding", "s10-eth2": "forwarding"},
        "s11": {"s11-eth1": "blocking", "s11-eth2": "forwarding",
                "s11-eth3": "blocking"},
        "s12": {"s12-eth1": "forwarding", "s12-eth2": "blocking"},
        "s17": {"s17-eth1": "forwarding", "s17-eth2": "forwarding"}
    },
    SpanningTreeIntermediate.__name__: {
        "s2": {"s2-eth1": "forwarding", "s2-eth2": "forwarding"},
        "s4": {"s4-eth1": "forwarding", "s4-eth2": "forwarding"},
        "s5": {"s5-eth1": "forwarding", "s5-eth2": "blocking",
               "s5-eth3": "blocking"},
        "s10": {"s10-eth1": "forwarding", "s10-eth2": "forwarding",
                "s10-eth3": "forwarding"}
    },
    SpanningTreeCost.__name__: {
        "s1": {"s1-eth1": "forwarding", "s1-eth2": "forwarding"},
        "s2": {"s2-eth1": "forwarding", "s2-eth2": "forwarding"},
        "s3": {"s3-eth1": "forwarding", "s3-eth2": "blocking"}
    }
}

@require_root
@pytest.mark.parametrize("topo", [
    SimpleSpanningTree,
    SpanningTreeNet,
    SpanningTreeAdjust,
    SpanningTreeBus,
    SpanningTreeFullMesh,
    SpanningTreeHub,
    SpanningTreeIntermediate,
    SpanningTreeCost
])
def test_stp(topo):
    try:
        net = IPNet(topo=topo())
        net.start()

        assert_connectivity(net, v6=False)
        assert_connectivity(net, v6=True)

        for switch, states in expected_states[topo.__name__].items():
            assert_stp_state(net[switch], states)
        net.stop()
    finally:
        cleanup()

def test_stp_adjust():
    try:
        net = IPNet(topo=SpanningTreeAdjust(l1_start="s2-eth1",
                                            l1_end="s1-eth1", l1_cost=2,
                                            l2_start="s1-eth3",
                                            l2_end="s3-eth1", l2_cost=3))
        net.start()

        assert_connectivity(net, v6=False)
        assert_connectivity(net, v6=True)

        for switch, states in expected_states["SpanningTreeAdjust-mod"].items():
            assert_stp_state(net[switch], states)
        net.stop()
    finally:
        cleanup()


eeTxGetAccessList() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
		exp  ethtypes.AccessList
	}{
		{
			"empty accesses",
			types.DynamicFeeTx{
				Accesses: nil,
			},
			nil,
		},
		{
			"nil",
			types.DynamicFeeTx{
				Accesses: types.NewAccessList(nil),
			},
			nil,
		},
		{
			"non-empty accesses",
			types.DynamicFeeTx{
				Accesses: types.AccessList{
					{
						Address:     suite.hexAddr,
						StorageKeys: []string{},
					},
				},
			},
			ethtypes.AccessList{
				{
					Address:     suite.addr,
					StorageKeys: []common.Hash{},
				},
			},
		},
	}

	for _, tc := range testCases {
		actual := tc.tx.GetAccessList()

		suite.Require().Equal(tc.exp, actual, tc.name)
	}
}

func (suite *TxDataTestSuite) TestDynamicFeeTxGetData() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
	}{
		{
			"non-empty transaction",
			types.DynamicFeeTx{
				Data: nil,
			},
		},
	}

	for _, tc := range testCases {
		actual := tc.tx.GetData()

		suite.Require().Equal(tc.tx.Data, actual, tc.name)
	}
}

func (suite *TxDataTestSuite) TestDynamicFeeTxGetGas() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
		exp  uint64
	}{
		{
			"non-empty gas",
			types.DynamicFeeTx{
				GasLimit: suite.uint64,
			},
			suite.uint64,
		},
	}

	for _, tc := range testCases {
		actual := tc.tx.GetGas()

		suite.Require().Equal(tc.exp, actual, tc.name)
	}
}

func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasPrice() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
		exp  *big.Int
	}{
		{
			"non-empty gasFeeCap",
			types.DynamicFeeTx{
				GasFeeCap: &suite.sdkInt,
			},
			(&suite.sdkInt).BigInt(),
		},
	}

	for _, tc := range testCases {
		actual := tc.tx.GetGasPrice()

		suite.Require().Equal(tc.exp, actual, tc.name)
	}
}

func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasTipCap() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
		exp  *big.Int
	}{
		{
			"empty gasTipCap",
			types.DynamicFeeTx{
				GasTipCap: nil,
			},
			nil,
		},
		{
			"non-empty gasTipCap",
			types.DynamicFeeTx{
				GasTipCap: &suite.sdkInt,
			},
			(&suite.sdkInt).BigInt(),
		},
	}

	for _, tc := range testCases {
		actual := tc.tx.GetGasTipCap()

		suite.Require().Equal(tc.exp, actual, tc.name)
	}
}

func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasFeeCap() {
	testCases := []struct {
		name string
		tx   types.DynamicFeeTx
		exp  *big.Int
	}{
		{
			"empty gasFeeCap",
			types.DynamicFee


kie"]); l != 2 {
		t.Fatalf("expected %d cookies, got %d", 2, l)
	}
	if g, e := m["Set-Cookie"][0], "cookie-1=one; Path=/restricted/"; g != e {
		t.Errorf("cookie #1: want %q, got %q", e, g)
	}
	if g, e := m["Set-Cookie"][1], "cookie-2=two; Max-Age=3600"; g != e {
		t.Errorf("cookie #2: want %q, got %q", e, g)
	}
}

var addCookieTests = []struct {
	Cookies []*Cookie
	Raw     string
}{
	{
		[]*Cookie{},
		"",
	},
	{
		[]*Cookie{{Name: "cookie-1", Value: "v$1"}},
		"cookie-1=v$1",
	},
	{
		[]*Cookie{
			{Name: "cookie-1", Value: "v$1"},
			{Name: "cookie-2", Value: "v$2"},
			{Name: "cookie-3", Value: "v$3"},
		},
		"cookie-1=v$1; cookie-2=v$2; cookie-3=v$3",
	},
}

func TestAddCookie(t *testing.T) {
	for i, tt := range addCookieTests {
		req, _ := NewRequest("GET", "http://example.com/", nil)
		for _, c := range tt.Cookies {
			req.AddCookie(c)
		}
		if g := req.Header.Get("Cookie"); g != tt.Raw {
			t.Errorf("Test %d:\nwant: %s\n got: %s\n", i, tt.Raw, g)
			continue
		}
	}
}

var readSetCookiesTests = []struct {
	Header  Header
	Cookies []*Cookie
}{
	{
		Header{"Set-Cookie": {"Cookie-1=v$1"}},
		[]*Cookie{{Name: "Cookie-1", Value: "v$1", Raw: "Cookie-1=v$1"}},
	},
	{
		Header{"Set-Cookie": {"NID=99=YsDT5i3E-CXax-; expires=Wed, 23-Nov-2011 01:05:03 GMT; path=/; domain=.google.ch; HttpOnly"}},
		[]*Cookie{{
			Name:       "NID",
			Value:      "99=YsDT5i3E-CXax-",
			Path:       "/",
			Domain:     ".google.ch",
			HttpOnly:   true,
			Expires:    time.Date(2011, 11, 23, 1, 5, 3, 0, time.UTC),
			RawExpires: "Wed, 23-Nov-2011 01:05:03 GMT",
			Raw:        "NID=99=YsDT5i3E-CXax-; expires=Wed, 23-Nov-2011 01:05:03 GMT; path=/; domain=.google.ch; HttpOnly",
		}},
	},
	{
		Header{"Set-Cookie": {".ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly"}},
		[]*Cookie{{
			Name:       ".ASPXAUTH",
			Value:      "7E3AA",
			Path:       "/",
			Expires:    time.Date(2012, 3, 7, 14, 25, 6, 0, time.UTC),
			RawExpires: "Wed, 07-Mar-2012 14:25:06 GMT",
			HttpOnly:   true,
			Raw:        ".ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly",
		}},
	},
	{
		Header{"Set-Cookie": {"ASP.NET_SessionId=foo; path=/; HttpOnly"}},
		[]*Cookie{{
			Name:     "ASP.NET_SessionId",
			Value:    "foo",
			Path:     "/",
			HttpOnly: true,
			Raw:      "ASP.NET_SessionId=foo; path=/; HttpOnly


但是halfkay bootloader会让它刷写十分简单，所以也很常用。

## Underlight(背光)
用于照亮电路板底面的LED的总称。这些LED通常从印刷电路板的底部向键盘所在的表面发光。

## Unicode
在广阔的计算机世界中，Unicode是一组编码方案，用于表示任何语言中的字符。 与qmk相关的是，它意味着使用各种操作系统方案来发送Unicode码点，而不是扫描码。

* [Unicode文档](zh-cn/feature_unicode.md)

## Unit Testing(单元测试)
针对qmk的自动测试框架。单元测试帮助我们确信我们的更改不会破坏任何东西。

* [单元测试文档](zh-cn/unit_testing.md)

## USB
通用串行总线，键盘最常见的有线接口。

## USB 主机 (简称主机)
USB主机就是你的电脑，或者你的键盘所插的任何设备。

# 并没有找到你想找到的术语?

[新建一个issue](https://github.com/qmk/qmk_firmware/issues) ，想好你的问题，或许你所问的术语就会添加到这里。创建一个PR帮我们添加需要添加的术语当然坠吼了:)

## 中文翻译术语特别说明（terms of Chinese translation）:id=terms-of-zh-cn-translate
!>如果你对QMK文档翻译中的细节不关心，请跳过该节

由于语言及文化差异，QMK英文文档中的部分内容，很难在**保持原句结构**的情况下，完美地翻译为中文，而保持翻译前后的语句结构一致对于开源代码的文档翻译来讲十分重要，这样才能确保不同的文档贡献者不会*夹带私货*，防止不同的翻译风格、不同的翻译水准、不同的理解与润色最终产生糟糕的混合。
因此，这里会对一些词组的的翻译进行规范化，并希望阅读者及后续文档翻译维护者，维持这种统一的范式。

### keyboard（键盘）及keymap（键映射）
QMK文档中使用最多的两个术语是keyboard及keymap
* 键盘：在中文语境下，我们提及键盘，基本是在指物理键盘，而在QMK文档中到处可见的“键盘”一词，多对应的是代码中 `keyboards\` 目录下的键盘定义，其更接近于我们讲的“配列”的概念，主要描述了键盘的大体结构，物理键数量及排列。
* 键映射：keymap的作用是定义物理键盘到实际输出键值(keycode)的映射关系，也是QMK最重要、涉及最多的概念。QMK很多功能就是为了能够在不改变键盘物理排列/电路组成/芯片程序的情况下，动态地改变物理按键输出的键值。如


dress();
            if (!(ia instanceof Inet4Address))
                throw new UnsupportedAddressTypeException();
            putFamily(AF_INET);
            putAddress(AF_INET, ia);
            putPort(AF_INET, isa.getPort());
            return SIZEOF_SOCKADDR4;
        } else {
            // struct sockaddr6
            putFamily(AF_INET6);
            putAddress(AF_INET6, isa.getAddress());
            putPort(AF_INET6, isa.getPort());
            UNSAFE.putInt(address + OFFSET_SIN6_FLOWINFO, 0);
            return SIZEOF_SOCKADDR6;
        }
    }

    /**
     * Return an InetSocketAddress to represent the socket address in this buffer.
     * @throws SocketException if the socket address is not AF_INET or AF_INET6
     */
    InetSocketAddress decode() throws SocketException {
        int family = family();
        if (family != AF_INET && family != AF_INET6)
            throw new SocketException("Socket family not recognized");
        return new InetSocketAddress(address(family), port(family));
    }

    /**
     * Find a mismatch between this and another socket address
     * @return the byte offset of the first mismatch or -1 if no mismatch
     */
    private int mismatch(NativeSocketAddress other) {
        int i = ArraysSupport.vectorizedMismatch(null,
                this.address,
                null,
                other.address,
                SIZEOF_SOCKETADDRESS,
                ArraysSupport.LOG2_ARRAY_BYTE_INDEX_SCALE);
        if (i >= 0)
            return i;
        i = SIZEOF_SOCKETADDRESS - ~i;
        for (; i < SIZEOF_SOCKETADDRESS; i++) {
            if (UNSAFE.getByte(this.address + i) != UNSAFE.getByte(other.address + i)) {
                return i;
            }
        }
        return -1;
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof NativeSocketAddress) {
            return mismatch((NativeSocketAddress) other) < 0;
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        int h = 0;
        for (int offset = 0; offset < SIZEOF_SOCKETADDRESS; offset++) {
            h = 31 * h + UNSAFE.getByte(address + offset);
        }
        return h;
    }

    @Override
    public String toString() {
        int family = family();
        if (family == AF_INET || family == AF_INET6) {
            return ((family == AF_INET) ? "AF_INET" : "AF_INET6")
                    + ", address=" + address(family) + ", port=" + port(family);
        } else {
            return "<unknown>";
        }
    }

    /**
     * Return the value of the sa_family field.
     */
    private int family() {
        if (SIZEOF_FAMILY == 1) {
            return UNSAFE.getByte(address + OFFSET_FAMILY);
        } else if (SIZEOF_FAMILY == 2) {
            return UNSAFE.getShort(address + OFFSET_FAMILY);
        } else {
            throw new InternalError();
        }
    }

    /**
     * Stores the given family in the sa_family field.
     */
    private void putFamily(int family) {
        if (SIZEOF_FAMILY == 1) {
            UNSAFE.putByte(address + OFFSET_FAMILY, (byte) family);
        } else if (SIZEOF_FAMILY == 2) {
            UNSAFE.putShort(address + OFFSET_FAMILY, (short) family);
        } else {
            throw new InternalError();
        }
    }

    /**
     * Return the value of the sin_port or sin6_port field. These fields are
     * stored in network order.
     */
    private int port(int family) {
        byte b1, b2;


.323 0 .57.254.57.561a.55.55 0 01-.288.48l-.99.553 1.092 1.482.01.012c.434.552 1.1.89 1.816.89h3.86c4.703 0 8.5 3.782 8.5 8.444 0 3.195-1.776 6.467-4.39 8.23l-.19.13a7.84 7.84 0 01-4.31-.304l-9.11-3.3v-2.124c1.136-.093 2.111-.505 2.831-1.211.824-.81 1.263-1.957 1.263-3.312a.5.5 0 00-1 0c0 1.135-.363 2.009-.964 2.598-.567.558-1.39.904-2.438.941l-.582-.064c-1.56-.172-2.847-1.47-3.074-3.07H8.31c.959 0 1.8-.503 2.276-1.253l.003-.006c.066-.105.124-.215.175-.33l.39-.878c.202-.282.3-.64.3-1.059 0-.924-.691-1.657-1.412-2.124-.74-.478-1.674-.786-2.452-.786H6.26a1.381 1.381 0 01-1.277-.859l-.524-1.289 5.863-1.592a3.477 3.477 0 012.26.146l.94.394.377-.945Zm-3.446 7.055c0 .315-.083.457-.16.533H7.53c-1.99 0-3.68-1.28-4.289-3.054.342-.21.625-.51.813-.879l.003.01A2.38 2.38 0 006.26 9.5h1.33c.552 0 1.3.232 1.909.626.628.406.954.878.954 1.284Z"/></g></svg>';
  static const String bed =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="M15 20H7v-3.5a.5.5 0 00.5.5h7a.5.5 0 00.5-.5v-.75c0-.946-.731-1.5-1.687-1.735a2.363 2.363 0 01-.123-.033c-.448-.137-3.287-.985-4.44-.982A1.75 1.75 0 007 14.75V12a3 3 0 10-6 0v15a2 2 0 002 2h1v1.5a.5.5 0 00.5.5h2a.5.5 0 00.5-.5V29h18v1.5a.5.5 0 00.5.5h2a.5.5 0 00.5-.5V29h1a2 2 0 002-2v-7.504a3.5 3.5 0 00-3.5-3.5h-11a1.5 1.5 0 00-1.5 1.5V20ZM4 11a1 1 0 011 1v10h10v.5a.5.5 0 00.5.5H29v4H3V12a1 1 0 011-1Z"/></svg>';
  static const String beer_mug =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><g fill="currentColor"><path d="M15.02 24.01c0 .55.45 1 1 1s1-.45 1-1V13.63c0-.55-.45-1-1-1s-1 .45-1 1v10.


 ((DartCTabFolder) getApi().parent.getImpl()).selectionBackground : getApi().parent.getBackground());
                    gc.fillPolygon(shape);
                }
            }
            //Draw client area
            if ((getApi().parent.getStyle() & SWT.NO_BACKGROUND) != 0) {
                gc.setBackground(getApi().parent.getBackground());
                int marginWidth = getApi().parent.marginWidth;
                int marginHeight = getApi().parent.marginHeight;
                int xClient = borderLeft + marginWidth + highlight_margin, yClient;
                if (((DartCTabFolder) getApi().parent.getImpl()).onBottom) {
                    yClient = borderTop + highlight_margin + marginHeight;
                } else {
                    yClient = borderTop + tabHeight + highlight_header + marginHeight;
                }
                gc.fillRectangle(xClient - marginWidth, yClient - marginHeight, width, height);
            }
        } else {
            if ((getApi().parent.getStyle() & SWT.NO_BACKGROUND) != 0) {
                int height = borderTop + tabHeight + highlight_header + borderBottom;
                if (size.y > height) {
                    gc.setBackground(getApi().parent.getParent().getBackground());
                    gc.fillRectangle(0, height, size.x, size.y - height);
                }
            }
        }
        //draw 1 pixel border around outside
        if (borderLeft > 0) {
            gc.setForeground(getApi().parent.getDisplay().getSystemColor(BORDER1_COLOR));
            int x1 = borderLeft - 1;
            int x2 = size.x - borderRight;
            int y1 = ((DartCTabFolder) getApi().parent.getImpl()).onBottom ? borderTop - 1 : borderTop + tabHeight;
            int y2 = ((DartCTabFolder) getApi().parent.getImpl()).onBottom ? size.y - tabHeight - borderBottom - 1 : size.y - borderBottom;
            // left
            gc.drawLine(x1, y1, x1, y2);
            // right
            gc.drawLine(x2, y1, x2, y2);
            if (((DartCTabFolder) getApi().parent.getImpl()).onBottom) {
                // top
                gc.drawLine(x1, y1, x2, y1);
            } else {
                // bottom
                gc.drawLine(x1, y2, x2, y2);
            }
        }
    }

    void drawClose(GC gc, Rectangle closeRect, int closeImageState) {
        if (closeRect.width == 0 || closeRect.height == 0)
            return;
        // draw X with length of this constant
        final int lineLength = 8;
        int x = closeRect.x + Math.max(1, (closeRect.width - lineLength) / 2);
        int y = closeRect.y + Math.max(1, (closeRect.height - lineLength) / 2);
        y += ((DartCTabFolder) getApi().parent.getImpl()).onBottom ? -1 : 1;
        int originalLineWidth = gc.getLineWidth();
        Color originalForeground = gc.getForeground();
        switch(closeImageState & (SWT.HOT | SWT.SELECTED | SWT.BACKGROUND)) {
            case SWT.NONE:
                {
                    drawCloseLines(gc, x, y, lineLength, false);
                    break;
                }
            case SWT.HOT:
                {
                    drawCloseLines(gc, x, y, lineLength, true);
                    break;
                }
            case SWT.SELECTED:
                {
                    drawCloseLines(gc, x, y, lineLength, true);
                    break;
                }
            case SWT.BACKGROUND:
                {


to style the legends when you use them
// $legend-bg: $white;
// $legend-font-weight: $font-weight-bold;
// $legend-padding: rem-calc(0 3);

// We use these to style the prefix and postfix input elements
// $input-prefix-bg: scale-color($white, $lightness: -5%);
// $input-prefix-border-color: scale-color($white, $lightness: -20%);
// $input-prefix-border-size: 1px;
// $input-prefix-border-type: solid;
// $input-prefix-overflow: hidden;
// $input-prefix-font-color: $oil;
// $input-prefix-font-color-alt: $white;

// We use this setting to turn on/off HTML5 number spinners (the up/down arrows)
// $input-number-spinners: true;

// We use these to style the error states for inputs and labels
// $input-error-message-padding: rem-calc(6 9 9);
// $input-error-message-top: -1px;
// $input-error-message-font-size: rem-calc(12);
// $input-error-message-font-weight: $font-weight-normal;
// $input-error-message-font-style: italic;
// $input-error-message-font-color: $white;
// $input-error-message-font-color-alt: $oil;

// We use this to style the glowing effect of inputs when focused
// $input-include-glowing-effect: true;
// $glowing-effect-fade-time: 0.45s;
// $glowing-effect-color: $input-focus-border-color;

// Select variables
// $select-bg-color: $ghost;
// $select-hover-bg-color: scale-color($select-bg-color, $lightness: -3%);

// 12. Icon Bar
// - - - - - - - - - - - - - - - - - - - - - - - - -

// We use these to style the icon-bar and items
// $include-html-icon-bar-classes: $include-html-classes;
// $icon-bar-bg: $oil;
// $icon-bar-font-color: $white;
// $icon-bar-font-size: 1rem;
// $icon-bar-hover-color: $primary-color;
// $icon-bar-icon-color: $white;
// $icon-bar-icon-size: 1.875rem;
// $icon-bar-image-width: 1.875rem;
// $icon-bar-image-height: 1.875rem;
// $icon-bar-active-color: $primary-color;
// $icon-bar-item-padding: 1.25rem;

// 13. Inline Lists
// - - - - - - - - - - - - - - - - - - - - - - - - -

// $include-html-inline-list-classes: $include-html-classes;

// We use this to control the margins and padding of the inline list.
// $inline-list-top-margin: 0;
// $inline-list-opposite-margin: 0;
// $inline-list-bottom-margin: rem-calc(17);
// $inline-list-default-float-margin: rem-calc(-22);
// $inline-list-default-float-list-margin: rem-calc(22);

// $inline-list-padding: 0;

// We use this to control the overflow of the inline list.
// $inline-list-overflow: hidden;

// We use this to control the list items
// $inline-list-display: block;

// We use this to control any elements within list items
// $inline-list-children-display: block;

// 14. Joyride
// - - - - - - - - - - - - - - - - - - - - - - - - -

// $include-html-joyride-classes: $include-html-classes;

// Cont


# IVXV Internet voting framework
"""Remote execution helper for microservice management."""

import subprocess

from .logging import log

def exec_remote_cmd(cmd, **kw):
    """Perform remote operation in service host.

    Execute service management command in service host (over OpenSSH SSH
    client) or copy file to service host file system (over secure copy).

    :param cmd: Command for subprocess.run()
    :type cmd: list
    :param kw: Parameters for subprocess.run()
    :type kw: dict
    :return: subprocess.CompletedProcess
    """
    assert cmd[0] in ('ssh', 'scp')

    # patch command
    if cmd[0] == 'ssh':
        cmd.insert(1, '-T')  # disable pseudo-terminal allocation
    cmd.insert(1, '-o')  # set preferred authentication method
    cmd.insert(2, 'PreferredAuthentications=publickey')

    # execute command
    log.debug('Executing command: %s', ' '.join(cmd))
    try:
        check = kw.pop('check')
    except KeyError:
        check = False
    proc = subprocess.run(cmd, **kw, check=check)
    if proc.returncode:
        log.debug('Command finished with error code %d', proc.returncode)
    else:
        log.debug('Command successfully executed')

    return proc


se;
		/// Air brake lap
		public string HandleLap;
		/// Air brake service
		public string HandleService;
		/// Brake emergency
		public string HandleEmergency;
		/// Hold brake applied
		public string HandleHoldBrake;
		/// Left Doors
		public string DoorsLeft;
		/// Right doors
		public string DoorsRight;
		/// Score (n)
		public string Score;

		internal InterfaceQuickReference(NewLanguage language)
		{
			HandleForward = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "forward" });
			HandleNeutral = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "neutral" });
			HandleBackward = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "backward" });
			HandlePower = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "power" });
			HandlePowerNull = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "powernull" });
			HandleBrake = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "brake" });
			HandleLocoBrake = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "locobrake" });
			HandleBrakeNull = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "brakenull" });
			HandleRelease = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "release" });
			HandleLap = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "lap" });
			HandleService = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "service" });
			HandleEmergency = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "emergency" });
			HandleHoldBrake = language.GetInterfaceString(HostApplication.OpenBve, new[] { "handles", "holdbrake" });
			DoorsLeft = language.GetInterfaceString(HostApplication.OpenBve, new[] { "doors", "left" });
			DoorsRight = language.GetInterfaceString(HostApplication.OpenBve, new[] { "doors", "right" });
			Score = language.GetInterfaceString(HostApplication.OpenBve, new[] { "misc", "score" });
		}
	}
}


// Copyright (c) 2013, Facebook, Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//   * Redistributions of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//   * Neither the name Facebook nor the names of its contributors may be used to
//     endorse or promote products derived from this software without specific
//     prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#import "fishhook.h"

#import <dlfcn.h>
#import <stdlib.h>
#import <string.h>
#import <sys/types.h>
#import <mach-o/dyld.h>
#import <mach-o/loader.h>
#import <mach-o/nlist.h>

#ifdef __LP64__
typedef struct mach_header_64 mach_header_t;
typedef struct segment_command_64 segment_command_t;
typedef struct section_64 section_t;
typedef struct nlist_64 nlist_t;
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64
#else
typedef struct mach_header mach_header_t;
typedef struct segment_command segment_command_t;
typedef struct section section_t;
typedef struct nlist nlist_t;
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT
#endif

#ifndef SEG_DATA_CONST
#define SEG_DATA_CONST  "__DATA_CONST"
#endif

struct rebindings_entry {
  struct rebinding *rebindings;
  size_t rebindings_nel;
  struct rebindings_entry *next;
};

static struct rebindings_entry *_rebindings_head;

static int prepend_rebindings(struct rebindings_entry **rebindings_head,
                              struct rebinding rebindings[],
                              size_t nel) {
  struct rebindings_entry *new_entry = malloc(sizeof(struct rebindings_entry));
  if (!new_entry) {
    return -1;
  }
  new_entry->rebindings = malloc(sizeof(struct rebinding) * nel);
  if (!new_entry->rebindings) {
    free(new_entry);
    return -1;
  }
  memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);
  new_entry->rebindings_nel = nel;
  new_entry->next = *rebindings_head;
  *rebindings_head = new_entry;
  return 0;
}

static void perform_rebinding_with_section(struct rebindings_entry *rebindings,
                                           section_t *section,
                                           intptr_t slide,
                                           nlist_t *symtab,
                                           char *strtab,
                                           uint32_t *indirect_symtab) {
  //__nl_symbol_ptr和__la_symbol_ptr的reserved1字段标识了section描述的符号在符号表中开始的index
  //动态符号表中第一个需要解析的符号 开始地址
  uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;

  void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);

  for (uint i = 0; i < section->size / sizeof(void *); i++) {
    uint32_t symtab_index = indirect_symbol_indices[i];
    if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||
        symtab_index == (INDIRECT_SYMBOL_LOCAL   | INDIRECT_SYMBOL_ABS)) {
      continue;
    }
	//获取每一个需要动态解析的符号在符号表中的地址
    uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;

	//通过符号表中每一个导入符号的字符串表偏移量获取符号对应的字符串（符号的名字）
    char *symbol_name = strtab + strtab_offset;
    struct rebindings_entry *cur = rebindings;
    while (cur) {
      for (uint j = 0; j < cur->rebindings_nel; j++) {
        if (strlen(symbol_name) > 1 &&
            strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
		  //找到相同的函数替换指针
          if (cur->rebindings[j].replaced != NULL &&


      let h2 = crypto.createHash("sha1").update(h1).update(this.option.salt).digest("hex")
        return h2
    }
}

export class WechatOpenIdAuthentication extends AuthenticationDefinition<WechatAuthenticationData> {
    constructor() {
        super()
    }
    readonly type = "openId"
    sanitize(meta: WechatAuthDefinition.Meta) {
        let copy = { ...meta }
        for (let field of ["openId"]) {
            if (!meta[field]) throw new Errors.InvalidParameter("Missing " + field)
        }

        return copy
    }
    queryCriteria(meta: WechatAuthDefinition.Meta) {
        if (!meta.openId) {
            throw new Errors.InvalidParameter("No valid openId provided")
        }
        let query = {
            "meta.openId": meta.openId
        }
        return query
    }
    authenticateCriteria(meta: WechatAuthDefinition.Meta) {
        if (!meta.openId) {
            throw new Errors.InvalidParameter("No valid openId provided")
        }
        let query = {
            "meta.openId": meta.openId
        }
        return query
    }
    clearSensitiveInformation(meta: WechatAuthDefinition.Meta) {
        let copy = { ...meta }
        return copy
    }
    guid(meta: WechatAuthDefinition.Meta) {
        return crypto.createHash("sha1").update(meta.openId).digest("hex")
    }
    about(meta: WechatAuthDefinition.Meta, field: string) {
        if (field === "phone") return meta.openId
        if (field === "name") return meta.openId
        if (field === "displayName") return meta.openId
        return null
    }
    unique() {
        return [{
            "meta.openId": 1
        }]
    }
    props(meta: WechatAuthDefinition.Meta) {
        return {
            openId: meta.openId
        }
    }
}

interface PhoneAuthVerificationData {
    verificationCode: string,
    expire: number,
}
import fetch from 'node-fetch';
import { isIndexableObject } from './utils/type-guards';

export interface YouTubeVideo {
  url: string;
}

interface SearchApiResponseItem {
  kind: 'youtube#searchResult';
  id: {
    kind: string;
    videoId: string;
    channelId: string;
    playlistId: string;
  };
}

interface SearchApiResponse {
  kind: 'youtube#searchListResponse';
  etag: string;
  nextPageToken: string;
  prevPageToken: string;
  regionCode: string;
  pageInfo: {
    totalResults: number;
    resultsPerPage: number;
  };
  items: readonly SearchApiResponseItem[];
}

function isSearchApiResponse(obj: unknown): obj is SearchApiResponse {
  if (!isIndexableObject(obj)) {
    return false;
  }

  if (obj['kind'] !== 'youtube#searchListResponse') {
    return false;
  }

  return true;
}

const SEARCH_API_URL = 'https://www.googleapis.com/youtube/v3/search';

class YouTubeClient {
  public constructor(private readonly key: string) {}

  public async search(
    query: string,
    maxResults: number
  ): Promise<readonly YouTubeVideo[]> {
    // Determine the URL for this request
    const params = new URLSearchParams();
    params.set('key', this.key);
    params.set('q', query);
    params.set('maxResults', maxResults.toString());
    params.set('part', 'snippet');
    const url = `${SEARCH_API_URL}?${params.toString()}`;
    params.set('key', '**REDACTED**');
    const redactedUrl = `${SEARCH_API_URL}?${params.toString()}`;

    // Make the request and process the results
    const response = await fetch(url);
    if (response.status !== 200) {
      throw new Error(
        `Received a status code of ${response.status} when querying: ${redactedUrl}`
      );
    }

    const body = await response.json();
    if (!isSearchApiResponse(body)) {
      throw new Error


cand", {
        templateUrl : "cand.html"
    })
    .when("/vote", {
        templateUrl : "vote.html"
    })
    .when("/curr", {
        templateUrl : "curr.php"
    });
});
document.getElementById("form").addEventListener("submit",x=>{
    x.preventDefault();
    redirect_can();
})

function redirect_can(){
    window.open("../html/can.html");
}

</script>

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>Jayanth Portfolio | Photo Gallery</title>
  <meta name="description"
    content="Explore the photo gallery of Jayanth's creative works, project snapshots, and behind-the-scenes moments.">
  <meta name="keywords" content="Jayanth, photo gallery, project images, portfolio snapshots, design work">
  <meta name="author" content="Donavalli Jayanth">
  <link rel="canonical" href="https://www.jayanth.site/photo.html" />
  <meta name="google-site-verification" content="RgDlIEHIkNAYH_iKQo5yOkA6BhKnkq2cjNAYhV8s9y0">
  <link href="assets/img/jayanth.png" rel="icon">
  <link href="assets/img/jayanth.png" rel="jayanth">
  <link rel="stylesheet" href="assets/css/style1.css">

      <video controls autoplay="autoplay" loop>
        <source src="assets/img/portfolio/vid.mp4" type="video/mp4">
      </video>

Designed by Jayanth Chowdary

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Jayanth Donavalli | Portfolio of Web, AI & IoT Projects</title>
    <meta name="description"
        content="Explore the project portfolio of Jayanth Donavalli, a developer specializing in innovative solutions across Web Development, Artificial Intelligence (AI), and the Internet of Things (IoT).">
    <meta name="author" content="Jayanth Donavalli">

    <meta name="robots" content="index, follow">

    <link rel="canonical" href="https://jayanth.site/projects.html">
    <meta name


/*!The Graphic Box Library
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Copyright (C) 2009 - 2017, TBOOX Open Source Group.
 *
 * @author      ruki
 * @file        decoder.h
 * @ingroup     core
 *
 */
#ifndef GB_CORE_BITMAP_DECODER_H
#define GB_CORE_BITMAP_DECODER_H

/* //////////////////////////////////////////////////////////////////////////////////////
 * includes
 */
#include "prefix.h"

/* //////////////////////////////////////////////////////////////////////////////////////
 * extern
 */
__tb_extern_c_enter__

/* //////////////////////////////////////////////////////////////////////////////////////
 * types
 */

/// the bitmap decoder ref type
typedef struct{}*       gb_bitmap_decoder_ref_t;

/* //////////////////////////////////////////////////////////////////////////////////////
 * interfaces
 */

/*! init bitmap decoder
 *
 * @param pixfmt        the pixfmt, convert bitmap to the given pixfmt
 * @param stream        the stream
 *
 * @return              the decoder
 */
gb_bitmap_decoder_ref_t  gb_bitmap_decoder_init(tb_size_t pixfmt, tb_stream_ref_t stream);

/*! exit bitmap decoder
 *
 * @param decoder       decoder
 */
tb_void_t               gb_bitmap_decoder_exit(gb_bitmap_decoder_ref_t decoder);

/*! done bitmap decoder
 *
 * @param decoder       decoder
 *
 * @return              the bitmap
 */
gb_bitmap_ref_t         gb_bitmap_decoder_done(gb_bitmap_decoder_ref_t decoder);

/* //////////////////////////////////////////////////////////////////////////////////////
 * extern
 */
__tb_extern_c_leave__
#endif


: [
                    {title: 'Морская форель'}
                ]
            },
        ]
    }
];

function generateMenu(list: IMenu[]): string {
    let content = `<ul>`;
    for (const a of list) {
        content += `
${a.title}
                        ${(a.items) ? generateMenu(a.items) : ''}

`;
    }
    content += `</ul>`;
    return content;
}

let navMenuList: HTMLDivElement | null = document.querySelector('.menu');

if (navMenuList) {
    navMenuList.innerHTML = generateMenu(menuList);
    navMenuList.onclick = (ev: MouseEvent) => {
        const el: HTMLAnchorElement = ev.target as HTMLAnchorElement;
        const classList = el.classList;
        if (!classList.contains('title')) {
            return;
        }
        const parentLi = el.parentNode as HTMLLIElement;
        parentLi.classList.toggle('menu-open');
    };
}
/* --- STATE --- */
export interface UserType {
  id: string;
  name: string;
  firstName: string;
  lastName: string;
  email: string;
  // TODO: define enum for roles
  role: string;
  avatar?: string;
}

export interface GlobalState {
  token: string | null;
  user: null | UserType;
}

export type ContainerState = GlobalState;
import { Card } from "../../../interfaces"
import Set from "../Astral Radiance"

const card: Card = {
	set: Set,

	name: {
		en: "Virizion V",
		fr: "Viridium V",
		es: "Virizion V",
		it: "Virizion V",
		pt: "Virizion V",
		de: "Viridium V"
	},

	rarity: "Ultra Rare",
	category: "Pokemon",
	hp: 200,
	types: ["Grass"],
	stage: "Basic",
	suffix: "V",

	abilities: [{
		type: "Ability",

		name: {
			en: "Verdant Wind",
			fr: "Vent Verdoyant",
			es: "Viento Verde Viento Verdoso",
			it: "Vento Rigoglioso",
			pt: "Vento Verdejante",
			de: "Mahdwind"
		},

		effect: {
			en: "Each of your Pokémon that has any Grass Energy attached to it can't be affected by any Special Conditions. (Remove any Special Conditions affecting those Pokémon.)",
			fr: "Chacun de vos Pokémon auquel de l'Énergie Grass est attachée ne peut être affecté par aucun État Spécial. (Retirez tous les États Spéciaux affectant les Pokémon concernés.)",
			es: "Cada uno de tus Pokémon que tenga cualquier Energía Grass unida a él no puede verse afectado por ninguna Condición Especial. (Elimina cualquier Condición Especial que afecte a esos Pokémon.)",
			it: "Nessuno dei tuoi Pokémon che ha delle Energie Grass assegnate può essere influenzato da condizioni speciali (rimuovi tutte le condizioni speciali che influenzano tali Pokémon).",
			pt: "Cada um de seus Pokémon que possuir qualquer Energia Grass ligado a ele não poderá ser afetado por nenhuma Condição Especial. (Remova quaisquer Condições Especiais que estejam afetando estes Pokémon.)",
			de: "Jedes deiner Pokémon, an das Grass-Energie angelegt ist, kann nicht von Speziellen Zuständen betroffen werden. (Spezielle Zustände, von denen diese Pokémon betroffen sind, verlieren ihre Wirkung.)"
		}
	}],

	attacks: [{
		cost: ["Grass", "Grass", "Colorless"],

		name: {
			en: "Emerald Blade",
			fr: "Lame Émeraude",
			es: "Hoja Esmeralda",
			it: "Lamasmeraldo",
			pt: "Lâmina Esmeralda",
			de: "Smaragdgrüne Klinge"
		},

		effect: {
			en: "During y


.try_into().expect("static vector"));

        matrix[1][1] = Fr::one();
        matrix[1][2] = Fr::zero();
        matrix[2][1] = Fr::zero();
        matrix[2][2] = Fr::one();

        crate::common::matrix::mmul_assign::<Bn256, DIM>(&matrix, &mut vector_fe);
        super::mul_by_sparse_matrix(&matrix, &mut vector_lc);

        vector_fe.iter().zip(vector_lc.iter()).for_each(|(fe, lc)| {
            let actual = lc.clone().into_num(cs).unwrap().get_value().unwrap();
            assert_eq!(*fe, actual);
        });
    }
}
use libblas::level2::complex;
use libblas::unstable::matrix;
use num_complex::Complex;
mod fixtures;

#[macro_use]
mod utils;

#[test]
fn gbmv() {
    let mut y = fixtures::complex::vector(6);
    complex::gbmv(
        'n',
        6,
        8,
        3,
        2,
        Complex::new(0.0, 0.0),
        &fixtures::complex::bandmatrix_nxm_ku_kl(8, 6, 3, 2),
        6,
        &fixtures::complex::vector(8),
        1,
        Complex::new(2.5, 0.5),
        &mut y,
        1,
    );
    capproximately!(
        y,
        vec![
            Complex::new(-2.0085962414741516, 1.6058503985404968),
            Complex::new(-0.18816410377621651, -0.60837343707680702),
            Complex::new(1.8727443814277649, -0.72995787858963013),
            Complex::new(2.9619127362966537, -0.49696569144725800),
            Complex::new(-0.13906472176313400, 2.5643529072403908),
            Complex::new(-0.15649497509002686, -0.74832186102867126)
        ]
    );

    let mut y = fixtures::complex::vector(6);
    complex::gbmv(
        'n',
        6,
        8,
        3,
        2,
        Complex::new(0.2, 0.8),
        &fixtures::complex::bandmatrix_nxm_ku_kl(8, 6, 3, 2),
        6,
        &fixtures::complex::vector(8),
        1,
        Complex::new(2.5, 0.5),
        &mut y,
        1,
    );
    capproximately!(
        y,
        vec![
            Complex::new(-1.0943454405994295, 1.0642741157616680),
            Complex::new(-0.38628598141225878, -1.2014790478399264),
            Complex::new(0.88995188622798471, -1.1623543999107093),
            Complex::new(7.9118205360687366E-002, 0.76470894087791352),
            Complex::new(-5.7862862678327798E-002, 0.62930340373117366),
            Complex::new(-0.36689070841052379, -0.18794836059332087)
        ]
    );

    let mut y = fixtures::complex::vector(8);
    complex::gbmv(
        't',
        6,
        8,
        3,
        2,
        Complex::new(0.2, 0.8),
        &fixtures::complex::bandmatrix_nxm_ku_kl(8, 6, 3, 2),
        6,
        &fixtures::complex::vector(6),
        1,
        Complex::new(0.0, 0.0),
        &mut y,


IDLength := 6
	if len(OrganizationalUnit) > 0 {
		if len(OrganizationalUnit[0]) == tenantIDLength && len(CommonName) > tenantIDLength {
			if OrganizationalUnit[0] == CommonName[:tenantIDLength] && CommonName[tenantIDLength] == '-' {
				tenantName := OrganizationalUnit[0]
				u.Extra = map[string][]string{"tenant": {tenantName}}
			}
		}
	}

	return &authenticator.Response{
		User: &u,
	}, true, nil
})
/*
Copyright 2022 The KubeZoo 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 convert

import (
	"k8s.io/apimachinery/pkg/runtime/schema"

	"github.com/kubewharf/kubezoo/pkg/common"
	"github.com/kubewharf/kubezoo/pkg/util"
)

// InitConvertors initialize native convertor and custom convertor
func InitConvertors(checkGroupKind util.CheckGroupKindFunc, listTenantCRDs ListTenantCRDsFunc) (nativeConvertor, customConvertor common.ObjectConvertor) {
	ownerReferenceTransformer := NewOwnerReferenceTransformer(checkGroupKind)
	objectReferenceTransformer := NewObjectReferenceTransformer(checkGroupKind)
	defaultConvertor := NewDefaultConvertor(ownerReferenceTransformer)
	nopeConvertor := NewNopeConvertor()

	nativeKindToConvertors := map[schema.GroupKind]common.ObjectConvertor{
		{
			Group: "",
			Kind:  "Namespace",
		}: NewCrossReferenceConverter(defaultConvertor, NewNamespaceTransformer()),
		{
			Group: "",
			Kind:  "Endpoints",
		}: NewCrossReferenceConverter(defaultConvertor, NewEndpointsTransformer(objectReferenceTransformer)),
		{
			Group: "discovery.k8s.io",
			Kind:  "EndpointSlice",
		}: NewCrossReferenceConverter(defaultConvertor, NewEndpointSliceTransformer(objectReferenceTransformer)),
		{
			Group: "",
			Kind:  "Event",
		}: NewCrossReferenceConverter(defaultConvertor, NewEventTransformer(objectReferenceTransformer)),
		{
			Group: "apiextensions.k8s.io",
			Kind:  "CustomResourceDefinition",
		}: NewCRDConvertor(ownerReferenceTransformer),
		{
			Group: "",
			Kind:  "PersistentVolumeClaim",
		}: defaultConvertor,
		{
			Group: "",
			Kind:  "PersistentVolume",
		}: nopeConvertor,
		{
			Group: "storage.k8s.io",
			Kind:  "VolumeAttachment",
		}: NewCrossReferenceConverter(defaultConvertor, NewVolumeAttachmentTransformer()),
		{
			Group: "rbac.authorization.k8s.io",
			Kind:  "ClusterRole",
		}: NewCrossReferenceConverter(defaultConvertor, NewClusterRoleTransformer(listTenantCRDs)),
		{
			Group: "rbac.authorization.k8s.io",
			Kind:  "ClusterRoleBinding",
		}: NewCrossReferenceConverter(defaultConvertor, NewClusterRoleBindingTransformer()),
		{
			Group: "rbac.authorization.k8s.io",
			Kind:  "Role",
		}: NewCrossReferenceConverter(defaultConvertor, NewRoleTransformer(listTenantCRDs)),
		{
			Group: "rbac.authorization.k8s.io",
			Kind:  "RoleBinding",
		}: NewCrossReferenceConverter(defaultConvertor, NewRoleBindingTransformer()),
		{


U+759D, U+75F1, U+75FF, U+7889, U+7A88, U+7C2A, U+7FB8, U+8012, U+8171, U+8214, U+821B, U+8222, U+826E,
    U+82DC, U+82EB, U+8331, U+8334, U+835A, U+83C5, U+83FD, U+843C, U+84FF, U+8693, U+86A3, U+86AA, U+86AF, U+86B6, U+86C6, U+8708, U+8759,
    U+8760, U+87C6, U+87D1, U+8869, U+88C6, U+8C49, U+8C62, U+8C89, U+8D6D, U+8DC6, U+8E4B, U+9005, U+9016, U+9051, U+907D, U+9082, U+914A,
    U+94E1, U+9509, U+975B, U+9AEF, U+9E82, U+9EB8, U+9EDC, U+9EE0;
}
@font-face {
  font-family: 'ShangguSansSC-VF';
  src:
    local('ShangguSansSC-VF'),
    url('./f9df45b18ffce2c6bd750054c11681ca.woff2') format('woff2');
  font-style: normal;
  font-display: swap;
  font-weight: 250 900;
  unicode-range:
    U+4F09, U+4F43, U+4F57, U+4F5D, U+4F6F, U+4FCE, U+4FF8, U+500C, U+502D, U+504E, U+5345, U+54A7, U+5544, U+558B, U+5594, U+559F, U+55E8,
    U+55EF, U+564E, U+5914, U+5958, U+599E, U+5A40, U+5AE1, U+5AE6, U+5B40, U+5E54, U+607F, U+608C, U+609A, U+60F4, U+60FA, U+61FF, U+621B,
    U+622E, U+63CD, U+6414, U+64D8, U+6748, U+67B7, U+6954, U+69AB, U+6C68, U+6DD9, U+6E98, U+6EC2, U+6F66, U+6FE0, U+7119, U+74E4, U+75BD,
    U+7634, U+76C5, U+778C, U+7791, U+77B3, U+77DC, U+781D, U+7827, U+7830, U+7949, U+7980, U+79E3, U+7A14, U+7A95, U+7AA0, U+7AFD, U+7BFE,
    U+8006, U+814B, U+8198, U+8200, U+828D, U+82D2, U+834F, U+840B, U+8438, U+84D6, U+852B, U+85D0, U+86A4, U+8703, U+8707, U+873B, U+8782,
    U+87D2, U+8839, U+8913, U+8BC5, U+8C4C, U+8DCE, U+8DDB, U+8DFA, U+8E1D, U+8E31, U+8E39, U+8E42, U+8E49, U+8E6D, U+8E8F, U+9169, U+9528,


Vec16f().load_a(src3p + x + k) - Vec16f().load_a(src1p + x - u2 + k)) +
                              abs(Vec16f().load_a(src1p + x + k) - Vec16f().load_a(src1n + x - u2 + k)) +
                              abs(Vec16f().load_a(src1n + x + k) - Vec16f().load_a(src3n + x - u2 + k));
                }

                if (s2Flag) {
                    for (int k = -(d->nrad); k <= d->nrad; k++)
                        s2 += abs(Vec16f().load_a(src3p + x + u2 + k) - Vec16f().load_a(src1p + x + k)) +
                              abs(Vec16f().load_a(src1p + x + u2 + k) - Vec16f().load_a(src1n + x + k)) +
                              abs(Vec16f().load_a(src1n + x + u2 + k) - Vec16f().load_a(src3n + x + k));
                }

                s1 = s1Flag ? s1 : (s2Flag ? s2 : s0);
                s2 = s2Flag ? s2 : (s1Flag ? s1 : s0);

                const Vec16f ip = (Vec16f().load_a(src1p + x + u) + Vec16f().load_a(src1n + x - u)) * 0.5f; // should use cubic if ucubic=true
                const Vec16f v = abs(Vec16f().load_a(src1p + x) - ip) + abs(Vec16f().load_a(src1n + x) - ip);
                const Vec16f result = mul_add(d->alpha, s0 + s1 + s2, d->beta * std::abs(u)) + d->remainingWeight * v;
                result.stream(ccosts + (d->tpitch * x + u) * d->vectorSize);
            }
        }
    } else {
        for (int x = 0; x < width; x++) {
            const int umax = std::min({ x, width - 1 - x, d->mdis });

            for (int u = -umax; u <= umax; u++) {
                Vec16f s = zero_16f();

                for (int k = -(d->nrad); k <= d->nrad; k++)
                    s += abs(Vec16f().load_a(src3p + x + u + k) - Vec16f().load_a(src1p + x - u + k)) +
                         abs(Vec16f().load_a(src1p + x + u + k) - Vec16f().load_a(src1n + x - u + k)) +
                         abs(Vec16f().load_a(src1n + x + u + k) - Vec16f().load_a(src3n + x - u + k));

                const Vec16f ip = (Vec16f().load_a(src1p + x + u) + Vec16f().load_a(src1n + x - u)) * 0.5f; // should use cubic if ucubic=true
                const Vec16f v = abs(Vec16f().load_a(src1p + x) - ip) + abs(Vec16f().load_a(src1n + x) - ip);
                const Vec16f result = mul_add(d->alpha, s, d->beta * std::abs(u)) + d->remainingWeight * v;
                result.stream(ccosts + (d->tpitch * x + u) * d->vectorSize);
            }
        }
    }
}

template<typename T1, typename T2>
void process_avx512(const VSFrameRef * src, const VSFrameRef * scp, VSFrameRef * dst, VSFrameRef ** pad, const int field_n, const EEDI3Data * d, const VSAPI * vsapi) noexcept {
    for (int plane = 0; plane < d->vi.format->numPlanes; plane++) {
        if (d->process[plane]) {
            copyPad<T1>(src, pad[plane], plane, 1 - field_n, d->dh, vsapi);

            const int srcWidth = vsapi->getFrameWidth(pad[plane], 0);


#undef SDIO_VERBOSE
#define SDIO_VERBOSE 0

#undef SDIO_SHL
#define SDIO_SHL CHIPRAM_ADDR

#include "common.h"
#include "syscode.h"

#include "sdio.c"
#define FAT_READ_SYS \
	if (sdio_read_block(sector, buf)) break;
#include "microfat.c"

#undef DBG_LOG
#if MENU_DEBUG
#define DBG_LOG(...) printf(__VA_ARGS__)
#define RAM_SHIFT 0x20000
#define DBG_EXTRA_ARG(x) , x
#else
#define DBG_LOG(...) (void)0
#define RAM_SHIFT 0
#define DBG_EXTRA_ARG(x)
#endif

typedef int (*printf_t)(const char *fmt, ...);

void entry_main(unsigned clust, unsigned size, uint8_t *ram,
		fatdata_t *old_fatdata DBG_EXTRA_ARG(printf_t printf)) {
	fatdata_t fatdata;
	uint32_t i = 0, n = sizeof(fatdata_t) / 4;
	// fatdata = *old_fatdata;
	do ((uint32_t*)&fatdata)[i] = ((uint32_t*)old_fatdata)[i];
	while (i++ < n);

	DBG_LOG("clust = 0x%x, size = 0x%x, ram = %p\n", clust, size, ram);
	ram += RAM_SHIFT;

	n = fat_read_simple(&fatdata, clust, ram, size);
	DBG_LOG("n = 0x%x\n", n);
	if (n < size) for (;;);
#if RAM_SHIFT
	ram -= RAM_SHIFT;
	memcpy(ram, ram + RAM_SHIFT, size);
#endif
	clean_dcache();
	clean_icache();
	((void(*)(void))ram)();
}


#include<stdio.h>
#define MAX 100

int main()
{
	int A[MAX] = {1}, N; //A[0] = 1Ϊ0
	int n , i , space;
	printf("ָǵĲ");
	scanf("%d",&N);
    for(n = 1 ; n <= N ; n++)
	{
		//ATTENTION 1: N0λN-11λ
		for(space = N-n ; space > 0 ; space--)
			printf("  ");
		for(i = n-1 ; i > 0 ; i--) //n
		{
			A[i] = A[i] + A[i-1];
			printf("%5d",A[i]);//1ʼӡԳƵȼ۴
		}
		printf("%5d\n",A[0]); //ٴ1ע⻻
	}
	return 0;
}

/*
#include<stdio.h>
#include<stdlib.h>

int main()
{
  int a[100] = {0} ;//״1һʼΪ1ʼΪ0
  int i , j , N ,space;
  a[0] = 1;
  printf("ָҪǲ");
  scanf("%d",&N);
  for(i = 0 ; i < N ; i++ )//Nѭ
  {
	  //״15%d1һոռ2λ
	  //һNո񣬵ڶN-1ո..
	  for(space=1; space <= N-i; space++)
          printf("  ");
	  for(j = i ; j > 0 ; j-- ) //ii+1Ӧ±[0,i],[i,1]
	  {
            a[j] = a[j]+a[j-1]; //Ҳ1ҲǼ
            printf("%5d", a[j]);//Ҳ1ʼӡԳ==ӡ

	  }
	  printf("%5d\n",a[0]); //ӡ1
  }
 return 0;

}
*/


option(message_down_cast(m)) {
            Some(ReflectValueRef::Bool(v)) => v,
            Some(_) => panic!("wrong type"),
            None => false, // TODO: check type
        }
    }

    fn get_reflect<'a>(&self, m: &'a Message) -> ReflectFieldRef<'a> {
        match self.fns {
            FieldAccessorFunctions::Repeated(ref accessor2) => {
                ReflectFieldRef::Repeated(accessor2.get_field(message_down_cast(m)))
            }
            FieldAccessorFunctions::Map(ref accessor2) => {
                ReflectFieldRef::Map(accessor2.get_field(message_down_cast(m)))
            }
            FieldAccessorFunctions::Optional(ref accessor2) => ReflectFieldRef::Optional(
                accessor2
                    .get_field(message_down_cast(m))
                    .to_option()
                    .map(|v| v.as_ref()),
            ),
            FieldAccessorFunctions::Simple(ref accessor2) => ReflectFieldRef::Optional({
                let v = accessor2.get_field(message_down_cast(m));
                if v.is_non_zero() {
                    Some(v.as_ref())
                } else {
                    None
                }
            }),
            FieldAccessorFunctions::SingularHasGetSet {
                ref has,
                ref get_set,
            } => ReflectFieldRef::Optional(if has(message_down_cast(m)) {
                Some(get_set.get_ref(message_down_cast(m)))
            } else {
                None
            }),
        }
    }
}

// singular

fn set_panic<A, B>(_: &mut A, _: B) {
    panic!()
}

// TODO: make_singular_xxx_accessor are used only for oneof fields
// oneof codegen should be changed

pub fn make_singular_u32_accessor<M: Message + 'static>(
    name: &'static str,
    has: fn(&M) -> bool,
    get: fn(&M) -> u32,
) -> Box<FieldAccessor + 'static> {
    Box::new(FieldAccessorImpl {
        name: name,
        fns: FieldAccessorFunctions::SingularHasGetSet {
            has: has,
            get_set: SingularGetSet::Copy(Box::new(GetSetCopyFnsImpl {
                get: get,
                _set: set_panic,
            })),
        },
    })
}

pub fn make_singular_i32_accessor<M: Message + 'static>(
    name: &'static str,
    has: fn(&M) -> bool,
    get: fn(&M) -> i32,
) -> Box<FieldAccessor + 'static> {
    Box::new(FieldAccessorImpl {
        name: name,
        fns: FieldAccessorFunctions::SingularHasGetSet {
            has: has,
            get_set: SingularGetSet::Copy(Box::new(GetSetCopyFnsImpl {
                get: get,
                _set: set_panic,
            })),
        },
    })
}

pub fn make_singular_u64_accessor<M: Message + 'static>(
    name: &'static str,
    has: fn(&M) -> bool,
    get: fn(&M) -> u64,
) -> Box<FieldAccessor + 'static> {
    Box::new(FieldAccessorImpl {
        name: name,
        fns: FieldAccessorFunctions::SingularHasGetSet {
            has: has,
            get_set: SingularGetSet::Copy(Box::new(GetSetCopyFnsImpl {
                get: get,
                _set: set_panic,
            })),
        },
    })
}

pub fn make_singular_i64_accessor<M: Message + 'static>(
    name: &'st


Style.maxWidth = maxWidth;
  }

  @override
  double get styleMinWidth {
    return _flexNodeStyle.minWidth;
  }

  @override
  set styleMinWidth(double minWidth) {
    _flexNodeStyle.minWidth = minWidth;
  }

  @override
  double get styleMaxHeight {
    return _flexNodeStyle.maxHeight;
  }

  @override
  set styleMaxHeight(double maxHeight) {
    _flexNodeStyle.maxHeight = maxHeight;
  }

  @override
  set styleMinHeight(double minHeight) {
    _flexNodeStyle.minHeight = minHeight;
  }

  @override
  double get styleMinHeight {
    return _flexNodeStyle.minHeight;
  }

  @override
  set wrap(FlexWrap flexWrap) {
    _flexNodeStyle.flexWrap = flexWrap;
  }

  @override
  FlexWrap get wrap => _flexNodeStyle.flexWrap;

  @override
  set flex(double flex) {
    _flexNodeStyle.flex = flex;
  }

  @override
  double get flex => _flexNodeStyle.flex;

  @override
  set display(FlexDisplay display) {
    _flexNodeStyle.display = display;
  }

  FlexDisplay get display => _flexNodeStyle.display;

  @override
  double get flexGrow {
    return _flexNodeStyle.flexGrow;
  }

  @override
  set flexGrow(double flexGrow) {
    _flexNodeStyle.flexGrow = flexGrow;
  }

  @override
  double get flexShrink {
    return _flexNodeStyle.flexShrink;
  }

  @override
  set flexShrink(double flexShrink) {
    _flexNodeStyle.flexShrink = flexShrink;
  }

  @override
  double getMargin(FlexStyleEdge spacingType) {
    return _flexNodeStyle.getMargin(spacingType).value;
  }

  @override
  void setMargin(FlexStyleEdge spacingType, double margin) {
    // 注意，设置宽高margin不直接改变flex node的属性值，在native层cssLayout后属性值由底层传上来设置
    _flexNodeStyle.setMargin(spacingType, margin);
  }

  @override
  double getPadding(FlexStyleEdge spacingType) {
    return _flexNodeStyle.getPadding(spacingType).value;
  }

  @override
  void setPadding(FlexStyleEdge spacingType, double padding) {
    // 注意，设置宽高padding不直接改变flex node的属性值，在native层cssLayout后属性值由底层传上来设置
    _flexNodeStyle.setPadding(spacingType, padding);
  }

  @override
  void setBorder(FlexStyleEdge spacingType, double border) {
    _flexNodeStyle.setBorder(spacingType, border);
  }

  @override
  double getPosition(FlexStyleEdge spacingType) {
    return _flexNodeStyle.getPosition(spacingType).value;
  }

  @override
  void setPosition(FlexStyleEdge spacingType, double position) {
    _flexNodeStyle.setPosition(spacingType, position);
  }

  @override
  double get layoutX {
    return _left;
  }

  @override
  double get layoutY {
    return _top;
  }

  @override
  double get layoutWidth {
    return _width;
  }

  @override
  double get layoutHeight {
    return _height;
  }

  @override
  FlexOverflow get overflow {
    return _flexNodeStyle.overflow;
  }

  @override
  set overflow(FlexOverflow overflow) {
    _flexNodeStyle.overflow = overflow;
  }
}
//
// Tencent is pleased to support the open source community by making
// Hippy available.
//
// Copyright (C) 2022 THL A29 Limited, a Tencent company.
// 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


/* $NetBSD: sig_machdep.c,v 1.1 2014/08/10 05:47:37 matt Exp $ */

/*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Matt Thomas of 3am Software Foundry.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>

__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.1 2014/08/10 05:47:37 matt Exp $");

#include <sys/param.h>
#include <sys/types.h>
#include <sys/cpu.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/siginfo.h>

#include <aarch64/locore.h>

void
sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
{
	struct lwp * const l = curlwp;
	struct proc * const p = l->l_proc;
	struct trapframe * const tf = l->l_md.md_utf;
	struct sigaltstack * const ss = &l->l_sigstk;
	const struct sigact_sigdesc * const sd =
	    &p->p_sigacts->sa_sigdesc[ksi->ksi_signo];

	const uintptr_t handler = (uintptr_t) sd->sd_sigact.sa_handler;
	const bool onstack_p = (ss->ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
	    && (sd->sd_sigact.sa_flags & SA_ONSTACK) != 0;

	vaddr_t sp;

	sp = onstack_p ? ((vaddr_t)ss->ss_sp + ss->ss_size) & -16 : tf->tf_sp;

	sp -= sizeof(ucontext_t);
	const vaddr_t ucp = sp;

	sp -= roundup(sizeof(siginfo_t), 16);
	const vaddr_t sip = sp;

	ucontext_t uc;
	memset(&uc, 0, sizeof(uc));
	uc.uc_flags = _UC_SIGMASK;
	uc.uc_sigmask = *mask;
	uc.uc_link = l->l_ctxlink;
	sendsig_reset(l, ksi->ksi_signo);
	mutex_exit(p->p_lock);
	cpu_getmcontext(l, &uc.uc_mcontext, &uc.uc_flags);

	/*
	 * Copy the siginfo and ucontext onto the user's stack.
	 */
	int error = copyout(&ksi->ksi_info, (void *)sip, sizeof(ksi->ksi_info));
	if (error == 0) {
		error = copyout(&uc, (void *)ucp, sizeof(uc));
	}

	mutex_enter(p->p_lock);

	if (error || sd->sd_vers != 2) {
		/*
		 * Thread has trashed its stack.  Blow it away.
		 */
		if (error == 0) {
			printf("pid %d.%d(%s): %p(sig %d): bad version %d\n",
			    p->p_pid, l->l_lid, p->p_comm, __func__,
			    ksi->ksi_signo, sd->sd_vers);
		}
		sigexit(l, SIGILL);
		/* NOTREACHED */
	}

	tf->tf_reg[0] = ksi->ksi_signo;
	tf->tf_reg[1] = sip;
	tf->tf_reg[2] = ucp;
	tf->tf_reg[28] = ucp;	/* put in a callee saved register */

	tf->tf_sp = sp;
	tf->tf_lr = sd->sd_tramp;
	tf->tf_pc = handler;

	/*
	 * Remember if we'ere now on the signal stack.
	 */
	if (onstack_p)
		ss->ss_flags |= SS_ONSTACK;
}


1 select-none"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="icon-xs"><path d="M12.0303 4.11328C13.4406 2.70317 15.7275 2.70305 17.1377 4.11328C18.5474 5.52355 18.5476 7.81057 17.1377 9.2207L10.8457 15.5117C10.522 15.8354 10.2868 16.0723 10.0547 16.2627L9.82031 16.4395C9.61539 16.5794 9.39783 16.7003 9.1709 16.7998L8.94141 16.8916C8.75976 16.9582 8.57206 17.0072 8.35547 17.0518L7.59082 17.1865L5.19727 17.5859C5.05455 17.6097 4.90286 17.6358 4.77441 17.6455C4.67576 17.653 4.54196 17.6555 4.39648 17.6201L4.24707 17.5703C4.02415 17.4746 3.84119 17.3068 3.72559 17.0957L3.67969 17.0029C3.59322 16.8013 3.59553 16.6073 3.60547 16.4756C3.61519 16.3473 3.6403 16.1963 3.66406 16.0537L4.06348 13.6602C4.1638 13.0582 4.22517 12.6732 4.3584 12.3096L4.45117 12.0791C4.55073 11.8521 4.67152 11.6346 4.81152 11.4297L4.9873 11.1953C5.17772 10.9632 5.4146 10.728 5.73828 10.4043L12.0303 4.11328ZM6.67871 11.3447C6.32926 11.6942 6.14542 11.8803 6.01953 12.0332L5.90918 12.1797C5.81574 12.3165 5.73539 12.4618 5.66895 12.6133L5.60742 12.7666C5.52668 12.9869 5.48332 13.229 5.375 13.8789L4.97656 16.2725L4.97559 16.2744H4.97852L7.37207 15.875L8.08887 15.749C8.25765 15.7147 8.37336 15.6839 8.4834 15.6436L8.63672 15.5811C8.78817 15.5146 8.93356 15.4342 9.07031 15.3408L9.2168 15.2305C9.36965 15.1046 9.55583 14.9207 9.90527 14.5713L14.8926 9.58301L11.666 6.35742L6.67871 11.3447ZM16.1963 5.05371C15.3054 4.16304 13.8616 4.16305 12.9707 5.05371L12.6074 5.41602L15.833 8.64258L16.1963 8.2793C17.0869 7.38845 17.0869 5.94456 16.1963 5.05371Z"></path><path d="M4.58301 1.7832C4.72589 1.7832 4.84877 1.88437 4.87695 2.02441C4.99384 2.60873 5.22432 3.11642 5.58398 3.50391C5.94115 3.88854 6.44253 4.172 7.13281 4.28711C7.27713 4.3114 7.38267 4.43665 7.38281 4.58301C7.38281 4.7295 7.27723 4.8546 7.13281 4.87891C6.44249 4.99401 5.94116 5.27746 5.58398 5.66211C5.26908 6.00126 5.05404 6.43267 4.92676 6.92676L4.87695 7.1416C4.84891 7.28183 4.72601 7.38281 4.58301 7.38281C4.44013 7.38267 4.31709 7.28173 4.28906 7.1416C4.17212 6.55728 3.94179 6.04956 3.58203 5.66211C3.22483 5.27


from legged_gym.envs.configs.basic_config import BasicCfg,BasicRunnerCfg
import numpy as np

class EnvCfg(BasicCfg):
    class env(BasicCfg.env):
        num_envs = 4096
        num_observations = 52 # 12(joint_pos) + 12(joint_vel) + 12 + 4 + 3 + 3 + 3
        num_actions = 12
        num_observation_history = 5
        episode_length_s = 20  # episode length in seconds

        # ----------- Basic Observation ------------
        ## 所有 vel 都看
        observe_vel = True
        observe_contact_states = True
        observe_command = True

        ## 手动 gait 设定的 task, 必须 observe gait command, clock 和 giat indice 才有意义
        observe_two_prev_actions = False
        observe_gait_commands = False
        observe_timing_parameter = False
        observe_clock_inputs = False
        observe_imu = False

        # ---------- Privileged Observations ----------
        num_privileged_obs = 3
        privileged_future_horizon = 0
        priv_observe_friction = True #! 1
        priv_observe_restitution = True #! 1
        priv_observe_base_mass = True #! 1
        priv_observe_com_displacement = False #! 3
        priv_observe_motor_strength = False #! 12

    class terrain(BasicCfg.terrain):
        mesh_type = 'trimesh' # "heightfield" # none, plane, heightfield or trimesh
        horizontal_scale = 0.1 # [m]
        vertical_scale = 0.005 # [m]
        border_size = 25 # [m]

        static_friction = 1.0
        dynamic_friction = 1.0
        restitution = 0.
        # Height Map only:
        measure_heights = False #! 17 * 11
        measured_points_x = np.linspace(-0.8,0.8,17).tolist()
        measured_points_y = np.linspace(-0.5,0.5,11).tolist()
        # Footclearance only:
        measure_foot_clearance = False #! 4
        # Footheight only:
        foot_offset = 0.02
        measure_foot_heights = False #! 3 * 3 * 4
        measured_foot_points_x = [-0.1,0.0,0.1]
        measured_foot_points_y = [-0.1,0.0,0.1]

        curriculum = True # True
        selected = True # False # select a unique terrain type and pass all arguments

        terrain_kwargs = {
            "plane_terrain":{
                "weight": 10.0,
                "height" : 0.0
            },
            'random_uniform_terrain': {
                "weight": 1.0,
                "min_height" : -0.03,
                "max_height" : 0.03,
                "step" : 0.005,
                "downsampled_scale" : 0.2
            },
            # 'sloped_terrain': {
            #     "weight": 1.0,
            #     "slope" : 0.4
            # },
            'pyramid_sloped_terrain': {
                "weight": 1.0,
                "slope" : 0.4,
                'platform_size':3.0
            },
            'wave_terrain':{
                "weight": 1.0,
                'num_waves': 2,
                'amplitude': 0.5,
            },
            # 'stairs_terrain':{
            #     "weight": 1.0,
            #     'step_height': 0.15,
            #     'step_width': 0.5,
            # },
            'pyramid_stairs_terrain':{
                "weight": 1.0,
                'step_width': 0.5,
                'step_height': 0.15,
                'platform_size': 2.0,
            },
            'stepping_stones_terrain':{
                "weight": 1.0,
                'stone_size': 1.5,
                'stone_distance': 0.1,
                'max_height': 0.0,
                'platform_size': 4.,
                'depth': -10
            },
            'discrete_obstacles_terrain':{
                "weight": 1.0,
                "max_height":0.2,
                "min_size" :1.0,
                "max_size" : 2.0,
                "num_rects" : 20,
                "platform_size":1.
            },

        }

        terrain_length = 8.
        terrain_width = 8.
        num_rows= 10 # number of terrain rows (levels)
        num_cols = 20 # number of terrain cols (types)

    class commands(BasicCfg.commands):

        command_curriculum = True
        cmd_cfg = {
            0:{
                'name':'vel_x',
                'init_low':-0.5,
                'init_high':0.5,
                'limit_low':-2.0,
                'limit_high':2.0,
                'local_range':0.5,
                'num_bins':21,
            },
            1:{
                'name':'vel_y',
                'init_low':-0.3,
                'init_high':0.3,
                'limit_low':-0.6,