remove attribute from unmachted attributes
							iterator.remove();
						}
					}
				}
			} else {
				String combinedMaskedRules = getParameterAsString(PARAMETER_ORDER_RULES);
				if (combinedMaskedRules == null || combinedMaskedRules.length() == 0) {
					throw new UserError(this, 205, PARAMETER_ORDER_RULES, "");
				}

				// iterate over all rules
				for (String maskedRule : combinedMaskedRules.split("\\|")) {
					String rule = Tools.unmask('|', maskedRule); // unmask them to allow regexp
					List<Attribute> matchedAttributes = new LinkedList<Attribute>();

					// iterate over all attributes and check if rules apply
					Iterator<Attribute> iterator = unmachtedAttributes.iterator();
					while (iterator.hasNext()) {
						Attribute attr = iterator.next();
						boolean match = false;
						if (getParameterAsBoolean(PARAMETER_USE_REGEXP)) {
							try {
								if (attr.getName().matches(rule)) {
									match = true;
								}
							} catch (PatternSyntaxException e) {
								throw new UserError(this, 206, rule, e.getMessage());
							}
						} else {
							if (attr.getName().equals(rule)) {
								match = true;
							}
						}

						// if rule applies remove attribute from unmachted list and add it to rules matched list
						if (match) {
							iterator.remove();
							matchedAttributes.add(attr);
						}
					}

					// sort matched attributes according to sort direction if more then one match has been found
					if (matchedAttributes.size() > 1) {
						sortAttributeListAlphabetically(matchedAttributes);
					}

					// add matched attributes to sorted attribute list
					sortedAttributes.addAll(matchedAttributes);

				}
			}

			/*
			 * UNMACHTED Handling
			 */

			if (!getParameterAsString(PARAMETER_HANDLE_UNMATCHED_ATTRIBUTES).equals(REMOVE_UNMATCHED_MODE)) {
				// sort unmachted attributes according to sort direction
				sortAttributeListAlphabetically(unmachtedAttributes);

				if (getParameterAsString(PARAMETER_HANDLE_UNMATCHED_ATTRIBUTES).equals(PREPEND_UNMATCHED_MODE)) {
					// prepend attributes to ordered attributes list
					sortedAttributes.addAll(0, unmachtedAttributes);
				} else {
					// append attributes to ordered attributes list
					sortedAttributes.addAll(unmachtedAttributes);
				}

				applySortedAttributes(sortedAttributes, null, attributes);

			} else {
				applySortedAttributes(sortedAttributes, unmachtedAttributes, attributes);
			}

		} else {
			throw new IllegalArgumentException("Order mode " + getParameterAsString(PARAMETER_ORDER_MODE) + " is not implemented!");
		}
		return exampleSet;
	}

	private List<Attribute> getAttributeList(Attributes attributes) {
		List<Attribute> attributeList = new LinkedList<Attribute>();
		for (Attribute attr : attributes) {
			attributeList.add(attr);
		}
		return attributeList;
	}

	/**
	 * Applies the sorted and unmachted attribute list to the provided {@link Attributes}.
	 * All unmachted attributes are removed from attributes and all {@link Attribute}s from the sorted list
	 * are added in correct order.
	 *
	 * @param sortedAttributeList attributes that will be removed first and added in correct order afterwards.
	 * @param unmachtedAttributes attributes that should be removed. May be null if no attributes should be removed.
	 */
	private void applySortedAttributes(List<Attribute> sortedAttributeList, List<Attribute> unmachtedAttributes, Attributes attributes) {
		if (unmachtedAttributes != null) {
			for (Attribute unmachted : unmachtedAttributes) {
				attributes.remove(unmachted);
			}
		}

		for (Attribute attribute : sortedA


时标记
    dxMap.get("VGPRO").put("updateTimeout", new Date().getTime())
    let timer = dxstd.setInterval(() => {
        let updateTimeout = dxMap.get("VGPRO").get("updateTimeout")
        if (!updateTimeout) {
            dxstd.clearInterval(timer)
            return
        }
        if (new Date().getTime() - updateTimeout > 2000) {
            if (config.get("sysInfo.language") == 1) {
                driver.screen.customPopWin("Upgrade interruption", 600000, true, "waring", false)
            } else {
                driver.screen.customPopWin("升级中断", 600000, true, "waring", false)
            }
            dxstd.clearInterval(timer)
            driver.pwm.beep(null, null, 1)
        }
    }, 2000)

}

//音频或图片更新 分包传输
vgProService.cmd82 = function (data) {
    // log.info("{vgPro} [cmd82] req:" + JSON.stringify(data))
    let pack = data.pack
    let packNum = common.littleEndianToDecimal(pack.data.substring(0, 4))
    let map = dxMap.get("VGPRO")
    let upgradeInfo = map.get('upgradeInfo')
    if (!upgradeInfo || !upgradeInfo.count || !upgradeInfo.size) {
        send(data.source, { "cmd": '82', "result": '90', "length": 0, 'data': '' })
        return
    }
    let firmware = ota.OTA_ROOT + '/download.zip'
    let fd = os.open(firmware, os.O_RDWR | os.O_CREAT | os.O_APPEND);
    //打开失败
    if (fd < 0) {
        return
    }
    let arraybuffer = common.hexStringToArrayBuffer(pack.data.substring(4))
    let pngBuffer = new Uint8Array(arraybuffer);
    os.write(fd, pngBuffer.buffer, 0, pngBuffer.length)
    os.close(fd)
    send(data.source, { "cmd": '82', "result": '00', "length": 0, 'data': '' })
    let index = utils.hexLEToTimestamp(pack.data.substring(0, 4))
    if (config.get("sysInfo.language") == 1) {
        driver.screen.customPopWin("Upgrading " + Math.floor((index / upgradeInfo.count) * 100) + "%", 2000, true, "waring", false)
    } else {
        driver.screen.customPopWin("正在升级 " + Math.floor((index / upgradeInfo.count) * 100) + "%", 2000, true, "waring", false)
    }

    dxMap.get("VGPRO").put("updateTimeout", new Date().getTime())
}

//音频或图片更新 结束指令
vgProService.cmd83 = function (data) {
    log.info("{vgPro} [cmd83] req:" + JSON.stringify(data))
    let pack = data.pack
    let md5 = pack.data.substring(4)
    let map = dxMap.get("VGPRO")
    let upgradeInfo = map.get('upgradeInfo')
    //3. 计算并比较md5是否一样
    let firmware = ota.OTA_ROOT + '/download.zip'
    const temp = ota.OTA_ROOT + '/temp'

    let size = parseInt(common.systemWithRes(`file="${firmware}"; [ -e "$file" ] && wc -c "$file" | awk '{print $1}' || echo "0"`, 100).split(/\s/g)[0])
    if (size != upgradeInfo.size) {
        map.del('upgradeInfo')
        send(data.source, { "cmd": '83', "result": '90', "length": 0, 'data': '' })
        return
    }
    let md5Hash = common.md5HashFile(firmware)


"""
Enunciado do Exercício:
    Reescreva a função leiaInt() que fizemos no desafio 104, incluindo agora a possibilidade da digitação de um número de tipo válido.
    Aproveite e crie também uma função leiaFloat() com a mesma funcionalidade.
"""

def leiaNumero(msg: True, tipo: type = float) -> float | int:
    while True:
        try:
            valor = tipo(input(msg))
            return valor
        except ValueError:
            tipo_str = 'real' if tipo is float else 'inteiro'
            print(f'\033[1;31mErro! Por favor, digite um número {tipo_str} válido.\033[m')
        except KeyboardInterrupt:
            print(f'\033[1;31mO usuário preferiu não informar os dados!\033[m')
            return 0

def leiaInt(msg: str) -> int:
    return leiaNumero(msg, tipo=int)

def leiaFloat(msg: str) -> float:
    return leiaNumero(msg, tipo=float)

def main():
    númeroInteiro = leiaInt('Digite um Inteiro: ')
    númeroReal = leiaFloat('Digite um Real: ')
    print(f'\nO valor inteiro digitado foi {númeroInteiro} e o real foi {númeroReal}.')

if __name__ == '__main__':
    main()


t val;
	int smolVersion = 0;

	// header
	smolv_Write4(outSpirv, kSpirVHeaderMagic); bytes += 4;
	smolv_Read4(bytes, bytesEnd, val); smolVersion = val >> 24; val &= 0x00FFFFFF; smolv_Write4(outSpirv, val); // version
	smolv_Read4(bytes, bytesEnd, val); smolv_Write4(outSpirv, val); // generator
	smolv_Read4(bytes, bytesEnd, val); smolv_Write4(outSpirv, val); // bound
	smolv_Read4(bytes, bytesEnd, val); smolv_Write4(outSpirv, val); // schema
	bytes += 4; // decode buffer size

	// there are two SMOL-V encoding versions, both not indicating anything in their header version field:
	// one that is called "before zero" here (2016-08-31 code). Support decoding that one only by presence
	// of this special flag.
	const bool beforeZeroVersion = smolVersion == 0 && (flags & kDecodeFlagUse20160831AsZeroVersion) != 0;

	const int knownOpsCount = smolv_GetKnownOpsCount(smolVersion);

	uint32_t prevResult = 0;
	uint32_t prevDecorate = 0;

	while (bytes < bytesEnd)
	{
		// read length + opcode
		uint32_t instrLen;
		SpvOp op;
		if (!smolv_ReadLengthOp(bytes, bytesEnd, instrLen, op))
			return false;
		const bool wasSwizzle = (op == SpvOpVectorShuffleCompact);
		if (wasSwizzle)
			op = SpvOpVectorShuffle;
		smolv_Write4(outSpirv, (instrLen << 16) | op);

		size_t ioffs = 1;

		// read type as varint, if we have it
		if (smolv_OpHasType(op, knownOpsCount))
		{
			if (!smolv_ReadVarint(bytes, bytesEnd, val)) return false;
			smolv_Write4(outSpirv, val);
			ioffs++;
		}
		// read result as delta+varint, if we have it
		if (smolv_OpHasResult(op, knownOpsCount))
		{
			if (!smolv_ReadVarint(bytes, bytesEnd, val)) return false;
			val = prevResult + smolv_ZigDecode(val);
			smolv_Write4(outSpirv, val);
			prevResult = val;
			ioffs++;
		}

		// Decorate: IDs relative to previous decorate
		if (op == SpvOpDecorate || op == SpvOpMemberDecorate)
		{
			if (!smolv_ReadVarint(bytes, bytesEnd, val)) return false;
			// "before zero" version did not use zig encoding for the value
			val = prevDecorate + (beforeZeroVersion ? val : smolv_ZigDecode(val));
			smolv_Write4(outSpirv, val);
			prevDecorate = val;
			ioffs++;
		}

		// MemberDecorate special decoding
		if (op == SpvOpMemberDecorate && !beforeZeroVersion)
		{
			if (bytes >= bytesEnd)
				return false; // broken input
			int count = *bytes++;
			int prevIndex = 0;
			int prevOffset = 0;
			for (int m = 0; m < count; ++m)
			{
				// read member index
				uint32_t memberIndex;
				if (!smolv_ReadVarint(bytes, bytesEnd, memberIndex)) return false;
				memberIndex += prevIndex;
				prevIndex = memberIndex;

				// decoration (and length if not common/known)
				uint32_t memberDec;
				if (!smolv_ReadVarint(bytes, bytesEnd, memberDec)) return false;
				const int knownExtraOps = smolv_DecorationExtraOps(memberDec);
				uint32_t memberLen;


final StreamTarget<ViewEvent> _owner;
  BroadcastEvents._(this._owner);

  /** Listeners for the activate event ([ActivateEvent]).
   */
  Stream<ActivateEvent> get activate => EventStreams.activate.forTarget(_owner);
}

/** An implementation of [Broadcaster].
 */
class _Broadcaster extends Broadcaster {
  final Map<String, List<ViewEventListener>> _listeners;
  BroadcastEvents _on;

  _Broadcaster(): _listeners = new HashMap() {
    _on = new BroadcastEvents._(this);
  }

  BroadcastEvents get on => _on;

  void addEventListener(String type, ViewEventListener listener) {
    if (listener == null)
      throw new ArgumentError("listener");

    _listeners.putIfAbsent(type, () => []).add(listener);
  }
  void removeEventListener(String type, ViewEventListener listener) {
    final ls = _listeners[type];
    if (ls != null)
      ls.remove(listener);
  }

  bool sendEvent(ViewEvent event, {String type}) {
    if (type == null)
      type = event.type;

    List<ViewEventListener> ls;
    bool dispatched = false;
    if ((ls = _listeners[type]) != null) {
      //Note: we make a copy of ls since listener might remove other listeners
      //It means the removing and adding of listeners won't take effect until next event
      for (final ViewEventListener listener in new List.from(ls)) {
        dispatched = true;
        listener(event);
        if (event.isPropagationStopped)
          return true; //done
      }
    }

    //broadcast to all root views
    for (final v in new List<View>.from(rootViews))
      if (v.sendEvent(event, type: type))
        dispatched = true;
    return dispatched;
  }

  void postEvent(ViewEvent event, {String type}) {
    Timer.run(() {sendEvent(event, type: type);});
      //note: the order of messages is preserved across all views (and message queues)
      //CONSIDER if it is better to have a queue shared by views/message queues/broadcaster
  }
}
//Copyright (C) 2012 Potix Corporation. All Rights Reserved.
//History: Mon, Mar 26, 2012  2:47:38 PM
// Author: tomyeh
part of rikulo_layout;

/**
 * The context to measure size.
 */
class MeasureContext {
  /** The widths of measured views. The size is stored to speed up
   * the measurement since [View.measureWidth_] might be called multiple times
   * in one layout run. If the width shall be re-measured, you can
   * remove it from this map.
   *
   * Note: null indicates the width is up to the system, i.e., no need
   * to set the width.
   */
  final Map<View, int> widths;
  /** The heights of measured views. The size is stored to speed up
   * the measurement since [View.measureHeight_] might be called multiple times
   * in one layout run. If the height shall be re-measured, you can
   * remove it from this map.
   *
   * Note: null indicates the height is up to the system, i.e., no need
   * to set the height.
   */
  final Map<View, int> heights;
  final Map<View, int> _borderWds, _borderHghs;
  Map<String, dynamic> _dataset;
  Size _windowSize;

  MeasureContext(): widths = new HashMap(), heights = new HashMap(),
  _borderWds = new HashMap(), _borderHghs = new HashMap();

  ///Returns the inner size of the window.
  Size get windowSize {
    ///It assumes the window size won't change during layout
    if (_windowSize == null)
      _windowSize = DomUtil.windowSize;
    return _windowSize;
  }

  /** Returns the


 PacingData* pacingEntry, PacingData::FrameType frameType)
{
    const PacingData::FrameInfo& frameInfo = pacingEntry->frames[frameType];

    const UINT uSyncInterval            = pacingEntry->vsync ? 1 : 0;
    const bool bExclusiveFullscreen     = isExclusiveFullscreen(presenter->swapChain);
    const bool bSetAllowTearingFlag     = pacingEntry->tearingSupported && !bExclusiveFullscreen && (0 == uSyncInterval);
    const UINT uFlags                   = bSetAllowTearingFlag * DXGI_PRESENT_ALLOW_TEARING;

    struct AntiLag2Data
    {
        AMD::AntiLag2DX12::Context* context;
        bool                        enabled;
    } data;

    // {5083ae5b-8070-4fca-8ee5-3582dd367d13}
    static const GUID IID_IFfxAntiLag2Data = {0x5083ae5b, 0x8070, 0x4fca, {0x8e, 0xe5, 0x35, 0x82, 0xdd, 0x36, 0x7d, 0x13}};

    bool isInterpolated = frameType != PacingData::Real;

    UINT size = sizeof(data);
    if (SUCCEEDED(presenter->swapChain->GetPrivateData(IID_IFfxAntiLag2Data, &size, &data)))
    {
        if (data.enabled)
        {
            AMD::AntiLag2DX12::SetFrameGenFrameType(data.context, isInterpolated);
        }
    }

    presenter->swapChain->Present(uSyncInterval, uFlags);

    // tick frames sent for presentation
    presenter->presentQueue->Signal(presenter->presentFence, frameInfo.presentIndex);

}

DWORD WINAPI presenterThread(LPVOID param)
{
    FrameinterpolationPresentInfo* presenter = static_cast<FrameinterpolationPresentInfo*>(param);

    if (presenter)
    {
        UINT64 numFramesSentForPresentation = 0;
        int64_t qpcFrequency                 = 0;

        LARGE_INTEGER freq;
        QueryPerformanceFrequency(&freq);
        qpcFrequency = freq.QuadPart;

        TIMECAPS timerCaps;
        timerCaps.wPeriodMin = UNKNOWN_TIMER_RESOlUTION; //Default to unknown to prevent sleep without guarantees.

        presenter->previousPresentQpc = 0;

        while (!presenter->shutdown)
        {

            WaitForSingleObject(presenter->pacerEvent, INFINITE);

            if (!presenter->shutdown)
            {
                EnterCriticalSection(&presenter->criticalSectionScheduledFrame);

                PacingData entry = presenter->scheduledPresents;
                presenter->scheduledPresents.invalidate();

                LeaveCriticalSection(&presenter->criticalSectionScheduledFrame);

                if (entry.numFramesToPresent > 0)
                {
                    // we might have dropped entries so have to update here, oterwise we might deadlock
                    presenter->presentQueue->Signal(presenter->presentFence, entry.numFramesSentForPresentationBase);
                    presenter->presentQueue->Wait(presenter->interpolationFence, entry.interpolationCompletedFenceValue);

                    for (uint32_t frameType = 0; frameType < PacingData::FrameType::Count; frameType++)
                    {
                        const PacingData::FrameInfo& frameInfo = entry.frames[frameType];
                        if (frameInfo.doPresent)
                        {
                            compositeSwapChainFrame(presenter, &entry, frameType);

                            // signal replacement buffer availability
                            if (frameInfo.presentIndex == entry.replacementBufferFenceSignal)
                            {
                                presenter->presentQueue->Signal(presenter->replacementBufferFence, entry.replacementBufferFenceSignal);
                            }

                            MMRESULT result = timeGetDevCaps(&timerCaps, sizeof(timerCaps));
                            if (result != MMSYSERR_NOERROR || !presenter->allowHybridSpin)
                            {
                                timerCaps.wPeriodMin = UNKNOWN_TIMER_RESOlUTION;
                            }
                            else
                            {
                                timerCaps.wPeriodMin = FFX_MAXIMUM(1, timerCaps.wPeriodMin);
                            }

                            // pacing without composition


is function
 * returns -EINVAL.
 *
 * If either port is not connected, this function returns -EPIPE.
 *
 * @port1 and @port2 are typically DT sibling nodes, but may have different
 * parents when, for instance, two separate LVDS encoders carry the even and odd
 * pixels.
 *
 * Return:
 * * DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS - @port1 carries even pixels and @port2
 *   carries odd pixels
 * * DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS - @port1 carries odd pixels and @port2
 *   carries even pixels
 * * -EINVAL - @port1 and @port2 are not connected to a dual-link LVDS sink, or
 *   the sink configuration is invalid
 * * -EPIPE - when @port1 or @port2 are not connected
 */
int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1,
					  const struct device_node *port2)
{
	int remote_p1_pt, remote_p2_pt;

	if (!port1 || !port2)
		return -EINVAL;

	remote_p1_pt = drm_of_lvds_get_remote_pixels_type(port1);
	if (remote_p1_pt < 0)
		return remote_p1_pt;

	remote_p2_pt = drm_of_lvds_get_remote_pixels_type(port2);
	if (remote_p2_pt < 0)
		return remote_p2_pt;

	/*
	 * A valid dual-lVDS bus is found when one remote port is marked with
	 * "dual-lvds-even-pixels", and the other remote port is marked with
	 * "dual-lvds-odd-pixels", bail out if the markers are not right.
	 */
	if (remote_p1_pt + remote_p2_pt != DRM_OF_LVDS_EVEN + DRM_OF_LVDS_ODD)
		return -EINVAL;

	return remote_p1_pt == DRM_OF_LVDS_EVEN ?
		DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS :
		DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS;
}
EXPORT_SYMBOL_GPL(drm_of_lvds_get_dual_link_pixel_order);


; }
    if settings.flags.world_tour { flags += "WorldTour, "; }
    if matches!(settings.spawn_loc, Spawn::Random) { flags += "RandomSpawn, "; }
    // TODO fully random?
    // TODO this isn't needed post the rando versioning changes
    flags += "NoFreeSword, ";
    // if flags.len() == empty_len { return String::new(); }
    for _ in 0..2 { flags.pop(); }  // remove the last comma
    flags.push('\n');
    flags
}

#[derive(Debug, Default)]
struct SpawnLoc {
    identifier: String,
    position: Position,
}

pub fn generate_seed(graph: &WorldGraph, settings: &Settings, headers: &[String], mut rng: StdRng, verbose: bool) -> Result<String, String> {
    let mut world = World::new(graph);
    world.pool = ItemPool::preset(&settings.pathsets);
    world.player.spawn(settings);

    let flag_line = write_flags(settings);

    let mut header_block = String::new();
    let mut total_dependencies = HashSet::new();
    for header in headers {
        let (header, dependencies) = headers::parse_header(header, &mut world, verbose, &settings.pathsets).map_err(|err| format!("{} in inline header", err))?;
        header_block += &header;
        total_dependencies = total_dependencies.union(&dependencies).cloned().collect();
    }
    for mut path in settings.header_list.clone() {
        path.set_extension("wotwrh");
        let header = util::read_file(&path, "headers").map_err(|err| format!("Error reading header from {:?}: {}", path, err))?;
        let (header, dependencies) = headers::parse_header(&header, &mut world, verbose, &settings.pathsets).map_err(|err| format!("{} in header '{:?}'", err, path))?;
        header_block += &header;
        total_dependencies = total_dependencies.union(&dependencies).cloned().collect();
    }

    let mut depth = 0;
    while !total_dependencies.is_empty() {
        let mut nested_dependencies = HashSet::new();
        for dependency in total_dependencies.drain() {
            let header = util::read_file(&dependency, "headers").map_err(|err| format!("Error reading header from {:?}: {}", dependency, err))?;
            let (header, dependencies) = &headers::parse_header(&header, &mut world, verbose, &settings.pathsets)?;
            header_block += &header;
            nested_dependencies = nested_dependencies.union(&dependencies).cloned().collect();
        }
        total_dependencies = nested_dependencies;
        depth += 1;
        if depth > 100 {
            return Err(String::from("More than 100 nested dependencies. Is there a circular !!include?"));
        }
    }

    let mut spawn;
    let mut spawn_loc = SpawnLoc::default();

    let mut placements = Vec::<Placement>::new();
    for index in 0..RETRIES {
        spawn = pick_spawn(graph, &settings, &mut rng)?;
        spawn_loc = SpawnLoc {
            identifier: spawn.identifier.clone(),
            position: spawn.position.clone().unwrap(),
        };
        if verbose { eprintln!("Spawning on {}", spawn_loc.identifier); }

        match generator::generate_placements(world.clone(), &spawn_loc.identifier, settings, &mut rng, verbose) {
            Ok(seed) => {
                placements = seed;
                eprintln!("Generated seed after {} {}{}", index + 1, if index == 0 { "try" } else { "tries" },


local mType = Game.createMonsterType("Ghoul")
local monster = {}

monster.description = "a ghoul"
monster.experience = 85
monster.outfit = {
	lookType = 18,
	lookHead = 0,
	lookBody = 0,
	lookLegs = 0,
	lookFeet = 0,
	lookAddons = 0,
	lookMount = 0
}

monster.raceId = 18
monster.Bestiary = {
	class = "Undead",
	race = BESTY_RACE_UNDEAD,
	toKill = 500,
	FirstUnlock = 25,
	SecondUnlock = 250,
	CharmsPoints = 15,
	Stars = 2,
	Occurrence = 0,
	Locations = "Ancient Temple in the Skeleton area, way to Mintwallin, Old Mintwallin Quest, \z
		Alatar Lake, Magician Tower, Mount Sternum Undead Cave, Ghostlands, Hellgate, \z
		Maze of Lost Souls, below Point of No Return in Outlaw Camp, Plains of Havoc in Necromant House, \z
		Drefia and Drefia's underground caves, Edron ghoul hill, Venore Amazon Camp underground, \z
		Venore Swamp Troll cave, Ghostship between Venore and Darashia, Triangle Tower, Dark Cathedral, \z
		Ankrahmun tombs, Isle of the Kings, Treasure Island, Nargor Undead Cave, Helheim, Lion's Rock, \z
		The Witches' Cliff (only accessible during a quest) and a cave northeast of Ab'Dendriel. \z
		Also found behind a wall in both Rookgaard and Paradox Tower, although they cannot be reached."
	}

monster.health = 100
monster.maxHealth = 100
monster.race = "blood"
monster.corpse = 5976
monster.speed = 144
monster.manaCost = 450

monster.changeTarget = {
	interval = 4000,
	chance = 0
}

monster.strategiesTarget = {
	nearest = 100,
}

monster.flags = {
	summonable = true,
	attackable = true,
	hostile = true,
	convinceable = true,
	pushable = false,
	rewardBoss = false,
	illusionable = true,
	canPushItems = true,
	canPushCreatures = false,
	staticAttackChance = 90,
	targetDistance = 1,
	runHealth = 0,
	healthHidden = false,
	isBlockable = false,
	canWalkOnEnergy = false,
	canWalkOnFire = false,
	c


tType::SpawnPosition,
    );

    m.insert(
        PacketId(0x4A, PacketDirection::Clientbound, PacketStage::Play),
        PacketType::TimeUpdate,
    );

    m.insert(
        PacketId(0x4F, PacketDirection::Clientbound, PacketStage::Play),
        PacketType::CollectItem,
    );

    m.insert(
        PacketId(0x50, PacketDirection::Clientbound, PacketStage::Play),
        PacketType::EntityTeleport,
    );

    m
});

static PACKET_TYPE_MAPPINGS: Lazy<AHashMap<PacketType, PacketId>> = Lazy::new(|| {
    let mut m = AHashMap::new();

    for (key, val) in PACKET_ID_MAPPINGS.clone().into_iter() {
        m.insert(val, key);
    }

    m
});

impl PacketType {
    pub fn get_from_id(id: PacketId) -> Result<PacketType, ()> {
        PACKET_ID_MAPPINGS.get(&id).copied().ok_or(())
    }

    pub fn get_id(self) -> PacketId {
        *PACKET_TYPE_MAPPINGS.get(&self).unwrap_or_else(|| panic!("failed to find packet ID for packet type {:?} (try inserting it into the ID map in core/network/packet.rs)", self))
    }

    pub fn get_implementation(self) -> Box<dyn Packet> {
        IMPL_MAP.get(&self).unwrap().build()
    }

    /// Returns a unique ID, allocated
    /// consecutively for each packet type.
    pub fn ordinal(self) -> usize {
        self as usize
    }
}

/// Certain packets have the same ID as
/// another packet during a different login stage (blame Mojang),
/// so this struct is used to differentiate between packets like that.
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
pub struct PacketId(pub u32, pub PacketDirection, pub PacketStage);

#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)]
pub enum PacketDirection {
    Serverbound,
    Clientbound,
}

#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)]
pub enum PacketStage {
    Handshake,
    Status,
    Login,
    Play,
}
<filename>lexical-core/tests/api_tests.rs
#[test]
#[cfg(feature = "write-integers")]
fn integer_to_string_test() {
    let mut buffer = [b'0'; lexical_core::BUFFER_SIZE];
    assert_eq!(lexical_core::write(12345u32, &mut buffer), b"12345");
    let options = lexical_core::WriteIntegerOptions::new();
    const FORMAT: u128 = lexical_core::format::STANDARD;
    assert_eq!(
        lexical_core::write_with_options::<_, FORMAT>(12345u32, &mut buffer, &options),
        b"12345"
    );
}

#[test]
#[cfg(feature = "write-floats")]
fn float_to_string_test() {
    let mut buffer = [b'0'; lexical_core::BUFFER_SIZE];
    assert_eq!(lexical_core::write(12345.0f32, &mut buffer), b"12345.0");
    let options = lexical_core::WriteFloatOptions::new();
    const FORMAT: u128 = lexical_core::format::STANDARD;
    assert_eq!(
        lexical_core::write_with_options::<_, FORMAT>(12345.0f32, &mut buffer, &options),
        b"12345.0"
    );
}

#[test]
#[cfg(feature = "parse-integers")]
fn string_to_integer_test() {
    assert_eq!(lexical_core::parse(b"12345"), Ok(12345u32));
    assert_eq!(lexical_core::parse_partial(b"12345"), Ok((12345u32, 5)));

    let options = lexical_core::ParseIntegerOptions::new();
    const FORMAT: u128 = lexical_core::format::STANDARD;
    assert_eq!(lexical_core::parse_with_options::<_, FORMAT>(b"12345", &options), Ok(12345u32));


00008 */  beq     $zero, $zero, .L80981090
/* 03A00 80981070 ADEE0164 */  sw      $t6, 0x0164($t7)           ## 00000164
.L80981074:
/* 03A04 80981074 24050003 */  addiu   $a1, $zero, 0x0003         ## $a1 = 00000003
/* 03A08 80981078 0C25F9C1 */  jal     func_8097E704
/* 03A0C 8098107C 24060004 */  addiu   $a2, $zero, 0x0004         ## $a2 = 00000004
/* 03A10 80981080 10400003 */  beq     $v0, $zero, .L80981090
/* 03A14 80981084 8FB90018 */  lw      $t9, 0x0018($sp)
/* 03A18 80981088 24180010 */  addiu   $t8, $zero, 0x0010         ## $t8 = 00000010
/* 03A1C 8098108C AF380164 */  sw      $t8, 0x0164($t9)           ## 00000164
.L80981090:
/* 03A20 80981090 8FBF0014 */  lw      $ra, 0x0014($sp)
/* 03A24 80981094 27BD0018 */  addiu   $sp, $sp, 0x0018           ## $sp = 00000000
/* 03A28 80981098 03E00008 */  jr      $ra
/* 03A2C 8098109C 00000000 */  nop


 U, 1, 24, std.pt, std.freeze(draw_oneshot_F, ["S"]), 0);
  std.div_spa(b, 1, 6, std.pt);
  std.div_add(b, U, 1, 24, std.pt, std.freeze(draw_oneshot_F, ["A"]), 0);
  std.div_spa(b, 1, 6, std.pt);
  std.div_add(b, U, 1, 24, std.pt, std.freeze(draw_oneshot_F, ["C"]), 0);
  std.div_spa(b, 1, 6, std.pt);
  std.div_add(b, U, 1, 24, std.pt, std.freeze(draw_oneshot_F, ["R"]), 0);
  std.div_spa(b, 1, 20, std.pt);
  std.div_spa(b, 1, 10, std.al);
  std.div_add(b, U, 1, 120, std.pt, d_vert_zoom_F, 0);
  std.div_spa(b, 1, 20, std.pt);
  std.div_add(b, U, 1, 24, std.pt, d_sidebar_toggle_F, 0);
  std.div_spa(b, 1, 2, std.pt);
  std.div_end(b);
  std.draw_slices(b);
std.k_leave(b);
}

//====================
//   d_note
//====================
function d_note(b) {
std.k_enter(b);
std.div_begin(b, null, false, false, false);
  std.div_add(b, U, 0, 10, std.al, d_note_410_F, 0);
  std.div_spa(b, 0, 3, std.pt);
  std.div_add(b, U, 0, 20, std.pt, d_edit_icon_F, 0);
  std.div_spa(b, 0, 2, std.pt);
  std.div_end(b);
  std.draw_slices(b);
std.k_leave(b);
}

//====================
//   d_phase_board
//====================
function d_phase_board(b) {
std.k_enter(b);
std.div_begin(b, null, false, false, false);
  std.k_back(b, {fill:getn(cs, F_c_sidebar_back)});
  std.div_spa(b, 0, 4, std.pt);
  if (getn(intf, F_r_side_vis) === Y) {
    std.div_spa(b, 0, 6, std.pt);
    let avail = std.dots_to_pt(b, b.bounds.width);
    let sidebar = std.interpolate(avail, 400, 1000, 130, 200, { clamp:Y });
    std.div_add(b, U, 0, sidebar, std.pt, d_fat_sidebar_F, 0);
  } else {
    std.div_add(b, U, 0, 24, std.pt, d_minimal_sidebar_F, 0);
    std.div_spa(b, 0, 4, std.pt);
  }
  std.div_add(b, U, 0, 10, std.al, _d_currimage_outer_F, 0);
  std.div_end(b);
  std.draw_slices(b);
std.k_leave(b);
}

//====================
//   d_phase_home
//====================
function d_phase_home(b) {
std.k_enter(b);
std.div_begin(b, null, false, false, false);
  let gap = std.interpolate(std.dots_to_pt(b, b.bounds.height), 300, 1000, 3, 20, { clamp:Y });
  let hgt = std.interpolate(std.dots_to_pt(b, b.bounds.height), 300, 1000, 24, 36, { clamp:Y });
  std.div_spa(b, 1, gap, std.pt);


	subql	IMM (1),d6
	bpl	4b
#endif
	movel	IMM (0),d7
	movel	d7,d6
	bra	Ladddf$4
5:
	movel	d2,d3
	movel	d1,d2
	movel	d0,d1
	movel	IMM (0),d0
#ifndef __mcoldfire__
	subw	IMM (32),d6
#else
	subl	IMM (32),d6
#endif
	bra	2b
6:
	movew	d2,d3
	swap	d3
	movew	d1,d2
	swap	d2
	movew	d0,d1
	swap	d1
	movew	IMM (0),d0
	swap	d0
#ifndef __mcoldfire__
	subw	IMM (16),d6
#else
	subl	IMM (16),d6
#endif
	bra	3b
Ladddf$3:
#ifndef __mcoldfire__
	exg	d4,a2
	exg	d5,a3
#else
	movel	d4,a4
	movel	a2,d4
	movel	a4,a2
	movel	d5,a4
	movel	a3,d5
	movel	a4,a3
#endif
Ladddf$4:
| Now we have the numbers in d0--d3 and d4--d7, the exponent in a2, and
| the signs in a4.

| Here we have to decide whether to add or subtract the numbers:
#ifndef __mcoldfire__
	exg	d7,a0		| get the signs
	exg	d6,a3		| a3 is free to be used
#else
	movel	d7,a4
	movel	a0,d7
	movel	a4,a0
	movel	d6,a4
	movel	a3,d6
	movel	a4,a3
#endif
	movel	d7,d6		|
	movew	IMM (0),d7	| get a's sign in d7 '
	swap	d6              |
	movew	IMM (0),d6	| and b's sign in d6 '
	eorl	d7,d6		| compare the signs
	bmi	Lsubdf$0	| if the signs are different we have
				| to subtract
#ifndef __mcoldfire__
	exg	d7,a0		| else we add the numbers
	exg	d6,a3		|
#else
	movel	d7,a4
	movel	a0,d7
	movel	a4,a0
	movel	d6,a4
	movel	a3,d6
	movel	a4,a3
#endif
	addl	d7,d3		|
	addxl	d6,d2		|
	addxl	d5,d1		|
	addxl	d4,d0           |

	movel	a2,d4		| return exponent to d4
	movel	a0,d7		|
	andl	IMM (0x80000000),d7 | d7 now has the sign

#ifndef __mcoldfire__
	moveml	sp@+,a2-a3
#else
	movel	sp@+,a4
	movel	sp@+,a3
	movel	sp@+,a2
#endif

| Before rounding normalize so bit #DBL_MANT_DIG is set (we will consider
| the case of denormalized numbers in the rounding routine itself).
| As in the addition (not in the subtraction!) we


creen::default();
    let crossterm = Crossterm::new(&screen);

    // init some modules we use for this demo
    let input = crossterm.input();
    let terminal = crossterm.terminal();
    let mut cursor = crossterm.cursor();

    let mut stdin = input.read_until_async(b'\r').bytes();

    for i in 0..100 {
        terminal.clear(ClearType::All);
        cursor.goto(1, 1);
        let a = stdin.next();

        println!("pressed key: {:?}", a);

        if let Some(Ok(b'\r')) = a {
            println!("The enter key is hit and program is not listening to input anymore.");
            break;
        }

        if let Some(Ok(b'x')) = a {
            println!("The key: x was pressed and program is terminated.");
            break;
        }

        thread::sleep(time::Duration::from_millis(100));
    }
}

/// this will read pressed characters async until `x` is typed.
pub fn read_async() {
    let screen = Screen::default();
    let input = input(&screen);

    let mut stdin = input.read_async().bytes();

    for i in 0..100 {
        let a = stdin.next();

        println!("pressed key: {:?}", a);

        if let Some(Ok(b'x')) = a {
            println!("The key: `x` was pressed and program is terminated.");
            break;
        }

        thread::sleep(time::Duration::from_millis(50));
    }
}

pub fn read_async_demo() {
    let screen = Screen::new(true);
    let crossterm = Crossterm::new(&screen);

    // init some modules we use for this demo
    let input = crossterm.input();
    let terminal = crossterm.terminal();
    let mut cursor = crossterm.cursor();

    // this will setup the async reading.
    let mut stdin = input.read_async().bytes();

    // clear terminal and reset the cursor.
    terminal.clear(ClearType::All);
    cursor.goto(1, 1);

    // loop until the enter key (\r) is pressed.
    loop {
        terminal.clear(ClearType::All);
        cursor.goto(1, 1);

        // get the next pressed key
        let pressed_key = stdin.next();
        terminal.write(format!("{:?}    <- Character pressed", pressed_key));

        // check if pressed key is enter (\r)
        if let Some(Ok(b'\r')) = pressed_key {
            break;
        }

        // wait 200 ms and reset cursor write
        thread::sleep(Duration::from_millis(200));
    }
}

pub fn async_reading_on_alternate_screen() {
    let screen = Screen::new(false);

    // switch to alternate screen
    if let Ok(alternate) = screen.enable_alternate_modes(true)
    {
        let crossterm = Crossterm::new(&alternate.screen);
        // init some


 rigid body frame after accounting
	//suspension compression and compliance.
	mComponentSequence.add(static_cast<PxVehicleWheelComponent*>(this));

	//Write the local poses of each wheel to the corresponding shapes on the physx actor.
	//Write the momentum change applied to the vehicle's rigid body to the physx actor.
	//The physx scene can now try to apply that change to the physx actor.
	//The physx scene will account for collisions and constraints to be applied to the vehicle
	//that occur by applying the change.
	if(addPhysXBeginEndComponents)
		mComponentSequence.add(static_cast<PxVehiclePhysXActorEndComponent*>(this));
}

}//namespace snippetvehicle
// 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 of NVIDIA CORPORATION 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 ''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 OWNER 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.
//
// Copyright (c) 2008-2025 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.

#ifdef RENDER_SNIPPET

#include "PxPhysicsAPI.h"

#include "../snippetrender/SnippetRender.h"
#include "../snippetrender/SnippetCamera.h"
#include "../snippetutils/SnippetUtils.h"

using namespace physx;

extern void initPhysics(bool interactive);
extern void stepPhysics(bool interactive);
extern void cleanupPhysics(bool interactive);
extern void keyPress(unsigned char key, const PxTransform& camera);
extern void renderScene();

namespace
{
Snippets::Camera* sCamera;

void renderCallback()
{
	stepPhysics(true);

	Snippets::startRender(sCamera);

//		PxVec3 camPos = sCamera->getEye();
//		PxVec3 camDir = sCamera->getDir();
//		printf("camPos: (%ff, %ff, %ff)\n", camPos.x, camPos.y, camPos.z);
//		printf("camDir: (%ff, %ff, %ff)\n", camDir.x, camDir.y, camDir.z);

	renderScene();

	Snippets::finishRender();
}

void exitCallback()
{
	delete sCamera;
	cleanupPhysics(true);
}
}

void renderLoop()
{
	sCamera = new Snippets::Camera(PxVec3(-1.301793f, 2.118334f, 7.282349f), PxVec3(0.209045f, -0.311980f, -0.926806f));

	Snippets::setupDefault("PhysX Snippet StandaloneQuerySystem", sCamera, keyPress, renderCallback, exitCallback);

	initPhysics(t


Trace()
	}

	durationKey, found := durationUnits[zerolog.DurationFieldUnit]
	if !found {
		zl.Error().
			Dur("zerolog.DurationFieldUnit", zerolog.DurationFieldUnit).
			Msg("unknown value for zerolog.DurationFieldUnit")
		durationKey = "elapsed_"
	}

	event.Dur(durationKey, time.Since(begin))

	sql, rows := f()
	if sql != "" {
		event.Str("sql", sql)
	}
	if rows > -1 {
		event.Int64("rows", rows)
	}

	event.Send()

	return
}
package apps

import (
	"fmt"
	"github.com/labstack/echo/v4"
	"github.com/texm/dokku-go"
	"gitlab.com/texm/shokku/internal/env"
	"gitlab.com/texm/shokku/internal/server/dto"
	"net/http"
)

func GetAppNetworksReport(e *env.Env, c echo.Context) error {
	var req dto.GetAppNetworksReportRequest
	if err := dto.BindRequest(c, &req); err != nil {
		return err.ToHTTP()
	}

	report, err := e.Dokku.GetAppNetworkReport(req.Name)
	if err != nil {
		return fmt.Errorf("getting app network report: %w", err)
	}

	return c.JSON(http.StatusOK, dto.GetAppNetworksReportResponse{
		AttachInitial:     report.ComputedInitialNetwork,
		AttachPostCreate:  report.ComputedAttachPostCreate,
		AttachPostDeploy:  report.ComputedAttachPostDeploy,
		BindAllInterfaces: report.ComputedBindAllInterfaces,
		TLD:               report.ComputedTLD,
		WebListeners:      report.WebListeners,
	})
}

func SetAppNetworks(e *env.Env, c echo.Context) error {
	var req dto.SetAppNetworksRequest
	if err := dto.BindRequest(c, &req); err != nil {
		return err.ToHTTP()
	}

	if req.Initial != nil {
		err := e.Dokku.SetAppNetworkProperty(req.Name,
			dokku.NetworkPropertyInitialNetwork, *req.Initial)
		if err != nil {
			return fmt.Errorf("setting initial network: %w", err)
		}
	}

	if req.PostCreate != nil {
		err := e.Dokku.SetAppNetworkProperty(req.Name,
			dokku.NetworkPropertyAttachPostCreate, *req.PostCreate)
		if err != nil {
			return fmt.Errorf("setting postcreate network: %w", err)
		}
	}

	if req.PostDeploy != nil {
		err := e.Dokku.SetAppNetworkProperty(req.Name,
			dokku.NetworkPropertyAttachPostDeploy, *req.PostDeploy)
		if err != nil {
			return fmt.Errorf("setting postdeploy network: %w", err)
		}
	}

	if req.BindAllInterfaces != nil {
		bindAll := "false"
		if *req.BindAllInterfaces {
			bindAll = "true"
		}
		err := e.Dokku.SetAppNetworkProperty(req.Name,
			dokku.NetworkPropertyBindAllInterfaces, bindAll)
		if err != nil {
			return fmt.Errorf("setting bind-all-interfaces: %w", err)
		}
	}

	if req.TLD != nil {
		err := e.Dokku.SetAppNetworkProperty(req.Name,
			dokku.NetworkPropertyTLD, *req.TLD)
		if err != nil {
			return fmt.Errorf("setting TLD: %w", err)
		}
	}

	return c.NoContent(http.Sta


ride java Enum

/**
 * "job-state" enum as defined in:
 * [RFC8011](http://www.iana.org/go/rfc8011).
 */
data class JobState(override val code: Int, override val name: String) : Enum() {

    override fun toString() = super.toString()

    /** An [AttributeType] for a [JobState] attribute. */
    class Type(name: String) : EnumType<JobState>(name, { get(it) })

    /** An [AttributeType] for multiple [JobState] attributes. */
    class SetType(name: String) : EnumType.Set<JobState>(name, { get(it) })

    object Code {
        const val pending = 3
        const val pendingHeld = 4
        const val processing = 5
        const val processingStopped = 6
        const val canceled = 7
        const val aborted = 8
        const val completed = 9
    }

    companion object {
        @JvmField val pending = JobState(Code.pending, "pending")
        @JvmField val pendingHeld = JobState(Code.pendingHeld, "pending-held")
        @JvmField val processing = JobState(Code.processing, "processing")
        @JvmField val processingStopped = JobState(Code.processingStopped, "processing-stopped")
        @JvmField val canceled = JobState(Code.canceled, "canceled")
        @JvmField val aborted = JobState(Code.aborted, "aborted")
        @JvmField val completed = JobState(Code.completed, "completed")

        @JvmField val all = listOf(
            pending,
            pendingHeld,
            processing,
            processingStopped,
            canceled,
            aborted,
            completed,
        ).map { it.code to it }.toMap()

        operator fun get(value: Int): JobState =
            all[value] ?: JobState(value, "???")
    }
}
// © Copyright 2018 - 2024 HP Development Company, L.P.
// SPDX-License-Identifier: MIT
//
// DO NOT MODIFY. Code is auto-generated by genTypes.py. Content taken from registry at
// https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml, updated on 2024-06-13
@file:Suppress("MaxLineLength", "WildcardImport")

package com.hp.jipp.model

import com.hp.jipp.encoding.* // ktlint-disable no-wildcard-imports

/**
 * Data object corresponding to a "job-save-disposition" collection as defined in:
 * [PWG5100.11](https://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext10-20101030-5100.11.pdf).
 */
@Suppress("RedundantCompanionReference", "unused")
data class JobSaveDisposition
constructor(
    /** May contain any keyword from [SaveDisposition]. */
    var saveDisposition: String? = null,
    var saveInfo: List<SaveInfo>? = null,
) : AttributeCollection {

    /** Construct an empty [JobSaveDisposition]. */
    constructor() : this(null)

    /** Produce an attribute list from members. */
    override val attributes: List<Attribute<*>>
        get() = listOfNotNull(
            saveDisposition?.let { JobSaveDisposition.saveDisposition.of(it) },
            saveInfo?.let { JobSaveDisposition.saveInfo.of(it) },
        )

    /** Defines types for each member of [JobSaveDisposition]. */
    companion object : AttributeCollection.Converter<JobSaveDisposition> {
        override fun convert(attributes: List<Attribute<*>>): JobSaveDisposition =
            JobSaveDisposition(
                extractOne(attributes, saveDisposition),
                extractAll(attributes, saveInfo),
            )
        override val cls = JobSaveDisposition::class.java
        @Deprecated("Remove this symbol")
        @JvmField val Types = this
        @JvmField val saveDisposition = KeywordType("save-disposition")
        @JvmField val saveInfo = AttributeCollection.SetType("save-info", SaveInfo)
    }

    /**
     * Data object


gRating = 5;
  }

  getAllFood() {
    let observable = this._httpService.getAllFood();
    observable.subscribe(data => {
      console.log("Showing all Food", data);
      this.allFood = data;
    });
  }

  onNewFood() {
    let observable = this._httpService.createFood(this.newFood);
    observable.subscribe(obj => {
      console.log("Task from Post Back!", obj);
    });
    this.getAllFood();
  }

  onShowFood(food): void {
    console.log("Showing Task", food);
    this.selectedFood = food;
    if(food.ratings.length > 0) {
      let sum = 0;
      for(let rating of food.ratings) {
        sum += rating.value;
      }
      this.selectedFoodAvgRating = (Math.round((sum / food.ratings.length) * 10)/10);
    } else {
      this.selectedFoodAvgRating = "#";
    }
  }

  onNewRating(newRatingFoodID) {
    this.newRating.value = parseInt(this.newRating.value);
    let observable2 = this._httpService.addRating(newRatingFoodID, this.newRating);
    observable2.subscribe(obj => {
      console.log("Added Rating to This " + obj[0].name)
      this.newRating = { value: 5, comment: ""}
    });
    this.getAllFood(); //shows all food
  }
}

// built in objects
let now: Date = new Date();

// array
let colors: string[] = ['red', 'blue', 'green'];
let numbers: number[] = [1, 2, 3];
let truths: boolean[] = [true, true, false];

// classes
class Car {}
let car: Car = new Car();

// object
let point: { x: number; y: number } = {
  x: 10,
  y: 20
};

// function
const logNumber: (i: number) => void = i => {
  console.log(i);
};

// when to use annotations
// 1) function that returns 'any' type
// 2) delay assigment
// 3) type can't be inferred
/*
 * SpurtCommerce
 * version 4.5
 * http://www.spurtcommerce.com
 *
 * Copyright (c) 2021 PICCOSOFT
 * Author piccosoft <support@spurtcommerce.com>
 * Licensed under the MIT license.
 */
// action
import * as actions from '../action/import.action';
// state
import { ImportState, ImportStateRecord } from './import.state';

export const initialState: ImportState = new ImportStateRecord() as unknown as ImportState;

export function reducer(state = initialState, { type, payload }: any): ImportState {
  if (!type) {
    return state;
  }

  switch (type) {

    case actions.ActionTypes.UPLOAD_FILE: {
      return Object.assign({}, state, {
        uploadFileLoading: true,
        uploadFileLoaded: false,
        uploadFileFailed: false,
      });
    }

    case actions.ActionTypes.UPLOAD_FILE_SUCCESS: {
      return Object.assign({}, state, {
        uploadFile: payload,
        uploadFileLoading: false,
        uploadFileLoaded: true,
        uploadFileFailed: false,
      });
    }
    case actions.ActionTypes.UPLOAD_FILE_FAIL: {
      return Object.assign({}, state, {
        uploadFileLoading: false,
        uploadFileLoaded: false,
        uploadFileFailed: true,
      });
    }
    default: {
      return state;
    }
  }
}

export const uploadFile = (state: ImportState) => state.uploadFile;
export const uploadFileLoading = (state: ImportState) => state.uploadFileLoading;
export const uploadFileLoaded = (state: ImportState) => state.uploadFileLoaded;
export const uploadFileFailed = (state: ImportState) => state.uploadFileFailed;

import { useCallback, useMemo, use


= _plottable is ScottPlot.Plottable.PiePlot;
            var isBar = _plottable is ScottPlot.Plottable.BarPlot;

            ButtonLabels.Visibility = isPie ? Visibility.Visible : Visibility.Collapsed;
            ButtonValues.Visibility = (isPie || isBar) ? Visibility.Visible : Visibility.Collapsed;
            ButtonPercentage.Visibility = isPie ? Visibility.Visible : Visibility.Collapsed;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (_plottable is ScottPlot.Plottable.PiePlot pie)
            {
                if (sender == ButtonLabels) pie.ShowLabels = !pie.ShowLabels;
                if (sender == ButtonValues) pie.ShowValues = !pie.ShowValues;
                if (sender == ButtonPercentage) pie.ShowPercentages = !pie.ShowPercentages;
            }

            if (_plottable is ScottPlot.Plottable.BarPlot bar)
            {
                if (sender == ButtonValues) bar.ShowValuesAboveBars = !bar.ShowValuesAboveBars;
            }

            if (sender == ButtonPrev)
            {
                _latestSamplePosition--;
                TextBoxSamplePos.Text = "" + _latestSamplePosition;
                LatestSamplePositionChanged?.Invoke(this, _latestSamplePosition);
            }

            if (sender == ButtonNext && _latestSamplePosition < 0)
            {
                _latestSamplePosition++;
                TextBoxSamplePos.Text = "" + _latestSamplePosition;
                LatestSamplePositionChanged?.Invoke(this, _latestSamplePosition);
            }

            WpfPlotItself.Render();
        }

        private void TextBoxSamplePos_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                if (int.TryParse(TextBoxSamplePos.Text, out var i))
                {
                    _latestSamplePosition = Math.Min(0, i);
                    TextBoxSamplePos.Text = "" + _latestSamplePosition;
                    LatestSamplePositionChanged?.Invoke(this, _latestSamplePosition);
                }
            }
        }
    }
}


       .padding(start = 16.dp)
                        .fillMaxHeight()
                ) {
                    Row(
                        modifier = Modifier.fillMaxWidth(),
                        horizontalArrangement = Arrangement.SpaceBetween,
                        verticalAlignment = Alignment.CenterVertically
                    ) {
                        Text(
                            text = movieDetail.title,
                            fontSize = 28.sp,
                            color = Color.White,
                            style = androidx.compose.ui.text.TextStyle(
                                fontWeight = androidx.compose.ui.text.font.FontWeight.Bold,
                                letterSpacing = 0.5.sp
                            )
                        )

                        Button(
                            onClick = {
                                viewModel.toggleFavorite(
                                    context,
                                    Movie(
                                        id = movieDetail.id,
                                        title = movieDetail.title,
                                        coverUrl = movieDetail.coverUrl,
                                        description = movieDetail.description
                                    )
                                )
                                isFavorite = !isFavorite
                            }
                        ) {
                            Text(if (isFavorite) "取消收藏" else "收藏")
                        }
                    }

                    // 其他信息
                    if (movieDetail.director.isNotEmpty()) {
                        Text(
                            text = "导演：${movieDetail.director}",
                            color = Color.LightGray,
                            modifier = Modifier.padding(vertical = 4.dp)
                        )
                    }
                    if (movieDetail.actors.isNotEmpty()) {
                        Text(
                            text = "主演：${movieDetail.actors}",
                            color = Color.LightGray,
                            modifier = Modifier.padding(vertical = 4.dp)
                        )
                    }
                    if (movieDetail.genre.isNotEmpty()) {
                        Text(
                            text = "类型：${movieDetail.genre}",
                            color = Color.LightGray,
                            modifier = Modifier.padding(vertical = 4.dp)
                        )
                    }
                    if (movieDetail.area.isNotEmpty()) {
                        Text(
                            text = "地区：${movieDetail.area}",
                            color = Color.LightGray,
                            modifier = Modifier.padding(vertical = 4.dp)
                        )
                    }
                    if (movieDetail.year.isNotEmpty()) {
                        Text(
                            text = "年份：${movieDetail.year}",
                            color = Color.LightGray,
                            modifier = Modifier.padding(vertical = 4.dp)
                        )
                    }

                    Spacer(modifier = Modifier.height(8.dp))

                    Text(
                        text = movieDetail.description,
                        color = Color.Gray,
                        maxLines = 3,
                        overflow = TextOverflow.Ellipsis,
                        modifier = Modifier.padding(vertical = 4.dp)
                    )
                }
            }

            // 在播放列表标题旁添加缓存状和操作
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(vertical = 16.dp),
                horizontalArrangement = Arrangement.SpaceBetween,
                verticalAlignment = Alignment.CenterVertically
            ) {
                Text(
                    text = "播放列表",


sprites,y

	iny
	lda #6 ; sprite index
	sta sprites,y

	iny ;skip attrs
	iny ; x
	lda #4 ; spr
	sta sprites,y

	lda #CURSOR_TILE
	sta CURSOR_SPRITE

	;set wumpus sprites
	ldy #FIRST_WUMPUS_SPRITE_TILE
	ldx #0
:lp	lda WumpusPattern,x
	sta $200,y
	lda #3 ; set palette to 3
	sta $201,y
	iny ; advance to next sprite
	iny
	iny
	iny
	inx
	cpx #12
	bne :lp
	rts

	;set palettes for 4 large bat sprites
	lda #3
	sta LARGE_BAT_ATTRS
	sta LARGE_BAT_ATTRS+4
	sta LARGE_BAT_ATTRS+8
	sta LARGE_BAT_ATTRS+12

	lda #UPPER_TEETH_TILE
	sta UPPER_TEETH_SPRITES
	sta UPPER_TEETH_SPRITES+4
	sta UPPER_TEETH_SPRITES+8

	;wumpus eyes for title
	lda WUMPUS_EYES_TILE
	sta WUMPUS_EYES_SPRITES
	sta WUMPUS_EYES_SPRITES+4

	;set palette
	lda #3
	sta WUMPUS_EYES_SPRITES_ATTRS
	sta WUMPUS_EYES_SPRITES_ATTRS+4

	rts

;sets roomPtr to address of current room's data
SetPlayerRoomPtr
	lda #0
	sta playerRoomPtrHi
	lda playerRoom
	sta playerRoomPtrLo
	beq :noMult
	ldy #3 ; times 8
:lp
	clc
	asl playerRoomPtrLo
	rol playerRoomPtrHi
	dey
	bne :lp
	;add base offset
:noMult
	;board starts at $300
	clc
	lda #>board
	adc playerRoomPtrHi
	sta playerRoomPtrHi
	rts

MoveLeft
	lda #LEFT
	sta direction
	lda #20
	sta btnCounter
	ldy #ROOM_LEFT
;	lda [playerRoomPtrLo],y
    lda (playerRoomPtrLo),y
	bmi :beep
	sta playerRoom
	;set sprite coord
	jsr SetPlayerRoomPtr
	jsr VisitRoom
	lda #1
	sta movePlayer
	jsr SetPlayerCoord
	jsr PlayFootSteps
	jsr CheckHazards
	jmp :x
:beep
	jsr PlayErrorBeep
:x	rts

MoveRight
	lda #RIGHT
	sta direction
	lda #20
	sta btnCounter
	ldy #ROOM_RIGHT
;	lda [playerRoomPtrLo],y
    lda (playerRoomPtrLo),y
	bmi :beep
	sta playerRoom
	;set sprite coord
	jsr SetPlayerRoomPtr
	jsr VisitRoom
	lda #1
	sta movePlayer
	jsr SetPlayerCoord
	jsr PlayFootSteps
	jsr CheckHazards
	jmp :x
:beep
	jsr PlayErrorBeep
:x	rts

MoveUp
	lda #UP
	sta direction
	lda #20
	sta btnCounter
	ldy #ROOM_UP
;	lda [playerRoomPtrLo],y
	lda (playerRoomPtrLo),y
	bmi :beep
	sta playerRoom
	;set sprite coord
	jsr SetPlayerRoomPtr
	jsr VisitRoom
	jsr SetPlayerCoord
	lda #1
	sta movePlayer
	jsr PlayFootSteps
	jsr CheckHazards
	jmp :


保一致性和效率。

1. 实施适当的网络分段
将网络划分为不同的部分，以将关键资产与不太安全的区域隔离开来。使用防火墙、VLAN 和访问控制来限制访问并减少暴露于潜在威胁的攻击面。

1. 事故响应和恢复计划
创建并维护事件响应计划，概述检测、响应和从安全事件中恢复的程序。定期测试和更新计划，以确保其有效性并与当前威胁保持一致。

1. 监控和记录恶意活动
实施全面的监控和日志记录解决方案，以检测和分析可疑活动。使用 SIEM（安全信息和事件管理）系统汇总和关联日志，以实现实时威胁检测和响应。

1. 跟踪安全警报
订阅来自官方供应商、CERT 和其他权威来源的安全建议和警报。定期检查和评估这些警报对系统的影响并采取适当的措施。

1. 渗透测试和审计
定期进行漏洞评估和渗透测试 (VAPT) 练习，以识别和修复系统中的漏洞。通过定期的安全审核来补充这些练习，以确保符合安全政策和标准。

1. 资产可见性
维护所有内部和外部资产（包括硬件、软件和网络组件）的最新清单。使用资产管理工具和持续监控来确保对 IT 环境的全面可视性和控制。

1. 强密码策略
立即更改默认密码并在整个组织内实施强密码策略。实施多因素身份验证(MFA) 以提供额外的安全保障并显著降低未经授权访问的风险。

#  Apache Subversion Windows 平台命令行参数注入漏洞 (CVE-2024-45720)
 安迈信科应急响应中心   2024-10-13 23:05

![](https://mmbiz.qpic.cn/mmbiz_png/tdibEPWdubQUgErMslSgzVibGKdSFkWPTbTgu83UTXdNYm7eOxRSmuNmOjUIxdicy73wTLufCMnbs6CAsc3uicJUcg/640?wx_fmt=png "")
### 01 漏洞概况      在Windows平台上，将命令行参数转换为SubVersion的可执行文件（例如，svn.Exec等）如果处理特制的命令行参数字符串，可能会导致意外的命令行参数解释，包括参数注入和其他程序的执行。SubVersion 1.14.3（含）之前的所有SubVersion版本仅在Windows平台上受影响。SubVersion在类


2-11.7zM66.3 352.9c-2.3-4.2-7-17.9 11.9-48.1 6.8 6.3 14 12.5 21.6 18.6 1.7 14.2 3.9 28 6.7 41.2-31.8 1.4-38.6-8.7-40.2-11.7zM224 288c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32z"/></svg>';
  static const String audio_description =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="576" height="512" preserveAspectRatio="xMidYMid meet" viewBox="0 0 576 512"><path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm149.5 141.3 72 144c5.9 11.9 1.1 26.3-10.7 32.2s-26.3 1.1-32.2-10.7l-9.4-18.9h-82.3l-9.4 18.9c-5.9 11.9-20.3 16.7-32.2 10.7s-16.7-20.3-10.7-32.2l72-144c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3zm-.4 106.6L192 237.7l-21.1 42.2h42.2zM304 184c0-13.3 10.7-24 24-24h56c53 0 96 43 96 96s-43 96-96 96h-56c-13.3 0-24-10.7-24-24V184zm48 24v96h32c26.5 0 48-21.5 48-48s-21.5-48-48-48h-32z"/></svg>';
  static const String austral_sign =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="448" height="512" preserveAspectRatio="xMidYMid meet" viewBox="0 0 448 512"><path fill="currentColor" d="M253.5 51.7C248.6 39.8 236.9 32 224 32s-24.6 7.8-29.5 19.7L122.7 224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64l-13.3 32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h24l-21.5 51.7c-6.8 16.3.9 35 17.2 41.8s35-.9 41.8-17.2l31.8-76.3h197.4l31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8L392 384h24c17.7 0 32-14.3 32-32s-14.3-32-32-32h-50.7L352 288h64c17.7 0 32-14.3 32-32s-14.3-32-32-32h-90.7L253.5 51.7zM256 224h-64l32-


éhne múu mépañétúéné nahbémuma meíjcyadu. -->• bos_cyrl: Сва људска биђа рађају се слободна и једнака у достојанству и правима. Она су обдарена разумом и свијешђу и треба да једно према другоме поступају у духу братства.
• bos_latn: Sva ljudska bića rađaju se slobodna i jednaka u dostojanstvu i pravima. Ona su obdarena razumom i sviješću i treba da jedno prema drugome postupaju u duhu bratstva.
• bre: Dieub ha par en o dellezegezh hag o gwirioù eo ganet an holl dud. Poell ha skiant zo dezho ha dleout a reont bevañ an eil gant egile en ur spered a genvreudeuriezh.
• btb: Abiali bod bese, tege ai sesala, bene etie dzia a mis memvende y'enyiñ, dzom dzia etu fili nkóbó, fili ntsogan, fili mboan. Ve abiali te, mod ose ayem dze ene abe, dze ene mbeñ asu e mod mbog antoa ai mfi na enyiñ ewulu mezen mene sosoo.
• bul: Всички хора се раждат свободни и равни по достойнство и права. Те са надарени с разум и


That(i, Is.EqualTo(id));
                Assert.That(c, Is.EqualTo(channel));
                Assert.That(d.Array, Is.EqualTo(segment.Array));
                Assert.That(d.Offset, Is.EqualTo(segment.Offset));
                Assert.That(d.Count, Is.EqualTo(segment.Count));
            };
            // start to give callback to inner
            middleware.ServerStart();

            inner.OnServerDataReceived.Invoke(id, segment, channel);
            Assert.That(called, Is.EqualTo(1));

            data = new byte[4];
            segment = new ArraySegment<byte>(data, 0, 3);

            inner.OnServerDataReceived.Invoke(id, segment, channel);
            Assert.That(called, Is.EqualTo(2));
        }

        [Test]
        [TestCase(0)]
        [TestCase(1)]
        [TestCase(19)]
        public void TestServerDisconnectedCallback(int id)
        {
            int called = 0;
            middleware.OnServerDisconnected = (i) =>
            {
                called++;
                Assert.That(i, Is.EqualTo(id));
            };
            // start to give callback to inner
            middleware.ServerStart();

            inner.OnServerDisconnected.Invoke(id);
            Assert.That(called, Is.EqualTo(1));

            inner.OnServerDisconnected.Invoke(id);
            Assert.That(called, Is.EqualTo(2));
        }

        [Test]
        [TestCase(0)]
        [TestCase(1)]
        [TestCase(19)]
        public void TestServerErrorCallback(int id)
        {
            Exception exception = new InvalidDataException();

            int called = 0;
            middleware.OnServerError = (i, e) =>
            {
                called++;
                Assert.That(i, Is.EqualTo(id));
                Assert.That(e, Is.EqualTo(exception));
            };
            // start to give callback to inner
            middleware.ServerStart();

            inner.OnServerError.Invoke(id, exception);
            Assert.That(called, Is.EqualTo(1));

            exception = new NullReferenceException();

            inner.OnServerError.Invoke(id, exception);
            Assert.That(called, Is.EqualTo(2));
        }
    }
}


// Modified by Princeton University on June 9th, 2015
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T1 Processor File: fadds_rnd_ninf.s
* Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/***********************************************************************
* Name:   fadds_rnd_ninf.s
* Date:   11/6/02
*
*
**********************************************************************/

#define ENABLE_T0_Fp_disabled_0x20
#include "boot.s"

.global sam_fast_immu_miss
.global sam_fast_dmmu_miss

.text
.global main

! Testing fadds with rounding mode ninf

!// fadds_rnd_ninf
!//
!//	Tests FADDS in round to negative infinity mode
!//	Inputs are positive and negative:
!//		- infinity and infinity
!//		- infinity and NaN
!//		- NaN and infinity
!//		- NaN and NaN
!//		- infinity and norm/denorm/zero
!//		- NaN and norm/denorm/zero
!//		- norm/denorm/zero and infinity
!//		- norm/denorm/zero and NaN
!//		- norm/denorm/zero and norm/denorm/zero

main:

	! Common code

	wr		%g0, 0x4, %fprs		! make sure fef is 1
	setx		source1, %l0, %l1
	setx		source2, %l0, %l2
	setx		result, %l0, %l3
	setx		fcc_result, %l0, %l4
	setx		cexc_flag, %l0, %l5
	setx		fsr_rounding_mode, %l0, %l6
	setx		scratch, %l0, %l7

	set		398, %g1		! Set loop count
	set		0x0, %g2		! Set loop iterator

fadds_loop:
	ldx		[%l6+0x0], %fsr

	! instruction specific code

	sll		%g2, 0x2, %g3

	ldx		[%l6], %fsr		! Load fsr with rounding mode
	ld		[%l1+%g3], %f0		! Load source 1
	ld		[%l2+%g3], %f2		! Load source 2
	fadds		%f0, %f2, %f4		! Perform the operation
	st		%f4, [%l7+0x0]		! Store the result for comparison
	stx		%fsr, [%l7+0x8]		! Store the fsr for comparis


a = sk_X509_CRL_value(crls.get(), i);
    X509_CRL *b = sk_X509_CRL_value(crls2.get(), i);
    ASSERT_EQ(0, X509_CRL_cmp(a, b));
  }

  ASSERT_TRUE(CBB_init(cbb.get(), der_len));
  ASSERT_TRUE(PKCS7_bundle_CRLs(cbb.get(), crls2.get()));
  ASSERT_TRUE(CBB_finish(cbb.get(), &result2_data, &result2_len));
  bssl::UniquePtr<uint8_t> free_result2_data(result2_data);

  EXPECT_EQ(Bytes(result_data, result_len), Bytes(result2_data, result2_len));

  // Parse with the legacy API instead.
  const uint8_t *ptr = der_bytes;
  bssl::UniquePtr<PKCS7> pkcs7_obj(d2i_PKCS7(nullptr, &ptr, der_len));
  ASSERT_TRUE(pkcs7_obj);
  EXPECT_EQ(ptr, der_bytes + der_len);

  ASSERT_TRUE(PKCS7_type_is_signed(pkcs7_obj.get()));
  const STACK_OF(X509_CRL) *crls3 = pkcs7_obj->d.sign->crl;
  ASSERT_EQ(sk_X509_CRL_num(crls.get()), sk_X509_CRL_num(crls3));
  for (size_t i = 0; i < sk_X509_CRL_num(crls.get()); i++) {
    X509_CRL *a = sk_X509_CRL_value(crls.get(), i);
    X509_CRL *b = sk_X509_CRL_value(crls3, i);
    ASSERT_EQ(0, X509_CRL_cmp(a, b));
  }

  ptr = result_data;
  pkcs7_obj.reset(d2i_PKCS7(nullptr, &ptr, result_len));
  ASSERT_TRUE(pkcs7_obj);
  EXPECT_EQ(ptr, result_data + result_len);

  ASSERT_TRUE(PKCS7_type_is_signed(pkcs7_obj.get()));
  const STACK_OF(X509_CRL) *crls4 = pkcs7_obj->d.sign->crl;
  ASSERT_EQ(sk_X509_CRL_num(crls.get()), sk_X509_CRL_num(crls4));
  for (size_t i = 0; i < sk_X509_CRL_num(crls.get()); i++) {
    X509_CRL *a = sk_X509_CRL_value(crls.get(), i);
    X509_CRL *b = sk_X509_CRL_value(crls4, i);
    ASSERT_EQ(0, X509_CRL_cmp(a, b));
  }
}

static void TestPEMCerts(const char *pem) {
  bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem, strlen(pem)));
  ASSERT_TRUE(bio);
  bssl::UniquePtr<STACK_OF(X509)> certs(sk_X509_new_null());
  ASSERT_TRUE(certs);

  ASSERT_TRUE(PKCS7_get_PEM_certificates(certs.get(), bio.get()));
  ASSERT_EQ(1u, sk_X509_num(certs.get()));
}

static void TestPEMCRLs(const char *pem) {
  bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem, strlen(pem)));
  ASSERT_TRUE(bio);
  bssl::UniquePtr<STACK_OF(X509_CRL)> crls(sk_X509_CRL_new_null());
  ASSERT_TRUE(crls);

  ASSERT_TRUE(PKCS7_get_PEM_CRLs(crls.get(), bio.get()));
  ASSERT_EQ(1u, sk_X509_CRL_num(crls.get()));
}

TEST(PKCS7Test, CertReparseNSS) {
  Test


 &'key [u8],

            _key: PhantomData<K>,
            _value: PhantomData<V>,
        }

        impl<'key, K, V> $name<'key, K, V> {
            /// Create a new map instance.
            pub const fn new(key: &'key [u8]) -> Self {
                Self {
                    key,
                    _key: PhantomData,
                    _value: PhantomData,
                }
            }
        }

        impl<'key, K, V> $name<'key, K, V>
        where
            K: MapKey,
            V: cbor::Encode + cbor::Decode,
        {
            fn key(&self, key: K) -> Vec<u8> {
                let raw_key = key.key();
                encode_length_prefixed_path(
                    self.key,
                    &raw_key[..raw_key.len() - 1],
                    raw_key[raw_key.len() - 1],
                )
            }

            /// Lookup a given key.
            pub fn get(&self, store: &dyn $store, key: K) -> Option<V> {
                $cell::new(&self.key(key)).get(store)
            }

            /// Insert a given key/value pair.
            pub fn insert(&self, store: &mut dyn $store, key: K, value: V) {
                $cell::new(&self.key(key)).set(store, value);
            }

            /// Remove a given key.
            pub fn remove(&self, store: &mut dyn $store, key: K) {
                $cell::<V>::new(&self.key(key)).clear(store);
            }
        }
    };
}

declare_map!(PublicMap, PublicCell, PublicStore);
declare_map!(ConfidentialMap, ConfidentialCell, ConfidentialStore);

/// A trait for types which can be used as map keys.
pub trait MapKey {
    /// Return the composite key.
    fn key(&self) -> Vec<&[u8]>;
}

impl<const N: usize> MapKey for [u8; N] {
    fn key(&self) -> Vec<&[u8]> {
        vec![self]
    }
}

impl MapKey for &[u8] {
    fn key(&self) -> Vec<&[u8]> {
        vec![self]
    }
}

impl MapKey for &str {
    fn key(&self) -> Vec<&[u8]> {
        vec![self.as_bytes()]
    }
}

impl MapKey for Vec<u8> {
    fn key(&self) -> Vec<&[u8]> {
        vec![self]
    }
}

impl MapKey for String {
    fn key(&self) -> Vec<&[u8]> {
        vec![self.as_bytes()]
    }
}

impl<T, U> MapKey for (T, U)
where
    T: MapKey,
    U: MapKey,
{
    fn key(&self) -> Vec<&[u8]> {
        let mut key = self.0.key();
        key.extend(self.1.key());
        key
    }
}

impl<T, U, V> MapKey for (T, U, V)
where
    T: MapKey,
    U: MapKey,
    V: MapKey,
{
    fn key(&self) -> Vec<&[u8]> {
        let mut key = self.0.key();
        key.extend(self.1.key());
        key.extend(self.2.key());
        key
    }
}

impl MapKey for Address {
    fn key(&self) -> Vec<&[u8]> {
        vec![self.as_ref()]
    }
}

/// A trait representing an integer that can be encoded into big-endian bytes.
pub trait Integer {
    /// Type of the encoded representation.
    type Encoded: AsRef<[u8]>;

    /// Return the memory representatio


; RST handlers
.bank 0 slot 0
.org 0
     inc  a
     ret
     .ds 6,0
     inc  a
     ret
     .ds 6,0
     inc  a
     ret
     .ds 6,0
     inc  a
     ret
     .ds 6,0
     inc  a
     ret
     .ds 6,0
     inc


, m;
  print('Enter the element: ');
  n = stdin.readLineSync();
  n = int.parse(n);

  print('Enter the modulo: ');
  m = stdin.readLineSync();
  m = int.parse(m);

  int mod_inv;
  print("\nModular multiplicative inverse of ‘$n’ under modulo ‘$m’ is: ");
  mod_inv = modulo_inverse(n, m);
  print(mod_inv);
}

/*
TIME COMPLEXITY: O(n).
SPACE COMPLEXITY: O(1).

SAMPLE INPUT/OUTPUT:
Enter the element:
11
Enter the modulo:
28

Modular multiplicative inverse of ‘11’ under modulo ‘28’ is:
23
*/
/*
Remove duplicates from an array by using DART.

Given an array, remove duplicate element from it so
that it only consists of unique elements in the array.
*/

import 'dart:io';

void duplicates(var array) {
  // sorting the array
  array.sort();
  for (int i = 0; i < array.length - 1; i++) {
    // checking if the next element is same
    if (array[i] == array[i + 1]) {
      array.remove(array[i + 1]);
      i -= 1;
    }
  }
}

void main() {
  var data = [];

  // taking input from user and storing it in data array
  var n, ele;
  print('Enter the number of Elements: ');
  n = stdin.readLineSync();
  n = int.parse(n);

  for (int i = 1; i <= n; i++) {
    print('Enter Element $i: ');
    ele = stdin.readLineSync();
    ele = int.parse(ele);
    data.add(ele);
  }

  print("Entered List is: ");
  print(data);

  print("\nList after removing duplicates: ");
  duplicates(data);
  print(data);
}

/*
TIME COMPLEXITY: O(n)
SPACE COMPLEXITY: O(1)

SAMPLE INPUT/OUTPUT:
Enter the number of Elements:
5
Enter Element 1:
1
Enter Element 2:
2
Enter Element 3:
2
Enter Element 4:
1
Enter Element 5:
3
Entered List is:
[1, 2, 2, 1, 3]

List after removing duplicates:
[1, 2, 3]
*/
/*
k largest elements in an array by using DART.

Given an array, find K largest elements from it.
*/
import 'dart:io';

List K_largest(var array, int k) {
  // sorting the array in descending order
  array.sort();
  array = new List.from(array.reversed);

  // List to store K elements.
  var kLarge = [];
  for (int i = 0; i < k; i++) {
    kLarge.add(array[i]);
  }
  return kLarge;
}

void main() {
  var data = [];

  // taking input from user and storing it in data array
  var n, ele, k;
  print('Enter the number of Elements: ');
  n = stdin.readLineSync();
  n = int.parse(n);

  print("Enter size of K: ");
  k = stdin.readLineSync();
  k = int.parse(k);

  for (int i = 1; i <= n; i++) {
    print('Enter Element $i: ');
    ele = stdin.readLineSync();
    ele = int.parse(ele);
    data.add(ele);
  }

  print("Entered List is: ");
  print(data);

  print("\nK Largest element are: ");
  var k_element = K_largest(data, k);
  print(k_element);
}

/*
TIME COMPLEXITY: O(n)
SPACE COMPLEXITY: O(k)

SAMPLE INPUT/OUTPUT:
Enter the number of Elements:
5
Enter size of K:
3
Enter Element 1:
10
Enter Element 2:
22
Enter Element 3:
45
Enter Element 4:
11
Enter Element 5:
2
Entered


__main__ -     loss = 0.07183869666975543
10/04/2019 00:42:06 - INFO - __main__ -     precision = 0.8467916366258111
10/04/2019 00:42:06 - INFO - __main__ -     recall = 0.8784592370979806
```

On the test dataset the following results could be achieved:

```bash
10/04/2019 00:42:42 - INFO - __main__ -   ***** Eval results  *****
10/04/2019 00:42:42 - INFO - __main__ -     f1 = 0.8614389652384803
10/04/2019 00:42:42 - INFO - __main__ -     loss = 0.07064602487454782
10/04/2019 00:42:42 - INFO - __main__ -     precision = 0.8604651162790697
10/04/2019 00:42:42 - INFO - __main__ -     recall = 0.8624150210424085
```

#### Run the Tensorflow 2 version

To start training, just run:

```bash
python3 run_tf_ner.py --data_dir ./ \
--labels ./labels.txt \
--model_name_or_path $BERT_MODEL \
--output_dir $OUTPUT_DIR \
--max_seq_length  $MAX_LENGTH \
--num_train_epochs $NUM_EPOCHS \
--per_device_train_batch_size $BATCH_SIZE \
--save_steps $SAVE_STEPS \
--seed $SEED \
--do_train \
--do_eval \
--do_predict
```

Such as the Pytorch version, if your GPU supports half-precision training, just add the `--fp16` flag. After training, the model will be both evaluated on development and test datasets.

#### Evaluation

Evaluation on development dataset outputs the following for our example:
```bash
           precision    recall  f1-score   support

 LOCderiv     0.7619    0.6154    0.6809        52
  PERpart     0.8724    0.8997    0.8858      4057
  OTHpart     0.9360    0.9466    0.9413       711
  ORGpart     0.7015    0.6989    0.7002       269
  LOCpart     0.7668    0.8488    0.8057       496
      LOC     0.8745    0.9191    0.8963       235
 ORGderiv     0.7723    0.8571    0.8125        91
 OTHderiv     0.4800    0.6667    0.5581        18
      OTH     0.5789    0.6875    0.6286        16
 PERderiv     0.5385    0.3889    0.4516        18
      PER     0.5000    0.5000    0.5000         2
      ORG     0.0000    0.0000    0.0000         3

micro avg     0.8574    0.8862    0.8715      5968
macro avg     0.8575    0.8862    0.8713      5968
```

On the test dataset the following results could be achieved:
```bash
           precision    recall  f1-score   support

  PERpart     0.8847    0.8944    0.8896      9397
  OTHpart     0.9376    0.9353    0.9365      1639
  ORGpart     0.7307    0.7044    0.7173       697
      LOC     0.9133    0.9394    0.9262       561
  LOCpart     0.8058    0.8157    0.8107      1150
      ORG     0.0000    0.0000    0.0000         8
 OTHderiv     0.5882    0.4762    0.5263        42
 PERderiv     0.6571    0.5227    0.5823        44
      OTH     0.4906    0.6667    0.5652        39
 ORGderiv     0.7016    0.7791    0.7383       172
 LOCderiv     0.8256    0.6514    0.7282       109
      PER     0.0000    0.0000    0.0000        11

micro avg     0.8722    0.8774    0.8748     13869
macro


ts"] = {
	      [1] = 9233;
	   };
	   ["level"] = 60;
	   ["source"] = {
	      [1] = {
	         ["id"] = 16376;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 60;
	};
	[7282] = {
	   ["type"] = "Raid";
	   ["objective"] = "Travel into Frostwolf territory and slay Commander Louis Philips. Return to Commander Karl Philips when the task is complete.\
";
	   ["zone"] = "Alterac Valley";
	   ["sort"] = "Alterac Valley";
	   ["kill"] = {
	      [1] = 13154;
	   };
	   ["repgain"] = {
	      [730] = 250;
	      [469] = 250;
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 13320;
	         ["type"] = "npc";
	      };
	   };
	   ["name"] = "Brotherly Love";
	   ["faction"] = "Alliance";
	   ["level"] = 60;
	   ["source"] = {
	      [1] = {
	         ["id"] = 13320;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 51;
	};
	[3090] = {
	   ["faction"] = "Horde";
	   ["name"] = "Tainted Parchment";
	   ["objective"] = "Read the Tainted Parchment and speak to Nartok inside the Den in the Valley of Trials.";
	   ["repgain"] = {
	      [76] = 75;
	   };
	   ["gather"] = {
	      [1] = 9579;
	   };
	   ["sort"] = "Warlock";
	   ["classes"] = {
	      [1] = "Warlock";
	   };
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 3156;
	         ["type"] = "npc";
	      };
	   };
	   ["prev"] = 788;
	   ["prequests"] = {
	      [1] = 788;
	   };
	   ["level"] = 1;
	   ["source"] = {
	      [1] = {
	         ["id"] = 3143;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 1;
	};
	[7807] = {
	   ["objective"] = "";
	   ["zone"] = "Ironforge";
	   ["sort"] = "Ironforge";
	   ["gather"] = {
	      [1] = 2592;
	   };
	   ["repgain"] = {
	      [47] = 150;
	   };
	   ["followup"] = 7808;
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 14724;
	         ["type"] = "npc";
	      };
	   };
	   ["faction"] = "Alliance";
	   ["name"] = "A Donation of Wool";
	   ["level"] = 15;
	   ["source"] = {
	      [1] = {
	         ["id"] = 14724;
	         ["type"] = "npc";
	      };
	   };
	   ["req"] = 12;
	};
	[5090] = {
	   ["objective"] = "Seek out Commander Ashlam Valorfist.  His base camp is located at Chillwind Camp, north of the Alterac Mountains.";
	   ["zone"] = "Ironforge";
	   ["sort"] = "Ironforge";
	   ["followup"] = 5092;
	   ["next"] = 5092;
	   ["deliver"] = {
	      [1] = {
	         ["id"] = 10838;
	         ["type"] = "npc";
	      };
	   };
	   ["faction"] = "Alliance";
	   ["name"] = "A Call to Arms: The Plaguelands!";
	   ["level"] = 50;
	   ["source"] = {
	      [1] = {
	         ["id"] = 10877;
	         ["type"] = "npc";
	      };
	   };
	   ["req"]


, buf := testFramer()
	if err := fr.WritePushPromise(pp); err != nil {
		t.Fatal(err)
	}
	const wantEnc = "\x00\x00\x07\x05\x00\x00\x00\x00*\x00\x00\x00*abc"
	if buf.String() != wantEnc {
		t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc)
	}
	f, err := fr.ReadFrame()
	if err != nil {
		t.Fatal(err)
	}
	_, ok := f.(*PushPromiseFrame)
	if !ok {
		t.Fatalf("got %T; want *PushPromiseFrame", f)
	}
	want := &PushPromiseFrame{
		FrameHeader: FrameHeader{
			valid:    true,
			Type:     0x5,
			Flags:    0x0,
			Length:   0x7,
			StreamID: 42,
		},
		PromiseID:     42,
		headerFragBuf: []byte("abc"),
	}
	if !reflect.DeepEqual(f, want) {
		t.Fatalf("parsed back:\n%#v\nwant:\n%#v", f, want)
	}
}

// test checkFrameOrder and that HEADERS/PUSH_PROMISE and CONTINUATION frames can't be intermingled.
func TestReadFrameOrder(t *testing.T) {
	head := func(f *Framer, id uint32, end bool) {
		f.WriteHeaders(HeadersFrameParam{
			StreamID:      id,
			BlockFragment: []byte("foo"), // unused, but non-empty
			EndHeaders:    end,
		})
	}
	push := func(f *Framer, id uint32, end bool) {
		f.WritePushPromise(PushPromiseParam{
			StreamID:      id,
			BlockFragment: []byte("foo"),
			EndHeaders:    end,
		})
	}
	cont := func(f *Framer, id uint32, end bool) {
		f.WriteContinuation(id, end, []byte("foo"))
	}

	tests := [...]struct {
		name    string
		w       func(*Framer)
		atLeast int
		wantErr string
	}{
		0: {
			w: func(f *Framer) {
				head(f, 1, true)
			},
		},
		1: {
			w: func(f *Framer) {
				push(f, 1, true)
			},
		},
		2: {
			w: func(f *Framer) {
				head(f, 1, true)
				head(f, 2, true)
			},
		},
		3: {
			w: func(f *Framer) {
				push(f, 1, true)
				push(f, 2, true)
			},
		},
		4: {
			wantErr: "got HEADERS for stream 2; expected CONTINUATION following HEADERS for stream 1",
			w: func(f *Framer) {
				head(f, 1, false)
				head(f, 2, true)
			},
		},
		5: {
			wantErr: "got PUSH_PROMISE for stream 2; expected CONTINUATION following PUSH_PROMISE for stream 1",
			w: func(f *Framer) {
				push(f, 1, false)
				push(f, 2, true)
			},
		},
		6: {
			wantErr: "got DATA for stream 1; expected CONTINUATION following HEADERS for stream 1",
			w: func(f *Framer) {
				head(f, 1, false)
			},
		},
		7: {
			wantErr: "got DATA for stream 1; expected CONTINUATION following PUSH_PROMISE for stream 1",
			w: func(f *Framer) {
				push(f, 1, false)
			},
		},
		8: {
			w: func(f *Framer)


        return supportedEngines
    }

    override fun init(configs: Map<*, *>): Boolean {
        if (configs["url"] != null && (configs["url"] as String).isNotBlank()) {
            url = (configs["url"] as String).trim()
        }

        try {
            URL(url)
        } catch (e: Exception) {
            logger.error("DeepSeekTranslator init failed, url is invalid: $url")
            return false
        }

        val fileApiKey = (configs["apiKey"] as String?)

        apiKey = if (fileApiKey.isNullOrBlank()) {
            (System.getenv("DEEPSEEK_API_KEY") ?: "").trim()
        } else {
            fileApiKey.trim()
        }

        if (apiKey.isBlank()) {
            logger.error("DeepSeekTranslator init failed, DeepSeek apiKey not found. Please set apiKey in DeepSeek.yaml or DEEPSEEK_API_KEY in environment.")
            return false
        }

        mConcurrent = (configs["concurrent"] as Int?) ?: 1
        systemPrompts = ((configs["systemPrompts"] as String?) ?: DEFAULT_SYSTEM_PROMPTS).trim()
        userPrompts = ((configs["userPrompts"] as String?) ?: DEFAULT_USER_PROMPTS).trim()

        if (configs["engineMapping"] == null || (configs["engineMapping"] as Map<String, String>).isEmpty()) {
            logger.error("DeepSeekTranslator init failed, engineMapping is null or empty")
            return false
        }

        try {
            val engineMapping = (configs["engineMapping"] as Map<String, Map<String, String>>)
            engineMapping.forEach { (engineCode, value) ->
                val engineName = value["name"] as String
                val engineModel = value["model"] as String

                supportedEngines.add(PublicConfig.TranslateEngine().apply {
                    code = engineCode
                    name = engineName
                })

                engineAndModelMap[engineCode] = engineModel
            }
        } catch (e: Exception) {
            logger.error("DeepSeekTranslator init failed, engineMapping is invalid: $e")
            return false
        }

        logger.info("DeepSeekTranslator init success, url: $url, supportedEngines: $supportedEngines")
        return true
    }

    private fun formatSystemPromptWords(
        srcLangLangName: String,
        targetLangLangName: String,
        glossaryWords: List<Pair<String, String>>?,
        glossaryIgnoreCase: Boolean
    ): String {
        return systemPrompts.replace("{{targetLang}}", LangCodes.langNameUppercase(targetLangLangName))
            .replace("{{srcLang}}", LangCodes.langNameUppercase(srcLangLangName))
            .replace("{{glossarySensitive}}", if (glossaryIgnoreCase) "insensitive" else "sensitive").trim()
    }

    private fun formatPromptWords(
        srcLangLangName: String,
        targetLangLangName: String,
        glossaryWords: List<Pair<String, String>>?,
        glossaryIgnoreCase: Boolean,
        text: String
    ): String {
        val glossaryListStr = if (glossaryWords.isNullOrEmpty()) {
            ""
        } else {
            /**
             * {
             *   "test": "检测",
             *   "internet": "互联网"
             * }
             *
             */
            val map = mutableMapOf<String, String>()
            glossaryWords.forEach { item ->
                map[item.first] = item.second
            }
            gson.toJson(map)
        }
        val promptWords = userPrompts.replace("{{targetLang}}", LangCodes.langNameUppercase(targetLangLangName))
            .replace("{{srcLang}}", LangCodes.langNameUppercase(srcLangLangName))
            .replace("{{glossaryList}}", glossaryListStr)
            .replace("{{glossarySensitive}}", if (glossaryIgnoreCase) "insensitive" else "sensitive")


("%.1f Mb", float64(s.Data.Used)/(1024*1024))},
		{"Data Space Total", fmt.Sprintf("%.1f Mb", float64(s.Data.Total)/(1024*1024))},
		{"Metadata Space Used", fmt.Sprintf("%.1f Mb", float64(s.Metadata.Used)/(1024*1024))},
		{"Metadata Space Total", fmt.Sprintf("%.1f Mb", float64(s.Metadata.Total)/(1024*1024))},
	}
	return status
}

func (d *Driver) Cleanup() error {
	err := d.DeviceSet.Shutdown()

	if err2 := mount.Unmount(d.home); err == nil {
		err = err2
	}

	return err
}

func (d *Driver) Create(id, parent string) error {
	if err := d.DeviceSet.AddDevice(id, parent); err != nil {
		return err
	}

	return nil
}

func (d *Driver) Remove(id string) error {
	if !d.DeviceSet.HasDevice(id) {
		// Consider removing a non-existing device a no-op
		// This is useful to be able to progress on container removal
		// if the underlying device has gone away due to earlier errors
		return nil
	}

	// This assumes the device has been properly Get/Put:ed and thus is unmounted
	if err := d.DeviceSet.DeleteDevice(id); err != nil {
		return err
	}

	mp := path.Join(d.home, "mnt", id)
	if err := os.RemoveAll(mp); err != nil && !os.IsNotExist(err) {
		return err
	}

	return nil
}

func (d *Driver) Get(id, mountLabel string) (string, error) {
	mp := path.Join(d.home, "mnt", id)

	// Create the target directories if they don't exist
	if err := os.MkdirAll(mp, 0755); err != nil && !os.IsExist(err) {
		return "", err
	}

	// Mount the device
	if err := d.DeviceSet.MountDevice(id, mp, mountLabel); err != nil {
		return "", err
	}

	rootFs := path.Join(mp, "rootfs")
	if err := os.MkdirAll(rootFs, 0755); err != nil && !os.IsExist(err) {
		d.DeviceSet.UnmountDevice(id)
		return "", err
	}

	idFile := path.Join(mp, "id")
	if _, err := os.Stat(idFile); err != nil && os.IsNotExist(err) {
		// Create an "id" file with the container/image id in it to help reconscruct this in case
		// of later problems
		if err := ioutil.WriteFile(idFile, []byte(id), 0600); err != nil {
			d.DeviceSet.UnmountDevice(id)
			return "", err
		}
	}

	return rootFs, nil
}

func (d *Driver) Put(id string) {
	if err := d.DeviceSet.UnmountDevice(id); err != nil {
		utils.Errorf("Warning: error unmounting device %s: %s\n", id, err)
	}
}

func (d *Driver) Exists(id string) bool {
	return d.DeviceSet.HasDevice(id)
}
// +build linux

package devmapper

import (
	"syscall"
	"unsafe"
)

func ioctlLoopCtlGetFree(fd uintptr) (int, error) {
	index, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, LoopCtlGetFree, 0)
	if err != 0 {
		return 0, err
	}
	return int(index), nil
}

func ioctlLoopSetFd(loopFd, sparseFd uintptr) error {
	if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, loopFd, LoopSetFd, sp


fff;background-clip:padding-box;_height:expression(this.scrollHeight>319 ? "320px":"auto");-moz-box-shadow:0 1px 2px rgba(0,1,1,0.2);-webkit-box-shadow:0 1px 2px rgba(0,1,1,0.2);box-shadow:0 1px 2px rgba(0,1,1,0.2);box-sizing:border-box;border:solid 1px #d0d0d0}.select-item{margin:0;padding:0}.select-option{background:#fff;line-height:34px;text-align:left;white-space:nowrap;cursor:pointer;border-bottom:1px solid #f2f2f2;padding:0 10px}.select-item .selected{background-color:#148cf1;color:#fff}.btn-upload{position:relative;display:inline-block;height:31px;*display:inline;overflow:hidden;vertical-align:middle;cursor:pointer}.upload-url{cursor:pointer;width:300px}.input-file{position:absolute;right:0;top:0;cursor:pointer;z-index:1;font-size:30em;opacity:0;filter:alpha(opacity=0)}.form-group .upload-btn{margin-left:-1px}.btn-upload .icon-add,.btn-upload .icon-minus{cursor:pointer;display:inline-block;font-family:Arial;font-size:30px;height:31px;line-height:31px;text-align:center;vertical-align:middle;width:36px}@media(max-width:767px){.upload-btn{display:none}.upload-url{display:none}}.numberControlBox{display:inline-block;overflow:hidden;vertical-align:middle}.ncb-up,.ncb-down{font-size:0;display:block;height:10px;background-color:#f4f4f4;background:-moz-linear-gradient(top,#fff 0,#e6e6e6 50%,#fff 100%);width:24px;border:1px solid #d1d1d1;cursor:pointer}.ncb-up{margin-bottom:1px}.numberControlBox .ncb_ico{display:block;height:10px;background-image:url(../images/iconpic-arrow.png);background-repeat:no-repeat}.ncb-up .ncb_ico{background-position:-22px center}.ncb-down .ncb_ico{background-position:1px center}.ncb_btn_hover{border:1px solid #9dc7e7;background-color:#dff2fc;background:-moz-linear-gradient(top,#fff 0,#d2edfa 50%,#fff 100%)}.ncb_btn_selected{border:1px solid #6198c2;background-color:#aee1fb;background:-moz-linear-gradient(top,#fff 0,#aee1fb 50%,#fff 100%)}.input-text[type="number"]{width:80px}.spinner{display:block;overflow:hidden;width:100px;position:relative;padding-left:29px;padding-right:29px}.spinner .input-text{height:30px;text-align:center;width:100%}.spinner a{display:inline-block;position:absolute;top:0;bottom:0;height:28px;line-height:28px;width:28px;cursor:pointer;outline:0;text-decoration:none;text-align:center;font-size:16px;border:1px solid #ddd;background-color:#f7f7f7}.spinner a:hover{text-decoration:none}.spinner a i{font-style:normal}.spinner a.subtract{left:0}.spinner a.add{right:0}.spinner a.add.disabled,.spinner a.subtract.disabled{color:#999;cursor:not-allowed}.emailSug-wrapper{position:absolute;background:#fff;text-align:left;z-index:999}.emailSug-wrapper .emailSug-list .emailSug-item{font-size:14px;height:25px;line-height:25px;padding-left:10px;color:#333}.emailSug-wrapper .emailSug-li


ents(By.XPATH, '//*[@id="detail-scroll detail-scroll2"]/div/div')
                        for comment in comments:
                            content = comment.text if comment else "无内容"
                            if course_name_short in content and content not in comments_collected:
                                print("find!")
                                comments_collected.append(content)
                                html_content += f"
{content}

"
                        if flag:
                            break

                    click_back_button(driver)

                    WebDriverWait(driver, 2).until(
                        EC.presence_of_element_located((By.XPATH, '//*[@id="table_list"]/div/div'))
                    )

                except Exception as e:
                    print(f"抓取第{i+1}条帖子时发生错误: {e}")

        except Exception as e:
            print(f"发生错误: {e}")

    if save_results:
        filename = f"{to_safe_filename(course_name)}.html"
        with open(os.path.join(data_folder_path, filename), "w", encoding="utf-8") as f:
            f.write(html_content)

    return html_content


_counter:OnCreated()
	if not IsServer() then return end
	self:StartIntervalThink(0.1)
end

function modifier_imba_enigma_eidolon_attack_counter:OnIntervalThink()
	local debuffs = self:GetParent():FindAllModifiersByName("modifier_imba_enigma_eidolon_attacks_debuff")
	if #debuffs > 0 then
		self:SetStackCount(#debuffs)
	else
		self:Destroy()
	end
end

function modifier_imba_enigma_eidolon_attacks_debuff:IsDebuff()			return true end
function modifier_imba_enigma_eidolon_attacks_debuff:IsHidden() 		return true end
function modifier_imba_enigma_eidolon_attacks_debuff:IsPurgable() 		return true end
function modifier_imba_enigma_eidolon_attacks_debuff:IsPurgeException() return true end
function modifier_imba_enigma_eidolon_attacks_debuff:IsStunDebuff() 	return false end
function modifier_imba_enigma_eidolon_attacks_debuff:RemoveOnDeath() 	return true end
function modifier_imba_enigma_eidolon_attacks_debuff:GetAttributes() 	return MODIFIER_ATTRIBUTE_MULTIPLE end

--=================================================================================================================
-- Enigma's Midnight Pulse
--=================================================================================================================

imba_enigma_midnight_pulse = imba_enigma_midnight_pulse or class(VANILLA_ABILITIES_BASECLASS)

LinkLuaModifier("modifier_imba_enigma_midnight_pulse_thinker","components/abilities/heroes/hero_enigma", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_enigma_midnight_pulse_aura","components/abilities/heroes/hero_enigma", LUA_MODIFIER_MOTION_NONE)

function imba_enigma_midnight_pulse:GetAOERadius()	 return self:GetVanillaAbilitySpecial("radius") end

function imba_enigma_midnight_pulse:OnSpellStart()
	local caster = self:GetCaster()
	local point = self:GetCursorPosition()
	local duration = self:GetVanillaAbilitySpecial("duration")
	local radius = self:GetVanillaAbilitySpecial("radius")
	EmitSoundOnLocationWithCaster(point,"Hero_Enigma.Midnight_Pulse",caster)
	GridNav:DestroyTreesAroundPoint(point, radius, false)
	CreateModifierThinker(caster, self, "modifier_imba_enigma_midnight_pulse_thinker", {duration = duration}, point, caster:GetTeamNumber(), false)
end

modifier_imba_enigma_midnight_pulse_thinker = modifier_imba_enigma_midnight_pulse_thinker or class({})

function modifier_imba_enigma_midnight_pulse_thinker:IsAura() 					return true end
function modifier_imba_enigma_midnight_pulse_thinker:GetAuraSearchTeam() 		return DOTA_UNIT_TARGET_TEAM_ENEMY end
function modifier_imba_enigma_midnight_pulse_thinker:GetAuraSearchFlags()		return DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES end
function modifier_imba_enigma_midnight_pulse_thinker:GetAuraSearchType() 		return DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO end
function modifier_imba_enigma_midnight_pulse_thinker:GetAuraRadius() 			return self.radius end
function modifier_imba_enigma_midnight_pulse_thinker:GetModifierAura()			return "modifier_imba_enigma_midnight_pulse_


id,
     symbol,
     data[current_position - 1][source_id].get_weight() + weight);
}

State AcyclicAutomaton::add_state(void)
{
  state_to_id_map.push_back(current_id);
  ++current_id;

  if (data[current_position].size() == current_id)
    { data[current_position].push_back(AcyclicState(current_id)); }

  return state_to_id_map.size() - 1;
}

void AcyclicAutomaton::finalize_position(void)
{
  ++current_position;
  if (data.size() == current_position)
    { data.push_back(default_position); }

  current_id = 0;
}

void AcyclicAutomaton::set_final_weight(State s, Weight weight)
{
  if (weight != infinity_)
    {
      size_t source_id = state_to_id_map[s];
      size_t target_id = 0;

      data[current_position + 1][target_id].add_transition
        (source_id,
         FINAL_SYMBOL,
         data[current_position][source_id].get_weight() + weight);
    }
}

void AcyclicAutomaton::clear(void)
{
  for (Data::iterator it = data.begin(); it != data.end(); ++it)
    {
      for (AcyclicStateVector::iterator jt = it->begin();
           jt != it->end();
           ++jt)
        {
          if (not jt->is_initialized())
            { break; }
          jt->clear();
        }
    }

  current_position = 0;
  current_id = 0;

  static_cast<void>(add_state());
  data[0][0].set_weight(0.0);

  state_to_id_map.clear();
}

WeightedSymbolVector AcyclicAutomaton::get_best_path(void)
{
  float best_weight = data[current_position].at(0).get_weight();
  SymbolVector best_path = get_path(0);

  return WeightedSymbolVector(best_weight, best_path);
}

SymbolVector AcyclicAutomaton::get_path(size_t id) const
{
  SymbolVector result(current_position);
  for (size_t i = current_position; i > 0; --i)
    {
      const AcyclicState &state = data[i][id];
      result.at(i - 1) = state.get_symbol();
      id = state.get_source();
    }

  if (not result.empty() and result.back() == FINAL_SYMBOL)
    { result.pop_back(); }

  return result;
}

#else // MAIN_TEST

#include <iostream>

int main(void)
{
  AcyclicAutomaton acyclic_automaton1;
  State s0 = 0;

  acyclic_automaton1.finalize_position();

  State s1 = acyclic_automaton1.add_state();
  State s1_5 = acyclic_automaton1.add_state();
  acyclic_automaton1.add_transition(s0,3,0.125,s1);
  acyclic_automaton1.add_transition(s0,1,0.5,s1);
  acyclic_automaton1.add_transition(s0,2,0.25,s1);
  acyclic_automaton1.add_transition(s0,2,0.1,s1_5);

  acyclic_automaton1.finalize_position();

  State s2 = acyclic_automaton1.add_state();
  State s3 = acyclic_automaton1.add_state();
  acyclic_automaton1.add_transition(s1,1,0.5,s2);
  acyclic_automaton1.add_transition(s1_5,2,0.425,s3);

  acyclic_automaton1.set_final_weight(s2,2.0);
  acyclic_automaton1.se


Pos; // Mouse Delta Vector
	float mouseDelta = sqrtf( mdv.x * mdv.x + mdv.y * mdv.y );
	const float fontSize = ImGui::GetFontSize();
	if ( mouseDelta > fontSize * 4.0f || hadKeyDownEvent ) {
		warningOverlayStartTime = -100.0f;
		return;
	}

	ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
	ImGui::PushStyleColor( ImGuiCol_WindowBg, ImVec4(1.0f, 0.4f, 0.4f, 0.4f) );
	float padSize = fontSize * 2.0f;
	ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2(padSize, padSize) );

	int winFlags = ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove
			| ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
	ImGui::Begin("WarningOverlay", NULL, winFlags);

	ImDrawList* drawList = ImGui::GetWindowDrawList();
	ImVec2 points[] = {
		{0, 40}, {40, 40}, {20, 0}, // triangle
		{20, 12}, {20, 28}, // line
		{20, 33} // dot
	};

	float iconScale = blaScale; // TODO: global scale also used for fontsize

	ImVec2 offset = ImGui::GetWindowPos() + ImVec2(fontSize, fontSize);
	for ( ImVec2& v : points ) {
		v.x = roundf( v.x * iconScale );
		v.y = roundf( v.y * iconScale );
		v += offset;
	}

	ImU32 color = ImGui::GetColorU32( ImVec4(0.1f, 0.1f, 0.1f, 1.0f) );
	//drawList->AddPolyline( points, 3, color, ImDrawFlags_RoundCornersAll | ImDrawFlags_Closed,
	//                       roundf( iconScale * 4.0f ) );
	drawList->AddTriangle( points[0], points[1], points[2], color, roundf( iconScale * 4.0f ) );

	drawList->AddPolyline( points+3, 2, color, 0, roundf( iconScale * 3.0f ) );

	float dotRadius = 2.0f * iconScale;
	drawList->AddEllipseFilled( points[5], ImVec2(dotRadius, dotRadius), color, 0, 6 );

	ImGui::Indent( 40.0f * iconScale );
	ImGui::TextUnformatted( warningOverlayText.c_str() );

	ImGui::End();

	ImGui::PopStyleVar(); // WindowPadding
	ImGui::PopStyleColor(); // WindowBg
}

static void ShowWarningOverlay( const char* text )
{
	warningOverlayText = text;
	warningOverlayStartTime = ImGui::GetTime();
	warningOverlayStartPos = ImGui::GetMousePos();
}

static bool IsKeyPressed( ImGuiKey key ) {
	return ImGui::IsKeyPressed( key, false );
}

// Enter or gamepad A, used to confirm or (when a binding table entry is focused/selected) to start binding a key
static bool IsConfirmKeyPressed() {
	return IsKeyPressed( ImGuiKey_Enter ) || IsKeyPressed( ImGuiKey_KeypadEnter )
	       || IsKeyPressed( ImGuiKey_GamepadFaceDown );
}

static bool IsClearKeyPressed() {
	return IsKeyPressed( ImGuiKey_Delete ) || IsKeyPressed( ImGuiKey_Backspace )
	       || IsKeyPressed( ImGuiKey_GamepadFaceUp );
}

static bool IsCancelKeyPressed() {
	// using Escape, gamepad Start and gamepad B for cancel, except in the
	// binding case (so gamepad B can be bound), there only Esc and Start work.