$at)
/* ABE0AC 80046F0C 24A5CE80 */  addiu $a1, %lo(D_8015CE80) # addiu $a1, $a1, -0x3180
/* ABE0B0 80046F10 8FA40034 */  lw    $a0, 0x34($sp)
/* ABE0B4 80046F14 46128100 */  add.s $f4, $f16, $f18
/* ABE0B8 80046F18 E7A8005C */  swc1  $f8, 0x5c($sp)
/* ABE0BC 80046F1C C62A0008 */  lwc1  $f10, 8($s1)
/* ABE0C0 80046F20 46045180 */  add.s $f6, $f10, $f4
/* ABE0C4 80046F24 0C01EFE4 */  jal   func_8007BF90
/* ABE0C8 80046F28 E7A60060 */   swc1  $f6, 0x60($sp)
/* ABE0CC 80046F2C C7A20078 */  lwc1  $f2, 0x78($sp)
/* ABE0D0 80046F30 3C013F80 */  lui   $at, 0x3f80
/* ABE0D4 80046F34 8FAE0080 */  lw    $t6, 0x80($sp)
/* ABE0D8 80046F38 4600103C */  c.lt.s $f2, $f0
/* ABE0DC 80046F3C 3C188016 */  lui   $t8, %hi(gGameInfo)
/* ABE0E0 80046F40 45020005 */  bc1fl .L80046F58
/* ABE0E4 80046F44 46020403 */   div.s $f16, $f0, $f2
/* ABE0E8 80046F48 44814000 */  mtc1  $at, $f8
/* ABE0EC 80046F4C 10000004 */  b     .L80046F60
/* ABE0F0 80046F50 E5C80000 */   swc1  $f8, ($t6)
/* ABE0F4 80046F54 46020403 */  div.s $f16, $f0, $f2
.L80046F58:
/* ABE0F8 80046F58 8FAF0080 */  lw    $t7, 0x80($sp)
/* ABE0FC 80046F5C E5F00000 */  swc1  $f16, ($t7)
.L80046F60:
/* ABE100 80046F60 8F18FA90 */  lw    $t8, %lo(gGameInfo)($t8)
/* ABE104 80046F64 3C018014 */  lui   $at, %hi(D_80139E80)
/* ABE108 80046F68 C4249E80 */  lwc1  $f4, %lo(D_80139E80)($at)
/* ABE10C 80046F6C 871901A8 */  lh    $t9, 0x1a8($t8)
/* ABE110 80046F70 24080001 */  li    $t0, 1
/* ABE114 80046F74 A6280018 */  sh    $t0, 0x18($s1)
/* ABE118 80046F78 44999000 */  mtc1  $t9, $f18
/* ABE11C 80046F7C 3C098016 */  lui   $t1, %hi(D_8015CEC0) # $t1, 0x8016
/* ABE120 80046F80 27A40048 */  addiu $a0, $sp, 0x48
/* ABE124 80046F84 468092A0 */  cvt.s.w $f10, $f18
/* ABE128 80046F88 27A60058 */  addiu $a2, $sp, 0x58
/* ABE12C 80046F8C 46045182 */  mul.s $f6,


//
// Copyright (C) 2024 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <vector>

#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/host/commands/run_cvd/launch/log_tee_creator.h"
#include "cuttlefish/host/libs/config/cuttlefish_config.h"
#include "cuttlefish/host/libs/feature/feature.h"

namespace cuttlefish {

// Feature that provides access to the connections to the input devices.
// Such connections are file descriptors over which (virtio_) input events can
// be written to inject them to the VM and (virtio_) status updates can be read.
class InputConnectionsProvider : public virtual SetupFeature {
 public:
  virtual ~InputConnectionsProvider() = default;

  virtual SharedFD RotaryDeviceConnection() const = 0;
  virtual SharedFD MouseConnection() const = 0;
  virtual SharedFD GamepadConnection() const = 0;
  virtual SharedFD KeyboardConnection() const = 0;
  virtual SharedFD SwitchesConnection() const = 0;
  virtual std::vector<SharedFD> TouchscreenConnections() const = 0;
  virtual std::vector<SharedFD> TouchpadConnections() const = 0;
};

fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific>,
                 InputConnectionsProvider, LogTeeCreator>
VhostInputDevicesComponent();

}  // namespace cuttlefish


oursText(minutes: number): string {
        // Support only whole hours
        const hours = minutes / 60;
        return `${hours}:00`;
    }

    private prepareValue(): void {
        if (!this.value) {
            this.value = this.createNewValue();
        }
        const value = this.value;

        if (!value.years) {
            value.years = this.createYears();
        }
        if (!value.selectedYear) {
            const currentYear = this.currentDate.getFullYear();
            value.selectedYear = value.years.find(x => x.value === currentYear) || value.years[0];
        }

        if (!value.months) {
            value.months = this.createMonths();
        }
        if (!value.selectedMonth) {
            const currentMonth = this.currentDate.getMonth() + 1;
            value.selectedMonth = value.months.find(x => x.value === currentMonth) || value.months[0];
        }

        if (!value.days) {
            value.days = this.createDays();
        }
        if (!value.selectedDay) {
            const currentDay = this.currentDate.getDate();
            value.selectedDay = value.days.find(x => x.value === currentDay) || value.days[0];
        }

        if (!value.hours) {
            value.hours = this.createHours();
        }
        if (!value.selectedHour) {
            value.selectedHour = value.hours[0];
        }
    }
}

export interface IDateTimeSelectorModel {
    years: INameWithValue[];
    selectedYear: INameWithValue;
    months: INameWithValue[];
    selectedMonth: INameWithValue;
    days: INameWithValue[];
    selectedDay: INameWithValue;
    hours: INameWithValue[];
    selectedHour: INameWithValue;
}

export interface INameWithValue {
    name: string;
    value: number;
}

import {
  lambda1,
  StreamSink,
  StreamLoop,
  CellSink,
  Transaction,
  Tuple2,
  Operational,
  Cell,
  CellLoop,
  getTotalRegistrations
} from '../../lib/Lib';

afterEach(() => {
  if (getTotalRegistrations() != 0) {
    throw new Error('listeners were not deregistered');
  }
});

test('should test map()', (done) => {
  const s = new StreamSink<number>();
  const out: number[] = [];
  const kill = s.map(a => a + 1)
    .listen(a => {
      out.push(a);
      done();
    });
  s.send(7);
  kill();

  expect([8]).toEqual(out);
});

test('should throw an error send_with_no_listener_1', () => {
  const s = new StreamSink<number>();

  try {
    s.send(7);
  } catch (e) {
    expect(e.message).toBe('send() was invoked before listeners were registered');
  }

});

test('should (not?) throw an error send_with_no_listener_2', () => {
  const s = new StreamSink<number>();
  const out: number[] = [];
  const kill = s.map(a => a + 1)
    .listen(a => out.push(a));

  s.send(7);
  kill();

  try {
    // TODO: the message below is bit misleading, need to verify with Stephen B.
    //


_params)};
                prev_bit = bit;
            }
        }
        ProjectivePoint::conditional_swap(&mut R1, &mut R2, prev_bit.into());
        let xR = R1;
        xR
    }
    /// Given the affine x-coordinate `affine_xP` of `P`, compute the x-coordinate
    /// `x(\tau(P)-P) of \tau(P)-P`.
    pub fn distort_and_difference(affine_xP: &PrimeFieldElement) -> ProjectivePoint {
        let mut t0 = affine_xP.square();            // = x_P^2
        let t1 = &PrimeFieldElement::one() + &t0;   // = x_P^2 + 1
        let b = t1.A;                               // = 0 + (x_P^2 + 1)*i
        t0 = affine_xP + affine_xP;                 // = 2*x_P
        let a = t0.A;                               // = 2*x_P + 0*i

        let x = ExtensionFieldElement{ A: Fp751Element::zero(), B: b };
        let z = ExtensionFieldElement{ A: a, B: Fp751Element::zero() };
        let xR = ProjectivePoint{ X: x, Z: z };
        xR
    }
    /// Given an affine point `P = (x_P, y_P)` in the prime-field subgroup of the
    /// starting curve `E_0(F_p)`, together with a secret scalar `m`, compute `x(P+[m]Q)`,
    /// where `Q = \tau(P)` is the image of `P` under the distortion map.
    //
    // The computation uses basically the same strategy as the
    // Costello-Longa-Naehrig implementation:
    //
    // 1. Use the standard Montgomery ladder to compute x([m]Q), x([m+1]Q)
    //
    // 2. Use Okeya-Sakurai coordinate recovery to recover [m]Q from Q, x([m]Q),
    // x([m+1]Q)
    //
    // 3. Use P and [m]Q to compute x(P + [m]Q)
    //
    // The distortion map \tau is defined as
    //
    // \tau : E_0(F_{p^2}) ---> E_0(F_{p^2})
    //
    // \tau : (x,y) |---> (-x, iy).
    //
    // The image of the distortion map is the _trace-zero_ subgroup of E_0(F_{p^2})
    // defined by Tr(P) = P + \pi_p(P) = id, where \pi_p((x,y)) = (x^p, y^p) is the
    // p-power Frobenius map.  To see this, take P = (x,y) \in E_0(F_{p^2}).  Then
    // Tr(P) = id if and only if \pi_p(P) = -P, so that
    //
    // -P = (x, -y) = (x^p, y^p) = \pi_p(P);
    //
    // we have x^p = x if and only if x \in F_p, while y^p = -y if and only if y =
    // i*y' for y' \in F_p.
    //
    // Thus (excepting the identity) every point in the trace-zero subgroup is of
    // the form \tau((x,y)) = (-x,i*y) for (x,y) \in E_0(F_p).
    //
    // Since the Montgomery ladder only uses the x-coordinate, and the x-coordinate
    // is always in the prime subfield, we can compute x([m]Q), x([m+1]Q) entirely
    // in the prime subfield.
    //
    // The affine form of the relation for Okeya-Sakurai coordinate recovery is
    // given on p. 13 of Costello-Smith:
    //
    // y_Q = ((x_P*x_Q + 1)*(x_P + x


#     Copyright 2017 Google, Inc.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.
"""
.. module: security_monkey.common.gcp.util
    :platform: Unix

.. version:: $$VERSION$$
.. moduleauthor:: Tom Melendez <supertom@google.com> @supertom
"""
from security_monkey.datastore import Account
from cloudaux.orchestration import modify as cloudaux_modify

def get_gcp_project_creds(account_names):
    """
    Build list of dicts with project credentials.

    Takes a list of account names and fetches all of those accounts.
    If the custom_field 'credentials_file' (custom field) is set, the list
    item will be in the format of: {'project': 'my-project', 'key_file': 'my-key'}
    Otherwise, it will be simply the project string.

    Returns a list containing strings or dictionaries with necessary credentials
    for connecting to GCP.

    :param account_names: list of account names
    :type account_names: ``list``

    :return: list of dictionaries with project credentials
    :rtype: ``list``
    """
    # The name of the field as defined in the GCP Account Manager.
    creds_field = 'creds_file'
    project_creds = []

    accounts = Account.query.filter(Account.name.in_(account_names)).all()

    for account in accounts:
        key_file = account.getCustom(creds_field)
        if key_file:
            project_creds.append({'project': account.identifier, 'key_file': key_file})
        else:
            project_creds.append(account.identifier)

    return project_creds

def gcp_resource_id_builder(service, identifier, project_id, region=''):
    resource = 'gcp:%s:%s:%s:%s' % (project_id, region, service, identifier)
    return resource.replace('/', ':').replace('.', ':')

def modify(d, output='camelized'):
    return cloudaux_modify(d, output=output)

def get_user_agent(**kwargs):
    from security_monkey.common.gcp.config import ApplicationConfig as appconfig
    return 'security-monkey/%s' % appconfig.get_version()


callingCode : country.callingCode ? country.callingCode.toString() : null,
        areaCodes   : country.areaCodes,
        phoneNumberLength: country.phoneNumberLength
    });
}

fs.writeFileSync('newdata.json', JSON.stringify(newCountries));
*//* istanbul ignore next */

'use strict';

export module ServiceModule1 {

    export var testValue  = 999;

    export class TestBaseClass {
        public name(): string {
            return null;
        }
    }
}

export module ServiceModule2 {

    export var testValue  = 999;

    export function TestBaseFunction() {

    }
}

export module ServiceModule3 {

    export var testValue  = 999;

    export class TestBaseClass1 {
        public name() {
            return null;
        }
    }

    export class TestBaseClass2 {
        public age() {
            return null;
        }
    }

    export class TestBaseClass3 {
        public date() {
            return null;
        }
    }
}

export module SubstituteModule1 {

    export var testValue2  = 999;

    export class ConcreteTestClass extends ServiceModule1.TestBaseClass {
        public name() : string {
            return 'Concrete class';
        }
    }
}

export module SubstituteModule2 {

    export class ConcreteTestClass {
        public name() {
            return 'Concrete class';
        }
    }
}

export module SubstituteModule3 {

    export class ConcreteTestClass {

        private age : number;
        private anotherParam : string;

        constructor(age : number, anotherParam : string) {
            this.age = age;
            this.anotherParam = anotherParam;
        }

        public name() {
            return 'Concrete class' + this.age + this.anotherParam;
        }
    }
}

export module SubstituteModule4 {

    export class ConcreteTestClass1 {
        public name() {
            return 'Concrete class1';
        }
    }

    export class ConcreteTestClass2 {
        public name() {
            return 'Concrete class2';
        }
    }
}

export module SubstituteModule5 {
    export class ConcreteClass1 {
        public name() {
            return 'name';
        }
    }

    export class ConcreteClass2 {
        public age() {
            return 'age';
        }
    }

    export class ConcreteClass3 {
        public date() {
            return 'date';
        }
    }
}

export module SubstituteModule6 {
    export class ConcreteClass1 {
        private _dependency : SubstituteModule3.ConcreteTestClass;

        constructor(dependency : SubstituteModule3.ConcreteTestClass) {
            this._dependency = dependency;
        }

        public name() {
            return 'Module6 - Class 1 - ' + this._dependency.name();
        }
    }
}import {ModeContext} from "../mode/mode-context";
import {SymbolContainer} from "../../symbol-container";
import {List} from "@everest/collections";
import {SymbolMode} from "../symbol-mode";
import {ButtonSymbolLoaderError} from "../../error";
import  { Symbol } from "../../symbols";

export class SymbolButtonLoader {
    constructor(private element: HTMLElement, private modeContext: ModeContext,
                private symbols: SymbolContainer, private modes: string[]) {

        if(!element.hasAttribute('data-cal-func-norm')){
            throw new ButtonSymbolLoaderError(`L'élement ${this.element} doit avoir les attribut [data-cal-func-norm]
            qui renseigne sa fonction primaire.`);
        }
    }

    loadSymbols():List<SymbolMode>{
        let symbolModes = new List<SymbolMode>();

        for (let mode of this.modes){
            console.log(`data-cal-func-${mode}`);
            if(this.element.hasAttribute(`data-cal-func-${


σπαθήστε να αποκρύψετε το γεγονός ότι η συσκευασία περιέχει μετρητά. Μπορείτε να βάλετε τα μετρητά σε ένα περιοδικό, σε σακκούλα αποθήκευσης ή σε κάποιο άλλο δοχείο. Το αεροστεγές κλείσιμο των μετρητών λειτουργεί επίσης.';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb2250Sbtitle => 'Προσπαθήστε να κρύψετε τα μετρητά';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb3250Sbtext => 'Αντί απλά να τοποθετείτε τα μετρητά στο φάκελο, χρησιμοποιήστε πολλούς ένθετους φακέλους για το πακέτο σας. Τοποθετήστε τα μετρητά στον μικρότερο φάκελο (ή απλώς διπλώστε έναν μεγαλύτερο φάκελο ), σφραγίστε τον και τοποθετήστε τα σε άλλο φάκελο. Επαναλάβετε αυτή τη διαδικασία μέχρι να έχετε τουλάχιστον 3 ένθετους φακέλους. Αυτό συμβάλλει στο να διασφαλιστεί ότι, αν ο παραλήπτης προσπαθήσει να αλλοιώσει το πακέτο σας, θα δυσκολευτεί πολύ περισσότερο να το ξανασφραγίσει όλο με τρόπο που θα είναι μη ανιχνεύσιμο όταν το επιθεωρήσει ο διαμεσολαβητής της διαφοράς.';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb3250Sbtitle => 'Τοποθετήστε τους φακέλους μέσα στους φακέλους';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb4250Sbtext => 'Τα πακέτα που αποστέλλονται χωρίς εντοπισμό μπορεί να χαθούν και χωρίς εντοπισμό μπορεί να είναι σχεδόν αδύνατο να εντοπιστούν. Η παρακολούθηση επιτρέπει επίσης στον παραλήπτη να έχει το κεφάλι του ήσυχο ότι το πακέτο είναι καθ\' οδόν σε περίπτωση που χρειάζεται περισσότερο χρόνο από το αναμενόμενο.';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb4250Sbtitle => 'Αποστολή με εντοπισμό';

  @override
  String get guide250Sbcbm250Sbbuyer250Sb5250Sbtext => 'Όπως έχουμε αναφέρει προηγουμένως, με αξιόπιστους εμπόρους ο κίνδυνος για έναν αγοραστή είναι πολύ χαμηλός. Ωστόσο, το πολύ χαμηλό δεν σημαίνει μηδέν, επομένως φροντίστε να ακολουθήσετε αυτούς τους κανόνες για να είστε προετοιμασμένοι για μια κατάσταση διαφωνίας.';

  @override
  String get guide250Sbcbm250Sbbuyer2


import argparse
import json
import logging
import os
import time
from typing import Dict, NamedTuple

import requests

def main() -> None:
    logging.basicConfig(
        level=logging.INFO,
        format="%(asctime)s %(message)s",
        datefmt="%Y-%m-%d %H:%M:%S",
    )
    args = parse_args()

    with open(args.relevant, "r") as fp:
        relevant = json.load(fp)

    quip = Quip(os.environ["QUIP_AUTH_TOKEN"])
    suffixes = {v for vs in relevant.values() for v in vs}
    logging.info(f"Found {len(suffixes)} suffixes")
    titles: Dict[str, str] = {}
    for suffix in suffixes:
        logging.info(f"Getting {suffix}")
        time.sleep(1)
        try:
            doc = quip.get(suffix)
            titles[suffix] = doc.title
        except requests.exceptions.HTTPError as e:
            logging.warn(f"Skipping {suffix} because of error: {e}")
            continue
        with open(f"{args.docs}/{suffix}.py", "w") as fp:
            fp.write(f'"""\n{doc.contents}\n"""')
    logging.info(f"Retrieved {len(titles)} documents")

    with open(args.titles, "w") as fp:
        json.dump(titles, fp, indent=2)

def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument("--relevant", type=str)
    parser.add_argument("--docs", type=str)
    parser.add_argument("--titles", type=str)
    return parser.parse_args()

class Doc(NamedTuple):
    title: str
    contents: str

class Quip:
    def __init__(self, token: str) -> None:
        self.base = "https://platform.quip.com/1"
        self.token = token

    def get(self, thread_id: str) -> Doc:
        resp = requests.get(
            f"{self.base}/threads/{thread_id}",
            headers={"Authorization": f"Bearer {self.token}"},
        )
        resp.raise_for_status()
        data = resp.json()
        return Doc(data["thread"]["title"], data["html"])

if __name__ == "__main__":
    main()


using System;
using System.Collections.Generic;
using HarmonyLib;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley.Events;
using StardewValley.GameData;
using StardewValley.GameData.BigCraftables;
using StardewValley.GameData.Shops;

namespace MeteorDefence
{
	/// The mod entry point.
	public partial class ModEntry : Mod
	{
		internal static IMonitor SMonitor;
		internal static IModHelper SHelper;
		internal static IManifest SModManifest;
		internal static ModConfig Config;
		internal static ModEntry context;

		/// The mod entry point, called after the mod is first loaded.
		/// <param name="helper">Provides simplified APIs for writing mods.</param>
		public override void Entry(IModHelper helper)
		{
			Config = Helper.ReadConfig<ModConfig>();

			context = this;
			SMonitor = Monitor;
			SHelper = helper;
			SModManifest = ModManifest;

			helper.Events.GameLoop.GameLaunched += GameLoop_GameLaunched;
			helper.Events.Content.AssetRequested += Content_AssetRequested;

			// Load Harmony patches
			try
			{
				Harmony harmony = new(ModManifest.UniqueID);

				harmony.Patch(
					original: AccessTools.Method(typeof(SoundInTheNightEvent), nameof(SoundInTheNightEvent.setUp)),
					prefix: new HarmonyMethod(typeof(SoundInTheNightEvent_setUp_Patch), nameof(SoundInTheNightEvent_setUp_Patch.Prefix))
				);
				harmony.Patch(
					original: AccessTools.Method(typeof(SoundInTheNightEvent), nameof(SoundInTheNightEvent.makeChangesToLocation)),
					prefix: new HarmonyMethod(typeof(SoundInTheNightEvent_makeChangesToLocation_Patch), nameof(SoundInTheNightEvent_makeChangesToLocation_Patch.Prefix)),
					postfix: new HarmonyMethod(typeof(SoundInTheNightEvent_makeChangesToLocation_Patch), nameof(SoundInTheNightEvent_makeChangesToLocation_Patch.Postfix))
				);
				harmony.Patch(
					original: AccessTools.Method(typeof(SoundInTheNightEvent), nameof(SoundInTheNightEvent.tickUpdate)),
					prefix: new HarmonyMethod(typeof(SoundInTheNightEvent_tickUpdate_Patch), nameof(SoundInTheNightEvent_tickUpdate_Patch.Prefix))
				);
			}
			catch (Exception e)
			{
				Monitor.Log($"Issue with Harmony patching: {e}", LogLevel.Error);
				return;
			}
		}

		private void Content_AssetRequested(object sender, AssetRequestedEventArgs e)
		{
			if (!Config.ModEnabled)
				return;

			if (e.Name.IsEquivalentTo("Data/CraftingRecipes"))
			{
				e.Edit(asset =>
				{
					IDictionary<string, string> data = asset.AsDictionary<string, string>().Data;

					data.Add($"{ModManifest.UniqueID}_SpaceLaser", $"60 1 335 5 787 1/Home/{ModManifest.UniqueID}_SpaceLaser/true/{Config.SkillsRequired}/");
				});
			}
			if (e.Name.IsEquivalentTo("Data/BigCraftables"))
			{
				e.Edit(asset =>
				{
					IDictionary<string, BigCraftableData> data = asset.AsDictionary<string, BigCraftableData>().Data;

					data.Add($"{ModManifest.UniqueID}_SpaceLaser", new BigCraftableData()
					{
						Name = "Space Laser",
						DisplayName = $"[{ModManifest.UniqueID}_i18n item.space-laser.name]",
						Description = $"[{ModManifest.UniqueID}_i18n item.space-laser.description]",
						Texture = SHelper.ModContent.G


from unittest import TestCase

import pandas as pd

from scattertext.CorpusFromParsedDocuments import CorpusFromParsedDocuments
from scattertext.WhitespaceNLP import whitespace_nlp
from scattertext.representations.Word2VecFromParsedCorpus import Word2VecFromParsedCorpus, \
	Word2VecFromParsedCorpusBigrams
from scattertext.test.test_corpusFromPandas import get_docs_categories

class TestWord2VecFromParsedCorpus(TestCase):
	@classmethod
	def setUp(cls):
		cls.categories, cls.documents = get_docs_categories()
		cls.parsed_docs = []
		for doc in cls.documents:
			cls.parsed_docs.append(whitespace_nlp(doc))
		cls.df = pd.DataFrame({'category': cls.categories,
		                       'author': ['a', 'a', 'c', 'c', 'c',
		                                  'c', 'd', 'd', 'e', 'e'],
		                       'parsed': cls.parsed_docs,
		                       'document_lengths': [len(doc) for doc in cls.documents]})
		cls.corpus = CorpusFromParsedDocuments(cls.df, 'category', 'parsed').build()

	def test_make(self):
		gensim_is_present_and_working = False
		try:
			from gensim.models import word2vec
			gensim_is_present_and_working = True
		except:
			pass
		if gensim_is_present_and_working:
			Word2VecFromParsedCorpus(self.corpus)
			Word2VecFromParsedCorpus(self.corpus, word2vec.Word2Vec())
			#with self.assertRaises(Exception):
			#	Word2VecFromParsedCorpus(3)

	def test_train(self):
		gensim_is_present_and_working = False
		try:
			from gensim.models import word2vec
			gensim_is_present_and_working = True
		except:
			pass
		if gensim_is_present_and_working:
			Word2VecFromParsedCorpus(self.corpus).train()

	def test_bigrams(self):
		gensim_is_present_and_working = False
		try:
			from gensim.models import word2vec
			gensim_is_present_and_working = True
		except:
			pass
		if gensim_is_present_and_working:
			Word2VecFromParsedCorpusBigrams(self.corpus).train()


     number_of_arguments        // the number of arguments to pop after the call
  );

  // This is the base routine called by the different versions of call_VM. The interpreter
  // may customize this version by overriding it for its purposes (e.g., to save/restore
  // additional registers when doing a VM call).
  //
  // If no java_thread register is specified (noreg) than rdi will be used instead. call_VM_base
  // returns the register which contains the thread upon return. If a thread register has been
  // specified, the return value will correspond to that register. If no last_java_sp is specified
  // (noreg) than rsp will be used instead.
  VIRTUAL void call_VM_base(           // returns the register containing the thread upon return
    Register oop_result,               // where an oop-result ends up if any; use noreg otherwise
    Register java_thread,              // the thread if computed before     ; use noreg otherwise
    Register last_java_sp,             // to set up last_Java_frame in stubs; use noreg otherwise
    address  entry_point,              // the entry point
    int      number_of_arguments,      // the number of arguments (w/o thread) to pop after the call
    bool     check_exceptions          // whether to check for pending exceptions after return
  );

  // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
  // The implementation is only non-empty for the InterpreterMacroAssembler,
  // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
  virtual void check_and_handle_popframe(Register java_thread);
  virtual void check_and_handle_earlyret(Register java_thread);

  void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);

  // helpers for FPU flag access
  // tmp is a temporary register, if none is available use noreg
  void save_rax   (Register tmp);
  void restore_rax(Register tmp);

 public:
  MacroAssembler(CodeBuffer* code) : Assembler(code) {}

  // Support for NULL-checks
  //
  // Generates code that causes a NULL OS exception if the content of reg is NULL.
  // If the accessed location is M[reg + offset] and the offset is known, provide the
  // offset. No explicit code generation is needed if the offset is within a certain
  // range (0 <= offset <= page_size).

  void null_check(Register reg, int offset = -1);
  static bool needs_explicit_null_check(intptr_t offset);

  // Required platform-specific helpers for Label::patch_instructions.
  // They _shadow_ the declarations in AbstractAssembler, which are undefined.
  void pd_patch_instruction(address branch, address target) {
    unsigned char op = branch[0];
    assert(op == 0xE8 /* call */ ||
        op == 0xE9 /* jmp */ ||
        op == 0xEB /* short jmp */ ||
        (op & 0xF0) == 0x70 /* short jcc */ ||
        op == 0x0F && (branch[1] & 0xF0) == 0x80 /* jcc */ ||
        op == 0xC7 && branch[1] == 0xF8 /* xbegin */,
        "Invalid opcode at patch point");

    if (op == 0xEB || (op & 0xF0) == 0x70) {
      // short offset operators (jmp and jcc)
      char* disp = (char*) &branch[1];
      int imm8 = target - (address) &disp[1];
      guarantee(this->is8bit(imm8), "Short forward jump exceeds 8-bit offset");
      *disp = imm8;
    } else {
      int* disp = (int*) &branch[(op == 0x0F || op == 0xC7)? 2: 1];
      int imm32 = target - (address) &disp[1];
      *disp = imm32;
    }
  }

  // The following


using FlatValidatorBenchmarks.Models;
using FluentValidation;

public class FluentValidatorForBigModel : AbstractValidator<BigModel>
{
    public FluentValidatorForBigModel()
    {
        RuleFor(x => x.Text1).NotNull();
        RuleFor(x => x.Text1).Must(t => t.Contains('a', StringComparison.InvariantCultureIgnoreCase))
            .WithMessage("Message T1").When(m => m.Text1 != null);

        RuleFor(x => x.Text2).NotNull();
        RuleFor(x => x.Text2).Must(t => t.Contains('b', StringComparison.InvariantCultureIgnoreCase))
            .WithMessage("Message T2").When(m => m.Text2 != null);

        RuleFor(x => x.Text3).NotNull();
        RuleFor(x => x.Text3).Must(t => t.Contains('c', StringComparison.InvariantCultureIgnoreCase))
            .WithMessage("Message T3").When(m => m.Text3 != null);

        RuleFor(x => x.Text4).NotNull();
        RuleFor(x => x.Text4).Must(t => t.Contains('d', StringComparison.InvariantCultureIgnoreCase))
            .WithMessage("Message T4").When(m => m.Text4 != null);

        RuleFor(x => x.Text5).NotNull();
        RuleFor(x => x.Text5).Must(t => t.Contains('e', StringComparison.InvariantCultureIgnoreCase))
            .WithMessage("Message T5").When(m => m.Text5 != null);

        //
        RuleFor(x => x.Number1).Must(m => m <= 10).WithMessage("Message N1");
        RuleFor(x => x.Number2).Must(m =>


face*
    pub(super) shell_surface: *mut c_void, // wl_shell_surface*

    pub(super) callback: *mut c_void, // wl_callback*
    pub(super) configured: i32,
    pub(super) fullscreen: bool,

    pub(super) wldisplay: *mut c_void, // wl_display*
    pub(super) registry: *mut c_void,  // wl_registry*
    pub(super) compositor: *mut c_void, // wl_compositor*
    pub(super) shell: *mut c_void,     // wl_shell*
    pub(super) seat: *mut c_void,      // wl_seat*
    pub(super) pointer: *mut c_void,   // wl_pointer*
    pub(super) keyboard: *mut c_void,  // wl_keyboard*
    pub(super) shm: *mut c_void,       // wl_shm*
    pub(super) cursor_theme: *mut c_void, // wl_cursor_theme*
    pub(super) default_cursor: *mut WlCursor, // wl_cursor*
    pub(super) cursor_surface: *mut c_void, // wl_surface*
    pub(super) toplevel: *mut c_void,  // void*

    keys_states: u128,
}

impl Drop for WaylandWindow {
    fn drop(&mut self) {
        extern "C" {
            fn wl_proxy_marshal(p: *mut c_void, opcode: u32) -> ();
        }

        unsafe {
            //
            wl_surface_destroy(self.surface);
            wl_egl_window_destroy(self.egl_window);

            // Free
            wl_proxy_marshal(self.shell_surface, 0);
            wl_proxy_destroy(self.shell_surface);

            if !self.callback.is_null() {
                wl_proxy_destroy(self.callback);
            }

            // ---
            wl_surface_destroy(self.cursor_surface);
            if !self.cursor_theme.is_null() {
                wl_cursor_theme_destroy(self.cursor_theme);
            }
            if !self.shell.is_null() {
                wl_proxy_destroy(self.shell);
            }
            if !self.compositor.is_null() {
                wl_proxy_destroy(self.compositor);
            }
            wl_proxy_destroy(self.registry);
            wl_display_flush(self.wldisplay);
            wl_display_disconnect(self.wldisplay);
        }
    }
}
<reponame>hegza/sum-of-squares-bench-rs
/*
use float_ord::FloatOrd;
use rand::Rng;
use spp_experiments::{sum_of_squares_by_move, sum_of_squares_by_ref, Float};
use std::iter;

/// Create the concrete data-structure of length `n` using FromIterator<V> where V is the element type.
fn create_scrambled_data<V, T>(n: usize) -> T
where
    V: Float<f64>,
    T: iter::FromIterator<V>,
{
    let mut rng = rand::thread_rng();

    (0..n).into_iter().map(|_| V::create(rng.gen())).collect()
}

#[no_mangle]
pub fn process(data: Vec<FloatOrd<f64>>) -> f64 {
    sum_of_squares_by_move(data)
}

fn main() {
    // 1 kB
    let input_size_bytes = 1_000;

    let data_len = input_size_bytes / std::mem::size_of::<f64>();

    let data: Vec<FloatOrd<f64>> = create_scrambled_data(data_len);

    let out = process(data);

    println!("{}", out);
}

*/
fn main() {}
<reponame>aprimadi/thordb<filename>src/storage/


{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu


ON_FRAME_DISPLAY_MONITOR)
    void animationResolutionTimerFired();
    Timer m_animationResolutionTimer;
#endif

    Timer m_tickScheduleTimer;
    GenericTaskQueue<Timer> m_currentTimeClearingTaskQueue;
    HashSet<RefPtr<WebAnimation>> m_acceleratedAnimationsPendingRunningStateChange;
    HashSet<Element*> m_elementsWithRunningAcceleratedAnimations;
    Vector<Ref<AnimationPlaybackEvent>> m_pendingAnimationEvents;
    RefPtr<Document> m_document;
    Markable<Seconds, Seconds::MarkableTraits> m_cachedCurrentTime;
    Seconds m_originTime;
    unsigned m_numberOfAnimationTimelineInvalidationsForTesting { 0 };
    bool m_isSuspended { false };
    bool m_waitingOnVMIdle { false };
    bool m_isUpdatingAnimations { false };
};

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_ANIMATION_TIMELINE(DocumentTimeline, isDocumentTimeline())


TopologyTreeNodeFormatter is the formatter for the topology tree node
type TopologyTreeNodeFormatter struct {
	style *config.ThemeConfig
}

// NewTopologyTreeNodeFormatter create a new topology tree node formatter
func NewTopologyTreeNodeFormatter(style *config.ThemeConfig) *TopologyTreeNodeFormatter {
	return &TopologyTreeNodeFormatter{
		style: style,
	}
}

const colorFmt = "%s [%s::b]%s[::]"

// EmojiFormat format the name with the emoji
func (t TopologyTreeNodeFormatter) EmojiFormat(name string, kind string) string {
	switch kind {
	case "app":
		return fmt.Sprintf(colorFmt, app, t.style.Topology.App.String(), name)
	case "workflow":
		return fmt.Sprintf(colorFmt, workflow, t.style.Topology.Workflow.String(), name)
	case "component":
		return fmt.Sprintf(colorFmt, component, t.style.Topology.Component.String(), name)
	case "policy":
		return fmt.Sprintf(colorFmt, policy, t.style.Topology.Policy.String(), name)
	case "trait":
		return fmt.Sprintf(colorFmt, trait, t.style.Topology.Trait.String(), name)
	default:
		return fmt.Sprintf(colorFmt, other, t.style.Topology.Kind.String(), name)
	}
}

const workflowStepFmt = "[::b]%s %s[::]"

// WorkflowStepFormat format the workflow step text with the emoji
func WorkflowStepFormat(name string, status v1alpha1.WorkflowStepPhase) string {
	switch status {
	case v1alpha1.WorkflowStepPhaseSucceeded:
		return fmt.Sprintf(workflowStepFmt, name, workflowStepSucceed)
	default:
		return name
	}
}

const statusColorFmt = "[%s::b]%s[::]"

// ColorizeStatus colorize the status text
func (t TopologyTreeNodeFormatter) ColorizeStatus(status types.HealthStatusCode) string {
	switch status {
	case types.HealthStatusHealthy:
		return fmt.Sprintf(statusColorFmt, t.style.Status.Healthy.String(), status)
	case types.HealthStatusUnHealthy:
		return fmt.Sprintf(statusColorFmt, t.style.Status.UnHealthy.String(), status)
	case types.HealthStatusProgressing:
		return fmt.Sprintf(statusColorFmt, t.style.Status.Waiting.String(), status)
	default:
		return fmt.Sprintf(statusColorFmt, t.style.Status.Unknown.String(), status)
	}
}

const kindColorFmt = "[%s::b]%s[::]"

// ColorizeKind colorize the kind text
func (t TopologyTreeNodeFormatter) ColorizeKind(kind string) string {
	return fmt.Sprintf(kindColorFmt, t.style.Topology.Kind, kind)
}
/*
Copyright 2022 The KubeVela Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package model

import (
	"context"
	"errors"
	"fmt"
	"runtime"
	"strconv"
	"strings"

	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1


):
    """检查对账单是否与发票信息匹配"""
    supplier_name = invoice_info.get('supplier_name')
    supplier_tax_id = invoice_info.get('supplier_tax_id')
    invoice_date = invoice_info.get('invoice_date')

    name_match = doc.supplier_name == supplier_name
    tax_id_match = supplier_tax_id and doc.supplier_tax_id == supplier_tax_id
    date_valid = invoice_date and doc.end_date < invoice_date
    invoice_needed = doc.tax_invoice_not_received == 1

    return (name_match or tax_id_match) and date_valid and invoice_needed

def extract_invoice_info_from_ofd(file_url):
    from zelin_ac.utils.ofd import get_ofd_xml, extract_amount

    contents = []
    if file_url and file_url[-4:] == '.ofd':
        raw_contents = get_ofd_xml(file_url)
        if raw_contents and raw_contents.items:
            for (k,v) in raw_contents.items():
                if 'Amount' in k and v == '¥':
                    continue
                if isinstance(v, list):
                    v = v[0]
                contents.append(frappe._dict({'field_name': k, 'field_value': v or ''}))

    # Define the mapping from OFD field names to target field names and conversion functions
    field_map = {
        'InvoiceNo': ('invoice_number', None),
        'IssueDate': ('invoice_date', lambda v: v.replace('年', '-').replace('月', '-').replace('日', '')),
        'SellerTaxID': ('supplier_tax_id', None),
        'SellerName': ('supplier_name', None),
        'TaxExclusiveTotalAmount': ('net_amount', extract_amount),
        'TaxTotalAmount': ('tax_amount', extract_amount),
        'TaxInclusiveTotalAmount': ('amount', extract_amount),
        'TaxScheme': ('is_special_vat', lambda v: 'special' in v.lower() if v else False),
    }

    # Loop through the child table and apply the mapping
    invoice_info = {}
    for row in contents:
        field_name, field_value = row.field_name, row.field_value
        if field_name in field_map:
            target_field, conversion_func = field_map[field_name]
            invoice_info[target_field] = conversion_func(field_value) if conversion_func else field_value

    return invoice_info


ANGSU.to_owned(),
            "heilongjiang" => HEILONGJIANG.to_owned(),
            "jilin" => JILIN.to_owned(),
            "liaoning" => LIAONING.to_owned(),
            "yunnan" => YUNNAN.to_owned(),

            "chongqing" => CHONGQING.to_owned(),
            "beijing" => BEIJING.to_owned(),
            "shanghai" => SHANGHAI.to_owned(),
            "tianjin" => TIANJIN.to_owned(),

            "xianggang" => XIANGGANG.to_owned(),
            "aomen" => AOMEN.to_owned(),
            "taiwan" => TAIWAN.to_owned(),
            _ => NONE.to_owned(),
        }
    }
}
<filename>src/model.rs
//! Contains the various structs and methods for handling JSON objects.

pub mod award;
pub mod comment;
pub mod link;
#[doc(hidden)]
pub mod listing;
pub mod message;
pub mod misc;
#[doc(hidden)]
pub mod more;
pub mod prelude;
pub mod subreddit;
#[doc(hidden)]
pub mod thing;
pub mod user;
pub mod usersubreddit;
<filename>src/lib.rs
pub mod reader;
pub mod core;
pub mod interpreter;

use std::os::raw::{c_char};
use std::ffi::{CString, CStr};

use interpreter::cps_interpreter::pixels;

#[no_mangle]
pub unsafe extern fn scheme(to: *const c_char, new_pixels: *mut c_char) -> *mut c_char {

    pixels = new_pixels;
    let c_str = unsafe { CStr::from_ptr(to) };
    let interp_string = match c_str.to_str() {
        Err(_) => "",
        Ok(string) => string,
    };
    let interpreter = interpreter::interpreter::new("cps");
    let result = interpreter.execute(interp_string);
    match result {
        Ok(v) => return CString::new(v).unwrap().into_raw(),
        Err(e) => return CString::new("Error").unwrap().into_raw(),
    }
}

//pub mod lexer;
//mod parser;
//mod interpreter;
//mod ast_walk_interpreter;
//mod cps_interpreter;

//#[cfg(not(test))]
//mod repl;<gh_stars>0
//! Library for writing LLVM IR.
//!
//! # Useful links:
//! - [LLVM language reference](https://llvm.org/docs/LangRef.html)
//!
//! # Error handling
//! Invalid operations, such as a basic block using a register that is not defined or an invalid linkage type being used,
//! result in panics. This is because these errors are treated as a bug in the compiler that is using `llvm-model`, and these
//! errors are not expected to be handled such as with the `Err` case of a result, resulting in more convenient return types.

#![deny(missing_docs, missing_debug_implementations)]

pub mod block;
pub mod global;
pub mod identifier;
pub mod interop;
pub mod module;
pub mod target;
pub mod types;
pub mod value;

pub use block::BasicBlock;
pub use identifier::{Id, Identifier};
pub use module::Module;
pub use target::Target;

/// Internal helper used to define a default value for enumerations.
#[doc(hidden)]
#[macro_export]
macro_rules! enum_default {
    ($enum_type: ty, $enum_case: ident) => {
        impl std::default::Default for $enum_type {
            fn default() -> Self {
                Self::$enum_case
            }
        }
    };
}

/// Internal helper that defines a `From` trait implementation for an enum case.
#[doc(hidden)]
#[macro_export]
macro_rules! enum_case_from {
    ($enum_type: ty, $e


etjmp
	.global longjmp

setjmp:
	pop	r1
	ldi	sp, ar0
#ifndef _REGPARM
	ldi	*ar0, ar2
#endif

	sti	r4, *ar2++
	sti	r5, *ar2++
	stf	r6, *ar2++
	stf	r7, *ar2++
#ifdef _TMS320C4x
	sti	r8, *ar2++
#endif
	sti	ar3, *ar2++
	sti	ar4, *ar2++
	sti	ar5, *ar2++
	sti	ar6, *ar2++
	sti	ar7, *ar2++
	bd	r1
	sti	r1, *ar2++
	sti	ar0, *ar2
	ldi	0, r0

longjmp:
#ifndef _REGPARM
	ldi	sp, ar0
	ldi	*-ar0(1), ar2
	ldi	*-ar0(2), r0
	ldiz	1, r0
#else
	ldi	r2, r0
	ldiz	1, r0
#endif

	ldi	*ar2++, r4
	ldi	*ar2++, r5
	ldf	*ar2++, r6
	ldf	*ar2++, r7
#ifdef _TMS320C4x
	ldi	*ar2++, r8
#endif
	ldi	*ar2++, ar3
	ldi	*ar2++, ar4
	ldi	*ar2++, ar5
	ldi	*ar2++, ar6
	ldi	*ar2++, ar7
	ldi	*ar2++, r1
	ldi	*ar2, sp

	b	 r1
	.end


ex = field
		case "groups":
			it.tableFieldGroups = field
			groupstyp, ok := field.Type.(*godwarf.StructType)
			if ok {
				for _, field := range groupstyp.Field {
					switch field.Name {
					case "data":
						it.groupsFieldData = field
						typ, ok := field.Type.(*godwarf.PtrType)
						if ok {
							it.groupType, _ = godwarf.ResolveTypedef(typ.Type).(*godwarf.StructType)
						}
					case "lengthMask":
						it.groupsFieldLengthMask = field
					}
				}
			}
		}
	}
	if it.groupType == nil || it.tableFieldIndex == nil || it.tableFieldGroups == nil || it.groupsFieldLengthMask == nil {
		it.v.Unreadable = errSwissMapBadType
		return
	}
	for _, field := range it.groupType.Field {
		switch field.Name {
		case "ctrl":
			it.groupFieldCtrl = field
		case "slots":
			it.groupFieldSlots = field
		}
	}
	if it.groupFieldCtrl == nil || it.groupFieldSlots == nil {
		it.v.Unreadable = errSwissMapBadGroupTypeErr
		return
	}

	slotsType, ok := godwarf.ResolveTypedef(it.groupFieldSlots.Type).(*godwarf.ArrayType)
	if !ok {
		it.v.Unreadable = errSwissMapBadGroupTypeErr
		return
	}
	slotType, ok := slotsType.Type.(*godwarf.StructType)
	if !ok {
		it.v.Unreadable = errSwissMapBadGroupTypeErr
		return
	}
	for _, field := range slotType.Field {
		switch field.Name {
		case "key":
			it.slotFieldKey = field
		case "elem":
			it.slotFieldElem = field
		}
	}
	if it.slotFieldKey == nil || it.slotFieldElem == nil {
		it.v.Unreadable = errSwissMapBadGroupTypeErr
		return
	}

	if it.dirLen <= 0 {
		// small maps, convert it.dirPtr to be of type *group, then dereference it
		it.dirPtr.DwarfType = pointerTo(fakeArrayType(1, it.groupType), it.v.bi.Arch)
		it.dirPtr.RealType = it.dirPtr.DwarfType
		it.dirPtr = it.dirPtr.maybeDereference()
		it.dirLen = 1
		it.tab = &swissTable{groups: it.dirPtr} // so that we don't try to load this later on
		return
	}

	// normal map, convert it.dirPtr to be of type *[dirLen]*table, then dereference it

	it.dirPtr.DwarfType = pointerTo(fakeArrayType(uint64(it.dirLen), tableptrtyp), it.v.bi.Arch)
	it.dirPtr.RealType = it.dirPtr.DwarfType
	it.dirPtr = it.dirPtr.maybeDereference()
}

// derived from $GOROOT/src/internal/runtime/maps/table.go and $GOROOT/src/runtime/runtime-gdb.py
func (it *mapIteratorSwiss) next() bool {
	if it.v.Unreadable != nil {
		return false
	}
	for it.dirIdx < it.dirLen {
		if it.tab == nil {
			it.loadCurrentTable()
			if it.tab == nil {
				return false
			}
			if it.tab.index != it.dirIdx {
				it.nextTable()
				continue
			}
		}

		for ; it.groupIdx < uint64(it.tab.groups.Len); it.nextGroup() {
			if it.maxNumGroups > 0 && it.groupIdx+it.groupCount >= it.maxNumGroups {
				return false
			}
			if it.group == nil {
				it.loadCurrentGroup()
				if it.group == nil {
					return false
				}
			}

			for ; it.slotIdx < uint32(it.group.slots.Len); it.slotIdx++ {
				if it.slot


oughContainers = 0xC01A0023,
    LogClientAlreadyRegistered = 0xC01A0024,
    LogClientNotRegistered = 0xC01A0025,
    LogFullHandlerInProgress = 0xC01A0026,
    LogContainerReadFailed = 0xC01A0027,
    LogContainerWriteFailed = 0xC01A0028,
    LogContainerOpenFailed = 0xC01A0029,
    LogContainerStateInvalid = 0xC01A002A,
    LogStateInvalid = 0xC01A002B,
    LogPinned = 0xC01A002C,
    LogMetadataFlushFailed = 0xC01A002D,
    LogInconsistentSecurity = 0xC01A002E,
    LogAppendedFlushFailed = 0xC01A002F,
    LogPinnedReservation = 0xC01A0030,
    VideoHungDisplayDriverThread = 0xC01B00EA,
    FltNoHandlerDefined = 0xC01C0001,
    FltContextAlreadyDefined = 0xC01C0002,
    FltInvalidAsynchronousRequest = 0xC01C0003,
    FltDisallowFastIo = 0xC01C0004,
    FltInvalidNameRequest = 0xC01C0005,
    FltNotSafeToPostOperation = 0xC01C0006,
    FltNotInitialized = 0xC01C0007,
    FltFilterNotReady = 0xC01C0008,
    FltPostOperationCleanup = 0xC01C0009,
    FltInternalError = 0xC01C000A,
    FltDeletingObject = 0xC01C000B,
    FltMustBeNonPagedPool = 0xC01C000C,
    FltDuplicateEntry = 0xC01C000D,
    FltCallbackDataQueueDisabled = 0xC01C000E,
    FltDoNotAttach = 0xC01C000F,
    FltDoNotDetach = 0xC01C0010,
    FltInstanceAltitudeCollision = 0xC01C0011,
    FltInstanceNameCollision = 0xC01C0012,
    FltFilterNotFound = 0xC01C0013,
    FltVolumeNotFound = 0xC01C0014,
    FltInstanceNotFound = 0xC01C0015,
    FltContextAllocationNotFound = 0xC01C0016,
    FltInvalidContextRegistration = 0xC01C0017,
    FltNameCacheMiss = 0xC01C0018,
    FltNoDeviceObject = 0xC01C0019,
    FltVolumeAlreadyMounted = 0xC01C001A,
    FltAlreadyEnlisted = 0xC01C001B,
    FltContextAlreadyLinked = 0xC01C001C,
    FltNoWaiterForReply = 0xC01C0020,
    MonitorNoDescriptor = 0xC01D0001,
    MonitorUnknownDescriptorFormat = 0xC01D0002,
    MonitorInvalidDescriptorChecksum = 0xC01D0003,
    MonitorInvalidStandardTimingBlock = 0xC01D0004,
    MonitorWmiDataBlockRegistrationFailed = 0xC01D0005,
    MonitorInvalidSerialNumberMonDscBlock = 0xC01D0006,
    MonitorInvalidUserFriendlyMonDscBlock = 0xC01D0007,
    MonitorNoMoreDescriptorData = 0xC01D0008,
    MonitorInvalidDetailedTimingBlock = 0xC01D0009,
    MonitorInvalidManufactureDate = 0xC01D000A,
    GraphicsNotExclusiveModeOwner = 0xC01E0000,
    GraphicsInsufficientDmaBuffer = 0xC01E0001,
    GraphicsInvalidDisplayAdapter = 0xC01E0002,
    GraphicsAdapterWasReset = 0xC01E0003,
    GraphicsInvalidDriverModel = 0xC01E0004,
    GraphicsPresentModeChanged = 0xC01E0005,
    GraphicsPresentOccluded = 0xC01E0006,
    GraphicsPresentDenied = 0xC01E0007,
    GraphicsCannotColorConvert = 0xC01E0008,
    GraphicsPresentRedirectionDisabled = 0xC01E000B,
    GraphicsPresentUnoccluded = 0xC01E000C,
    GraphicsNoVideoMemory = 0xC01E0100,
    GraphicsCantLockMemory = 0xC01E0101,
    GraphicsAllocationBusy = 0xC01E0102,
    GraphicsTooManyReferences = 0xC01E0103,
    GraphicsTryAgainLater = 0xC01E0104,
    GraphicsTryAgainNow = 0xC01E0105,
    Graphi


,2,3[,0] */
	dup		v7.4s, w5
	mov		v0.16b, v4.16b
	add		v7.4s, v7.4s, v8.4s
	mov		v1.16b, v4.16b
	rev32		v8.16b, v7.16b
	mov		v2.16b, v4.16b
	mov		v3.16b, v4.16b
	mov		v1.s[3], v8.s[0]
	mov		v2.s[3], v8.s[1]
	mov		v3.s[3], v8.s[2]
	ld1		{v5.16b-v7.16b}, [x1], #48	/* get 3 input blocks */
	do_encrypt_block4x
	eor		v0.16b, v5.16b, v0.16b
	ld1		{v5.16b}, [x1], #16		/* get 1 input block  */
	eor		v1.16b, v6.16b, v1.16b
	eor		v2.16b, v7.16b, v2.16b
	eor		v3.16b, v5.16b, v3.16b
	st1		{v0.16b-v3.16b}, [x0], #64
	add		x5, x5, #INTERLEAVE
#endif
	cbz		w4, .LctroutNx
.LctrincNx:
	rev		x7, x5
	ins		v4.d[1], x7
	b		.LctrloopNx
.LctroutNx:
	sub		x5, x5, #1
	rev		x7, x5
	ins		v4.d[1], x7
	b		.Lctrout
.Lctr1x:
	adds		w4, w4, #INTERLEAVE
	beq		.Lctrout
#endif
.Lctrloop:
	mov		v0.16b, v4.16b
	encrypt_block	v0, w3, x2, x6, w7
	subs		w4, w4, #1
	bmi		.Lctrhalfblock		/* blocks < 0 means 1/2 block */
	ld1		{v3.16b}, [x1], #16
	eor		v3.16b, v0.16b, v3.16b
	st1		{v3.16b}, [x0], #16
	beq		.Lctrout
.Lctrinc:
	adds		x5, x5, #1		/* increment BE ctr */
	rev		x7, x5
	ins		v4.d[1], x7
	bcc		.Lctrloop		/* no overflow? */
	umov		x7, v4.d[0]		/* load upper word of ctr  */
	rev		x7, x7			/* ... to handle the carry */
	add		x7, x7, #1
	rev		x7, x7
	ins		v4.d[0], x7
	b		.Lctrloop
.Lctrhalfblock:
	ld1		{v3.8b}, [x1]
	eor		v3.8b, v0.8b, v3.8b
	st1		{v3.8b}, [x0]
.Lctrout:
	FRAME_POP
	ret
AES_ENDPROC(aes_ctr_encrypt)
	.ltorg

	/*
	 * aes_xts_decrypt(u8 out[], u8 const in[], u8 const rk1[], int rounds,
	 *		   int blocks, u8 const rk2[], u8 iv[], int first)
	 * aes_xts_


dler,
		},
		{
			MethodName: "ListModels",
			Handler:    _TranslationService_ListModels_Handler,
		},
		{
			MethodName: "GetModel",
			Handler:    _TranslationService_GetModel_Handler,
		},
		{
			MethodName: "DeleteModel",
			Handler:    _TranslationService_DeleteModel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/cloud/translate/v3/translation_service.proto",
}
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.35.2
// 	protoc        v4.25.7
// source: google/cloud/datalabeling/v1beta1/evaluation.proto

package datalabelingpb

import (
	_ "google.golang.org/genproto/googleapis/api/annotations"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Describes an evaluation between a machine learning model's predictions and
// ground truth labels. Created when an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] runs successfully.
type Evaluation struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// Output only. Resource name of an evaluation. The name has the following
	// format:
	//
	// "projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id</var>}'
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Output only. Options used in the evaluation job that created this
	// evaluation.
	Config *EvaluationConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// Output only. Timestamp for when the evaluation job that created this
	// evaluation ran.
	EvaluationJobRunTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=evaluation_job_run_time,json=evaluationJobRunTime,proto3" json:"evaluation_job_run_time,omitempty"`
	// Output only. Timestamp for when this evaluation was created.
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// Output only. Metrics comparing predictions to ground truth labels.
	EvaluationMetrics *EvaluationMetrics `protobuf:"bytes,5,opt,name=evaluation_metrics,json=evaluationMetrics,proto3" json:"evaluation_metrics,omitempty"`
	// Output only. Type of task


from aioprogress import AsyncDownloader, DownloadConfig
from aioprogress.events import DownloadTimeoutEvent, DownloadFailureEvent
import asyncio

async def main():
    """
    Proxy usage example demonstrating how to download files through
    HTTP proxies with authentication and custom headers.
    """
    # Configure proxy settings and download behavior
    config = DownloadConfig(
        proxy_url='http://proxy.example.com:8080',  # Replace with real proxy
        proxy_auth=('username', 'password'),  # Replace with real credentials
        proxy_headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'},
        max_retries=5,  # Increase retries for proxy connections
        retry_delay=2.0  # Longer delay between retries
    )

    async def on_timeout(event: DownloadTimeoutEvent):
        """Handle timeout events which may be more common with proxies"""
        print(f"Timeout occurred ({event.timeout_type}) on attempt {event.attempt}")
        if event.will_retry:
            print("Will retry with proxy...")

    async def on_failure(event: DownloadFailureEvent):
        """Handle failures that might be proxy-related"""
        print(f"Download failed through proxy: {event.error}")

    url = 'https://mirror.nforce.com/pub/speedtests/25mb.bin'

    # Create downloader with proxy configuration and event handling
    async with AsyncDownloader(
            url,
            "./downloads/",
            config,
            on_timeout=on_timeout,
            on_failure=on_failure
    ) as downloader:
        result = await downloader.start()
        if result:
            print(f"Successfully downloaded through proxy: {result}")
        else:
            print("Proxy download failed or was cancelled")

if __name__ == '__main__':
    asyncio.run(main())


from ida_hexrays import *
from idaapi import SEGPERM_READ, SEGPERM_WRITE, xrefblk_t, getseg, segment_t, XREF_DATA, dr_W, is_loaded

from d810.optimizers.instructions.early.handler import EarlyRule
from d810.ast import AstLeaf, AstConstant, AstNode

class SetGlobalVariablesToZero(EarlyRule):
    DESCRIPTION = "This rule can be used to patch memory read"

    PATTERN = AstNode(m_mov, AstLeaf("ro_dword"))
    REPLACEMENT_PATTERN = AstNode(m_mov, AstConstant("val_res"))

    def __init__(self):
        super().__init__()
        self.ro_dword_min_ea = None
        self.ro_dword_max_ea = None

    def configure(self, kwargs):
        super().configure(kwargs)
        self.ro_dword_min_ea = None
        self.ro_dword_max_ea = None
        if "ro_dword_min_ea" in kwargs.keys():
            self.ro_dword_min_ea = int(kwargs["ro_dword_min_ea"], 16)
        if "ro_dword_max_ea" in kwargs.keys():
            self.ro_dword_max_ea = int(kwargs["ro_dword_max_ea"], 16)

    def check_candidate(self, candidate):
        if (self.ro_dword_min_ea is None) or (self.ro_dword_max_ea is None):
            return False
        if candidate["ro_dword"].mop.t != mop_v:
            return False
        mem_read_address = candidate["ro_dword"].mop.g
        if not(self.ro_dword_min_ea <= mem_read_address <= self.ro_dword_max_ea):
            return False

        candidate.add_constant_leaf("val_res", 0, candidate["ro_dword"].mop.size)
        return True

# This rule is from
# https://www.carbonblack.com/blog/defeating-compiler-level-obfuscations-used-in-apt10-malware/
class SetGlobalVariablesToZeroIfDetectedReadOnly(EarlyRule):
    DESCRIPTION = "WARNING: Use it only if you know what you are doing as it may patch data not related to obfuscation"

    PATTERN = AstNode(m_mov, AstLeaf("ro_dword"))
    REPLACEMENT_PATTERN = AstNode(m_mov, AstConstant("val_res"))

    def __init__(self):
        super().__init__()
        # If we optimized too early (in MMAT_GENERATED), we may replace something like
        # 'mov     &($dword_10020CC8).4, eoff.4' by 'mov     #0.4, eoff.4'
        # and this will lead to incorrect decompilation where MEMORY[0] is used
        # Thus, we explicitly specify the MMAT_PREOPTIMIZED maturity.
        self.maturities = [MMAT_PREOPTIMIZED]

    def is_read_only_inited_var(self, address):
        s: segment_t = getseg(address)
        if s is None:
            return False
        if s.perm != (SEGPERM_READ | SEGPERM_WRITE):
            return False
        if is_loaded(address):
            return False
        ref_finder = xrefblk_t()
        is_ok = ref_finder.first_to(address, XREF_DATA)
        while is_ok:
            if ref_finder.type == dr_W:
                return False
            is_ok = ref_finder.next_to()
        return True

    def check_candidate(self, candidate):
        mem_read_address = None
        if candidate["ro_dword"].mop.t == mop_v:
            mem_read_address = candidate["ro_dword"].mop.g
        elif candidate["ro_dword"].mop.t == mop_a:
            if candidate["ro_dword"].mop.a.t == mop_v:
                mem_read_address = candidate["ro_dword"].mop.a.g

        if mem_read_address is None:
            return False

        if not self.is_read_only_inited_var(mem_read_address):
            return False
        candidate.add_constant_leaf("val_res", 0, candidate["ro_dword"].mop.size)
        return True


�，避免 AI 不稳定导致错过创建
        if (!billInfoModel.generateByAi() && SettingUtils.autoAssetMap()) {
            runCatchingExceptCancel {
                val emptyMapping = AssetsMapModel().apply {
                    name = accountName
                    mapName = ""
                }
                ServerLog.d("创建空资产映射占位符: '$accountName'")
                Db.get().assetsMapDao().insert(emptyMapping)
            }
        }

        // 3.5 让AI处理
        if (useAi && SettingUtils.aiAssetMapping() && !isAccountName2) {
            ServerLog.d("通过AI进行资产映射")
            val json =
                AssetTool().execute(billInfoModel.accountNameTo, billInfoModel.accountNameFrom)
            if (json != null) {
                val aiTo = json.safeGetString("asset1")
                val aiFrom = json.safeGetString("asset2")
                billInfoModel.accountNameTo =
                    aiTo.ifBlank { billInfoModel.accountNameTo }
                billInfoModel.accountNameFrom =
                    aiFrom.ifBlank { billInfoModel.accountNameFrom }
                ServerLog.d("AI建议: to='$aiTo' from='$aiFrom'")
                return null
            } else {
                ServerLog.d("AI未返回有效结果")
            }
        }

        // 3.5 基于算法的保守匹配（数字优先 → 最长连续相似子串）
        findByAlgorithm(accountName)?.let { return it }

        // 空映射占位符已在 AI 之前创建

        return null
    }

    /**
     * 基于算法的资产匹配
     *
     * 策略：
     * 1) 若原始账户名中包含数字（如卡号），优先用数字在资产名中匹配
     * 2) 否则使用“最长连续相似子串”作为相似度指标选取最佳匹配
     *
     * 返回匹配到的资产名称；若无匹配则返回 null
     */
    private suspend fun findByAlgorithm(accountName: String): String? {
        // 提取原始账户名中的银行标识（如“招商银行”、“北京银行”），用于信用卡银行一致性校验
        val inputBank = extractBankName(accountName)

        // 1) 数字优先匹配（如卡号）
        val number = Regex("\\d+").find(accountName)?.value ?: ""
        if (number.isNotEmpty()) {
            assets.firstOrNull { candidate ->
                val hit = candidate.name.contains(number.trim())
                if (!hit) return@firstOrNull false
                // 若候选为信用卡且识别到输入中的银行名，则要求银行一致，避免不同银行信用卡混淆
                if (candidate.name.contains("信用卡") && inputBank != null) {
                    val candidateBank = extractBankName(candidate.name)
                    return@firstOrNull candidateBank == null || candidateBank == inputBank
                }
                true
            }?.let { asset ->
                ServerLog.d("算法映射-卡号命中: ${asset.name}")
                return asset.name
            }
        }

        // 2) 文本相似度匹配（最长连续相似子串）
        val cleanInput = accountName.cleanText(number)
        var bestName: String? = null
        var bestSimilarity = 0
        var bestDiff = Int.MAX_VALUE

        for (asset in assets) {


istributed 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 AndroidIDE.  If not, see <https://www.gnu.org/licenses/>.
 */

package com.itsaky.androidide.lsp.xml.edits

import com.itsaky.androidide.lsp.edits.DefaultEditHandler
import com.itsaky.androidide.lsp.models.CompletionItem

/**
 * Handles edits for attribute values with qualified binary names. The default implementation in
 * [CompletionItem] cannot handle these type of edits.
 *
 * @author Akash Yadav
 */
open class QualifiedValueEditHandler : DefaultEditHandler() {

  override fun isPartialPart(c: Char): Boolean {
    return super.isPartialPart(c) || c == '.' // Tags can contain '.' as well
  }
}
/*
 *  This file is part of AndroidIDE.
 *
 *  AndroidIDE is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  AndroidIDE 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 AndroidIDE.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.itsaky.androidide.lsp.xml.models

import com.itsaky.androidide.lsp.util.PrefBasedServerSettings

/**
 * Preferences based settings for XML language server.
 *
 * @author Akash Yadav
 */
object XMLServerSettings : PrefBasedServerSettings() {

  /** Options for XML code formatting. */
  val formattingOptions = XMLFormattingOptions()

  override fun completionFuzzyMatchMinRatio(): Int {
    return 50
  }
}
/*
 *  This file is part of AndroidIDE.
 *
 *  AndroidIDE is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  AndroidIDE 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 AndroidIDE.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.itsaky.androidide.lsp.xml.utils

import com.itsaky.androidide.lexers.xml.XMLLexer
import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE
import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.ATTRIBUTE_VALUE
import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.TAG
import com.itsaky.androidide.lsp.xml.utils.XmlUtils.NodeType.UNKNOWN
import org.antlr.v4.runtime.CharStreams
import org.antlr.v4.runtime.Token
import org.eclipse.lemminx.dom.DOMDocument
import org.eclipse.lemminx.dom.DOMElement
import org.eclipse.lemminx.dom.DOMNode
import org.slf4j.LoggerFactory

/** @author Akash Yadav */
object XmlUtils {

  private val log = LoggerFactory.getLogger


.Wrap(err)
		}

		err = r.checkOCPVersion(clientset)
		if err != nil {
			r.Log.Error(err, "check ocp version failed", "plan", plan)
			plan.Status.SetCondition(unsupportedVersion)
		}
	}

	return nil
}

func (r *Reconciler) ensureSecretForProvider(plan *api.Plan) error {
	if plan.Referenced.Provider.Source != nil &&
		plan.Referenced.Secret == nil &&
		!plan.Referenced.Provider.Source.IsHost() {
		err := r.setupSecret(plan)
		if err != nil {
			return err
		}
	}

	return nil
}

// Validate that warm migration is supported from the source provider.
func (r *Reconciler) validateWarmMigration(ctx *plancontext.Context) (err error) {
	if !ctx.Plan.IsWarm() {
		return
	}
	provider := ctx.Plan.Referenced.Provider.Source
	if provider == nil {
		return nil
	}
	pAdapter, err := adapter.New(provider)
	if err != nil {
		return err
	}
	validator, err := pAdapter.Validator(ctx)
	if err != nil {
		return err
	}
	if !validator.WarmMigration() {
		ctx.Plan.Status.SetCondition(libcnd.Condition{
			Type:     WarmMigrationNotReady,
			Status:   True,
			Category: api.CategoryCritical,
			Reason:   NotSupported,
			Message:  "Warm migration from the source provider is not supported.",
		})
	}
	return
}

func (r *Reconciler) validateMigrationType(ctx *plancontext.Context) (err error) {
	provider := ctx.Plan.Referenced.Provider.Source
	if provider == nil {
		return nil
	}
	pAdapter, err := adapter.New(provider)
	if err != nil {
		return err
	}
	validator, err := pAdapter.Validator(ctx)
	if err != nil {
		return err
	}
	if !validator.MigrationType() {
		ctx.Plan.Status.SetCondition(libcnd.Condition{
			Type:     MigrationTypeNotValid,
			Status:   True,
			Category: Critical,
			Reason:   NotSupported,
			Message:  fmt.Sprintf("`%s` migration from the source provider is not supported.", ctx.Plan.Spec.Type),
		})
	}
	return
}

// Validate the target namespace.
func (r *Reconciler) validateTargetNamespace(plan *api.Plan) (err error) {
	newCnd := libcnd.Condition{
		Type:     NamespaceNotValid,
		Status:   True,
		Category: api.CategoryCritical,
		Message:  "Target namespace is not valid.",
	}
	if plan.Spec.TargetNamespace == "" {
		newCnd.Reason = NotSet
		plan.Status.SetCondition(newCnd)
		return
	}
	if len(k8svalidation.IsDNS1123Subdomain(plan.Spec.TargetNamespace)) > 0 {
		newCnd.Reason = NotValid
		plan.Status.SetCondition(newCnd)
	}
	return
}

// Validate unsupported User Defined Network configurations in the destination namespace.
func (r *Reconciler) validateUserDefinedNetwork(ctx *plancontext.Context) (err error) {
	nads, err := r.getDestinationNamespaceNads(ctx)
	if err != nil {
		return err
	}

	for _, nad := range nads.Items {
		var networkConfig model.NetworkConfig
		err = json.Unmarshal([]byte(nad.Spec.Config), &networkConfig)
		if err != nil {
			r.Log.Info("Skipping NAD: failed to parse network config", "namespace", nad.Namespace, "name", nad.Name, "error", err.Error())
			continue
		}
		if networkConfig.Type != model.OvnOverlayType {
			continue
		}
		if networkConfig.Top


-- ENGLISH (Default)

-- Buttons
AFP_BUTTON_TEXT_CLEAR = "Clear";
AFP_BUTTON_TEXT_FILTER = "Filters";
AFP_BUTTON_TEXT_RESET = "Reset";
AFP_BUTTON_TEXT_SAVE = "Save Defaults";
AFP_BUTTON_TEXT_LOAD = "Load Defaults";

-- Tooltips
AFP_TOOLTIP_TITLE_UNAFFORD = "Hide Unaffordable";
AFP_TOOLTIP_TEXT_UNAFFORD = "Checking this will filter out any items that cost more than the amount you currently have on this character.";
AFP_TOOLTIP_TITLE_HIDEKNOWN = "Hide Known";
AFP_TOOLTIP_TEXT_HIDEKNOWN = "This will hide any recipes you already know. The benefit of this option over Blizzard's Usable Items is that this will show things you can't yet learn (but will be able to in the future).";
AFP_TOOLTIP_TITLE_NOBUYOUT = "Only with Buyout";
AFP_TOOLTIP_TEXT_NOBUYOUT = "Checking this will hide any items that do not have buyout prices.";
AFP_TOOLTIP_TITLE_PERUNIT = "Show Price Per Item";
AFP_TOOLTIP_TEXT_PERUNIT = "This will show the price-per-item (for stacked items) so you can find the best deals no matter what size of stack is being sold.";
AFP_TOOLTIP_TITLE_STACK20 = "Stacks of 20";
AFP_TOOLTIP_TEXT_STACK20 = "This filter will hide any stacks that are not exactly 20 units.";
AFP_TOOLTIP_TITLE_STACK10 = "Stacks of 10";
AFP_TOOLTIP_TEXT_STACK10 = "This filter will hide any stacks that are not exactly 10 units.";
AFP_TOOLTIP_TITLE_STACK5 = "Stacks of 5";
AFP_TOOLTIP_TEXT_STACK5 = "This filter will hide any stacks that are not exactl


;
	Vision *vision = g_player[m_owner]->m_vision;
	sint32 w = vision->m_width;
	sint32 bottom = m_row + m_numRows;
	if(bottom > vision->m_height)
		bottom = vision->m_height;

	for (sint32 y = m_row; y < bottom; ++y)
	{
		bitPos = 0;
		ptr = &buf[size] + ((y - m_row) * ((w+7) / 8));
		*ptr = 0;
		for (sint32 x = 0; x < vision->m_width; ++x)
		{
			uint16 vis = vision->m_array[x][y];
			if(vis & 0x8000) {
				*ptr |= 1 << bitPos;
			}
			bitPos++;
			if(bitPos >= 8) {
				bitPos = 0;
				ptr++;
				*ptr = 0;
			}
		}
	}
	if(bitPos != 0) {

		ptr++;
	}
	size = static_cast<uint16>(ptr - buf + 1);
}

//----------------------------------------------------------------------------
//
// Name       : NetVision::Unpacketize
//
// Description: Retrieve the data from a received application data packet.
//
// Parameters : id          : Sender identification?
//              buf         : Buffer with received message
//              size        : Length of received message (in bytes)
//
// Globals    : -
//
// Returns    : -
//
// Remark(s)  : -
//
//----------------------------------------------------------------------------
void NetVision::Unpacketize(uint16 id, uint8 *buf, uint16 size)
{
	sint32 pos = 0;
	uint16 packid;
	PULLID(packid);
	Assert(packid == k_PACKET_VISION_ID);

	PULLBYTE(m_owner);
	PULLSHORT(m_row);
	PULLBYTE(m_numRows);

	uint8 *         ptr     = NULL;
	uint8           bitPos  = 0;
	Vision *        vision  = g_player[m_owner]->m_vision;
	sint32          w       = vision->m_width;
	sint32 const    bottom  =
	    std::min<sint32>(m_row + m_numRows, vision->m_height);

	for (sint32 y = m_row; y < bottom; ++y)
	{
		bitPos = 0;
		ptr = &buf[pos] + ((y - m_row) * ((w+7) / 8));
		for (sint32 x = 0; x < vision->m_width; ++x)
		{
			if(*ptr & (1 << bitPos)) {
				vision->m_array[x][y] |= 0x8000;
			} else {
				vision->m_array[x][y] &= 0x7fff;
			}
			bitPos++;
			if(bitPos >= 8) {
				bitPos = 0;
				ptr++;
			}
		}
	}
	if(bitPos != 0) {

		ptr++;
	}
	Assert(size == ptr - buf + 1);

}

//----------------------------------------------------------------------------
//
// Name       : NetUnseenCell::NetUnseenCell
//
// Description: Constructor
//
// Parameters : UnseenCell *ucell: The unseen cell from/to the network
//              uint8 owner:
//
// Globals    : -
//
// Returns    : -
//
// Remark(s)  : -
//
//----------------------------------------------------------------------------
NetUnseenCell::NetUnseenCell(UnseenCell *ucell, uint8 owner)
:
    m_ucell (ucell),
    m_owner (owner)
{ ; }

#define k_BIO 1
#define k_NANO 2
#define k_CONVERTED 4
#define k_FRANCHISED 8
#define k_INJOINED 0x10
#define k_HAPPINESS 0x20
#define k_HUT 0x40

//----------------------------------------------------------------------------
//
// Name       : NetUnseen


table, flags);
		if (ret)
			return ret;
	}

	for (unsigned i = 0; i < inode->i_num_streams; i++) {

		strm = &inode->i_streams[i];

		if (!stream_is_named_data_stream(strm))
			continue;

		wdentry->num_named_streams++;

		ret = stream_to_wimlib_stream_entry(inode, strm,
						    &wdentry->streams[
							wdentry->num_named_streams],
						    wim->blob_table, flags);
		if (ret)
			return ret;
	}
	return 0;
}

static void
free_wimlib_dentry(struct wimlib_dir_entry *wdentry)
{
	utf16le_put_tstr(wdentry->filename);
	utf16le_put_tstr(wdentry->dos_name);
	for (unsigned i = 1; i <= wdentry->num_named_streams; i++)
		utf16le_put_tstr(wdentry->streams[i].stream_name);
	FREE(wdentry);
}

static int
do_iterate_dir_tree(WIMStruct *wim,
		    struct wim_dentry *dentry, int flags,
		    wimlib_iterate_dir_tree_callback_t cb,
		    void *user_ctx)
{
	struct wimlib_dir_entry *wdentry;
	int ret = WIMLIB_ERR_NOMEM;

	wdentry = CALLOC(1, sizeof(struct wimlib_dir_entry) +
				  (1 + dentry->d_inode->i_num_streams) *
					sizeof(struct wimlib_stream_entry));
	if (wdentry == NULL)
		goto out;

	ret = init_wimlib_dentry(wdentry, dentry, wim, flags);
	if (ret)
		goto out_free_wimlib_dentry;

	if (!(flags & WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN)) {
		ret = (*cb)(wdentry, user_ctx);
		if (ret)
			goto out_free_wimlib_dentry;
	}

	if (flags & (WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE |
		     WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN))
	{
		struct wim_dentry *child;

		ret = 0;
		for_dentry_child(child, dentry) {
			ret = do_iterate_dir_tree(wim, child,
						  flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN,
						  cb, user_ctx);
			if (ret)
				break;
		}
	}
out_free_wimlib_dentry:
	FREE(dentry->d_full_path);
	dentry->d_full_path = NULL;
	free_wimlib_dentry(wdentry);
out:
	return ret;
}

struct image_iterate_dir_tree_ctx {
	const tchar *path;
	int flags;
	wimlib_iterate_dir_tree_callback_t cb;
	void *user_ctx;
};

static int
image_do_iterate_dir_tree(WIMStruct *wim)
{
	struct image_iterate_dir_tree_ctx *ctx = wim->private;
	struct wim_dentry *dentry;

	dentry = get_dentry(wim, ctx->path, WIMLIB_CASE_PLATFORM_DEFAULT);
	if (dentry == NULL)
		return WIMLIB_ERR_PATH_DOES_NOT_EXIST;
	return do_iterate_dir_tree(wim, dentry, ctx->flags, ctx->cb, ctx->user_ctx);
}

/* API function documented in wimlib.h  */
WIMLIBAPI int
wimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *_path,
			int flags,
			wimlib_iterate_dir_tree_callback_t cb, void *user_ctx)
{
	tchar *path;
	int ret;

	if (flags & ~(WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE |
		      WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN |
		      WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED))
		return WIMLIB_ERR_INVALID_PARAM;

	path = canonicalize_wim_path(_path);
	if (path == NULL)
		return WIMLIB_ERR_NOMEM;
	struct image_iterate_dir_tree_ctx ctx = {
		.path = path,
		.flags = flags,
		.cb = cb,
		.user_ctx = user_ctx,
	};
	wim->private = &ctx;
	ret = for_image(wim, image, image_do_iterate_dir_tree);
	FREE(path);
	return ret;
}


49690e115082526d0b6bbe2573cce3c6e36bac47b0042b499f&scene=21#wechat_redirect)

**原文链接**

https://www.darkreading.com/cyber-risk/citrix-addresses-high-severity-flaw-in-netscaler-adc-and-gateway

题图：
Pexels
 License

****
**本文由奇安信编译，不代表奇安信观点。转载请注明“转自奇安信代码卫士 https://codesafe.qianxin.com”。**

![](https://mmbiz.qpic.cn/mmbiz_jpg/oBANLWYScMSf7nNLWrJL6dkJp7RB8Kl4zxU9ibnQjuvo4VoZ5ic9Q91K3WshWzqEybcroVEOQpgYfx1uYgwJhlFQ/640?wx_fmt=jpeg "")

![](https://mmbiz.qpic.cn/mmbiz_jpg/oBANLWYScMSN5sfviaCuvYQccJZlrr64sRlvcbdWjDic9mPQ8mBBFDCKP6VibiaNE1kDVuoIOiaIVRoTjSsSftGC8gw/640?wx_fmt=jpeg "")

**奇安信代码卫士 (codesafe)**

国内首个专注于软件开发安全的产品线。

   ![](https://mmbiz.qpic.cn/mmbiz_gif/oBANLWYScMQ5iciaeKS21icDIWSVd0M9zEhicFK0rbCJOrgpc09iaH6nvqvsIdckDfxH2K4tu9CvPJgSf7XhGHJwVyQ/640?wx_fmt=gif "")

觉得不错，就点个 “
在看
” 或 "
赞
” 吧~

#  【攻防实战】某行业hw-如何利用nday拿下n个靶标
原创 胡图图  攻防实战指南   2024-05-29 16:27

**点击上方蓝字关注我们**

原创声明

本文由[
攻防实战指南]原创，版权所有。未经本公众号书面授权，禁止任何形式的转载、摘编、复制或建立镜像。如需转载，请联系我们，违反上述声明者，我们将依法追究其法律责任
。

# 【序言】

上个月参加了某行业
HW，由于时间紧任务重，直接拿着
13页靶标就开始怼，在项目实施中，利用
nday拿下多个靶标，不出意外是第一，因为时间上的小插曲最后拿了第二，接下来简单分享下：

一、
**某靶标NC bsh.servlet.BshServlet RCE**

信息收集发现某靶标存在
bsh.servlet.BshServle RCE

![](https://mmbiz.qpic.cn/sz_mmbiz_png/CsyjOZ96XiaeOrBdlRibkRPicP7hv6bxASjN


, w7, w26
.L3868:
	orr	w0, w0, 33554432
	str	w0, [x6, 40]
	b	.L3778
.L3777:
	ldr	x0, [x29, 184]
	add	w5, w19, w27, lsr 1
	add	x5, x0, w5, sxtw 1
	ldrh	w0, [x5, 16]
	and	w5, w27, 1
	madd	w0, w0, w7, w26
	add	w0, w0, w5
	b	.L3868
.L3784:
	ldr	x3, [x0, w1, sxtw 3]
	add	w1, w1, 1
	ldr	x5, [x0, w1, sxtw 3]
	and	w1, w1, 65535
	ldrb	w5, [x5, 1]
	strb	w5, [x3]
	b	.L3783
.L3782:
	ldrb	w2, [x1, 1336]
	ldr	x1, [x29, 192]
	cbz	w2, .L3786
.L3789:
	strb	wzr, [x1, 60]
	b	.L3788
.L3786:
	ldr	w2, [x29, 180]
	cmp	w2, 1
	bne	.L3787
	mov	w2, 9
.L3869:
	strb	w2, [x1, 60]
.L3788:
	mov	w2, w23
	add	x1, x0, 24
	bl	sblk_xlc_prog_pages
.L3785:
	add	x0, x22, :lo12:.LANCHOR3
	ldrb	w1, [x0, 1336]
	cbz	w1, .L3794
	ldr	w0, [x29, 128]
	add	w23, w23, w0
	and	w23, w23, 65535
.L3795:
	add	x21, x21, :lo12:.LANCHOR0
	add	x22, x22, :lo12:.LANCHOR3
	ldr	x1, [x21, 3384]
	ldr	w0, [x1, 52]
	add	w0, w0, w23
	str	w0, [x1, 52]
	ldr	x1, [x29, 184]
	ldrh	w0, [x21, 5522]
	add	w23, w23, w0
	ldrh	w0, [x22, 1338]
	and	w23, w23, 65535
	strh	w23, [x21, 5522]
	ldrb	w1, [x1, 9]
	mul	w0, w0, w1
	cmp	w23, w0
	blt	.L3796
	ldr	x0, [x21, 1128]
	strh	wzr, [x0, 86]
.L3796:
	bl	gc_write_completed
	b	.L3733
.L3787:
	ldr	w2, [x29, 180]
	cmp	w2, 2
	bne	.L3789
	mov	w2, 13
	b	.L3869
.L3781:
	ldrb	w2, [x1, 1322]
	cbz	w2, .L3807
	ldrb	w1, [x1, 1323]
	cbnz	w1, .L3791
.L3790:
	ldr	w2, [x29, 176]
	sub	w2, w2, #1
.L3792:
	cmp	w1, w2
	bge	.L3870
	ldr	x3, [x0, w1, s


 handle_reboot_runtime(self, msg: dmsg.RebootRuntime):
        self.msg_log.info("la_be received dmsg.RebootRuntime")

    @route(dmsg.SHProcessCreate, _DTBL)
    def handle_sh_proc_crate(self, msg: dmsg.SHProcessCreate):
        self.msg_log.info("In Transport Test Mode: Sending SHProcessCreate directly to local services.")
        self.ls_queue.send(msg.serialize())

    @route(dmsg.SHChannelsUp, _DTBL)
    def handle_sh_channels_up(self, msg: dmsg.SHChannelsUp):
        self.to_overlaynet_log.info("la_be recv SHChannelsUp - m5.1")
        self.to_overlaynet_log.info("la_be sent SHChannelsUp to OverlayNet be - m5.2")

    @route(dmsg.LAChannelsInfo, _DTBL)
    def handle_la_channels_info(self, msg: dmsg.LAChannelsInfo):
        # Wait for the LAChannelsInfo Message to be sent
        # The LAChannelsInfo gave us the serialized descriptor of
        # global services channel, so now we can attach to that channel.
        if self.is_primary and (not self.transport_test_env):
            self.gs_channel = Channel.attach(B64.from_str(msg.gs_cd).decode())
            self.gs_queue = Connection(outbound_initializer=self.gs_channel, policy=POLICY_INFRASTRUCTURE)
            self.msg_log.debug(f"Primary la_be created gs_queue: {self.gs_queue}")

        # Forward the message to my leaves
        self.forward_to_leaves(msg)

        # Forward the LAChannelsInfo Message to Local Services
        self.ls_queue.send(msg.serialize())
        self.msg_log.info("la_be sent LAChannelsInfo to ls - m5.3")

    @route(dmsg.TAUp, _DTBL)
    def handle_ta_up(self, msg: dmsg.TAUp):
        self._state = BackendState.TA_UP
        self.to_overlaynet_log.info("la_be recvd Ping response from TA - m8.1")
        if not self.is_primary:
            self._state = BackendState.BACKEND_UP
            self.to_overlaynet_log.info("non-primary backend node is up")

    @route(dmsg.GSIsUp, _DTBL)
    def handle_gs_is_up(self, msg: dmsg.GSIsUp):
        self.to_overlaynet_log.info("la_be received GSIsUp ping - m12.1")
        self._state = BackendState.BACKEND_UP

    @route(dmsg.GSHalted, _DTBL)
    def handle_gs_halted(self, msg: dmsg.GSHalted):
        self.to_overlaynet_log.info("m6.1 primary la_be received GSHalted")

    @route(dmsg.TAHalted, _DTBL)
    def handle_ta_halted(self, msg: dmsg.TAHalted):
        self.to_overlaynet_log.info("m10.1 la_be received TAHalted")
        self.to_overlaynet_log.info("m10.2 la_be forwarded TAHalted to FE")

    @route(dmsg.SHHaltBE, _DTBL)
    def handle_sh_halt_be(self, msg: dmsg.SHHaltBE):
        self.to_overlaynet_log.info("m12 la_be received SHHaltBE")

    @route(dmsg.SHProcessExit, _DTBL)
    def handle_sh_process_exit(self, msg: dmsg.SHProcessExit):
        pass

    @route(dmsg.SHProcessCreateResponse, _DTBL)
    def handle_sh_proc_create_response(self, msg: dmsg.SHProcessCreateResponse):
        pass


 [25.04] DIGIT THREE (NU) × [25.04] RIGHT PARENTHESIS (CP_CP30) × [30.02] CIRCLED PLUS (AI_AL) × [30.01] LEFT PARENTHESIS (OP_OP30) × [14.0] MINUS SIGN (PR) × [25.01] DIGIT FOUR (NU) × [25.03] COMMA (IS) × [25.04] DIGIT FIVE (NU) × [25.04] RIGHT PARENTHESIS (CP_CP30) × [30.02] CIRCLED MINUS (AL) × [30.01] LEFT PARENTHESIS (OP_OP30) × [14.0] DIGIT SIX (NU) × [25.03] COMMA (IS) × [25.04] DIGIT SEVEN (NU) × [25.04] RIGHT PARENTHESIS (CP_CP30) ÷ [0.3]
× 007B × 0030 × 002C × 0031 × 007D × 002B × 007B × 0032 × 002C × 0033 × 007D ÷ 2295 × 007B × 2212 × 0034 × 002C × 0035 × 007D ÷ 2296 × 007B × 0036 × 002C × 0037 × 007D ÷	#  × [0.3] LEFT CURLY BRACKET (OP_OP30) × [14.0] DIGIT ZERO (NU) × [25.03] COMMA (IS) × [25.04] DIGIT ONE (NU) × [25.04] RIGHT CURLY BRACKET (CL) × [25.05] PLUS SIGN (PR) × [25.01] LEFT CURLY BRACKET (OP_OP30) × [14.0] DIGIT TWO (NU) × [25.03] COMMA (IS) × [25.04] DIGIT THREE (NU) × [25.04] RIGHT CURLY BRACKET (CL) ÷ [999.0] CIRCLED PLUS (AI_AL) × [30.01] LEFT CURLY BRACKET (OP_OP30) × [14.0] MINUS SIGN (PR) × [25.01] DIGIT FOUR (NU) × [25.03] COMMA (IS) × [25.04] DIGIT FIVE (NU) × [25.04] RIGHT CURLY BRACKET (CL) ÷ [999.0] CIRCLED MINUS (AL) × [30.01] LEFT CURLY BRACKET (OP_OP30) × [14.0] DIGIT SIX (NU) × [25.03] COMMA (IS) × [25.04] DIGIT SEVEN (NU) × [25.04] RIGHT CURLY BRACKET (CL) ÷ [0.3]
× 0061 × 0062 ÷	#  × [0.3] LATIN SMALL LETTER A (AL) × [28.0] LATIN SMALL LETTER B (AL) ÷ [0.3]
× 0061 × 0062 × 0020 ÷	#  × [0.3] LATIN SMALL LETTER A (AL) × [28.0] LATIN SMALL LETTER B (AL) × [7.01] SPACE (SP) ÷ [0.3]
× 0061 × 0062 × 0020 ÷ 0063 ÷	#  × [0.3] LATIN SMALL LETTER A (AL) × [28.0] LATIN SMALL LETTER B (AL) × [7.01] SPACE (SP) ÷ [18.0] LATIN SMALL LETTER C (AL) ÷ [0.3]
× 0061 ÷ 307E ÷	#  × [0.3] LATIN SMALL LETTER A (AL) ÷ [999.0] HIRAGANA LETTER MA (ID) ÷ [0.3]
× 0939 × 093F × 0928 × 094D × 0926 × 0940 × 0020 ÷	#  × [0.3] DEVANAGARI LETTER HA (AL)


}

void POA_CORBA_ValueBoxDef::_interface_skel (
    TAO_ServerRequest &_tao_server_request,
    void * _tao_object_reference,
    void * /* Servant_Upcall */,
    CORBA::Environment &ACE_TRY_ENV
  )
{
  POA_CORBA_ValueBoxDef *_tao_impl = (POA_CORBA_ValueBoxDef *) _tao_object_reference;
  CORBA_InterfaceDef_ptr _tao_retval = 0;
  CORBA::Boolean _tao_result = 0;

  TAO_IFR_Client_Adapter *_tao_adapter =
    ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
        TAO_ORB_Core::ifr_client_adapter_name ()
      );

  if (_tao_adapter == 0)
    {
      ACE_THROW (CORBA::INTF_REPOS ());
    }

  ACE_TRY
    {
      _tao_retval = _tao_impl->_get_interface (ACE_TRY_ENV);
      ACE_TRY_CHECK;

      _tao_server_request.init_reply ();

      TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();

      _tao_result =
        _tao_adapter->interfacedef_cdr_insert (
            _tao_out,
            _tao_retval
          );
    }
  ACE_CATCHALL
    {
      _tao_adapter->dispose (_tao_retval);
    }
  ACE_ENDTRY;

  if (_tao_result == 0)
    {
      ACE_THROW (CORBA::MARSHAL ());
    }
}

CORBA::Boolean POA_CORBA_ValueBoxDef::_is_a (
    const char* value,
    CORBA::Environment &ACE_TRY_ENV
  )
{
  const char *base_id = CORBA::_tc_Object->id (ACE_TRY_ENV);
  ACE_CHECK_RETURN (0);

  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/ValueBoxDef:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/TypedefDef:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Contained:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/IDLType:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/IRObject:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, base_id)))
      return 1;
    else
      return 0;
}

void* POA_CORBA_ValueBoxDef::_downcast (
    const char* logical_type_id
  )
{
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/ValueBoxDef:1.0") == 0)
    return ACE_static_cast (POA_CORBA_ValueBoxDef_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/TypedefDef:1.0") == 0)
    return ACE_static_cast (POA_CORBA_TypedefDef_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Contained:1.0") == 0)
    return ACE_static_cast (POA_CORBA_Contained_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/IDLType:1.0") == 0)
    return ACE_static_cast (POA_CORBA_IDLType_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/IRObject:1.0") == 0)
    return ACE_static_cast (POA_CORBA_IRObject_ptr, this);
  if (ACE_O


	path_len := (len(control) - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE
	//! The internal pubkey (x-only, so no Y coordinate parity).
	p := control[1:TAPROOT_CONTROL_BASE_SIZE]
	//! The output pubkey (taken from the scriptPubKey).
	q := program //const XOnlyPubKey q{uint256(program)};
	// Compute the tapleaf hash.

	sha := btc.Hasher(btc.HASHER_TAPLEAF)
	sha.Write([]byte{control[0] & TAPROOT_LEAF_MASK})
	btc.WriteVlen(sha, uint64(len(script)))
	sha.Write(script)
	*tapleaf_hash = sha.Sum(nil)

	// Compute the Merkle root from the leaf and the provided path.
	k := *tapleaf_hash
	for i := 0; i < path_len; i++ {
		ss_branch := btc.Hasher(btc.HASHER_TAPBRANCH)
		tmp := TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE*i
		node := control[tmp : tmp+TAPROOT_CONTROL_NODE_SIZE]

		if lexicographical_compare(k, node) {
			ss_branch.Write(k)
			ss_branch.Write(node)
		} else {
			ss_branch.Write(node)
			ss_branch.Write(k)
		}
		k = ss_branch.Sum(nil)
	}

	// Compute the tweak from the Merkle root and the internal pubkey.
	sha = btc.Hasher(btc.HASHER_TAPTWEAK)
	sha.Write(p)
	sha.Write(k)
	k = sha.Sum(nil)
	// Verify that the output pubkey matches the tweaked internal pubkey, after correcting for parity.
	return btc.CheckPayToContract(q, p, k, (control[0]&1) != 0)
}
package btc

import (
	"errors"
	"encoding/hex"
	"github.com/piotrnar/gocoin/lib/secp256k1"
)

type PublicKey struct {
	secp256k1.XY
}

type Signature struct {
	secp256k1.Signature
	HashType byte
}

func NewPublicKey(buf []byte) (res *PublicKey, e error) {
	res = new(PublicKey)
	if !res.XY.ParsePubkey(buf) {
		e = errors.New("NewPublicKey: Unknown format: "+hex.EncodeToString(buf[:]))
		res = nil
	}
	return
}

func NewSignature(buf []byte) (*Signature, error) {
	sig := new(Signature)
	le := sig.ParseBytes(buf)
	if le < 0 {
		return nil, errors.New("NewSignature: ParseBytes error")
	}
	if le<len(buf) {
		sig.HashType = buf[len(buf)-1]
	}
	return sig, nil
}

// RecoverPublicKey recovers the public key from a signature.
func (sig *Signature) RecoverPublicKey(msg []byte, recid int) (key *PublicKey) {
	key = new(PublicKey)
	if !secp256k1.RecoverPublicKey(sig.R.Bytes(), sig.S.Bytes(), msg, recid, &key.XY) {
		key = nil
	}
	return
}

func (sig *Signature) IsLowS() bool {
	return sig.S.Cmp(&secp256k1.TheCurve.HalfOrder.Int)<1
}

// Bytes returns a serialized canoncal signature followed by a hash type.
func (sig *Signature) Bytes() []byte {
	return append(sig.Signature.Bytes(), sig.Has


es.CassandraRid, out cosmosElement))
                    {
                        throw new InvalidOperationException($"Underlying object does not have an '{FieldNames.Rid}' or '{FieldNames.CassandraRid}' field.");
                    }
                }

                if (!(cosmosElement is CosmosString cosmosString))
                {
                    throw new InvalidOperationException($"'{FieldNames.Rid}' or ' {FieldNames.CassandraRid} ' field.g.");
                }

                return cosmosString.Value;
            }
        }

        /// <summary>
        /// Gets the order by items from the document.
        /// </summary>
        public IReadOnlyList<OrderByItem> OrderByItems => this.orderByItems;

        /// <summary>
        /// Gets the actual document.
        /// </summary>
        public CosmosElement Payload
        {
            get
            {
                if (!this.cosmosObject.TryGetValue(FieldNames.Payload, out CosmosElement cosmosElement))
                {
                    return CosmosUndefined.Create();
                }

                return cosmosElement;
            }
        }

        private static IReadOnlyList<OrderByItem> GetOrderByItems(CosmosObject cosmosObject)
        {
            if (!cosmosObject.TryGetValue(FieldNames.OrderByItems, out CosmosElement cosmosElement))
            {
                throw new InvalidOperationException($"Underlying object does not have an 'orderByItems' field.");
            }

            if (!(cosmosElement is CosmosArray cosmosArray))
            {
                throw new InvalidOperationException($"orderByItems field was not an array.");
            }

            List<OrderByItem> orderByItems = new List<OrderByItem>(cosmosArray.Count);
            foreach (CosmosElement orderByItem in cosmosArray)
            {
                orderByItems.Add(new OrderByItem(orderByItem));
            }

            return orderByItems;
        }

        private static class FieldNames
        {
            public const string OrderByItems = "orderByItems";

            public const string Payload = "payload";

            public const string Rid = "_rid";

            public const string CassandraRid = "__sys_rid";
        }
    }
}


latexDotchart <-
  function(data, labels, groups = NULL, gdata = NA,
           xlab = "", auxdata, auxgdata=NULL, auxtitle,
           w=4, h=4, margin, lines = TRUE, dotsize = .075, size='small',
           size.labels = 'small', size.group.labels = 'normalsize',
           ttlabels = FALSE, sort.=TRUE, xaxis=TRUE, lcolor='gray',
           ...)
{
  txt <- function(x, y, s, size=NULL, just=c('c','l','r'), tt=FALSE) {
    just <- match.arg(just)
    s <- latexTranslate(s)
    n <- max(length(x), length(y), length(s))
    x <- rep(x, length.out=n)
    y <- rep(y, length.out=n)
    s <- rep(s, length.out=n)
    z <- character(n)
    if(tt) s <- paste('\\texttt{', s, '}', sep='')
    if(length(size)) s <- paste('\\', size, ' ', s, sep='')
    for(i in 1:n)
      z[i] <- sprintf('\\put(%g,%g){\\makebox(.001,.001)[%s]{%s}}',
                      x[i], y[i], just, s[i])
    z
  }
  ln <- function(x1, y1, x2, y2, color='black') {
    n <- max(length(x1), length(x2), length(y1), length(y2))
    x1 <- rep(x1, length.out=n)
    y1 <- rep(y1, length.out=n)
    x2 <- rep(x2, length.out=n)
    y2 <- rep(y2, length.out=n)
    z <- character(n)
    for(i in 1:n)
      z[i] <- if(x1[i] == x2[i])
        sprintf('\\put(%g,%g){\\line(0,%g){%g}}', x1[i], y1[i],
                1*(y2[i] >= y1[i]) - 1*(y2[i] < y1[i]), abs(y2[i]-y1[i]))
    else if(y1[i] == y2[i])
      sprintf('\\put(%g,%g){\\line(%g,0){%g}}', x1[i], y1[i],
              1*(x2[i] >= x1[i]) - 1*(x2[i] < x1[i]), abs(x2[i]-x1[i]))
    else
        sprintf('\\drawline(%g,%g)(%g,%g)',
                      x1[i], y1[i], x2[i], y2[i])
    if(color != 'black')
      z <- c(if(color == 'gray') '\\color[gray]{0.8}' else
             sprintf('\\color{%s}', color),
             z, '\\color{black}')
    z
  }
  ## Approximate length in inches of longest char. string
  acl <- function(s) 0.09 * max(nchar(s))
  f <- sprintf

  if(size.labels == size) size.labels <- NULL
  if(size.group.labels == size) size.group.labels <- NULL

  z <- c('\\setlength{\\unitlength}{1in}',
         f('\\begin{picture}(%g,%g)', w, h),
         f('\\%s', size))

  ndata <- length(data)
  if(missing(labels)) {
    if(length(names(data)))
      labels <- names(data)
    else labels <- paste("#", seq(along = ndata))
  }
  else labels <- rep(as.character(labels), length = ndata)

  if(missing(groups)) {
    glabels <- NULL
    gdata <- NULL
    if(sort.) {
      ord <- order(-data)
      data <- data[ord]
      labels  <- labels[ord]
      if(! missing(auxdata)) auxdata <- auxdata[o


st: substmts.3,
            choice: substmts.4,
            anydata: substmts.5,
            anyxml: substmts.6,
            uses: substmts.7,
        }
    }
}

///
/// "data-def-stmt" / "case-stmt" / "action-stmt" / "notification-stmt".
///
#[derive(Debug, Clone, PartialEq, Getters)]
pub struct DataDefOrElse {
    /// "container" statement.
    container: Vec<ContainerStmt>,

    /// "leaf" statement.
    leaf: Vec<LeafStmt>,

    /// "leaf-list" statement.
    leaf_list: Vec<LeafListStmt>,

    /// "list" statement.
    list: Vec<ListStmt>,

    /// "choice" statement.
    choice: Vec<ChoiceStmt>,

    /// "anydata" statement.
    anydata: Vec<AnydataStmt>,

    /// "anyxml" statement.
    anyxml: Vec<AnyxmlStmt>,

    /// "uses" statement.
    uses: Vec<UsesStmt>,

    /// "case" statement.
    case: Vec<CaseStmt>,

    /// "action" statement.
    action: Vec<ActionStmt>,

    /// "notification" statement.
    notification: Vec<NotificationStmt>,
}

impl Selection for DataDefOrElse {
    /// Sub Statements.
    type SubStmts = (
        Vec<ContainerStmt>,
        Vec<LeafStmt>,
        Vec<LeafListStmt>,
        Vec<ListStmt>,
        Vec<ChoiceStmt>,
        Vec<AnydataStmt>,
        Vec<AnyxmlStmt>,
        Vec<UsesStmt>,
        Vec<CaseStmt>,
        Vec<ActionStmt>,
        Vec<NotificationStmt>,
    );

    /// Return list fo statement keyword.
    fn keywords() -> Vec<Keyword> {
        vec![
            ContainerStmt::keyword(),
            LeafStmt::keyword(),
            LeafListStmt::keyword(),
            ListStmt::keyword(),
            ChoiceStmt::keyword(),
            AnydataStmt::keyword(),
            AnyxmlStmt::keyword(),
            UsesStmt::keyword(),
            CaseStmt::keyword(),
            ActionStmt::keyword(),
            NotificationStmt::keyword(),
        ]
    }

    /// Constructor with empty substatements.
    fn new() -> Self
    where
        Self: Sized,
    {
        Self {
            container: Vec::new(),
            leaf: Vec::new(),
            leaf_list: Vec::new(),
            list: Vec::new(),
            choice: Vec::new(),
            anydata: Vec::new(),
            anyxml: Vec::new(),
            uses: Vec::new(),
            case: Vec::new(),
            action: Vec::new(),
            notification: Vec::new(),
        }
    }

    /// Constructor with tuple of substatements. Panic if it is not defined.
    fn new_with_substmts(substmts: Self::SubStmts) -> Self
    where
        Self: Sized,
    {
        Self {
            container: substmts.0,
            leaf: substmts.1,
            leaf_list: substmts.2,
            list: substmts.3,
            choice: substmts.4,
            anydata: substmts.5,
            anyxml: substmts.6,
            uses: substmts.7,
            case: substmts.8,
            action: substmts.9,
            notification: substmts.10,
        }
    }
}

///
/// "short-case-stmt" / "case-stmt".
///
#[derive(Debug, Clone, PartialEq, Getters)]
pub struct ShortCaseOrCaseStmt {
    /// "choice" statement.
    choice: Vec<ChoiceStmt>,

    /// "container" statement.
    container: Vec<ContainerStmt>,

    /// "leaf"


e, 5 | BRF_GRA },           //  7
	{ "pm-0.ic134",		0x8000, 0x828c1b0c, 5 | BRF_GRA },           //  8
	{ "pn-0.ic133",		0x8000, 0xd37939e0, 5 | BRF_GRA },           //  9
	{ "pc-0.ic114",		0x8000, 0x8f0aa1a7, 5 | BRF_GRA },           // 10
	{ "pd-0.ic113",		0x8000, 0x45681910, 5 | BRF_GRA },           // 11
	{ "pe-0.ic112",		0x8000, 0xa8eeabc8, 5 | BRF_GRA },           // 12
	{ "pf-0.ic111",		0x8000, 0xe59a2f27, 5 | BRF_GRA },           // 13

	{ "p5-0.ic44",		0x8000, 0x5c6c453c, 6 | BRF_GRA },           // 14 Background Layer 0 tiles
	{ "p4-0.ic45",		0x8000, 0x59d87a9a, 6 | BRF_GRA },           // 15
	{ "p3-0.ic46",		0x8000, 0x84884a2e, 6 | BRF_GRA },           // 16
	{ "p6-0.ic43",		0x8000, 0x8d637639, 6 | BRF_GRA },           // 17
	{ "p7-0.ic42",		0x8000, 0x71eec4e6, 6 | BRF_GRA },           // 18
	{ "p8-0.ic41",		0x8000, 0x7fc9704f, 6 | BRF_GRA },           // 19

	{ "po-0.ic131",		0x8000, 0x252976ae, 7 | BRF_GRA },           // 20 Sprite tiles
	{ "pp-0.ic130",		0x8000, 0xe6f1e8d5, 7 | BRF_GRA },           // 21
	{ "pq-0.ic129",		0x8000, 0x785381ed, 7 | BRF_GRA },           // 22
	{ "pr-0.ic128",		0x8000, 0x59754e3d, 7 | BRF_GRA },           // 23
	{ "pg-0.ic109",		0x8000, 0x4d977f33, 7 | BRF_GRA },           // 24
	{ "ph-0.ic108",		0x8000, 0x3f3b62a0, 7 | BRF_GRA },           // 25
	{ "pi-0.ic107",		0x8000, 0x76641ee3, 7 | BRF_GRA },           // 26
	{ "pj-0.ic106",		0x8000, 0x37671f36, 7 | BRF_GRA },           // 27

	{ "pt-0.ic59",		0x0100, 0xfed32888, 8 | BRF_GRA | BRF_OPT }, // 28 Priority Prom
};

STD_ROM_PICK(xsleenaba)
STD_ROM_FN(xsleenaba)

struct BurnDriverD BurnDrvXsleenaba = {
	"xsleenaba", "xsleena", NULL, NULL, "1987",
	"Xain'd Sleena (bootleg, bugfixed)\0", NULL, "bootleg", "Miscellaneous",
	NULL, NULL, NULL, NULL,
	BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_TECHNOS, GBF_HORSHOOT, 0,
	NULL, xsleenabaRomInfo, xsleenabaRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo,
	DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,
	256, 240,