2 | minBits
2 | isPublic

TYPE TABLE: 32 bytes each
8 | coeffs
8 | maxPos
8 | maxNeg
8 | minBits

CONSTANT TABLE: 8 bytes each
8 | word

OPERATIONS: 8 bytes each
 4 bits: opcode
 12 bits: type T
 24 bits: operand A
 24 bits: operand B

OPCODES:
  0: Eqz -  A
  1: Def - TA
  2: Con - TAB
  8: Add - TAB
  9: Sub - TAB
  A: Mul - TAB
  B: Rem - TAB
  C: Quo - TAB
  D: Inv - TAB
*/

IOException::IOException(const char* file, const char* func, int line, const char* msg)
    : std::runtime_error::runtime_error(std::string(file) + ":" + std::to_string(line) +
                                        ", check failed in " + std::string(func) + ": " +
                                        std::string(msg)) {}

#define check(cond)                                                                                \
  if (cond)                                                                                \
  throw IOException(__FILE__, __FUNCTION__, __LINE__, #cond)

#define MAGIC 0x63626962

namespace {

struct Writer {
  virtual void write(const void*, size_t) = 0;
};

void writeU16(uint16_t value, Writer& stream) {
  std::array<uint8_t, 2> buf{};
  buf[0] = (value >> 0x00) & 0xFFU;
  buf[1] = (value >> 0x08) & 0xFFU;
  stream.write(buf.data(), buf.size());
}

void writeU32(uint32_t value, Writer& stream) {
  std::array<uint8_t, 4> buf{};
  buf[0] = (value >> 0x00) & 0xFFU;
  buf[1] = (value >> 0x08) & 0xFFU;
  buf[2] = (value >> 0x10) & 0xFFU;
  buf[3] = (value >> 0x18) & 0xFFU;
  stream.write(buf.data(), buf.size());
}

void writeU64(uint64_t value, Writer& stream) {
  std::array<uint8_t, 8> buf{};
  buf[0] = (value >> 0x00) & 0xFFU;
  buf[1] = (value >> 0x08) & 0xFFU;
  buf[2] = (value >> 0x10) & 0xFFU;
  buf[3] = (value >> 0x18) & 0xFFU;
  buf[4] = (value >> 0x20) & 0xFFU;
  buf[5] = (value >> 0x28) & 0xFFU;
  buf[6] = (value >> 0x30) & 0xFFU;
  buf[7] = (value >> 0x38) & 0xFFU;
  stream.write(buf.data(), buf.size());
}

void writeHeader(const Program& p, Writer& stream) {
  writeU32(MAGIC, stream);
  writeU32(1, stream);
  writeU32(p.inputs.size(), stream);
  writeU32(p.types.size(), stream);
  writeU32(p.constants.size(), stream);
  writeU32(p.ops.size(), stream);
}

void writeInput(const Input& i, Writer& stream) {
  writeU64(i.label, stream);
  writeU32(i.bitWidth, stream);
  writeU16(i.minBits, stream);
  writeU16(i.isPublic ? 1 : 0, stream);
}

void writeType(const Type& t, Writer& stream) {
  writeU64(t.coeffs, stream);
  writeU64(t.maxPos, stream);
  writeU64(t.maxNeg, stream);
  writeU64(t.minBits, stream);
}

void writeOp(const Op& o, Writer& stream) {
  // Pack operation struct


"scapus penis":"[医] 阴茎干, 阴茎体",
"scapus pili":"[医] 毛干",
"scaqmd":"abbr. South Coast Air Quality Management District 南海岸大气质量管理区（美国加利福尼亚州）",
"scar":"n. 疤痕, 伤痕, 悬崖\\nvi. 结疤, 愈合, 痊愈\\nvt. 使有伤痕",
"scar over":"愈合, 结疤",
"scar tissue":"[医] 瘢痕组织",
"scar-face":"[法] 脸上有刀伤的人, 脸上有伤疤的人",
"scar-faced":"adj. 脸上有疤的；满脸伤疤的",
"scar-pterygium":"[医] 瘢痕翼状胬肉, 假翼状胬肉",
"SCARA":"驯服的装配机器人臂",
"scarab":"n. 金龟子科甲虫, 圣甲虫, 雕刻成圣甲虫形状的宝石",
"scarabaean":"圣甲虫, 甲虫形宝石,金龟子科甲虫",
"scarabaei":"圣甲虫, 甲虫形宝石,金龟子科甲虫",
"scarabaeid":"金龟子科甲虫的",
"scarabaeid beetle":"[网络] 瓢虫甲虫",
"Scarabaeidae":"[网络] 金龟子科；金龟科；金龟子科的甲虫",
"scarabaeoid":"金龟子, 圣甲虫宝石",
"scarabaeus":"(=scarab) n.[动]金龟子科,圣甲虫, 甲虫形宝石",
"Scarabaeus sacer":"[网络] 神圣粪金龟；神圣金龟；圣甲虫",
"scarabee":"蜣螂线",
"scarabeiform":"蛴螬形",
"scarabiasis":"[医] 肠蜣螂病",
"scaraboid":"a. [昆](似)金龟子的",
"scarabs":"(scarab 的复数) n. 金龟子科甲虫, 圣甲虫, 雕刻成圣甲虫形状的宝石",
"scaramouch":"n. 虚张声势的胆小鬼",
"scaramouche":"n. 胆小丑角;胆怯者",
"scarboro":" [人名] 斯卡伯勒; [地名] [美国] 斯卡伯勒",
"Scarborough":"n. 士嘉堡（多伦多一区名）；斯卡伯勒（英格兰一自治市）",
"scarbroite":"n. 羟碳酸铝矿",
"scarbrough":" [人名] 斯卡伯勒",
"scarce":"a. 难得的, 稀罕的, 缺乏的",
"scarce capacity":"[经] 稀有的生产能力",
"scarce metals":"稀有金属",
"scarce times":"艰难时世,萧条时期",
"scarcely":"adv. 简直不, 一定不, 仅仅",
"scarcely any":"几乎没有, 几乎从不, 几乎不, 很少",
"sca


* instruction information is no longer valid. A JMP forces
   * the processor to discard the invalid information.
   *
   * Note that a short jump to a code32 block won't work. We
   * either continue running in 16-bit potected mode by a short
   * jump to a code16 block, or move to 32-bit pmode by a long
   * jump to a code32 block where %cs segment cache is updated */
  jmp    flush_prefetch

flush_prefetch:
  /* Setup the data segments and the stack pointer. Note that
   * the segment descriptors index is 8bytes aligned, thus
   * Intel uses the least significant 3 bits in the segment
   * selector to decode the DPL and the TI bits */
  movw   $(gdt_ds - gdt), %ax
  movw   %ax, %ds
  movw   %ax, %es
  movw   %ax, %fs
  movw   %ax, %gs
  movw   %ax, %ss
  movl   $((MBR_SEG << 4) + STACK_OFFSET), %esp

  /* Setup %cs: long jump to 32-bit protected mode. GAS should
   * have known that $(gdt_cs - gdt), equalling 0x08, *is* an
   * absoulte code segment value, but it doesn't.
   *
   * Far pointer offset is the destination's full flat address
   * since now setup %cs base = 0 */
  ljmp   $0x08, $((MBR_SEG << 4) + reloc)

.code32

reloc:
  /* Goodbye the 80's; welcome the 90's!
   * Relocate the kernel above the one mege-byte point at
   * 0x100000. We should have directly done so using multiple
   * stages, but we're still very simple (read: braindead) */
  .equ   KERNEL_RELOC, 0x100000
  .equ   KERNEL_SIZE, 0x80000
  movl   $(KERNEL_SEGMENT << 4), %esi
  movl   $KERNEL_RELOC, %edi
  movl   $(KERNEL_SIZE / 4), %ecx
  rep    movsl

  /* Run our kernel with the currently setup code segment:
   * perform an absolute near jump */
  movl   $KERNEL_RELOC, %eax
  jmpl   *%eax

.code16

/*
 * A20 line methods
 *
 * There's usually a controller in the keyboard itself and
 * a motherboard keyboard controller responsible for buffering,
 * data validity checking, and translation form Kscan codes
 * provided by the in-keyboard controller to scan codes.
 *
 * On AT+ machines, ports 0x60 and 0x64 communicate with the
 * motherboard keyboard controller. What's relative to us is
 * port 0x64 which is used to read status from the
 * motherboard keyboard controller and to send commands to it
 *
 * Port 0x64 input:
 *
 * bit1: If clear, the motherboard controller's input buffer
 * is empty. A write can be made to port 0x60 or port 0x64.
 * If set, the motherboard controller's input buffer is full.
 * Until the motherboard controller has emptied the buffer,
 * no writes should occur to ports 0x60/0x64 or the command
 * will be lost.
 *
 * bit0: If clear, the motherboard controller's output buffer
 * is empty. A read from port 0x60 will not be valid.
 * If set, the motherboard controller's output buffer has
 * a byte available. Use port 0x60 to read that byte.
 *
 * Port 0x64 output:
 * (send commands to motherboard's keyboard controller)
 *
 * 0xd0: Read the controller's state/output-port. The byte can
 * be read by reading from 0x60 afterwards.
 * bit1: if set, A20 line is on. The opposite if clear.
 *
 * 0xD1: The next byte written to 0x60 is transfered to the
 * c


2c43.52%2c7.458z M42.106%2c42.105c-4.432%2c4.431-10.332%2c6.872-16.615%2c6.872h-0.002c-6.285-0.001-12.187-2.441-16.617-6.872 c-9.162-9.163-9.162-24.071%2c0-33.233C13.303%2c4.44%2c19.204%2c2%2c25.489%2c2c6.284%2c0%2c12.186%2c2.44%2c16.617%2c6.872 c4.431%2c4.431%2c6.871%2c10.332%2c6.871%2c16.617C48.977%2c31.772%2c46.536%2c37.675%2c42.106%2c42.105z'/%3e %3cpath d='M23.578%2c32.218c-0.023-1.734%2c0.143-3.059%2c0.496-3.972c0.353-0.913%2c1.11-1.997%2c2.272-3.253 c0.468-0.536%2c0.923-1.062%2c1.367-1.575c0.626-0.753%2c1.104-1.478%2c1.436-2.175c0.331-0.707%2c0.495-1.541%2c0.495-2.5 c0-1.096-0.26-2.088-0.779-2.979c-0.565-0.879-1.501-1.336-2.806-1.369c-1.802%2c0.057-2.985%2c0.667-3.55%2c1.832 c-0.301%2c0.535-0.503%2c1.141-0.607%2c1.814c-0.139%2c0.707-0.207%2c1.432-0.207%2c2.174h-2.937c-0.091-2.208%2c0.407-4.114%2c1.493-5.719 c1.062-1.64%2c2.855-2.481%2c5.378-2.527c2.16%2c0.023%2c3.874%2c0.608%2c5.141%2c1.758c1.278%2c1.16%2c1.929%2c2.764%2c1.95%2c4.811 c0%2c1.142-0.137%2c2.111-0.41%2c2.911c-0.309%2c0.845-0.731%2c1.593-1.268%2c2.243c-0.492%2c0.65-1.068%2c1.318-1.73%2c2.002 c-0.65%2c0.697-1.313%2c1.479-1.987%2c2.346c-0.239%2c0.377-0.429%2c0.777-0.565%2c1.199c-0.16%2c0.959-0.217%2c1.951-0.171%2c2.979 C26.589%2c32.218%2c23.578%2c32.218%2c23.578%2c32.218z M23.578%2c38.22v-3.484h3.076v3.484H23.578z'/%3e %3c/g%3e %3c/svg%3e"},54488:e=>{"use strict";e.exports="data:image/svg+xml,%3csvg width='152' height='165' viewBox='0 0 152 165' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e %3cg class='jp-jupyter-icon-color' fill='%23F37726'%3e %3cpath transform='translate(0.078947%2c 110.582927)' d='M75.9422842%2c29.5804561 C43.3023947%2c29.5804561 14.7967832%2c17.6534634 0%2c0 C5.51083211%2c15.8


{
		case log := <-it.logs:
			it.Event = new(AuctionNewDonationAddress)
			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
				it.fail = err
				return false
			}
			it.Event.Raw = log
			return true

		default:
			return false
		}
	}
	// Iterator still in progress, wait for either a data or an error event
	select {
	case log := <-it.logs:
		it.Event = new(AuctionNewDonationAddress)
		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
			it.fail = err
			return false
		}
		it.Event.Raw = log
		return true

	case err := <-it.sub.Err():
		it.done = true
		it.fail = err
		return it.Next()
	}
}

// Error returns any retrieval or parsing error occurred during filtering.
func (it *AuctionNewDonationAddressIterator) Error() error {
	return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *AuctionNewDonationAddressIterator) Close() error {
	it.sub.Unsubscribe()
	return nil
}

// AuctionNewDonationAddress represents a NewDonationAddress event raised by the Auction contract.
type AuctionNewDonationAddress struct {
	NewDonationAddress common.Address
	Raw                types.Log // Blockchain specific contextual infos
}

// FilterNewDonationAddress is a free log retrieval operation binding the contract event 0xa62863cbad1647a2855e9cd39d04fa6dfd32e1b9cfaff1aaf6523f4aaafeccd7.
//
// Solidity: event NewDonationAddress(address indexed newDonationAddress)
func (_Auction *AuctionFilterer) FilterNewDonationAddress(opts *bind.FilterOpts, newDonationAddress []common.Address) (*AuctionNewDonationAddressIterator, error) {

	var newDonationAddressRule []interface{}
	for _, newDonationAddressItem := range newDonationAddress {
		newDonationAddressRule = append(newDonationAddressRule, newDonationAddressItem)
	}

	logs, sub, err := _Auction.contract.FilterLogs(opts, "NewDonationAddress", newDonationAddressRule)
	if err != nil {
		return nil, err
	}
	return &AuctionNewDonationAddressIterator{contract: _Auction.contract, event: "NewDonationAddress", logs: logs, sub: sub}, nil
}

// WatchNewDonationAddress is a free log subscription operation binding the contract event 0xa62863cbad1647a2855e9cd39d04fa6dfd32e1b9cfaff1aaf6523f4aaafeccd7.
//
// Solidity: event NewDonationAddress(address indexed newDonationAddress)
func (_Auction *AuctionFilterer) WatchNewDonationAddress(opts *bind.WatchOpts, sink chan<- *AuctionNewDonationAddress, newDonationAddress []common.Address) (event.Subscription, error) {

	var newDonationAddressRule []interface{}
	for _, newDonationAddressItem := range newDonationAddress {
		newDonationAddressRule = append(newDonationAddressRule, newDonationAddressItem)
	}

	logs, sub, err := _Auction.contract.WatchLogs(opts, "NewDonationAddress", newDonationAddressRule)
	if err != nil {
		return nil, err
	}
	return event.NewSubscription(func(quit <-chan struct{}) error {
		defer sub.Unsubscribe()
		for {
			select {
			case log := <-logs:
				// New log arrived, parse the event and forward to the user
				event := new(AuctionNewDonationAddress)
				if err := _Auction.contract.UnpackLog(event, "NewDonationAddress", log); err != nil {
					return err
				}
				event.Raw = log

				select {
				case sink <- event:
				case err := <-sub.Err():
					return


2_val == -131073,
// opcode: beq, op1:x10; op2:x11; op1val:0x0; op2val:-0x20001; immval:0x40; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, 0x0, -0x20001, 0x40, 3f, x1, 116,0)

inst_51:
// rs2_val == -262145, rs1_val == -17
// opcode: beq, op1:x10; op2:x11; op1val:-0x11; op2val:-0x40001; immval:0x80; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, -0x11, -0x40001, 0x80, 3f, x1, 120,0)

inst_52:
// rs2_val == -524289,
// opcode: beq, op1:x10; op2:x11; op1val:-0x201; op2val:-0x80001; immval:0xa; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, -0x201, -0x80001, 0xa, 1b, x1, 124,0)

inst_53:
// rs2_val == -1048577,
// opcode: beq, op1:x10; op2:x11; op1val:-0x801; op2val:-0x100001; immval:0x556; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, -0x801, -0x100001, 0x556, 1b, x1, 128,0)

inst_54:
// rs2_val == -2097153,
// opcode: beq, op1:x10; op2:x11; op1val:0x66666666; op2val:-0x200001; immval:0x4; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, 0x66666666, -0x200001, 0x4, 3f, x1, 132,0)

inst_55:
// rs2_val == -4194305,
// opcode: beq, op1:x10; op2:x11; op1val:0xb504; op2val:-0x400001; immval:0x10; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, 0xb504, -0x400001, 0x10, 3f, x1, 136,0)

inst_56:
// rs2_val == -8388609, rs1_val == -2
// opcode: beq, op1:x10; op2:x11; op1val:-0x2; op2val:-0x800001; immval:0x80; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, -0x2, -0x800001, 0x80, 3f, x1, 140,0)

inst_57:
// rs2_val == -16777217,
// opcode: beq, op1:x10; op2:x11; op1val:-0x55555556; op2val:-0x1000001; immval:0x400; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, -0x55555556, -0x1000001, 0x400, 1b, x1, 144,0)

inst_58:
// rs2_val == -33554433,
// opcode: beq, op1:x10; op2:x11; op1val:0x9; op2val:-0x2000001; immval:0x0; align:0
TEST_BRANCH_OP(beq, x2, x10, x11, 0x9, -0x2000001, 0


RT1>, Rx<USART1>, Tx<USART2>, Rx<USART2>) {
    let p = Peripherals::take().unwrap();
    let pwr = p.PWR.constrain();
    let vos = pwr.freeze();
    let rcc = p.RCC.constrain();
    let ccdr = rcc.sys_ck(160.mhz()).freeze(vos, &p.SYSCFG);
    let clocks = ccdr.clocks;
    let gpioa = p.GPIOA.split(ccdr.peripheral.GPIOA);

    let (tx1, rx1) = p
        .USART1
        .serial(
            (
                gpioa.pa9.into_alternate_af7(), //tx pa9
                gpioa.pa10.into_alternate_af7(),
            ), //rx pa10
            9600.bps(),
            ccdr.peripheral.USART1,
            &clocks,
        )
        .unwrap()
        .split();

    let (tx2, rx2) = p
        .USART2
        .serial(
            (
                gpioa.pa2.into_alternate_af7(), //tx pa2
                gpioa.pa3.into_alternate_af7(),
            ), //rx pa3
            9600.bps(),
            ccdr.peripheral.USART2,
            &clocks,
        )
        .unwrap()
        .split();

    (tx1, rx1, tx2, rx2)
}

#[cfg(feature = "stm32l0xx")]
use stm32l0xx_hal::{
    pac::Peripherals,
    pac::{USART1, USART2},
    prelude::*,
    rcc, // for ::Config but note name conflict with serial
    serial::{Config, Rx, Serial1Ext, Serial2Ext, Tx},
};

#[cfg(feature = "stm32l0xx")]
fn setup() -> (Tx<USART1>, Rx<USART1>, Tx<USART2>, Rx<USART2>) {
    let p = Peripherals::take().unwrap();
    let mut rcc = p.RCC.freeze(rcc::Config::hsi16());

    let gpioa = p.GPIOA.split(&mut rcc);

    let (tx1, rx1) = p
        .USART1
        .usart(
            gpioa.pa9,  //tx pa9  for console
            gpioa.pa10, //rx pa10 for console
            Config::default().baudrate(9600.bps()),
            &mut rcc,
        )
        .unwrap()
        .split();

    let (tx2, rx2) = p
        .USART2
        .usart(
            gpioa.pa2, //tx pa2  for GPS
            gpioa.pa3, //rx pa3  for GPS
            Config::default().baudrate(9600.bps()),
            &mut rcc,
        )
        .unwrap()
        .split();

    (tx1, rx1, tx2, rx2)
}

#[cfg(feature = "stm32l1xx")] // eg  Discovery kit stm32l100 and Heltec lora_node STM32L151CCU6
use stm32l1xx_hal::{
    prelude::*,
    rcc, // for ::Config but note name conflict with next
    serial::{Config, Rx, SerialExt, Tx},
    stm32::Peripherals,
    stm32::{USART1, USART2},
};

// The Heltec lora_node 151 uses USART2 and USART3 pins for on board LoRa connections and power
// detection. See
// https://resource.heltec.cn/download/LoRa_Node_151/LoRa_Node_151_Pinout_Diagram.pdf.
// So only USART1 is available and this example cannot work on Heltec lora_node 151 as


OLOv8 Multi-Object Tracking in Videos                                    |            |  |
| YOLOv8 Object Counting in Videos                               |            |  |
| YOLOv8 Heatmaps in Videos                                             |                   |  |
| Ultralytics Datasets Explorer with SQL and OpenAI Integration 🚀 New |  |  |

##
Models

YOLOv8 [Detect](https://docs.ultralytics.com/tasks/detect), [Segment](https://docs.ultralytics.com/tasks/segment) and [Pose](https://docs.ultralytics.com/tasks/pose) models pretrained on the [COCO](https://docs.ultralytics.com/datasets/detect/coco) dataset are available here, as well as YOLOv8 [Classify](https://docs.ultralytics.com/tasks/classify) models pretrained on the [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet) dataset. [Track](https://docs.ultralytics.com/modes/track) mode is available for all Detect, Segment and Pose models.

All [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.

Detection (COCO)

See [Detection Docs](https://docs.ultralytics.com/tasks/detect/) for usage examples with these models trained on [COCO](https://docs.ultralytics.com/datasets/detect/coco/), which include 80 pre-trained classes.

| Model                                                                                | size
(pixels) | mAPval
50-95 | Speed
CPU ONNX<br


DataTypeTest, mpi_datatype_typedefs_and_using) {
    // typedefs and using directives.
    typedef int myInt;
    EXPECT_THAT(possible_mpi_datatypes<int>(), Contains(mpi_type_traits<myInt>::data_type()));

    using myFloat = float;
    EXPECT_THAT(possible_mpi_datatypes<float>(), Contains(mpi_type_traits<myFloat>::data_type()));
}

TEST(MpiDataTypeTest, mpi_datatype_size_t) {
    // size_t, which should be one of the unsigned integer types with at least 16 bits (as of C++11).
    EXPECT_THAT(
        (std::array{MPI_UNSIGNED_SHORT, MPI_UNSIGNED, MPI_UNSIGNED_LONG, MPI_UNSIGNED_LONG_LONG}),
        Contains(mpi_type_traits<size_t>::data_type())
    );

    // As should std::size_t, which should be one of the unsigned integer types with at least 16 bits (as of C++11).
    EXPECT_THAT(
        (std::array{MPI_UNSIGNED_SHORT, MPI_UNSIGNED, MPI_UNSIGNED_LONG, MPI_UNSIGNED_LONG_LONG}),
        Contains(mpi_type_traits<std::size_t>::data_type())
    );
}

TEST(MpiDataTypeTest, mpi_datatype_enum) {
    // Calling mpi_datatype with a enum type should use the underlying type.

    // Unscoped enum
    enum unscopedEnum { valueA = 0, valueB = 1 };
    auto unscopedEnum_types = possible_mpi_datatypes<std::underlying_type_t<unscopedEnum>>();
    EXPECT_THAT(unscopedEnum_types, Contains(mpi_type_traits<unscopedEnum>::data_type()));

    // Unscoped enum with explicit underlying type
    enum unscopedEnumInt : int { valueA2 = 0, valueB2 = 1 };
    auto unscopedEnumInt_types = possible_mpi_datatypes<std::underlying_type_t<unscopedEnumInt>>();
    EXPECT_THAT(unscopedEnumInt_types, Contains(mpi_type_traits<unscopedEnumInt>::data_type()));

    // Scoped enum
    enum class scopedEnum { valueA = 0, valueB = 1 };
    auto scopedEnum_types = possible_mpi_datatypes<std::underlying_type_t<scopedEnum>>();
    EXPECT_THAT(scopedEnum_types, Contains(mpi_type_traits<scopedEnum>::data_type()));

    // Scope enum with explicit underlying type
    enum class scopedEnumUint8_t : uint8_t { valueA = 0, valueB = 1 };
    EXPECT_THAT(possible_mpi_datatypes<uint8_t>(), Contains(mpi_type_traits<scopedEnumUint8_t>::data_type()));

    enum class scopedEnumInt64_t : int64_t { valueA = 0, valueB = 1 };
    EXPECT_THAT(possible_mpi_datatypes<int64_t>(), Contains(mpi_type_traits<scopedEnumInt64_t>::data_type()));
}

TEST(MpiDataTypeTest, contiguous_type_works) {
    std::array<float, 3> a               = {1.0f, 2.0f, 3.0f};
    MPI_Datatype         contiguous_type = kamping::contiguous_type<float, 3>::data_type();
    int                  num_integers, num_addresses, num_datatypes, combiner;
    MPI_Type_get_envelope(contiguous_type, &num_integers, &num_addresses, &num_datatypes, &combiner);
    EXPECT_EQ(combiner, MPI_COMBINER_CONTIGUOUS);
    // returned values for MPI_COMBINER_CONTIGUOUS according to section 5.1.13 of the MPI standard (Decodi


r, _p: Peripherals) -> ! {
    loop {
        Timer::after(Duration::from_secs(1)).await;
        info!("Hello");
    }
}
use crossterm::event::{self, Event, KeyCode};
use std::{
  io,
  time::{Duration, Instant},
};
use tui::{backend::Backend, Terminal};

use crate::app::App;
use crate::ui::ui;

pub fn run_app<B: Backend>(
  terminal: &mut Terminal<B>,
  mut app: App,
  tick_rate: Duration,
) -> io::Result<()> {
  let mut last_tick = Instant::now();
  loop {
    terminal.draw(|f| ui(f, &mut app))?;

    let timeout = tick_rate
      .checked_sub(last_tick.elapsed())
      .unwrap_or_else(|| Duration::from_secs(0));
    if crossterm::event::poll(timeout)? {
      if let Event::Key(key) = event::read()? {
        match key.code {
          KeyCode::Char('q') => return Ok(()),
          KeyCode::Left => app.items.unselect(),
          KeyCode::Down => app.items.next(),
          KeyCode::Up => app.items.previous(),
          _ => {}
        }
      }
    }
    if last_tick.elapsed() >= tick_rate {
      last_tick = Instant::now();
    }
  }
}
//! Device adapters.
//!
//! # Usage
//!
//! All device adapters are used as wrappers around another (shared) device.
//! Through nesting adapters, users should be able to emulate fairly complex
//! memory-mapped layouts.
//!
//! Adapters are themselves a [`Device`](crate::dev::Device), so they use the
//! same interface as the devices they are modifying. As well, they all own the
//! devices they modify through a [`SharedDevice`](crate::dev::SharedDevice),
//! allowing for sharing and reuse elsewhere.

pub use self::bank::Bank;
pub use self::remap::Remap;
pub use self::view::View;

mod bank;
mod remap;
mod view;
<filename>script/src/syscalls/mmap_tx.rs
use ckb_vm::memory::PROT_READ;
use ckb_vm::{CoreMachine, Error as VMError, Memory, Register, Syscalls, A0, A1, A2, A3, A7};
use std::cmp;
use std::rc::Rc;
use syscalls::{Mode, MMAP_TX_SYSCALL_NUMBER, OVERRIDE_LEN, SUCCESS};

pub struct MmapTx<'a> {
    tx: &'a [u8],
}

impl<'a> MmapTx<'a> {
    pub fn new(tx: &'a [u8]) -> MmapTx<'a> {
        MmapTx { tx }
    }
}

impl<'a, R: Register, M: Memory> Syscalls<R, M> for MmapTx<'a> {
    fn initialize(&mut self, _machine: &mut CoreMachine<R, M>) -> Result<(), VMError> {
        Ok(())
    }

    fn ecall(&mut self, machine: &mut CoreMachine<R, M>) -> Result<bool, VMError> {
        if machine.registers()[A7].to_u64() != MMAP_TX_SYSCALL_NUMBER {
            return Ok(false);
        }

        let addr = machine.registers()[A0].to_usize();
        let size_addr = machine.registers()[A1].to_usize();
        let mode = Mode::parse_from_flag(machine.registers()[A2].to_u64())?;
        let size = machine.memory_mut().load64(size_addr)? as usize;

        let data = self.tx;

        let (size, offset) = match mode {
            Mode::ALL => {
                if size < data.len()


SHARD_LOCK_HOLD_PERIOD_MS("1200000"),
    // 1 min
    SHARD_LOCK_DISINTERESTED_PERIOD_MS("60000"),
    // 2 min
    SHARD_LOCK_SCAVENGE_INTERVAL_MS("120000"),
    MAX_ZK_LOCKS_TO_ACQUIRE_PER_CYCLE("1"),

    INTERNAL_API_CLUSTER("127.0.0.1:50020,127.0.0.1:50020"),

    RIEMANN_HOST(""), //string: address of riemann server where events should be sent.
    RIEMANN_PORT("5555"),
    RIEMANN_PREFIX(""), //string: prefix metric names with this. useful for telling metrics from backfiller vs normal BF instance. (RIEMANN_LOCALHOST and RIEMANN_TAGS are better though)
    RIEMANN_LOCALHOST(""), //string: name of the server blueflood is running on.
    RIEMANN_TAGS(""), //comma-delimited list of strings: tags to append to metric events. ex- blueflood,ingest
    RIEMANN_SEPARATOR(""), //string: separator between metric name components. if set to "|" would result in: prefix|metric_name|rate_5m
    RIEMANN_TTL(""), //float: number of seconds until metric TTLs out of riemann's index

    GRAPHITE_HOST(""),
    GRAPHITE_PORT("2003"),
    GRAPHITE_PREFIX("unconfiguredNode.metrics."),
    GRAPHITE_REPORT_PERIOD_SECONDS("30"),

    INGEST_MODE("true"),
    ROLLUP_MODE("true"),
    QUERY_MODE("true"),

    METRICS_BATCH_WRITER_THREADS("50"),

    METRIC_BATCH_SIZE("100"),

    // The locator cache is a local, in-memory cache that keeps track of locators that have been inserted into Cassandra
    // and Elasticsearch for various tracking purposes, like marking a delayed locator dirty for rollup or indexing a
    // locator and tokens for later querying. The cache is used to avoid unnecessary writes to these remote systems.

    // This setting tunes the concurrency of the locator cache. All threads writing to the database contend for access
    // to this cache. Setting the concurrency too low will impact metric writing throughput.
    LOCATOR_CACHE_CONCURRENCY("16"),
    // Sets the length of time a locator is kept in the cache after it's written or last accessed. Any given locator
    // will typically be seen at regular intervals in a production setting, but load balancing can spread occurrences of
    // a locator across multiple Blueflood nodes. This setting should account for the combination of both. For instance,
    // if data points for a locator arrive every minute and there are six Blueflood nodes, setting this any lower than 7
    // is virtually guaranteed to expire cache entries too early. In reality, it's probably necessary to set it
    // significantly higher due to other factors affecting the distribution of locators around nodes.
    LOCATOR_CACHE_TTL_MINUTES("60"),
    // Sets the length of time a delayed locator is kept in the cache. This guards against excessive writes to the
    // "delayed locator" column family in cassandra. Note that both the locator and the slot are taken into account
    // here, so a single locator could account for multiple entries in this portion of the cache.
    LOCATOR_CACHE_DELAYED_TTL_SECONDS("30"),

    // The token cache is similar in use to the locator cache, described previously. When
    // ENABLE_TOKEN_SEARCH_IMPROVEMENTS is turned on, both the locator cache and the token cache are used to avoid
    // unnecessary writes to Elasticsearch.


-- 菍
    0x083fc, -- 菼
    0x08423, -- 萣
    0x044e8, -- 䓨
    0x083c9, -- 菉
    0x044db, -- 䓛
    0x068bc, -- 梼
    0x068bd, -- 梽
    0x06872, -- 桲
    0x068be, -- 梾
    0x0686f, -- 桯
    0x068a3, -- 梣
    0x0688c, -- 梌
    0x06879, -- 桹
    0x06554, -- 敔
    0x053a3, -- 厣
    0x07854, -- 硔
    0x09fce, -- 鿎
    0x07859, -- 硙
    0x0785a, -- 硚
    0x0784a, -- 硊
    0x0784d, -- 硍
    0x052d4, -- 勔
    0x04d15, -- 䴕
    0x09f81, -- 龁
    0x09034, -- 逴
    0x0552a, -- 唪
    0x0556b, -- 啫
    0x07fc8, -- 翈
    0x03af0, -- 㫰
    0x06659, -- 晙
    0x07564, -- 畤
    0x2cc56, -- 𬱖
    0x08dbc, -- 趼
    0x08dc2, -- 跂
    0x086c3, -- 蛃
    0x086b2, -- 蚲
    0x2c7fd, -- 𬟽
    0x086ba, -- 蚺
    0x05574, -- 啴
    0x04383, -- 䎃
    0x05d27, -- 崧
    0x05d1f, -- 崟
    0x05d1e, -- 崞
    0x05d12, -- 崒
    0x05d0c, -- 崌
    0x05d21, -- 崡
    0x094cf, -- 铏
    0x2b4ef, -- 𫓯
    0x2b7f9, -- 𫟹
    0x094d5, -- 铕
    0x2b7fc, -- 𫟼
    0x094d6, -- 铖
    0x094d8, -- 铘
    0x094da, -- 铚
    0x094de, -- 铞
    0x094e5, -- 铥
    0x094f4, -- 铴
    0x0727b, -- 牻
    0x0727f, -- 牿
    0x07a06, -- 稆
    0x07b31, -- 笱
    0x07b2f, -- 笯
    0x05070, -- 偰
    0x05061, -- 偡
    0x09e3a, -- 鸺
    0x0506d, -- 偭
    0x05072, -- 偲
    0x05041, -- 偁
    0x03fe0, -- 㿠
    0x09105, -- 鄅
    0x05053, -- 偓
    0x05f9b, -- 徛
    0x08852, -- 衒
    0x08233, -- 舳
    0x08232, -- 舲
    0x09e3c, -- 鸼
    0x06086, -- 悆
    0x09103, -- 鄃
    0x074fb, -- 瓻
    0x04759,


pected, inRaftZone, dustyScroll), returnToHazeelRaft);
		questionsForHazeel.addStep(new Conditions(scrollInspected, inBasement, dustyScroll), returnToHazeelLadder);
		questionsForHazeel.addStep(new Conditions(scrollInspected, inHiddenRoom, dustyScroll), returnToHazeelWall);
		questionsForHazeel.addStep(new Conditions(scrollInspected, dustyScroll), returnToHazeelCave);
		questionsForHazeel.addStep(new Conditions(buttonPressed, inHiddenRoom, dustyScroll), inspectScroll);
		questionsForHazeel.addStep(new Conditions(buttonPressed, inHiddenRoom), lockpickChest);
		questionsForHazeel.addStep(new Conditions(buttonPressed, inBasement), examineWall);
		questionsForHazeel.addStep(new Conditions(talkedToClaus, inBasement), examineShelves);
		questionsForHazeel.addStep(new Conditions(talkedToGuard, inBasement), talkToClaus);
		questionsForHazeel.addStep(talkedToGuard, ladderToClaus);
		questionsForHazeel.addStep(new Conditions(inRaftZone, talkedToHazeel), returnStairs);
		questionsForHazeel.addStep(new Conditions(inHazeelZone, talkedToHazeel), returnRaft);
		questionsForHazeel.addStep(talkedToHazeel, returnGuard);
		questionsForHazeel.addStep(new Conditions(talkedToAlomoneOrClivet, inHazeelZone), talkToHazeel);
		questionsForHazeel.addStep(inHazeelZone, talkToAlomoneOrClivet);
		questionsForHazeel.addStep(inRaftZone, boardRaft);

		steps.put(30, questionsForHazeel);
		steps.put(32, questionsForHazeel);
		steps.put(34, questionsForHazeel);
		steps.put(36, questionsForHazeel);
		steps.put(38, questionsForHazeel);
		steps.put(40, questionsForHazeel);
		steps.put(42, questionsForHazeel);
		steps.put(44, questionsForHazeel);
		steps.put(46, questionsForHazeel);
		steps.put(48, questionsForHazeel);
		steps.put(50, questionsForHazeel);
		steps.put(52, questionsForHazeel);

		ConditionalStep prisonPuzzleSteps = new ConditionalStep(this, searchBarrel);
		prisonPuzzleSteps.addStep(new Conditions(gottenIcyKey), openSouthGate);
		prisonPuzzleSteps.addStep(new Conditions(icyChest, ancientJewel), openIcyChest);
		prisonPuzzleSteps.addStep(new Conditions(icyChest, jewelShard1, jewelShard2), combineShards);
		prisonPuzzleSteps.addStep(new Conditions(icyChest, jewelShard1, northGateUnlocked, leverPulled), inspectPillar);
		prisonPuzzleSteps.addStep(new Conditions(icyChest, jewelShard1, northGateUnlocked, fixedLever), pullLever);
		prisonPuzzleSteps.addStep(new Conditions(leverHandle, icyChest, settlementsNote, jewelShard1, northGateUnlocked), useLeverOnMechanism);
		prisonPuzzleSteps.addStep(new Conditions(leverHandle, icyChest, settlementsNote, jewelShard1), openNorthGate);
		prisonPuzzleSteps.addStep(new Conditions(leverHandle, icyChest, brazierFin), openWestChest);
		prisonPuzzleSteps.addStep(new Conditions(leverHandle, icyChest, tinderbox, nwBrazier, seBrazier, neBrazier), lightSW);
		prisonPuzzleSteps.addStep(new Conditions(leverHandle, icyChest, tinderbox, nwBrazier, seBrazier), lightNE);
		prisonPuzzleSteps.addStep(new Co


': {
            'score': 100.0,
            'overlap': ['Python', 'JavaScript'],
            'missing': []
        }
    }
}

# Generar dashboard
print("=== VERIFICANDO CORRECCIONES ===\n")
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
exporter = Exporter()

try:
    # 1. Generar Dashboard HTML
    print("1. Generando Dashboard HTML...")
    exporter.exportar_html(test_data, timestamp, dashboard=True)
    print(f"   ✅ Dashboard generado: export/dashboard_{timestamp}.html")

    # 2. Verificar que no hay referencias a PDF
    print("\n2. Verificando eliminación de PDF...")
    print("   ✅ Funcionalidad de PDF eliminada correctamente")

    print("\n=== RESULTADOS ===")
    print("✅ Error de tooltips: CORREGIDO (Bootstrap JS carga antes de inicializar)")
    print("✅ Error de horizontalBar: CORREGIDO (cambiado a 'bar' con indexAxis: 'y')")
    print("✅ Funcionalidad PDF: ELIMINADA del sistema")
    print("\n📝 Notas:")
    print("- Los tooltips ahora se inicializan después de que Bootstrap esté cargado")
    print("- El gráfico de patrones usa el tipo 'bar' correcto para Chart.js v3+")
    print("- Se eliminó completamente la exportación a PDF del código")
    print("\nAbre el dashboard en un navegador y verifica que:")
    print("1. Los iconos 'i' muestran tooltips al pasar el mouse")
    print("2. Los gráficos se renderizan correctamente sin errores")
    print("3. No hay errores en la consola del navegador")

except Exception as e:
    print(f"❌ Error: {e}")
    import traceback
    traceback.print_exc()


# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Sub-package providing interfaces to different teleoperation devices.

Currently, the following categories of devices are supported:

* **Keyboard**: Standard keyboard with WASD and arrow keys.
* **Spacemouse**: 3D mouse with 6 degrees of freedom.
* **Gamepad**: Gamepad with 2D two joysticks and buttons. Example: Xbox controller.

All device interfaces inherit from the :class:`DeviceBase` class, which provides a
common interface for all devices. The device interface reads the input data when
the :meth:`DeviceBase.advance` method is called. It also provides the function :meth:`DeviceBase.add_callback`
to add user-defined callback functions to be called when a particular input is pressed from
the peripheral device.
"""

from .device_base import DeviceBase
from .gamepad import Se2Gamepad, Se3Gamepad
from .keyboard import Se2Keyboard, Se3Keyboard
from .spacemouse import Se2SpaceMouse, Se3SpaceMouse


#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>

"""
Example: Direct drive linear motor
Please make sure that the direct drive linear motor is attached to the end.
"""

import os
import sys
import time
sys.path.append(os.path.join(os.path.dirname(__file__), '../../..'))

from xarm.wrapper import XArmAPI
from configparser import ConfigParser
parser = ConfigParser()
parser.read('../robot.conf')
try:
    ip = parser.get('xArm', 'ip')
except:
    ip = input('Please input the xArm ip address[192.168.1.196]:')
    if not ip:
        ip = '192.168.1.196'

# arm = XArmAPI(ip)
arm = XArmAPI('192.168.1.196')
arm.motion_enable(True)
arm.clean_error()
arm.set_mode(0)
arm.set_state(0)
time.sleep(1)

code = arm.set_linear_motor_back_origin(wait=True)
print('set linear motor back origin, code={}'.format(code))

# status = 1 is go back on zero successful,
code, status = arm.get_linear_motor_on_zero()
print('get linear motor on zero point, code={}, status={}'.format(code, status))

code = arm.set_linear_motor_enable(True)
print('set linear motor enable, code={}'.format(code))

# set speed 500mm/s
code = arm.set_linear_motor_speed(500)
print('set linear motor speed, code={}'.format(code))

# set position 300mm
code = arm.set_linear_motor_pos(300, wait=True)
print('[wait]set linear motor pos, code={}'.format(code))

# set position 700mm
code = arm.set_linear_motor_pos(700, wait=False)
print('[no wait]set linear motor pos, code={}'.format(code))


MOVQ", _V_min_f32, _CX)            // MOVQ     _min_f32, CX
	self.Emit("UCOMISS", jit.Ptr(_CX, 0), _X0)    // UCOMISS  (CX), X0
	self.Sjmp("JB", _LB_range_error)              // JB      _range_error
}

func (self *_Assembler) range_signed_CX(i *rt.GoItab, t *rt.GoType, a int64, b int64) {
	self.Emit("MOVQ", _VAR_st_Iv, _CX)   // MOVQ st.Iv, CX
	self.Emit("MOVQ", jit.Gitab(i), _ET) // MOVQ ${i}, ET
	self.Emit("MOVQ", jit.Gtype(t), _EP) // MOVQ ${t}, EP
	self.Emit("CMPQ", _CX, jit.Imm(a))   // CMPQ CX, ${a}
	self.Sjmp("JL", _LB_range_error)     // JL   _range_error
	self.Emit("CMPQ", _CX, jit.Imm(b))   // CMPQ CX, ${B}
	self.Sjmp("JG", _LB_range_error)     // JG   _range_error
}

func (self *_Assembler) range_unsigned_CX(i *rt.GoItab, t *rt.GoType, v uint64) {
	self.Emit("MOVQ", _VAR_st_Iv, _CX)        // MOVQ  st.Iv, CX
	self.Emit("MOVQ", jit.Gitab(i), _ET)      // MOVQ  ${i}, ET
	self.Emit("MOVQ", jit.Gtype(t), _EP)      // MOVQ  ${t}, EP
	self.Emit("TESTQ", _CX, _CX)              // TESTQ CX, CX
	self.Sjmp("JS", _LB_range_error)          // JS    _range_error
	self.Emit("CMPQ", _CX, jit.Imm(int64(v))) // CMPQ  CX, ${a}
	self.Sjmp("JA", _LB_range_error)          // JA    _range_error
}

/** String Manipulating Routines **/

var (
	_F_unquote = jit.Imm(int64(native.S_unquote))
)

func (self *_Assembler) slice_from(p obj.Addr, d int64) {
	self.Emit("MOVQ", p, _SI) // MOVQ    ${p}, SI
	self.slice_from_r(_SI, d) // SLICE_R SI, ${d}
}

func (self *_Assembler) slice_from_r(p obj.Addr, d int64) {
	self.Emit("LEAQ", jit.Sib(_IP, p, 1, 0), _DI) // LEAQ (IP)(${p}), DI
	self.Emit("NEGQ", p)                          // NEGQ ${p}
	self.Emit("LEAQ", jit.Sib(_IC, p, 1, d), _SI) // LEAQ d(IC)(${p}), SI
}

func (self *_Assembler) unquote_once(p obj.Addr, n obj.Addr, stack bool, copy bool) {
	self.slice_from(_VAR_st_Iv, -1)            // SLICE  st.Iv, $-1
	self.Emit("CMPQ", _VAR_st_Ep, jit.Imm(-1)) // CMPQ   st.Ep, $-1
	self.Sjmp("JE", "_noescape_{n}")           // JE     _escape_{n}
	self.Byte(0x4c, 0x8d, 0x0d)                // LEAQ (PC), R9
	self.Sref("_unquote_once_write_{n}", 4)
	self.Sjmp("JMP", "_escape_string")
	self.Link("_noescape_{n


mpatActivity {

    OverridesManager overridesManager;
    PreferenceManager preferenceManager;
    LinearLayout exportButton;
    TileLargeEditText tileBackupName, tileAuthorName, tileVersion, tileChangelog;
    EditText tileVersionEditText, tileAuthorNameEditText, tileBackupNameEditText, tileChangelogEditText;
    JSONObject backupFile;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        updateIflUi(this);
        updateIflLocale(this, false);
        setContentView(R.layout.ifl_at_export_backup);

        this.overridesManager = new OverridesManager(this);
        this.preferenceManager = new PreferenceManager(this);

        this.tileBackupName = findViewById(R.id.ifl_tile_export_backup_name);
        this.tileAuthorName = findViewById(R.id.ifl_tile_export_author_name);
        this.tileVersion = findViewById(R.id.ifl_tile_export_backup_version);
        this.tileChangelog = findViewById(R.id.ifl_tile_export_backup_changelog);
        this.exportButton = findViewById(R.id.ifl_button_exportbackup);

        tileVersionEditText = tileVersion.getEditTextView();
        tileAuthorNameEditText = tileAuthorName.getEditTextView();
        tileBackupNameEditText = tileBackupName.getEditTextView();
        tileChangelogEditText = tileChangelog.getEditTextView();

        tileVersionEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)});
        tileVersionEditText.setInputType(131073);
        tileVersionEditText.setInputType(InputType.TYPE_CLASS_TEXT);
        tileVersionEditText.setMaxLines(1);
        tileVersionEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);
        tileVersionEditText.setOnEditorActionListener((textView, actionId, keyEvent) -> {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                fixVersionNameString(tileVersionEditText);
            }
            return false;
        });

        tileVersionEditText.setOnFocusChangeListener((view, b) -> {
            if (!b) {
                fixVersionNameString(tileVersionEditText);
            }
        });

        tileAuthorNameEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(40)});
        tileAuthorNameEditText.setInputType(131073);
        tileAuthorNameEditText.setInputType(InputType.TYPE_CLASS_TEXT);
        tileAuthorNameEditText.setMaxLines(1);
        tileAuthorNameEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);

        tileBackupNameEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(40)});
        tileBackupNameEditText.setInputType(131073);
        tileBackupNameEditText.setInputType(InputType.TYPE_CLASS_TEXT);
        tileBackupNameEditText.setMaxLines(1);
        tileBackupNameEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);

        tileChangelogEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(2500)});
        tileChangelogEditText.setInputType(131073);
        tileChangelogEditText.setMaxLines(10);
        tileChangelogEditText.setOnEditorActionListener((textView, i, keyEvent) -> {
            if (i != 6 && (keyEvent.getAction() != 0 || keyEvent.getKeyCode() != 66)) {
                return false;
            }
            tileAuthorNameEditText.append("\n");
            return true;
        });

        exportButton.setOnClickListener(view -> {
            if (!tileAuthorNameEditText.getText().toString().isEmpty() && !tileBackupNameEditText.getText().toString().isEmpty() && !tileVersionEditText.getText().toString().isEmpty()) {


MANAGED_EXCEPTION(L_4, Task_TaskConstructorCore_m6B54AFE9106C1C96AC2B4560FCD65796A8D5525C_RuntimeMethod_var);
	}

IL_0028:
	{
		int32_t L_5 = ___creationOptions3;
		if (!((int32_t)((int32_t)L_5&(int32_t)2)))
		{
			goto IL_0048;
		}
	}
	{
		int32_t L_6 = ___internalOptions4;
		if (!((int32_t)((int32_t)L_6&(int32_t)((int32_t)2048))))
		{
			goto IL_0048;
		}
	}
	{
		String_t* L_7 = Environment_GetResourceString_m2C75C2AF268F01E2BF34AD1C2E1352CF4BA51AD9(_stringLiteral18134C3172E2C551F0F862780D5C8A01A31AECFF, /*hidden argument*/NULL);
		InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 * L_8 = (InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1 *)il2cpp_codegen_object_new(InvalidOperationException_t0530E734D823F78310CAFAFA424CA5164D93A1F1_il2cpp_TypeInfo_var);
		InvalidOperationException__ctor_m72027D5F1D513C25C05137E203EEED8FD8297706(L_8, L_7, /*hidden argument*/NULL);
		IL2CPP_RAISE_MANAGED_EXCEPTION(L_8, Task_TaskConstructorCore_m6B54AFE9106C1C96AC2B4560FCD65796A8D5525C_RuntimeMethod_var);
	}

IL_0048:
	{
		int32_t L_9 = ___creationOptions3;
		int32_t L_10 = ___internalOptions4;
		V_0 = ((int32_t)((int32_t)L_9|(int32_t)L_10));
		RuntimeObject * L_11 = __this->get_m_action_5();
		if (!L_11)
		{
			goto IL_0060;
		}
	}
	{
		int32_t L_12 = ___internalOptions4;
		if (!((int32_t)((int32_t)L_12&(int32_t)((int32_t)512))))
		{
			goto IL_0068;
		}
	}

IL_0060:
	{
		int32_t L_13 = V_0;
		V_0 = ((int32_t)((int32_t)L_13|(int32_t)((int32_t)33554432)));
	}

IL_0068:
	{
		int32_t L_14 = V_0;
		il2cpp_codegen_memory_barrier();
		__this->set_m_stateFlags_9(L_14);
		Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_15 = __this->get_m_parent_8();
		if (!L_15)
		{
			goto IL_0099;
		}
	}
	{
		int32_t L_16 = ___creationOptions3;
		if (!((int32_t)((int32_t)L_16&(int32_t)4)))
		{
			goto IL_0099;
		}
	}
	{
		Task_t1F48C203E163126EBC69ACCA679D1A462DEE9EB2 * L_17 = __this->get_m_parent_8();
		NullCheck(L_17);
		int32_t L_18 = Task_get_CreationOptions_m1013CF6F9F645BFA03F13F89DFA749ADABA541C8(L_17, /*hidden argument*/NULL);
		if (((int32_t)((int32_t)L_18&(int32_t)8)))
		{
			goto IL_0099;
		}
	}
	{


ring() { return \"XX\"; } } \n" +
			"	                                    ^^^^^^^^^^\n" +
			"The method toString() of type XX should be tagged with @Override since it actually overrides a superclass method\n" +
			"----------\n" +
			"4. WARNING in X.java (at line 42)\n" +
			"	class YY extends XX { public String toString() { return \"YY\"; } } \n" +
			"	                                    ^^^^^^^^^^\n" +
			"The method toString() of type YY should be tagged with @Override since it actually overrides a superclass method\n" +
			"----------\n" +
			"5. WARNING in X.java (at line 43)\n" +
			"	class ZZ extends YY { public String toString() { return \"ZZ\"; } } \n" +
			"	                                    ^^^^^^^^^^\n" +
			"The method toString() of type ZZ should be tagged with @Override since it actually overrides a superclass method\n" +
			"----------\n");
	}
	// cannot allocate parameterized type with wildcards
	public void test0398() {
		this.runNegativeTest(
			new String[] {
				"X.java",
				"public class X <T> {\n" +
				"    X(){\n" +
				"    }\n" +
				"    public static void main(String[] args) {\n" +
				"		new X<?>();\n" +
				"		new X<? extends String>();\n" +
				"		new X<?>(){};\n" +
				"		new X<? extends String>(){};\n" +
				"	}\n" +
				"}\n"	,
			},
			"----------\n" +
			"1. ERROR in X.java (at line 5)\n" +
			"	new X<?>();\n" +
			"	    ^\n" +
			"Cannot instantiate the type X<?>\n" +
			"----------\n" +
			"2. ERROR in X.java (at line 6)\n" +
			"	new X<? extends String>();\n" +
			"	    ^\n" +
			"Cannot instantiate the type X<? extends String>\n" +
			"----------\n" +
			"3. ERROR in X.java (at line 7)\n" +
			"	new X<?>(){};\n" +
			"	    ^\n" +
			"The type new X(){} cannot extend or implement X<?>. A supertype may not specify any wildcard\n" +
			"----------\n" +
			"4. ERROR in X.java (at line 8)\n" +
			"	new X<? extends String>(){};\n" +
			"	    ^\n" +
			"The type new X(){} cannot extend or implement X<? extends String>. A supertype may not specify any wildcard\n" +
			"----------\n");
	}

	public void test0399() {
		this.runNegativeTest(
			new String[] {
				"X.java",
				"public class X <T> {\n" +
				"    T t;\n" +
				"    X(T t){\n" +
				"        this.t = t;\n" +
				"    }\n" +
				"    public static void main(String[] args) {\n" +
				"		X<? extends AX> x = new X<AX<Math>>(new AX<String>());\n" +
				"	}\n" +
				"}\n" +
				"\n" +
				"class AX<P> {\n" +
				"    P foo() { return null; }\n" +
				"}\n",
			},
			"----------\n" +
			"1. WARNING in X.java (at line 7)\n" +
			"	X<? extends AX> x = new X<AX<Math>>(new AX<String>());\n" +
			"	            ^^\n" +


				if (ptb) {
					var bltbdat = blt_info.bltbdat = (SAER_Memory_chipData[ptb] << 8) | SAER_Memory_chipData[ptb + 1]; ptb -= 2;
					srcb = (((bltbdat << 16) | prevb) >>> 0) >>> b.blitdownbshift;
					prevb = bltbdat;
				}
				if (pta) { bltadat = blt_info.bltadat = (SAER_Memory_chipData[pta] << 8) | SAER_Memory_chipData[pta + 1]; pta -= 2; } else { bltadat = blt_info.bltadat; }
				bltadat &= blit_masktable[i];
				srca = (((bltadat << 16) | preva) >>> 0) >>> b.blitdownashift;
				preva = bltadat;
				if (dstp) {
					SAER_Memory_chipData[dstp] = dstd >> 8;
					SAER_Memory_chipData[dstp + 1] = dstd & 0xff;
				}
				dstd = (srcc & (srca | srcb)) & 0xffff;
				totald |= dstd;
				if (ptd) { dstp = ptd; ptd -= 2; }
			}
			if (pta) pta -= b.bltamod;
			if (ptb) ptb -= b.bltbmod;
			if (ptc) ptc -= b.bltcmod;
			if (ptd) ptd -= b.bltdmod;
		}
		b.bltbhold = srcb;
		b.bltcdat = srcc;
		if (dstp) {
			SAER_Memory_chipData[dstp] = dstd >> 8;
			SAER_Memory_chipData[dstp + 1] = dstd & 0xff;
		}
		if (totald != 0) b.blitzero = 0;
	}

	function blitdofast_aa(pta, ptb, ptc, ptd, b) {
		var i,j;
		var totald = 0;
		var srcc = b.bltcdat;
		var dstd = 0;
		var dstp = 0;
		for (j = 0; j < b.vblitsize; j++) {
			for (i = 0; i < b.hblitsize; i++) {
				var bltadat, srca;
				if (ptc) { srcc = (SAER_Memory_chipData[ptc] << 8) | SAER_Memory_chipData[ptc + 1]; ptc += 2; }
				if (dstp) {
					SAER_Memory_chipData[dstp] = dstd >> 8;
					SAER_Memory_chipData[dstp + 1] = dstd & 0xff;
				}
				dstd = srcc & 0xffff;
				totald |= dstd;
				if (ptd) { dstp = ptd; ptd += 2; }
			}
			if (ptc) ptc += b.bltcmod;
			if (ptd) ptd += b.bltdmod;
		}
		b.bltcdat = srcc;
		if (dstp) {
			SAER_Memory_chipData[dstp] = dstd >> 8;
			SAER_Memory_chipData[dstp + 1] = dstd & 0xff;
		}
		if (totald != 0) b.blitzero = 0;
	}

	function blitdofast_desc_aa(pta, ptb, ptc, ptd, b) {
		var totald = 0;
		var i,j;
		var srcc = b.bltcdat;
		var dstd = 0;
		var dstp = 0;
		for (j = 0; j < b.vblitsize; j++) {
			for (i = 0; i < b.hblitsize; i++) {
				var bltadat, srca;
				if (ptc) { srcc =


;

   auto foldPointer = [](pdk::uintptr v) {
      if (sizeof(pdk::uintptr) == sizeof(pdk::puint32)) {
         // For 32-bit systems, we simply return the pointer.
         return pdk::puint32(v);
      } else {
         // For 64-bit systems, we try to return the variable part of the
         // pointer. On current x86-64 and AArch64, the top 17 bits are
         // architecturally required to be the same, but in reality the top
         // 24 bits on Linux are likely to be the same for all processes.
         return pdk::puint32(v >> (32 - 24));
      }
   };

   PDK_ASSERT(left);

   *end++ = foldPointer(pdk::uintptr(&seed));          // 1: variable in this library/executable's .data
   *end++ = foldPointer(pdk::uintptr(&scratch));       // 2: variable in the stack
   *end++ = foldPointer(pdk::uintptr(&errno));         // 3: veriable either in libc or thread-specific
   *end++ = foldPointer(pdk::uintptr(reinterpret_cast<void*>(strerror)));   // 4: function in libc (and unlikely to be a macro)

   pdk::puint64 nsecs = DeadlineTimer::getCurrent(pdk::TimerType::PreciseTimer).getDeadline();
   *end++ = pdk::puint32(nsecs);    // 5

   if (pdk::puint32 v = sg_seed.load()) {
      *end++ = v; // 6
   }
#if PDK_CONFIG(getauxval)
   // works on Linux -- all modern libc have getauxval
#  ifdef AT_RANDOM
   // ELF's auxv AT_RANDOM has 16 random bytes
   // (other ELF-based systems don't seem to have AT_RANDOM)
   ulong auxvSeed = getauxval(AT_RANDOM);
   if (auxvSeed) {
      memcpy(end, reinterpret_cast<void *>(auxvSeed), 16);
      end += 4;   // 7 to 10
   }
#  endif

   // Both AT_BASE and AT_SYSINFO_EHDR have some randomness in them due to the
   // system's ASLR, even if many bits are the same. They also have randomness
   // between them.
#  ifdef AT_BASE
   // present at least on the BSDs too, indicates the address of the loader
   ulong base = getauxval(AT_BASE);
   if (base)
      *end++ = foldPointer(base); // 11
#  endif
#  ifdef AT_SYSINFO_EHDR
   // seems to be Linux-only, indicates the global page of the sysinfo
   ulong sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
   if (sysinfo_ehdr)
      *end++ = foldPointer(sysinfo_ehdr); // 12
#  endif
#endif

   PDK_ASSERT(end <= std::end(scratch));

   // this is highly inefficient, we should save the generator across calls...
   std::seed_seq sseq(scratch, end);
   std::mt19937 generator(sseq);
   std::generate(ptr, ptr + left, generator);

   fallback_update_seed(*ptr);
}
#endif
} // anonymous namespace

using internal::RandomGeneratorControl;
using internal::RNGType;

PDK_NEVER_INLINE void RandomGenerator::SystemGenerator::generate(pdk::puint32 *begin, pdk::puint32 *end)
noexcept(FillBufferNoexcept)
{
   pdk::puint32 *buffer = begin;
   pdk::sizetype count = end - begin;

   if (PDK_UNLIKELY(uint(internal::sg_randomdeviceControl) & pdk::as_integer<RandomGeneratorControl>(RandomGeneratorControl::SetRandomData))) {
      uint value = uint(internal::sg_randomdeviceControl) & pdk::as_integer<RandomGeneratorControl>(RandomGeneratorControl::RandomDataMask);
      std::fill_n(buffer, count, value);
      return;
   }

   pdk::sizetype filled = 0;
   if (internal::pdk_has_hwrng() && (uint(internal::sg_randomdeviceControl) &
                                     pdk


">泛型方法

有界类型形参

泛型方法和有界类型形参

泛型，继承和子类型

类型推断

通配符

上界通配符

无界通配符

下界通配符

通配符和子类型

通配符捕获和辅助方法

通配符使用指南

类型擦除

删除泛型类型

泛型方法的擦除

类型擦除和桥接方法的影响

不可具体化的类型

对泛型的限制

问题和练习

        Trail: Learning the Java Language

Lesson: Generics (Updated)

Section: Wildcards

                主页>学习 Java 语言>泛型(更新)

                « 上一页 • 路径 • 下一页 »

<p style="background-color: rgb(247, 248, 249); border-width: 1px; padding: 10px; font-style: italic; border-style: solid; border-color: rgb(64, 74, 91)


 dispositif", () => {
        page.clickClasse(0, "mat-option-text");
    });
    it('Complement intitule -> Must be able to fill the field', () => {
        page.enterChamps(1, "0001", "mat-input-wrapper mat-form-field-wrapper");
    });
    it("Rechercher dispositif -> Must be able to click bouton rechercher", () => {
        page.clickClasse(0, "mat-raised-button");
    });
    it("Rechercher dispositif -> Must be able to click an element from the list", () => {
        page.clickClasse(33, "ng-star-inserted");
    });
    it("Dossiers rataché -> Must be able to click Dossiers rataché", () => {
        page.clickClasse(1, "mat-tab-label-content");
        sleep(5000);
    });
    it("Dossiers rataché -> Must be able to click un element de la liste", () => {
        page.clickClasse(0, "nounderline ng-star-inserted");
        sleep(10000);
    });

    // Second batch of tests
    it('Must be able to click on the first button -> Creer dispositif', () => {
        page.clickAttribut(0, 'span[ng-reflect-translate]');
    });
    it('Must be able to click on the arrow of -> Type dispositif', () => {
        page.clickClasse(0, 'mat-select-arrow mat-select-arrow-down');
    });
    it('Must be able to choose on the list -> Type dispositif', () => {
        page.clickClasse(9, 'mat-option-text');
    });

    it('Must be able to click on the arrow of -> Responsable Technique', () => {
        page.clickClasse(1, 'mat-select-arrow mat-select-arrow-down');
    });
    it('Must be able to choose on the list -> Responsable Technique', () => {
        page.clickClasse(0, 'mat-option-text');
    });
    it('Must be able to click on the green button and go on the other page', () => {
        page.clickClasse(1, 'mat-raised-button');
        sleep(10000);
    });
    it('Get -> nom dossier', () => {
        //page.getClasse("ng-star-inserted").getText().then(function(texte){console.log(page.getFromElementToAnother(texte,0,99));});
        page.getOneElementByClasse(0, "ng-star-inserted").getText().then(function (texte) { console.log(numeroDossier = (page.getWordInList(1, texte, " "))); });
    });
    it('Must be able to click on the arrow of -> Thematique', () => {
        page.clickClasse(0, 'mat-select-arrow-wrapper');
    });
    it('Must be able to choose several elements on the list -> Thematique', () => {
        page.clickClasse(0, 'mat-option-text');
        page.clickClasse(3, 'mat-option-text');
        page.clickClasse(5, 'mat-option-text');
        sleep(20);
        page.sendTab();
    });
    it('Must be able to fill the field -> Annee previsionnelle debut', () => {
        page.enterChamps(1, "1994", 'mat-input-element mat-form-field-autofill-control mat-input-autofill-monitored ng-untouched ng-pristine ng-valid');
    });
    it('Must be able to fill the field -> Annee previsionnelle fin', () => {
        page.enterChamps(1, "1995", 'mat-input-element mat-form-field-autofill-control mat-input-autofill-monitored ng-untouched ng-pristine ng-valid');
    });
    it('Must be able to click on the arrow of -> Instance', () => {
        page.clickClasse(0, 'mat-select-arrow-wrapper-session');
    });


 baseUrl, "config.xml" ).toString();
			String [] args = {fullUrl,
				  "--config:controller.outputDirectory", utils.getOutputDirectory(),
				  "--config:controller.lastIteration", "1"
			} ;
			RunMatsim.main( args ) ;
			{
				Population expected = PopulationUtils.createPopulation( ConfigUtils.createConfig() ) ;
				PopulationUtils.readPopulation( expected, utils.getInputDirectory() + "/output_plans.xml.gz" );

				Population actual = PopulationUtils.createPopulation( ConfigUtils.createConfig() ) ;
				PopulationUtils.readPopulation( actual, utils.getOutputDirectory() + "/output_plans.xml.gz" );

				for ( Id<Person> personId : expected.getPersons().keySet()) {
					double scoreReference = expected.getPersons().get(personId).getSelectedPlan().getScore();
					double scoreCurrent = actual.getPersons().get(personId).getSelectedPlan().getScore();
					assertEquals(scoreReference, scoreCurrent, 0.001, "Scores of person=" + personId + " are different");
				}

//				boolean result = PopulationUtils.comparePopulations( expected, actual );
//				Assert.assertTrue( result );
				// (There are small differences in the score.  Seems that there were some floating point changes in Java 17, and the
				// differ by JDK (e.g. oracle vs. ...).   So not testing this any more for the time being.  kai, jul'23
			}
			{
				String expected = utils.getInputDirectory() + "/output_events.xml.gz" ;
				String actual = utils.getOutputDirectory() + "/output_events.xml.gz" ;
				ComparisonResult result = EventsUtils.compareEventsFiles( expected, actual );
				assertEquals( ComparisonResult.FILES_ARE_EQUAL, result );
			}

		} catch ( Exception ee ) {
			LogManager.getLogger(this.getClass() ).fatal("there was an exception: \n" + ee ) ;

			// if one catches an exception, then one needs to explicitly fail the test:
			fail();
		}
	}
}
package org.matsim.codeexamples.integration;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Scenario;
import org.matsim.core.config.Config;
import org.matsim.core.controler.Controler;
import org.matsim.core.controler.OutputDirectoryHierarchy;
import org.matsim.testcases.MatsimTestUtils;

public class RunMultipleModesExampleTest{
	@RegisterExtension
	public MatsimTestUtils utils = new MatsimTestUtils();

	@Test
	void testRun() {
		try{
			Config config = RunMultipleModesExample.prepareConfig() ;

			config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists );
			config.controller().setOutputDirectory( utils.getOutputDirectory() );
			config.controller().setLastIteration( 2 );

			Scenario scenario = RunMultipleModesExample.prepareScenario( config );

			Controler controler = RunMultipleModesExample.prepareControler( scenario );

			controler.run() ;
		} catch ( Exception ee ) {
			ee.printStackTrace();
			Assertions.fail("something went wrong; see stack trace" ) ;
		}
	}

}
/* *********************************************************************** *
 * project: org.matsim.*
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 * copyright       : (C) 2015 by the members listed in the COPYING,        *
 *                   LICENSE and WARRANTY file.                            *
 * email           : info at matsim dot org                                *
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as pub


ummary-title a:visited,.sqs-block-summary-v2 .summary-heading a:visited{color:#666}.sqs-block-summary-v2 .summary-title a:hover,.sqs-block-summary-v2 .summary-heading a:hover,.sqs-block-summary-v2 .summary-title a:link:hover,.sqs-block-summary-v2 .summary-heading a:link:hover,.sqs-block-summary-v2 .summary-title a:visited:hover,.sqs-block-summary-v2 .summary-heading a:visited:hover{color:#85baff}.sqs-block-summary-v2 a,.sqs-block-summary-v2 a:link,.sqs-block-summary-v2 a:visited{color:#005eff}.sqs-block-summary-v2 a:hover,.sqs-block-summary-v2 a:link:hover,.sqs-block-summary-v2 a:visited:hover{color:#85baff}.sqs-block-summary-v2 .summary-metadata-item{color:rgba(0,0,0,.7000000000000001)}.sqs-block-summary-v2 .summary-metadata-item a,.sqs-block-summary-v2 .summary-metadata-item a:link,.sqs-block-summary-v2 .summary-metadata-item a:visited{color:rgba(0,0,0,.7000000000000001)}.sqs-block-summary-v2 .summary-metadata-item a:hover,.sqs-block-summary-v2 .summary-metadata-item a:link:hover,.sqs-block-summary-v2 .summary-metadata-item a:visited:hover{color:#85baff}.hidden{display:none;visibility:hidden}html.touch #galleryWrapper .sqs-gallery-design-stacked-slide{left:999em}html.touch #galleryWrapper .sqs-gallery-design-stacked-slide.sqs-active-slide{left:0}@media only screen and (min-device-width:641px){html.touch #simpleControls{display:block !important}}@media only screen and (max-width:750px){.gallery-controls{display:none !important}#simpleControls{display:none !important}.layout-style-right.site-title h1.logo{margin-right:0}#logo{float:none !important}h1.logo{text-align:center !important;display:block !important;letter-spacing:0 !important;margin:0 !important}h1.logo.no-nav-items{margin-top:25px !important}.logo-image .logo{height:50px}.logo-image .logo img{display:inline}.logo-subtitle{text-align:center}.sqs-layout [class*=sqs-col]{float:none !important;width:auto !important}.sqs-layout .spacer-block{display:none}.sqs-layout .sqs-row .sqs-block:first-child{padding-top:17px !important}.sqs-layout .sqs-row .sqs-block:last-child{padding-bottom:17px !important}.sqs-layout .sqs-row+.sqs-row,.sqs-layout .sqs-row+.sqs-block{margin-top:0 !important}.sqs-gallery-design-grid-slide{width:50% !important;clear:none !important}#canvas{margin:0 auto;padding:20px}#slideshowWrapper{margin:0 !important}#galleryWrapper{position:static}.gallery-controls{display:none !important}#slideshow img{width:100%}#slideshow .slide{margin-bottom:20px;position:static !important;opacity:1 !important;height:auto !important}#slideshow .slide img{position:static !important}#projectThumbs>.wrapper{width:103%;margin-left:-3%;margin-top:-3%}#projectThumbs .project{float:left;margin-left:2.912621359223301%;margin-top:3%;width:47.0873786407767%;cursor:pointer}#projectThumbs .project .project-image{opacity:1;-webkit-transition:initial}#projectThumbs .project .project-image{background:#


);
            while(map.size() > k){
                map.put(nums[i], map.get(nums[i]) - 1);
                if(map.get(nums[i]) == 0){
                    map.remove(nums[i]);
                }
                i++;
            }
            sum += ((j - i) + 1);
        }
        return sum;
    }
    public static int subarraysWithKDistinct(int[] nums, int k) {
        return atMost(nums, k) - atMost(nums, k - 1);
    }
    public static void main(String[] args) {
        int[] nums = {1,2,1,2,3};
        int k = 2;
        System.out.println(subarraysWithKDistinct(nums, k));
    }
}
import java.util.Arrays;

public class Rearrange_Array_Elements_by_Sign_Positive_Negative {
    public static int[] rearrangeArray(int[] nums) {
        /*
         * Brute Force Solution: Time Complexity: O(N) & Space complexity: O(N)
         * int[] ans = new int[nums.length];
           int k = 0;
           for(int i = 0; i < nums.length; i++){
               if(nums[i] > 0){
                   ans[k] = nums[i];
                   k+=2;
               }
           }
           int m = 1;
           for(int i = 0; i < nums.length; i++){
               if(nums[i] < 0){
                   ans[m] = nums[i];
                   m+=2;
               }
           }
           return ans;
        */

        // Solution 2: Using one loop: Time Complexity: O(N) & Space complexity: O(N)
        int[] ans = new int[nums.length];
        int k = 0;
        int j = 1;
        for(int i = 0; i < nums.length; i++){
            if(nums[i] > 0){
                ans[k] = nums[i];
                k+=2;
            }
            else{
                ans[j] = nums[i];
                j+=2;
            }
        }
        return ans;
    }
    public static void main(String[] args) {
        int[] nums = {3,1,-2,-5,2,-4};
        int[] ans = rearrangeArray(nums);
        System.out.println(Arrays.toString(ans));
    }
}
/*
 * Count Reverse Pairs
   Problem Statement: Given an array of numbers, you need to return the count of reverse pairs. Reverse Pairs are those pairs where i<j and arr[i]>2*arr[j].

   Examples:

   Example 1:
   Input: N = 5, array[] = {1,3,2,3,1)
   Output: 2
   Explanation: The pairs are (3, 1) and (3, 1) as from both the pairs the condition arr[i] > 2*arr[j] is satisfied.

   Example 2:
   Input: N = 4, array[] = {3,2,1,4}
   Output: 1
   Explaination: There is only 1 pair  ( 3 , 1 ) that satisfy the condition arr[i] > 2*arr[j]
*/

import java.util.ArrayList;

public class Reverse_Pairs {
    public static int merge(int[] nums, int low, int mid, int high) {
        int cnt = 0;
        int j = mid + 1;
        for(int i = low;i<=mid;i++) {
            while(j<=high && nums[i] > (2 * (long) nums[j])) {
                j++;
            }
            cnt += (j - (mid+1));
        }

        ArrayList<Integer> temp = new ArrayList<>();
        int left = low, right = mid+1;
        while(left <= mid && right<=high) {
            if(nums[left]<=nums[right]) {
                temp.add(nums[left++]);
            }
            else {
                temp.add(nums[right++]);
            }
        }

        while(left<=mid) {
            temp.add(nums[left+


extInputType.datetime,
              decoration: InputDecoration(
                  labelText: "Digite um valor: "
              ),
              style: TextStyle(
                fontSize: 30,
                color: Colors.red,
              ),
              controller: _textEditingController, //controlador do nosso campo de texto
            ),
          ),
          ElevatedButton(
            child: Text("Salvar"),
            style: ElevatedButton.styleFrom(
              primary: Colors.green,
            ),
            onPressed: (){
              print("Texto digitado: " + _textEditingController.text);
            },
          ),
        ],
      ),
    );
  }
}
import 'package:flutter/material.dart';
class EntradaSlider extends StatefulWidget {
  @override
  _EntradaSliderState createState() => _EntradaSliderState();
}

class _EntradaSliderState extends State<EntradaSlider> {
  double valor = 50;
  String label = "seleção";
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Satisfação dos clientes"),
      ),
      body: Container(
        padding: EdgeInsets.all(40),
        child: Column(
          children: <Widget>[
            Slider(
                value: valor, //definir o valor inicial
                min:0,
                max:100,
                label: label, //label dinamico
                divisions: 10, //define as divisoes entre o minimo e o maximo
                activeColor: Colors.red,
                inactiveColor: Colors.black12,
                onChanged: (double novoValor){
                  setState(() {
                    valor = novoValor;
                    label = "seleção: " + novoValor.toString();
                  });
                  // print("Valor selecionado: "+valor.toString());
                }
            ),
            ElevatedButton(
                child: Text("Salvar",
                  style: TextStyle(
                      fontSize: 20
                  ),
                ),
                onPressed: () {
                  print("Valor salvo: "+valor.toString());
                }
            ),

          ],
        ),
      ),
    );
  }
}
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:navegacao/main.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(Inicio());

    // Verify that our counter starts at 0.
    expect(find.text('0'), findsOneWidget);
    expect(find.text('1'), findsNothing);

    // Tap the '+' icon and trigger a frame.
    await tester.tap(find.byIcon(Icons.add));
    await tester.pump();

    // Verify that our counter has incremented.
    expect(find.text('0'), findsNothing);
    expect(find.text('1'), findsOneWidget);
  });
}
import 'package:flutter/material.dart';
import 'package:sqflite/sqflite.dart';
import 'package:path/path.dart';

void main() => runApp(
    MaterialApp(
      home: Home(),
    )
);

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {


    # Announce any keys defined only for target language.
        if target_defs:
          extra_keys = [key for key in target_defs if key not in synonym_defs]
          synonym_keys = [key for key in target_defs if key in synonym_defs]
          if not args.quiet:
            if extra_keys:
              print('These extra keys appeared in {0}: {1}'.format(
                  filename, ', '.join(extra_keys)))
            if synonym_keys:
              print('These synonym keys appeared in {0}: {1}'.format(
                  filename, ', '.join(synonym_keys)))

        outfile.write(synonym_text)

      if not args.quiet:
        print('Created {0}.'.format(outname))

if __name__ == '__main__':
  main()


/*
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

/*
 * NOTE: this file was auto generated by the mkerr.pl script: any changes
 * made to it will be overwritten when the script next updates this file,
 * only reason strings will be preserved.
 */

#include <stdio.h>
#include <openssl/err.h>
#include "e_chil_err.h"

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

# define ERR_FUNC(func) ERR_PACK(0,func,0)
# define ERR_REASON(reason) ERR_PACK(0,0,reason)

static ERR_STRING_DATA HWCRHK_str_functs[] = {
    {ERR_FUNC(HWCRHK_F_HWCRHK_CTRL), "HWCRHK_CTRL"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_FINISH), "HWCRHK_FINISH"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_GET_PASS), "HWCRHK_GET_PASS"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_INIT), "HWCRHK_INIT"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_INSERT_CARD), "HWCRHK_INSERT_CARD"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_LOAD_PRIVKEY), "HWCRHK_LOAD_PRIVKEY"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_LOAD_PUBKEY), "HWCRHK_LOAD_PUBKEY"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_MOD_EXP), "HWCRHK_MOD_EXP"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_RAND_BYTES), "HWCRHK_RAND_BYTES"},
    {ERR_FUNC(HWCRHK_F_HWCRHK_RSA_MOD_EXP), "HWCRHK_RSA_MOD_EXP"},
    {0, NULL}
};

static ERR_STRING_DATA HWCRHK_str_reasons[] = {
    {ERR_REASON(HWCRHK_R_ALREADY_LOADED), "already loaded"},
    {ERR_REASON(HWCRHK_R_BIO_WAS_FREED), "bio was freed"},
    {ERR_REASON(HWCRHK_R_CHIL_ERROR), "chil error"},
    {ERR_REASON(HWCRHK_R_CTRL_COMMAND_NOT_IMPLEMENTED),
     "ctrl command not implemented"},
    {ERR_REASON(HWCRHK_R_DSO_FAILURE), "dso failure"},
    {ERR_REASON(HWCRHK_R_MISSING_KEY_COMPONENTS), "missing key components"},
    {ERR_REASON(HWCRHK_R_NOT_INITIALISED), "not initialised"},
    {ERR_REASON(HWCRHK_R_NOT_LOADED), "not loaded"},
    {ERR_REASON(HWCRHK_R_NO_CALLBACK), "no callback"},
    {ERR_REASON(HWCRHK_R_NO_KEY), "no key"},
    {ERR_REASON(HWCRHK_R_PRIVATE_KEY_ALGORITHMS_DISABLED),
     "private key algorithms disabled"},
    {ERR_REASON(HWCRHK_R_REQUEST_FAILED), "request failed"},
    {ERR_REASON(HWCRHK_R_REQUEST_FALLBACK), "request fallback"},
    {ERR_REASON(HWCRHK_R_UNIT_FAILURE), "unit failure"},
    {0, NULL}
};

#endif

#ifdef HWCRHK_LIB_NAME
static ERR_STRING_DATA HWCRHK_lib_name[] = {
    {0, HWCRHK_LIB_NAME},
    {0, NULL}
};
#endif

static int HWCRHK_lib_error_code = 0;
static int HWCRHK_error_init = 1;

static void ERR_load_HWCRHK_strings(void)
{
    if (HWCRHK_lib_error_code == 0)
        HWCRHK_lib_error_code = ERR_get_next_error_library();

    if (HWCRHK_error_init) {
        HWCRHK_error_init = 0;
#ifndef OPENSSL_NO_ERR
        ERR_load_strings(HWCRHK_lib_error_code, HWCRHK_str_functs);
        ERR_load_strings(HWCRHK_lib_error_code, HWCRHK_str_reasons);
#endif

#ifdef HWCRHK_LIB_NAME
        HWCRHK_lib_name->error = ERR_PACK(HWCRHK_lib_error_code, 0, 0);
        ERR_load_strings(0, HWCRHK_lib_name);
#endif
    }
}

static void ERR_unload_HWCRHK_strings(void)
{
    if (HWCRHK_error_init == 0) {
#ifndef OPENSSL_NO_ERR
        ERR_unload_strings(HWCRHK_lib_error_code, HWCRHK_str_functs);
        ERR_unload_strings(HWCRHK_lib_error_code, HWCRHK_str_reasons);
#endif

#ifdef HWCRHK_LIB_NAME
        ERR_unload_strings(0, HWCRHK_lib_name);
#endif
        HWCRHK_error_init = 1;
    }
}

static void ERR_HWCRHK_error(int function, int reason, char *file, int line)
{
    if (HWCRHK_lib_error_code == 0)
        HWCRHK_lib_error_code = ERR_get_next_error_library();
    ERR_PUT_error(HWCRHK_lib_error_code, function, reason, file, line);
}


/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8"?><svg enable-background="new 0 0 129 129" version="1.1" viewBox="0 0 129 129" xmlns="http://www.w3.org/2000/svg"><path d="m7.6 121.4c0.8 0.8 1.8 1.2 2.9 1.2s2.1-0.4 2.9-1.2l51.1-51.1 51.1 51.1c0.8 0.8 1.8 1.2 2.9 1.2 1 0 2.1-0.4 2.9-1.2 1.6-1.6 1.6-4.2 0-5.8l-51.1-51.1 51.1-51.1c1.6-1.6 1.6-4.2 0-5.8s-4.2-1.6-5.8 0l-51.1 51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8 0s-1.6 4.2 0 5.8l51.1 51.1-51.1 51.1c-1.6 1.6-1.6 4.2 0 5.8z" fill="%23abbac4"/></svg>');
  margin: 12px 6px 12px 6px;
  background: $gray-5;
}

.commento-option-collapse {
  height: 14px;
  width: 14px;
  @include mask-image('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8"?><svg enable-background="new 0 0 42 42" version="1.1" viewBox="0 0 42 42" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><polygon points="42 20 0 20 0 22 20 22 22 22 42 22" fill="%231e2127"/></svg>');
  margin: 12px 6px 12px 6px;
  background: $gray-7;
}

.commento-option-uncollapse {
  height: 14px;
  width: 14px;
  @include mask-image('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8"?><svg enable-background="new 0 0 42 42" version="1.1" viewBox="0 0 42 42" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><polygon points="42 20 22 20 22 0 20 0 20 20 0 20 0 22 20 22 20 42 22 42 22 22 42 22" fill="%231e2127"/></svg>');
  margin: 12px 6px 12px 6px;
  background: $gray-7;
}

.commento-option-upvote,
.commento-option-downvote {
  height: 14px;
  width: 14px;
  @include mask-image('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8"?><svg enable-background="new 0 0 284.929 284.929" version="1.1" viewBox="0 0 284.93 284.93" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">	<path d="m282.08 195.28-133.05-133.04c-1.901-1.903-4.088-2.856-6.562-2.856s-4.665 0.953-6.567 2.856l-133.04 133.04c-1.906 1.906-2.856 4.093-2.856 6.568 0 2.474 0.953 4.664 2.856 6.566l14.272 14.271c1.903 1.903 4.093 2.854 6.567 2.854s4.664-0.951 6.567-2.854l112.2-112.2 112.21 112.21c1.902 1.903 4.093 2.848 6.563 2.848 2.478 0 4.668-0.951 6.57-2.848l14.274-14.277c1.902-1.902 2.847-4.093 2.847-6.566 1e-3 -2.476-0.944-


mes.GetValue).Data;
                if (pusherData.Count > 0)
                {
                    return;
                }
            }

            if (_gizmoContainer != null)
            {
                _gizmoContainer.CurrentGizmoType = _currentGizmoType;
            }

            if (Inputs.ContainsKey(InputNames.SelectionContainerPipe))
            {
                var selectionContainer =
                    Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetContainer).Get
                        <SelectionContainer>();

                foreach (var editingTool in _editingTools)
                {
                    editingTool.SetViewInfo(_viewInfo, ActionsGraph);
                    editingTool.SetEditor(selectionContainer, ActionsGraph);
                    if (selectionContainer.CurrentSelectionMode == TopAbsShapeEnum.TopAbs_FACE)
                        break;
                }
            }
        }

        private void UpdateViewInfo(DataPackage dataPackage)
        {
            _viewInfo = dataPackage.Get<ViewInfo>();
            foreach (var editingTool in _editingTools)
                editingTool.SetViewInfo(_viewInfo, ActionsGraph);
        }

        private void SetupEditingTools()
        {
            _shapeEditingContainer = new EditingContainer();
            _gizmoContainer = new GizmoContainer();
            _editingTools.Clear();
            _editingTools.Add(_shapeEditingContainer);
            _editingTools.Add(_gizmoContainer);
            _editingTools.Add(new FloatingToolbarEditingTool());
        }

        private void Mouse3DEventHandler(DataPackage data)
        {
            _shapeEditingContainer.Mouse3DEventHandler(data.Get<Mouse3DPosition>());
            _gizmoContainer.Mouse3DEventHandler(data.Get<Mouse3DPosition>());
            var selectionContainer =
                Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetContainer).Get
                    <SelectionContainer>();
            if(selectionContainer.Entities.Count == 1 && data.Get<Mouse3DPosition>().Clicks == 2 )
            {
                if(FunctionNames.GetSketchShapes().ToList().Contains(selectionContainer.Entities[0].Node.Get<ShapeFunctionsInterface.Functions.FunctionInterpreter>().Name))
                    ActionsGraph.SwitchAction(ModifierNames.StartSketch);
            }
        }
    }
}


 "./ast.js";
import { Env, TypeConstructor } from "./domain.js";

export type SubRes = [SubstanceEnv, Env];
export type LabelMap = im.Map<string, LabelValue>;
export interface SubstanceEnv {
  exprEqualities: [SubExpr<A>, SubExpr<A>][];
  // predEqualities is not used; the original proposal was to allow equivalent
  // predicates; it was left in here in case we decide to revive it in the
  // future
  predEqualities: [ApplyPredicate<A>, ApplyPredicate<A>][];
  bindings: im.Map<string, SubExpr<A>>;
  labels: LabelMap;
  ast: CompiledSubProg<A>;
}

//#region Substance AST

export type SubProg<T> = ASTNode<T> & {
  tag: "SubProg";
  statements: Stmt<T>[];
};

export type Stmt<T> = SubStmt<T> | StmtSet<T>;

export type SubStmt<T> =
  | Decl<T>
  | DeclList<T>
  | Bind<T>
  | DeclBind<T>
  | EqualExprs<T>
  | EqualPredicates<T>
  | ApplyPredicate<T>
  | LabelDecl<T>
  | AutoLabel<T>
  | NoLabel<T>;

// DeclList compiles into two Decl
// DeclBind compiles into Decl and Bind
export type AggregateSubStmt<T> = DeclList<T> | DeclBind<T>;
export type CompiledSubStmt<T> = Exclude<SubStmt<T>, AggregateSubStmt<T>>;

export type CompiledSubProg<T> = SubProg<T> & {
  statements: CompiledSubStmt<T>[];
};

// An application of relation
// A relation is a predicate or a binding.
export type ApplyRel<T> = ApplyPredicate<T> | Bind<T>;

export interface LabelValue {
  value: string;
  type: LabelType;
}

export type LabelDecl<T> = ASTNode<T> & {
  tag: "LabelDecl";
  variable: Identifier<T>;
  label: StringLit<T>;
  labelType: LabelType;
};

export type LabelType = "MathLabel" | "TextLabel" | "NoLabel";
export type AutoLabel<T> = ASTNode<T> & {
  tag: "AutoLabel";
  option: LabelOption<T>;
};

export type LabelOption<T> = DefaultLabels<T> | LabelIDs<T>;

export type DefaultLabels<T> = ASTNode<T> & {
  tag: "DefaultLabels";
};
export type LabelIDs<T> = ASTNode<T> & {
  tag: "LabelIDs";
  variables: Identifier<T>[];
};

export type NoLabel<T> = ASTNode<T> & {
  tag: "NoLabel";
  args: Identifier<T>[];
};

export type Decl<T> = ASTNode<T> & {
  tag: "Decl";
  type: TypeConsApp<T>;
  name: Identifier<T>;
};

export type DeclList<T> = ASTNode<T> & {
  tag: "DeclList";
  type: TypeConsApp<T>;
  names: Identifier<T>[];
};

type TypeConsAppArgs<T> = {
  args: TypeConsApp<T>[];
};
export type TypeConsApp<T> = Omit<
  TypeConstructor<T>,
  keyof TypeConsAppArgs<T>
> &
  TypeConsAppArgs<T>;

export type Bind<T> = ASTNode<T> & {
  tag: "Bind";
  variable: Identifier<T>;
  expr: SubExpr<T>;
};

export type DeclBind<T> = ASTNode<T> & {
  tag: "DeclBind";
  type: TypeConsApp<T>;
  variable: Identifier<T>;
  expr: SubExpr<T>;
};

export type SubE


}

 private:
  const Options options_;
  const std::string black_name_;
  const std::string white_name_;
  bool game_over_ = false;
  GameOverReason game_over_reason_;
  float result_;
  std::string result_string_;
  std::string comment_;
  std::vector<std::unique_ptr<Move>> moves_;
};

template <typename T>
void Game::GetPositionHistory(int move, int num_moves, T* history) const {
  history->clear();
  MG_CHECK(move >= 0);
  MG_CHECK(move < static_cast<int>(moves_.size()));
  for (int i = 0; i < num_moves && move - i >= 0; ++i) {
    history->push_back(&moves_[move - i]->position);
  }
}

}  // namespace minigo

#endif  // CC_GAME_H_


ent) {
        super(client, {
            "name": "start",
            "aliases": ["create"],
            "group": "encounter",
            "memberName": "start",
            "description": "Start an encounter",
            "guildOnly": true,
            "args": [
                {
                    "key": "members",
                    "label": "users",
                    "prompt": "who will be part of your encounter? (one per line)\n",
                    "type": "member",
                    "infinite": true
                }
            ]
        });
    }

    async run(msg: CommandMessage, args: { "members": GuildMember[] }) {
        const guild = msg.guild;
        const gm = msg.author;
        const users = args.members.map((member) => {
            return member.user;
        });

        const existingEncounters = await EncounterManager.getEncountersFor(guild, users.concat(gm));
        if (existingEncounters.length > 0) {
            // TODO: get info on what players/which encounters
            return msg.reply(`Some players are already in an encounter! Try again`);
        }

        const players = await PlayerManager.getEncounterStatBlocks(users, guild);
        const invalidPlayers = players.filter((player) => {
            return (player.statBlock == null);
        });
        if (invalidPlayers.length > 0) {
            const invalidMentions = invalidPlayers.map(player => `<@${player.userId}>`).join(", ");
            return msg.say(`The following players are missing statblocks: ${invalidMentions}`);
        }

        const encounter = await EncounterManager.startEncounter(guild, gm, players);

        const gmEmbed = encounter.getGmEmbed();
        const playerEmbed = encounter.getPlayerEmbed();

        await msg.author.send({ "embed": gmEmbed });
        return msg.channel.send({ "embed": playerEmbed });
    }
}
import {Component, Input, Output} from '@angular/core';
import {StringCentimetersToNumberFeetPipe, RoundToPipe} from './../formatPipes';

let template = `

    {{character.avatarName}}

Archetype:

{{character.name}}

Height:

{{character.height | stringCentimetersToNumberFeet | roundTo:1}} ft.

Strength:

{{str}}

Dexterity:

{{dex}}

Gender:

{{character.gender}}

Appearances:

{{film}}

`;

@Component({
  selector: 'character-card',
  template,
  pipes: [StringCentimetersToNumberFeetPipe, RoundToPipe]
})
export class CharacterCard {
  @Input()
  character: any;
  @Input()
  str: number;
  @Input()
  dex: number;
}
import * as expect from 'expect';
import * as paredit from '../../../cursor-doc/paredit';
import * as mock from '../common/mock';
import { docFromTextNotation, textAndSelection } from '../common/text-notation';
import { ModelEditSelection } from '../../../cursor-doc/model';

/**
 * TODO:


     }
            }
        } catch (e: HttpRequestTimeoutException) {
            Log.e("LxnsProberUtil", "上传失败: $e")
            sendMessageToUi("上传失败: $e")
            return
        }

        val postScoreResponseBody = postResponse.body<LxnsChuniResponse>()
        if (postScoreResponseBody.success) {
            sendMessageToUi("上传中二节奏成绩到落雪查分器成功")
            Log.d("LxnsProberUtil", "上传完毕")
        } else {
            sendMessageToUi("上传中二成绩成绩到落雪查分器失败: ${postScoreResponseBody.message}")
            Log.e("LxnsProberUtil", "上传失败: ${postScoreResponseBody.message}")
        }
        GlobalViewModel.chuniHooking = false
        application.sendNotification("落雪查分器", "中二数据上传完毕")
        if (isCache) {
            writeChuniScoreCache(scores)
        }
    }

    override suspend fun getMaimaiProberData(importToken: String): List<MaimaiScoreEntity> {
        try {
            val response = client.get("$baseApiUrl/api/v0/user/maimai/player/scores") {
                header("X-User-Token", importToken)
            }
            if (response.status.value != 200) {
                sendMessageToUi("获取舞萌数据失败, API返回体: ${response.bodyAsText()}")
                return emptyList()
            }
            val body = response.body<LxnsGetMaimaiScoreResponse>()
            val parseList = arrayListOf<MaimaiScoreEntity>()
            body.data.forEach {
                val type = MaimaiEnums.SongType.getSongTypeByName(it.type)
                if (type == MaimaiEnums.SongType.UTAGE) return@forEach
                val diff = MaimaiEnums.Difficulty.getDifficultyWithIndex(it.levelIndex)
                val levelValue = MaimaiData.getLevelValue(it.songName, diff, type)
                val version = MaimaiData.getChartVersion(it.songName, diff, type)
                parseList.add(
                    MaimaiScoreEntity(
                        songId = MaimaiData.getSongIdFromTitle(it.songName),
                        title = it.songName ?: "",
                        level = levelValue,
                        achievement = it.achievements,
                        dxScore = it.dxScore,
                        rating = floor(it.dxRating ?: 0F).toInt(),
                        version = version,
                        type = type,
                        diff = diff,
                        rankType = MaimaiEnums.RankType.getRankTypeByScore(it.achievements),
                        syncType = MaimaiEnums.SyncType.getSyncTypeByName(it.fs ?: ""),
                        fullComboType = MaimaiEnums.FullComboType.getFullComboTypeByName(it.fc ?: "")
                    )
                )
            }
            return parseList
        } catch (e: Exception) {
            Log.d("LxnsProberUtil", "获取舞萌成绩失败: $e", e)
            sendMessageToUi("获取舞萌成绩失败: ${e.message}")
            return emptyList()
        }
    }

    override suspend fun getChuniProberData(importToken: String): List<ChuniScoreEntity> {
        try {
            val response = client.get("$baseApiUrl/api/v0/user/chunithm/player/scores") {
                header("X-User-Token", importToken)
            }
            val body = response.body<LxnsGetChuniScoreResponse>()
            val


using System;
using System.Collections.Generic;
using System.Linq;
using WDE.DatabaseEditors.Data.Structs;
using WDE.DatabaseEditors.Models;

namespace WDE.DatabaseEditors.QueryGenerators;

/// <summary>
/// A helper struct used to store a hash of a primary key of a database entity
/// It is never updated, so never store it for more than a single call
/// </summary>
internal readonly struct HashedEntityPrimaryKey
{
    private readonly IList<IDatabaseField> fields;
    private readonly int hash;

    public HashedEntityPrimaryKey(DatabaseEntity entity, DatabaseTableDefinitionJson table)
    {
        fields = table.PrimaryKey!.Select(key => entity.GetCell(key)!).ToList();


s()%self.size_y as i32) as usize;

    self.sections[idx].clone()
  }
}
mod harness;
use fuel_vm::prelude::*;

pub fn run(filter_regex: Option<regex::Regex>) {
    let filter = |name| {
        filter_regex
            .as_ref()
            .map(|regex| regex.is_match(name))
            .unwrap_or(true)
    };

    // programs that should successfully compile and terminate
    // with some known state
    let project_names = vec![
        ("asm_expr_basic", ProgramState::Return(6)),
        ("basic_func_decl", ProgramState::Return(1)), // 1 == true
        ("contract_abi_impl", ProgramState::Return(0)),
        // TEMPORARILY DISABLED DUE TO OOM ("dependencies", ProgramState::Return(0)), // 0 == false
        ("if_elseif_enum", ProgramState::Return(10)),
        ("tuple_types", ProgramState::Return(123)),
        ("out_of_order_decl", ProgramState::Return(1)),
        ("struct_field_reassignment", ProgramState::Return(0)),
        ("enum_in_fn_decl", ProgramState::Return(255)),
        ("empty_impl", ProgramState::Return(0)),
        ("main_returns_unit", ProgramState::Return(0)),
        ("unary_not_basic", ProgramState::Return(1)), // 1 == true
        ("unary_not_basic_2", ProgramState::Return(1)), // 1 == true
        ("fix_opcode_bug", ProgramState::Return(30)),
        (
            "retd_b256",
            ProgramState::ReturnData(Bytes32::from([
                102, 104, 122, 173, 248, 98, 189, 119, 108, 143, 193, 139, 142, 159, 142, 32, 8,
                151, 20, 133, 110, 226, 51, 179, 144, 42, 89, 29, 13, 95, 41, 37,
            ])),
        ),
        (
            "retd_struct",
            ProgramState::ReturnData(Bytes32::from([
                251, 57, 24, 241, 63, 94, 17, 102, 252, 182, 8, 110, 140, 105, 102, 105, 138, 202,
                155, 39, 97, 32, 94, 129, 141, 144, 190, 142, 33, 32, 33, 75,
            ])),
        ),
        ("op_precedence", ProgramState::Return(0)),
        ("asm_without_return", ProgramState::Return(0)),
        ("op_precedence", ProgramState::Return(0)), // false
        ("b256_bad_jumps", ProgramState::Return(1)),
        ("b256_ops", ProgramState::Return(100)),
        ("struct_field_access", ProgramState::Return(43)),
        ("bool_and_or", ProgramState::Return(42)),
        ("neq_4_test", ProgramState::Return(0)),
        ("eq_4_test", ProgramState::Return(1)),
        ("local_impl_for_ord", ProgramState::Return(1)), // true
        ("const_decl", ProgramState::Return(100)),
        // TEMPORARILY DISABLED DUE TO OOM ("const_decl_in_library", ProgramState::Return(1)), // true
        ("aliased_imports", ProgramState::Return(42)),
        ("empty_method_initializer", ProgramState::Return(1)), // true
        ("b512_struct_alignment", ProgramState::Return(1)),    // true
        ("generic_structs", ProgramState::Return(1)),          // true
        ("generic_functions", ProgramState::Return(1)),        // true
        ("generic_enum", ProgramState::Return(1)),             // true
        ("import_method_from_other_file", ProgramState::Return(10)), // true
        ("address_test", ProgramState::Return(1)),             // true
        ("generic_struct", ProgramState::Return(1)),           // true
        ("zero_field_types", ProgramState::Return(10)),        // true
        ("assert_test", ProgramState::Return(1)),              // true
        ("match_expressions", ProgramState::Return(42


 ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

```

### once@1.4.0

From https://github.com/isaacs/once.

**ISC**:

```
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

```

### onetime@5.1.2

From https://github.com/sindresorhus/onetime.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### open@6.4.0, open@7.4.2, open@8.4.2

From https://github.com/sindresorhus/open.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### ora@5.4.1

From https://github.com/sindresorhus/ora.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### os-tmpdir@1.0.2

From https://github.com/sindresorhus/os-tmpdir.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### p-finally@1.0.0

From https://github.com/sindresorhus/p-finally.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### p-limit@1.3.0, p-limit@2.3.0, p-limit@3.1.0

From https://github.com/sindresorhus/p-limit.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### p-locate@2.0.0, p-locate@3.0.0, p-locate@4.1.0, p-locate@5.0.0

From https://github.com/sindresorhus/p-locate.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### p-map@4.0.0

From https://github.com/sindresorhus/p-map.

**MIT**:

Copyright: Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

See [Appendix B](#appendix-b-the-mit-license) for the full MIT license.

### p-try@1.0.0, p-try@2.2.0

From https://github.com/sindres


ic id: number;

    /**
     * Creates an instance of Weapon.
     *
     * @param {Array<number>} type (EquipmentType id)
     * @param {string} [name="Item Name"] (description)
     * @param {number} [cost=1] (description)
     * @param {Damage} damage (damage {die}, type{damageType})
     * @param {number} weight (description)
     * @param {Array<number>} properties (WeaponProperty id)
     * @param {Die} versatileDamage (description)
     * @param {number} normalRange (description)
     * @param {number} longRange (description)
     */
    constructor(
        public type: Array<number>,
        public name: string = "Item Name",
        public cost: number = 1,
        public damage: Damage,
        public weight: number,
        public properties: Array<number>,
        public versatileDamage: Die,
        public normalRange: number,
        public longRange: number
    ) { }
}import supertest from 'supertest'
import { createAuthHeaders, buildURL } from '../../spec/utils'
import { ItemCuration } from '../Curation/ItemCuration'
import {
  ThirdPartyFragment,
  ThirdPartyMetadataType,
} from '../ethereum/api/fragments'
import { thirdPartyAPI } from '../ethereum/api/thirdParty'
import { app } from '../server'
import { ThirdParty } from './ThirdParty.types'
import { toThirdParty } from './utils'

const server = supertest(app.getApp())

jest.mock('../ethereum/api/thirdParty')
jest.mock('../Curation/ItemCuration')

describe('ThirdParty router', () => {
  let fragments: ThirdPartyFragment[]
  let thirdParties: ThirdParty[]

  beforeEach(() => {
    let metadata = {
      type: ThirdPartyMetadataType.THIRD_PARTY_V1,
      thirdParty: { name: 'a name', description: 'a description' },
    }
    fragments = [
      {
        id: '1',
        root: 'aRoot',
        managers: ['0x1'],
        maxItems: '3',
        metadata,
      },
      {
        id: '2',
        root: 'anotherRoot',
        managers: ['0x2', '0x3'],
        maxItems: '2',
        metadata,
      },
    ]
    thirdParties = fragments.map(toThirdParty)
  })

  afterEach(() => {
    jest.resetAllMocks()
  })

  describe('when retrieving all third party records', () => {
    let url: string

    beforeEach(() => {
      ;(thirdPartyAPI.fetchThirdPartiesByManager as jest.Mock).mockResolvedValueOnce(
        fragments
      )
      url = '/thirdParties'
    })

    it('should respond with a third party array', () => {
      return server
        .get(buildURL(url))
        .set(createAuthHeaders('get', url))
        .expect(200)
        .then((response: any) => {
          expect(response.body).toEqual({ data: thirdParties, ok: true })
        })
    })
  })

  describe('when using a query string to filter', () => {
    let url: string
    let manager: string
    let managerFragments: ThirdPartyFragment[]
    let managerThirdParties: ThirdParty[]

    beforeEach(() => {
      manager = '0x1'
      managerFragments = fragments.slice(0, 1)
      ;(thirdPartyAPI.fetchThirdPartiesByManager as jest.Mock).mockResolvedValueOnce(
        managerFragments
      )
      managerThirdParties = managerFragments.map(toThirdParty)
      url = '/thirdParties'
    })


ap_code(KC_RCTL);
				tap_code(KC_A);
				tap_code(KC_E);
			}
			return false;
		case C_NO2: // ø
			// the "/" symbol can't be shifted, so we have to deal with that
			if(record->event.pressed){
				if(shifted){
					unregister_code(KC_LSFT); // reset the shift state, I always use LSFT personally
					tap_code(KC_RCTL);
					tap_code(KC_SLSH);
					tap_code16(S(KC_O));
					register_code(KC_LSFT); // enable the shift state again to keep state consistent
				} else {
					tap_code(KC_RCTL);
					tap_code(KC_SLSH);
					tap_code(KC_O);
				}
			}
			return false;
		case C_NO3: // å
			// the "o" symbol can't be shifted, so we have to deal with that
			if(record->event.pressed){
				if(shifted){
					unregister_code(KC_LSFT); // reset the shift state, I always use LSFT personally
					tap_code(KC_RCTL);
					tap_code(KC_O);
					tap_code16(S(KC_A));
					register_code(KC_LSFT); // enable the shift state again to keep state consistent
				} else {
					tap_code(KC_RCTL);
					tap_code(KC_O);
					tap_code(KC_A);
				}
			}
			return false;
	}
	return true;
}