);

          if (suffix == '+') timeout_given = 2; else timeout_given = 1;

          break;

      }

      case 'm': { /* mem limit 内存限制*/

          u8 suffix = 'M';

          if (mem_limit_given) FATAL("Multiple -m options not supported");
          mem_limit_given = 1;

          if (!strcmp(optarg, "none")) {

            mem_limit = 0;
            break;

          }

          if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
              optarg[0] == '-') FATAL("Bad syntax used for -m");

          switch (suffix) {

            case 'T': mem_limit *= 1024 * 1024; break;
            case 'G': mem_limit *= 1024; break;
            case 'k': mem_limit /= 1024; break;
            case 'M': break;

            default:  FATAL("Unsupported suffix or bad syntax for -m");

          }

          if (mem_limit < 5) FATAL("Dangerously low value of -m");

          if (sizeof(rlim_t) == 4 && mem_limit > 2000)
            FATAL("Value of -m out of range on 32-bit systems");

        }

        break;

      case 'd': /* skip deterministic */

        if (skip_deterministic) FATAL("Multiple -d options not supported");
        skip_deterministic = 1;
        use_splicing = 1;
        break;

      case 'B': /* load bitmap */

        /* This is a secret undocumented option! It is useful if you find
           an interesting test case during a normal fuzzing process, and want
           to mutate it without rediscovering any of the test cases already
           found during an earlier run.

           To use this mode, you need to point -B to the fuzz_bitmap produced
           by an earlier run for the exact same binary... and that's it.

           I only used this once or twice to get variants of a particular
           file, so I'm not making this an official setting. */

        if (in_bitmap) FATAL("Multiple -B options not supported");

        in_bitmap = optarg;
        read_bitmap(in_bitmap);
        break;

      case 'C': /* crash mode */

        if (crash_mode) FATAL("Multiple -C options not supported");
        crash_mode = FAULT_CRASH;
        break;

      case 'n': /* dumb mode */

        if (dumb_mode) FATAL("Multiple -n options not supported");
        if (getenv("AFL_DUMB_FORKSRV")) dumb_mode = 2; else dumb_mode = 1;

        break;

      case 'T': /* banner */

        if (use_banner) FATAL("Multiple -T options not supported");
        use_banner = optarg;
        break;

      case 'Q': /* QEMU mode 这个模式是用于没有源码的情况下进行fuzz*/

        if (qemu_mode) FATAL("Multiple -Q options not supported");
        qemu_mode = 1;

        if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;

        break;

      default:

        usage(argv[0]);

    }

  if (optind == argc || !in_dir || !out_dir) usage(argv[0]);
//设置信号句柄
  setup_signal_handlers();
//检测asan选项
  check_asan_opts();

  if (sync_id) fix_up_sync();
//检查in out文件夹是否相同
  if (!strcmp(in_dir, out_dir))
    FATAL("Input and output directories can't be the same");

//设置环境变量
  if (dumb_mode) {

    if (crash_mode) FATAL("-C and -n are mutually exclusive");
    if (qemu_mode)  FATAL("-Q and -n are mutually exclusive");

  }

  if (getenv("AFL_NO_FORKSRV"))    no_forkserver    = 1;
  if (getenv("AFL_NO_CPU_RED"))    no_cpu_meter_red = 1;
  if (getenv("AFL_NO_ARITH"))      no_arith         = 1;
  if (getenv("AFL_SHUFFLE_QUEUE")) shuffle_queue    = 1;
  if (getenv("AFL_FAST_CAL"))      fast_cal         = 1;

  if (getenv("AFL_HANG_TMOUT")) {
    hang_tmout = atoi(getenv("AFL_HANG_TMOUT"));
    if (!hang_tmout) FATAL("Invalid value of AFL_HANG_TMOUT");
  }

  if (dumb_mode == 2 && no_forkserver)
    FATAL("AFL_DUMB_FORKSRV and AFL_NO_FORKSRV are mutually exclusive");

  if (getenv("AFL_PRELOAD")) {
    setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
    setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
  }

  if (getenv("AFL_LD_PRELOAD"))
    FATAL("Use AFL_PRELOAD instead of AFL_LD_PRELOAD");

  save_cmdline(argc, argv);

  fix_up_banner(argv[optind]);

  check_if_tty();

//获取cpu逻辑核数
  get_core_count();
//尝试绑定空闲cpu
#ifdef HAVE_AFFINITY
  bind_to_free_cpu();
#endif /* HAVE_AFFINITY */
//确保 core dump 不发生
  check_crash_handling();
//cpu的调度管理
  check_cpu_governor();

  setup_post();
  //创建共享内存 && 各种覆盖状态
  setup_shm();
  //初始化统计计数桶
  init_count_class16();
//设置文件夹；主要是out目录的相关操作
  setup_dirs_fds();
//read测试用例，读取种子
  read_testcases();
//自动加载字典
  load_auto();

  pivot_inputs();
//加载用户通过-x指定的字典
  if (extras_dir) load_extras(extras_dir);

  if (!timeout_given)


 DEFAULT.domain)
      .appendEncodedPath(UNIVERSAL_AUTHORIZE_PATH)
      .appendQueryParameter(CLIENT_ID_PARAM, clientId)
      .appendQueryParameter(RESPONSE_TYPE_PARAM, responseType.lowercase(Locale.US))
      .appendQueryParameter(REDIRECT_PARAM, redirectUri)
      .appendQueryParameter(SCOPE_PARAM, scopes)
      .appendQueryParameter(SDK_VERSION_PARAM, BuildConfig.VERSION_NAME)
      .appendQueryParameter(PLATFORM_PARAM, "android")
    return builder.build()
  }

  /** Gets the endpoint host used to hit the Uber API. */
  fun getEndpointHost(): String = "${HTTPS.scheme}://${API.subDomain}.${DEFAULT.domain}"

  /** Gets the login host used to sign in to the Uber API. */
  fun getAuthHost(): String = "${HTTPS.scheme}://${AUTH.subDomain}.${DEFAULT.domain}"

  const val CLIENT_ID_PARAM = "client_id"
  const val UNIVERSAL_AUTHORIZE_PATH = "oauth/v2/universal/authorize"
  const val AUTHORIZE_PATH = "oauth/v2/authorize"
  const val REDIRECT_PARAM = "redirect_uri"
  const val RESPONSE_TYPE_PARAM = "response_type"
  const val SCOPE_PARAM = "scope"
  const val PLATFORM_PARAM = "sdk"
  const val SDK_VERSION_PARAM = "sdk_version"
  const val CODE_CHALLENGE_PARAM = "code_challenge"
  const val REQUEST_URI = "request_uri"
  const val CODE_CHALLENGE_METHOD = "code_challenge_method"
  const val CODE_CHALLENGE_METHOD_VAL = "S256"
  const val PROMPT_PARAM = "prompt"
}
/**
 * Copyright (c) 2024 Uber Technologies, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.uber.sdk2.auth.request

/**
 * Represents the prompt parameter for the OAuth 2.0 authorization request.
 * https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest:~:text=select_account-,The,-Authorization%20Server%20SHOULD
 */
enum class Prompt(val value: String) {

  /** The user will be prompted to login and authorize the app. */
  LOGIN("login"),

  /** The user will be prompted to authorize the app. */
  CONSENT("consent")
}
/**
 * Copyright (c) 2024 Uber Technologies, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS


{3,200,9208}, -- Pattern: Swift Boots
	[7506] = {9,125,8344}, -- Gnomish Universal Remote
	[7560] = {9,125,9269}, -- Schematic: Gnomish Universal Remote
	[7561] = {9,165,9273}, -- Schematic: Goblin Jumper Cables
	[7613] = {3,155,3772}, -- Pattern: Green Leather Armor
	[7678] = {6,60,9513}, -- Recipe: Thistle Tea
	[7742] = {9,200,3971}, -- Schematic: Gnomish Cloaking Device
	[7967] = {2,215,9781}, -- Mithril Shield Spike
	[7969] = {2,215,9783}, -- Mithril Spurs
	[7975] = {2,210,9933}, -- Plans: Heavy Mithril Pants
	[7976] = {2,215,9939}, -- Plans: Mithril Shield Spike
	[7977] = {2,220,9942}, -- Plans: Mithril Scale Gloves
	[7978] = {2,160,9811}, -- Plans: Barbaric Iron Shoulders
	[7979] = {2,160,9813}, -- Plans: Barbaric Iron Breastplate
	[7980] = {2,175,9814}, -- Plans: Barbaric Iron Helm
	[7981] = {2,180,9818}, -- Plans: Barbaric Iron Boots
	[7982] = {2,185,9820}, -- Plans: Barbaric Iron Gloves
	[7983] = {2,220,9945}, -- Plans: Ornate Mithril Pants
	[7984] = {2,220,9950}, -- Plans: Ornate Mithril Gloves
	[7985] = {2,225,9952}, -- Plans: Ornate Mithril Shoulder
	[7986] = {2,240,9972}, -- Plans: Ornate Mithril Breastplate
	[7987] = {2,245,9980}, -- Plans: Ornate Mithril Helm
	[7988] = {2,245,9979}, -- Plans: Ornate Mithril Boots
	[7989] = {2,235,9964}, -- Plans: Mithril Spurs
	[7990] = {2,245,9970}, -- Plans: Heavy Mithril Helm
	[7991] = {2,235,9966}, -- Plans: Mithril Scale Shoulders
	[7992] = {2,220,9995}, -- Plans: Blue Glittering Axe
	[7993] = {2,240,10005}, -- Plans: Dazzling Mithril Rapier
	[7994] = {2,230,9957}, -- Plans: Orcish War Leggings
	[7995] = {2,215,9937}, -- Plans: Mithril Scale Bracers
	[8028] = {2,245,10009}, -- Plans: Runed Mithril Hammer
	[8029] = {2,225,9997}, -- Plans: Wicked Mithril Blade
	[8030] = {2,255,10013}, -- Plans: Ebon Shiv
	[8384] = {3,200,10490}, -- Pattern: Comfortable Leather Hat
	[8385] = {3,205,10509}, -- Pattern: Turtle Scale Gloves
	[8386] = {3,215,10520}, -- Pattern: Big Voodoo Robe
	[8387] = {3,220,10531}, -- Pattern: Big Voodoo Mask
	[8388] = {3,230,10550}, -- Pattern: Nightscape Cloak
	[8389] = {3,240,10560}, -- Pattern: Big Voodoo Pants
	[8390] = {3,240,10562}, -- Pattern: Big Voodoo Cloak
	[8395] = {3,220,10525}, -- Pattern: Tough Scorpid Breastplate
	[8397] = {3,220,10533}, -- Pattern: Tough Scorpid Bracers
	[8398] = {3,225,10542}, -- Pattern: Tough


GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices
	/// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier
	typedef mat<3, 2, double, highp>	highp_dmat3x2;

	/// @}
}//namespace glm
/// @ref ext_vector_int3_sized
/// @file glm/ext/vector_int3_sized.hpp
///
/// @defgroup ext_vector_int3_sized GLM_EXT_vector_int3_sized
/// @ingroup ext
///
/// Exposes sized signed integer vector of 3 components type.
///
/// Include <glm/ext/vector_int3_sized.hpp> to use the features of this extension.
///
/// @see ext_scalar_int_sized
/// @see ext_vector_uint3_sized

#pragma once

#include "../ext/vector_int3.hpp"
#include "../ext/scalar_int_sized.hpp"

#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
#	pragma message("GLM: GLM_EXT_vector_int3_sized extension included")
#endif

namespace glm
{
	/// @addtogroup ext_vector_int3_sized
	/// @{

	/// 8 bit signed integer vector of 3 components type.
	///
	/// @see ext_vector_int3_sized
	typedef vec<3, int8, defaultp>		i8vec3;

	/// 16 bit signed integer vector of 3 components type.
	///
	/// @see ext_vector_int3_sized
	typedef vec<3, int16, defaultp>		i16vec3;

	/// 32 bit signed integer vector of 3 components type.
	///
	/// @see ext_vector_int3_sized
	typedef vec<3, int32, defaultp>		i32vec3;

	/// 64 bit signed integer vector of 3 components type.
	///
	/// @see ext_vector_int3_sized
	typedef vec<3, int64, defaultp>		i64vec3;

	/// @}
}//namespace glm
/// @ref ext_quaternion_geometric
/// @file glm/ext/quaternion_geometric.hpp
///
/// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric
/// @ingroup ext
///
/// Provides geometric functions for quaternion types
///
/// Include <glm/ext/quaternion_geometric.hpp> to use the features of this extension.
///
/// @see core_func_geometric
/// @see ext_quaternion_float
/// @see ext_quaternion_double

#pragma once

// Dependency:
#include "../geometric.hpp"
#include "../exponential.hpp"
#include "../ext/vector_relational.hpp"

#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
#	pragma message("GLM: GLM_EXT_quaternion_geometric extension included")
#endif

namespace glm
{
	/// @addtogroup ext_quaternion_geometric
	/// @{

	/// Returns the norm of a quaternions
	///
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see ext_quaternion_geometric
	template<typename T, qualifier Q>
	GLM_FUNC_DECL T length(qua<T, Q> const& q);

	/// Returns the normalized quaternion.
	///
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see ext_quaternion_geometric
	template<typename T, qualifier Q>
	GLM_FUNC_DECL qua<T, Q> normalize(qua<T, Q> const& q);

	/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
	///
	/// @tparam T Floating-point scalar types.
	/// @tparam Q Val


).isEqualTo(2)
    }

    @Transactional
    @Rollback
    @Test
    @Tag(TestTags.RESTDOC)
    fun `Can edit user by userId in path in Group`() {
        val group = Group(id = randomUUID(), slug = "slug", name = "group-name", gitlabId = 100L)
        groupsRepository.save(group)

        this.mockUserAuthentication(groupIdLevelMap = mutableMapOf(group.id to AccessLevel.OWNER))

        val gitlabUserInGroup1 = GitlabUserInGroup(mainAccount.gitlabId!!, "url", mainAccount.name, mainAccount.username)
        val gitlabUserInGroup2 =
            GitlabUserInGroup(mainAccount2.gitlabId!!, "url", mainAccount2.name, mainAccount2.username)

        every { restClient.adminGetGroupMembers(any()) } answers {
            listOf(gitlabUserInGroup1, gitlabUserInGroup2)
        }

        val url = "$rootUrl/${group.id}/users/${mainAccount2.id}?access_level=DEVELOPER"

        val result = this.performPut(url, mainToken)
            .expectOk()
            .document(
                "group-edit-user",
                requestParameters(
                    parameterWithName("access_level").optional().description("Access level for the user")
                ),
                responseFields(usersInGroupResponseFields("[]."))
            )
            .returnsList(UserInGroupDto::class.java)

        assertThat(result.size).isEqualTo(2)
    }

    @Transactional
    @Rollback
    @Test
    @Tag(TestTags.RESTDOC)
    fun `Can delete user by userId in path from Group`() {
        val group = Group(id = randomUUID(), slug = "slug", name = "group-name", gitlabId = 100L)
        groupsRepository.save(group)

        this.mockUserAuthentication(groupIdLevelMap = mutableMapOf(group.id to AccessLevel.OWNER))

        val gitlabUserInGroup1 = GitlabUserInGroup(mainAccount.gitlabId!!, "url", mainAccount.name, mainAccount.username)

        every { restClient.adminGetGroupMembers(any()) } answers {
            listOf(gitlabUserInGroup1)
        }

        val url = "$rootUrl/${group.id}/users/${mainAccount2.id}"

        val result = this.performDelete(url, mainToken)
            .expectOk()
            .document(
                "group-delete-user",
                responseFields(usersInGroupResponseFields("[]."))
            )
            .returnsList(UserInGroupDto::class.java)

        assertThat(result.size).isEqualTo(1)
    }

    fun groupCreateRequestFields(): List<FieldDescriptor> {
        return listOf(
            fieldWithPath("path").type(JsonFieldType.STRING).description("Path of group"),
            fieldWithPath("namespace").type(JsonFieldType.STRING).description("Namespace of group"),
            fieldWithPath("name").type(JsonFieldType.STRING).description("Name of Group"),
            fieldWithPath("visibility").type(JsonFieldType.STRING)
                .description("Visibility level: ${VisibilityScope.values()}")
        )
    }

    fun groupUpdateRequestFields(): List<FieldDescriptor> {
        return listOf(
            fieldWithPath("path").type(JsonFieldType.STRING).description("Path of group"),
            fieldWithPath("name").type(JsonFieldType.STRING).description("Name of Group")
        )
    }

    fun groupResponseFields(prefix: String = ""): List<FieldDescriptor> {
        return listOf(
            fieldWithPath(prefix + "id").type(JsonFieldType.STRING).description("Group id"),
            fieldWithPath(prefix + "gitlab_id").type(JsonFieldType.NUMBER).description("Gitlab group id"),
            fieldWithPath(prefix + "name").type(JsonFieldType.STRING).description("Group name")
        )
    }

    private fun groupsOfUserResponseFields(prefix: String = ""


Type.QByteArray),
    QVariant.of(data.objectName.serializeString(StringSerializer.UTF8), QtType.QByteArray)
  )

  override fun deserialize(data: QVariantList) = SignalProxyMessage.InitRequest(
    data[0].value<ByteBuffer?>().deserializeString(StringSerializer.UTF8) ?: "",
    data[1].value<ByteBuffer?>().deserializeString(StringSerializer.UTF8) ?: ""
  )
}
/*
 * Quasseldroid - Quassel client for Android
 *
 * Copyright (c) 2020 Janne Mareike Koschinski
 * Copyright (c) 2020 The Quassel Project
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 3 as published
 * by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package de.kuschku.libquassel.protocol.primitive.serializer

import de.kuschku.libquassel.quassel.QuasselFeatures
import de.kuschku.libquassel.util.nio.ChainedByteBuffer
import org.threeten.bp.*
import org.threeten.bp.temporal.ChronoField
import org.threeten.bp.temporal.JulianFields
import org.threeten.bp.temporal.Temporal
import java.nio.ByteBuffer

object DateTimeSerializer : Serializer<Temporal> {
  enum class TimeSpec(val value: Byte) {
    LocalUnknown(-1),
    LocalStandard(0),
    LocalDST(1),
    UTC(2),
    OffsetFromUTC(3);

    companion object {
      private val map = TimeSpec.values().associateBy(TimeSpec::value)
      fun of(type: Byte) = map[type]
    }
  }

  override fun serialize(buffer: ChainedByteBuffer, data: Temporal, features: QuasselFeatures) {
    when (data) {
      is LocalDateTime  -> {
        IntSerializer.serialize(buffer, data.getLong(JulianFields.JULIAN_DAY).toInt(), features)
        IntSerializer.serialize(buffer, data.getLong(ChronoField.MILLI_OF_DAY).toInt(), features)
        ByteSerializer.serialize(buffer, TimeSpec.LocalUnknown.value, features)
      }
      is OffsetDateTime -> {
        IntSerializer.serialize(buffer, data.getLong(JulianFields.JULIAN_DAY).toInt(), features)
        IntSerializer.serialize(buffer, data.getLong(ChronoField.MILLI_OF_DAY).toInt(), features)
        ByteSerializer.serialize(buffer, TimeSpec.OffsetFromUTC.value, features)
        IntSerializer.serialize(buffer, data.offset.totalSeconds, features)
      }
      is ZonedDateTime  -> {
        IntSerializer.serialize(buffer, data.getLong(JulianFields.JULIAN_DAY).toInt(), features)
        IntSerializer.serialize(buffer, data.getLong(ChronoField.MILLI_OF_DAY).toInt(), features)
        ByteSerializer.serialize(buffer, TimeSpec.OffsetFromUTC.value, features)
        IntSerializer.serialize(buffer, data.offset.totalSeconds, features)
      }
      is Instant        -> {
        val time = data.atOffset(ZoneOffset.UTC)
        IntSerializer.serialize(buffer, time.getLong(JulianFields.JULIAN_DAY).toInt(), features)
        IntSerializer.serialize(buffer, time.getLong(ChronoField.MILLI_OF_DAY).toInt(), features)
        ByteSerializer.serialize(buffer, TimeSpec.UTC.value, features)
      }
      else


\x1a\xe7w\xb9\xb4\x80\xb3\x1c\x05\x1e$\x81\
c\x8dF\x124\x1d\xa8\x8b@\xaa(:\x06?\x99\xb8\
\xff\x00\x9c\xf6\xdb\xe3\xff\x00\x01\x03h\x0f\xfd\x8d\x1d\xa3\
\xef\xa1\xbf\xdcY\xff\x00\x88\xdb\xee?\xfe/\x17\xdf\xf7\
k\xd8\xba%\xfb\xf8\x7f\xca\xe1\xcb_\xf4\xac\x87\xfe\xaf\
\xdftG\xeb\xbe\x87\xfd\x87\xfb\xda\xfb\xee\x0a\xf0\xeb\x9f\
r\xfc]#\xab\x87\x07\xfd\xf7\xfa\x93\xff\x00\x11\xed\xc1\
\xe5\xd2\x09x\xf4\x8c\xae\x1f_\xf7\xdf\x8f\xf8\xd7\xb7\x17\
\x81\xe9\x14\xbc:j\xf7\xbe\x93\xf5\xef~\xeb\xdd\x05{\
\x9e\xae\xa7\x0f\x93\xa4\xcb\xd0\xb0J\xcc]u.J\x91\
\xdbU\x92\xa6\x8a\xa2:\x9av:\x19\x1e\xcb,@\xf0\
A\xfe\x84}}\xc7|\xe5\xb6[\xee\xbbv\xe5\xb6]\
\xa96\x970\xc9\x13\x8ce$R\x8d\xc4\x11\xf0\x93\xc4\
\x11\xea:\x93y6\xeeK[\x8bK\x98\x8f\xea\xc6\xea\
\xc3\xedR\x08\xfec\xad\x90\xbf\xe1Ct\xb4\xd9\xa9>\
\x19\xf65\x1d\xd57\x16\xc7\xdd\xc9'\x9bR\xcf,\x15\
\xb8\xbe\xb9\xcaP\x13\x10/\x0a4 \xcf\xe4\xe6\xf7\x91\
G q\xf2\xe3\xfd\xdf2\xdcXo>\xf0\xec\x17T\
3${c\x12\xb4+\xae6\xbf\x8a^\xec\x12\x09\xd1\
\xa7\x1c\x14\x9c\x13\x9c\xf9\xfb\xec\xdb\xc7q\xb7{o\xba\
\xc5\xf0\x97\xbfL\xd6\xba[\xe9\x1d1\xc0S\xba\xbf2\
8\xd3\xadx1\x0d\xfa\x7f\xa7\x1c\xfb\xe9\xca\xf5\xcd\xcd\
\xc1x\xf5d]\x05\xf07\xbe\xfb\xcf\xa92\x1d\xd1\xb4\
(p\x14\x9b2\x9b']\x85\xc4I\x9c\xcb5\x0dv\
\xe6\xca\xe3 \x96j\xfal-4t\xb5*\xe9L\xd0\
\xb4M,\xad\x14ba\xa4\x91pN+\xfb\xbd\xf7\xbf\
\xf6\xbf\xd9\xaes\xb5\xe4\x9ea\xb6\xdcn7\x10b\xfa\
\x87\xb7\x8d\x1a;_\x19D\x91\x87/\x223\xb9\x8c\xac\
\xac\xb1\xab\x05\x8d\xd0\x96\x0c\xc1z\x9b=\xb4\xfb\xa4\xfb\
\x8d\xee\xff\x00(\xdcs\x96\xcb}\xb7\xda\xd87\x8a-\
\x96\xe1\xe4\x0frac\x1b\x95\xf0\xe3q\x1cbEh\
\xc39\xa9uj&\x91\xa8\x96J\xaaJ\x9a\x0a\xaa\x9a\
\x1a\xc8^\x9e\xae\x8ay\xa9*\xa0\x92\xc1\xe0\xa9\xa7\x91\
\xa1\x9e\x17\x00\x91\xae)P\xa9\xff\x00\x11\xef(\xf6\xed\
\xc2\xcfv\xdb\xec7]\xbaq.\xdfs\x0aK\x13\x8e\
\x0f\x1c\x8a\x1d\x18W4e \x8f\x91\xeb\x127]\xb2\
\xfbe\xdd7-\x9fs\xb70\xeeV\x97\x12C*\x1a\
U%\x89\xcaH\x86\x95\x15VR\x0d\x0d*:\xb0\xef\
\xe5I\x934?:zb\x83[\xaa\xeeI\xb7.\xde\
\x90,q\xc8\x92GU\xb62\xb5l\x93k\xe5a\xff\
\x00!\xbbi\xe5\xad\xa7\xe8\xc7\xde)}\xf8\xb6\xf1{\
\xf7v\xe6i\xca\x83\xf4\xdb\x86\xd9&I\x14\xd7\x7fo\
mP\x06\x1b\x13\x90A\xc5\x09<@\xeb(\xfe\xe4\x97\
\xe6\xcf\xef\x0f\xca\xd0\x06#\xeal\xf7\x08\xf0\x01\xae\x9b\
\x19\xe7\xa1'#0\xd6\xa35\x00p'\xad\xc2?\x96\
\xedw\xdbw\xe6\xec\xc5\x06t9O\x8f\xedUS\x1e\
\x84)QS\xb7~Cv\x5c\x90\xd4\xc95\xdaO\xda\
\xc6o\x8axc\x1c~\x97\x04Y\x10\x9cn\xfe\xed\xad\
\xc0\xb5\xcf5Yk4\x93k\x81\xe9AO\xd1\x91c\
\xfd\xa0\xb9\xa7\xa8$\x9c\xf5\xd4\xefz!\xd3=\xac\x94\
\xe13\x8f\xf7\xaa\xb7\xf9:\xbb?}a\xea\x08\xeb\xde\
\xfd\xd7\xba\xf7\xbfu\xee\xbeZ\xbf/\xbf\xec\xac\xfeP\
\xff\x00\xe2\xc4\xf7_\xfe\xfc\xad\xcd\xee7\xba\xff\x00r\
\xae\x7f\xe6\xa3\x7f\x84\xf5\xce\xeeg\xff\x00\x95\x97\x98\x7f\
\xe7\xba\x7f\xfa\xba\xfd\x17\x7fi\xfa#\xeb\xde\xfd\xd7\xba\
\xf7\xbfu\xee\xbd\xef\xdd{\xa1\xabl|k\xf9\x19\xbd\
\xb0X\xed\xd3\xb3:\x07\xba\xf7v\xd9\xcb\xc7$\xd8\x9d\
\xc5\xb6:\xaf}g\xb0Y8a\x9eZY\xa5\xc7e\
\xf1X*\xbc}lqU@\xf1\xb3G#\x05\x91\x19\
O \x8fo-\xbd\xc3\xa8d\x81\xca\x9f0\xa4\x8f\xf0\
tmo\xb0\xef\xb7p\xa5\xc5\xae\xcbw-\xbbpd\
\x86FS\x9aa\x82\x90r)\x83\xc7\xa7\xef\xf6P~\
Y\xff\x00\xde/|\x89\xff\x00\xd1)\xd9_\xfd\x8c\xfb\
\xb7\xd2\xdd\x7f\xca4\x9f\xef'\xfc\xdd=\xfdX\xe6_\
\xfag\xaf\xbf\xe7\x04\xbf\xf4\x07^\xff\x00e\x07\xe5\x9f\
\xfd\xe2\xf7\xc8\x9f\xfd\x12\x9d\x95\xff\x00\xd8\xcf\xbf}-\
\xd7\xfc\xa3I\xfe\xf2\x7f\xcd\xd7\xbf\xab\x1c\xcb\xff\x00L\
\xf5\xf7\xfc\xe0\x97\xfe\x80\xeb\xdf\xec\xa0\xfc\xb3\xff\x00\xbc\
^\xf9\x13\xff\x00\xa2S\xb2\xbf\xfb\x19\xf7\xef\xa5\xba\xff\
\x00\x94i?\xdeO\xf9\xba\xf7\xf5c\x99\x7f\xe9\x9e\xbe\
\xff\x00\x9c\x12\xff\x00\xd0\x1d{\xfd\x94\x1f\x96\x7f\xf7\x8b\
\xdf\x22\x7f\xf4JvW\xff\x00c>\xfd\xf4\xb7_\xf2\
\x8d'\xfb\xc9\xff\x007^\xfe\xacs/\xfd3\xd7\xdf\
\xf3\x82_\xfa\x03\xaf\x7f\xb2\x83\xf2\xcf\xfe\xf1{\xe4O\
\xfe\x89N\xca\xff\x00\xecg\xdf\xbe\x96\xeb\xfeQ\xa4\xff\
\x00y?\xe6\xeb\xdf\xd5\x8ee\xff\x00\xa6z\xfb\xfep\
K\xff\x00@u\xef\xf6P~Y\xff\x00\xde/|\x89\
\xff\x00\xd1)\xd9_\xfd\x8c\xfb\xf7\xd2\xdd\x7f\xca4\x9f\
\xef'\xfc\xdd{\xfa\xb1\xcc\xbf\xf4\xcf_\x7f\xce\x09\x7f\
\xe8\x0e\xbd\xfe\xca\x0f\xcb?\xfb\xc5\xef\x91?\xfa%;\
+\xff\x00\xb1\x9f~\xfa[\xaf\xf9F\x93\xfd\xe4\xff\x00\
\x9b\xaf\x7fV9\x97\xfe\x99\xeb\xef\xf9\xc1/\xfd\x01\xd7\
\xbf\xd9A\xf9g\xff\x00x\xbd\xf2'\xff\x00D\xa7e\
\x7f\xf63\xef\xdfKu\xff\x00(\xd2\x7f\xbc\x9f\xf3u\
\xef\xea\xc72\xff\x00\xd3=}\xff\x008%\xff\x00\xa0\
:?\x1f\xca\xe7\xe3/\xc9\x1d\xa1\xfc\xc1>)\xee]\
\xd9\xf1\xf3\xbb\xf6\xbe\xdc\xc3v\x9d\x05f_pn.\
\xa8\xdf\x98\x5c&*\x91q\xb94j\xac\x96W%\x80\
\xa6\xa


4451.749574, 1312444452.306143],
        "urls": {}
    }, {
        "eta": null,
        "expectations": [
            ["output", 2477406, 2498915.6146275494]
        ],
        "isFinished": true,
        "isStarted": true,
        "logs": [
            ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/WebKit%20Linux/builds/11461/steps/webkit_tests/logs/stdio"]
        ],
        "name": "webkit_tests",
        "results": [2, ["webkit_tests"]],
        "statistics": {},
        "step_number": 5,
        "text": ["webkit_tests", "2014 fixable", "(370 skipped)", "failed 1", "
", "", "box-shadow-clipped-slices.html", "", "
"],
        "times": [1312444452.306695, 1312444768.888266],
        "urls": {}
    }, {
        "eta": null,
        "expectations": [
            ["output", 2668845, 2672746.372363254]
        ],
        "isFinished": true,
        "isStarted": true,
        "logs": [
            ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/WebKit%20Linux/builds/11461/steps/archive_webkit_tests_results/logs/stdio"]
        ],
        "name": "dummy_perf_test_1",
        "results": [0, []],
        "statistics": {},
        "step_number": 6,
        "text": ["archived webkit_tests results"],
        "times": [1312444768.888746, 1312444781.444399],
        "urls": {
            "results": "http://dummyurl1"
        }
    }, {
        "eta": null,
        "expectations": [
            ["output", 210958, 208138.4965182993]
        ],
        "isFinished": true,
        "isStarted": true,
        "logs": [
            ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/WebKit%20Linux/builds/11461/steps/webkit_gpu_tests/logs/stdio"]
        ],
        "name": "webkit_gpu_tests",
        "results": [2, ["webkit_gpu_tests"]],
        "statistics": {},
        "step_number": 7,
        "text": ["webkit_gpu_tests", "148 fixable", "(24 skipped)", "failed 1", "
", "", "tiled-layer-recursion.html", "", "
"],
        "times": [1312444781.444903, 1312444966.856074],
        "urls": {}
    }, {
        "eta": null,
        "expectations": [
            ["output", 148825, 147822.1074277072]
        ],
        "isFinished": true,
        "isStarted": true,
        "logs": [
            ["stdio", "http://build.chromium.org/p/chromium.webkitbuilders/WebKit%20Linux/builds/11461/steps/archive_webkit_tests_gpu_results/logs/stdio"]
        ],
        "


 not be performed.

## admin-password

The password of the administrator account.

Type: String

Default: password

## security-filters-enabled

Whether to enable the default security filters for web authentication. If set to 'false', the web security filters will not be enabled.

Use this option if you intend to customize JIFA with an alternative authentication and authorization layer.

Default: true

## input-files

Local files to be analyzed, used only in `STANDALONE_WORKER` role.

Type: Path[]

Default: null
# 堆快照分析

## 介绍

堆快照（即 Heap Dump）分析是一种用于分析堆内存相关问题的技术手段。堆快照中包含某时刻 Java 应用中存在的对象、引用关系、类、线程调用栈等丰富的运行时信息。

使用堆快照分析功能，可以帮助开发者快速定位堆内存相关问题的根源，如内存泄漏。

## 视图

### 概况

此视图展示了堆快照的基本信息，如堆大小、对象数量、类数量。

### 泄漏检测

此视图展示了可能导致内存泄漏的对象。

### 支配树

此视图展示了堆中对象之间的支配关系。

### 类

此视图展示了类及其实例的信息，如对象数量、占用的堆内存大小。

### 线程

此视图展示了线程信息，如线程的调用栈。

### 类加载器

此视图展示了类加载器及其加载的类信息。

### 对象查询语言

此视图允许开发者使用 OQL 进行对象查询。

### GC 根对象

此视图将对象按照 GC Root 类型和 Java 对象类型进行分类。

### 堆外内存

此视图展示了 DirectByteBuffer 的信息，如容量。

### 重复类

此视图展示了重复类的信息，如引起类重复的类加载器以及对象数量。

### 不可达对象

此视图展示了不可达对象的信息，如类型、对象数量以及内存占用大小。

### 系统属性

此视图展示了应用使用的系统属性，即通过 `-Dkey=value` 或系统默认设置的属性。 # JFR 分析

## 介绍

性能剖析是一种分析应用程序性能的方法，可以改善应用性能、降低IT成本、提升用户体验。
Java Flight Recorder（简称JFR）是内建在Java种的性能剖析工具。
开启JFR后，可以从Java进程中持续收


return {
  'echasnovski/mini.nvim',
  event = 'VeryLazy',
  specs = {
    { 'nvim-tree/nvim-web-devicons', enabled = false, optional = true },
  },
  init = function()
    package.preload['nvim-web-devicons'] = function()
      require('mini.icons').mock_nvim_web_devicons()
      return package.loaded['nvim-web-devicons']
    end
  end,
  config = function()
    -- require('mini.comment').setup {}
    require('mini.ai').setup { mappings = {
      goto_left = '[',
      goto_right = ']',
    } }
    require('mini.icons').setup {
      style = 'glyph',
      file = {
        README = { glyph = '󰆈', hl = 'MiniIconsYellow' },
        ['README.md'] = { glyph = '󰆈', hl = 'MiniIconsYellow' },
      },
      filetype = {
        bash = { glyp


r line in lines {
        result.push(line?);
    }

    Ok(result)
}
<reponame>hinaria/arya<filename>src/arya/verify.rs
use {
    arya,
    arya::JsonError,
    arya::JsonStatus,
    arya::table::ComplexToken,
    arya::table::Token,
    arya::table::Transition,
};

#[derive(Debug, Clone, Copy, PartialEq)]
enum ValueType {
    Key,
    Array,
    Object,
}

/// a fast json syntax validator for utf8 sequences.
///
/// # remarks
///
/// this parser can continue even when an invalid character is attempted.
///
/// invocations to `update(<character>)` only update the state and validity of this parser if and only if the input
/// sequence would result in a valid json object.
///
/// if `character` would cause this json object to become invalid, `update()` will return an error but keep its state.
/// the next invocation of `update()` will operate as if the bad character had never been applied.
///
/// in that sense, you can continue to "test" a character for json validity multiple times until one is foudn.
///
/// # examples.
///
/// ```
/// # use arya::JsonVerifier;
/// #
/// # fn main() {
/// #
/// let mut json = JsonVerifier::new();
///
/// for character in r#"{ "name": "annie", "value": 1 }"#.bytes() {
///     println!(
///         "{} - {:?} - {:?}",
///         character as char,
///         json.update(character),
///         json.status());
/// }
///
/// //     { - Ok(()) - Continue
/// //       - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     n - Ok(()) - Continue
/// //     a - Ok(()) - Continue
/// //     m - Ok(()) - Continue
/// //     e - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     : - Ok(()) - Continue
/// //       - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     a - Ok(()) - Continue
/// //     n - Ok(()) - Continue
/// //     n - Ok(()) - Continue
/// //     i - Ok(()) - Continue
/// //     e - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     , - Ok(()) - Continue
/// //       - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     v - Ok(()) - Continue
/// //     a - Ok(()) - Continue
/// //     l - Ok(()) - Continue
/// //     u - Ok(()) - Continue
/// //     e - Ok(()) - Continue
/// //     " - Ok(()) - Continue
/// //     : - Ok(()) - Continue
/// //       - Ok(()) - Continue
/// //     1 - Ok(()) - Continue
/// //       - Ok(()) - Continue
/// //     } - Ok(()) - Valid
/// # }
/// ```
pub struct JsonVerifier {
    maximum: usize,
    state:   Token,
    stack:   Vec<ValueType>,

    length:  usize,
    last_ok: usize,
}

impl JsonVerifier {
    pub fn new() -> JsonVerifier {
        JsonVerifier::with_maximum_depth(std::usize::MAX)
    }

    pub fn with_maximum_depth(maximum_depth: usize) -> JsonVerifier {
        assert![maximum_depth > 0];

        JsonVerifier {
            stack:   vec![],
            state:   Token::Begin,
            maximum: maximum_depth,

            length:  0,
            last_ok: 0,
        }
    }

    pub fn len(&self) -> usize {
        self.length
    }

    pub fn status(&self) -> JsonStatus {
        match self.state == Token::Ok && self.stack.is_empty() {
            true  => JsonStatus::Valid,
            false => JsonStatus::


mul
     * @param m {GeometricE2}
     * @return {G2} this
     * @chainable
     */
    mul(m: GeometricE2): G2;
    /**
     *

     * this ⟼ a * b
     *

     * @method mul2
     * @param a {GeometricE2}
     * @param b {GeometricE2}
     * @return {G2} this
     * @chainable
     */
    mul2(a: GeometricE2, b: GeometricE2): G2;
    /**
     *

     * this ⟼ -1 * this
     *

     * @method neg
     * @return {G2} this
     * @chainable
     */
    neg(): G2;
    /**
    *

    * this ⟼ sqrt(this * conj(this))
    *

    * @method norm
    * @return {G2} this
    * @chainable
    */
    norm(): G2;
    /**
     *

     * this ⟼ this / magnitude(this)
     *

     * @method direction
     * @return {G2} this
     * @chainable
     */
    direction(): G2;
    /**
     * Sets this multivector to the identity element for multiplication, 1.
     * @method one
     * @return {G2}
     * @chainable
     */
    one(): G2;
    pow(): G2;
    /**
     *

     * Updates this target to be the quad or squared norm of the target.
     *

     *

     * this ⟼ scp(this, rev(this)) = this | ~this
     *

     * @method quad
     * @return {G2} this
     * @chainable
     */
    quad(): G2;
    /**
     * @method quadraticBezier
     * @param t {number}
     * @param controlPoint {GeometricE2}
     * @param endPoint {GeometricE2}
     * @return {G2}
     */
    quadraticBezier(t: number, controlPoint: GeometricE2, endPoint: GeometricE2): G2;
    /**
     *

     * this ⟼ this >> m
     *

     * @method rco
     * @param m {GeometricE2}
     * @return {G2} this
     * @chainable
     */
    rco(m: GeometricE2): G2;
    /**
     *

     * this ⟼ a >> b
     *

     * @method rco2
     * @param a {GeometricE2}
     * @param b {GeometricE2}
     * @return {G2} this
     * @chainable
     */
    rco2(a: GeometricE2, b: GeometricE2): G2;
    /**
     *

     * this ⟼ - n * this * n
     *

     * @method reflect
     * @param n {VectorE2}
     * @return {G2} this
     * @chainable
     */
    reflect(n: VectorE2): G2;
    /**
     *

     * this ⟼ rev(this)
     *

     * @method reverse


bound =
          //   ceil(tile_height / num_threads_y) * num_threads_y
          llvm::Value* ceiling_of_ratio = builder->CreateUDiv(
              builder->CreateAdd(tile_height, llvm::ConstantInt::get(
                                                  index_ty, num_threads_y - 1)),
              llvm::ConstantInt::get(index_ty, num_threads_y));
          llvm::Value* tile_height_bound = builder->CreateMul(
              ceiling_of_ratio,
              llvm::ConstantInt::get(index_ty, num_threads_y));
          ksl->For(
              loop_name, /*start=*/llvm::ConstantInt::get(index_ty, 0),
              /*end=*/tile_height_bound,
              /*step=*/llvm::ConstantInt::get(index_ty, num_threads_y),
              [&](llvm::Value* y_indvar) {
                llvm::Value* y_loc = builder->CreateAdd(y_indvar, y);
                ksl->If(
                    loop_name + "_y_in_tile",
                    builder->CreateICmpULT(y_loc, tile_height), [&] {
                      emit_elem_function(
                          source_idx.AddOffsetToDim(
                              y_indvar, KernelMappingScheme::DimY, builder),
                          y_loc, x_loc);
                    });
              });
        });
  }
}

// Emits code to process up to
// (tile_size_x/num_threads_x * tile_size_y/num_threads_y) elements in a tile,
// given `emit_elem_function` is the function to emit code to process one
// element, `y` and `x` are the intra-tile coordinates for the first element
// to process, and `index` is the index for the origin of the tile. Information
// about tile_size_x/y and num_threads_x/y are stored in `mapping_scheme`. Emits
// bounds check to ensure that each processed element is within the boundary
// defined by `tile_width` and `tile_height`.
void EmitTiledElementalCodeWithBoundsCheck(
    const KernelMappingScheme* mapping_scheme,
    const IrArray::Index& tile_origin_index, const string& loop_name,
    KernelSupportLibrary* ksl, llvm::IRBuilder<>* builder, llvm::Value* y,
    llvm::Value* x, llvm::Value* tile_height, llvm::Value* tile_width,
    const std::function<void(const IrArray::Index&, llvm::Value*,
                             llvm::Value*)>& emit_elem_function) {
  int64 tile_size_x = mapping_scheme->GetTileSizeForDimensionX();
  int64 tile_size_y = mapping_scheme->GetTileSizeForDimensionY();
  llvm::Type* index_ty = tile_width->getType();

  ksl->If(
      loop_name + "_full_tile",
      builder->CreateAnd(
          builder->CreateICmpEQ(llvm::ConstantInt::get(index_ty, tile_size_x),
                                tile_width),
          builder->CreateICmpEQ(llvm::ConstantInt::get(index_ty, tile_size_y),
                                tile_height)),
      [&] {
        EmitFullElementalTile(mapping_scheme, tile_origin_index, loop_name, ksl,
                              builder, y, x, index_ty, emit_elem_function);
      },
      [&] {
        EmitPartialElementalTile(mapping_scheme, tile_origin_index, loop_name,
                                 ksl, builder, y, x, tile_height, tile_width,
                                 index_ty, emit_elem_function);
      });
}
}  // namespace

// Emits code to process a tensor element in a tile for the given kCopy HLO that
// performs a 0-2-1 transpose.
//


代码]
    ├── game_js_beautifier.py  # 美化 game.js
    ├── LICENSE
    ├── main_cv.py  # 自动跳 opencv 版本
    ├── main.py  # 自动跳 pillow 版本
    ├── Pipfile
    ├── Pipfile.lock
    └── README.md

## 游戏源码分析

[请前往源码分析](docs/README.md)

## 原理说明

普通版本（main.py，已废弃）：

![普通版本](http://upload-images.jianshu.io/upload_images/576195-ebb3e6782df3c0b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

优化版本(main_cv.py)：

![优化版本](http://upload-images.jianshu.io/upload_images/576195-5f5ced00075de3cd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

调试时，修改 debug 为 True，真实运行时，设置为 False。停顿时间设置为 2s，如果电脑运算速度太快，保险起见可以设置为 2s。

原理：

Android:

1. adb 截图
1. 找到小人臀部坐标（hsv 色相紫黑色）
1. 找到下一桥墩的顶点坐标
1. 找到下一桥墩的极左/极右点坐标
1. 计算出下一桥墩的中心点坐标
1. 从小人臀部到下一桥墩中心点计算出跳远距离
1. 将距离换算为长按时长
1. 使用 adb 跳

iOS:

使用 wda 截图与事件点击，比 adb 快很多。

![16.png.canny.png](http://upload-images.jianshu.io/upload_images/576195-14cf69084bab0fa8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![16.png.debug.png](http://upload-images.jianshu.io/upload_images/576195-75eb2f74920898b8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

## 更新日志

**2018-01-04**

由于微信的小游戏的更新，基于背景 hsv 查找极点的方式，对于亮色背景，已经不再适用。

更新为使用轮廓区域获取顶点，再由商高定理计算中心点坐标。

**2018-01-01**

目的只是找到极点，并不需要二值化，去除相关代码。速度快。

目前以 距离 x 1.5 作为长按时长，基本能跳到目标中心位置。

**2017-12-30**

去除垂直投影图的方案，使用直接识别背景的方式去除背景，并二值化，以识别“极点”。速度仍然慢。

**2017-12-29**

第一可用版本，准确性不高，速度慢，


current == batch); // no one should've changed this
          // TODO(jmesserly): VM doesn't seem to like nested try/finally, so
          // set current to null before _notify. That will ensure we're back
          // to the right state, even if _notify throws.
          current = null;
          batch._notify();
        }
        return result;
      } else {
        // Already in a batch, so just use it.
        // TODO(rnystrom): Reentrant calls to wrap() are kind of hairy. They
        // can occur in at least one known place:
        // 1. You respond to an event handler by calling a function with wrap()
        //    (i.e. the normal way we wrap event handlers).
        // 2. In that handler, you spawn an XHR. You give it a callback which
        //    is also calling wrap, so that when it's later invoked, that is in
        //    a batch too.
        // 3. Because of an error the XHR fails and calls the callback
        //    immediately instead of unwinding the stack past the first wrap()
        //    and then calling it asynchronously.
        // This check handles that, but ideally we'd have a more elegant way of
        // notifying after a series of changes like a onEventHandlerFinished
        // event or something built into the DOM API.
        return userFunction(e);
      }
    };
  }

  /// Returns a unique global id for observable objects. */
  static int genUid() {
    return nextUid++;
  }

  /// Retrieves the events associated with {@code obj}. */
  EventSummary getEvents(Observable obj) {
    int uid = obj.uid;
    EventSummary? summary = summaries[uid];
    if (summary == null) {
      assert(!sealed);
      summary = EventSummary(obj);
      summaries[uid] = summary;
    }
    return summary;
  }

  /// Fires all events at once. */
  void _notify() {
    assert(!sealed);
    sealed = true;
    for (final summary in summaries.values) {
      summary.notify();
    }
  }
}
// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

part of touch;

/// Wraps a callback with translations of mouse events to touch events. Use
/// this function to invoke your callback that expects touch events after
/// touch events are created from the actual mouse events.
EventListener mouseToTouchCallback(EventListener callback) {
  return (Event e) {
    var touches = <Touch>[];
    var targetTouches = <Touch>[];
    var changedTouches = <Touch>[];
    final mockTouch = MockTouch(e as MouseEvent);
    final mockTouchList = <Touch>[mockTouch];
    if (e.type == 'mouseup') {
      changedTouches = mockTouchList;
    } else {
      touches = mockTouchList;
      targetTouches = mockTouchList;
    }
    callback(MockTouchEvent(e, touches, targetTouches, changedTouches));
    // Required to prevent spurious selection changes while tracking touches
    // on devices that don't support touch events.
    e.preventDefault();
  };
}

/// Helper method to attach event listeners to a [node]. */
void _addEventListeners(Element node, EventListener onStart,
    EventListener onMove, EventListener onEnd, EventListener onCancel,
    [bool capture = false]) {
  late final Function removeListeners;

  onEndWrapper(e) {
    removeListeners();
    return onEnd(e);
  }

  onLeaveWrapper(e) {
    removeListeners();
    return onEnd(e);
  }

  onCancelWrapper(e) {
    removeListeners();
    return onCancel(e);
  }

  if (Device.supportsTouch) {
    late StreamSubscription<TouchEvent> touchMoveSub;
    late StreamSubscription<TouchEvent> touchEndSub;
    late StreamSu


s
		//			m_memory.clear();
		//		}
		//	}
		//}
		//else
		//{
		//	stateAnim = STATE_MOUNT;
		//	m_memory.clear();
		//}

		// lxz 2008.6.20. This is just a quick fix: when character is commanded to be mounted while in air,
		// the animation state should be changed to standing for later mount animation to be played at a later time.

		// we will not play mount animation in C++, instead the scripting system should direct a property animation to play
		// so we just set STATE_STANDING to retain the animation set by the scripting language.
		stateAnim = STATE_STANDING;
		m_memory.clear();
	}

	if(stateAnim == STATE_JUMP_IN_AIR && m_nLastAnimState == stateAnim)
	{
	}
	else if (m_EnableAutoAnimation)
	{
		/** play animation */
		if(GetStateAnimName(stateAnim, sAnimName))
			pBiped->PlayAnimation(sAnimName, bUpdateSpeed);
	}
	m_nLastAnimState = stateAnim;
}

void CBipedStateManager::EnableAutoAnimation(bool enable)
{
	m_EnableAutoAnimation = enable;
	auto biped = GetBiped();
	if (biped)
		biped->EnableAutoAnimation(m_EnableAutoAnimation);
}
#include "ParaEngine.h"
#include "SceneState.h"
#include "TextureEntity.h"
#include "AssetManager.h"
#include "Globals.h"
#include "ParaWorldAsset.h"
#include "IBatchedElementDraw.h"
#include "BaseCamera.h"
#include "SceneObject.h"
#include "util/StringHelper.h"
#include "ScriptParticle.h"

using namespace ParaEngine;

int ParaEngine::CScriptParticle::InstallFields(CAttributeClass * pClass,bool bOverride)
{
	CBaseObject::InstallFields(pClass,bOverride);
	pClass->AddField("clear",FieldType_void,(void*)clear_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("beginParticle",FieldType_void,(void*)beginParticle_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("endParticle",FieldType_void,(void*)endParticle_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticlePositionX",FieldType_Float,(void*)setParticlePositionX_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticlePositionY",FieldType_Float,(void*)setParticlePositionY_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticlePositionZ",FieldType_Float,(void*)setParticlePositionZ_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticlePositionZ",FieldType_Float,(void*)setParticlePositionZ_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticleUVOffsetX",FieldType_Float,(void*)setParticleUVOffsetX_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticleUVOffsetY",FieldType_Float,(void*)setParticleUVOffsetY_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticleUVScaleX",FieldType_Float,(void*)setParticleUVScaleX_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticleUVScaleY",FieldType_Float,(void*)setParticleUVScaleY_s,NULL,NULL,NULL,bOverride);
	pClass->AddField("mParticleColourR",FieldType_Float,(void*)setParticleColourR_s,NULL,NULL,NULL,bOverride);
	p


] <= 983039 {
						goto st59
					}
				default:
					goto st59
				}
			default:
				goto st59
			}
		default:
			goto st59
		}
		goto tr0
tr92:
//line parse_actions.rl:42

		if object < 0 {
			panic("unexpected parser state: object start not set")
		}
		s.Object.Value = string(data[object:p])

//line parse_actions.rl:20

		label = p

	goto st61
	st61:
		if p++; p == pe {
			goto _test_eof61
		}
	st_case_61:
//line parse.go:2428
		switch data[p] {
		case 9:
			goto tr31
		case 32:
			goto tr31
		case 45:
			goto st59
		case 46:
			goto tr91
		case 58:
			goto st62
		case 60:
			goto tr33
		case 95:
			goto tr92
		case 183:
			goto st59
		}
		switch {
		case data[p] < 8204:
			switch {
			case data[p] < 192:
				switch {
				case data[p] < 65:
					if 48 <= data[p] && data[p] <= 57 {
						goto st59
					}
				case data[p] > 90:
					if 97 <= data[p] && data[p] <= 122 {
						goto st59
					}
				default:
					goto st59
				}
			case data[p] > 214:
				switch {
				case data[p] < 248:
					if 216 <= data[p] && data[p] <= 246 {
						goto st59
					}
				case data[p] > 893:
					if 895 <= data[p] && data[p] <= 8191 {
						goto st59
					}
				default:
					goto st59
				}
			default:
				goto st59
			}
		case data[p] > 8205:
			switch {
			case data[p] < 12289:
				switch {
				case data[p] < 8304:
					if 8255 <= data[p] && data[p] <= 8256 {
						goto st59
					}
				case data[p] > 8591:
					if 11264 <= data[p] && data[p] <= 12271 {
						goto st59
					}
				default:
					goto st59
				}
			case data[p] > 55295:
				switch {
				case data[p] < 65008:
					if 63744 <= data[p] && data[p] <= 64975 {
						goto st59
					}
				case data[p] > 65533:
					if 65536 <= data[p] && data[p] <= 983039 {
						goto st59
					}
				default:
					goto st59
				}
			default:
				goto st59
			}
		default:
			goto st59
		}
		goto tr0
	st62:
		if p++; p == pe {
			goto _test_eof62
		}
	st_case_62:
		switch data[p] {
		case 9:
			goto tr31
		case 32:
			goto tr31
		case 45:
			goto st59
		case 46:
			goto tr91
		case 60:
			goto tr33
		case 95:
			goto tr96
		case 183:
			goto st59
		}
		switch {
		case data[p] < 895:
			switch {
			case data[p] < 192:
				switch {
				case data[p] < 65:
					if 48 <= data[p] && data[p] <= 58 {
						goto st63
					}
				case data[p] > 90:
					if 97 <= data[p] && data[p] <= 122 {
						goto st63
					}
				default:
					goto st63
				}
			case data[p] > 214:
				switch {
				case data[p] < 248:
					if 216 <= data[p] &&


 hashes[k * 2 + 1])
        )
        k ++
    }

    return hashes[hashes.length - 1]
}

describe('Merkle Tree', () => {

    const tree = setupTree(2, ZERO_VALUE)

    it('Should calculate the correct root', () => {
        const leaves: SnarkBigInt[] = []
        for (let i = 0; i < 2 ** DEPTH; i ++) {
            const leaf = genRandomSalt()
            leaves.push(leaf)
            tree.insert(leaf)
        }

        expect(calculateRoot(leaves)).toEqual(tree.root)
    })

    it('an updated tree should have the same root as another tree with the same leaves', () => {
        const tree1 = setupTree(2, ZERO_VALUE)
        const tree2 = setupTree(2, ZERO_VALUE)

        for (let i = 0; i < 4; i++) {
            tree1.insert(i + 1)
            tree2.insert(i + 1)
        }

        expect(tree1.root).toEqual(tree2.root)

        // Update the first tree at index 1
        const indexToUpdate = 1
        const newVal = 9
        tree1.update(indexToUpdate, newVal)

        // The roots must not match
        expect(tree1.root).not.toEqual(tree2.root)

        const tree3 = setupTree(2, ZERO_VALUE)
        for (let leaf of tree1.leaves) {
            tree3.insert(leaf)
        }
        expect(tree1.root).toEqual(tree3.root)
        expect(tree3.leaves[indexToUpdate]).toEqual(newVal)
    })

    it('copy() should produce a different object with the same attributes', () => {
        const copiedTree = tree.copy()

        expect(tree === tree).toBeTruthy()
        expect(tree === copiedTree).toBeFalsy()
        expect(tree.depth).toEqual(copiedTree.depth)
        expect(tree.zeroValue).toEqual(copiedTree.zeroValue)
        expect(tree.leaves).toEqual(copiedTree.leaves)
        expect(tree.leavesRaw).toEqual(copiedTree.leavesRaw)
        expect(tree.leafNumber).toEqual(copiedTree.leafNumber)
        expect(tree.zeros).toEqual(copiedTree.zeros)
        expect(tree.filledSubtrees).toEqual(copiedTree.filledSubtrees)
        expect(tree.filledPaths).toEqual(copiedTree.filledPaths)
        expect(tree.root).toEqual(copiedTree.root)
        expect(tree.nextIndex).toEqual(copiedTree.nextIndex)
    })

    it('intermediate tree generation', () => {
        const leaves = [
            bigInt('1'),
            bigInt('8'),
            bigInt('7'),
            bigInt('7'),
        ]
        const largeTree = setupTree(4, 0)
        const subTree = setupTree(2, 0)

        const b = subTree.root

        largeTree.insert(leaves[0])
        largeTree.insert(10)
        largeTree.update(1, leaves[1])
        largeTree.insert(leaves[2])
        largeTree.insert(leaves[3])

        for (let leaf of leaves) {
            subTree.insert(leaf)
        }

        const agg = setupTree(2, 0)
        agg.insert(subTree.root)
        agg.insert(b)
        agg.insert(b)
        agg.insert(b)

        expect(agg.root.toString()).toEqual(largeTree.root.toString())
    })
})
import { BrowserWindow } from 'electron'
import { ViewPane } from '../src/lib/view-pane'
import { calcMinSize, createBrowserWindow, initPanels, mountPanels } from '../src/main'

interface BrowserWindowMock {
  spyConstructor?: () => any
  prototype?: any
}

describe('main', () => {
  const BwMock = BrowserWindow as BrowserWindowMock
  const bwConstructorSpy = jest.spyO


ld = 0.05,
	},
	size = {
		180,
		8,
	},
	icon_size = {
		72,
		80,
	},
	icon_bar_spacing = {
		10,
		0,
	},
	throwable_size = {
		16,
		16,
	},
	ammo_size = {
		16,
		16,
	},
	ammo_spacing = {
		-18,
		0,
	},
	critical_health_color = UIHudSettings.color_tint_alert_2,
	default_health_color = UIHudSettings.color_tint_main_2,
	disabled_health_color = {
		255,
		200,
		200,
		200,
	},
	feature_list = {
		ammo = true,
		coherency = true,
		health = true,
		name = true,
		player_color = true,
		pocketable = true,
		portrait = true,
		respawn_timer = true,
		status_icon = true,
		throwables = true,
		toughness = true,
		toughness_hit_indicator = true,
		voip = true,
	},
}

return settings("HudElementTeamPlayerPanelSettings", hud_element_team_player_panel_settings)


class based on discriminator value
        /// </summary>
        /// <returns>A <see cref="global::Microsoft.Graph.Beta.Drives.Item.SearchWithQ.SearchWithQResponse"/></returns>
        /// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
        public static new global::Microsoft.Graph.Beta.Drives.Item.SearchWithQ.SearchWithQResponse CreateFromDiscriminatorValue(IParseNode parseNode)
        {
            if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
            return new global::Microsoft.Graph.Beta.Drives.Item.SearchWithQ.SearchWithQResponse();
        }
    }
}
#pragma warning restore CS0618


from odoo import models, fields, api

class ResPartner(models.Model):
    _inherit = 'res.partner'

    # Kreditor/Debitor kateqoriyası
    financial_category = fields.Selection([
        ('creditor', 'Kreditor (Podratçı/Satıcı)'),
        ('debitor', 'Debitor (Alıcı/Sifarişçi)'),
        ('both', 'Həm Kreditor həm Debitor'),
        ('other', 'Digər')
    ], string='Maliyyə Kateqoriyası', help='Kontaktın maliyyə əlaqələri')

    # Əlavə sahələr kreditorlar üçün
    is_supplier = fields.Boolean('Təchizatçıdır', compute='_compute_financial_flags', store=True)
    is_contractor = fields.Boolean('Podratçıdır', compute='_compute_financial_flags', store=True)

    # Əlavə sahələr debitorlar üçün
    is_customer = fields.Boolean('Müştəridir', compute='_compute_financial_flags', store=True)
    is_client = fields.Boolean('Sifarişçidir', compute='_compute_financial_flags', store=True)

    # Əlavə məlumatlar
    credit_limit = fields.Float('Kredit Limiti', help='Maksimum borc məbləği')
    payment_terms = fields.Text('Ödəniş Şərtləri', help='Ödəniş şərtləri və müddətləri')

    @api.depends('financial_category')
    def _compute_financial_flags(self):
        """Maliyyə kateqoriyasına əsasən boolean sahələri təyin et"""
        for partner in self:
            if partner.financial_category == 'creditor':
                partner.is_supplier = True
                partner.is_contractor = True
                partner.is_customer = False
                partner.is_client = False
            elif partner.financial_category == 'debitor':
                partner.is_supplier = False
                partner.is_contractor = False
                partner.is_customer = True
                partner.is_client = True
            elif partner.financial_category == 'both':
                partner.is_supplier = True
                partner.is_contractor = True
                partner.is_customer = True
                partner.is_client = True
            else:
                partner.is_supplier = False
                partner.is_contractor = False
                partner.is_customer = False
                partner.is_client = False

    @api.model
    def name_search(self, name='', args=None, operator='ilike', limit=100):
        """Axtarışda maliyyə kateqoriyasını da daxil et"""
        if args is None:
            args = []

        # Əgər maliyyə kateqoriyası ilə axtarış edilsə
        domain = args[:]
        if name:
            domain = ['|', ('name', operator, name), ('financial_category', operator, name)] + domain

        return super(ResPartner, self).name_search(name, domain, operator, limit)


               |m: &ExtraActionSummary| { &m.action },
                    |m: &mut ExtraActionSummary| { &mut m.action },
                ));
                ::protobuf::reflect::MessageDescriptor::new::<ExtraActionSummary>(
                    "ExtraActionSummary",
                    fields,
                    file_descriptor_proto()
                )
            })
        }
    }

    fn default_instance() -> &'static ExtraActionSummary {
        static mut instance: ::protobuf::lazy::Lazy<ExtraActionSummary> = ::protobuf::lazy::Lazy {
            lock: ::protobuf::lazy::ONCE_INIT,
            ptr: 0 as *const ExtraActionSummary,
        };
        unsafe {
            instance.get(ExtraActionSummary::new)
        }
    }
}

impl ::protobuf::Clear for ExtraActionSummary {
    fn clear(&mut self) {
        self.action.clear();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for ExtraActionSummary {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for ExtraActionSummary {
    fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
        ::protobuf::reflect::ProtobufValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct DetailedExtraActionInfo {
    // message fields
    triggering_file: ::protobuf::SingularField<::std::string::String>,
    action: ::protobuf::SingularPtrField<ExtraActionInfo>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a DetailedExtraActionInfo {
    fn default() -> &'a DetailedExtraActionInfo {
        <DetailedExtraActionInfo as ::protobuf::Message>::default_instance()
    }
}

impl DetailedExtraActionInfo {
    pub fn new() -> DetailedExtraActionInfo {
        ::std::default::Default::default()
    }

    // optional string triggering_file = 1;

    pub fn get_triggering_file(&self) -> &str {
        match self.triggering_file.as_ref() {
            Some(v) => &v,
            None => "",
        }
    }
    pub fn clear_triggering_file(&mut self) {
        self.triggering_file.clear();
    }

    pub fn has_triggering_file(&self) -> bool {
        self.triggering_file.is_some()
    }

    // Param is passed by value, moved
    pub fn set_triggering_file(&mut self, v: ::std::string::String) {
        self.triggering_file = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_triggering_file(&mut self) -> &mut ::std::string::String {
        if self.triggering_file.is_none() {
            self.triggering_file.set_default();
        }
        self.triggering_file.as_mut().unwrap()
    }

    // Take field
    pub fn take_triggering_file(&mut self) -> ::std::string::String {
        self.triggering_file.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // required .blaze.ExtraActionInfo action = 2;

    pub fn get_action(&self) -> &ExtraActionInfo {
        self.action.as_ref().unwrap_or_else(|| ExtraActionInfo::default_instance())
    }
    pub fn clear_action(&mut self) {
        self.action.clear();
    }

    pub fn has_action(&self) -> bool {
        self.


2) {}

  Eigen::MatrixXd symop_to_matrix(
      Eigen::Ref<const Eigen::Matrix3d> const &_matrix,
      Eigen::Ref<const Eigen::Vector3d> const &_tau, bool time_reversal,
      Index dim) const override {
    assert(dim == Dim1 * Dim2);
    Eigen::MatrixXd result;
    kroneckerProduct(
        m_builder1.symop_to_matrix(_matrix, _tau, time_reversal, Dim1),
        m_builder2.symop_to_matrix(_matrix, _tau, time_reversal, Dim2), result);
    return result;
  }

 private:
  SymRepBuilderInterface *_clone() const override {
    return new KroneckerSymRepBuilder(*this);
  }

  Builder1 m_builder1;
  Builder2 m_builder2;
};

/// \brief Builds symmetry representation as the 'dim' x 'dim' identity matrix,
/// regardless of symop
class IdentitySymRepBuilder : public SymRepBuilderBase {
 public:
  IdentitySymRepBuilder() : SymRepBuilderBase("Identity") {}

  Eigen::MatrixXd symop_to_matrix(
      Eigen::Ref<const Eigen::Matrix3d> const &_matrix,
      Eigen::Ref<const Eigen::Vector3d> const &_tau, bool time_reversal,
      Index dim) const override {
    return Eigen::MatrixXd::Identity(dim, dim);
  }

 private:
  SymRepBuilderInterface *_clone() const override {
    return new IdentitySymRepBuilder();
  }
};

/// \brief Builds symmetry representation that is the angular momentum symmetry
/// representation of provided symop
class AngularMomentumSymRepBuilder : public TimeReversalSymRepBuilderBase {
 public:
  AngularMomentumSymRepBuilder()
      : TimeReversalSymRepBuilderBase("AngularMomentum") {}

  Eigen::MatrixXd symop_to_matrix(
      Eigen::Ref<const Eigen::Matrix3d> const &_matrix,
      Eigen::Ref<const Eigen::Vector3d> const &_tau, bool time_reversal,
      Index dim) const override {
    return ((time_reversal ? -1. : 1.) * _matrix.determinant()) * _matrix;
  }

 private:
  SymRepBuilderInterface *_clone() const override {
    return new AngularMomentumSymRepBuilder();
  }
};

/// \brief Builds symmetry representation that is 'dim'x'dim' +Identity
/// (-Identity) matrix if time_reversal is false (true)
class TimeReversalSymRepBuilder : public TimeReversalSymRepBuilderBase {
 public:
  TimeReversalSymRepBuilder() : TimeReversalSymRepBuilderBase("TimeReversal") {}

  Eigen::MatrixXd symop_to_matrix(
      Eigen::Ref<const Eigen::Matrix3d> const &_matrix,
      Eigen::Ref<const Eigen::Vector3d> const &_tau, bool time_reversal,
      Index dim) const override {
    return (time_reversal ? -1. : 1.) * Eigen::MatrixXd::Identity(dim, dim);
  }

 private:
  SymRepBuilderInterface *_clone() const override {
    return new TimeReversalSymRepBuilder();
  }
};

/// \brief Build 6x6 symmetry representation for a rank 2 Cartesian tensor
/// represented in Kelvin notation
class Rank2


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

from .base import BasePPORewardModel


ld(22, defaultValue: false)
  final bool gameScreenRecorderSupport;

  @HiveField(23, defaultValue: 2)
  final int gameScreenRecorderDuration;

  @HiveField(24, defaultValue: 50)
  final int gameScreenRecorderPixelRatio;

  @HiveField(25, defaultValue: true)
  final bool showTutorial;

  @HiveField(26, defaultValue: false)
  final bool remindedOpponentMayFly;

  @HiveField(27, defaultValue: false)
  final bool usePerfectDatabase;

  @HiveField(28, defaultValue: false)
  final bool focusOnBlockingPaths;

  @HiveField(29, defaultValue: false)
  final bool vibrationEnabled;

  @HiveField(30, defaultValue: SoundTheme.ball)
  final SoundTheme? soundTheme;

  @HiveField(31, defaultValue: false)
  final bool useOpeningBook;

  @HiveField(32, defaultValue: 0)
  final int humanMoveTime;

  // The header part of LLM prompt
  @HiveField(33, defaultValue: "")
  final String llmPromptHeader;

  // The footer part of LLM prompt
  @HiveField(34, defaultValue: "")
  final String llmPromptFooter;

  @HiveField(35, defaultValue: LlmProvider.openai)
  final LlmProvider llmProvider;

  @HiveField(36, defaultValue: "")
  final String llmModel;

  @HiveField(37, defaultValue: "")
  final String llmApiKey;

  @HiveField(38, defaultValue: "")
  final String llmBaseUrl;

  @HiveField(39, defaultValue: 0.7)
  final double llmTemperature;

  // Enable trap awareness analysis when using Perfect DB
  @HiveField(40, defaultValue: false)
  final bool trapAwareness;

  /// Decodes a Json from a [GeneralSettings] object
  Map<String, dynamic> toJson() => _$GeneralSettingsToJson(this);

  // For backwards compatibility with code that uses static properties
  static String get defaultLlmPromptHeader => PromptDefaults.llmPromptHeader;

  static String get defaultLlmPromptFooter => PromptDefaults.llmPromptFooter;
}
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2019-2025 The Sanmill developers (see AUTHORS file)

// rule_set_modal.dart

// ignore_for_file: deprecated_member_use

part of 'package:sanmill/rule_settings/widgets/rule_settings_page.dart';

// A modal widget to select a rule set for the game.
class _RuleSetModal extends StatelessWidget {
  const _RuleSetModal({required this.ruleSet, required this.onChanged});

  final RuleSet ruleSet;
  final Function(RuleSet?)? onChanged;

  @override
  Widget build(BuildContext context) {
    return Semantics(
      key: const Key('rule_set_semantics'),
      label: S.of(context).ruleSet,
      child: SingleChildScrollView(
        key: const Key('rule_set_scroll_view'),
        child: Column(
          key: const Key('rule_set_column'),
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            RadioListTile<RuleSet>(
              key: const Key('radio_current_rule'),
              title: Text(S.of(context).currentRule),
              groupValue: ruleSet,
              value: RuleSet.current,
              onChanged: onChanged,
            ),
            RadioListTile<RuleSet>(
              key: const Key('radio_nine_mens_morris'),
              title: Text(S.of(context).nineMensMorris),
              groupValue: ruleSet,
              value: RuleSet.nineMensMorris,
              onChanged: onChanged,
            ),
            RadioListTile<RuleSet>(
              key:


1 = m_alpha[i1]; alph2 = m_alpha[i2];
      y1 = m_class[i1]; y2 = m_class[i2];
      F1 = m_errors[i1];
      s = y1 * y2;

      // Find the constraints on a2
      if (y1 != y2) {
	L = Math.max(0, alph2 - alph1);
	H = Math.min(C2, C1 + alph2 - alph1);
      } else {
	L = Math.max(0, alph1 + alph2 - C1);
	H = Math.min(C2, alph1 + alph2);
      }
      if (L >= H) {
	return false;
      }

      // Compute second derivative of objective function
      k11 = m_kernel.eval(i1, i1, m_data.instance(i1));
      k12 = m_kernel.eval(i1, i2, m_data.instance(i1));
      k22 = m_kernel.eval(i2, i2, m_data.instance(i2));
      eta = 2 * k12 - k11 - k22;

      // Check if second derivative is negative
      if (eta < 0) {

	// Compute unconstrained maximum
	a2 = alph2 - y2 * (F1 - F2) / eta;

	// Compute constrained maximum
	if (a2 < L) {
	  a2 = L;
	} else if (a2 > H) {
	  a2 = H;
	}
      } else {

	// Look at endpoints of diagonal
	f1 = SVMOutput(i1, m_data.instance(i1));
	f2 = SVMOutput(i2, m_data.instance(i2));
	v1 = f1 + m_b - y1 * alph1 * k11 - y2 * alph2 * k12;
	v2 = f2 + m_b - y1 * alph1 * k12 - y2 * alph2 * k22;
	double gamma = alph1 + s * alph2;
	Lobj = (gamma - s * L) + L - 0.5 * k11 * (gamma - s * L) * (gamma - s * L) -
	  0.5 * k22 * L * L - s * k12 * (gamma - s * L) * L -
	  y1 * (gamma - s * L) * v1 - y2 * L * v2;
	Hobj = (gamma - s * H) + H - 0.5 * k11 * (gamma - s * H) * (gamma - s * H) -
	  0.5 * k22 * H * H - s * k12 * (gamma - s * H) * H -
	  y1 * (gamma - s * H) * v1 - y2 * H * v2;
	if (Lobj > Hobj + m_eps) {
	  a2 = L;
	} else if (Lobj < Hobj - m_eps) {
	  a2 = H;
	} else {
	  a2 = alph2;
	}
      }
      if (Math.abs(a2 - alph2) < m_eps * (a2 + alph2 + m_eps)) {
	return false;
      }

      // To prevent precision problems
      if (a2 > C2 - m_Del * C2) {
	a2 = C2;
      } else if (a2 <= m_Del * C2) {
	a2 = 0;
      }

      // Recompute a1
      a1 = alph1 + s * (alph2 - a2);

      // To prevent precision problems
      if (a1 > C1 - m_Del * C1) {
	a1 = C1;
      } else if (a1 <= m_Del * C1) {
	a1 = 0;
      }

      // Update sets
      if (a1 > 0) {
	m_supportVectors.ins


def filter_integer(list):
    """
    Filters an input list based on specific conditions.

    Parameters:
    - list: The input list of integers.

    Returns:
    - list: A filtered list containing elements at index not multiples of 2 or 3.

    Raises:
    - ValueError: If the length of the input list is not a multiple of 10.
    """

    #Retrieve the lenght of the list and check wether it's multiple of 10 or not
    if len(list) % 10 != 0:

        #Print error and exit the program if the list length is not a multiple of 10
        raise ValueError("Error: The list length must be a multiple of 10.")

    # A list that will contain filtered integer
    filtered_integer = []

    # A littke bit confusing finally, I assume that index == position
    position = 0
    for item in list:

        # Add item to filtered list if item's position is not multiple of 2 and 3
        if position % 2 != 0 and position % 3 != 0:
            filtered_integer.append(item)
        position += 1
    return filtered_integer


est clone() => UserFriendRequest()..mergeFromMessage(this);
  @$core.Deprecated('Using this can add significant overhead to your binary. '
      'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
      'Will be removed in next major version')
  UserFriendRequest copyWith(void Function(UserFriendRequest) updates) =>
      super.copyWith((message) => updates(message as UserFriendRequest))
          as UserFriendRequest;

  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static UserFriendRequest create() => UserFriendRequest._();
  UserFriendRequest createEmptyInstance() => create();
  static $pb.PbList<UserFriendRequest> createRepeated() =>
      $pb.PbList<UserFriendRequest>();
  @$core.pragma('dart2js:noInline')
  static UserFriendRequest getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<UserFriendRequest>(create);
  static UserFriendRequest? _defaultInstance;

  @$pb.TagNumber(1)
  $fixnum.Int64 get id => $_getI64(0);
  @$pb.TagNumber(1)
  set id($fixnum.Int64 v) {
    $_setInt64(0, v);
  }

  @$pb.TagNumber(1)
  $core.bool hasId() => $_has(0);
  @$pb.TagNumber(1)
  void clearId() => clearField(1);

  @$pb.TagNumber(2)
  $fixnum.Int64 get creationDate => $_getI64(1);
  @$pb.TagNumber(2)
  set creationDate($fixnum.Int64 v) {
    $_setInt64(1, v);
  }

  @$pb.TagNumber(2)
  $core.bool hasCreationDate() => $_has(1);
  @$pb.TagNumber(2)
  void clearCreationDate() => clearField(2);

  @$pb.TagNumber(3)
  $core.String get content => $_getSZ(2);
  @$pb.TagNumber(3)
  set content($core.String v) {
    $_setString(2, v);
  }

  @$pb.TagNumber(3)
  $core.bool hasContent() => $_has(2);
  @$pb.TagNumber(3)
  void clearContent() => clearField(3);

  @$pb.TagNumber(4)
  $0.RequestStatus get requestStatus => $_getN(3);
  @$pb.TagNumber(4)
  set requestStatus($0.RequestStatus v) {
    setField(4, v);
  }

  @$pb.TagNumber(4)
  $core.bool hasRequestStatus() => $_has(3);
  @$pb.TagNumber(4)
  void clearRequestStatus() => clearField(4);

  @$pb.TagNumber(5)
  $core.String get reason => $_getSZ(4);
  @$pb.TagNumber(5)
  set reason($core.String v) {
    $_setString(4, v);
  }

  @$pb.TagNumber(5)
  $core.bool hasReason() => $_has(4);
  @$pb.TagNumber(5)
  void clearReason() => clearField(5);

  @$pb.TagNumber(6)
  $fixnum.Int64 get expirationDate => $_getI64(5);
  @$pb.TagNumber(6)
  set expirationDate($fixnum.Int64 v) {
    $_setInt64(5, v);
  }

  @$pb.TagNumber(6)
  $core.bool hasExpirationDate() => $_has(5);
  @$pb.TagNumber(6)
  void clearExpirationDate() => clearField(6);

  @$pb.TagNumber(7)
  $fixnum.Int64 get requesterId => $_getI64(6);
  @$pb.TagNumber(7)
  set requesterId($fixnum.Int64 v) {
    $_setInt64(6, v);
  }

  @$pb.TagNumber(7)
  $core.bool hasRequesterId() => $_has(6);
  @$pb.TagNumber(7)
  void clearRequesterId() => clearField(7);

  @$pb.TagNumber(8)


),
      ];
    case 1:
      return [
        crearEstado(TipoDispositivo.SENSOR_MOVIMIENTO, true),
        crearEstado(TipoDispositivo.ALARMA, false),
      ];
    case 2:
      return [
        crearEstado(TipoDispositivo.SENSOR_MOVIMIENTO, true),
        crearEstado(TipoDispositivo.ALARMA, true),
      ];
    case 3:
      return [
        crearEstado(TipoDispositivo.SENSOR_MOVIMIENTO, false),
        crearEstado(TipoDispositivo.ALARMA, true),
      ];
    default:
      throw new Error('Fuera de rango');
  }
}

function crearEstado(tipo: TipoDispositivo, activo: boolean): Dispositivo {
  switch (tipo) {
    case TipoDispositivo.ALARMA:
      return {id: 1, tipo: TipoDispositivo.ALARMA, estado: activo ? 'sonando' : 'apagada'};
    case TipoDispositivo.SENSOR_MOVIMIENTO:
      return {id: 0, tipo: TipoDispositivo.SENSOR_MOVIMIENTO, estado: activo ? 'movimiento' : 'quieto'};
    default:
      throw new Error('Unimplemented');
  }
}
declare module "topojson-client" {
    // 2. TopoJSON Objects
    export interface TopoJSON {
        type: "Topology" | GeoJSON.GeoJsonGeometryTypes | null;
        bbox?: GeoJSON.BBox;
    }

    // 2.1. Topology Objects
    export interface Topology<T extends Objects<Properties> = Objects<Properties>> extends TopoJSON {
        type: "Topology";
        objects: T;
        arcs: Arc[];
        transform?: Transform;
    }

    // 2.1.1. Positions
    export type Positions = number[]; // at least two elements
    // 2.1.2. Transforms
    export interface Transform {
        scale: [number, number];
        translate: [number, number];
    }

    // 2.1.3. Arcs
    export type Arc = Positions[]; // at least two elements
    // 2.1.4. Arc Indexes
    export type ArcIndexes = number[];

    // 2.1.5. Objects
    export type Properties = GeoJSON.GeoJsonProperties;

    export interface Objects<P extends Properties = {}> {
        [key: string]: GeometryObject<P>;
    }

    // 2.2. Geometry Objects
    export interface GeometryObjectA<P extends Properties = {}> extends TopoJSON {
        type: GeoJSON.GeoJsonGeometryTypes | null;
        id?: number | string;
        properties?: P;
    }

    export type GeometryObject<P extends Properties = {}> =
        Point<P> | MultiPoint<P> |
        LineString<P> | MultiLineString<P> |
        Polygon<P> | MultiPolygon<P> |
        GeometryCollection<P> |
        NullObject;

    // 2.2.1. Point
    export interface Point<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "Point";
        coordinates: Positions;
    }

    // 2.2.2. MultiPoint
    export interface MultiPoint<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "MultiPoint";
        coordinates: Positions[];
    }

    // 2.2.3. LineString
    export interface LineString<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "LineString";
        arcs: ArcIndexes;
    }

    // 2.2.4. MultiLineString
    export interface MultiLineString<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "MultiLineString";
        arcs: ArcIndexes[];
    }

    // 2.2.5. Polygon
    export interface Polygon<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "Polygon";
        arcs: ArcIndexes[];
    }

    // 2.2.6. MultiPolygon
    export interface MultiPolygon<P extends Properties = {}> extends GeometryObjectA<P> {
        type: "MultiPolygon";
        arcs: ArcIndexes[][];
    }

    // 2.2.7. Geometry Collection
    export in


prefix:"fas",iconName:"child-combatant",icon:[576,512,["child-rifle"],"e4e0","M176 128A64 64 0 1 0 176 0a64 64 0 1 0 0 128zm-8 352l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-179.5L260.9 321c9.4 15 29.2 19.4 44.1 10s19.4-29.2 10-44.1l-51.7-82.1c-17.6-27.9-48.3-44.9-81.2-44.9l-12.3 0c-33 0-63.7 16.9-81.2 44.9L36.9 287c-9.4 15-4.9 34.7 10 44.1s34.7 4.9 44.1-10L104 300.5 104 480c0 17.7 14.3 32 32 32s32-14.3 32-32zM448 0L432 0 416 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l0 100.3c-9.6 5.5-16 15.9-16 27.7l0 32c-17.7 0-32 14.3-32 32l0 144c0 17.7 14.3 32 32 32l16 0 0 96c0 8.8 7.2 16 16 16l59.5 0c10.4 0 18-9.8 15.5-19.9L484 400l44 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-48 0 0-26.7 53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2l0-84.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 56-16 5.3L480 160c0-11.8-6.4-22.2-16-27.7L464 16c0-8.8-7.2-16-16-16z"]},fk=dk,pk={prefix:"fas",iconName:"gun",icon:[576,512,[],"e19b","M528 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8L32 64C14.3 64 0 78.3 0 96L0 208c0 17.7 14.3 32 32 32l10 0c20.8 0 36.1 19.6 31 39.8L33 440.2c-2.4 9.6-.2 19.7 5.8 27.5S54.1 480 64 480l96 0c14.7 0 27.5-10 31-24.2L217 352l104.5 0c23.7 0 44.8-14.9 52.7-37.2L400.9 240l31.1 0c8.5 0 16.6-3.4 22.6-9.4L477.3 208l66.7 0c17.7 0 32-14.3 32-32l0-80c0-17.7-14.3-32-32-32l-16 0 0-8zM321.4 304L229 304l16-64 105 0-21 58.7c-1.1 3.2-4.2 5.3-7.5 5.3zM80 128l384 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},mk={prefix:"fas",iconName:"square-phone",icon:[448,512,["phone-square"],"f098","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm90.7 96.7c9.7-2.6 19.9 2.3 23.7 11.6


0]))
                }
                if (rulePcx.size > 1) {
                    val rulePcs = rulePcx[1].splitNotBlank(":")
                    for (pc in rulePcs) {
                        val pcInt = Integer.parseInt(pc)
                        if (pcInt < 0 && elements.size + pcInt >= 0) {
                            elements[elements.size + pcInt] = null
                        } else if (Integer.parseInt(pc) < elements.size) {
                            elements[Integer.parseInt(pc)] = null
                        }
                    }
                    val es = Elements()
                    es.add(null)
                    elements.removeAll(es)
                }
            }
        } catch (ignore: Exception) {
        }

        return elements
    }

    /**
     * 获取内容列表
     */
    private fun getResultList(ruleStr: String): List<String>? {
        if (isEmpty(ruleStr)) {
            return null
        }
        var elements = Elements()
        elements.add(element)
        val rules = ruleStr.splitNotBlank("@")
        for (i in 0 until rules.size - 1) {
            val es = Elements()
            for (elt in elements) {
                es.addAll(getElementsSingle(elt, rules[i]))
            }
            elements.clear()
            elements = es
        }
        return if (elements.isEmpty()) {
            null
        } else getResultLast(elements, rules[rules.size - 1])
    }

    /**
     * 根据最后一个规则获取内容
     */
    private fun getResultLast(elements: Elements, lastRule: String): List<String> {
        val textS = ArrayList<String>()
        try {
            when (lastRule) {
                "text" -> for (element in elements) {
                    val text = element.text()
                    textS.add(text)
                }
                "textNodes" -> for (element in elements) {
                    val tn = arrayListOf<String>()
                    val contentEs = element.textNodes()
                    for (item in contentEs) {
                        val temp = item.text().trim { it <= ' ' }
                        if (!isEmpty(temp)) {
                            tn.add(temp)
                        }
                    }
                    textS.add(join("\n", tn))
                }
                "ownText", "html" -> {
                    elements.select("script").remove()
                    val html = elements.html()
                    textS.add(html)
                }
                "all" -> textS.add(elements.html())
                else -> for (element in elements) {
                    val url = element.attr(lastRule)
                    if (!isEmpty(url) && !textS.contains(url)) {
                        textS.add(url)
                    }
                }
            }
        } catch (e: Exception) {
            e.printStackTrace()
        }

        return textS
    }

    internal inner class SourceRule(ruleStr: String) {
        var isCss = false
        var elementsRule: String

        init {
            if (ruleStr.startsWith("@CSS:", true)) {
                isCss = true
                elementsRule = ruleStr.substring(5).trim { it <= ' ' }
            } else {
                elementsRule = ruleStr
            }
        }
    }

}

import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
import kotlinx.serialization.Serializable

@Serializable
class GpsPosition(
    val latitude: Double,
    val longitude: Double
)

sealed interface PictureData {
    val name: String
    val description: String
    val gps: GpsPosition
    val dateString: String

    data class Resource(
        val resource: String,
        val thumbnailResource: String,
        override val name: String,
        override val description: String,
        override val gps: GpsPosition,
        override val dateString: String,
    ) : PictureData

    @Serializable
    data class Camera(
        val id: String,
        val timeStampSeconds: Long,
        override val name: String,
        override val description: String,
        override val gps: GpsPosition,
    ) : PictureData {
        override val dateString: String
            get(): String {
                val instantTime = Instant.fromEp


   backgroundColor = ColorRGBa.WHITE
    val seed = random(1.0, 1000000000000.0).toLong() // know your seed 😛
    println("seed: $seed")
    val rand = Random(seed)

    // In future, consider implementing own screenshot mechanism that could run after each draw loop
    // screenshot: https://github.com/openrndr/openrndr/blob/9f17eb3c24813454cbad1a99d697cd279fa80d96/openrndr-extensions/src/main/kotlin/org/openrndr/extensions/Screenshots.kt
    // timestamp: https://github.com/openrndr/openrndr/blob/9f17eb3c24813454cbad1a99d697cd279fa80d96/openrndr-core/src/main/kotlin/org/openrndr/utils/NamedTimestamp.kt
    val progName = this.name.ifBlank { this.window.title.ifBlank { "my-amazing-drawing" } }
    extend(Screenshots()) {
      quitAfterScreenshot = false
      scale = 4.0
      captureEveryFrame = true
      name = "screenshots/$progName/${timestamp()}-seed-$seed.jpg"
    }

    val lineLength = 1500
    val padding = 300

    val colors = listOf(
      hsl(261.0, 0.45, 0.43), // purple
      hsl(238.0, 0.67, 0.36), // dark blue
      hsl(194.0, 0.70, 0.85), // light blue
      hsl(10.0, 0.40, 0.15), // dark brown
      hsl(255.0, 0.46, 0.86), // light purple
      hsl(173.0, 0.66, 0.975), // smokey white
      hsl(29.0, 0.93, 0.83) // orange/salmon
    )

    // val palette = Palette(colors.map { it.toRGBa() }, 0.0, hypot(width.toDouble(), height.toDouble()), rand)
    val palette = Palette(colors.map { it.toRGBa() }, 0.0, width + padding * 2.0, rand)

    // these attract things
    val yOffset = 100.0
    val gravityBodies: List<GravityBody> = listOf(
      GravityBody(width * 0.1, height * 1.1, 100000.0),
      GravityBody(width * -0.95, height * 0.15, 70000.0),
      GravityBody(width * 1.2, height * 0.20, 150000.0)
    )

    // these repel things
    val primaryAntigravityBodies = listOf(
      AntigravityBody(width * -0.05, height + yOffset * 0.5, 100000.0),
      AntigravityBody(width * 0.85, -yOffset * 0.5, 150000.0)
    )

    // this calculates net forces on a point mass
    val system = GravitySystem(1.0, gravityBodies + primaryAntigravityBodies)

    val stepSize = 20
    val target = Vector2(width * 1.1, height * 1.1)
    val contours: List<ShapeContour> = (-padding until width + padding step stepSize).flatMap { x ->
      (-padding until height + padding step stepSize).map { y ->
        val body = PhysicalBody(Vector2(random(x * 0.95, x * 1.05, rand), random(y * 0.95, y * 1.05, rand)), random(50.0, 150.0, rand), random(15.0, 25.0, rand), target)
        contour {
          moveTo(body.coords)
          List(lineLength) {
            lineTo(body.move(system))
          }
        }
      }
    }

    extend {
      drawer.strokeWeight = 0.55
      drawer.lineCap = LineCap.ROUND
      contours.forEach {
        val start = it.segments.first().start
        drawer.stroke = palette.colorAt(start.x).opacify(0.885)
        drawer.contour(it)
      }
      drawer.circle(gravityBodies[0].origin, 10.0)
    }
  }


ons for encoding and decoding.
  /// Returns memory size (in bytes) required to encode this object.
  size_t size (void) const;

  /// Encodes this object into buf for network transmission.
  size_t encode (void *buf) const;

  /// Decodes buf into current object, you better use
  /// the default ctor.
  size_t decode (void *buf);

  /// Dump this object for debug.
  void dump (void) const;

protected:
  /// URL of this offer.
  ACE_WString url_;

  /// Properties associate with this offer.
  ACE_URL_Property_Seq prop_;
};

typedef ACE_Array<ACE_URL_Offer> ACE_URL_Offer_Seq;
// type of URL offer collections.

#if defined (__ACE_INLINE__)
#include "URL_Properties.inl"
#endif /* __ACE_INLINE__ */

#endif /* ACE_WEB_PROPERTIES_H */


al buildTask = tasks.maybeCreate(
                    "rustBuildUniversal$profileCapitalized",
                    DefaultTask::class.java
                ).apply {
                    group = TASK_GROUP
                    description = "Build dynamic library in $profile mode for all targets"
                }

                tasks["mergeUniversal${profileCapitalized}JniLibFolders"].dependsOn(buildTask)

                for (targetPair in targetsList.withIndex()) {
                    val targetName = targetPair.value
                    val targetArch = archList[targetPair.index]
                    val targetArchCapitalized = targetArch.replaceFirstChar { it.uppercase() }
                    val targetBuildTask = project.tasks.maybeCreate(
                        "rustBuild$targetArchCapitalized$profileCapitalized",
                        BuildTask::class.java
                    ).apply {
                        group = TASK_GROUP
                        description = "Build dynamic library in $profile mode for $targetArch"
                        rootDirRel = config.rootDirRel
                        target = targetName
                        release = profile == "release"
                    }

                    buildTask.dependsOn(targetBuildTask)
                    tasks["merge$targetArchCapitalized${profileCapitalized}JniLibFolders"].dependsOn(
                        targetBuildTask
                    )
                }
            }
        }
    }
}package com.carriez.flutter_hbb

import ffi.FFI

import android.Manifest
import android.content.Context
import android.media.*
import android.content.pm.PackageManager
import android.media.projection.MediaProjection
import androidx.annotation.RequiresApi
import androidx.core.app.ActivityCompat
import android.os.Build
import android.util.Log
import kotlin.concurrent.thread

const val AUDIO_ENCODING = AudioFormat.ENCODING_PCM_FLOAT //  ENCODING_OPUS need API 30
const val AUDIO_SAMPLE_RATE = 48000
const val AUDIO_CHANNEL_MASK = AudioFormat.CHANNEL_IN_STEREO

class AudioRecordHandle(private var context: Context, private var isVideoStart: ()->Boolean, private var isAudioStart: ()->Boolean) {
    private val logTag = "LOG_AUDIO_RECORD_HANDLE"

    private var audioRecorder: AudioRecord? = null
    private var audioReader: AudioReader? = null
    private var minBufferSize = 0
    private var audioRecordStat = false
    private var audioThread: Thread? = null

    @RequiresApi(Build.VERSION_CODES.M)
    fun createAudioRecorder(inVoiceCall: Boolean, mediaProjection: MediaProjection?): Boolean {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
            return false
        }
        if (ActivityCompat.checkSelfPermission(
            context,
            Manifest.permission.RECORD_AUDIO
        ) != PackageManager.PERMISSION_GRANTED
        ) {
            Log.d(logTag, "createAudioRecorder failed, no RECORD_AUDIO permission")
            return false
        }

        var builder = AudioRecord.Builder()
        .setAudioFormat(
            AudioFormat.Builder()
                .setEncoding(AUDIO_ENCODING)
                .setSampleRate(AUDIO_SAMPLE_RATE)
                .setChannelMask(AUDIO_CHANNEL_MASK).build()
        );
        if (inVoiceCall) {
            builder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
        } else {
            mediaProjection?.let {
                var apcc = AudioPlaybackCaptureConfiguration.Builder(it)
                .addMatchingUsage(AudioAttributes.USAGE_MEDIA)
                .addMatchingUsage(AudioAttributes.USAGE_ALARM)
                .addMatchingUsage(AudioAttributes.USAGE_GAME)
                .addMatchingUsage(AudioAttributes.USAGE_UNKNOWN).build();
                builder.


, double thirdNumber, double fourthNumber)
        {
            return Math.Max(Math.Max(firstNumber, secondNumber), Math.Max(thirdNumber, fourthNumber));
        }

        public static double MinOf3(double firstNumber, double secondNumber, double thirdNumber)
        {
            return Math.Min(firstNumber, Math.Min(secondNumber, thirdNumber));
        }

        public static int MinOf3(int firstNumber, int secondNumber, int thirdNumber)
        {
            return Math.Min(firstNumber, Math.Min(secondNumber, thirdNumber));
        }
    }
}


		function checkLoading(domNode){
				if(domNode.firstChild.innerHTML == "Loading...") {
					return true;
				}
				return false;
			}

			dojo.addOnLoad(function(){
				doh.robot.initRobot('../test_AccordionContainer.html');
				doh.register("Accordion Mouse tests",[
					{
						name: "basic operation",
						timeout: 10000,
						runTest: function(t){
							var d = new doh.Deferred();

							// Click open second pane
							doh.robot.mouseMoveAt("lazyLoadPane_button_title", 500);
							doh.robot.mouseClick({left: true}, 500);
							doh.robot.sequence(d.getTestErrback(function(){
								doh.is("lazyLoadPane", dojo.global.dijit.byId("markupAccordion").get("selectedChildWidget").id, "second pane is now selected");
							}), 500);

							// Click open fourth pane
							doh.robot.mouseMoveAt("embeddedLayoutPane_button_title", 500);
							doh.robot.mouseClick({left: true}, 500);
							doh.robot.sequence(d.getTestCallback(function(){
								doh.is("embeddedLayoutPane", dojo.global.dijit.byId("markupAccordion").get("selectedChildWidget").id, "fourth pane is now selected");
							}), 2000);

							return d;
						}
					}
				]);

				doh.register("Accordion refreshOnShow",[
					{
						name: "pane3InitialLoading",
						timeout: 6000,
						runTest: function(t){
							var d = new doh.Deferred();

							var wasLoading = false;

							doh.robot.mouseMoveAt('ac_pane3_button', 500);
							doh.robot.mouseClick({left: true}, 500);
							doh.robot.sequence(function(){ wasLoading = checkLoading(dojo.byId("ac_pane3")); }, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.t(wasLoading);

								var tabContent = dojo.byId("ac_pane3").innerHTML.substring(0, 5);
								doh.is("There", tabContent);
							}), 4000);

							return d;
						}
					},
					{
						name: "pane2InitialLoading",
						timeout: 6000,
						runTest: function(t){
							var d = new doh.Deferred();

							var wasLoading = false;

							doh.robot.mouseMoveAt('ac_pane2_button', 500);
							doh.robot.mouseClick({left: true}, 500);
							doh.robot.sequence(function(){ wasLoading = checkLoading(dojo.byId("ac_pane2")); }, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.t(wasLoading);

								var tabContent = dojo.byId("ac_pane2").innerHTML.substring(0, 5);
								doh.is("There", tabContent);
							}), 4000);

							return d;
						}
					},
					{
						name: "pane3Refresh",
						timeout: 3000,
						runTest: function(t){
							var d = new doh.Deferred();

							var wasLoading = false;

							doh.robot.mouseMoveAt('ac_pane3_button', 500);
							doh.robot.mouseClick({left: true}, 500);
							doh.robot.sequence(function(){ wasLoading = checkLoading(dojo.byId("ac_pane3")); }, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.f(wasLoading);
							}), 1000);

							return d;
						}
					},


ll plants stored in the db
  constructor(private _plantService: PlantService){}
  //Makes a post request for a new plant to be stored in the db
  postPlant(cleanPlantObj): void{
    let localObject = JSON.parse(localStorage.getItem('fields'));
    console.log(JSON.stringify(localObject.sow.name));

    var newPlantObj = {
        sow:{name: localObject.sow.name, startDate: localObject.sow.startDate, endDate: localObject.sow.endDate },
        care:{comment: localObject.care.comment},
        fertilizer:{name: localObject.fertilizer.name, startDate: localObject.fertilizer.startDate, endDate: localObject.fertilizer.endDate},
        other:{comment: localObject.other.comment, tags: localObject.other.tags}
    };
    var notes;
    this._plantService.postPlant(newPlantObj).subscribe(
             data => {
               notes = data;
             },
             err => console.error(err)
           );
    }

}
import { Level } from "./level";
import {Vector2 } from "scrapy-engine";
import { TileBox } from "../entities/tile-box";
import { ArrowDispenser } from "../entities/arrow-dispenser";
import { Direction } from "@/utils/direction";
import { Door } from "../entities/door";
import { Bin } from "../entities/bin";
import { Button } from "../entities/button";
import { Level7 } from "./level7";

export class Level6 extends Level {
	public entry: Vector2 = new Vector2(2, 1);
	public exit: Vector2 = new Vector2(9, 4);

	protected buildLevel(): void {
		this.buildFloor();
		this.buildRoof();
		this.addTile(new TileBox(this.engine, 1, 1, 9, 3));
		this.addTile(new TileBox(this.engine, 2, 1, 8, 2));
		this.addTile(new TileBox(this.engine, 3, 1, 7, 1));
		this.addTile(new TileBox(this.engine, 1, 1, 3, 1));
		let door = new Door(this.engine, 1, 8, 4);
		door.activate();
		let dispenser1 = new ArrowDispenser(this.engine, Direction.LEFT, 6, 1);
		let dispenser2 = new ArrowDispenser(this.engine, Direction.LEFT, 7, 2);
		let dispenser3 = new ArrowDispenser(this.engine, Direction.LEFT, 8, 3);
		this.addTile(door);
		this.addTile(dispenser1);
		this.addTile(dispenser2);
		this.addTile(dispenser3);

		dispenser1.interval = 4000;
		dispenser2.interval = 4000;
		dispenser3.interval = 4000;

		let now = new Date().getTime() - dispenser1.interval;
		dispenser1.lastFired = now;
		dispenser2.lastFired = now + 1000;
		dispenser3.lastFired = now + 2000;

		this.addTile(new Bin(this.engine, 0, 1));

		let b = new Button(this.engine, 4, 1);
		this.addTile(b);

		b.setOnRelease(()=>door.activate());
		b.setOnPress(()=>door.deactive());
	}

	public onFinish(): void {
		this.engine.setWorld(new Level7(this.engine));
	}
}import uniqueIdGenerator from "./unique-id-generator.ts";

interface D<DecisionData> {
  id: string;
  p?: D<DecisionData>;
  d: DecisionData;
}

export function* depthFirstSearchDecisionTree<DecisionData>({
  areBranchesEquivalent,
  getNextLegalDecisions,
  isBranchFinished,
}: {
  getNextLegalDecisions: (decisions: DecisionData[]) => DecisionData[];
  areBranchesEquivalent?: (
    first: DecisionData[],
    second: DecisionData[]
  ) => boolean;
  isBranchFinished: (decisions: DecisionData[]) => boolean;
}) {
  type Decision = D<


p	xzr,xzr,[sp,#8*0]
	sbcs	x8,x21,x16
	stp	xzr,xzr,[sp,#8*2]
	sbcs	x9,x22,x17
	stp	xzr,xzr,[sp,#8*4]
	sbcs	xzr,x0,xzr		// did it borrow?
	stp	xzr,xzr,[sp,#8*6]

	// x6-3 hold result-modulus
	csel	x6,x19,x6,lo
	csel	x7,x20,x7,lo
	csel	x8,x21,x8,lo
	csel	x9,x22,x9,lo
	stp	x6,x7,[x1,#8*0]
	stp	x8,x9,[x1,#8*2]

.Lmul4x_done:
	ldp	x19,x20,[x29,#16]
	mov	sp,x29
	ldp	x21,x22,[x29,#32]
	mov	x0,#1
	ldp	x23,x24,[x29,#48]
	ldp	x25,x26,[x29,#64]
	ldp	x27,x28,[x29,#80]
	ldr	x29,[sp],#128
	// x30 is popped earlier
	AARCH64_VALIDATE_LINK_REGISTER
	ret
.size	__bn_mul4x_mont,.-__bn_mul4x_mont
.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
.align	2
.align	4
#endif
#endif  // !OPENSSL_NO_ASM
.section	.note.GNU-stack,"",%progbits


...origin/main
```

Running the shortest `gs` shell alias that it found:
```sh
╭─tim@fox ~/repo/gitopolis ‹main›
╰─$ gs
         # <=== no suggestions alias-finder because this is the shortest
## main...origin/main
```

![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b)

### Options

> In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'.

- Use `--longer` or `-l` to include aliases where the source is longer than the input (in other words, the source could contain the whole input).
- Use `--exact` or `-e` to avoid aliases where the source is shorter than the input (in other words, the source must be the same with the input).
- Use `--cheaper` or `-c` to avoid aliases where the destination is longer than the input (in other words, the destination must be the shorter than the input).

# `svn` plugin

This plugin adds some utility functions to display additional information regarding your current
svn repository. See https://subversion.apache.org/ for the full svn documentation.

To use it, add `svn` to your plugins array:

```zsh
plugins=(... svn)
```

## Functions

| Command               | Description                                 |
|:----------------------|:--------------------------------------------|
| `svn_prompt_info`     | Shows svn prompt in themes                  |
| `in_svn`              | Checks if we're in an svn repository        |
| `svn_get_repo_name`   | Get repository name                         |
| `svn_get_branch_name` | Get branch name (see [caveats](#caveats))   |
| `svn_get_rev_nr`      | Get revision number                         |
| `svn_dirty`           | Checks if there are changes in the svn repo |

## Caveats

The plugin expects the first directory to be the current branch / tag / trunk. So it returns
the first path element if you don't use branches.

## Usage on themes

To use this in the `agnoster` theme follow these instructions:

1. Enable the svn plugin

2. Add the following lines to your `zshrc` file:

    ```shell
    prompt_svn() {
        local rev branch
        if in_svn; then
            rev=$(svn_get_rev_nr)
            branch=$(svn_get_branch_name)
            if [[ $(svn_dirty_choose_pwd 1 0) -eq 1 ]]; then
                prompt_segment yellow black
                echo -n "$rev@$branch"
                echo -n "±"
            else
                prompt_segment green black
                echo -n "$rev@$branch"
            fi
        fi
    }
    ```

3. Override the agnoster `build_prompt()` function:

    ```zsh
    build_prompt() {
        RETVAL=$?
        prompt_status
        prompt_context
        prompt_dir
        prompt_git
        prompt_svn
        prompt_end
    }
    ```

# lol

Plugin for adding catspeak aliases, because why not.

To use it, add `lol` to the plugins array in your zshrc file:

```zsh
plugins=(... lol)
```

## Aliases

| Alias        | Command                                                         |
| ------------ | --------------------------------------------------------------- |
| `:3`         | `echo`                                                          |
| `alwayz`     | `tail -f`                                                       |
| `bringz`     | `git pull`