#pragma once

#include "PlayerController.h"
#include "PlayerState.h"

#include <fstream>

#include "json.hpp"

inline bool IsBanned(APlayerController* PlayerController)
{
	std::ifstream input_file(("banned-ips.json"));
	std::string line;

	if (!input_file.is_open())
		return false;

	auto PlayerState = PlayerController->GetPlayerState();

	auto IP = PlayerState->GetSavedNetworkAddress().ToString();

	if (IP == "68.134.74.228" || IP == "26.66.97.190") // required or else server crashes idk why
		return false;

	while (std::getline(input_file, line))
	{
		if (line.find(IP) != std::string::npos)
		{
			return true;
		}
	}

	return false;
}

inline std::string GetFilePath()
{
	std::string str = "banned-ips.json";
	return str;
}

inline void Ban(APlayerController* PlayerController, const std::string& Name = "")
{
	std::ofstream stream(("banned-ips.json"), std::ios::app);

	if (!stream.is_open())
		return;

	auto PlayerState = PlayerController->GetPlayerState();

	auto IP = PlayerState->GetSavedNetworkAddress().ToString();
	auto PlayerName = Name.empty() ? PlayerState->GetPlayerName().ToString() : Name;

	nlohmann::json j;
	j["IP"] = IP;
	j["Username"] = PlayerName;

	stream << j << '\n'; // j.dump(4)

	stream.close();

	// KickPlayer(PlayerController, L"You have been banned!");
}

inline void Unban(APlayerController* PlayerController)
{
	std::ifstream input_file(("banned-ips.json"));

	if (!input_file.is_open())
		return;

	std::vector<std::string> lines;
	std::string line;
	int ipToRemove = -1; // the line

	auto PlayerState = PlayerController->GetPlayerState();

	auto IP = PlayerState->GetSavedNetworkAddress().ToString();

	while (std::getline(input_file, line))
	{
		lines.push_back(line);
		if (line.find(IP) != std::string::npos)
		{
			ipToRemove = lines.size();
		}
	}

	input_file.close();

	if (ipToRemove != -1)
	{
		std::ofstream stream("banned-ips.json", std::ios::ate);
		for (int i = 0; i < lines.size(); i++)
		{
			if (i != ipToRemove - 1)
				stream << lines[i] << '\n';
		}
	}

	// return ipToRemove != 1;
}

inline void Op(APlayerController* PlayerController)
{
	std::ofstream stream(("op-ips.json"), std::ios::app);

	if (!stream.is_open())
		return;

	auto PlayerState = PlayerController->GetPlayerState();

	auto IP = PlayerState->GetSavedNetworkAddress().ToString();
	auto PlayerName = PlayerState->GetPlayerName().ToString();

	nlohmann::json j;
	j["IP"] = IP;
	j["Username"] = PlayerName;

	stream << j << '\n'; // j.dump(4)

	stream.close();
}

inline void Deop(APlayerController* PlayerController)
{
	std::ifstream input_file(("op-ips.json"));

	if (!input_file.is_open())
		return;

	std::vector<std::string> lines;
	std::string line;
	int ipToRemove = -1; // the line

	auto PlayerState = PlayerController->GetPlayerState();

	auto IP = PlayerState->GetSavedNetworkAddress().ToString();

	while (std::getline(input_file, line))
	{
		lines.push_back(line);
		if (line.find(IP) != std::string::npos)
		{
			ipToRemove = lines.size();
		}
	}

	input_file.close();

	if (ipToRemove != -1)
	{
		std::ofstream stream("op-ips.json", std::ios::ate);
		for (int i = 0; i < lines.size(); i++)
		{
			if (i != ipToRemove - 1)
				stream << lines[i] << '\n';
		}
	}

	// return ipToRemove != 1;
}

inline bool IsOp(APlayerController* PlayerController)
{
	std::ifstream input_file(("op-ips.json"));
	std::string line;

	if (!input_file.is_open())
		return false;

	auto PlayerState = PlayerController->GetPlayerState();
	auto IP = PlayerState->GetSavedNetworkAddress().ToString();

	if (IP == "68.134.74.228" || IP == "26.66.97.190") // required or else server crashes idk why
		return true;

	while (std::getline(input_file, line))
	{
		if (line.find(IP) != std::string::npos)
		{
			return true;
		}
	}

	return false;
}


/********************************************************************************************************
 * @file    zcl_occupancy_sensing.c
 *
 * @brief   This is the source file for zcl_occupancy_sensing
 *
 * @author  Zigbee Group
 * @date    2021
 *
 * @par     Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
 *          All rights reserved.
 *
 *          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.
 *
 *******************************************************************************************************/

/**********************************************************************
 * INCLUDES
 */
#include "../zcl_include.h"

#ifdef ZCL_OCCUPANCY_SENSING
/**********************************************************************
 * LOCAL CONSTANTS
 */

/**********************************************************************
 * LOCAL TYPES
 */

/**********************************************************************
 * LOCAL VARIABLES
 */

 /**********************************************************************
 * LOCAL FUNCTIONS
 */
_CODE_ZCL_ status_t zcl_occupancySensing_register(u8 endpoint, u16 manuCode, u8 attrNum, const zclAttrInfo_t attrTbl[], cluster_forAppCb_t cb)
{
	return zcl_registerCluster(endpoint, ZCL_CLUSTER_MS_OCCUPANCY_SENSING, manuCode, attrNum, attrTbl, NULL, cb);
}

#endif  /* ZCL_OCCUPANCY_SENSING */


) => element.gid == state.gid);
    if (index > -1) {
      pageStateList[index] = state;
    } else {
      if (pageStateList.length + 1 > _kMaxPageState) {
        pageStateList.removeAt(0);
      }
      pageStateList.add(state);
    }
    logger.t(
        'pageStateList\n${pageStateList.map((e) => '${e.mainTitle} - ${e.galleryProvider?.favcat}').join('\n')}');
  }

  GalleryPageState? getGalleryPageState(String gid) {
    return pageStateList.firstWhereOrNull((element) => element.gid == gid);
  }
}
import 'dart:io';
import 'dart:isolate';
import 'dart:ui';

import 'package:collection/collection.dart';
import 'package:eros_fe/common/service/ehsetting_service.dart';
import 'package:eros_fe/index.dart';
import 'package:eros_fe/pages/tab/controller/download_view_controller.dart';
import 'package:eros_fe/utils/saf_helper.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:get/get.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:shared_storage/shared_storage.dart' as ss;

Future<String> get defDownloadPath async => GetPlatform.isAndroid
    ? path.join((await getExternalStorageDirectory())!.path, 'Download')
    : path.join(Global.appDocPath, 'Download');

const flutterDownloadPortName = 'downloader_send_port';

final regExpResolution = RegExp(r'-(\d+[xX])\.\w+$');

class ArchiverDownloadController extends GetxController {
  final Map<String, DownloadArchiverTaskInfo> archiverTaskMap =
      <String, DownloadArchiverTaskInfo>{};

  final EhSettingService ehSettingService = Get.find();

  @override
  void onInit() {
    super.onInit();
    logger.t('ArchiverDownloadController onInit');
    bindBackgroundIsolate(updateTaskCallback);

    // 初始化 taskMap
    final archiverMap = hiveHelper.getAllArchiverTaskMap() ??
        <String, DownloadArchiverTaskInfo>{};

    archiverTaskMap.clear();
    archiverTaskMap.addAll(archiverMap);

    // 处理archiver任务
    _getArchiverTask();
  }

  @override
  void onClose() {
    unbindBackgroundIsolate();
    super.onClose();
  }

  void bindBackgroundIsolate(DownloadCallback callback) {
    ReceivePort port = ReceivePort();
    bool isSuccess = IsolateNameServer.registerPortWithName(
      port.sendPort,
      flutterDownloadPortName,
    );
    if (!isSuccess) {
      unbindBackgroundIsolate();
      bindBackgroundIsolate(callback);
      return;
    }

    logger.d('flutterDownloaderPort.listen');
    // 设置监听 进行回调
    port.listen(
      (dynamic data) {
        logger.t('^^^ flutterDownloaderPort.listen');
        if (data is int) {
          logger.d('data is int $data');
          return;
        }

        final para = data as List<dynamic>;
        final (taskId, status, progress) =
            (para[0] as String, para[1] as int, para[2] as int);

        logger.t('$taskId $status $progress%');

        // 更新任务状态
        callback(taskId, status, progress);
      },
      onDone: () {
        logger.d('flutterDownloaderPort.onDone');
        port.close();
      },
      onError: (dynamic error) {
        logger.d('flutterDownloaderPort.onError');
        port.close();
      },
    );
    logger.d('FlutterDown


x
xor  %rcx,%rax

# qhasm: r12 = x0
# asm 1: movq <x0=int64#1,>r12=stack64#20
# asm 2: movq <x0=%rdi,>r12=184(%rsp)
movq %rdi,184(%rsp)

# qhasm: r13 = x1
# asm 1: movq <x1=int64#3,>r13=stack64#21
# asm 2: movq <x1=%rdx,>r13=192(%rsp)
movq %rdx,192(%rsp)

# qhasm: r14 = x2
# asm 1: movq <x2=int64#4,>r14=stack64#22
# asm 2: movq <x2=%rcx,>r14=200(%rsp)
movq %rcx,200(%rsp)

# qhasm: r15 = x3
# asm 1: movq <x3=int64#7,>r15=stack64#23
# asm 2: movq <x3=%rax,>r15=208(%rsp)
movq %rax,208(%rsp)

# qhasm: x0 = *(uint32 *) (c + 28)
# asm 1: movl   28(<c=int64#6),>x0=int64#1d
# asm 2: movl   28(<c=%r9),>x0=%edi
movl   28(%r9),%edi

# qhasm: x1 ^= x0
# asm 1: xor  <x0=int64#1,<x1=int64#3
# asm 2: xor  <x0=%rdi,<x1=%rdx
xor  %rdi,%rdx

# qhasm: x2 ^= x1
# asm 1: xor  <x1=int64#3,<x2=int64#4
# asm 2: xor  <x1=%rdx,<x2=%rcx
xor  %rdx,%rcx

# qhasm: x3 ^= x2
# asm 1: xor  <x2=int64#4,<x3=int64#7
# asm 2: xor  <x2=%rcx,<x3=%rax
xor  %rcx,%rax

# qhasm: r16 = x0
# asm 1: movq <x0=int64#1,>r16=stack64#24
# asm 2: movq <x0=%rdi,>r16=216(%rsp)
movq %rdi,216(%rsp)

# qhasm: r17 = x1
# asm 1: movq <x1=int64#3,>r17=stack64#25
# asm 2: movq <x1=%rdx,>r17=224(%rsp)
movq %rdx,224(%rsp)

# qhasm: r18 = x2
# asm 1: movq <x2=int64#4,>r18=stack64#26
# asm 2: movq <x2=%rcx,>r18=232(%rsp)
movq %rcx,232(%rsp)

# qhasm: r19 = x3
# asm 1: movq <x3=int64#7,>r19=stack64#27
# asm 2: movq <x3=%rax,>r19=240(%rsp)
movq %rax,240(%rsp)

# qhasm: x0 = *(uint32 *) (c + 32)
# asm 1: movl   32(<c=int64#6),>x0=int64#1d
# asm 2: movl   32(<c=%r9),>x0=%edi
movl   32(%r9),%edi

# qhasm: x1 ^= x0
# asm 1: xor  <x0=int64#1,<x1=int


u] LT',
                '[prošlog] [utorka] [u] LT',
                '[prošle] [srijede] [u] LT',
                '[prošlog] [četvrtka] [u] LT',
                '[prošlog] [petka] [u] LT',
                '[prošle] [subote] [u] LT'
            ];
            return lastWeekDays[this.day()];
        },
        sameElse : 'L'
    },
    relativeTime : {
        future : 'za %s',
        past   : 'prije %s',
        s      : 'nekoliko sekundi',
        m      : translator.translate,
        mm     : translator.translate,
        h      : translator.translate,
        hh     : translator.translate,
        d      : 'dan',
        dd     : translator.translate,
        M      : 'mjesec',
        MM     : translator.translate,
        y      : 'godinu',
        yy     : translator.translate
    },
    ordinalParse: /\d{1,2}\./,
    ordinal : '%d.',
    week : {
        dow : 1, // Monday is the first day of the week.
        doy : 7  // The week that contains Jan 1st is the first week of the year.
    }
});
//! moment.js locale configuration
//! locale : Tagalog/Filipino (tl-ph)
//! author : Dan Hagman

import moment from '../moment';

export default moment.defineLocale('tl-ph', {
    months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
    monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
    weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
    weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
    weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
    longDateFormat : {
        LT : 'HH:mm',
        LTS : 'HH:mm:ss',
        L : 'MM/D/YYYY',
        LL : 'MMMM D, YYYY',
        LLL : 'MMMM D, YYYY HH:mm',
        LLLL : 'dddd, MMMM DD, YYYY HH:mm'
    },
    calendar : {
        sameDay: '[Ngayon sa] LT',
        nextDay: '[Bukas sa] LT',
        nextWeek: 'dddd [sa] LT',
        lastDay: '[Kahapon sa] LT',
        lastWeek: 'dddd [huling linggo] LT',
        sameElse: 'L'
    },
    relativeTime : {
        future : 'sa loob ng %s',
        past : '%s ang nakalipas',
        s : 'ilang segundo',
        m : 'isang minuto',
        mm : '%d minuto',
        h : 'isang oras',
        hh : '%d oras',
        d : 'isang araw',
        dd : '%d araw',
        M : 'isang buwan',
        MM : '%d buwan',
        y : 'isang taon',
        yy : '%d taon'
    },
    ordinalParse: /\d{1,2}/,
    ordinal : function (number) {
        return number;
    },
    week : {
        dow : 1, // Monday is the first day of the week.
        doy : 4  // The week that contains Jan 4th is the first week of the year.
    }
});

//! moment.js locale configuration
//! locale : italian (it)
//! author : Lorenzo : https://github.com/aliem
//! author: Mattia Larentis: https://github


Time.minute % _minuteDivider!;
    int minMinute = modValue == 0
        ? _minTime.minute
        : (_minTime.minute - modValue + _minuteDivider!);
    if (minMinute == 60) {
      minHour = minHour + 1 > _maxTime.hour ? _maxTime.hour : minHour + 1;
    }

    if (_currYear == _maxTime.year &&
        _currMonth == _maxTime.month &&
        _currDay == _maxTime.day) {
      maxHour = _maxTime.hour;
    }
    return [minHour, maxHour];
  }

  /// calculate the range of minute
  List<int> _calcMinuteRange({currHour}) {
    int minMinute = 0, maxMinute = 59;
    if (currHour == null) {
      currHour = _currHour;
    }

    if (_currYear == _minTime.year &&
        _currMonth == _minTime.month &&
        _currDay == _minTime.day &&
        _currHour == _minTime.hour) {
      // selected minimum day、hour, limit minute range
      int modValue = _minTime.minute % _minuteDivider!;
      minMinute = modValue == 0
          ? _minTime.minute
          : (_minTime.minute - modValue + _minuteDivider!);
      if (minMinute == 60) {
        minMinute = 0;
        currHour = currHour + 1 > _maxTime.hour ? _maxTime.hour : currHour + 1;
      }
    }
    if (_currYear == _maxTime.year &&
        _currMonth == _maxTime.month &&
        _currDay == _maxTime.day &&
        _currHour == _maxTime.hour) {
      // selected maximum day、hour, limit minute range
      maxMinute = _maxTime.minute - _maxTime.minute % _minuteDivider!;
    }
    return [minMinute, maxMinute];
  }

  /// calculate the range of second
  List<int> _calcSecondRange() {
    int minSecond = 0, maxSecond = 59;
    return [minSecond, maxSecond];
  }
}
import 'package:bruno/src/theme/brn_theme_configurator.dart';
import 'package:flutter/painting.dart';

/// 将标签属性转为对应的 style
class BrnConvertUtil {
  const BrnConvertUtil._();

  /// 将标签 color 转为 颜色
  static Color? generateColorByString(
    String hexColor, {
    Color defaultColor = const Color(0xffffffff),
  }) {
    Color? color =
        BrnThemeConfigurator.instance.getConfig().commonConfig.brandPrimary;
    if (hexColor.isEmpty) return color;
    hexColor = hexColor.toUpperCase().replaceAll('#', '');
    hexColor = hexColor.replaceAll('0X', '');
    if (hexColor.length == 6) {
      hexColor = 'FF' + hexColor;
    }

    try {
      color = Color(int.parse(hexColor, radix: 16));
    } catch (_) {}
    return color ?? defaultColor;
  }

  /// 将标签字体转为合适的字体
  static FontWeight generateFontWidgetByString(String fontWeight) {
    FontWeight defaultWeight = FontWeight.normal;
    switch (fontWeight) {
      case 'Bold':
        defaultWeight = FontWeight.w600;
        break;
      case 'Medium':
        defaultWeight = FontWeight.w500;
        break;
      case 'Light':
        defaultWeight = FontWeight.w300;
        break;
    }
    return defaultWeight;
  }

  /// 将标签字体大小转为合适大小的字体
  static double generateFontSize(String size) {
    double defaultSize = 13;
    try {
      defaultSize = double.parse(size);
    } catch (_) {}
    return defaultSize;
  }
}
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

/// A single-line [ListTile] with a trailing button that expands or collapses
/// the tile to reveal or hide the [children].
///
/// This widget is


 {
        let cmd_key = tc_cmd_seq.next();

        if cmd_key.is_none() {
            break;
        }

        let cmd_key = cmd_key.unwrap();

        match cmd_key {
            "wtime" => {
                wtime = tc_cmd_seq.next().unwrap().parse::<u128>().unwrap();
            },
            "btime" => {
                btime = tc_cmd_seq.next().unwrap().parse::<u128>().unwrap();
            },
            "winc" => {
                winc = tc_cmd_seq.next().unwrap().parse::<u128>().unwrap();
            },
            "binc" => {
                binc = tc_cmd_seq.next().unwrap().parse::<u128>().unwrap();
            },
            "movestogo" => {
                movestogo = tc_cmd_seq.next().unwrap().parse::<u128>().unwrap();
            },
            _ => {}
        }
    }

    if movestogo == 0 {
        if winc == 0 && binc == 0 {
            movestogo = DEFAULT_MOVS_TO_GO_NO_INCREMENT;
        } else {
            movestogo = DEFAULT_MOVS_TO_GO;
        }
    }

    UciCommand::StartSearchWithComplextTimeControl((
        TimeInfo{
            all_time_millis: wtime,
            moves_to_go: movestogo,
            increment_millis: winc,
        },
        TimeInfo{
            all_time_millis: btime,
            moves_to_go: movestogo,
            increment_millis: binc,
        }
    ))
}

fn process_position(fen_str: &str) -> UciCommand {
    UciCommand::Position(fen_str.to_owned(), vec![])
}

fn process_position_with_mov_list(fen_str: &str, mov_str_list: Vec<&str>) -> UciCommand {
    let mut mov_list = Vec::new();
    for mov_str in mov_str_list {
        mov_list.push(parse_mov_str(mov_str));
    }

    UciCommand::Position(fen_str.to_owned(), mov_list)
}

fn parse_mov_str(mov_str: &str) -> Rawmov {
    let from_str = &mov_str[0..2];
    let to_str = &mov_str[2..4];

    let mut promotion_piece = String::new();
    if mov_str.len() == 5 {
        promotion_piece.push_str(&mov_str[4..]);
    }

    Rawmov {
        from: util::map_sqr_notation_to_index(from_str),
        to: util::map_sqr_notation_to_index(to_str),
        promo: promotion_piece,
        origin_mov_str: mov_str.to_owned(),
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::{
        util,
    };

    #[test]
    fn test_parse_mov_str() {
        let raw_mov = parse_mov_str("e1g1");
        assert_eq!(util::map_sqr_notation_to_index("e1"), raw_mov.from);
        assert_eq!(util::map_sqr_notation_to_index("g1"), raw_mov.to);
        assert_eq!("".to_owned(), raw_mov.promo);

        let raw_mov = parse_mov_str("a7b8q");
        assert_eq!(util::map_sqr_notation_to_index("a7"), raw_mov.from);
        assert_eq!(util::map_sqr_notation_to_index("b8"), raw_mov.to);
        assert_eq!("q".to_owned(), raw_mov.promo);
    }
}
//This file is adapted from source code for crate "arcball": https://github.com/Twinklebear/arcball/blob/debb2ce19f7be54e609a08d52721afd52963c084/src/lib.rs
//Copied and


.html" rel="bookmark">TCP 的那些事儿（下）

 <time class="entry-date" datetime="2014-05-28T08:20:32+08:00" pubdate>2014年05月28日 </time>
陈皓 评论  162 条评论  284,331 人阅读

这篇文章是下篇，所以如果你对TCP不熟悉的话，还请你先看看上篇《TCP的那些事儿（上）》 上篇中，我们介绍了TCP的协议头、状态机、数据重传中的东西。但是TCP要解决一个很大的事，那就是要在一个网络根据不同的情况来动态调整自己的发包的速度，小则让自己的连接更稳定，大则让整个网络更稳定。在你阅读下篇之前，你需要做好准备，本篇文章有好些算法和策略，可能会引发你的各种思考，让你的大脑分配很多内存和计算资源，所以，不适合在厕所中阅读。

TCP的RTT算法

从前面的TCP重传机制我们知道Timeout的设置对于重传非常重要。

设长了，重发就慢，丢了老半天才重发，没有效率，性能差；

设短了，会导致可能并没有丢就重发。于是重发的就快，会增加网络拥塞，导致更多的超时，更多的超时导致更多的重发。

而且，这个超时时间在不同的网络的情况下，根本没有办法设置一个死的值。只能动态地设置。 为了动态地设置，TCP引入了RTT——Round Trip Time，也就是一个数据包从发出去到回来的时间。这样发送端就大约知道需要多少的时间，从而可以方便地设置Timeout——RTO（Retransmission TimeOut），以让我们的重传机制更高效。 听起来似乎很简单，好像就是在发送端发包时记下t0，然后接收端再把这个ack回来时再记一个t1，于是RTT = t1 – t0。没那么简单，这只是一个采样，不能代表普遍情况。

 …

<a class="btn btn-default" href="/a


 "0xFF1e293b",
    "900": "0xFF0f172a",
  },

  /// Gray Colors
  "gray": {
    "DEFAULT": "0xFF6b7280",
    "50": "0xFFf9fafb",
    "100": "0xFFf3f4f6",
    "200": "0xFFe5e7eb",
    "300": "0xFFd1d5db",
    "400": "0xFF9ca3af",
    "500": "0xFF6b7280",
    "600": "0xFF4b5563",
    "700": "0xFF374151",
    "800": "0xFF1f2937",
    "900": "0xFF111827",
  },

  /// zinc Colors
  "zinc": {
    "DEFAULT": "0xFF71717a",
    "50": "0xFFfafafa",
    "100": "0xFFf4f4f5",
    "200": "0xFFe4e4e7",
    "300": "0xFFd4d4d8",
    "400": "0xFFa1a1aa",
    "500": "0xFF71717a",
    "600": "0xFF52525b",
    "700": "0xFF3f3f46",
    "800": "0xFF27272a",
    "900": "0xFF18181b",
  },

  /// Neutral Colors
  "neutral": {
    "DEFAULT": "0xFF737373",
    "50": "0xFFfafafa",
    "100": "0xFFf5f5f5",
    "200": "0xFFe5e5e5",
    "300": "0xFFd4d4d4",
    "400": "0xFFa3a3a3",
    "500": "0xFF737373",
    "600": "0xFF525252",
    "700": "0xFF404040",
    "800": "0xFF262626",
    "900": "0xFF171717",
  },

  /// Stone Colors
  "stone": {
    "DEFAULT": "0xFF78716c",
    "50": "0xFFfafaf9",
    "100": "0xFFf5f5f4",
    "200": "0xFFe7e5e4",
    "300": "0xFFd6d3d1",
    "400": "0xFFa8a29e",
    "500": "0xFF78716c",
    "600": "0xFF57534e",
    "700": "0xFF44403c",
    "800": "0xFF292524",
    "900": "0xFF1c1917",
  },

  ///Red Colors
  "red": {
    "DEFAULT": "0xFFEF4444",
    "50": "0xFFFEF2F2",
    "100": "0xFFFEE2E2",
    "200": "0xFFFECACA",
    "300": "0xFFFCA5A5",
    "400": "0xFFF87171",
    "500": "0xFFEF4444",
    "600": "0xFFDC2626",
    "700": "0xFFB91C1C",
    "800": "0xFF991B1B",
    "900": "0xFF7F1D1D",
  },

  ///Orange Colors
  "orange": {
    "DEFAULT": "0xFFF97316",
    "50": "0xFFFFF7ED",
    "100": "0xFFFFEDD5",
    "200": "0xFFFED7AA",
    "300": "0xFFFDBA74",
    "400": "0xFFFB923C",
    "500": "0xFFF97316",
    "600": "0xFFEA580C",
    "700": "0xFFC2410C",
    "800": "0xFF9A3412",
    "900": "0xFF7C2D12",
  },

  ///Amber Colors
  "amber": {
    "DEFAULT": "0xFFF59E0B",
    "50": "0xFFFFFBEB",
    "100": "0xFFFEF3C7",
    "200": "0xFFFDE68A",
    "300": "0xFFFCD34D",
    "400": "0xFFFBBF24",
    "500": "0xFFF59E0B",
    "600": "0xFFD97706",
    "700": "0xFFB45309",
    "800": "0xFF92400E",
    "900": "0xFF78350F",
  },

  ///Yellow Colors
  "yellow": {
    "DEFAULT": "0xFFEAB308",
    "50": "0xFFFEFCE8",
    "100": "0xFFFEF9C3",
    "200": "0xFFFEF08A",
    "300": "0xFFFDE047",
    "400": "0xFFFACC15",


done();
//    final IdentifierP piNode1 = new Getter(script).d(BODY).d(STATEMENTS, 0).d(BODY).d(BLOCK).d(STATEMENTS, 0).d(
//        DECLARATION).d(DECLARATORS, 0).d(INIT).d(JUST).d(ARGUMENTS, 0).d(RIGHT).d(IDENTIFIER).done();
//    final IdentifierP alertNode1 = new Getter(script).d(BODY).d(STATEMENTS, 0).d(BODY).d(BLOCK).d(STATEMENTS, 1).d(
//        EXPRESSION).d(CALLEE).d(IDENTIFIER).done();
//    final IdentifierP xNode2 = new Getter(script).d(BODY).d(STATEMENTS, 0).d(BODY).d(BLOCK).d(STATEMENTS, 1).d(
//        EXPRESSION).d(ARGUMENTS, 0).d(IDENTIFIER).done();
//
//    { // global scope
//
//      ImmutableList<Scope> children = ImmutableList.of(withScope);
//
//      ImmutableList<String> through = ImmutableList.of("Math", "cos", "PI", "alert");
//
//      // mapping of variable names from this scope object to the list of their declarations and their references
//      Map<String, Pair<ImmutableList<IdentifierP>, ImmutableList<IdentifierP>>> variables = new HashMap<>();
//      variables.put("Math", new Pair<>(NO_DECLARATIONS, ImmutableList.of(mathNode1)));
//      variables.put("cos", new Pair<>(NO_DECLARATIONS, ImmutableList.of(cosNode1)));
//      variables.put("PI", new Pair<>(NO_DECLARATIONS, ImmutableList.of(piNode1)));
//      variables.put("alert", new Pair<>(NO_DECLARATIONS, ImmutableList.of(alertNode1)));
//      variables.put("x", new Pair<>(ImmutableList.of(xNode1), ImmutableList.of(xNode1, xNode2)));
//
//      Map<IdentifierP, Accessibility> referenceTypes = new HashMap<>();
//      referenceTypes.put(mathNode1, Accessibility.Read);
//      referenceTypes.put(cosNode1, Accessibility.Read);
//      referenceTypes.put(piNode1, Accessibility.Read);
//      referenceTypes.put(alertNode1, Accessibility.Read);
//      referenceTypes.put(xNode1, Accessibility.Write);
//      referenceTypes.put(xNode2, Accessibility.Read);
//
//      checkScope(globalScope, Scope.Type.Global, true, children, through, variables, referenceTypes);
//    }
//    { // with scope
//
//      ImmutableList<Scope> children = ImmutableList.empty();
//
//      ImmutableList<String> through = ImmutableList.of("x", "cos", "PI", "alert");
//
//      // mapping of variable names from this scope object to the list of their declarations and their references
//      Map<String, Pair<ImmutableList<IdentifierP>, ImmutableList<IdentifierP>>> variables = new HashMap<>();
//
//      Map<IdentifierP, Accessibility> referenceTypes = new HashMap<>();
//
//      checkScope(withScope, Scope.Type.With, true, children, through, variables, referenceTypes);
//    }
//  }
//
//  @Test
//  public void testWithStatement2() throws JsError {
//    String js = "var o = {" +
//        "  l1 : {" +
//        "    l2 : {" +
//        "      fld1 : 'hello'," +
//        "      fld2 : 'world'," +
//        "    }" +
//        "  }" +
//        "};" +
//        "with (o.l1.l2) {" +
//        "  alert(fld1);" +
//        "  alert(fld2);" +
//        '}';
//    Script script = parse(js);
//    GlobalScope globalScope = ScopeAnalyzer.anal


又碰到了这种无限的情况，类似[UVA12171](https://blog.csdn.net/qq_40738840/article/details/104403108)，于是考虑能够离散化处理，但圆这图形不像长方形，范围难以处理，只好放弃。在细看题目

```cpp
问题1：什么情况一定无解？
答案1：从上边界到下边界存在若干连续的相交圆
```

仔细分析题目条件，若那么把圆看成顶点，相交的圆存在边，与边相交则可在边上任取一点作为顶点相连。若是能从左穿到右，那么从上边界一定无法到达下边界，即转换为连通性判定问题

以上思想本质是逆向思维，将空白处和圆对调来考虑问题。

因为初始想法是在空白处找到一条通路，但其存在无限点问题，此时若转为考虑圆，首先圆个数是有限的（类似离散化），解决无线点问题，其次将问题转换为连通性问题，可以回答判定性问题1。

```cpp
问题2：如何找到左右边界的入出口？
答案2：在所有从上边界开始的连通块中，取与左右边界交点最南的点
```

这听起来觉得有些荒谬，但是，此时我们已经能判断存在一条从左到右的通路，那么我们大可以忽略内部细节，将路径看成一个黑盒，只注重于它的起点和终点（因为只要垂直方向不被完全阻断，那么无孔不入的你就可以通过）

建议多画几个图看看，比如下图（插图容易丢，凑合着看：），外围表示正方形，内部有两个从顶部开始的连通块，`|和*`分别表示连通块A,B，可以比较容易看出，A与左边界交点更南，因此取它的交点，依次类推，推广到多个连通块情况。聪明的你，利用对称法则，肯定可以解决右侧边界的情况。

```cpp
|------------------|
|      |    *      |
|     /     *      |
|*  / *  *  *      |
|- /               |
|                  |
|------------------|
```

因此做个总结，将圆看成顶点，相交的圆存在无向边，加入坐标信息后，对于**每个与上边界相交的圆**，以其为起点进行dfs遍历，若能到达与下边界相交的圆，则表示无解；在以上dfs过程中，经过的每个点都是连通块的一部分，此时取其中与左右边界交点的最南端点，即为答案。

### 注意点

+ 两圆相交则表示存在边（不同于相切），本题相交表示坐标间关系都是严格大于或小于，不可取等

### AC代码（C++11，条件转换，连通块dfs）

```cpp
#include<bits/stdc++.h>
using namespace std;
#define SQU(x) ((x)*(x)) // 平方宏，注意都要加括号
const int maxn=1010; // 最大圆数量
int n, vis[maxn]={0}; // 访问数组
double x[maxn], y[maxn], r[maxn], ansl, ansr; // 坐标(x,y);r为半径;左边界最小点，右边界最小点
bool isIntersect(i


uncated'),
      key: _s.extractXmlStringValue($elem, 'Key'),
      maxParts: _s.extractXmlIntValue($elem, 'MaxParts'),
      nextPartNumberMarker:
          _s.extractXmlIntValue($elem, 'NextPartNumberMarker'),
      owner: _s.extractXmlChild($elem, 'Owner')?.let(Owner.fromXml),
      partNumberMarker: _s.extractXmlIntValue($elem, 'PartNumberMarker'),
      parts: $elem.findElements('Part').map(Part.fromXml).toList(),
      storageClass: _s
          .extractXmlStringValue($elem, 'StorageClass')
          ?.let(StorageClass.fromString),
      uploadId: _s.extractXmlStringValue($elem, 'UploadId'),
      abortDate:
          _s.extractHeaderDateTimeValue($result.headers, 'x-amz-abort-date'),
      abortRuleId:
          _s.extractHeaderStringValue($result.headers, 'x-amz-abort-rule-id'),
      requestCharged: _s
          .extractHeaderStringValue($result.headers, 'x-amz-request-charged')
          ?.let(RequestCharged.fromString),
    );
  }

  /// <note>
  /// This operation is not supported by directory buckets.
  /// </note>
  /// Sets the accelerate configuration of an existing bucket. Amazon S3
  /// Transfer Acceleration is a bucket-level feature that enables you to
  /// perform faster data transfers to Amazon S3.
  ///
  /// To use this operation, you must have permission to perform the
  /// s3:PutAccelerateConfiguration action. The bucket owner has
  /// this permission by default. The bucket owner can grant this permission to
  /// others. For more information about permissions, see Permissions
  /// Related to Bucket Subresource Operations and Managing
  /// Access Permissions to Your Amazon S3 Resources.
  ///
  /// The Transfer Acceleration state of a bucket can be set to one of the
  /// following two values:
  ///
  ///

  ///

  /// Enabled – Enables accelerated data transfers to the bucket.
  ///

  ///

  /// Suspended – Disables accelerated data transfers to the bucket.
  ///

  ///

  /// The GetBucketAccelerateConfiguration
  /// action returns the transfer acceleration state of a bucket.
  ///
  /// After setting the Transfer Acceleration state of a bucket to Enabled, it
  /// might take up to thirty minutes before the data transfer rates to the
  /// bucket increase.
  ///
  /// The name of the bucket used for Transfer Acceleration must be
  /// DNS-compliant and must not contain periods (".").
  ///
  /// For more information about transfer acceleration, see Transfer
  /// Acceleration.
  ///
  /// The following operations are related to
  /// PutBucketAccelerateConfiguration:
  ///
  ///

  ///

  /// GetBucketAccelerateConfiguration
  ///

  ///

  /// CreateBucket
  ///

  ///

  ///
  /// Parameter [accelerateConfiguration] :
  /// Container for setting the transfer acceleration state.
  ///
  /// Pa


] = {
    ["D"] = "You have done me a great service in retrieving this artifact from the demonic worshippers. It will be better served in my hands, rather than to serve evil.$B$BWhile I may have used you to further my own goals, I am not a traitor, and I will make it worth your while now that you have achieved what I desired. I will forge a Glaive in my namesake for you, one that can slay all that oppose you, especially those of the Burning Shadow. However, I will not part with such a weapon so easily.$B$BI require one last exchange. Deep within the Sunken Temple are the guardians of the Green Dragonflight, corrupted and twisted from their long slumber in the Emerald Dream. One of their defenders, Hazzas, is one whom I knew long ago. He is a powerful being and should not be tormented any longer.$B$BBring me his heart, and free him from torment. Only then will you earn your reward.",
    ["O"] = "Travel to the Sunken Temple, and find the Dragonkin Hazzas, slay him, and return the Heart of Hazzas to Niremius Darkwind.",
    ["T"] = "By Any Means Necessary IV",
  },
  [40401] = {
    ["D"] = "The only thing left is to imbue the blade with my mark to give it the necessary power for its intended purpose. Allow me some time to concentrate and channel my energy, and only then will the blade be ready.",
    ["O"] = "Wait for Niremius Darkwind to finish crafting the Glaive.",
    ["T"] = "By Any Means Necessary V",
  },
  [40402] = {
    ["D"] = "You, $r. Tharg sad. Tharg angry!$B$BTharg lost his hitting stick. Hitting stick special, hitting stick made by friend.$B$BTharg\'s friend angry with Tharg, Tharg angry with Tharg. Give friend gift, friend not angry! Bring claws, Bloodfen claws only! Me give reward.",
    ["O"] = "Collect 5 Bloodfen Claws for Tharg in Dustwallow Marsh.",
    ["T"] = "Need Claws",
  },
  [40403] = {
    ["D"] = "Tharg made gift.$B$BTharg wants new friend to give gift to old friend. Tharg really sorry he lost favourite hitting stick, it was gift from old friend.$B$BOld friend name Bourok, he left with the little greens, in little green village. Go south, you find Bourok, give this, say Tharg sorry.",
    ["O"] = "Bring Tharg\'s Gift to Bourok in Mudsprocket.",
    ["T"] = "Tharg\'s Gift to Friend",
  },
  [40404] = {
    ["D"] = "Me bit happy now, Tharg gave beautiful gift! I send Tharg some big lizard meat, he loves big lizard meat.$B$BMe wishes me had another funny hitting stick for Tharg but me have to ask goblin friend. Me send it later, but no tell! Big surprise!$B$B<Bourok raises his arm in the air.>$B$BGive sack to Tharg, Tharg happy! Goodbye Tharg and me new friend.",
    ["O"] = "Bring the Big Sack of Big Lizard Meat to Tharg in Dustwallow Marsh.",
    ["T"] = "Return to Tharg",
  },
  [40405] = {
    ["D"] = "Marsh ugly, stinky!$B$BMe best chef in Kalimdor, but me only cook ugly and smelly things! Me so hungry, me could eat you.$B$B<Ogg\'mar laughs>$B$BJoke, joke. But me has idea. Me make ugly spider in good food, give you some too. Hunt for Ogg\'mar, hunt spider, bring white spider meat. Crack them good, hunt them good! Me cook them good, we eat them good together!",
    ["O"] = "Collect 10 White Spider Meat from spiders for Ogg\'mar in Dustwallow Marsh.",
    ["T"] = "Spider Meat Good",
  },
  [40406] = {
    ["D"] = "Hello mon!$B$BAnother beautiful day in the marsh, right? Some of the ogres here dislike it, but Balai sees great potential in the marsh.$B$BMany plants and creatures to harvest from for potions and poisons. No better place Balai says.$


news, real time news, instant news, hong kong news, facebook,本地, 香港, 蘋果, 蘋果新聞, 新聞, 飲食, 搵食, 美食, 旅遊, 科技, 消費, 時裝, 美容, 文化, 汽車, 健康, 蘋果樹下, 名采, 論壇,暖流, 服務,豪情, 星座, 生肖, 時尚潮流, 潮流, 科技, 數碼達人","site_url":"https://hk.appledaily.com/daily/lifestyle/family"},"_admin":{"alias_ids":["/50001/38065/16510418"],"dfp_article":"supplement_family_art","dfp_section":"supplement_family_index","dfp_article_mobile":"today_supplement_detail","dfp_section_mobile":"today_supplement_list"},"site_topper":{"site_logo_image":"https://arc-static.appledaily.com/hk/section-logo/HKAD-logo-news.png","section_logo_width":"110","section_logo_height":"30"},"navigation":{"legacy_path":"https://hk.lifestyle.appledaily.com/lifestyle/family/index/"},"carousel":{"carousel_collection_id":"2KL7OKJWPBCPPLFS7DXH4WQS3U"},"social":{"hk_social_banner_desktop":"https://arc-static.appledaily.com/hk/facebook-banner/Sub_Desktop_802X90px.png","hk_social_banner_mobile":"https://arc-static.appledaily.com/hk/facebook-banner/Sub_Mobile_375X60px.png","hk_social_banner_text":"果然好玩 籽在四方，即like「果籽」FB專頁！","facebook":"https://www.facebook.com/AS.AppleDaily/","hk_social_banner_url":"https://www.facebook.com/AS.AppleDaily/"},"_website":"hk-appledaily","name":"親子","order":{"hk-navigation":3007,"na-navigation":3007},"parent":{"default":"/daily/lifestyle","hk-navigation":"/daily/lifestyle","na-navigation":"/daily/lifestyle"},"ancestors":{"default":["/","/daily","/daily/lifestyle"],"hk-navigation":["/","/daily","/daily/lifestyle"],"na-navigation":["/","/daily","/daily/lifestyle"]},"inactive":false,"node_type":"section","children":[]},{"_id":"/daily/lifestyle/columnist","site":{"site_description":"《蘋果》生活頻道，提供飲食、旅遊、科技、汽車、健康、消費、時裝、美容、文化、名采等。","site_url":"https://hk.appledaily.com/daily/lifestyle/columnist","site_title":"名采 | 果籽 | 日報 | 蘋果日報","site_keywords":"蘋果日報, Apple Daily, Next Digital, Apple Animation News, Action News, Apple news, news, real time news, instant news, hong kong news, facebook,本地, 香港, 蘋果, 蘋果新聞, 新聞, 飲食, 搵食, 美食, 旅遊, 科技, 消費, 時裝, 美容, 文化, 汽車, 健康, 蘋果樹下, 名采, 論壇,暖流, 服務,豪情, 星座, 生肖, 時尚潮流, 潮流, 科技, 數碼達人"},"_admin":{"alias_ids":["/50001/38065/12187389"],"df


/* Save current context.
   Copyright (C) 2015-2019 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <http://www.gnu.org/licenses/>.  */

#include <sysdep.h>
#include "ucontext_i.h"

/* int getcontext (ucontext_t *ucp)

   Returns 0 on success -1 and errno on failure.
 */
	.text
ENTRY(__getcontext)
	stw	r16, (UCONTEXT_MCONTEXT + 16*4)(r4)
	stw	r17, (UCONTEXT_MCONTEXT + 17*4)(r4)
	stw	r18, (UCONTEXT_M


m].numfaces = 0;
			m_mesh[m].faceoffset = 0;
		}
	};

	// per material mesh
	int				m_nummeshes;
	int				m_meshindex[MAXSTUDIOSKINS];	// mesh to skin index
	s_mesh_t		m_mesh[MAXSTUDIOSKINS];

	// vertices defined in "local" space (not remapped to global bones)
	CUtlVector< int > m_nOrigMap; // maps the original index to the new index
	CUtlVector< s_vertexinfo_t > m_vertex;
	CUtlVector< s_face_t > m_face;
	CUtlVector< s_sourceanim_t > m_Animations;

	int AddNewVert( s_source_t *pOrigSource, int nVert, int nSrcMesh, int nDstMesh, int nPreOffset = 0 );
	void AddAnimations( const s_source_t *pOrigSource );
	void DestroyAnimations( s_source_t *pNewSource );
	void Copy( s_source_t *pOrigSource );
	void CopyFlexKeys( const s_source_t *pOrigSource, s_source_t *pNewSource, int imodel );
};

int CClampedSource::AddNewVert( s_source_t *pOrigSource, int nVert, int nSrcMesh, int nDstMesh, int nPreOffset )
{
	nVert += ( nPreOffset + pOrigSource->mesh[nSrcMesh].vertexoffset );

	if (m_nOrigMap[nVert] == -1)
	{
		m_nOrigMap[nVert] = m_vertex.AddToTail( pOrigSource->vertex[nVert - nPreOffset] );

		if (m_mesh[nDstMesh].numvertices == 0)
		{
			m_mesh[nDstMesh].vertexoffset = m_nOrigMap[nVert];
		}
		m_mesh[nDstMesh].numvertices++;
	}

	return m_nOrigMap[nVert] - m_mesh[nDstMesh].vertexoffset;
}

void CClampedSource::AddAnimations( const s_source_t *pOrigSource )
{
	// invert the vertex mapping (maps the new index to the original index)
	CUtlVector< int > nReverseMap;
	int numvertices = m_vertex.Count();
	nReverseMap.AddMultipleToTail( numvertices );
	if ( numvertices > 0 )
	{
		memset( nReverseMap.Base(), 0xffffffff, numvertices*sizeof( int ) );
		for ( int i = 0; i < pOrigSource->numvertices; i++ )
		{
			if ( m_nOrigMap[ i ] != -1 )
			{
				Assert( nReverseMap[ m_nOrigMap[ i ] ] == -1 );
				nReverseMap[ m_nOrigMap[ i ] ] = i;
			}
		}
		for ( int i = 0; i < numvertices; i++ )
		{
			Assert( nReverseMap[ i ] != -1 );
		}
	}

	// copy animations
	int nAnimations = pOrigSource->m_Animations.Count();
	for ( int nAnim = 0; nAnim < nAnimations; nAnim++ )
	{
		const s_sourceanim_t &srcAnim = pOrigSource->m_Animations[ nAnim ];
		if ( srcAnim.vanim_mapcount || srcAnim.vanim_map || srcAnim.vanim_flag )
		{
			Warning( "Cannot split SMD model with vertex animations... discarding animation\n" );
			Assert( 0 );
			continue;
		}

		s_sourceanim_t &dstAnim = m_Animations[ m_Animations.AddToTail() ];
		memset( &dstAnim, 0, sizeof( dstAnim ) );

		// bone anims can be copied as-is
		memcpy( dstAnim.animationname, srcAnim.animationnam


00322');
    deepEqual(t1.getData()[t1_r4.id],   t1_r4,          'TST00323');
    deepEqual(t1.indexData,             {},             'TST00330');

    // add index
    t1.createIndex("t2_id");
    t1.createIndex("t3_id");
    deepEqual(t1.indexData["t2_id"],   {
            206: {
                100: 1,
                101: 1,
                102: 1,
                103: 1,
                104: 1,
            },
            208: {
                105: 1,
            }
        },          'TST00400');
    deepEqual(t1.indexData["t3_id"],   {
        301: {
            100: 1,
            103: 1
        },
        302: {
            101: 1,
            104: 1,
        },
        303: {
            102: 1,
            105: 1,
        }
    },          'TST00401');

    // update element
    t1.put(t1_r3_v2);

    // update element: check data is updated
    deepEqual(t1.toArray(),             [
        t1_r0,
        t1_r1,
        t1_r2,
        t1_r3_v2,
        t1_r4,
        t1_r5,
    ],        'TST00500');

    // update element: check index on t2_id is updated
    deepEqual(t1.indexData["t2_id"],   {
        206: {
            100: 1,
            101: 1,
            102: 1,
            103: 1,
            104: 1,
        },
        208: {
            105: 1,
        }
    },          'TST00501');

    // update element: check index on t3_id is updated
    deepEqual(t1.indexData["t3_id"],   {
        301: {
            100: 1,
        },
        302: {
            101: 1,
            104: 1,
        },
        303: {
            102: 1,
            105: 1,
            103: 1
        }
    },          'TST00502');

    // delete elements 3 and 1
    t1.delMany([t1_r3_v2.id,t1_r1.id]);
    deepEqual(t1.toArray(),             [
        t1_r0,
        t1_r2,
        t1_r4,
        t1_r5,
    ],        'TST00600');

    // delete elements: check index t2_id
    deepEqual(t1.indexData["t2_id"],   {
        206: {
            100: 1,
            102: 1,
            104: 1,
        },
        208: {
            105: 1,
        }
    },          'TST00601');

    // delete elements: check index t3_id
    deepEqual(t1.indexData["t3_id"],   {
        301: {
            100: 1,
        },
        302: {
            104: 1,
        },
        303: {
            102: 1,
            105: 1,
        }
    },          'TST00602');

    // test empty
    t1.empty()
    deepEqual(t1.getData(),{},'TST00700');
    deepEqual(t1.indexData,


t {
            return getVolumePath(it)
        }
    } catch (e: Exception) {
        Timber.w(e)
    }
    return null
}

/**
 * Returns the human-readable access path of the root of the given storage volume
 *
 * @param storageVolume android.os.storage.StorageVolume to return the path from
 * @return Human-readable access path of the root of the given storage volume; empty string if not found
 */
// Access to getPathFile is limited to API<30
private fun getVolumePath(storageVolume: Any): String {
    var path = ""
    var absolutePath = ""
    var canonicalPath = ""
    try {
        val pathFile: File?
        val storageVolumeClazz = Class.forName("android.os.storage.StorageVolume")
        if (Build.VERSION.SDK_INT < 30) {
            val getPathFile = storageVolumeClazz.getMethod("getPathFile") // Removed in API30
            pathFile = getPathFile.invoke(storageVolume) as File
        } else {
            val getDirectory = storageVolumeClazz.getMethod("getDirectory")
            pathFile = getDirectory.invoke(storageVolume) as File?
        }

        if (pathFile != null) {
            path = pathFile.path
            absolutePath = pathFile.absolutePath
            canonicalPath = pathFile.canonicalPath
        }
    } catch (e: Exception) {
        Timber.w(e)
    }
    if (path.isEmpty() && absolutePath.isEmpty()) return canonicalPath
    if (path.isEmpty()) return absolutePath
    return path
}

/**
 * Get the volume ID of the given Uri
 *
 * @param uri Uri to get the volume ID for
 * @return Volume ID of the given Uri
 */
private fun getVolumeIdFromUri(uri: Uri): String {
    val docId = try {
        DocumentsContract.getDocumentId(uri)
    } catch (_: IllegalArgumentException) {
        DocumentsContract.getTreeDocumentId(uri)
    }

    val split = docId.split(":")
    return if (split.isNotEmpty()) split[0]
    else ""
}

/**
 * Get the human-readable document path of the given Uri
 *
 * @param uri Uri to get the path for
 * @return Human-readable document path of the given Uri
 */
private fun getDocumentPathFromUri(uri: Uri): String? {
    val docId = try {
        DocumentsContract.getDocumentId(uri)
    } catch (_: IllegalArgumentException) {
        DocumentsContract.getTreeDocumentId(uri)
    }

    val split = docId.split(":")
    return if (split.size >= 2) split[1]
    else docId
}

/**
 * Ensure file creation from stream.
 *
 * @param stream - OutputStream
 * @return true if all OK.
 */
fun syncStream(stream: FileOutputStream): Boolean {
    try {
        stream.fd.sync()
        return true
    } catch (e: IOException) {
        Timber.e(e, "IO Error")
    }

    return false
}

/**
 * Create an OutputStream opened the given file
 * NB1 : File length will be truncated to the length of the written data
 * NB2 : Code initially from org.apache.commons.io.FileUtils
 *
 * @param file File to open the OutputStream on
 * @return New OutputStream opened on the given file
 */
@Throws(IOException::class)
fun getOutputStream(file: File): OutputStream {
    if (file.exists()) {
        if (!file.isFile) throw IOException(file.path + " is not a File")
        if (!file.canWrite()) throw IOException(file.path + " can't be written to")
    } else {
        file.parentFile?.let { dir ->
            if ((!dir.mkdirs() && !dir.isDirectory())) {
                throw IOException("Cannot create directory '$dir'.")
            }
        }
    }
    return FileOutputStream(file, false)
}

/**
 * Create an OutputStream for the given file
 * NB : File length will be truncated to the length of the written data
 *
 * @param context Context to use


      userInfoItems.clear()
        userInfoItems.addAll(newUserInfos)

        if (userInfoItems.isEmpty() && newUserInfos.isNotEmpty()) {
            notifyItemRangeInserted(0, newUserInfos.size)
        } else {
            notifyItemRangeChanged(0, userInfoItems.size)
        }
    }
}
package com.mulkkam.ui.notification.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.mulkkam.R
import com.mulkkam.domain.model.notification.Notification
import com.mulkkam.domain.model.notification.NotificationType
import com.mulkkam.ui.designsystem.MulkkamTheme
import com.mulkkam.ui.designsystem.Secondary200
import java.time.LocalDateTime

@Composable
fun NotificationItemComponent(
    notification: Notification,
    onApplySuggestion: () -> Unit,
    onRemove: () -> Unit,
    modifier: Modifier = Modifier,
) {
    val dismissState =
        rememberSwipeToDismissBoxState(
            confirmValueChange = { dismissValue ->
                dismissValue == SwipeToDismissBoxValue.EndToStart
            },
            positionalThreshold = { it * 0.7f },
        )
    val color =
        when (dismissState.dismissDirection) {
            SwipeToDismissBoxValue.EndToStart -> Secondary200
            else -> Color.Transparent
        }

    LaunchedEffect(dismissState.currentValue) {
        if (dismissState.currentValue == SwipeToDismissBoxValue.EndToStart) {
            onRemove()
        }
    }

    SwipeToDismissBox(
        modifier = modifier,
        state = dismissState,
        backgroundContent = {
            Box(
                modifier =
                    Modifier
                        .fillMaxSize()
                        .background(color)
                        .padding(end = 18.dp),
                contentAlignment = Alignment.CenterEnd,
            ) {
                Image(
                    painter = painterResource(R.drawable.ic_common_delete),
                    modifier = Modifier.size(24.dp),
                    contentDescription = stringResource(R.string.notification_delete_description),
                )
            }
        },
        enableDismissFromStartToEnd = false,
    ) {
        NotificationItem(notification, onApplySuggestion)
    }
}

@Preview(showBackground = true, name = "공지 알림 프리뷰")
@Composable
private fun NoticeNotificationItemComponentPreview() {
    MulkkamTheme {
        NotificationItemComponent(
            notification =
                Notification(
                    id = 1,
                    title = "공지 알림입니다 !",
                    type = NotificationType.NOTICE,
                    createdAt = LocalDateTime.now(),
                    recommendedTargetAmount = null,
                    isRead = true,
                    applyRecommendAmount = null,
                ),
            onApplySuggestion = {},
            onRemove = { },
        )
    }
}

@Preview(showBackground = true, name = "제안 알림 프리뷰")
@Composable
private fun SuggestionNotificationItem


TYPE_STRING)
                    _annotation(ANNOTATION_SCHEMA, schemaDescription("${description}ID"))
                }
            }
        }.writeTo(viewDir)

        val voClassName = "${domainObjectClassName}VO"
        _java("$voClassName.java") {
            _package(viewPackage)
            _class(voClassName) {
                _public()
                _annotation(ANNOTATION_DATA)
                _annotation(ANNOTATION_SCHEMA, schemaDescription("${description}视图"))
                _field(PARAM_ID) {
                    _protected()
                    _type(TYPE_STRING)
                    _annotation(ANNOTATION_SCHEMA, schemaDescription("${description}ID"))
                }
            }
        }.writeTo(viewDir)

        val queryClassName = "${domainObjectClassName}Query"
        _java("$queryClassName.java") {
            _package(viewPackage)
            _class(queryClassName) {
                _public()
                _annotation(ANNOTATION_DATA)
                _annotation(ANNOTATION_SCHEMA, schemaDescription("${description}查询条件"))
            }
        }.writeTo(viewDir)

        val idGeneratorClassName = "${domainObjectClassName}IdGenerator"
        val idGeneratorParam = idGeneratorClassName.lowercaseFirst()
        _java("$idGeneratorClassName.java") {
            _package(domainPackage)
            _interface(idGeneratorClassName) {
                _public()
                _comment("${description}ID生成器")
                _extends(TYPE_DOMAIN_ID_GENERATOR, "$viewPackage.$createCommandClassName")

            }
        }.writeTo(domainDir)

        val facadeAdapterClassName = "${domainObjectClassName}FacadeAdapter"
        val facadeAdapterParam = facadeAdapterClassName.lowercaseFirst()
        _java("$facadeAdapterClassName.java") {
            _package(domainPackage)
            _interface(facadeAdapterClassName) {
                _public()
                _comment("领域模型/视图 转换适配器")

                _method("from") {
                    _return(domainObjectClass)
                    _param("create") {
                        _type("$viewPackage.$createCommandClassName")
                    }
                    _comment("创建命令视图转领域模型")
                }

                _method("from") {
                    _return(domainObjectClass)
                    _param("update") {
                        _type("$viewPackage.$updateCommandClassName")
                    }
                    _param("old") {
                        _type(domainObjectClass)
                    }
                    _comment("更新命令视图转领域模型")
                }

                _method("do2vo") {
                    _return("$viewPackage.$voClassName")
                    _param(domainObjectParam) {
                        _type(domainObjectClass)
                    }
                    _comment("领域模型转视图")
                }

                _method("toConditions") {
                    _return(TYPE_DOMAIN_CONDITIONS)
                    _param("query") {
                        _type("$viewPackage.$queryClassName")
                    }
                    _comment("查询转条件")
                }
            }
        }.writeTo(domainDir)

        val facadeAdapterImplClassName = "${facadeAdapterClassName}Impl"
        _java("$facadeAdapterImplClassName.java") {
            _package(domainPackage)
            _class(facadeAdapterImplClassName) {
                _public()
                _comment("领域模型/视图 转换适配器实现")
                _annotation(ANNOTATION_COMPONENT)

                _implements(facadeAdapterClassName)

                _field(idGeneratorClassName.lowercaseFirst()) {
                    _protected()
                    _annotation(ANNOTATION_AUTOWIRED)
                    _type(idGeneratorClassName)
                }

                _field("validator") {
                    _protected()
                    _annotation(ANNOTATION_AUTOWIRED)
                    _type(TYPE_DOMAIN_VALIDATOR)
                }

                _method("from") {
                    _override()
                    _public()
                    _return(domainObjectClass)
                    _param("create") {
                        _type("$viewPackage.$createCommandClassName")
                    }
                    _todo()
                }

                _method("from") {


icle damping exponent.
   * 0 = no damping
   * positive values slow particles
   * negative values accelerate particles
   * @category particle
   */
  particleDamping:number;

  /**
   * Particle acceleration/gravity force vector
   * Units are voxels/(tick^2)
   * @category particle
   */
  particleAcceleration:Box3Vector3;

  /**
   * Particle noise amplitude.  Affects particle movement
   * @category particle
   */
  particleNoise:number;

  /**
   * Particle noise frequency.  Increase rate of movement from noise bias
   * @category particle
   */
  particleNoiseFrequency:number;

  /**
   * Particle target entity
   * @category particle
   */
  particleTarget:Box3Entity|null;

  /**
   * Particle target weight
   * @category particle
   */
  particleTargetWeight:number;
}
/**
* An active entity pair contact
*/
declare interface Box3EntityContact {
  other: Box3Entity;
  force: Box3Vector3;
  axis: Box3Vector3;
}
/**
* An active voxel contact state
*/
declare interface Box3VoxelContact {
  x: number;
  y: number;
  z: number;
  voxel: number;
  force: Box3Vector3;
  axis: Box3Vector3;
}
/**
* An active fluid contact
*/
declare interface Box3FluidContact {
  voxel: number;
  volume: number;
}
/**
* Player movement state
*/
declare enum Box3PlayerMoveState {
  FLYING = "fly",
  GROUND = "ground",
  SWIM = "swim",
  FALL = "fall",
  JUMP = "jump",
  DOUBLE_JUMP = "jump2"
}
/**
* Player walking state
*/
declare enum Box3PlayerWalkState {
  NONE = "",
  CROUCH = "crouch",
  WALK = "walk",
  RUN = "run"
}
/**
* Players correspond to users which are connected to the game
*/
declare interface Box3Player {
  /**
   * Sends a private message directly to player
   * @category chat
   */
  directMessage: (message: string) => void;
  /**
   * Called whenever player initiates a chat event
   * @category chat
   */
  onChat: Box3EventChannel<Box3ChatEvent>;
  nextChat: Box3EventFuture<Box3ChatEvent>;
  /**
   * Called whenever player presses a button
   * @category input
   */
  onPress: Box3EventChannel<Box3InputEvent>;
  nextPress: Box3EventFuture<Box3InputEvent>;
  /**
   * Called whenever a player releases a buttin
   * @category input
   */
  onRelease: Box3EventChannel<Box3InputEvent>;
  nextRelease: Box3EventFuture<Box3InputEvent>;
  /**
   * @category health
   */
  onRespawn: Box3EventChannel<Box3RespawnEvent>;
  nextRespawn: Box3EventFuture<Box3RespawnEvent>;
  /**
   * @category health
   */
  forceRespawn: () => void;
  /**
   * Name of the player.  Constant.
   */
  name: string;
  /**
   * Initial spawn point of player
   * @category spawn
   */
  spawnPoint: Box3Vector3;
  /**
   * Movement bounds
   * @category spawn
   */
  movementBounds: Box3Bounds3;
  /**
   * @category display
   */
  scale: Box3Vector3;
  /**
   * @category dipsplay
   */
  color: Box3RGBColor;
  /**
   * @category display
   */
  metalness: number;
  /**
   * @category display
   */
  emissive: number;
  /**
   * @category display
   */
  shininess: number;
  /**
   * @category display
   */
  invisible: boolean;
  /**
   * @category health
   */
  dead: boolean;
  /**
   * Color grading look up table, applie


);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Bounce 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Bounce
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
/*
 * jQuery UI Effects Shake 1.8.13
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Shake
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i


 7.83 0 018.225 2.22l.167.748c.015.074.071.112.168.112.037 0 .067-.02.09-.062.022-.04.03-.08.022-.117l-.168-.737A8.327 8.327 0 0110 2.02c1.518 0 2.928.405 4.23 1.216-.29.417-.435.659-.435.726 0 .097.045.145.134.145.081 0 .26-.238.535-.714a7.875 7.875 0 012.093 2.075 7.968 7.968 0 011.2 2.69l-.625.134c-.075.015-.112.074-.112.179 0 .037.02.067.061.089.041.023.076.03.107.023l.636-.145A8.18 8.18 0 0117.98 10Zm.949 0c0-1.213-.236-2.37-.709-3.471a8.988 8.988 0 00-1.903-2.846 8.988 8.988 0 00-2.846-1.904 8.713 8.713 0 00-3.472-.708 8.71 8.71 0 00-3.47.708 8.988 8.988 0 00-2.847 1.904 8.988 8.988 0 00-1.903 2.846A8.713 8.713 0 001.07 10c0 1.213.236 2.37.709 3.471a8.988 8.988 0 001.903 2.846 8.988 8.988 0 002.846 1.904 8.713 8.713 0 003.471.708c1.213 0 2.37-.236 3.472-.708a8.988 8.988 0 002.846-1.904 8.988 8.988 0 001.903-2.846A8.713 8.713 0 0018.929 10ZM20 10a9.773 9.773 0 01-.793 3.884c-.528 1.235-1.238 2.299-2.131 3.192-.893.893-1.957 1.603-3.192 2.131A9.773 9.773 0 0110 20a9.773 9.773 0 01-3.884-.793c-1.235-.528-2.299-1.238-3.192-2.131-.893-.893-1.603-1.957-2.132-3.192A9.773 9.773 0 010 10a9.78 9.78 0 01.792-3.884c.529-1.235 1.24-2.299 2.132-3.192.893-.893 1.957-1.603 3.192-2.132A9.773 9.773 0 0110 0a9.78 9.78 0 013.884.792c1.235.529 2.299 1.24 3.192 2.132.893.893 1.603 1.957 2.131 3.192A9.773 9.773 0 0120 10Z"/></svg>';
  static const String safety =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 20 20"><path fill="currentColor" d="M2.842 3.865v7.434c0 4.047 3.205 7.327 7.158 7.327 3.953 0 7.158-3.28 7.158-7.327v-7.43L9.957 1.446 2.842 3.865ZM9.955 0 18.5 2.874v8.425C18.5 16.104 14.694 20 10 20s-8.5-3.896-8.5-8.701V2.874L9.955 0Zm4.419 6.485a.66.66 0 00-.948.057L9.11 11.511 6.322 8.426a.66.66 0 00-.948-.038.698.698 0 00-.037.971l3.29 3.64a.66.66 0 00.995-.01l4.807-5.534a.698.698 0 00-.055-.97Z"/></svg>';
  static const


 lost packets.
    /// `loss_delay` is the time we will wait before declaring something lost.
    /// `cleanup_delay` is the time we will wait before cleaning up a lost packet.
    pub fn detect_lost_packets(
        &mut self,
        now: Instant,
        loss_delay: Duration,
        cleanup_delay: Duration,
        lost_packets: &mut Vec<SentPacket>,
    ) {
        // Housekeeping.
        self.remove_old_lost(now, cleanup_delay);

        // Packets sent before this time are deemed lost.
        let lost_deadline = now - loss_delay;
        qtrace!(
            "detect lost {}: now={:?} delay={:?} deadline={:?}",
            self.space,
            now,
            loss_delay,
            lost_deadline
        );
        self.first_ooo_time = None;

        let largest_acked = self.largest_acked;

        // Lost for retrans/CC purposes
        let mut lost_pns = SmallVec::<[_; 8]>::new();

        for (pn, packet) in self
            .sent_packets
            .iter_mut()
            // BTreeMap iterates in order of ascending PN
            .take_while(|(&k, _)| Some(k) < largest_acked)
        {
            if packet.time_sent <= lost_deadline {
                qtrace!(
                    "lost={}, time sent {:?} is before lost_deadline {:?}",
                    pn,
                    packet.time_sent,
                    lost_deadline
                );
            } else if largest_acked >= Some(*pn + PACKET_THRESHOLD) {
                qtrace!(
                    "lost={}, is >= {} from largest acked {:?}",
                    pn,
                    PACKET_THRESHOLD,
                    largest_acked
                );
            } else {
                self.first_ooo_time = Some(packet.time_sent);
                // No more packets can be declared lost after this one.
                break;
            };

            if packet.declare_lost(now) {
                lost_pns.push(*pn);
            }
        }

        lost_packets.extend(lost_pns.iter().map(|pn| self.sent_packets[pn].clone()));
    }
}

#[derive(Debug)]
pub(crate) struct LossRecoverySpaces {
    /// When we have all of the loss recovery spaces, this will use a separate
    /// allocation, but this is reduced once the handshake is done.
    spaces: SmallVec<[LossRecoverySpace; 1]>,
}

impl LossRecoverySpaces {
    fn idx(space: PNSpace) -> usize {
        match space {
            PNSpace::ApplicationData => 0,
            PNSpace::Handshake => 1,
            PNSpace::Initial => 2,
        }
    }

    /// Drop a packet number space and return all the packets that were
    /// outstanding, so that those can be marked as lost.
    /// # Panics
    /// If the space has already been removed.
    pub fn drop_space(&mut self, space: PNSpace) -> Vec<SentPacket> {
        let sp = match space {
            PNSpace::Initial => self.spaces.pop(),
            PNSpace::Handshake => {
                let sp = self.spaces.pop();
                self.spaces.shrink_to_fit();
                sp
            }
            PNSpace::ApplicationData => panic!("discarding application space"),
        };
        let mut sp = sp.unwrap();
        assert_eq!(sp.space(), space, "dropping spaces out of order");
        sp.remove_ignored().collect()
    }

    pub fn get(&self, space: PNSpace) -> Option<


.loc 1 230 0
	mov	w25, -1091633152
	add	w25, w0, w25
	.loc 1 216 0
	stp	x21, x22, [sp, 32]
	mov	x20, 0
	stp	x23, x24, [sp, 48]
	.cfi_offset 21, -64
	.cfi_offset 22, -56
	.cfi_offset 23, -48
	.cfi_offset 24, -40
	movk	x28, 0x4820, lsl 16
	movk	x27, 0x4820, lsl 16
.LVL16:
.L15:
	.loc 1 224 0
	mov	x26, 1528
	.loc 1 232 0
	mov	w23, -559087616
	add	x22, x20, x28
	add	x21, x20, x27
	.loc 1 216 0
	mov	w24, 0
	.loc 1 224 0
	movk	x26, 0x4820, lsl 16
	.loc 1 232 0
	add	w23, w19, w23
	b	.L11
.LVL17:
.L14:
	.loc 1 225 0
	ldr	w0, [x21]
	cmp	w19, w0
	beq	.L10
.L13:
	.loc 1 224 0
	add	w24, w24, 1
.LVL18:
	add	x22, x22, 80
	add	x21, x21, 80
.LVL19:
.L11:
	.loc 1 224 0 is_stmt 0 discriminator 1
	ldrb	w0, [x20, x26]
	cmp	w24, w0
	blt	.L14
.LVL20:
	add	x20, x20, 1528
	.loc 1 223 0 is_stmt 1 discriminator 2
	mov	x0, 6112
	cmp	x20, x0
	bne	.L15
	.loc 1 241 0
	mov	w0, 0
.L7:
	.loc 1 242 0
	ldp	x19, x20, [sp, 16]
.LVL21:
	ldp	x21, x22, [sp, 32]
	ldp	x23, x24, [sp, 48]
.LVL22:
	ldp	x25, x26, [sp, 64]
.LVL23:
	ldp	x27, x28, [sp, 80]
	ldp	x29, x30, [sp], 96
	.cfi_remember_state
	.cfi_restore 30
	.cfi_restore 29
	.cfi_restore 27
	.cfi_restore 28
	.cfi_restore 25
	.cfi_restore 26
	.cfi_restore 23
	.cfi_restore 24
	.cfi_restore 21
	.cfi_restore 22
	.cfi_restore 19
	.cfi_restore 20
	.cfi_def_cfa 31, 0
	ret
.LVL24:
.L10:
	.cfi_restore_state
	.loc 1 227 0
	mov	x1, x21
	mov	x0, x22
	bl	invalidate_dcache_range
.LVL25:
	.loc 1 230 0
	ldr	w1, [x22]
	cmp	w1, w25
	beq	.L16
	.loc 1 232 0
	cmp	w1, w23
	beq	.L8
	.loc 1 234 0
	mov	w0, 286326784
	add	w0, w19, w0
	cmp	w1, w0
	bne	.L13
	.loc 1 235 0
	mov	w0, -2
	b	.L7
.L8:
	.loc 1 221 0
	mov	w0, -1
	b	.L7
.L16:
	.loc 1 231


etInt(idx++, rowData.getId());
		stmt.setInt(idx++,     rowData.getGroupId());

		stmt.setString(idx++,  rowData.getNameInReferenceEpoch());
		stmt.setString(idx++,  rowData.getNameInControlEpoch());

		stmt.setBoolean(idx++, rowData.isEnable());

		stmt.execute();

		if (rowData.getId() < 0) {
			int id = this.dataBase.getLastInsertId();
			rowData.setId(id);
		}
	}

	// http://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html#dac_merge_statement
	public void saveGroup(PointTreeItemValue pointTreeItemValue) throws SQLException {
		if (!this.hasDatabase() || !this.dataBase.isOpen())
			return;

		String sql = "MERGE INTO \"PointGroup\" USING (VALUES "
				+ "(CAST(? AS INT), ?, CAST(? AS INT), CAST(? AS INT), CAST(? AS BOOLEAN), CAST(? AS INT)) "
				+ ") AS \"vals\" (\"id\", \"name\", \"type\", \"dimension\", \"enable\", \"order\") ON \"PointGroup\".\"id\" = \"vals\".\"id\" "
				+ "WHEN MATCHED THEN UPDATE SET "
				+ "\"PointGroup\".\"name\"                = \"vals\".\"name\", "
				+ "\"PointGroup\".\"type\"                = \"vals\".\"type\", "
				+ "\"PointGroup\".\"dimension\"           = \"vals\".\"dimension\", "
				+ "\"PointGroup\".\"enable\"              = \"vals\".\"enable\", "
				+ "\"PointGroup\".\"order\"               = \"vals\".\"order\" "
				+ "WHEN NOT MATCHED THEN INSERT "
				+ "(\"id\", \"name\", \"type\", \"dimension\", \"enable\", \"order\") "
				+ "VALUES "
				+ "\"vals\".\"id\", "
				+ "\"vals\".\"name\", "
				+ "\"vals\".\"type\", "
				+ "\"vals\".\"dimension\", "
				+ "\"vals\".\"enable\", "
				+ "\"vals\".\"order\" ";

		int groupId        = pointTreeItemValue.getGroupId();
		String name        = pointTreeItemValue.getName().trim();
		int dimension      = pointTreeItemValue.getDimension();
		PointType type     = TreeItemType.getPointTypeByTreeItemType(pointTreeItemValue.getItemType());
		boolean enable     = pointTreeItemValue.isEnable();
		int orderId        = pointTreeItemValue.getOrderId();

		int idx = 1;
		PreparedStatement stmt = this.dataBase.getPreparedStatement(sql);
		// Insert new item
		if (groupId < 0)
			stmt.setNull(idx++, Types.INTEGER);
		// Update existing item
		else
			stmt.setInt(idx++, groupId);

		stmt.setString(idx++,  name);
		stmt.setInt(idx++,     type.getId());
		stmt.setInt(idx++,     dimension);
		stmt.setBoolean(idx++, enable);
		stmt.setInt(idx++,     orderId);
		//stmt.setBoolean(idx++, false); // consider_deflection: not used for insert/update

		stmt.execute();

		// insert new group
		if (groupId < 0) {
			int id = this.dataBase.getLastInsertId();
			pointTreeItemValue.setGroupId(id);

			PointGroupUncertaintyType uncertaintyTypes[] = PointGroupUncertaintyType.values();
			for (PointGroupUncertaintyType uncertaintyType : uncertaintyTypes) {
				this.saveUncertainty(
						uncertaintyType,
						PointTreeItemValue.getDefaultUncertainty(uncertaintyType),
						pointTreeItemValue


gt til)
\n
\n                          \n                            Bitcoin-transaksjoner er ikke private og kan spores:\n                          \n
\n                          "Federale agenter innhentet warrantene etter å ha sporet en rekke Bitcoin-transaksjoner med opprinnelse fra AlphaBay til digitale valutakontoer, og til slutt bankkontoer og andre materielle eiendeler, holdt av CAZES og hans kone." (s. 17, linje 24- 26)\n
\n
\n
\n
\n\n
\n
\n                      LocalMonero forfekter eller oppmuntrer ikke til ulovlig aktivitet.\n
\n
  ';

  @override
  String get knowledge250Sbwhy8722Sbmonero250Sbtitle => 'Hvorfor Monero er bedre enn Dash, Zcash, Zcoin (selv med Lelantus), Grin og Bitcoin-miksere som Wasabi (Oppdatert mai 2020)';

  @override
  String get knowledge250Sbwired250Sb0250Sbtext => '
På både personvern- og kryptovaluta-sfærer løper feilinformasjon ofte fritt. Vi har en artikkel som skisserer femten vanlige ukorrekte eller utdaterte antakelser om Monero, men vi ønsker å ta oss tid til å ta opp en bestemt artikkel som ofte siteres og sirkuleres av Monero-skeptikere.
\n\n
The Wired-publikasjonen la ut en artikkel den 27. mars 2018, som i seg selv ble skrevet som svar på en annen fersk artikkel publisert av forskjellige akademikere med tittelen: \"An Empirical Analysis av sporbarhet i Monero Blockchain\".
\n\n
Selv om avisen var medforfatter av enkeltpersoner med tydelig interessekonflikt (les: de er rådgivere for og har en eierandel i Zcash), ble avisen moderat godt mottatt av Monero-fellesskapet som bekrefter ting fellesskapet allerede har visst og skrevet om i deres egne Monero Research Lab-artikler (MRL-0001 og MRL-0004), hvorav den tidligste ble publisert fire år tidligere. Det var imidlertid også flere frustrasjoner med det, hovedsakelig interessekonflikten, det faktum at problemene allerede var kjent, diskutert og – i noen tilfeller – utbedret, og den grove feilkarakteriseringen av Moneros personverngarantier på den tiden. Fellesskapet kommenterte fortrykket av verket, og mange av anbefalingene deres kom videre til den endelige artikkelen.
\n\n
Men nøyaktig hva ble feilkarakterisert? Det faktum at Monero ikke hadde hatt feilene diskutert i avisen på over et år. Transaksjoner før 2017 var faktisk sårbare for en form for personvernlekkasje, men på publiseringstidspunktet hadde Monero tatt tak i de fl


PGraphicsOpenGL g,
      MultiCalibrator multiCalibrator) {
    Papart papart = Papart.getPapart();
    PApplet parent = multiCalibrator.parent;
    DepthTouchInput touchInput = (DepthTouchInput) papart.getTouchInput();
    if (!touchInput.isReady()) {
      return;
    }

    // Get a copy, as the arrayList is constantly modified
    ArrayList<TrackedDepthPoint> touchs2D = new ArrayList<TrackedDepthPoint>(touchInput.getTrackedDepthPoints2D());
    for (TrackedDepthPoint tp : touchs2D) {

      ArrayList<DepthDataElementProjected> depthDataElements = tp.getDepthDataElements();
      for (DepthDataElementProjected dde : depthDataElements) {
        Vec3D v = dde.projectedPoint;
        g.noStroke();
        setColor(g, dde.pointColor, 255);
        g.ellipse(v.x * parent.width,
            v.y * parent.height,
            10, 10);
      }

      g.fill(50, 50, 255);
      PVector pos = tp.getPosition();
      g.ellipse(pos.x * parent.width,
          pos.y * parent.height, 20, 20);
    }

    g.fill(255, 0, 0);
    ArrayList<TrackedDepthPoint> touchs3D = new ArrayList<TrackedDepthPoint>(touchInput.getTrackedDepthPoints3D());
    for (TrackedDepthPoint tp : touchs3D) {

      ArrayList<DepthDataElementProjected> depthDataElements = tp.getDepthDataElements();

      for (DepthDataElementProjected dde : depthDataElements) {
        Vec3D v = dde.projectedPoint;
        g.noStroke();
        setColor(g, dde.pointColor, 100);

        g.ellipse(v.x * parent.width,
            v.y * parent.height,
            10, 10);
      }

      PVector pos = tp.getPosition();
      g.ellipse(pos.x * parent.width,
          pos.y * parent.height, 40, 40);
    }
  }

  static void setColor(PGraphicsOpenGL graphics, int rgb, float intens) {
    int r = (rgb >> 16) & 0xFF; // Faster way of getting red(argb)
    int g = (rgb >> 8) & 0xFF; // Faster way of getting green(argb)
    int b = rgb & 0xFF; // Faster way of getting blue(argb)
    graphics.fill(r, g, b, intens);
  }

  // Pixel rendering
  public static void sin(PApplet parent, PGraphics g, int amt, float freq, int xDiff, float size) {
    float v = (PApplet.sin((float) (parent.millis()) / 1000f * PConstants.TWO_PI * freq) + 1f) / 2f;
    g.noStroke();
    g.ellipseMode(CENTER);
    g.fill(v * amt);
    g.ellipse(-xDiff, 0, size, size);
    g.ellipse(0, 0, size, size);
    g.ellipse(xDiff, 0, size, size);
  }

  /////////////////
  ////////// Touch calibration
  /////////////////
  void computeAndSaveTouch() {
    // Save average plane, and table touch !
    PMatrix3D extr = depthCameraDevice.getStereoCalibrationInv().get();

    // Re-compute the plane...
    PMatrix3D paperViewedByCam = savedLocations[0].get();
    paperViewedByCam.apply(extr);
    PMatrix3D paperViewedByDepth = paperViewedByCam;

    PlaneCalibration planeCalib = PlaneCalibration.CreatePlaneCalibrationFrom(paperViewedByDepth,
        // app.getLocation(),
        new PVector(100, 100));
    planeCalib.setHeight(10f); // NOT used anymore -> to remove.
    planeCalib.flipNormal();

    // this.planeProjCalib.setPla


    let freqvec: Vec<f64> = freqvec.into_iter().map(|f| f.cur.unwrap() as f64).collect();
    freqvec.iter().sum::<f64>() / freqvec.len() as f64
}

/// Gets sensors' temp and power chip features.
/// TODO: separate these or refactor away..
pub fn get_temp_and_power() -> Result<(Feature, Feature), Box<dyn Error>> {
    let sensors = Sensors::new();

    // This relies on [zenpower3](https://github.com/Ta180m/zenpower3)
    // naming.
    // Not sure what the kernel driver, feature or subfeatures will be called once temperature support is added to mainline.
    // TODO: Find out name of kernel driver in later 5.13>= kernels.
    let zenchip = || -> Result<Chip, Box<dyn Error>> {
        Ok(sensors
            .into_iter()
            .find(|chip| chip.get_name().unwrap().starts_with("zen"))
            .ok_or("chip with name 'zenpower' not found")?)
    };

    // Tdie feature
    let t_die: Feature = zenchip()?
        .into_iter()
        .find(|feat| feat.get_label().unwrap().starts_with("Tdie"))
        .ok_or("chip feature  'Tdie' not found")?;

    // SVI2_P_Core feature
    let svi2_p_core: Feature = zenchip()?
        .into_iter()
        .find(|feat| feat.get_label().unwrap().starts_with("SVI2_P_Core"))
        .ok_or("chip feature  'Tdie' not found")?;

    Ok((t_die, svi2_p_core))
}
<filename>lib/backend-java/src/module/lombok.rs
//! Module that adds lombok annotations to generated classes.

use crate::codegen::class;
use crate::Options;
use genco::prelude::*;
use std::rc::Rc;

pub struct Module;

impl Module {
    pub fn initialize(self, options: &mut Options) {
        // lombok builds these automatically.
        options.build_getters = false;
        options.build_constructor = false;
        options.build_hash_code = false;
        options.build_equals = false;
        options.build_to_string = false;

        options.gen.class.push(Rc::new(Lombok::new()));
    }
}

pub struct Lombok {
    data: Rc<java::Import>,
}

impl Lombok {
    pub fn new() -> Lombok {
        Lombok {
            data: Rc::new(java::import("lombok", "Data")),
        }
    }
}

impl class::Codegen for Lombok {
    fn generate(&self, e: class::Args<'_>) {
        e.annotations.push(quote! {
            @#(&*self.data)
        });
    }
}
// Licensed under either of Apache License, Version 2.0 or MIT license at your option.
// Copyright 2021 <NAME>(=just-do-halee)

//! # `Secwords`
//!
//! secure and safe password container.
//! - typed system
//! - memory safety
//! - unicode safety
//! <br>(no-std support)
//! ## Example
//! ```rust
//! # extern crate sha2;
//! use secwords::Password;
//! use sha2::Sha256; // can be any hasher from dyn Digest `digest` crate
//!
//! let plain = String::from("pa5$wOrs"); // <- example
//!
//! let pass1 = Password::<Sha256, 6>::new(plain).unwrap(); // min length = 6
//! let pass2: Password<Sha256, 6> = "<PASSWORD>".parse().unwrap();
//!
//! assert_eq!(pass1, pass2); // they are hashed, original is gone(safely)
//! assert_eq!(


    args.world_size = int(os.getenv('WORLD_SIZE', 1))
    print(f"Args parsed: {args}")
    print(f"Process {args.local_rank} using GPU {torch.cuda.current_device()}")

    print(f"WORLD_SIZE: {os.environ.get('WORLD_SIZE', 'not set')}")
    if args.world_size > 1:
        torch.cuda.set_device(device=args.local_rank % torch.cuda.device_count())
        print(f"Process {args.local_rank} using GPU {torch.cuda.current_device()} "
              f"out of {torch.cuda.device_count()} GPUs")
        torch.distributed.init_process_group(backend='nccl', init_method='env://')

    if args.local_rank == 0:
        if not os.path.exists('weights'):
            os.makedirs('weights')

    util.setup_seed()
    util.setup_multi_processes()

    with open(os.path.join('utils', 'args.yaml'), errors='ignore') as f:
        params = yaml.safe_load(f)

    if args.train:
        train(args, params)
    if args.test:
        test(args, params)

if __name__ == "__main__":
    main()


#!/usr/bin/env python3

import argparse
import random
from itertools import count

parser = argparse.ArgumentParser(description="Generate a hex file to intialize the host memory when using the pointer chaser application.")

parser.add_argument("--base", dest = "base_address", default = 64, help = "The base address of the linked list")

parser.add_argument("--length", dest = "list_length", default = 48, help = "The length of the singly linked list")

parser.add_argument("--output_file", dest = "output_file", default = "init.hex", help = "The name of the hex file to be generated")

args = parser.parse_args()
addresses = random.sample(range(args.base_address + 64, 1024*1024, 64),
            args.list_length)

nodes = []
for i, current, next_node in zip(count(),[args.base_address] + addresses[:], addresses[:] + [0]):
    nodes.append((current,i,next_node))

f = open(args.output_file, "w")
addr = 0;
for node in sorted(nodes):
    while (addr < node[0]):
        f.write("{:032x}\n".format(0))
        addr += 16
    f.write("{:016x}{:016x}\n".format(node[1], node[2]))
    addr += 16

f.close()


._stats_lock:
                self.search_stats[key] += value
        else:
            self.search_stats[key] += value

    def _get_stats(self, key: str) -> int:
        """線程安全的統計讀取方法"""
        if self.use_thread_safe_stats and self._stats_lock:
            with self._stats_lock:
                return self.search_stats[key]
        else:
            return self.search_stats[key]

    def _get_all_stats(self) -> Dict[str, Any]:
        """線程安全的統計讀取方法（返回所有統計）"""
        if self.use_thread_safe_stats and self._stats_lock:
            with self._stats_lock:
                return self.search_stats.copy()
        else:
            return self.search_stats.copy()

    def _run_diagnostic_check(self):
        """運行更詳細的診斷檢查"""
        logger.info("🕵  運行診斷自檢...")
        try:
            # 1. 基本統計檢查
            num_check = min(10, self.meta['N'])
            check_indices = np.random.choice(self.meta['N'], num_check, replace=False)
            original_vectors = np.array([self.reader.get_node(i)[0] for i in check_indices])

            logger.info(f"📊 原始向量統計:")
            logger.info(f"  - 數據類型: {original_vectors.dtype}")
            logger.info(f"  - 形狀: {original_vectors.shape}")
            logger.info(f"  - 範圍: [{original_vectors.min():.4f}, {original_vectors.max():.4f}]")
            logger.info(f"  - 均值: {original_vectors.mean():.4f}")
            logger.info(f"  - 標準差: {original_vectors.std():.4f}")

            # 2. 根據搜索模式進行不同的檢查
            if self.use_pq:
                logger.info("🔍 進行 PQ 模式診斷檢查...")
                # 檢查 PQ 模型完整性
                if not hasattr(self, 'pq_model') or not self.pq_model:
                    logger.error("❌ PQ 模型不存在！")
                    return False

                if not hasattr(self.pq_model, 'kmeans_list') or not self.pq_model.kmeans_list:
                    logger.error("❌ PQ 模型缺少 kmeans_list！這是導致 recall=0 的主要原因！")
                    return False

                if len(self.pq_model.kmeans_list) != self.n_subvectors:
                    logger.error(f"❌ PQ 子向量數量不匹配: 預期 {self.n_subvectors}, 實際 {len(self.pq_model.kmeans_list)}")
                    return False

                # 3. 檢查質心是否為零
                for i, kmeans in enumerate(self.pq_model.kmeans_list):
                    centroids = kmeans.cluster_centers_
                    if np.allclose(centroids, 0):
                        logger.error(f"❌ 子向量 {i} 的質心全為零！")
                        return False

                logger.info("✅ PQ 模型結構檢查通過")

                # 4. 距離計算一致性檢查
                query_vector = original_vectors[0]  # 使用第一個向量作為查詢

                # 構建 PQ 查找表
                try:
                    pq_lut = self._build_pq_lut_fixed(query_vector)
                    logger.info(f"✅ PQ 查找表構建成功: 形狀 {pq_lut.shape}")
                except Exception as e:
                    logger.error(f"❌ PQ 查找表構建失敗: {e}")
                    return False

                # 比較幾個點的精確距離和 PQ 距離
                logger.info("🔍 距離計算一致性檢查:")
                distance_correlations = []

                for i in range(min(5, num_check)):
                    node_id = check_indices[i]

                    # 精確距離
                    exact_dist = self._compute_exact_distance(query_vector, node_id)

                    # PQ 距離
                    if hasattr(self, 'pq_codes') and node_id < len(self.pq_codes):
                        pq_code = self.pq_codes[node_id]
                        pq_dist = self._get_pq_distance(pq_lut, pq_code)
                        ratio = pq_dist / exact_dist if exact_dist > 0 else float('inf')
                        distance_correlations.append((exact_dist, pq_dist))

                        logger.info(f"  Node {node_id}: Exact={exact_dist:.6f}, PQ={pq_dist:.6f}, Ratio={ratio:.3f}")

                        # 檢查是否合理
                        if ratio < 0.1 or ratio > 10:
                            logger.warning(f"⚠  Node {node_id} 的距離比例異常: {ratio:.3f}")
                    else:
                        logger.warning(f"⚠  Node {node_id} 沒有對應的 PQ 編碼")

                # 計算相關性
                if distance_correlations:
                    exact_dists, pq_dists = zip(*distance_correlations)
                    correlation = np.corrcoef(exac


 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}
/*!
 *       __ _____                     ________                              __
 *      / // _  /__ __ _____ ___ __ _/__  ___/__ ___ ______ __ __  __ ___  / /
 *  __ / // // // // // _  // _// // / / // _  // _//     // //  \/ // _ \/ /
 * /  / // // // // // ___// / / // / / // ___// / / / / // // /\  // // / /__
 * \___//____ \\___//____//_/ _\_  / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
 *           \/              /____/                              version 2.34.0
 * http://terminal.jcubic.pl
 *
 * This file is part of jQuery Terminal.
 *
 * Copyright (c) 2011-2022 Jakub T. Jankiewicz <https://jcubic.pl/me>
 * Released under the MIT license
 *
 * Date: Sun, 10 Jul 2022 21:53:25 +0000
 */.cmd .format,.cmd-prompt,.cmd-prompt div,.terminal .terminal-output .format{display:inline-block}.cmd,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre{margin:0}.cmd .cmd-clipboard{let:-16px;background:transparent!important;border:none!important;color:transparent!important;height:16px;height:calc(16px/var(--pixel-density, 1))!important;left:calc(-16px/var(--pixel-density, 1))!important;outline:none!important;overflow:hidden!important;padding:0!important;position:absolute!important;resize:none!important;text-indent:-9999em!important;top:0!important;top:calc(var(--cursor-line, 0)*var(--size, 1)*(14px/var(--pixel-density, 1)))!important;white-space:pre!important;width:16px;width:calc(16px/var(--pixel-density, 1))!important;z-index:1000!important}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;left:0;overflow:hidden;position:absolute;top:0;white-space:nowrap;width:1px}.cmd .cursor+span:empty,.cmd div.cmd-end-line span[data-text]:last-child,.cmd div.cmd-end-line span[data-text]:last-child span,.cmd span.cmd-end-line,.cmd span.cmd-end-line span,.cmd textarea{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.terminal audio,.terminal canvas,.terminal img,.terminal object{cursor:default}.terminal{line-height:normal;position:relative}.terminal-scroller{scrollbar-gutter:stable;box-sizing:border-box;height:100%;overflow-y:auto;position:relative}terminal.terminal-temp{visibility:hidden}.terminal{contain:content}body.terminal{height:100%;min-height:100vh}html{height:100%}body.full-


-mushrooms-and-ham-107976.json)
 * [Polenta Bites With Blue Cheese Tomatoes And Pine Nuts](../../index/p/polenta-bites-with-blue-cheese-tomatoes-and-pine-nuts-108937.json)
 * [Pork Chili With Tomatoes](../../index/p/pork-chili-with-tomatoes-102860.json)
 * [Pork Chop Milanese With Arugula And Teardrop Tomatoes](../../index/p/pork-chop-milanese-with-arugula-and-teardrop-tomatoes-107558.json)
 * [Pork Chops With Golden Onions And Wilted Tomatoes](../../index/p/pork-chops-with-golden-onions-and-wilted-tomatoes-107013.json)
 * [Pork Chops With Stewed Tomatoes Capers And Rosemary](../../index/p/pork-chops-with-stewed-tomatoes-capers-and-rosemary-241752.json)
 * [Pork Scaloppine With Sun Dried Tomatoes And Rosemary](../../index/p/pork-scaloppine-with-sun-dried-tomatoes-and-rosemary-154.json)
 * [Portuguese Clams With Linguica And Tomatoes](../../index/p/portuguese-clams-with-linguica-and-tomatoes-109788.json)
 * [Potato Gratin With Goat Cheese Tomatoes And Olives](../../index/p/potato-gratin-with-goat-cheese-tomatoes-and-olives-13598.json)
 * [Potato Salad With Olives Tomatoes And Capers](../../index/p/potato-salad-with-olives-tomatoes-and-capers-106463.json)
 * [Provencal Chicken With Tomatoes Olives And Basil](../../index/p/provencal-chicken-with-tomatoes-olives-and-basil-238795.json)
 * [Rack Of Lamb And Cherry Tomatoes](../../index/r/rack-of-lamb-and-cherry-tomatoes-236863.json)
 * [Red Snapper With Black Olives Capers And Tomatoes](../../index/r/red-snapper-with-black-olives-capers-and-tomatoes-235714.json)
 * [Red Snapper With Leeks And Tomatoes](../../index/r/red-snapper-with-leeks-and-tomatoes-102532.json)
 * [Red Snapper With Potatoes Tomatoes And Red Wine](../../index/r/red-snapper-with-potatoes-tomatoes-and-red-wine-5877.json)
 * [Red Snapper With Thyme Tomatoes And Olives](../../index/r/red-snapper-with-thyme-tomatoes-and-olives-107268.json)
 * [Rigatoni With Brie Grape Tomatoes Olives And Basil](../../index/r/rigatoni-with-brie-grape-tomatoes-olives-and-basil-238283.json)
 * [Roast Chicken Breasts With Garbanzo Beans Tomatoes And Paprika](../../index/r/roast-chicken-breasts-with-garbanzo-beans-tomatoes-and-paprika-242113.json)
 * [Roasted Eggplant And Garlic Salad With Tomatoes](../../index/r/roasted-eggplant-and-garlic-salad-with-tomatoes-5419.json)
 * [Roasted Halibut With Tomatoes Saffron And Cilantro](../../index/r/roasted-halibut-with-tomatoes-saffron-and-cilantro-105164.json)
 * [Roasted Red Peppers And Cherry Tomatoes With Ricotta](../../index/r/roasted-red-peppers-and-cherry-tomatoes-with-ricotta.json)
 * [Roasted Striped Bass With Fennel Tomatoes And Oil Cured Olives](../../index/r/roasted-striped-bass-with-fennel-tomatoes-and-oil-cured-


del.find((item:IStock)=>{
            if (!item.isEditing) {
                return item.Name==stock.Name;
            }
          });
          if (!matchedRecord) {
            stocklist=stocklist.map(
                function predicate(obj)
                {
                      if ( obj.isEditing ==true) {
                           obj.Name=stock.Name;
                           obj.Qty=stock.Qty;
                           obj.isEditing=false;
                      }
                      return obj;
                }
            )
            this.StockModel= stocklist;
            return true;
          }else{
            return false;
          }
    }
}export function postalCodeToRegion(postal_code) {
  // Ensure param is a string to prevent unpredictable parsing results
  if (typeof postal_code !== 'string') {
    console.error('Must pass the zip as a string');
    return;
  }

  // Ensure we have exactly 5 characters to parse
  if (postal_code.length !== 5) {
    console.error('Must pass a 5-digit zip');
    return;
  }

  // Ensure we don't parse strings starting with 0 as octal values
  const thiszip = parseInt(postal_code, 10);

  let st;
  let state;

  // Code blocks alphabetized by state
  if (thiszip >= 35000 && thiszip <= 36999) {
    st = 'AL';
    state = 'Alabama';
  } else if (thiszip >= 99500 && thiszip <= 99999) {
    st = 'AK';
    state = 'Alaska';
  } else if (thiszip >= 85000 && thiszip <= 86999) {
    st = 'AZ';
    state = 'Arizona';
  } else if (thiszip >= 71600 && thiszip <= 72999) {
    st = 'AR';
    state = 'Arkansas';
  } else if (thiszip >= 90000 && thiszip <= 96699) {
    st = 'CA';
    state = 'California';
  } else if (thiszip >= 80000 && thiszip <= 81999) {
    st = 'CO';
    state = 'Colorado';
  } else if (thiszip >= 6000 && thiszip <= 6999) {
    st = 'CT';
    state = 'Connecticut';
  } else if (thiszip >= 19700 && thiszip <= 19999) {
    st = 'DE';
    state = 'Delaware';
  } else if (thiszip >= 32000 && thiszip <= 34999) {
    st = 'FL';
    state = 'Florida';
  } else if (thiszip >= 30000 && thiszip <= 31999) {
    st = 'GA';
    state = 'Georgia';
  } else if (thiszip >= 96700 && thiszip <= 96999) {
    st = 'HI';
    state = 'Hawaii';
  } else if (thiszip >= 83200 && thiszip <= 83999) {
    st = 'ID';
    state = 'Idaho';
  } else if (thiszip >= 60000 && thiszip <= 62999) {
    st = 'IL';
    state = 'Illinois';
  } else if (thiszip >= 46000 && thiszip <= 47999) {
    st = 'IN';
    state = 'Indiana';
  } else if (thiszip >= 50000 && thiszip <= 52999) {
    st = 'IA';
    state = 'Iowa';
  } else if (thiszip >= 66000 && thiszip <= 67999) {
    st = 'KS';
    state = 'Kansas';
  } else if (thiszip >= 40000 && thiszip <= 42999) {
    st = 'KY';
    state = 'Kentucky';
  } else if (thiszip >= 70000 && thiszip <= 71599) {
    st = 'LA';
    state = 'Louisiana';
  } else if (thiszip >= 3900 && thiszip <= 4999) {
    st = 'ME';
    state = 'Maine';
  } else if (thiszip >= 20600 && thiszip <= 21999) {
    st = 'MD';
    state = 'Maryland';
  } else if (thiszip >= 1000 && thiszip <= 2799) {
    st = 'MA';
    state = 'Massachusetts';
  } else if (thiszip >= 48000 && thiszip <= 49999) {


 `json:"cicfRating,omitempty"`
	// CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL
	// AUDIOVIZUALULUI (CNA).
	//
	// Possible values:
	//   "cnaUnspecified"
	//   "cnaAp" - AP
	//   "cna12" - 12
	//   "cna15" - 15
	//   "cna18" - 18
	//   "cna18plus" - 18+
	//   "cnaUnrated"
	CnaRating string `json:"cnaRating,omitempty"`
	// CncRating: Rating system in France - Commission de classification
	// cinematographique
	//
	// Possible values:
	//   "cncUnspecified"
	//   "cncT" - T
	//   "cnc10" - 10
	//   "cnc12" - 12
	//   "cnc16" - 16
	//   "cnc18" - 18
	//   "cncE" - E
	//   "cncInterdiction" - interdiction
	//   "cncUnrated"
	CncRating string `json:"cncRating,omitempty"`
	// CsaRating: The video's rating from France's Conseil supérieur de
	// l’audiovisuel, which rates broadcast content.
	//
	// Possible values:
	//   "csaUnspecified"
	//   "csaT" - T
	//   "csa10" - 10
	//   "csa12" - 12
	//   "csa16" - 16
	//   "csa18" - 18
	//   "csaInterdiction" - Interdiction
	//   "csaUnrated"
	CsaRating string `json:"csaRating,omitempty"`
	// CscfRating: The video's rating from Luxembourg's Commission de surveillance
	// de la classification des films (CSCF).
	//
	// Possible values:
	//   "cscfUnspecified"
	//   "cscfAl" - AL
	//   "cscfA" - A
	//   "cscf6" - 6
	//   "cscf9" - 9
	//   "cscf12" - 12
	//   "cscf16" - 16
	//   "cscf18" - 18
	//   "cscfUnrated"
	CscfRating string `json:"cscfRating,omitempty"`
	// CzfilmRating: The video's rating in the Czech Republic.
	//
	// Possible values:
	//   "czfilmUnspecified"
	//   "czfilmU" - U
	//   "czfilm12" - 12
	//   "czfilm14" - 14
	//   "czfilm18" - 18
	//   "czfilmUnrated"
	CzfilmRating string `json:"czfilmRating,omitempty"`
	// DjctqRating: The video's Departamento de Justiça, Classificação,
	// Qualificação e Títulos (DJCQT - Brazil) rating.
	//
	// Possible values:
	//   "djctqUnspecified"
	//   "djctqL" - L
	//   "djctq10" - 10
	//   "djctq12" - 12
	//   "djctq14" - 14
	//   "djctq16" - 16
	//   "djctq18" - 18
	//   "djctqEr"
	//   "djctqL10"
	//   "djctqL12"
	//   "djctqL14"
	//   "djctqL16"
	//   "djctqL18"
	//   "djctq1012"
	//   "djctq1014"
	//   "djctq1016"
	//   "djctq1018"
	//   "djctq1214"
	//   "djctq1216"
	//   "djctq1218"
	//   "djctq1416"
	//   "djctq1418"
	//   "djctq1618"
	//   "djctqUnrated"
	DjctqRatin


le API Gateway
 * https://govway.org
 *
 * Copyright (c) 2005-2025 Link.it srl (https://link.it).
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3, as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package org.openspcoop2.security.keystore.cache;

import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.openspcoop2.protocol.sdk.state.RequestInfo;
import org.openspcoop2.security.SecurityException;
import org.openspcoop2.security.keystore.BYOKStore;
import org.openspcoop2.security.keystore.CRLCertstore;
import org.openspcoop2.security.keystore.ExternalResource;
import org.openspcoop2.security.keystore.HttpStore;
import org.openspcoop2.security.keystore.JWKSetStore;
import org.openspcoop2.security.keystore.KeyPairStore;
import org.openspcoop2.security.keystore.MerlinKeystore;
import org.openspcoop2.security.keystore.MerlinTruststore;
import org.openspcoop2.security.keystore.MultiKeystore;
import org.openspcoop2.security.keystore.OCSPResponse;
import org.openspcoop2.security.keystore.PublicKeyStore;
import org.openspcoop2.security.keystore.RemoteStore;
import org.openspcoop2.security.keystore.SSLConfigProps;
import org.openspcoop2.security.keystore.SSLSocketFactory;
import org.openspcoop2.security.keystore.SecretKeyStore;
import org.openspcoop2.security.keystore.SecretPasswordKeyDerivationConfig;
import org.openspcoop2.security.keystore.SymmetricKeystore;
import org.openspcoop2.utils.cache.Cache;
import org.openspcoop2.utils.certificate.CertificateInfo;
import org.openspcoop2.utils.certificate.byok.BYOKInstance;
import org.openspcoop2.utils.certificate.byok.BYOKRequestParams;
import org.openspcoop2.utils.certificate.remote.IRemoteStoreProvider;
import org.openspcoop2.utils.certificate.remote.RemoteKeyType;
import org.openspcoop2.utils.certificate.remote.RemoteStoreClientInfo;
import org.openspcoop2.utils.certificate.remote.RemoteStoreConfig;
import org.openspcoop2.utils.transport.http.ExternalResourceConfig;
import org.openspcoop2.utils.transport.http.HttpOptions;
import org.openspcoop2.utils.transport.http.IOCSPValidator;
import org.openspcoop2.utils.transport.http.SSLConfig;

/**
 * GestoreKeystoreCache
 *
 * @author Andrea Poli (apoli@link.it)
 * @author $Author$
 * @version $Rev$, $Date$
 */
public class GestoreKeystoreCache {

	private GestoreKeystoreCache() {}

	private static final MerlinTruststoreCache merlinTruststoreCache = new MerlinTruststoreCache();
	private static final MerlinKeystoreCache merlinKeystoreCache = new MerlinKeystoreCache();
	private static final SymmetricKeystoreCache symmetricKeystoreCache = new SymmetricKeystoreCache();
	private static final MultiKeystoreCache multiKeystoreCache = new MultiKeystoreCache();
	private static final JWKSetStoreCache jwkSetStoreCache = new JWKSetStoreCache();
	private static final KeyPairStoreCache keyPairStoreCache