OLUTELY NO WARRANTY;
 * This is free software, and you are welcome to redistribute it under certain conditions;
 *
 * See /LICENSE for more details.
 */

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:handygram/src/common/cubits/colors.dart';
import 'package:handygram/src/common/cubits/scaling.dart';
import 'package:handygram/src/common/misc/localizations.dart';
import 'package:handygram/src/components/controls/tile_button.dart';
import 'package:handygram/src/components/scaled_sizes.dart';
import 'package:handygram/src/components/text/header.dart';
import 'package:handygram/src/pages/setup/bloc.dart';

class SetupStageColorSchemeView extends StatelessWidget {
  const SetupStageColorSchemeView({super.key, required this.currentId});

  final int currentId;

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    final itemSize = size.shortestSide * 0.27 * Scaling.userFactor;
    final l10n = AppLocalizations.of(context);
    final state = context.watch<SetupBloc>().state;
    return Scaffold(
      body: Column(
        children: [
          const PageHeader(title: "Select color scheme"),
          SizedBox(
            height: itemSize,
            // lmao, flutter team, make a horizontal ListWheelScrollView
            child: SingleChildScrollView(
              scrollDirection: Axis.horizontal,
              child: Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  for (final color in ColorStyles.accentColors) ...[
                    InkWell(
                      splashColor: Theme.of(context).splashColor,
                      onTap: () => context.read<SetupBloc>().add(
                            SetupEventSetColorScheme(
                                ColorStyles.accentColors.indexOf(color), true),
                          ),
                      borderRadius: BorderRadius.circular(999),
                      child: Ink(
                        width: itemSize,
                        height: itemSize,
                        decoration: BoxDecoration(
                          shape: BoxShape.circle,
                          color: color.primary,
                        ),
                        child: (state is SetupStateColorScheme &&
                                state.currentId ==
                                    ColorStyles.accentColors.indexOf(color))
                            ? Center(
                                child: Icon(
                                  Icons.done,
                                  size: itemSize / 2,
                                  color: color.onPrimary,
                                ),
                              )
                            : null,
                      ),
                    ),
                    if (ColorStyles.accentColors.indexOf(color) !=
                        ColorStyles.accentColors.length - 1)
                      SizedBox(width: 5 * Scaling.factor)
                  ]
                ],
              ),
            ),
          ),
          SizedBox(height: Paddings.beforeSmallButton),
          Expanded(
            child: Center(
              child: TileButton(
                text: l10n.nextButton,
                big: false,
                onTap: () => context
                    .read<SetupBloc>()
                    .add(SetupEventSetColorScheme(currentId, false)),
              ),
            ),
          ),
          SizedBox(height: Paddings.beforeSmallButton),
        ],
      ),
    );
  }
}
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:handygram/generated/l10n.dart';
import 'package:handygra


-base，從而簡化開發過程並提昇效能。

模組<button data-href="#Modules" class="anchor-icon" translate="no">
      <svg translate="no"
        aria-hidden="true"
        focusable="false"
        height="20"
        version="1.1"
        viewBox="0 0 16 16"
        width="16"
      >
        <path
          fill="#0092E4"
          fill-rule="evenodd"
          d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
        ></path>
      </svg>
    </button>

建構 LLM 管道有許多元件。在此，我們將介紹一些關鍵元件，以提供對 DSPy 運作方式的高層次瞭解。

     DSPy 模組

簽名：DSPy 中的簽章 (Signature) 是宣告性的規格，概述模組的輸入/輸出行為，在執行任務時引導語言模型。 模組 (Module)：DSPy 模組是程式利用語言模型 (LM) 的基本元件。它們抽象出各種提示技術，例如連鎖思考或 ReAct，並可適應處理任何 DSPy Signature。這些模組具有可學習的參數，以及處理輸入和產生輸出的能力，可結合形成更大的程式，其靈感來自 PyTorch 中的 NN 模組，但專為 LM 應用程式量身打造。 優化器：DSPy 中的優化器可微調 DSPy 程式的參數，例如提示和 LLM 權重，以最大化指定的準確度等指標，進而提升程式效率。

為


] = "Calças Rasgadas em Combate",
[15486] = "Escudo Rasgado em Combate",
[15487] = "Túnica Rasgada em Combate",
[15488] = "Sobretudo Salpicado de Sangue",
[15489] = "Escarpes Salpicados de Sangue",
[15490] = "Manto Salpicado de Sangue",
[15491] = "Luvas Salpicadas de Sangue",
[15492] = "Faixa Salpicada de Sangue",
[15493] = "Tanga Salpicada de Sangue",
[15494] = "Escudo Salpicado de Sangue",
[15495] = "Munhequeiras Salpicadas de Sangue",
[15496] = "Ombreiras Salpicadas de Sangue",
[15497] = "Cordão do Vanguardeiro",
[15498] = "Sapatilhas do Vanguardeiro",
[15499] = "Manilhas do Vanguardeiro",
[15500] = "Couraça do Vanguardeiro",
[15501] = "Manto do Vanguardeiro",
[15502] = "Luvas do Vanguardeiro",
[15503] = "Guarda-pernas do Vanguardeiro",
[15504] = "Escudo do Vanguardeiro",
[15505] = "Brafoneiras do Vanguardeiro",
[15506] = "Tornozeleiras do Bruto",
[15507] = "Braçadeiras do Bruto",
[15508] = "Capa do Bruto",
[15509] = "Mitenes do Bruto",
[15510] = "Cinto do Bruto",
[15511] = "Guarda-pernas do Bruto",
[15512] = "Escudo do Bruto",
[15513] = "Brafoneiras do Bruto",
[15514] = "Peito d'Armas do Bruto",
[15515] = "Cinto de Malha Farpada",
[15516] = "Sapatilhas de Malha Farpada",
[15517] = "Munhequeiras de Malha Farpada",
[15518] = "Peitoral de Malha Farpada",
[15519] = "Manto de Malha Farpada",
[15520] = "Manoplas de Malha Farpada",
[15521] = "Perneiras de Malha Farpada",
[15522] = "Escudo de Malha Farpada",
[15523] = "Espaldares de Malha Farpada",
[15524] = "Sobretudo da Sentinela",
[15525] = "Sapatilhas da Sentinela",
[15526] = "Capa da Sentinela",
[15527] = "Luvas da Sentinela",
[15528] = "Faixa da Sentinela",
[15529] = "Perneiras da Sentinela",
[15530] = "Escudo da Sentinela",
[15531] = "Guarda-ombros da Sentinela",
[15532] = "Pulseiras da Sentinela",
[15533] = "Diadema da Sentinela",
[15534] = "Botas de Malha Perversas",
[15535] = "Braçadeiras Encadeadas Perversas",
[15536] = "Peito d'Armas Encadeado Perverso",
[15537] = "Manto Encadeado Perverso",
[15538] = "Manoplas Encadeadas Perversas",
[15539] = "Cintel Encadeado Perverso",
[15540] = "Capacete Encadeado Perverso",
[15541] = "Guarda-pernas Encadeadas Perversas",
[15542] = "Ombreiras Encadeadas Perversas",
[15543] = "Escudo Encadeado Perverso",
[15544] = "Escarpes de Escama Grossos",
[15545] = "Braceletes de Escama


def xyxy2xywhn(x, w=640, h=640, clip=False, eps=0.0):
    if clip:
        clip_boxes(x, (h - eps, w - eps))
    y = x.clone() if isinstance(x, torch.Tensor) else np.copy(x)
    y[..., 0] = (x[..., 0] + x[..., 2]) / 2 / w
    y[..., 1] = (x[..., 1] + x[..., 3]) / 2 / h
    y[..., 2] = (x[..., 2] - x[..., 0]) / w
    y[..., 3] = (x[..., 3] - x[..., 1]) / h
    return y


, 160, 175, 69, 213, 92, 253, 225, 19,
    ],
    [
      175, 9, 223, 238, 12, 17, 220, 208, 100, 29, 175, 170, 230, 192, //
      215, 235, 150, 159, 36, 223, 38, 200, 132, 54, 228, 146, 218, 234,
      117, 203, 29, 232, 144, 238, 22, 150, 201, 117, 62, 207, 164, 13, 137,
      245, 127, 67, 247, 28, 155, 43, 203, 107, 233, 53, 143, 46,
    ],
    [
      242, 93, 169, 50, 144, 210, 39, 118, 202, 188, 201, 189, 143, 108, 196, //
      37, 185, 112, 134, 230, 245, 63, 197, 190, 250, 106, 185, 221, 175, 64,
      114, 71, 161, 44, 147, 6, 27, 218, 51, 63, 87, 10, 40, 130, 188, 17,
      163, 31, 176, 170, 4, 107, 232, 7, 94, 166, 224, 124, 86, 47, 11, 204,
    ],
    [
      220, 228, 173, 89, 251, 149, 159, 56, 89, 33, 147, 244, 154, 36, 73, //
      127, 213, 136, 248, 180, 234, 197, 158, 177, 68, 122, 93, 213, 15,
      160, 227, 236, 66, 139, 153, 185, 202, 167, 179, 25, 220, 232, 96,
      210, 231, 136, 223, 239, 181, 241, 59, 52, 172, 25, 49, 232, 211,
      189, 64, 54, 108, 153, 132, 63, 96, 103, 82, 186,
    ]
  ];

  static const int _moduloValue = 0x12D;

  static bool _isInit = false;
  static final List<int> _log = List.filled(256, 0);
  static final List<int> _aLog = List.filled(255, 0);

  static void init() {
    if (_isInit) return;
    _isInit = true;
    int p = 1;
    for (int i = 0; i < 255; i++) {
      _aLog[i] = p;
      _log[p] = i;
      p *= 2;
      if (p >= 256) {
        p ^= _moduloValue;
      }
    }
  }

  ErrorCorrection._();

  /// Creates the ECC200 error correction for an encoded message.
  ///
  /// @param codewords  the codewords
  /// @param symbolInfo information about the symbol to be encoded
  /// @return the codewords with interleaved error correction.
  static String encodeECC200(String codewords, SymbolInfo symbolInfo) {
    if (codewords.length != symbolInfo.dataCapacity) {
      throw ArgumentError(
        'The number of codewords does not match the selected symbol',
      );
    }
    final sb = StringBuilder();
    sb.write(codewords);
    final blockCount = symbolInfo.interleavedBlockCount;
    if (blockCount == 1) {
      final ecc = _createECCBlock(codewords, symbolInfo.errorCodewords);
      sb.write(ecc);
    } else {
      sb.setLength(symbolInfo.dataCapacity + symbolInfo.errorCodewords);
      // this is using for temp StringBuffer's init length
      //List<int> dataSizes = List.generate(blockCount, (index) => symbolInfo.getDataLengthForInterleavedBlock(index + 1));
      final errorSizes = List.generate(
        blockCount,
        (index) => symbolInfo.getErrorLengthForInterleavedBlock(index + 1),
      );

      for (int block = 0; block < blockCount; block++) {
        final temp = StringBuffer();
        for (int d = block; d < symbolInfo.dataCapacity; d += blockCount) {
          temp.write(codewords[d]);
        }
        final ecc = _createECCBlock(temp.toString(), errorSizes[block]);
        int pos = 0;
        for (int e = block;
            e < errorSizes[block] * blockCount;
            e += blockCount) {
          sb.


(
                    Float4(a[0], a[4], a[8],  a[12]),
                    Float4(a[1], a[5], a[9],  a[13]),
                    Float4(a[2], a[6], a[10], a[14]),
                    Float4(a[3], a[7], a[11], a[15])
            )
        }

        fun identity() = Mat4()
    }

    inline var right: Float3
        get() = x.xyz
        set(value) {
            x.xyz = value
        }
    inline var up: Float3
        get() = y.xyz
        set(value) {
            y.xyz = value
        }
    inline var forward: Float3
        get() = z.xyz
        set(value) {
            z.xyz = value
        }
    inline var position: Float3
        get() = w.xyz
        set(value) {
            w.xyz = value
        }

    inline val scale: Float3
        get() = Float3(length(x.xyz), length(y.xyz), length(z.xyz))
    inline val translation: Float3
        get() = w.xyz
    val rotation: Float3
        get() {
            val x = normalize(right)
            val y = normalize(up)
            val z = normalize(forward)

            return when {
                z.y <= -1.0f -> Float3(degrees(-HALF_PI), 0.0f, degrees(atan2( x.z,  y.z)))
                z.y >=  1.0f -> Float3(degrees( HALF_PI), 0.0f, degrees(atan2(-x.z, -y.z)))
                else -> Float3(
                        degrees(-asin(z.y)), degrees(-atan2(z.x, z.z)), degrees(atan2( x.y,  y.y)))
            }
        }

    inline val upperLeft: Mat3
        get() = Mat3(x.xyz, y.xyz, z.xyz)

    operator fun get(column: Int) = when (column) {
        0 -> x
        1 -> y
        2 -> z
        3 -> w
        else -> throw IllegalArgumentException("column must be in 0..3")
    }
    operator fun get(column: Int, row: Int) = get(column)[row]

    operator fun get(column: MatrixColumn) = when (column) {
        MatrixColumn.X -> x
        MatrixColumn.Y -> y
        MatrixColumn.Z -> z
        MatrixColumn.W -> w
    }
    operator fun get(column: MatrixColumn, row: Int) = get(column)[row]

    operator fun invoke(row: Int, column: Int) = get(column - 1)[row - 1]
    operator fun invoke(row: Int, column: Int, v: Float) = set(column - 1, row - 1, v)

    operator fun set(column: Int, v: Float4) {
        this[column].xyzw = v
    }
    operator fun set(column: Int, row: Int, v: Float) {
        this[column][row] = v
    }

    operator fun unaryMinus() = Mat4(-x, -y, -z, -w)
    operator fun inc() = Mat4(x++, y++, z++, w++)
    operator fun dec() = Mat4(x--, y--, z--, w--)

    ope


ng, time: String) {
        ChatUtils.chat("§r§aPlot §r§7- §r§b$plot §r§7was sprayed with §r§a$spray§r§7!§r")
        ChatUtils.chat("§r§7This will expire in §r§a$time§r§7!§r")
    }

    private fun sprayMessageEligible(
        sprayExpiryTime: SimpleTimeMark, expectedExpireTime: SimpleTimeMark, currentSpray: SprayType, newSpray: SprayType,
    ): Boolean {
        return (sprayExpiryTime <= expectedExpireTime - 10.minutes || currentSpray != newSpray) &&
            (config.newSprayNotification && sprayExpiryTime >= SimpleTimeMark.now() + 1.minutes)
    }

    fun Plot.isBarn() = id == 0

    fun Plot.isPlayerInside() = box.isPlayerInside()

    fun getPlot(location: LorenzVec) = plots.find { it.box.isInside(location) }

    fun Plot.sendTeleportTo() {
        if (isBarn()) HypixelCommands.teleportToPlot("barn")
        else HypixelCommands.teleportToPlot(name)
        LockMouseLook.unlockMouse()
    }

    init {
        val plotMap = listOf(
            listOf(21, 13, 9, 14, 22),
            listOf(15, 5, 1, 6, 16),
            listOf(10, 2, 0, 3, 11),
            listOf(17, 7, 4, 8, 18),
            listOf(23, 19, 12, 20, 24),
        )
        val list = mutableListOf<Plot>()
        var slot = 2
        for ((y, rows) in plotMap.withIndex()) {
            for ((x, id) in rows.withIndex()) {
                val minX = ((x - 2) * 96 - 48).toDouble()
                val minY = ((y - 2) * 96 - 48).toDouble()
                val maxX = ((x - 2) * 96 + 48).toDouble()
                val maxY = ((y - 2) * 96 + 48).toDouble()
                val a = LorenzVec(minX, 0.0, minY)
                val b = LorenzVec(maxX, 256.0, maxY)
                val middle = a.middle(b).copy(y = 10.0)
                val box = a.axisAlignedTo(b).expand(0.0001, 0.0, 0.0001)
                list.add(Plot(id, slot, box, middle))
                slot++
            }
            slot += 4
        }
        plots = list
    }

    @HandleEvent(onlyOnIsland = IslandType.GARDEN)
    fun onChat(event: SkyHanniChatEvent) {

        plotSprayedPattern.matchMatcher(event.message) {
            val sprayName = group("spray")
            val plotName = group("plot")

            val plot = getPlotByName(plotName)
            val spray = SprayType.getByNameOrNull(sprayName) ?: return

            plot?.setSpray(spray, 30.minutes)

        }
        cleanPlotChatPattern.matchMatcher(event.message) {
            val plotId = group("plot").toInt()
            val plot = getPlotByID(plotId)
            plot?.uncleared = false
        }
        unlockPlotChatPattern.matchMatcher(event.message) {
            val plotId = group("plot").toInt()
            val plot = getPlotByID(plotId)
            plot?.locked = false
        }

        portableWasherPattern.matchMatcher(event.message) {
            for (plot in plots) {
                if (plot.currentSpray != null) {
                    plot.removeSpray()
                }
            }
        }
    }

    private fun getPlotByID(plotId: Int) = plots.firstOrNull { it.id == plotId }

    @HandleEvent(onlyOnIsland = IslandType.GARDEN)
    fun onInventoryFullyOpened(event: InventoryFullyOpenedEvent) {
        if (event.inventoryName != "Configure Plots") return

        for (plot in plots) {
            val itemStack = event.inventoryItems[plot.in


sert.state(!StrUtil.equals(projectInfoModel.getLinkId(), id), StrUtil.format(I18nMessageUtil.get("i18n.project_soft_linked_by.8556"), projectInfoModel.getName()));
        }
        this.thorough(thorough, nodeProjectInfoModel);
        //
        projectInfoService.deleteItem(nodeProjectInfoModel.getId());

        return JsonMessage.success(I18nMessageUtil.get("i18n.deletion_success_message.4359"));

    }

    /**
     * 彻底删除项目文件
     *
     * @param thorough             是否彻底
     * @param nodeProjectInfoModel 项目
     */
    private void thorough(String thorough, NodeProjectInfoModel nodeProjectInfoModel) {
        if (StrUtil.isEmpty(thorough)) {
            return;
        }
        File logBack = this.projectInfoService.resolveLogBack(nodeProjectInfoModel);
        boolean fastDel = CommandUtil.systemFastDel(logBack);
        Assert.state(!fastDel, I18nMessageUtil.get("i18n.delete_log_file_failure_with_colon.d867") + logBack.getAbsolutePath());
        File log = this.projectInfoService.resolveAbsoluteLogFile(nodeProjectInfoModel);
        fastDel = CommandUtil.systemFastDel(log);
        Assert.state(!fastDel, I18nMessageUtil.get("i18n.delete_log_file_failure_with_colon.d867") + log.getAbsolutePath());
        //
        if (nodeProjectInfoModel.getRunMode() != RunMode.Link) {
            // 非软链项目才删除文件
            File allLib = projectInfoService.resolveLibFile(nodeProjectInfoModel);
            fastDel = CommandUtil.systemFastDel(allLib);
            Assert.state(!fastDel, I18nMessageUtil.get("i18n.delete_project_file_failure.f007") + allLib.getAbsolutePath());
        }
    }

    @RequestMapping(value = "releaseOutGiving", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public IJsonMessage<Object> releaseOutGiving() {
        NodeProjectInfoModel nodeProjectInfoModel = tryGetProjectInfoModel();
        if (nodeProjectInfoModel != null) {
            NodeProjectInfoModel update = new NodeProjectInfoModel();
            update.setOutGivingProject(false);
            projectInfoService.updateById(update, nodeProjectInfoModel.getId());
        }
        return JsonMessage.success(I18nMessageUtil.get("i18n.release_successful.f2ca"));
    }

    @RequestMapping(value = "change-workspace-id", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public IJsonMessage<Object> changeWorkspaceId(String newWorkspaceId, String newNodeId) {
        Assert.hasText(newWorkspaceId, I18nMessageUtil.get("i18n.select_workspace_to_modify.ac87"));
        Assert.hasText(newWorkspaceId, I18nMessageUtil.get("i18n.select_node_to_modify.6617"));
        NodeProjectInfoModel nodeProjectInfoModel = tryGetProjectInfoModel();
        if (nodeProjectInfoModel != null) {
            NodeProjectInfoModel update = new NodeProjectInfoModel();
            update.setNodeId(newNodeId);
            update.setWorkspaceId(newWorkspaceId);
            projectInfoService.updateById(update, nodeProjectInfoModel.getId());
        }
        return JsonMessage.success(I18nMessageUtil.get("i18n.modify_success.69be"));
    }
}
/*
 * Copyright (c) 2019 Of Him Code Technology Studio
 * Jpom is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * 			http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS"


 cc.Node[] = []
    @property(cc.Node) // 兵种描述节点
    soldierDescriptionNode = null
    @property(cc.Node) // 招募按钮
    recruitButton = null
    @property(cc.Prefab) // 兵种预制资源
    soldierPrefab = null
    @property(cc.Prefab) // 怪物预制资源
    monsterPrefab = null
    @property(cc.Node) // 背景层，挂载关卡主界面的节点
    background: cc.Node = null
    @property(cc.Node) // 显示金币数量的节点
    coinDescriptionNode:cc.Node = null
    @property(cc.Node) // 倒计时节点
    timeRemainNode:cc.Node = null
    @property(cc.Node) // 关卡结算界面节点
    stageEndInfo:cc.Node = null
    @property(cc.Node) // 暂停游戏按钮
    pauseButton:cc.Node = null
    @property(cc.Node) // 暂停面板
    pauseNode:cc.Node = null
    @property(cc.Node) // 时间速率调整按钮
    timeButtonNode:cc.Node = null

    // =====================================================

    @property(cc.Node) // 游戏主菜单节点
    _menu:cc.Node = null
    @property // 当前关卡ID
    _stageId:string = ''
    @property(cc.Vec2) // 当前关卡出兵点坐标
    _castlePosition = null;
    @property(cc.Vec2) // 当前关卡出怪点坐标
    _dungeonPosition = null;
    @property // 金币
    _coin: number = 200;
    @property // 关卡开始时间
    _gameTime:number = 0
    @property // 关卡倒计时
    _timeRemain:number = 100
    @property // 怪物生成器相关参数
    _monsterArranger:any = {
        monsterlist:[],
        nextMonster:0
    }
    @property // 被选中的兵种按钮
    _buttonChosen: number = -1
    @property // 被消灭怪物数量
    _monsterDestroyed: number = 0
    @property // 是否已经胜利，如果已经胜利则倒计时结束时关卡不会失败
    _isWin:boolean = false

    // =====================================================

    // 关卡初始化
    initGame(stage:string){
        // 初始化节点列表
        Common.monsterNodes = []
        Common.soldierNodes = []

        // 关卡ID赋值
        this._stageId = stage

        // 获取关卡数据
        let stageData = Common.stageData[stage]

        // 初始化关卡结算界面
        this.initStageEndInfo()

        // 设置出怪点（地牢）和城堡（出兵点）
        this._castlePosition = stageData.castlePosition
        this._dungeonPosition = stageData.dungeonPosition
        this.castle.setPosition(this._castlePosition)
        this.dungeon.setPosition(this._dungeonPosition)

        // 初始化金币数量，设置定时获取金币
        this._coin = stageData.coin
        this.changeCoin(0)
        this.schedule(()=>{
            this.changeCoin(stageData.coinGain)
        },Common.coinGainInterval)

        // 初始化招募功能界面并绑定点击事件
        this.initButtonGroup()
        this.resetButtonGroup()

        // 设置关卡倒计时，倒计时结束关卡失败
        this.scheduleOnce(()=>{
            if(!this._isWin){
                this.gameFail()


ce2_data_intmax("negotiate_using_fetch", the_repository,
				   "in_vain", in_vain);

		/* Send request */
		packet_buf_flush(&req_buf);
		if (write_in_full(fd[1], req_buf.buf, req_buf.len) < 0)
			die_errno(_("unable to write request to remote"));

		/* Process ACKs/NAKs */
		process_section_header(&reader, "acknowledgments", 0);
		while (process_ack(&negotiator, &reader, &common_oid,
				   &received_ready)) {
			struct commit *commit = lookup_commit(the_repository,
							      &common_oid);
			if (commit) {
				timestamp_t generation;

				parse_commit_or_die(commit);
				commit->object.flags |= COMMON;
				generation = commit_graph_generation(commit);
				if (generation < min_generation)
					min_generation = generation;
			}
			in_vain = 0;
			seen_ack = 1;
			oidset_insert(acked_commits, &common_oid);
		}
		if (received_ready)
			die(_("unexpected 'ready' from remote"));
		else
			do_check_stateless_delimiter(stateless_rpc, &reader);
		if (can_all_from_reach_with_flag(&nt_object_array, COMMON,
						 REACH_SCRATCH, 0,
						 min_generation))
			last_iteration = 1;
		trace2_region_leave_printf("negotiation", "round",
					   the_repository, "%d",
					   negotiation_round);
	}
	trace2_region_leave("fetch-pack", "negotiate_using_fetch", the_repository);
	trace2_data_intmax("negotiate_using_fetch", the_repository,
			   "total_rounds", negotiation_round);

	clear_common_flag(acked_commits);
	object_array_clear(&nt_object_array);
	negotiator.release(&negotiator);
	strbuf_release(&req_buf);
}

int report_unmatched_refs(struct ref **sought, int nr_sought)
{
	int i, ret = 0;

	for (i = 0; i < nr_sought; i++) {
		if (!sought[i])
			continue;
		switch (sought[i]->match_status) {
		case REF_MATCHED:
			continue;
		case REF_NOT_MATCHED:
			error(_("no such remote ref %s"), sought[i]->name);
			break;
		case REF_UNADVERTISED_NOT_ALLOWED:
			error(_("Server does not allow request for unadvertised object %s"),
			      sought[i]->name);
			break;
		}
		ret = 1;
	}
	return ret;
}


_BASE + 0x05)

serial_print_char16:
	.code16
	pushw	%bp
	movw	%sp, %bp
	# The character to print is in al
	pushw	%ax

	# Wait until the serial port is ready to receive characters
serial_print_char16.1:
	movw	$TTYS0_LSR, %dx
	inb	%dx, %al
	testb	$0x20, %al
	jz	serial_print_char16.1

	# Output the character
	movw	$TTYS0_TBR, %dx
	movb	-2(%bp), %al
	outb	%al, %dx

	# Wait until the serial port has transmitted the character
serial_print_char16.2:
	movw	$TTYS0_LSR, %dx
	inb	%dx, %al
	testb	$0x40, %al
	jz	serial_print_char16.2

	# Restore %eax
	popw	%ax
	# Return to caller
	popw	%bp
	retw

s_a20_err_msg:
	.asciz	"A20 gate not responding!\r\n"

s_in_real_mode:
	.asciz	"In real mode.\r\n"
s_base_memory_size:
	.asciz	"Base memory size: "
s_interrupts_enabled:
	.asciz	"Interrupts enabled.\r\n"
s_a20_disabled:
	.asciz	"A20 disabled.\r\n"
s_a20_cant_disable:
	.asciz	"Can not A20 line.\r\n"
s_a20_enabled:
	.asciz	"A20 enabled\r\n"
s_interrupts_disabled:
	.asciz	"Interrupts disabled.\r\n"

s_meme820:	.asciz	"E820 Memory Map.\r\n"
s_at:		.asciz	" @ "
s_type:		.asciz	" type: "


                ctx.stroke();
            }
            else{
                if(circulo){  // debe ser un CIRCULO
                    ctx.beginPath();
                    ctx.arc(pX, pY, ancho, alto, Math.PI*2);
                    ctx.fill();
                    ctx.stroke();
                }
                else{
                    if(lados == 5 && cuadro == false){
                        ctx.beginPath();
                        ctx.moveTo(pX, pY);
                        for( var i = 0;i<lados;i++){
                            switch(i){
                                case 1: ancho -= 20; alto += 70; break;
                                case 2: ancho -= 20; alto -= 3; break;
                                case 3: ancho += 12; alto -= 50; break;
                                case 4: ancho -= 221; break;
                            }
                            ctx.lineTo(ancho, alto);
                        }
                        ctx.fillStyle = "black";
                        ctx.fill();
                        ctx.stroke();
                    }
                }
            }
        }
    }
}

var tren:Tren = new Tren();

var canvas:any = document.getElementById("caja");
if(canvas != undefined && canvas.getContext){
    tren.nombre = "Tren ChuChu"                  // NOMBRE MAS G.... IMPOSIBLE
    var ancho:number = canvas.width;
    var alto:number = canvas.height;
    var ctx:CanvasRenderingContext2D = canvas.getContext("2d");
    ctx.font = "50px rockwell";
    ctx.fillText(tren.nombre, 20, 50);
                                          // aqui se coloca la matriz pixeles, en donde se ubica las coordenadas de las figuras, los rieles y el piso

    tren.pintar(ctx, 50, 500, 1000, 30, 0, true, false, false);
    tren.pintar(ctx, 0, 620, canvas.width, 80, 0, true, false, false);
    tren.pintar(ctx, 0, 610, 250, 615, 5, false, false, false);
    tren.pintar(ctx, 200, 610, 400, 615, 5, false, false, false);
    tren.pintar(ctx, 400, 615, 550, 615, 5, false, false, false);
    tren.pintar(ctx, 550, 614, 700, 615, 5, false, false, false);
    tren.pintar(ctx, 700, 614, 850, 615, 5, false, false, false);
    tren.pintar(ctx, 850, 614, 1000, 615, 5, false, false, false);
    tren.pintar(ctx, 1000, 614, 1150, 615, 5, false, false, false);
    tren.pintar(ctx, 1150, 614, 1300, 615, 5, false, false, false);
    tren.pintar(ctx, 1300, 614, 1450, 615, 5, false, false, false);
    tren.pintar(ctx, 1450, 614, 1600, 615, 5, false, false, false);
    tren.pintar(ctx, 1600, 614, 1750, 615, 5, false, false, false);
    tren.pintar(ctx, 1750, 614, 1900, 615, 5, false, false, false);
    let x:number = 80;
    for(var i = 0;i<3;i++){
        tren.pintar(ctx, x, 350, 200, 200, 0, true, false, false);
        tren.pintar(ctx, x+100, 570, 60, 0, 0, false, true, false);
        x += 270;
    }
    tren.pintar(ctx, 140, 350, 135, 350, 5, false, false, true);
    tren.pintar(ctx, 390, 350, 405, 350, 4, false, false, true);
    tren.pintar(ctx, 680, 350, 680, 350, 7, false, false, true);
    tren.pintar(ctx, x, 150, 320, 400, 0, true, false, false);
    tren.pintar(ctx, x-50, 100, 410, 50, 0, true, false, false);
    tren.pintar(ctx, x+50, 200, 200, 200, 0, true, false, false);
    tren.pintar(ctx, x+320, 250, 300, 300, 0, true, false, false);
    tren.pintar(ctx, x+470, 160, 90, 90, 0, true, false, false);
    tren.pintar(ctx, x+440, 110, 150, 90, 0, true, false, false);
    tren.pintar(ctx, x+


BlitRenderTargetPass::Warmup()
{
}

void BlitRenderTargetPass::UpdateView(const float* pViewMatrix, const float* pProjectionMatrix)
{
}

void BlitRenderTargetPass::Render(float deltaTime)
{
	constexpr StringCrc sceneRenderTarget("SceneRenderTarget");
	const RenderTarget* pSceneRT = GetRenderContext()->GetRenderTarget(sceneRenderTarget);
	bgfx::TextureHandle sceneColorTextureHandle = pSceneRT->GetTextureHandle(0);
	bgfx::TextureHandle emissColorTextureHandle = pSceneRT->GetTextureHandle(1);
	bgfx::TextureHandle depthColorTextureHandle = pSceneRT->GetTextureHandle(2);

	constexpr StringCrc sceneRenderTargetBlitSRV("SceneRenderTargetBlitSRV");
	constexpr StringCrc sceneRenderTargetBlitEmissColor("SceneRenderTargetBlitEmissColor");
	constexpr StringCrc sceneRenderTargetBlitDepthColor("SceneRenderTargetBlitDepthColor");

	bgfx::TextureHandle blitTargetSRVHandle = GetRenderContext()->GetTexture(sceneRenderTargetBlitSRV);
	bgfx::TextureHandle blitTargetEmissColorHandle = GetRenderContext()->GetTexture(sceneRenderTargetBlitEmissColor);
	bgfx::TextureHandle blitTargetDepthColorHandle = GetRenderContext()->GetTexture(sceneRenderTargetBlitDepthColor);

	bool buildSRV = false;
	if (bgfx::isValid(blitTargetSRVHandle))
	{
		if (pSceneRT->GetWidth() != m_blitTextureWidth ||
			pSceneRT->GetHeight() != m_blitTextureHeight)
		{
			bgfx::destroy(blitTargetSRVHandle);
			bgfx::destroy(blitTargetEmissColorHandle);
			bgfx::destroy(blitTargetDepthColorHandle);
			buildSRV = true;
		}
	}
	else
	{
		buildSRV = true;
	}

	if (buildSRV)
	{
		m_blitTextureWidth = pSceneRT->GetWidth();
		m_blitTextureHeight = pSceneRT->GetHeight();
		blitTargetSRVHandle = bgfx::createTexture2D(m_blitTextureWidth, m_blitTextureHeight, false, 1, bgfx::TextureFormat::RGBA32F,
			BGFX_TEXTURE_BLIT_DST | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
		GetRenderContext()->SetTexture(sceneRenderTargetBlitSRV, blitTargetSRVHandle);

		blitTargetEmissColorHandle = bgfx::createTexture2D(m_blitTextureWidth, m_blitTextureHeight, false, 1, bgfx::TextureFormat::RGBA32F,
			BGFX_TEXTURE_BLIT_DST | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
		GetRenderContext()->SetTexture(sceneRenderTargetBlitEmissColor, blitTargetEmissColorHandle);

		blitTargetDepthColorHandle = bgfx::createTexture2D(m_blitTextureWidth, m_blitTextureHeight, false, 1, bgfx::TextureFormat::D32F,
			BGFX_TEXTURE_BLIT_DST | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
		GetRenderContext()->SetTexture(sceneRenderTargetBlitDepthColor, blitTargetDepthColorHandle);
	}

	bgfx::blit(GetViewID(), blitTargetSRVHandle, 0, 0, sceneColorTextureHandle);
	bgfx::blit(GetViewID(), blitTargetEmissColorHandle, 0, 0, emissColorTextureHandle);
	bgfx::blit(GetViewID(), blitTargetDepthColorHandle, 0, 0, depthColorTextureHandle);
}

}#include "DDGIRenderer.h"

#include "ECWorld/CameraComponent.h"
#include "ECWorld/MaterialComponent.h


_TITLE, "Caméra", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON1, "Verrouillé pour les personnages <<1>> jusqu'à la fin de la campagne (<<2>>).", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON2, "Verrouillé pour les personnages <<1>> quand <<2>> est affecté à cette campagne.", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON3, "Verrouillé pour les personnages <<1>> jusqu'à ce que la campagne (<<2>>) se termine et que <<3>> n'y est plus affecté.", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON_DIALOGMESSAGE1, "Pour lever cette restriction, vous devez attendre la fin de la campagne (<<1>>).", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON_DIALOGMESSAGE2, "Pour lever cette restriction, vous devez soit abandonner, soit changer la campagne principale de tous les personnages affectés à cette campagne.", 0)
SAS(SI_CAMPAIGNALLIANCELOCKREASON_DIALOGMESSAGE3, "Pour lever cette restriction, vous devez attendre que cette campagne (<<1>>) prenne fin, et vous assurer qu'aucun de vos personnages n'y soit affecté.", 0)
SAS(SI_CAMPAIGNLEVELREQUIREMENTTYPE0, "Aucun", 0)
SAS(SI_CAMPAIGNLEVELREQUIREMENTTYPE1, "Niveau du joueur", 0)
SAS(SI_CAMPAIGNLEVELREQUIREMENTTYPE2, "Points de Champion", 3)
SAS(SI_CAMPAIGNPOPULATIONTYPE0, "Bas", 0)
SAS(SI_CAMPAIGNPOPULATIONTYPE1, "Moyen", 0)
SAS(SI_CAMPAIGNPOPULATIONTYPE2, "Haut", 0)
SAS(SI_CAMPAIGNPOPULATIONTYPE3, "Complet", 0)
SAS(SI_CAMPAIGNREASSIGNMENTERRORREASON13, "Vous ne répondez pas aux critères de sélection de cette campagne.", 1)
SAS(SI_CAMPAIGNREASSIGNMENTERRORREASON14, "Les campagnes sont désactivées sur ce serveur.", 1)
SAS(SI_CAMPAIGNREASSIGNMENTERRORREASON15, "Vous n'avez pas le niveau minimum requis pour rejoindre cette campagne.", 0)
SAS(SI_CAMPAIGNREASSIGNMENTERRORREASON17, "Cette campagne est actuellement inaccessible aux membres de certaines alliances.", 0)
SAS(SI_CAMPAIGNREASSIGNMENTERRORREASON5, "Un personnage appartenant à une alliance rivale est déjà affecté à cette campagne.", 3)
SAS(SI_CAMPAIGNRULESETTYPE1, "Cyrodiil", 1)
SAS(SI_CAMPAIGNRULESETTYPE4, "Cité impériale", 0)
SAS(SI_CAMPAIGN_ABDICATE_EMPEROR, "(<<1>>) Le <<2{empereur/impératrice}>> <<2>> d'un <<3>> a abdiqué !", 0)
SAS(SI_CAMPAIGN_ALLIANCE_LOCK_PENDING_DISMISS_BUTTON, "Annuler", 0)
SAS(SI_CAMPAIGN_ALLIANCE_LOCK_PENDING_MESSAGE, "<<1>> sera verrouillée aux personnages de <<2>>


/cdn/expire-1-M/twitter-bootstrap/3.3.5/css/bootstrap-theme.min.css">

            <link href="{{ url_for('admin.static', filename='css/admin.css')}}" rel="stylesheet">
        {% endblock %}

        {% block js %}

        {% endblock %}

欢迎使用H3BLOG博客系统

连接数据库配置

                                <form method="post" role="form" action="{{url_for("admin.setup", step=2)}}">
                                    {{ form.hidden_tag() }}

                                        {{ form.uri(class="form-control", placeholder="mysql+pymysql://{账号}:{密码}@{ip:port}/{数据库}?charset=utf8", required="", autofocus="") }}

                                        mysql配置案例：mysql+pymysql://root:123456@127.0.0.1/h3blog?charset=utf8

                                        sqlite配置案例：sqlite:///data-dev.db

                                        {{ form.submit(class="btn btn-primary") }}

                                </form>

                                    {% for fie


#!/usr/bin/env python
# coding: UTF-8

# pt-show-locks
#
# Copyright(c) 2015-2018 Uptime Technologies, LLC.

import getopt
import os
import sys

import PsqlWrapper

class ShowLastAnalyzed:
    def __init__(self, psql, debug=False):
        self.debug = debug

        self.psql = psql

        self.query = '''
select
  schemaname as "SCHEMA",
  relname as "TABLE",
  case
    when last_analyze is null then last_autoanalyze
    when last_autoanalyze is null then last_analyze
    when last_autoanalyze > last_analyze then last_autoanalyze
    else last_analyze
  end "LAST_ANALYZED"
from
  pg_stat_user_tables
order by
  3 nulls first;
'''

        if self.debug is True:
            print self.query

    def get(self):
        rs = self.psql.execute_query(self.query)

        self.psql.print_result(rs)

        return True

def usage():
    print '''
Usage: {0} [option...]

Options:
    -h, --host=HOSTNAME        Host name of the postgres server
    -p, --port=PORT            Port number of the postgres server
    -U, --username=USERNAME    User name to connect
    -d, --dbname=DBNAME        Database name to connect

    --help                     Print this help.
'''.format(os.path.basename(sys.argv[0]))

def main():
    try:
        opts, args = getopt.getopt(sys.argv[1:], "h:p:U:d:o:n:t:i:u",
                                   ["help", "debug", "host=", "port=",
                                    "username=", "dbname=",
                                    "owner=", "schema=", "table="])
    except getopt.GetoptError as ex:
        print str(err)
        usage()
        sys.exit(2)

    host = None
    port = None
    username = None
    dbname = None

    debug = None

    for o, a in opts:
        if o in ("-h", "--host"):
            host = a
        elif o in ("-p", "--port"):
            port = int(a)
        elif o in ("-U", "--username"):
            username = a
        elif o in ("-d", "--dbname"):
            dbname = a
        elif o in ("--debug"):
            debug = True
        elif o in ("--help"):
            usage()
            sys.exit(0)
        else:
            print "unknown option: " + o + "," + a
            sys.exit(1)

    p = PsqlWrapper.PsqlWrapper(host=host, port=port, username=username,
                                dbname=dbname, debug=debug)

    last_analyzed = ShowLastAnalyzed(p, debug=debug)
    if not last_analyzed.get():
        sys.exit(1)

    sys.exit(0)


ting', () => {
      store.dispatch(
        store.actions.datasource.sortDataSource({
          id: 'someDataSource',
          sortField: 'value',
          sortDirection: 'desc',
        })
      );
      store.dispatch(
        store.actions.datasource.filterDataSource({
          id: 'someDataSource',
          textFilter: 'keep',
          field: 'prop',
        })
      );
      expect(store.getState().datasource.someDataSource.data[0].id).toBe('c');
      store.dispatch(
        store.actions.datasource.mapDataSource('someDataSource', (record) => {
          if (record.value === 3) {
            record.value = -1;
          }
          return record;
        })
      );
      expect(store.getState().datasource.someDataSource.data[0].id).toBe('c');
    });
  });
  describe('sortFunc', () => {
    it('sorts by the primary field', () => {
      const arr = [{ name: 'b' }, { name: 'a' }];
      arr.sort(sortFunc('name', null, 'asc'));
      expect(arr[0].name).toBe('a');
    });
    it('tie breaks with the baseSortField', () => {
      const arr = [
        { id: 1, name: 'a' },
        { id: 0, name: 'a' },
      ];
      arr.sort(sortFunc('name', 'id', 'asc'));
      expect(arr[0].id).toBe(0);
    });
  });
});

const delay = (ms: number) =>
  new Promise<void>((resolve) => setTimeout(() => resolve(), ms));
import { Ingredient } from '../shared/ingredient.model'

export class Recipe{
	public name: string;
	public description: string;
	public imgPath: string;
	public ingredient:Ingredient[]

	constructor(name:string, description:string, imgPath:string, ingredient:Ingredient[]) {
		this.name = name
		this.description = description
		this.imgPath = imgPath
		this.ingredient = ingredient
	}
}import { ENABLE_DIAGNOSTICS } from '../config';

const divider = '\n-----------------------------------';

/**
 * Print canned message when the server starts
 *
 * @param {String} port The port the server is running on
 * @param {String} ip The IP the server is running on
 * @param {String} appName Human-friendly name of the app (e.g 'PDF microservice')
 */
export const startedMessage = (port: string | number, ip: string, appName: string) => {
  console.log(`\n${appName} API started`);
  console.log(`Access URLs: ${divider}`);
  console.log(`Localhost: http://localhost:${port}`);
  console.log(`      LAN: http://${ip}:${port} ${divider}`);

  if (process.env.NODE_ENV === 'development') {
    console.log(`Press 'CTRL-C' to stop\n`);
  }
}

export const sysdebug = (message: string) => {
  if (ENABLE_DIAGNOSTICS) { console.log(message); }
};

export class Stopwatch {
  private startAt: number;
  private end = 0;

  // in milliseconds
  get time(): number {
    return this.end;
  }
  get words(): string {
    return `Execution time: ${this.time}ms`;
  }
  start(): Stopwatch {
    if (ENABLE_DIAGNOSTICS) { this.startAt = Date.now(); }
    return this;
  }
  stop(): void {
    if (ENABLE_DIAGNOSTICS) { this.end = Date.now() - this.startAt; }
  }
}
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Storage } from '@ionic/storage';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  /// base values
  item: string;
  quantity: number;
  myCartItems: any;

  constructor(public navCtrl: NavController,
    private


, b2
	LDF	[AO +  6 * SIZE], b3
	LDF	[AO +  7 * SIZE], b4

	FSUB	a1, c01, c01
	FSUB	a2, c02, c02
	FSUB	a3, c03, c03
	FSUB	a4, c04, c04

	FSUB	b1, c05, c05
	FSUB	b2, c06, c06
	FSUB	b3, c07, c07
	FSUB	b4, c08, c08

#endif

#ifdef LN
	LDF	[AO +  3 * SIZE], a1
	LDF	[AO +  2 * SIZE], a2
	LDF	[AO +  0 * SIZE], a3

	FMUL	a1, c02, c02
	FMUL	a1, c04, c04
	FMUL	a1, c06, c06
	FMUL	a1, c08, c08

	FNMSUB	(aa2, cc02, cc01, cc01)
	FNMSUB	(aa2, cc04, cc03, cc03)
	FNMSUB	(aa2, cc06, cc05, cc05)
	FNMSUB	(aa2, cc08, cc07, cc07)

	FMUL	a3, c01, c01
	FMUL	a3, c03, c03
	FMUL	a3, c05, c05
	FMUL	a3, c07, c07
#endif

#ifdef LT
	LDF	[AO +  0 * SIZE], a1
	LDF	[AO +  1 * SIZE], a2
	LDF	[AO +  3 * SIZE], a3

	FMUL	a1, c01, c01
	FMUL	a1, c03, c03
	FMUL	a1, c05, c05
	FMUL	a1, c07, c07

	FNMSUB	(aa2, cc01, cc02, cc02)
	FNMSUB	(aa2, cc03, cc04, cc04)
	FNMSUB	(aa2, cc05, cc06, cc06)
	FNMSUB	(aa2, cc07, cc08, cc08)

	FMUL	a3, c02, c02
	FMUL	a3, c04, c04
	FMUL	a3, c06, c06
	FMUL	a3, c08, c08
#endif

#ifdef RN
	LDF	[BO +  0 * SIZE], a1
	LDF	[BO +  1 * SIZE], a2
	LDF	[BO +  2 * SIZE], a3
	LDF	[BO +  3 * SIZE], a4

	FMUL	a1, c01, c01
	FMUL	a1, c02, c02

	FNMSUB	(aa2, cc01, cc03, cc03)
	FNMSUB	(aa2, cc02, cc04, cc04)
	FNMSUB	(aa3, cc01, cc05, cc05)
	FNMSUB	(aa3, cc02, cc06, cc06)
	FNMSUB	(aa4, cc01, cc07, cc07)
	FNMSUB	(aa4, cc02, cc08, cc08)

	LDF	[BO +  5 * SIZE], a1
	LDF	[BO +  6 * SIZE], a2
	LDF	[BO +  7 * SIZE], a3

	FMUL	a1, c03, c03
	FMUL	a1, c04, c04

	FNMSUB	(aa2, cc03, cc05, cc05)
	FNMSUB	(aa2, cc04, cc06, cc06)
	FNMSUB	(aa3, cc03, cc07, cc07)
	FNMSUB	(aa3, cc04, cc08, cc08)

	LDF	[BO + 10 * SIZE], a1
	LDF	[BO + 11 * SIZE], a2

	FMUL	a1, c05, c05
	FMUL	a1, c06, c06

	FNMSUB	(aa2, cc05


�
 3. 用户界面：简化复杂操作的图形化前端

第二章 系统部署全流程

2.1 安全获取安装包

建议通过以下渠道获取：
 - 官方网站（注意验证PGP签名）
 - GitHub官方仓库的Release页面
 - 受信任的第三方镜像站

警示：2023年已出现仿冒"汉堡云Clash Pro"的恶意软件，务必校验SHA-256哈希值

2.2 跨平台安装指南

Windows系统：
 1. 右键安装包以管理员身份运行
 2. 自定义安装路径时避免中文目录
 3. 安装完成后自动创建防火墙规则

macOS系统：
 ```bash</p>  <h1>使用Homebrew安装更便捷  <p>brew install --cask hamburg-cloud-clash ```

移动端注意事项：
 Android需手动授予VPN权限，iOS用户需通过TestFlight获取特定版本

第三章 深度配置实战

3.1 配置文件的艺术

典型YAML配置结构解析：
 yaml proxies:   - name: "东京节点"     type: vmess     server: tk.example.com     port: 443     uuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx     alterId: 64     cipher: auto     tls: true

专业建议：使用在线YAML校验工具避免语法错误

3.2 规则集进阶用法

地理围栏策略：
 ```yaml rules:</p>  <ul> <li>DOMAIN-SUFFIX,google.com,PROXY</li> <li>GEOIP,CN,DIRECT</li> <li>MATCH,PROXY ```

智能分流方案：

- 流媒体专用规则（Netflix/HBO等）
 - 游戏低延迟路由
 - 学术资源直连通道

3.3 节点优化技巧

延迟测试：ping -t


Helper.IsPrime(5));
      Assert.IsTrue(PrimeHelper.IsPrime(7));
      Assert.IsTrue(PrimeHelper.IsPrime(397));
    }

    [Test]
    public void NextPrimesTest()
    {
      for (int n = 1; n < int.MaxValue / 2; n <<= 1)
      {
        int prime = PrimeHelper.NextPrime(n);
        Assert.GreaterOrEqual(prime, n);
        Assert.IsTrue(PrimeHelper.IsPrime(prime));

        if (n > 1)
        {
          // Prime number should be close to actual number.
          Assert.LessOrEqual(prime, (int)(n * 1.5));
        }
      }
    }
  }
}


yyyy\"}",Student.class);
        System.out.println("Name: "+xiaoming.getName());
        System.out.println("Age: "+xiaoming.getAge());

    }
}

```

![](https://shs3.b.qianxin.com/attack_forum/2024/03/attach-bcbfec8ca016b01786cf988d411335b11957654a.png)

我们获取到的是 初始化的值 为 0

但是这里我们加上 Feature.SupportNonPublicField 即可获得该私有变量

```
package fastjson;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class FJTest {
    public static void main(String[] args){

        Student xiaoming = JSON.parseObject("{\"age\":20,\"name\":\"zzzjjjjaaaacccckkkkkyyyy\"}",Student.class, Feature.SupportNonPublicField);
        System.out.println("Name: "+xiaoming.getName());
        System.out.println("Age: "+xiaoming.getAge());

    }
}

```

![](https://shs3.b.qianxin.com/attack_forum/2024/03/attach-a4ffc9fe077b161b2638071484e6f0d00c5b4338.png)

也就是说，若想让传给 JSON.parseObject() 进行反序列化的 JSON 内容指向的对象类中的私有变量成功还原出来，则需要在调用 JSON.parseObject() 时加上 Feature.SupportNonPublicField 这个属性设置才行。

反序列化时几种类型设置的比较
--------------

再来看下 parseObject() 的指定或不指定反序列化类型之间的差异

由于 Fastjson 反序列化漏洞的利用只和包含了 @type 的 JSON 数据有关，因此这里我们只对序列化时设置了 SerializerFeature.WriteClassName 即含有 @type 指定反序列化类型的 JSON 数据进行反序列化

如下 demo

Student 类，添加两个 private 成员变量，且所有的私有成员变量都不定义 setter 方法

```
package fastjson;

public class Student {
    private String name;
    private int age;
    private String address;
    private String sex;

    public Student() {
        System.out.println("构造函数");
    }

    public String getName() {
        System.out.println("getName");
        return name;
    }

    public int getAge() {
        System.out.println("getAge");
        return age;
    }

    public String getAddress() {
        System.out.println("getAddress");
        return address;
    }

    public String getsex() {
        System.out.println("getsex");
        return sex;
    }
}

```

我序列化出来的值为

```
{"@type":"fastjson.Student","age":20,"name":"zjacky","sex":"男"}

```

##### 未设置 Feature.SupportNonPublicField

反序列化

```
public class UnSerFJTest {
    public static void main(String[] args){

        String jsonstring = "{\"@type\":\"fastjson.Student\",\"age\":20,\"name\":\"zjacky\",\"sex\":\"男\"}";
        Object obj = JSON.parseObject(jsonstring, Student.class);
        System.out.println(obj);
        System.out.println(obj.getClass().getName());
    }
}


 (0.3294738052815987 + 0.012120855841304373 * theta2) * theta2;
            x3 = Math.cos(theta2);
            y3 = Math.sin(theta2);
            x2 = x3 + y1 * y3;
            y2 = y3 - y1 * x3;
            result.push(
                exx + eyx * y1 + cx, exy + eyy * y1 + cy,
                exx * x2 + eyx * y2 + cx, exy * x2 + eyy * y2 + cy,
                exx * x3 + eyx * y3 + cx, exy * x3 + eyy * y3 + cy
            );
            count += 6;
        }
        return count;
    },

    /**
     * [http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes](http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes)
     * @param rx
     * @param ry
     * @param rotation Differ from svg spec, this is radian.
     * @param fA
     * @param fS
     * @param x2
     * @param y2
     */
    arcSvg: function (rx, ry, rotation, fA, fS, x2, y2) {
        if (rx < 0) {
            rx = -rx;
        }
        if (ry < 0) {
            ry = -ry;
        }
        var me = this,
            x1 = me.cursor[0],
            y1 = me.cursor[1],
            hdx = (x1 - x2) / 2,
            hdy = (y1 - y2) / 2,
            cosPhi = Math.cos(rotation),
            sinPhi = Math.sin(rotation),
            xp = hdx * cosPhi + hdy * sinPhi,
            yp = -hdx * sinPhi + hdy * cosPhi,
            ratX = xp / rx,
            ratY = yp / ry,
            lambda = ratX * ratX + ratY * ratY,
            cx = (x1 + x2) * 0.5, cy = (y1 + y2) * 0.5,
            cpx = 0, cpy = 0;
        if (lambda >= 1) {
            lambda = Math.sqrt(lambda);
            rx *= lambda;
            ry *= lambda;
            // me gives lambda == cpx == cpy == 0;
        } else {
            lambda = Math.sqrt(1 / lambda - 1);
            if (fA === fS) {
                lambda = -lambda;
            }
            cpx = lambda * rx * ratY;
            cpy = -lambda * ry * ratX;
            cx += cosPhi * cpx - sinPhi * cpy;
            cy += sinPhi * cpx + cosPhi * cpy;
        }

        var theta1 = Math.atan2((yp - cpy) / ry, (xp - cpx) / rx),
            deltaTheta = Math.atan2((-yp - cpy) / ry, (-xp - cpx) / rx) - theta1;

        if (fS) {
            if (deltaTheta <= 0) {
                deltaTheta += Math.PI * 2;
            }
        } else {
            if (deltaTheta >= 0) {
                deltaTheta -= Math.PI * 2;
            }
        }
        me.ellipse(cx, cy, rx, ry, rotation, theta1, theta1 + deltaTheta, 1 - fS);
    },

    /**
     * Feed the path from svg path string.
     * @param pathString
     */
    fromSvgString: function (pathString) {
        if (!pathString) {
            return;
        }
        var me = this,
            parts,
            paramCounts = {
                a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0,
                A: 7, C: 6, H: 1, L: 2, M: 2, Q: 4, S: 4, T: 2, V: 1, Z: 0
            },
            lastCommand = '',
            lastControlX, lastControlY,
            lastX = 0, lastY = 0,
            part = false, i, partLength, relative;

        // Split the string to items.
        if (Ext.isString(pathString)) {
            parts = pathString.replace(Ext.draw.Path.pathRe, " $1 ").replace(Ext.draw.Path.pathRe2, " -").split(Ext.draw.Path.pathSplitRe);
        } else if (Ext.


     @JvmName("setStateValue")
      set(value) {
        _builder.setStateValue(value)
      }
    /**
     * ```
     * state of the crypto session
     * ```
     *
     * `.qaul.net.messaging.CryptoState state = 1;`
     */
    public fun clearState() {
      _builder.clearState()
    }

    /**
     * ```
     * crypto session id
     * ```
     *
     * `uint32 session_id = 2;`
     */
    public var sessionId: kotlin.Int
      @JvmName("getSessionId")
      get() = _builder.getSessionId()
      @JvmName("setSessionId")
      set(value) {
        _builder.setSessionId(value)
      }
    /**
     * ```
     * crypto session id
     * ```
     *
     * `uint32 session_id = 2;`
     */
    public fun clearSessionId() {
      _builder.clearSessionId()
    }

    /**
     * An uninstantiable, behaviorless type to represent the field in
     * generics.
     */
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    public class DataProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
    /**
     * ```
     * one or several Data messages
     * of maximally 64KB each.
     * ```
     *
     * `repeated .qaul.net.messaging.Data data = 3;`
     */
     public val data: com.google.protobuf.kotlin.DslList<qaul.net.messaging.MessagingOuterClass.Data, DataProxy>
      @kotlin.jvm.JvmSynthetic
      get() = com.google.protobuf.kotlin.DslList(
        _builder.getDataList()
      )
    /**
     * ```
     * one or several Data messages
     * of maximally 64KB each.
     * ```
     *
     * `repeated .qaul.net.messaging.Data data = 3;`
     * @param value The data to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addData")
    public fun com.google.protobuf.kotlin.DslList<qaul.net.messaging.MessagingOuterClass.Data, DataProxy>.add(value: qaul.net.messaging.MessagingOuterClass.Data) {
      _builder.addData(value)
    }
    /**
     * ```
     * one or several Data messages
     * of maximally 64KB each.
     * ```
     *
     * `repeated .qaul.net.messaging.Data data = 3;`
     * @param value The data to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignData")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList<qaul.net.messaging.MessagingOuterClass.Data, DataProxy>.plusAssign(value: qaul.net.messaging.MessagingOuterClass.Data) {
      add(value)
    }
    /**
     * ```
     * one or several Data messages
     * of maximally 64KB each.
     * ```
     *
     * `repeated .qaul.net.messaging.Data data = 3;`
     * @param values The data to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addAllData")
    public fun com.google.protobuf.kotlin.DslList<qaul.net.messaging.MessagingOuterClass.Data, DataProxy>.addAll(values: kotlin.collections.Iterable<qaul.net.messaging.MessagingOuterClass.Data>) {
      _builder.


     warn("Fuel resource not found, please set your fuel resource in the config.lua")
        SetVehicleFuelLevel(vehicle, fuel) -- Fallback to the default fuel system
    end
end

---@param vehicle any
---@return string
---@decription If you have a custom vehicle key system you can give the key to the player
Config.GiveKey = function(vehicle, plate)
    if GetResourceState("wasabi_carlock") == "started" then
        exports.wasabi_carlock:GiveKey(plate)
    elseif GetResourceState("jaksam-vehicles-keys") == "started" then
        TriggerServerEvent("vehicles_keys:selfGiveVehicleKeys", plate)
    elseif GetResourceState("cd_garage") == "started" then
        TriggerEvent('cd_garage:AddKeys', plate)
    elseif GetResourceState("okokGarage") == "started" then
        TriggerServerEvent("okokGarage:GiveKeys", plate)
    elseif GetResourceState("t1ger_keys") == "started" then
        TriggerServerEvent('t1ger_keys:updateOwnedKeys', plate, true)
    elseif GetResourceState("ak47_vehiclekeys") == "started" then
        exports['ak47_vehiclekeys']:GiveKey(plate, false)
    else
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
    end
end

---@param message string
---@param type string
---@param is_server boolean
---@decription Send notification to the player
Config.Notification = function(message, type, is_server, src)
    local Core, Framework = GetCore()
    if is_server then
        if Framework == "esx" then
            TriggerClientEvent("esx:showNotification", src, message)
        else
            TriggerClientEvent('QBCore:Notify', src, message, type, 5000)
        end
    else
        if Framework == "esx" then
            -- TriggerEvent("esx:showNotification", message)
            Core.ShowNotification(message, type, 5000)
        else
            Core.Functions.Notify(message, type, 5000)
        end
    end
end


.max()
                    if (SlayerStorage.getXp(slayerType) > maxXp) return@case
                    SlayerStorage.setXp(slayerType, RepoSlayerData.getData(slayerType).leveling.max())
                }
            }

            34 -> findWhen(event.getLore()) {
                case(inventoryRngSelected, "stored") { (stored) ->
                    SlayerStorage.setMeter(slayerType, stored.toLongValue())
                }
                case(inventoryRngNonSelected, "stored") { (stored) ->
                    SlayerStorage.setMeter(slayerType, stored.toLongValue())
                }
            }
        }
    }

    @Subscription
    @OnlyOnSkyBlock
    @MustBeContainer
    @InventoryTitle("Slayer")
    fun onSlayerInventory(event: InventoryChangeEvent) {
        if (event.slot.index != 29) return
        if (event.slot.item.cleanName != "Slayer Leaderboards") return
        inventoryLeaderBoardXp.findAll(event.getLoreLines(), "type", "xp") { (type, xp) ->
            val type = SlayerType.fromName(type) ?: return@findAll
            val xp = xp.takeUnless { it == NOT_AVAILABLE }?.toLongValue() ?: return@findAll
            SlayerStorage.setXp(type, xp)
        }
    }

    private fun InventoryChangeEvent.getLoreLines() = this.slot.item.getRawLore()
    private fun InventoryChangeEvent.getLore() = this.getLoreLines().joinToString("\n")

    @Subscription
    @OnlyOnSkyBlock
    @OptIn(SkyBlockPvRequired::class)
    fun onPv(event: SkyBlockPvOpenedEvent) {
        event.member.getPath("slayer.slayer_bosses").asMap { k, v ->
            SlayerType.fromName(k) to v.asJsonObject["xp"].asLong(0)
        }.filter { (key, xp) -> key != null && xp > SlayerStorage.getXp(key) }.mapKeys { it.key!! }.apply {
            if (isNotEmpty()) PvLoadingHelper.markLoaded(LoadedData.SLAYER)
        }.forEach(SlayerStorage::setXp)
    }
}
package tech.thatgravyboat.skyblockapi.api.area.hub

import me.owdding.ktmodules.Module
import tech.thatgravyboat.skyblockapi.api.events.base.Subscription
import tech.thatgravyboat.skyblockapi.api.events.base.predicates.OnlyIn
import tech.thatgravyboat.skyblockapi.api.events.info.ScoreboardUpdateEvent
import tech.thatgravyboat.skyblockapi.api.events.location.ServerDisconnectEvent
import tech.thatgravyboat.skyblockapi.api.events.profile.ProfileChangeEvent
import tech.thatgravyboat.skyblockapi.api.location.SkyBlockIsland
import tech.thatgravyboat.skyblockapi.utils.extentions.parseColonDuration
import tech.thatgravyboat.skyblockapi.utils.extentions.parseFormattedInt
import tech.thatgravyboat.skyblockapi.utils.regex.RegexGroup
import tech.thatgravyboat.skyblockapi.utils.regex.RegexUtils.anyMatch
import kotlin.time.Duration

@Module
object CarnivalAPI {

    private val group = RegexGroup.SCOREBOARD.group("carnival")

    private val carnivalTokensRegex = group.create(
        "tokens",
        "Carnival Tokens: (?i)(?<tokens>[\\d,kmb]+)",
    )

    private val carnivalDurationRegex = group.create(
        "duration",
        "Carnival (?i)(?<duration>[\\d:]+)",
    )

    var tokens: Int = 0
        private set

    var duration: Duration = Duration.ZERO
        private set

    @Subscription
    @OnlyIn(SkyBlockIsland.HUB)
    fun onScoreboardUpdate(event: ScoreboardUpdateEvent) {
        carnivalTokensRegex.anyMatch(event.added, "tokens") { (tokens) ->
            this.tokens = tokens.parseFormat


off2",
    $range: (U+a5, U+2022, U+2192, U+2605, U+4e11, U+4e22, U+4e32, U+4f0d, U+4f0f, U+4f69, U+4ff1, U+50b2, U+5154, U+51dd, U+51f0, U+5211, U+5269, U+533f, U+5366-5367, U+5389, U+5413, U+5440, U+5446, U+5561, U+574a, U+5751, U+57ab, U+5806, U+5821, U+582a, U+58f3, U+5938, U+5948, U+5978, U+59d1, U+5a03, U+5a07, U+5ac1, U+5acc, U+5ae9, U+5bb4, U+5bc4, U+5c3f, U+5e3d, U+5e7d, U+5f92, U+5faa, U+5fe0, U+5ffd, U+6016, U+60a0, U+60dc, U+60e8, U+614e, U+6212, U+6284, U+62c6, U+62d3-62d4, U+63f4, U+642c, U+6478, U+6491-6492, U+64e6, U+6591, U+65a4, U+664b, U+6735, U+6746, U+67f1, U+67f3, U+6842, U+68af, U+68c9, U+68cb, U+6a31, U+6b3a, U+6bc1, U+6c0f, U+6c27, U+6c57, U+6cc4, U+6ce5, U+6d2a, U+6d66, U+6d69, U+6daf, U+6e58, U+6ecb, U+6ef4, U+707e, U+7092, U+70ab, U+71d5, U+7275, U+7384, U+73b2, U+7434, U+74e6, U+74f7, U+75bc, U+76c8, U+76d0, U+7709, U+77ac, U+7855, U+78a7, U+78c1, U+7a77, U+7b79, U+7c92, U+7cae, U+7cd5, U+7ea4, U+7eb5, U+7ebd, U+7f5a, U+7fd4, U+7ffc, U+8083, U+8096, U+80a0, U+80d6, U+80de, U+8102, U+8109, U+810f, U+8179, U+8292, U+82b3, U+8352, U+8361, U+83cc, U+841d, U+8461, U+8482, U+8521, U+857e, U+866b, U+8776, U+8896, U+889c, U+88f8, U+8a9e, U+8bc8, U+8bf8, U+8c0b, U+8c28, U+8d2b, U+8d2f, U+8d37, U+8d3a, U+8d54, U+8dc3, U+8dcc, U+8df5, U+8e0f, U+8e48, U+8f86, U+8f88, U+8f9e, U+8fc1, U+8fc8, U+8feb, U+9065, U+90a6, U+90bb, U+90c1, U+94dc, U+9521, U+9676, U+96d5, U+970d, U+9897, U+997c, U+9a70, U+9a76, U+9a9a, U+9ad4


cludePathModuleNames.AddRange(
				new string[]
				{
					"Analytics",
					"Core",
					"Launch",
				}
			);

			string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
			bool bHasAdjustSDK = true; //  Directory.Exists(System.IO.Path.Combine(PluginPath, "ThirdParty", "adjust_library"));
            if (bHasAdjustSDK)
            {
                PublicDefinitions.Add("WITH_ADJUST=1");
				AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Adjust_UPL.xml"));
            }
            else
            {
                PublicDefinitions.Add("WITH_ADJUST=0");
            }
        }
	}
}


 и не делают.
«Сначала посмотрите, где люди ходят, а потом асфальтируйте дорожки».

# Запахи на этапе внедрения

## Очевидность

> Любая сложная задача имеет простое, легкое для понимания неправильное решение.<br>
> Артур Блох.

Упала производительность на удаленке — давайте вернем всех в офис.

Проще искать там, где светло, а не там, где потеряли.

## Безальтернативность

Выбрали скрам, потому что. Альтернатив не рассматривали.

## Так делает Google

Так делают в большой компании, поэтому и мы так будем.
Есть убеждение, что если компания большая и успешная, то там идеальные процессы.
Это ошибка.

## Так сказал Kent Beck

Когда аргументом в споре является цитата из книги или доклада на конференции.
Не верьте этому докладу на слово, не применяйте слепо. Пробуйте и проверяйте.

## Я так сказал!

Когда что-то внедряется по приказу сверху.

## Карго-культ

У кого-то А привело к Б, значит и у нас приведёт. Точно-точно!
Например, история с самоорганизующимися командами применима к очень специфическим компаниям
с их культурой.

# Примеры

## Ревью кода в пулл-реквестах

Придумано для мейнтейнеров опенсорса, когда контрибьюторы — случайные люди,
которые могут быть некомпетентны или враждебны проекту.

## Системные аналитики

Люди, которые придумывают описания системных экранов и прочие штуки.
Человек должен одновременно разбираться в предметной области, технологических процессах,
внутреннем устройстве кода, юзабилити и других вещах.
И всё это за зарплату мидла.
Это сложно, люди не справляются.

## Scrum

Прекрасная практика, но внедряют обычно как попало.

# Как сделать хорошо

Идея из ТРИЗа: идеальная система — та, которой нет, но её функция выполняется.
Идеальный процесс должен быть таким же.

Вторая идея из ТРИЗа: выделение и разрешение противоречий.

Фил рекомендует книгу «Месяц под звездами фантазии».

## Измерения

Попытка что-то измерить, чтобы это потом м


      /* Palette --> BitField */
            map->info.table =
                Map1toN(srcfmt, src->map->info.r, src->map->info.g,
                        src->map->info.b, src->map->info.a, dstfmt);
            if (map->info.table == NULL) {
                return -1;
            }
        }
    } else {
        if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) {
            /* BitField --> Palette */
            map->info.table = MapNto1(srcfmt, dstfmt, &map->identity);
            if (!map->identity) {
                if (map->info.table == NULL) {
                    return -1;
                }
            }
            map->identity = 0; /* Don't optimize to copy */
        } else {
            /* BitField --> BitField */
            if (srcfmt == dstfmt) {
                map->identity = 1;
            }
        }
    }

    map->dst = dst;

    if (map->dst) {
        /* Register BlitMap to the destination surface, to be invalidated when needed */
        SDL_ListAdd((SDL_ListNode **)&(map->dst->list_blitmap), map);
    }

    if (dstfmt->palette) {
        map->dst_palette_version = dstfmt->palette->version;
    } else {
        map->dst_palette_version = 0;
    }

    if (srcfmt->palette) {
        map->src_palette_version = srcfmt->palette->version;
    } else {
        map->src_palette_version = 0;
    }

    /* Choose your blitters wisely */
    return SDL_CalculateBlit(src);
}

void SDL_FreeBlitMap(SDL_BlitMap *map)
{
    if (map) {
        SDL_InvalidateMap(map);
        SDL_free(map);
    }
}


(assembly);
    debug!("{:?}", cmd);

    match cmd.output() {
        Ok(prog) => {
            if !prog.status.success() {
                let mut note = prog.stderr.clone();
                note.extend_from_slice(&prog.stdout);

                handler.struct_err(&format!("linking with `{}` failed: {}",
                                            pname.display(),
                                            prog.status))
                    .note(&format!("{:?}", &cmd))
                    .note(str::from_utf8(&note[..]).unwrap())
                    .emit();
                handler.abort_if_errors();
            }
        },
        Err(e) => {
            handler.err(&format!("could not exec the linker `{}`: {}", pname.display(), e));
            handler.abort_if_errors();
        }
    }
}

pub unsafe fn with_llvm_pmb(llmod: &llvm::Module,
                            config: &ModuleConfig,
                            opt_level: llvm::CodeGenOptLevel,
                            prepare_for_thin_lto: bool,
                            f: &mut dyn FnMut(&llvm::PassManagerBuilder)) {
    use std::ptr;

    // Create the PassManagerBuilder for LLVM. We configure it with
    // reasonable defaults and prepare it to actually populate the pass
    // manager.
    let builder = llvm::LLVMPassManagerBuilderCreate();
    let opt_size = config.opt_size.unwrap_or(llvm::CodeGenOptSizeNone);
    let inline_threshold = config.inline_threshold;

    let pgo_gen_path = config.pgo_gen.as_ref().map(|s| {
        let s = if s.is_empty() { "default_%m.profraw" } else { s };
        CString::new(s.as_bytes()).unwrap()
    });

    let pgo_use_path = if config.pgo_use.is_empty() {
        None
    } else {
        Some(CString::new(config.pgo_use.as_bytes()).unwrap())
    };

    llvm::LLVMRustConfigurePassManagerBuilder(
        builder,
        opt_level,
        config.merge_functions,
        config.vectorize_slp,
        config.vectorize_loop,
        prepare_for_thin_lto,
        pgo_gen_path.as_ref().map_or(ptr::null(), |s| s.as_ptr()),
        pgo_use_path.as_ref().map_or(ptr::null(), |s| s.as_ptr()),
    );

    llvm::LLVMPassManagerBuilderSetSizeLevel(builder, opt_size as u32);

    if opt_size != llvm::CodeGenOptSizeNone {
        llvm::LLVMPassManagerBuilderSetDisableUnrollLoops(builder, 1);
    }

    llvm::LLVMRustAddBuilderLibraryInfo(builder, llmod, config.no_builtins);

    // Here we match what clang does (kinda). For O0 we only inline
    // always-inline functions (but don't add lifetime intrinsics), at O1 we
    // inline with lifetime intrinsics, and O2+ we add an inliner with a
    // thresholds copied from clang.
    match (opt_level, opt_size, inline_threshold) {
        (.., Some(t)) => {
            llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, t as u32);
        }
        (llvm::CodeGenOptLevel::Aggressive, ..) => {
            llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 275);
        }
        (_, llvm::CodeGenOptSizeDefault, _) => {
            llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 75);
        }
        (_, llvm::CodeGenOptSizeAggressive, _) => {
            llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 25);
        }
        (llvm::CodeGenOptLevel::None, ..) => {
            llvm::LLVMRustAddAlwaysIn


"[C++로 풀이] N개의 최소공배수 ⭐⭐"

categories:
  - Programmers
tags:
  - [Algorithm, Coding Test]

toc: true
toc_sticky: true

date: 2021-01-28
last_modified_at: 2021-01-28
---

# 📌 N개의 최소공배수

> 난이도 ⭐⭐

## 🚀 문제

![image](https://user-images.githubusercontent.com/42318591/106024990-a96d9e00-610b-11eb-9643-7bdce220d020.png)

## 🚀 내 풀이 ⭕

![image](https://user-images.githubusercontent.com/42318591/106273285-be664080-6275-11eb-96c2-9464f27ec4b4.png)

> 3개 이상의 수에서 최소공배수를 구할 때, 공약수가 없다면 모든 수에서 서로소가 나올 때까지 일부의 공약수만으로 계속 나눈다!

처음엔 두 수의 최소 공배수를 구하는 것처럼 최대공약수 * 두 수의 서로소 이렇게 구하려고 했었는데 그렇게 하니 오답이 났었다. 3개 이상의 수에선 좀 다르구나..⭐ 4와 16이 3으로 나눠지지 않더라도 일단 3 과 9의 공약수인 3으로 나누고 그 이후엔 4 와 16의 공약수인 4로 나누고 나중에 3 x 4 x 3 x 4 = 144 이게 최소공배수가 된다.

```cpp
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int solution(vector<int> arr) {
    int answer = 1;

    int max = *max_element(arr.begin(), arr.end());
    int cur = max;
    while(true)
    {
        bool flag = true;
        for(int i = 0; i < arr.size(); i++)
        {
            if (cur % arr[i] != 0)
            {
                flag = false;
                break;
            }
        }

        if (flag)
        {
            answer = cur;
            break;
        }
        else
            cur += max;
    }

    return answer;
}
```

최소공배수를 구하는거니까 `arr`의 원소들 중 가장 최대값의 배수들 중에 최소공배수가 있을 것임을 생각할 수 있다! 최대값의 배수에서 `arr`의 원소들이 전부 나누어 떨어지는 수를 처음으로찾으면 그게 바로 최소 공배수.

***

    🌜 개인 공부 기록용 블로그입니다. 오류나 틀린 부분이 있을 경우
    언제든지 댓글 혹은 메일로 지적해주시면 감사하겠습니다! 😄

[맨 위로 이동하기](#){: .btn .btn--primary }{: .align-right}---
slug: creating-example-collection
id: nxbgmaltwzta
type: challenge
title: Creating An Example Collection
teaser: Creating an example collection
tabs:
- title: Terminal
  type: terminal
  hostname: shell
- title: VS Code
  type: service
  hostname: sh


     }
            Vdev::Parity1(ref parity) => {
                writeln!(f, "{:indent$}parity1", "", indent = indent)?;
                for vdev in parity {
                    vdev.display(indent + 4, f)?;
                }
                Ok(())
            }
        }
    }
}

impl LeafVdev {
    fn display(&self, indent: usize, f: &mut fmt::Formatter) -> fmt::Result {
        writeln!(f, "{:indent$}{}", "", &self.0.display(), indent = indent)
    }
}
<filename>src/tmr0/nolcmp.rs<gh_stars>1-10
#[doc = "Register `NOLCMP` reader"]
pub struct R(crate::R<NOLCMP_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<NOLCMP_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<NOLCMP_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<NOLCMP_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `NOLCMP` writer"]
pub struct W(crate::W<NOLCMP_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<NOLCMP_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<NOLCMP_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<NOLCMP_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `NOLLCMP` reader - Non-overlapping Low Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A and next rising edge of PWM output 0A'."]
pub struct NOLLCMP_R(crate::FieldReader<u8, u8>);
impl NOLLCMP_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        NOLLCMP_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NOLLCMP_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NOLLCMP` writer - Non-overlapping Low Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A and next rising edge of PWM output 0A'."]
pub struct NOLLCMP_W<'a> {
    w: &'a mut W,
}
impl<'a> NOLLCMP_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
        self.w
    }
}
#[doc = "Field `NOLHCMP` reader - Non-overlapping High Compare. The 8-bit timer count value of non-overlapping time between falling edge of PWM output 0A' and next rising edge of PWM output 0A."]
pub struct NOLHCMP_R(crate::FieldReader<u8, u8>);
impl NOLHCMP_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        NOLHCMP_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NOLHCMP_R {
    type Target = crate


Name: 'URLError.backgroundSessionRequiresSharedContainer',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2883169-backgroundsessionrequiressharedc',
        value: -995),
    EnumMacOSPlatform(
        apiName: 'URLError.backgroundSessionRequiresSharedContainer',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2883169-backgroundsessionrequiressharedc',
        value: -995)
  ])
  static const BACKGROUND_SESSION_REQUIRES_SHARED_CONTAINER =
      WebResourceErrorType_._internal(
          "BACKGROUND_SESSION_REQUIRES_SHARED_CONTAINER");

  ///An app or app extension attempted to connect to a background session that is already connected to a process.
  @EnumSupportedPlatforms(platforms: [
    EnumIOSPlatform(
        apiName: 'URLError.backgroundSessionInUseByAnotherProcess',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2882923-backgroundsessioninusebyanotherp',
        value: -996),
    EnumMacOSPlatform(
        apiName: 'URLError.backgroundSessionInUseByAnotherProcess',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2882923-backgroundsessioninusebyanotherp',
        value: -996)
  ])
  static const BACKGROUND_SESSION_IN_USE_BY_ANOTHER_PROCESS =
      WebResourceErrorType_._internal(
          "BACKGROUND_SESSION_IN_USE_BY_ANOTHER_PROCESS");

  ///The app is suspended or exits while a background data task is processing.
  @EnumSupportedPlatforms(platforms: [
    EnumIOSPlatform(
        apiName: 'URLError.backgroundSessionWasDisconnected',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2883075-backgroundsessionwasdisconnected',
        value: -997),
    EnumMacOSPlatform(
        apiName: 'URLError.backgroundSessionWasDisconnected',
        apiUrl:
            'https://developer.apple.com/documentation/foundation/urlerror/code/2883075-backgroundsessionwasdisconnected',
        value: -997)
  ])
  static const BACKGROUND_SESSION_WAS_DISCONNECTED =
      WebResourceErrorType_._internal("BACKGROUND_SESSION_WAS_DISCONNECTED");

  ///Indicates that the host is unreachable.
  @EnumSupportedPlatforms(platforms: [
    EnumWindowsPlatform(
        apiName: 'COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE',
        apiUrl:
            'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2210.55#corewebview2_web_error_status',
        value: 6),
  ])
  static const SERVER_UNREACHABLE =
      WebResourceErrorType_._internal("SERVER_UNREACHABLE");

  ///Indicates that the connection was stopped.
  @EnumSupportedPlatforms(platforms: [
    EnumWindowsPlatform(
        apiName: 'COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED',
        apiUrl:
            'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2210.55#corewebview2_web_error_status',
        value: 9)
  ])
  static const CONNECTION_ABORTED =
      WebResourceErrorType_._internal("CONNECTION_ABORTED");

  ///Indicates that the connection was reset.
  @EnumSupportedPlatforms(platforms: [
    EnumWindowsPlatform(
        apiName: 'COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET',
        apiUrl:
            'https://learn.micr


List<TagTrack> FinalTagTracks { get; }
        List<TagTrack> FinalFavourTagTracks { get; }
        AnimationClip AnimGeneratedClip { get; }
        List<TagTrackBase> GenericTagTracks { get; }
        List<TagTrackBase> FinalGenericTagTracks { get; }
        List<TagTrackBase> UserTagTracks { get; }
        List<TagTrackBase> FinalUserTagTracks { get; }
        List<MxMCurveTrack> CurveTracks { get; }

        //Functions
        (List<Vector3> posLookup, List<Quaternion> rotLookup) GetRootLookupTable();
        (Vector3 pos, Quaternion rot) GetRoot(float a_time);
        float GetAverageRootSpeed(float a_startTime, float a_endTime);
        void InitPoseDataList();
        void InitTagTracks();
        void VerifyData();

        void GenerateModifiedAnimation(MxMPreProcessData a_data, string a_folderName);
        void ScrapGeneratedClips();
        void AddToPoseList(ref PoseData newPose);
        void AddEvent(float a_time);

        void OnDeleteEventMarker(object a_eventObj);
        void OnDeleteTag(object a_tagObject);
        void OnDeleteMotionSection(object a_motionObj);

        bool CheckAnimationCompatibility(bool a_human);

        int GetTrackId();
        void SetTrackId(int a_trackId);

    }//End of interface IMxMAnim
}//End of namespace: MxMEditor


" << endl;
            else      cout << "\nCurve Found" << endl;
        }

        cout << "A= " << a << endl;
        cout << "B= " << b << endl;
        G.get(x,y);
        cout << "P= " << p << endl;
        cout << "R= " << ord;
        if (pord)
        {
            cout << " a " << bits(ord) << " bit prime"  << endl;
            cout << "X= " << x << endl;
            cout << "Y= " << y << endl;
        }
        else            cout << " NOT prime" << endl;
        cout << endl;

        if (D!=1 && D!=3 )
        {
                cout << "Try for different random factorisation (Y/N)? ";
                cin >> c;
                if (c=='Y' || c=='y') continue;
        }
        break;
    }
    if (pord) cout << "\nCurve and Point OK (Y/N)? " ;
    else      cout << "\nCurve OK (Y/N)? " ;
    cin >> c;
    if (c=='N' || c=='n')
    {
        if (!suppress) cout << "finding a curve..." << endl;
        mirexit();
        int precision=(1<<m);
        mip=mirsys(precision+2,0);     // restart with new precision
        setprecision(m);
        gprime(1000000);
        mip->RPOINT=ON;

        return FALSE;
    }
    if (fout)
    {
        ofile << bits(p) << endl;
        mip->IOBASE=16;
        ofile << p << endl;
        ofile << a << endl;
        ofile << b << endl;
        ofile << ord << endl;
        if (pord)
        {
            ofile << x << endl;
            ofile << y << endl;
        }
        mip->IOBASE=10;
    }
    exit(0);
    return TRUE;
}

// Code to parse formula
// This code isn't mine, but its public domain
// Shamefully I forget the source
//
// NOTE: It may be necessary on some platforms to change the operators * and #

#if defined(unix)
#define TIMES '.'
#define RAISE '^'
#else
#define TIMES '*'
#define RAISE '#'
#endif

void eval_power (Big& oldn,Big& n,char op)
{
        if (op) n=pow(oldn,toint(n));    // power(oldn,size(n),n,n);
}

void eval_product (Big& oldn,Big& n,char op)
{
        switch (op)
        {
        case TIMES:
                n*=oldn;
                break;
        case '/':
                n=oldn/n;
                break;
        case '%':
                n=oldn%n;
        }
}

void eval_sum (Big& oldn,Big& n,char op)
{
        switch (op)
        {
        case '+':
                n+=oldn;
                break;
        case '-':
                n=oldn-n;
        }
}

void eval (Big& t)
{
        Big oldn[3];
        Big n;
        int i;
        char oldop[3];
        char op;
        char minus;
        for (i=0;i<3;i++)
        {
            oldop[i]=0;
        }
LOOP:
        while (*s==' ')
        s++;
        if (*s=='-')    /* Unary minus */
        {
        s++;
        minus=1;
        }
        else
        minus=0;
        while (*s==' ')
        s++;
        if (*s=='(' || *s=='[' || *s=='{')    /* Number is subexpression */
        {
        s++;
        eval(t);
        n=t;
        }
        else            /* Number is decimal value */
        {
        for (i=0;s[i]>='0' && s[i]<='9'


import re

def read_file(filepath):
    with open(filepath, 'r') as file:
        return file.read()

def parse_blocks(content):
    blocks = re.split(r'\n(?=\d+\.)', content)  # Split based on the pattern "{Number}."
    block_dict = {}

    for block in blocks:
        id_match = re.search(r'ID\s*-\s*(\S+)', block)
        if id_match:
            block_id = id_match.group(1)
            block_dict[block_id] = block.strip()

    return block_dict

def compare_blocks(blocks1, blocks2):
    only_in_first = {k: v for k, v in blocks1.items() if k not in blocks2}
    only_in_second = {k: v for k, v in blocks2.items() if k not in blocks1}

    return only_in_first, only_in_second

def write_to_file(filename, content):
    with open(filename, 'w') as file:
        file.write(content)

def prepare_content(blocks):
    content = []
    for id, block in blocks.items():
        content.append(f"ID: {id}\n{block}\n")
    return "\n".join(content)

# Read the documents
content1 = read_file('Medline.txt')
content2 = read_file('Medline2.txt')

# Parse the documents
blocks1 = parse_blocks(content1)
blocks2 = parse_blocks(content2)

# Compare the blocks
only_in_first, only_in_second = compare_blocks(blocks1, blocks2)

# Prepare content for output
only_in_first_content = prepare_content(only_in_first)
only_in_second_content = prepare_content(only_in_second)

# Write the differences to three separate files
write_to_file('only_in_first.txt', only_in_first_content)
write_to_file('only_in_second.txt', only_in_second_content)

keys1 = list(only_in_first.keys())
print("Number of blocks in 'only_in_first.txt':", len(keys1))

keys2 = list(only_in_second.keys())
print("Number of blocks in 'only_in_second.txt':", len(keys2))
print("Differences written to 'only_in_first.txt' and 'only_in_second.txt'")


ve here). Unfortunately we don't have a good formula for it, but keep in mind that allowing for more ZooKeeper state means that snapshots can become large, and large snapshots affect recovery time. In fact, if the snapshot becomes too large (a few gigabytes), then you may need to increase the initLimit parameter to give enough time for servers to recover and join the ensemble.

Monitoring: Both JMX and the 4 letter words (4lw) commands are very useful, they do overlap in some cases (and in those cases we prefer the 4 letter commands, they seem more predictable, or at the very least, they work better with the LI monitoring infrastructure)

Don't overbuild the cluster: large clusters, especially in a write heavy usage pattern, means a lot of intracluster communication (quorums on the writes and subsequent cluster member updates), but don't underbuild it (and risk swamping the cluster). Having more servers adds to your read capacity.

  Overall, we try to keep the ZooKeeper system as small as will handle the load (plus standard growth capacity planning) and as simple as possible. We try not to do anything fancy with the configuration or application layout as compared to the official release as well as keep it as self contained as possible. For these reasons, we tend to skip the OS packaged versions, since it has a tendency to try to put things in the OS standard hierarchy, which can be 'messy', for want of a better way to word it.
</script>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
  1 /*
  2  * Copyright (C) 2014 Glyptodon LLC
  3  *
  4  * Permission is hereby granted, free of charge, to any person obtaining a copy
  5  * of this software and associated documentation files (the "Software"), to deal
  6  * in the Software without restriction, including without limitation the rights
  7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8  * copies of the Software, and to permit persons to whom the Software is
  9  * furnished to do so, subject to the following conditions:
 10  *
 11  * The above copyright notice and this permission notice shall be included in
 12  * all copies or substantial portions of the Software.
 13  *
 14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 20  * THE SOFTWARE.
 21  */
 22</


// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 The Prime Citizens
//
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64

#include "textflag.h"

// gcWriteBarrier informs the GC about heap pointer writes.
//
// gcWriteBarrier returns space in a write barrier buffer which
// should be filled in by the caller.
// gcWriteBarrier does NOT follow the Go ABI. It accepts the
// number of bytes of buffer needed in R11, and returns a pointer
// to the buffer space in R11.
// It clobbers FLAGS. It does not clobber any general-purpose registers,
// but may clobber others (e.g., SSE registers).
// Typical use would be, when doing *(CX+88) = AX
//     CMPL    $0, runtime.writeBarrier(SB)
//     JEQ     dowrite
//     CALL    runtime.gcBatchBarrier2(SB)
//     MOVQ    AX, (R11)
//     MOVQ    88(CX), DX
//     MOVQ    DX, 8(R11)
// dowrite:
//     MOVQ    AX, 88(CX)
TEXT gcWriteBarrier<>(SB),NOSPLIT,$112
	// Save the registers clobbered by the fast path. This is slightly
	// faster than having the caller spill these.
	MOVQ R12, 96(SP)
	MOVQ R13, 104(SP)
retry:
	// TODO: Consider passing g.m.p in as an argument so they can be shared
	// across a sequence of write barriers.
	MOVQ g_m(R14), R13
	MOVQ m_p(R13), R13
	// Get current buffer write position.
	MOVQ (p_wbBuf+wbBuf_next)(R13), R12 // original next position
	ADDQ R11, R12 // new next position
	// Is the buffer full?
	CMPQ R12, (p_wbBuf+wbBuf_end)(R13)
	JA flush
	// Commit to the larger buffer.
	MOVQ R12, (p_wbBuf+wbBuf_next)(R13)
	// Make return value (the original next position)
	SUBQ R11, R12
	MOVQ R12, R11
	// Restore registers.
	MOVQ 96(SP), R12
	MOVQ 104(SP), R13
	RET

flush:
	// Save all general purpose registers since these could be
	// clobbered by wbBufFlush and were not saved by the caller.
	//


,45.27466713199229],[26.533292758865024,45.26709667408819],[26.518590539534102,45.266690551949736],[26.50718269441214,45.253541237353055],[26.497237015688626,45.251622736299524],[26.480984015668593,45.26374902078705],[26.465432074404646,45.28248698782979],[26.445796295004147,45.29496117026518],[26.45045701629967,45.30023481118675],[26.47047707743035,45.2946138777845],[26.49754520404786,45.30188946090455],[26.495795240159396,45.305946988224946],[26.518754299809064,45.320614934167395],[26.54848762622457,45.3272323564295],[26.570365369148075,45.337452296022136],[26.568799049993856,45.34997335501639],[26.571238216311105,45.35159131844805],[26.576812485613722,45.345994898507506],[26.586789097818908,45.32268039277601],[26.594565792050613,45.3188948420735],[26.606211368654122,45.29487298654805]]]},"properties":{"countyId":"Pîrscov", "scoring":"3","procente":"
Populatie: 5539
 Total consilieri: 15
 Procent USRPLUS: 18.22%
 Necesar consilieri USRPLUS: 2.73
 Necesar rotunjit: 3" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[21.805556343192563,45.31865232473552],[21.82616053435681,45.313084480233094],[21.858721635232577,45.287959761348745],[21.86114814603064,45.27241140747921],[21.87664343519194,45.26133314093348],[21.872120962623747,45.253220507393415],[21.861901815886633,45.24359106698282],[21.83767650349789,45.23318786854062],[21.808919108431667,45.22647417357222],[21.804153646840835,45.20532729969686],[21.799825896793106,45.20524773648955],[21.767521346997412,45.21967742226478],[21.754017279636702,45.22260306621209],[21.756147177639665,45.23812383112316],[21.77106168836686,45.24155639624399],[21.777334586855492,45.26710649832739],[21.768854466133547,45.27545851809987],[21.784449703104933,45.295242528394404],[21.79306701917392,45.3191597329906],[21.805556343192563,45.31865232473552]]]},"properties":{"countyId":"Lupac", "scoring":"0","procente":"
Populatie: 2632
 Total consilieri: 11
 Procent USRPLUS: 6.02%
 Necesar consilieri USRPLUS: 0.66
 Necesar rotunjit: 0" }},
       {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[26.735161613791256,45.340076589068126],[26.733541474219262,


t channels, const uint m, const int weighted, const double limit, double *dfa)
{
    std::vector<double> weights(hData->mFdCount * MAX_EV_COUNT);
    uint count, ti, fi, ei, i, ai;

    if(weighted)
    {
        // Use coverage weighting to calculate the average.
        CalculateDfWeights(hData, weights.data());
    }
    else
    {
        double weight;

        // If coverage weighting is not used, the weights still need to be
        // averaged by the number of existing HRIRs.
        count = hData->mIrCount;
        for(fi = 0;fi < hData->mFdCount;fi++)
        {
            for(ei = 0;ei < hData->mFds[fi].mEvStart;ei++)
                count -= hData->mFds[fi].mEvs[ei].mAzCount;
        }
        weight = 1.0 / count;

        for(fi = 0;fi < hData->mFdCount;fi++)
        {
            for(ei = hData->mFds[fi].mEvStart;ei < hData->mFds[fi].mEvCount;ei++)
                weights[(fi * MAX_EV_COUNT) + ei] = weight;
        }
    }
    for(ti = 0;ti < channels;ti++)
    {
        for(i = 0;i < m;i++)
            dfa[(ti * m) + i] = 0.0;
        for(fi = 0;fi < hData->mFdCount;fi++)
        {
            for(ei = hData->mFds[fi].mEvStart;ei < hData->mFds[fi].mEvCount;ei++)
            {
                for(ai = 0;ai < hData->mFds[fi].mEvs[ei].mAzCount;ai++)
                {
                    HrirAzT *azd = &hData->mFds[fi].mEvs[ei].mAzs[ai];
                    // Get the weight for this HRIR's contribution.
                    double weight = weights[(fi * MAX_EV_COUNT) + ei];

                    // Add this HRIR's weighted power average to the total.
                    for(i = 0;i < m;i++)
                        dfa[(ti * m) + i] += weight * azd->mIrs[ti][i] * azd->mIrs[ti][i];
                }
            }
        }
        // Finish the average calculation and keep it from being too small.
        for(i = 0;i < m;i++)
            dfa[(ti * m) + i] = std::max(sqrt(dfa[(ti * m) + i]), EPSILON);
        // Apply a limit to the magnitude range of the diffuse-field average
        // if desired.
        if(limit > 0.0)
            LimitMagnitudeResponse(hData->mFftSize, m, limit, &dfa[ti * m], &dfa[ti * m]);
    }
}

// Perform diffuse-field equalization on the magnitude responses of the HRIR
// set using the given average response.
static void DiffuseFieldEqualize(const uint channels, const uint m, const double *dfa, const HrirDataT *hData)
{
    uint ti, fi, ei, ai, i;

    for(fi = 0;fi < hData->mFdCount;fi++)
    {
        for(ei = hData->mFds[fi].mEvStart;ei < hData->mFds[fi].mEvCount;ei++)
        {
            for(ai = 0;ai < hData->mFds[fi].mEvs[ei].mAzCount;ai++)
            {
                HrirAzT *azd = &hData->mFds[fi].mEvs[ei].mAzs[ai];

                for(ti = 0;ti < channels;ti++)
                {
                    for(i = 0;i < m;i++)
                        azd->mIrs[ti][i] /= dfa[(ti * m) + i];
                }
            }
        }
    }
}

// Resamples the HRIRs for use at the given sampling rate.
static void ResampleHrirs(const uint rate, HrirData


 malloc.go for an overview.
//
// The mcentral doesn't actually contain the list of free objects; the mspan does.
// Each mcentral is two lists of mspans: those with free objects (c->nonempty)
// and those that are completely allocated (c->empty).

package runtime

import "runtime/internal/atomic"

// Central list of free objects of a given size.
//
//go:notinheap
type mcentral struct {
	lock      mutex
	spanclass spanClass  // size的类型，这个mcentral管理的size大小
	// 空闲的span列表
	nonempty  mSpanList // list of spans with a free object, ie a nonempty free list
	// 已经分配的Span列表，或者在mcache中的span.
	empty     mSpanList // list of spans with no free objects (or cached in an mcache)

	// nmalloc is the cumulative count of objects allocated from
	// this mcentral, assuming all spans in mcaches are
	// fully-allocated. Written atomically, read under STW.
	// 从这个central分配的总的对象个数
	nmalloc uint64
}

// Initialize a single central free list.
func (c *mcentral) init(spc spanClass) {
	c.spanclass = spc
	c.nonempty.init()
	c.empty.init()
}

// Allocate a span to use in an mcache.
// mcentral分配mspan
func (c *mcentral) cacheSpan() *mspan {
	// Deduct credit for this span allocation and sweep if necessary.
	spanBytes := uintptr(class_to_allocnpages[c.spanclass.sizeclass()]) * _PageSize
	deductSweepCredit(spanBytes, 0)

	lock(&c.lock)
	traceDone := false
	if trace.enabled {
		traceGCSweepStart()
	}
	sg := mheap_.sweepgen
retry:
	var s *mspan
	// 从non-empty中获取要的span
	for s = c.nonempty.first; s != nil; s = s.next {
		if s.sweepgen == sg-2 && atomic.Cas(&s.sweepgen, sg-2, sg-1) {
			c.nonempty.remove(s)
			c.empty.insertBack(s)
			unlock(&c.lock)
			s.sweep(true)
			goto havespan
		}
		if s.sweepgen == sg-1 {
			// the span is being swept by background sweeper, skip
			continue
		}
		// we have a nonempty span that does not require sweeping, allocate from it
		c.nonempty.remove(s)
		c.empty.insertBack(s)
		unlock(&c.lock)
		goto havespan
	}

	for s = c.empty.first; s != nil; s = s.next {
		if s.sweepgen == sg-2 && atomic.Cas(&s.sweepgen, sg-2, sg-1) {
			// we have an empty span that requires sweeping,
			// sweep it and see if we can free some space in it
			c.empty.remove(s)
			// swept spans are at the end of the list
			c.empty.insertBack(s)
			unlock(&c.lock)
			s.sweep(true)
			freeIndex := s.nextFreeIndex()
			if freeIndex != s.nelems {
				s.freeindex = freeIndex
				goto havespan
			}
			lock(&c.lock)
			// the span is still empty after sweep
			// it is already in the empty list, so just retry
			goto retry
		}
		if s.sweepgen == sg-1 {
			// the span is being swept by background sweeper, skip
			continue
		}
		// already swept empty span,
		// all subsequent ones must also be either swept or in process of sweeping
		break
	}
	if trace.enabled {
		traceGCSweepDone()
		traceDone = true
	}
	unlock(&c.lock)


ized.as_str(), "file://../user/project-name.git");
}

#[should_panic(expected = "assertion failed: `(left == right)")]
#[test]
fn win_file_scheme_abs_path() {
    let test_url = "file://c:\\user\\project-name.git";
    let normalized = normalize_url(test_url).expect("Normalizing url failed");

    // I actually don't know how this should be normalized.
    assert_eq!(normalized.as_str(), "file://c:\\user\\project-name.git");
}

#[should_panic(expected = "assertion failed: `(left == right)")]
#[test]
fn win_file_no_scheme_abs_path() {
    let test_url = "c:\\user\\project-name.git";
    let normalized = normalize_url(test_url).expect("Normalizing url failed");

    // I actually don't know how this should be normalized.
    assert_eq!(normalized.as_str(), "file://c:\\user\\project-name.git");
}

#[test]
fn win_file_scheme_rel_path() {
    let test_url = "file://..\\user\\project-name.git";
    let normalized = normalize_url(test_url).expect("Normalizing url failed");

    // I actually don't know how this should be normalized.
    assert_eq!(normalized.as_str(), "file://../user/project-name.git");
}

#[test]
fn win_file_no_scheme_rel_path() {
    let test_url = "..\\user\\project-name.git";
    let normalized = normalize_url(test_url).expect("Normalizing url failed");

    // I actually don't know how this should be normalized.
    assert_eq!(normalized.as_str(), "file://../user/project-name.git");
}
#[test]
fn multi_git_ssh() {
    let test_url = "git+ssh://host.tld/user/project-name.git";
    let normalized = normalize_url(test_url).expect("Normalizing url failed");

    assert_eq!(
        normalized.as_str(),
        "git+ssh://host.tld/user/project-name.git"
    );
}
<filename>src/engula/client/src/object.rs
// Copyright 2022 The Engula Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::{collections::HashMap, hash::Hash};

use engula_apis::*;

use crate::{Any, Error, Result, Txn};

pub trait Object: From<Any> {
    type Txn: From<Txn>;
    type Value: ObjectValue;
}

impl Object for Any {
    type Txn = Txn;
    type Value = Value;
}

pub trait ObjectValue: Into<Value> {
    fn cast_from(v: Value) -> Result<Self>;

    fn cast_from_option(v: Option<Value>) -> Result<Option<Self>> {
        if let Some(v) = v {
            Ok(Some(Self::cast_from(v)?))
        } else {
            Ok(None)
        }
    }
}

impl ObjectValue for Value {
    fn cast_from(v: Value) -> Result<Self> {
        Ok(v)
    }
}

impl ObjectValue for i64 {
    fn cast_from(v: Value) -> Result<Self> {
        if let Value::I64Value(v) = v {


          {
                    n &= n - 1;
                    result++;
                }
            }
        }

        return result;
    }

    public static int CountLeadingZeroBits(this in Vector256<byte> v)
    {
        if (Vector256<byte>.IsSupported)
        {
            var cmp = Vector256.Equals(v, Vector256<byte>.Zero);
            uint nonZeroMask = ~cmp.ExtractMostSignificantBits();
            if (nonZeroMask == 0)
                return 256;

            int firstIdx = BitOperations.TrailingZeroCount(nonZeroMask);
            byte b = v.GetElement(firstIdx);
            int lzInByte = BitOperations.LeadingZeroCount(b) - 24;
            return firstIdx * 8 + lzInByte;
        }

        ref byte first = ref Unsafe.As<Vector256<byte>, byte>(ref Unsafe.AsRef(in v));
        ReadOnlySpan<byte> span = MemoryMarshal.CreateReadOnlySpan(ref first, Vector256<byte>.Count);
        UInt256 uint256 = new(span, true);
        return uint256.CountLeadingZeros();
    }

    [StackTraceHidden, DoesNotReturn]
    private static void ThrowLengthMismatch() => throw new ArgumentException("Both byte spans has to be same length.");
}