= Server::builder(battle).build();
        assert_eq!(
            ResetRounds::trigger(&mut server).seed(model).fire().err(),
            None
        );
        util::team(&mut server, TEAM_1_ID);
        util::creature(&mut server, CREATURE_1_ID, TEAM_1_ID, ());
        util::creature(&mut server, CREATURE_2_ID, TEAM_1_ID, ());
        util::creature(&mut server, CREATURE_3_ID, TEAM_1_ID, ());
        server
    }};
}

#[test]
fn start_turn() {
    // Initialize the battle.
    let mut server = server!();
    // Pre-start checks.
    assert_eq!(
        server.battle().rounds().model().adds,
        server.battle().entities().actors().count()
    );
    assert_eq!(*server.battle().rounds().state(), TurnState::<_>::Ready);
    // Check start turn is prevented for faulty conditions.
    assert_eq!(
        StartTurn::trigger(&mut server, ENTITY_ERR_ID)
            .fire()
            .err()
            .map(|e| e.unfold()),
        Some(WeaselError::EntityNotFound(ENTITY_ERR_ID))
    );
    assert_eq!(
        StartTurn::trigger(&mut server, ENTITY_2_ID)
            .fire()
            .err()
            .map(|e| e.unfold()),
        Some(WeaselError::ActorNotEligible(ENTITY_2_ID))
    );
    assert_eq!(*server.battle().rounds().state(), TurnState::<_>::Ready);
    assert_eq!(server.battle().rounds().model().starts, 0);
    assert_eq!(server.battle().rounds().completed_turns(), 0);
    // Check start works.
    util::start_turn(&mut server, &ENTITY_1_ID);
    // Post-start checks.
    assert_eq!(
        *server.battle().rounds().state(),
        TurnState::<_>::Started(indexset! {ENTITY_1_ID})
    );
    assert_eq!(server.battle().rounds().model().starts, 1);
    // Another start in a row must not work.
    assert_eq!(
        StartTurn::trigger(&mut server, ENTITY_2_ID)
            .fire()
            .err()
            .map(|e| e.unfold()),
        Some(WeaselError::TurnInProgress)
    );
    assert_eq!(
        *server.battle().rounds().state(),
        TurnState::<_>::Started(indexset! {ENTITY_1_ID})
    );
    assert_eq!(server.battle().rounds().model().starts, 1);
}

#[test]
fn end_turn() {
    // Initialize the battle.
    let mut server = server!();
    // Pre-start checks.
    assert_eq!(
        server.battle().rounds().model().adds,
        server.battle().entities().actors().count()
    );
    assert_eq!(*server.battle().rounds().state(), TurnState::<_>::Ready);
    // Check end turn is prevented for faulty conditions.
    assert_eq!(
        EndTurn::trigger(&mut server)
            .fire()
            .err()
            .map(|e| e.unfold()),
        Some(WeaselError::NoTurnInProgress)
    );
    assert_eq!(server.battle().rounds().model().ends, 0);
    assert_eq!(*server.battle().rounds().state(), TurnState::<_>::Ready);
    // Start turn.
    util::start_turn(&mut server, &ENTITY_1_ID);
    // Check end works.
    util::end_turn(&mut server);
    // Post-end checks.
    assert_eq!(server.battle().rounds().model().ends, 1);
    assert_eq!(*server.battle().


A list of features, that Android version of the app has and that iOS does not.

## Incident light metering

Apple does not provide API for reading Lux stream form the ambient light sensor. Lux can be calculated based on front camera image stream, but this would be a reflected light. So there is no way incident light metering can be implemented on iOS.

## Volume buttons action

This can be [implemented](https://stackoverflow.com/questions/70161271/ios-override-hardware-volume-buttons-same-as-zello) but the app will be rejected due to [2.5.9](https://developer.apple.com/app-store/review/guidelines/#software-requirements)
# PSFree version 1.5.1

PSFree est une collection d’exploits pour la console PS4. L’objectif principal du dépôt est la PS4, mais nous essayons de rendre les choses portables sur PS5.

## Fonctionnalités

- **Détection automatique :** Détecte automatiquement le type de console et la version du firmware (via [`src/config.mjs`](https://raw.githubusercontent.com/Al-Azif/psfree-lapse/main/src/config.mjs)).
- **Exploit WebKit (PSFree) :** Point d’entrée via le navigateur web de la console.
- **Exploit Kernel (Lapse) :** Escalade les privilèges au niveau kernel.
- **Chargeur de payload :** Après une exploitation kernel réussie, attend un payload sur le port 9020.

## Portée des vulnérabilités

|               | PSFree    | Lapse      |
| :------------ | :-------- | :--------- |
| PlayStation 4 | 6.00-9.60 | 1.01-12.02 |
| PlayStation 5 | 1.00-5.50 | 1.00-10.01 |

## Pris en charge par ce dépôt

Ce tableau indique les versions de firmware pour lesquelles la _version actuelle_ de ce dépôt fournit une chaîne d’exploit fonctionnelle et testée.

|               | PSFree    | Lapse     |
| :------------ | :-------- | :-------- |
| PlayStation 4 | 7.00-9.60 | 7.00-9.60 |
| PlayStation 5 | N/A       | N/A       |

_Note : Le support pour d’autres firmwares listés dans le tableau "Portée des vulnérabilités" peut, ou non, être en cours de développement ou avoir été pris en charge dans des versions précédentes de ce dépôt. Veuillez consulter [`CHANGELOG.md`](https://raw.githubusercontent.com/Al-Azif/psfree-lapse/main/CHANGELOG.md) pour l’historique du support._

## Liste TODO

- [ ] Problème d’écran noir/sauvegarde avec certains jeux
- [ ] `lapse.mjs` : Juste définir les bits pour les privilèges JIT
- [ ] `view.mjs` : Suppose PS4, ajouter la prise en charge PS5 également
- [ ] Ajouter le support PS5

## Copyright et auteurs :

AGPL-3.0-ou-supérieure (voir [`LICENSE`](h


的党员要处理一下，校委会改组，吸收点积极分子参加等。

   这样采取些措施，大家就会继续鸣放，就会起团结作用，老年人是不希望不团结的，也不愿带头搞不团结的工作，如果没有措施，就收一下，老教师不说话，群众闷下去，这一收就无信心了，以后就不能谈别的问题了。但如果碰到问题，就可能爆发，现在学生中开展争辩的条件是够了，老教师已经在缩，如何争辩？总之发展前途是要注意团结，要防止学生找题目，改进一些显而易见的错误。党内要继续放，然后对反动的东西打下去，反动的东西在清华是站不住的。大家对党中央的信仰是很强的，失望仅是个别的。学生中现在没有条件搞波匈事件，现在群众都是期待改，期待较多，但是再拖上一个月可能上街，上街也不是什么政治口号，可能仍是对干部不满，以及把学生分成几类和前途出路这类问题。民主党派带了个头，现在是没有办法了，现在不能收，收要失去人心，问题是要把党内外的线拿掉。

    来源：1957年7月20日《新清华》；《捍卫高等教育和科学事业的社会主义方向 批判右派分子钱伟长的反党反社会主义言行（一）》（清华大学《新清华》编辑委员会编，1957年12月）

    [返回索引页面]

   Copyright (C)  2024  Marxist-Leninist-Maoist.

   Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover


/*
 * Copyright 2012 Actions Semi Inc.
 * Author: Actions Semi, Inc.
 *
 * Copyright (c) 2017 Andreas Färber
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/linkage.h>
#include <linux/init.h>

ENTRY(owl_v7_invalidate_l1)
	mov	r0, #0
	mcr	p15, 0, r0, c7, c5, 0	@ invalidate I cache
	mcr	p15, 2, r0, c0, c0, 0
	mrc	p15, 1, r0, c0, c0, 0

	ldr	r1, =0


ore segment create a loop",
			FileName: "00_loops.txt",
			SrcIA:    addr.MustParseIA("1-ff00:0:111"),
			DstIA:    addr.MustParseIA("1-ff00:0:112"),
			Ups: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_120_X_111_B}),
				g.Beacon([]uint16{graph.If_130_B_111_A}),
			},
			Cores: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_130_B_120_A}),
				g.Beacon([]uint16{graph.If_120_A_130_B}),
				g.Beacon([]uint16{graph.If_120_A_110_X, graph.If_110_X_130_A}),
				g.Beacon([]uint16{graph.If_130_A_110_X, graph.If_110_X_120_A}),
			},
			Downs: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_130_A_112_X}),
				g.Beacon([]uint16{graph.If_130_B_111_A, graph.If_111_A_112_X}),
				g.Beacon([]uint16{graph.If_120_X_111_B, graph.If_111_A_112_X}),
			},
		},
	}
	t.Log("TestLoops")
	for _, tc := range testCases {
		t.Run(tc.Name, func(t *testing.T) {
			result := combinator.Combine(tc.SrcIA, tc.DstIA, tc.Ups, tc.Cores, tc.Downs, false)
			txtResult := writePaths(result)
			if *update {
				err := os.WriteFile(xtest.ExpandPath(tc.FileName), txtResult.Bytes(), 0644)
				require.NoError(t, err)
			}
			expected, err := os.ReadFile(xtest.ExpandPath(tc.FileName))
			assert.NoError(t, err)
			assert.Equal(t, string(expected), txtResult.String())
		})
	}
}

func TestComputePath(t *testing.T) {
	ctrl := gomock.NewController(t)
	g := graph.NewDefaultGraph(ctrl)

	testCases := []struct {
		Name     string
		FileName string
		SrcIA    addr.IA
		DstIA    addr.IA
		Ups      []*seg.PathSegment
		Cores    []*seg.PathSegment
		Downs    []*seg.PathSegment
	}{
		{
			Name:     "#0 simple up-core-down",
			FileName: "00_compute_path.txt",
			SrcIA:    addr.MustParseIA("1-ff00:0:131"),
			DstIA:    addr.MustParseIA("1-ff00:0:111"),
			Ups: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_130_A_131_X}),
			},
			Cores: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_120_A_130_B}),
			},
			Downs: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_120_X_111_B}),
			},
		},
		{
			Name:     "#1 simple up-core",
			FileName: "01_compute_path.txt",
			SrcIA:    addr.MustParseIA("1-ff00:0:131"),
			DstIA:    addr.MustParseIA("1-ff00:0:110"),
			Ups: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_130_A_131_X}),
			},
			Cores: []*seg.PathSegment{
				g.Beacon([]uint16{graph.If_110_X_130_A}),
			},
		},
		{
			Name:     "#2 simple up only",
			FileName: "02_compute_path.txt",
			SrcIA:    addr.MustParseIA("1-ff00:0:131"),


  andi       $t1, $t1, 0x7FF
/* 1679C 80025F9C FF03CA30 */  andi       $t2, $a2, 0x3FF
/* 167A0 80025FA0 00488848 */  mtc2       $t0, C2_IR1 /* handwritten instruction */
/* 167A4 80025FA4 00508948 */  mtc2       $t1, C2_IR2 /* handwritten instruction */
/* 167A8 80025FA8 00588A48 */  mtc2       $t2, C2_IR3 /* handwritten instruction */
/* 167AC 80025FAC 00C80848 */  mfc2       $t0, C2_MAC1 /* handwritten instruction */
/* 167B0 80025FB0 00D00948 */  mfc2       $t1, C2_MAC2 /* handwritten instruction */
/* 167B4 80025FB4 00D80A48 */  mfc2       $t2, C2_MAC3 /* handwritten instruction */
/* 167B8 80025FB8 40450800 */  sll        $t0, $t0, 21
/* 167BC 80025FBC 804A0900 */  sll        $t1, $t1, 10
/* 167C0 80025FC0 20400901 */  add        $t0, $t0, $t1 /* handwritten instruction */
/* 167C4 80025FC4 20400A01 */  add        $t0, $t0, $t2 /* handwritten instruction */
/* 167C8 80025FC8 E4FF4314 */  bne        $v0, $v1, .L80025F5C
/* 167CC 80025FCC FCFF28AC */   sw        $t0, -0x4($at)
.L80025FD0:
/* 167D0 80025FD0 8AFE8007 */  bltz       $gp, .L800259FC
/* 167D4 80025FD4 020E1C00 */   srl       $at, $gp, 24
/* 167D8 80025FD8 1B003DA2 */  sb         $sp, 0x1B($s1)
/* 167DC 80025FDC 0880023C */  lui        $v0, %hi(D_80078560)
/* 167E0 80025FE0 60854224 */  addiu      $v0, $v0, %lo(D_80078560)
/* 167E4 80025FE4 2C00428C */  lw         $v0, 0x2C($v0)
/* 167E8 80025FE8 80080100 */  sll        $at, $at, 2
/* 167EC 80025FEC 20082200 */  add        $at, $at, $v0 /* handwritten instruction */
/* 167F0 80025FF0 0000218C */  lw         $at, 0x0($at)
/* 167F4 80025FF4 00000000 */  nop
/* 167F8 80025FF8 02002390 */  lbu        $v1, 0x2($at)
/* 167FC 80025FFC 0C002220 */  addi       $v0, $at, 0xC /* handwritten instruction */
/* 16800 80026000 C0180300 */  sll        $v1, $v1, 3
/* 16804 80026004 20104300 */  add        $v0, $v0, $v1 /* handwritten instruction */
/* 16808 80026008 04004590 */  lbu        $a1, 0x4($v0)
/* 1680C 8002600C 05004390 */  lbu        $v1, 0x5($v0)
/* 16810 80026010 06002694 */  lhu        $a2, 0x6($at)
/* 16814 80026014 2000A01C */  bgtz       $a1, .L80026098
/* 16818 80026018 18006600 */   mult      $v1, $a2
/* 1681C 8002601C 0800238C */  lw         $v1, 0x8($at)
/* 16820 80026020 12200000 */  mflo       $a0
/* 16824 80026024 20082400 */  add        $at


 'Luxor Gold',#ab8d3f;
$c: 'Lynx',#604d47;
$c: 'M. Bison',#b4023d;
$c: 'Macabre',#880033;
$c: 'Macadamia',#e4cfb6;
$c: 'Macaroni',#f3d085;
$c: 'Macaroon',#b38b71;
$c: 'Macau',#46c299;
$c: 'Machinery',#9999aa;
$c: 'Machu Picchu Gardens',#99bb33;
$c: 'Mademoiselle Pink',#f504c9;
$c: 'Madonna',#3f4250;
$c: 'Madras',#473e23;
$c: 'Magenta',#ff00ff;
$c: 'Magenta Affair',#aa44dd;
$c: 'Magenta Elephant',#de0170;
$c: 'Magentle',#aa11aa;
$c: 'Magic Carpet',#9488be;
$c: 'Magic Ink',#0247fe;
$c: 'Magic Magenta',#7f4774;
$c: 'Magic Potion',#ff4466;
$c: 'Magical Merlin',#3d8ed0;
$c: 'Magical Stardust',#eaeadb;
$c: 'Magma',#ff4e01;
$c: 'Magna Cum Laude',#dd0066;
$c: 'Magnesium',#c1c2c3;
$c: 'Magnet',#4d4b4f;
$c: 'Magnetos',#bf3cff;
$c: 'Magnificent Magenta',#ee22aa;
$c: 'Magnolia',#fff9e4;
$c: 'Magnolia Petal',#f7eee3;
$c: 'Maharaja',#3f354f;
$c: 'Mahogany',#c04000;
$c: 'Mai Tai',#a56531;
$c: 'Maiden´s Blush',#f3d3bf;
$c: 'Maison Verte',#e5f0d9;
$c: 'Maizena',#fbec5e;
$c: 'Majestic Eggplant',#443388;
$c: 'Majestic Magenta',#ee4488;
$c: 'Majestic Magic',#555570;
$c: 'Majesty',#593761;
$c: 'Major Brown',#5b5149;
$c: 'Makin it Rain',#88bb55;
$c: 'Malibu',#66b7e1;
$c: 'Malibu Sun',#fff2d9;
$c: 'Mallard',#254855;
$c: 'Malt',#ddcfbc;
$c: 'Mamba',#766d7c;
$c: 'Man Cave',#816045;
$c: 'Mana Tree',#4f7942;
$c: 'Mandarin',#f37a48;
$c: 'Mangala Pink',#e781a6;
$c: 'Mango',#ffa62b;
$c: 'Mango Cheesecake',#fbedda;
$c: 'Mango Madness',#fd8c23;
$c: 'Mango Tango',#ff8243;
$c: 'Mangrove',#757461;
$c: 'Manhattan',#e2af80;
$c: 'Maniac Green',#009000;
$c: 'Maniac Mansion',#004058;
$c: 'Mantis',#74c365;
$c: 'Maple Syrup',#bb9351;
$c: 'Maraschino',#ff2600;
$c: 'Marble White',#f2f0e6;
$c: 'Marigold',#fcc006;
$c: 'Marina',#4f84c4;
$c: 'Marine',#042e60;
$


-right: 0.969em;
}

mjx-c.mjx-c210C.TEX-FR::before {
  padding: 0.666em 0.72em 0.133em 0;
  content: "H";
}

mjx-c.mjx-c210D.TEX-A::before {
  padding: 0.683em 0.778em 0 0;
  content: "H";
}

mjx-c.mjx-c210E.TEX-I::before {
  padding: 0.694em 0.576em 0.011em 0;
  content: "h";
}

mjx-c.mjx-c210F.TEX-A::before {
  padding: 0.695em 0.562em 0.013em 0;
  content: "\210F";
}

[noIC] mjx-c.mjx-c210F.TEX-A:last-child::before {
  padding-right: 0.54em;
}

mjx-c.mjx-c2110.TEX-SC::before {
  padding: 0.717em 1.133em 0.314em 0;
  content: "J";
}

[noIC] mjx-c.mjx-c2110.TEX-SC:last-child::before {
  padding-right: 1.052em;
}

mjx-c.mjx-c2111.TEX-FR::before {
  padding: 0.686em 0.554em 0.026em 0;
  content: "I";
}

mjx-c.mjx-c2112.TEX-SC::before {
  padding: 0.717em 1.035em 0.017em 0;
  content: "L";
}

[noIC] mjx-c.mjx-c2112.TEX-SC:last-child::before {
  padding-right: 0.874em;
}

mjx-c.mjx-c2113::before {
  padding: 0.705em 0.417em 0.02em 0;
  content: "\2113";
}

mjx-c.mjx-c2115.TEX-A::before {
  padding: 0.683em 0.722em 0.02em 0;
  content: "N";
}

mjx-c.mjx-c2118::before {
  padding: 0.453em 0.636em 0.216em 0;
  content: "\2118";
}

mjx-c.mjx-c2119.TEX-A::before {
  padding: 0.683em 0.611em 0 0;
  content: "P";
}

mjx-c.mjx-c211A.TEX-A::before {
  padding: 0.701em 0.778em 0.181em 0;
  content: "Q";
}

mjx-c.mjx-c211B.TEX-SC::before {
  padding: 0.717em 0.887em 0.017em 0;
  content: "R";
}

[noIC] mjx-c.mjx-c211B.TEX-SC:last-child::before {
  padding-right: 0.85em;
}

mjx-c.mjx-c211C.TEX-FR::before {
  padding: 0.686em 0.828em 0.026em 0;
  content: "R";
}

mjx-c.mjx-c211D.TEX-A::before {
  padding: 0.683em 0.722em 0 0;
  content: "R";
}

mjx-c.mjx-c2124.TEX-A::before {
  padding: 0.683em 0.667em 0 0;
  content: "Z";
}

mjx-c.mjx-c2126::before {
  padding: 0.704em 0.722em 0 0;
  content: "\3A9";
}

mjx-c.mjx-c2127.TEX-A::before {
  padding: 0.684em 0.72


#ifndef _INTERFACE_H_
#define _INTERFACE_H_

enum ProtoCmds {
    PROTOCMD_INIT,
    PROTOCMD_DEINIT,
    PROTOCMD_BIND,
    PROTOCMD_CHECK_AUTOBIND,
    PROTOCMD_NUMCHAN,
    PROTOCMD_DEFAULT_NUMCHAN,
    PROTOCMD_CURRENT_ID,
    PROTOCMD_GETOPTIONS,
    PROTOCMD_SETOPTIONS,
    PROTOCMD_TELEMETRYSTATE,
    PROTOCMD_TELEMETRYTYPE,
    PROTOCMD_TELEMETRYRESET,
    PROTOCMD_RESET,
    PROTOCMD_CHANNELMAP,
    PROTOCMD_RANGETESTON,
    PROTOCMD_RANGETESTOFF,
    PROTOCMD_OPTIONSPAGE,
    PROTOCMD_CHANGED_ID,
    PROTOCMD_MAX_ID,
};

enum TXRX_State {
    TXRX_OFF,
    TX_EN,
    RX_EN,
};

enum PinConfigState {
    CSN_PIN,
    ENABLED_PIN,
    DISABLED_PIN,
    RESET_PIN,
};

#define AETRG (0)
#define UNCHG (1)
#define EATRG (2)
#define TAERG (3)

#ifndef MODULAR
#define PROTODEF(proto, module, map, cmd, name) extern uintptr_t cmd(enum ProtoCmds);
#include "protocol.h"
#undef PROTODEF
#endif

#ifdef PROTO_HAS_A7105
#include "iface_a7105.h"
#endif

#ifdef PROTO_HAS_CYRF6936
#include "iface_cyrf6936.h"
#endif

#ifdef PROTO_HAS_CC2500
#include "iface_cc2500.h"
#endif

#ifdef PROTO_HAS_NRF24L01
#include "iface_nrf24l01.h"
#endif

#endif //_INTERFACE_H_


pDelta = getEyesPos(player).y - positionVector.add(0.0, 0.5, 0.0).y
        val downDelta = getEyesPos(player).y - positionVector.add(0.0, -0.5, 0.0).y
        if (westDelta > 0 && !world.getBlockState(bp.west()).isReplaceable) visibleSides.add(Direction.EAST)
        if (westDelta < 0 && !world.getBlockState(bp.east()).isReplaceable) visibleSides.add(Direction.WEST)
        if (eastDelta < 0 && !world.getBlockState(bp.east()).isReplaceable) visibleSides.add(Direction.WEST)
        if (eastDelta > 0 && !world.getBlockState(bp.west()).isReplaceable) visibleSides.add(Direction.EAST)
        if (northDelta > 0 && !world.getBlockState(bp.north()).isReplaceable) visibleSides.add(Direction.SOUTH)
        if (northDelta < 0 && !world.getBlockState(bp.south()).isReplaceable) visibleSides.add(Direction.NORTH)
        if (southDelta < 0 && !world.getBlockState(bp.south()).isReplaceable) visibleSides.add(Direction.NORTH)
        if (southDelta > 0 && !world.getBlockState(bp.north()).isReplaceable) visibleSides.add(Direction.SOUTH)
        if (upDelta > 0 && !world.getBlockState(bp.down()).isReplaceable) visibleSides.add(Direction.UP)
        if (upDelta < 0 && !world.getBlockState(bp.up()).isReplaceable) visibleSides.add(Direction.DOWN)
        if (downDelta < 0 && !world.getBlockState(bp.up()).isReplaceable) visibleSides.add(Direction.DOWN)
        if (downDelta > 0 && !world.getBlockState(bp.down()).isReplaceable) visibleSides.add(Direction.UP)
        return visibleSides
    }

    fun SafeClientEvent.calculateAngle(to: Vec3d): FloatArray {
        return calculateAngle(getEyesPos(player), to)
    }

    fun SafeClientEvent.calculateAngle(from: Vec3d, to: Vec3d): FloatArray {
        val difX = to.x - from.x
        val difY = (to.y - from.y) * -1.0
        val difZ = to.z - from.z
        val dist = sqrt((difX * difX + difZ * difZ).toFloat()).toDouble()
        val yD = wrapDegrees(toDegrees(atan2(difZ, difX)) - 90.0).toFloat()
        val pD = clamp(wrapDegrees(toDegrees(atan2(difY, dist))), -90.0, 90.0).toFloat()
        return floatArrayOf(yD, pD)
    }

}package dev.slmpc.kappaclient.module.impl.client

import dev.slmpc.kappaclient.gui.clickgui.KappaClickGUI
import dev.slmpc.kappaclient.module.Category
import dev.slmpc.kappaclient.module.Module
import dev.slmpc.kappaclient.util.threads.runSafe
import org.lwjgl.glfw.GLFW

object ClickGUI: Module(
    name = "ClickGUI",
    category = Category.CLIENT,
    description = "",
    defaultKeyBind = GLFW.GLFW_KEY_RIGHT_SHIFT
) {

    val background by setting("Background", false)
    val animationLength by setting("AnimationLength", 0.2f, 0.01f..1f, 0.01f)
    val red by setting("GuiRed", 175, 0..255, 1)
    val green by setting("GuiGreen", 175, 0..255, 1)
    val blue by setting("GuiBlue", 255, 0..255, 1)
    val nRed by setting("SliderRed", 120, 0..255, 1)
    val nGreen by setting("SliderGreen", 190, 0..255, 1)
    val nBlue by setting("SliderBlue", 255, 0..255, 1)
    val shadow by setting("Shadow", true)

    init {

        onEnable {
            runSafe {
                mc.setScreen(KappaClickGUI)
            }
        }


	CREATE_OS_APP_TAG_DICTIONARY_SQL = SQL_CREATE_DICT +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64,\n" +
		"    `sub_domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id, key\n" +
		SQL_SOURCE_MYSQL +
		SQL_LIFETIME +
		SQL_LAYOUT_COMPLEX_KEY_HASHED
	CREATE_OS_APP_TAGS_DICTIONARY_SQL = SQL_CREATE_DICT +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `os_app_tags` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64,\n" +
		"    `sub_domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		SQL_SOURCE_MYSQL +
		SQL_LIFETIME +
		SQL_LAYOUT_FLAT
)
/**
 * Copyright (c) 2024 Yunshan Networks
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package recorder

import (
	"context"
	"time"

	"github.com/op/go-logging"

	cloudmodel "github.com/deepflowio/deepflow/server/controller/cloud/model"
	"github.com/deepflowio/deepflow/server/controller/common"
	metadbmodel "github.com/deepflowio/deepflow/server/controller/db/metadb/model"
	"github.com/deepflowio/deepflow/server/controller/recorder/cache"
	"github.com/deepflowio/deepflow/server/controller/recorder/cache/tool"
	rcommon "github.com/deepflowio/deepflow/server/controller/recorder/common"
	"github.com/deepflowio/deepflow/server/controller/recorder/config"
	"github.com/deepflowio/deepflow/server/controller/recorder/listener"
	"github.com/deepflowio/deepflow/server/controller/recorder/pubsub"
	"github.com/deepflowio/deepflow/server/controller/recorder/pubsub/message"
	"github.com/deepflowio/deepflow/server/controller/recorder/statsd"
	"github.com/deepflowio/deepflow/server/controller/recorder/updater"
	"github.com/deepflowio/deepflow/server/controller/trisolaris/refresh"
)

type subDomains struct {
	metadata *rcommon.Metadata

	cacheMng   *cache.CacheManager
	refreshers map[string]*subDomain
}

func newSubDomains(ctx context.Context, cfg config.RecorderConfig, md *rcommon.Metadata, cacheMng *cache.CacheManager) *subDomains {
	return &subDomains{
		metadata: md,

		cacheMng:   cacheMng,
		refreshers: make(map[string]*subDomain),
	}
}

func (s *subDomains) CloseStatsd() {
	for _, refresher


GREEN_LEGEND.getIcon(), 1, 2, 1, 1, 0, 0);
    panel.addEmptyCellAt(2, 1);
    panel.add(getLabels()[BUDGET_DIFFERENCE], 3, 0, 1, 1, 100, 0);
    panel.add(getLabels()[BUDGET_BALANCE], 3, 2, 1, 1, 0, 0);

    panel.setBorder(createTitledBorder(getSharedProperty("legend"), false));

    return panel;
  }

  private
  Budget
  getBudget()
  {
    return itsBudget;
  }

  private
  JLabel[]
  getLabels()
  {
    return itsLabels;
  }

  private
  static
  String
  getProperty(String key)
  {
    return I18NHelper.getProperty("BudgetPieChartPanel." + key);
  }

  private
  void
  setBudget(Budget budget)
  {
    itsBudget = budget;
  }

  private
  void
  updateInfo()
  {
    PercentFormat format = new PercentFormat();
    String balance = "";
    String difference = "";

    if(getBudget() != null && getBudget().getAmount() != 0)
    {
      balance = format.format(getBudget().getBalancePercentage());
      difference = format.format(getBudget().getChangePercentage());
    }

    getLabels()[BUDGET_BALANCE].setText(balance);
    getLabels()[BUDGET_DIFFERENCE].setText(difference);
  }

  //////////////////////////////////////////////////////////////////////////////
  // Start of class members.
  //////////////////////////////////////////////////////////////////////////////

  private Budget itsBudget;
  private JLabel[] itsLabels;

  private static final int BUDGET_BALANCE = 0;
  private static final int BUDGET_DIFFERENCE = 1;

  private static final Image BALANCE = PIE_CHART_GREEN.getIcon().getImage();
  private static final Image DIFFERENCE = PIE_CHART_BLUE.getIcon().getImage();
  private static final Image NO_DATA = PIE_CHART_GRAY.getIcon().getImage();
}
// TextConstrainer

package org.javamoney.examples.ez.common.utility;

import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

/**
 * This class facilitates constraining the input of text. There are two text
 * attributes this class can constrain, the length of the text and the
 * characters that can be inputted.
 */
public
final
class
TextConstrainer
extends PlainDocument
{
  /**
   * Constructs a new constrainer.
   *
   * @param maxInput The maximum length of input the text can have.
   */
  public
  TextConstrainer(int maxInput)
  {
    this(maxInput, null);
  }

  /**
   * Constructs a new constrainer.
   *
   * @param maxInput The maximum length of input the text can have.
   * @param inputConstraints The characters the text can contain.
   */
  public
  TextConstrainer(int maxInput, String inputConstraints)
  {
    setConstraints(inputConstraints);
    setMaxLength(maxInput);
  }

  /**
   * Constructs a new constrainer.
   *
   * @param inputConstraints The characters the text can contain.
   */
  public
  TextConstrainer(String inputConstraints)
  {
    this(0, inputConstraints);
  }

  /**
   * This method returns the characters the text can contain. A null string
   * implies that the text can contain anything.
   *
   * @return The characters the text can contain.
   */
  public
  String
  getConstraints()
  {
    return itsConstraints;
  }

  /**
   * This method returns the maximum length of input the text can have. A value
   * of 0 implies that there is no limit.
   *
   * @return The maximum length of input the text can have.
   */
  public
  int


-.42.312-.767 1.07.968 1.12 1.265-1.147.768-1.07zm10.19.8c-.18.022-.37.223-.496.741 1.505.71 1.038-.812.496-.742zm-29.23 2.2c-.195-.017-.468.065-.799.336 1.275.653 1.384-.284.799-.336zm1.763.596c-.079-.03-.238.024-.507.248.277.688.746-.159.507-.248zm6.352 4.022c-.077.018-.179.102-.309.294.492.805.641-.374.309-.294zm-40.133.34c-.073 0-.118.18-.074.695.78.92.293-.698.074-.696zm-.435 1.306c-.074-.012-.183.202-.328.842.44 1.268.547-.805.328-.842zm-2.235.668c-1.553-.159 1.306 2.557 1.418 3.754 2.876.768-.402 1.637 2.03 2.607 3.662 1.305 1.399-1.61-.155-2.224.61-.969-1.544-1.682-2.336-3.88-.423-.152-.735-.234-.957-.257zm45.364.607c-.166 0-.348.3-.424 1.198 1.073.255.787-1.198.424-1.198zm-42.34.647a.079.079 0 00-.063.008c-.084.053-.088.31.145.873l.181.119c.15-.526-.104-.96-.263-1zm39.603.066c-.47.027-.774.238-.44.79l.141.064h.8c2.373-.078.533-.913-.5-.854zm-41.83 2.887c-.21-.044-.24.197.264 1.04 1.539.529.2-.944-.264-1.04zm-4.297.12c.534 2.287.875 4.947 1.866 6.958.654 2.462 1.135-.637 1.298 1.303.555 3.664-1.7 7.44 1.077 10.953 1.32 3.543 4.219 6.026 6.248 9.111C16.432 58.79 12.4 49.668 12.4 39.604c0-.823.035-1.635.088-2.444zm9.573 2.112c-.193.024-.362.226-.409.75 1.763.714.985-.821.409-.75zm2.808 2.887c-.078-.03-.158.315-.21 1.358l.03.574c.625 1.65.414-1.841.18-1.932zm28.06 2.324c-.199-.021-.2.132.352.653 1.478.29.087-.606-.351-.653zm2.15.489c-.093.001-.213.067-.364.238.613.954.76-.245.363-.238zm-.356 1.043c-.141.022-.34.113-.608.314.735.785 1.217-.412.608-.314zm-1.034.152c-.075-.008-.188.101-.343.432.44.67.568-.408.343-.432zm23.377 7.377c-.075-.008-.188.101-.343.432.44.67.568-.409.343-.432zM42.5 90h15v5h-15v-5z" color="currentColor"/></svg>';
  static const String earth_net_o =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" preserveAspectRatio


}

    geometry_msgs::PointStamped intersectionMsg;
    intersectionMsg.header.frame_id = "base_link";
    intersectionMsg.header.stamp = ros::Time::now();
    intersectionMsg.point.x = average_intersection[0];
    intersectionMsg.point.y = average_intersection[1];
    intersectionPubAvg.publish(intersectionMsg);

    for (int i = 0; i < num_wheels; ++i)
    {
      // ignore the wheel if the intersection is on its center of rotation
      if (isclose(average_intersection[0], positions_list[i][0]) &&
          isclose(average_intersection[1], positions_list[i][1]))
      {
        continue;
      }
      auto icr_wh = std::array<double, 2>{ positions_list[i][0] - average_intersection[0],
                                           positions_list[i][1] - average_intersection[1] };

      if (isinf(icr_wh[0]) || isinf(icr_wh[1]))
      {
        // ROS_DEBUG_STREAM("icr_wh is inf! Discarding!");
        continue;
      }
      if (isclose(icr_wh[0], 0) || isclose(icr_wh[1], 0))
      {
        // ROS_DEBUG_STREAM("icr_wh for wheel " << i << " is zero! Discarding!");
        continue;
      }

      double ang_x = (wheel_info[i][0] * wheel_radius * sin(wheel_info[i][1])) / (icr_wh[0]);
      double ang_y = (wheel_info[i][0] * wheel_radius * cos(wheel_info[i][1])) / (icr_wh[1]);
      double ang_computed = ang_x / 2 - ang_y / 2;

      angular += ang_computed;

      if (isinf(angular) || angular > angular_limit_)
      {
        // ROS_WARN_STREAM("angular is the problem");
        return;
      }
    }
    angular /= num_wheels;
    linear_x_vh = average_intersection[1] * angular;
    linear_y_vh = -1 * average_intersection[0] * angular;
  }

  // transform velocities from local to global frame
  linear_x = linear_x_vh * cos(yaw) - linear_y_vh * sin(yaw);
  linear_y = linear_x_vh * sin(yaw) + linear_y_vh * cos(yaw);

  // Filter to remove noise
  linear_x_ = (alpha * linear_x) + (1.0 - alpha) * linear_x_;
  linear_y_ = (alpha * linear_y) + (1.0 - alpha) * linear_y_;
  angular_ = (alpha * angular) + (1.0 - alpha) * angular_;

  /// Integrate odometry:
  yaw += angular_ * deltaT;
  x += linear_x_ * deltaT;
  y += linear_y_ * deltaT;

  // publishes odometry message
  SwerveOdometer::pubOdometry();
}

void SwerveOdometer::pubOdometry()
{
  geometry_msgs::Vector3 linearVelocities;
  linearVelocities.z = 0;
  linearVelocities.x = linear_x_;
  linearVelocities.y = linear_y_;

  // set angular velocities - assuming 2D operation
  geometry_msgs::Vector3 angularVelocities;
  angularVelocities.x = 0.0;
  angularVelocities.y = 0.0;
  angularVelocities.z = angular_;

  nav_msgs::Odometry odom;
  odom.twist.twist.linea


#ifndef ADPCM_H
#define ADPCM_H

#define MAX_ADPCM		16
#define MAX_OKIM6295	(MAX_ADPCM/4)	// 4 voices per chip

/* a generic ADPCM interface, for unknown chips */

struct ADPCMinterface
{
	int num;			       /* total number of ADPCM decoders in the machine */
	int frequency;             /* playback frequency */
	int region;                /* memory region where the samples come from */
	int mixing_level[MAX_ADPCM];     /* master volume */
};

int ADPCM_sh_start(const struct MachineSound *msound);
void ADPCM_sh_stop(void);
void ADPCM_sh_update(void);

void ADPCM_play(int num, int offset, int length);
void ADPCM_setvol(int num, int vol);
void ADPCM_stop(int num);
int ADPCM_playing(int num);

/* an interface for the OKIM6295 and similar chips */

/*
  Note about the playback frequency: the external clock is internally divided,
  depending on pin 7, by 132 (high) or 165 (low). This isn't handled by the
  emulation, so you have to provide the didvided internal clock instead of the
  external clock.
*/
struct OKIM6295interface
{
	int num;                  		/* total number of chips */
	int frequency[MAX_OKIM6295];	/* playback frequency */
	int region[MAX_OKIM6295];		/* memory region where the sample ROM lives */
	int mixing_level[MAX_OKIM6295];	/* master volume */
};

int OKIM6295_sh_start(const struct MachineSound *msound);
void OKIM6295_sh_stop(void);
void OKIM6295_sh_update(void);
void OKIM6295_set_bank_base(int which, int base);
void OKIM6295_set_frequency(int which, int frequency);

READ_HANDLER( OKIM6295_status_0_r );
READ_HANDLER( OKIM6295_status_1_r );
READ_HANDLER( OKIM6295_status_2_r );
READ16_HANDLER( OKIM6295_status_0_lsb_r );
READ16_HANDLER( OKIM6295_status_1_lsb_r );
READ16_HANDLER( OKIM6295_status_2_lsb_r );
READ16_HANDLER( OKIM6295_status_0_msb_r );
READ16_HANDLER( OKIM6295_status_1_msb_r );
READ16_HANDLER( OKIM6295_status_2_msb_r );
WRITE_HANDLER( OKIM6295_data_0_w );
WRITE_HANDLER( OKIM6295_data_1_w );
WRITE_HANDLER( OKIM6295_data_2_w );
WRITE16_HANDLER( OKIM6295_data_0_lsb_w );
WRITE16_HANDLER( OKIM6295_data_1_lsb_w );
WRITE16_HANDLER( OKIM6295_data_2_lsb_w );
WRITE16_HANDLER( OKIM6295_data_0_msb_w );
WRITE16_HANDLER( OKIM6295_data_1_msb_w );
WRITE16_HANDLER( OKIM6295_data_2_msb_w );

#endif


mulps zmm6, zmm27, zmmword ptr [rdx + 8128]

// CHECK: vmulps zmm6, zmm27, zmmword ptr [rdx + 8192]
// CHECK:  encoding: [0x62,0xf1,0x24,0x40,0x59,0xb2,0x00,0x20,0x00,0x00]
          vmulps zmm6, zmm27, zmmword ptr [rdx + 8192]

// CHECK: vmulps zmm6, zmm27, zmmword ptr [rdx - 8192]
// CHECK:  encoding: [0x62,0xf1,0x24,0x40,0x59,0x72,0x80]
          vmulps zmm6, zmm27, zmmword ptr [rdx - 8192]

// CHECK: vmulps zmm6, zmm27, zmmword ptr [rdx - 8256]
// CHECK:  encoding: [0x62,0xf1,0x24,0x40,0x59,0xb2,0xc0,0xdf,0xff,0xff]
          vmulps zmm6, zmm27, zmmword ptr [rdx - 8256]

// CHECK: vmulps zmm6, zmm27, dword ptr [rdx + 508]{1to16}
// CHECK:  encoding: [0x62,0xf1,0x24,0x50,0x59,0x72,0x7f]
          vmulps zmm6, zmm27, dword ptr [rdx + 508]{1to16}

// CHECK: vmulps zmm6, zmm27, dword ptr [rdx + 512]{1to16}
// CHECK:  encoding: [0x62,0xf1,0x24,0x50,0x59,0xb2,0x00,0x02,0x00,0x00]
          vmulps zmm6, zmm27, dword ptr [rdx + 512]{1to16}

// CHECK: vmulps zmm6, zmm27, dword ptr [rdx - 512]{1to16}
// CHECK:  encoding: [0x62,0xf1,0x24,0x50,0x59,0x72,0x80]
          vmulps zmm6, zmm27, dword ptr [rdx - 512]{1to16}

// CHECK: vmulps zmm6, zmm27, dword ptr [rdx - 516]{1to16}
// CHECK:  encoding: [0x62,0xf1,0x24,0x50,0x59,0xb2,0xfc,0xfd,0xff,0xff]
          vmulps zmm6, zmm27, dword ptr [rdx - 516]{1to16}

// CHECK: vmulsd xmm23, xmm29, xmm22
// CHECK:  encoding: [0x62,0xa1,0x97,0x00,0x59,0xfe]
          vmulsd xmm23, xmm29, xmm22

// CHECK: vmulsd xmm23 {k5}, xmm29, xmm22
// CHECK:  encoding: [0x62,0xa1,0x97,0x05,0x59,0xfe]
          vmulsd xmm23 {k5}, xmm29, xmm22

// CHECK: vmulsd xmm23 {k5} {z}, xmm29, xmm22
// CHECK:  encoding: [0x62,0xa1,0x97,0x85,0x59,0xfe]
          vmulsd xmm23 {k5} {z}, xmm29, xmm22

// CHECK: vmulsd xmm23, xmm29, xmm22, {rn-sae}
// CHECK:  encoding: [0x62,0xa1,0x97,0x10,0x59,0xfe]
          vmulsd xmm23, xmm29, xmm22, {rn-


        match lang {
            Lang::English => "Add Reader",
            Lang::Russian => "Добавить читателя",
        },
        match lang {
            Lang::English => "First Name",
            Lang::Russian => "Имя",
        },
        match lang {
            Lang::English => "Second Names",
            Lang::Russian => "Фамилия",
        },
        match lang {
            Lang::English => "Middle Name",
            Lang::Russian => "Отчество",
        },
        match lang {
            Lang::English => "Info (< 50 symb.)",
            Lang::Russian => "Инфо (< 50 симв.)",
        },
    );

    caretaker.add_memento(reader_base, book_system, genres);

    inp.show();
    (*inp.ok).borrow_mut().emit(s2, true);

    while app.wait() {
        if let Some(message) = r2.recv() {
            if message {
                inp.hide();

                if let Ok(reader) = inp.set_input(lang) {
                    if empty_inp_reader(&reader, lang) {
                        caretaker.pop().unwrap();
                        return;
                    }

                    let mut win = fltk::window::SingleWindow::new(
                        800,
                        500,
                        200,
                        100,
                        match lang {
                            Lang::English => "Choose birth date",
                            Lang::Russian => "Выберите дату рождения",
                        },
                    );

                    let _ = fltk::frame::Frame::new(
                        30,
                        10,
                        150,
                        50,
                        match lang {
                            Lang::English => "Choose birth date",
                            Lang::Russian => "Выберите дату рождения",
                        },
                    );

                    let mut but = fltk::button::Button::new(
                        80,
                        60,
                        60,
                        20,
                        match lang {
                            Lang::English => "OK",
                            Lang::Russian => "ОК",
                        },
                    );

                    win.end();
                    win.show();

                    let (sd, rd) = app::channel();
                    but.emit(sd, true);

                    while app.wait() {
                        if let Some(msg) = rd.recv() {
                            if msg {
                                win.hide();

                                match Calendar::default().get_date() {
                                    Some(date) => {
                                        match reader_base.add_reader(
                                            unsafe { reader.get_unchecked(0).trim().to_string() },
                                            unsafe { reader.get_unchecked(1).trim().to_string() },
                                            unsafe { reader.get_unchecked(2).trim().to_string() },
                                            unsafe {
                                                reader.get_unchecked(3).trim()
                                                    [0..min(50, reader.get_unchecked(3).len())]
                                                    .split('\n')
                                                    .collect::<Vec<_>>()
                                                    .into_iter()
                                                    .fold("".to_string(), |acc, s| acc + " " + s)
                                            },
                                            Date::from(date),
                                        ) {
                                            Ok(_) => {
                                                fltk::dialog::message(
                                                    500,
                                                    500,
                                                    match lang {
                                                        Lang::English => "Successfully added",
                                                        Lang::Russian => "Успешно добавлено",
                                                    },
                                                );
                                                reader_base.save();
                                            }

                                            Err(_) => {
                                                alert(


-left: 15px solid #FF9955;
  margin-left: -15px;
  font-family: 'Open Sans', sans-serif;
}

.pane-view .collection-list-view .model-view {
  width: 100%;
  background-color: transparent;
  font-size: 75%;
}

.pane-view .collection-list-view .model-view.actionpending .main-content-inner,
.pane-view .collection-list-view .model-view.subactionpending .main-content-inner,
.pane-view .collection-list-view .model-view.hovered .main-content-inner,
.pane-view .collection-list-view .model-view:hover .main-content-inner {
  background-color: #A1C8DB;
}

.pane-view .collection-list-view .model-view .main-content.inner .state-indicator {
  top: 5px;
}

.pane-view .collection-list-view .model-view .main-content .state-indicator {
  width: 50px;
  position: absolute;
  top: 46px;
  right: 5px;
}

.pane-view .collection-list-view .model-view .main-content .title {
  font-weight: normal;
}

.pane-view .collection-list-view .model-view .main-content {
}

.pane-view .collection-list-view .model-view:last-child .main-content {
  border-bottom: none;
}

.pane-view .collection-list-view .model-view .main-content {
  width: 520px;
  padding-bottom: 5px;
  margin-bottom: 5px;
  float: left;
  border-bottom: 1px solid #D1E7F0;
}

.pane-view .collection-list-view .model-view .main-content-inner {
  padding: 20px 20px;
  padding-right: 10px;
  padding-top: 20px;
  /*overflow: hidden;*/
}

.pane-view .collection-list-view .model-view .main-content .logo {
  float: left;
}

.pane-view .collection-list-view .model-view .main-content .entry-right {
  position: relative;
}

.pane-view .collection-list-view .model-view .main-content .entry {
  width: 290px;
  padding-top: 5px;
  margin-left: 10px;
  float: left;
  position: relative;
}

.model-item .actions-content.inline {
  padding-top: 6px;
  position: absolute;
  right: 0px;
  font-size: 1.2em;
  height: 26px;
  width: 182px;
}

.pane-view .collection-list-view .model-view .main-content .actions-content {
  width: 80px;
  float: left;
}

.pane-view .collection-list-view .model-item .link {
  color: #4085A5;
}

.collection .no-available a {
  color: #aaa;
}

.collection .select-item span.available {
  font-size: 0.9em;
  float: right;
}

.collection span.no-available {
}

.collection span.no-available {
  float: right;
}

.collection .no-available {
  font-size: 0.8em;
  color: #f00;
}

.collection .empty-list {
  padding: 10px;
  padding-top:6px;
  padding-left: 10px;
  font-size: 0.8em;
  color: #333;
}

.collection-list-view .items-sublist:first-child {
  padding-top: 0;
}

.collection-list-view .items-sublist {
  padding-top: 10px;
}

.collection-list-view .items-sublist:last-child {
  margin-top:


              requestedStatuses.isNullOrEmpty()
                || requestedStatuses.contains(it.status)
                || (requestedStatuses.contains(MdArtifactStatusInEnvironment.CURRENT) && it.isCurrent == true)
              ) &&
              (requestedVersionIds.isNullOrEmpty() || requestedVersionIds.contains(it.version))
          }.let {
            if (requestedLimit != null) {
              it.take(requestedLimit)
            } else {
              it
            }
          }
      }.toMutableMap()
    }
  }
}

//empty list means give me all statuses
data class ArtifactAndEnvironment(
  val artifact: DeliveryArtifact,
  val environmentName: String,
)

fun PublishedArtifactInEnvironment.toDgs() =
  MdArtifactVersionInEnvironment(
    id = "${environmentName}-${publishedArtifact.reference}-${publishedArtifact.version}",
    version = publishedArtifact.version,
    buildNumber = publishedArtifact.buildNumber,
    createdAt = publishedArtifact.createdAt,
    deployedAt = deployedAt,
    gitMetadata = if (publishedArtifact.gitMetadata == null) {
      null
    } else {
      publishedArtifact.gitMetadata?.toDgs()
    },
    environment = environmentName,
    reference = publishedArtifact.reference,
    status = MdArtifactStatusInEnvironment.valueOf(status.name),
    isCurrent = isCurrent
  )

package com.netflix.spinnaker.keel.preview

import com.netflix.spinnaker.keel.api.ec2.AllPorts
import com.netflix.spinnaker.keel.api.ec2.ApplicationLoadBalancerSpec.TargetGroup
import com.netflix.spinnaker.keel.api.ec2.ReferenceRule
import com.netflix.spinnaker.keel.api.ec2.SecurityGroupRule.Protocol.TCP
import com.netflix.spinnaker.keel.api.ec2.SecurityGroupRule.Protocol.UDP
import com.netflix.spinnaker.keel.test.applicationLoadBalancer
import com.netflix.spinnaker.keel.test.classicLoadBalancer
import com.netflix.spinnaker.keel.test.ec2Cluster
import com.netflix.spinnaker.keel.test.randomString
import com.netflix.spinnaker.keel.test.securityGroup
import com.netflix.spinnaker.keel.test.titusCluster
import org.junit.jupiter.api.Test
import strikt.api.expectThat
import strikt.assertions.all
import strikt.assertions.endsWith
import strikt.assertions.isEqualTo
import strikt.assertions.isLessThanOrEqualTo

internal class ResourceRenamingTests {
  private val securityGroup = securityGroup().run {
    copy(
      spec = spec.copy(
        inboundRules = setOf(
          ReferenceRule(protocol = TCP, name = name, portRange = AllPorts),
          ReferenceRule(protocol = UDP, name = name, portRange = AllPorts)
        )
      )
    )
  }

  private val applicationLoadBalancer = applicationLoadBalancer().run {
    copy(
      spec = spec.copy(
        targetGroups = setOf(
          TargetGroup(name = "tg1", port = 80),
          TargetGroup(name = "tg2", port = 443)
        )
      )
    )
  }

  private val classicLoadBalancer = classicLoadBalancer()
  private val titusCluster = titusCluster()
  private val ec2Cluster = ec2Cluster()

  @Test
  fun `deep renaming a security group renames the security group and self-referencing ingress rules`() {
    expectThat(securityGroup.deepRename("suffix"))
      .run {
        get { name }.endsWith("-suffix")
        get { id }.endsWith("-suffix")
        get { metadata["id"] as String }.endsWith("-suffix")
        get { spec.inboundRu


equire.Equal(t, Version, got)
		}
		{
			// read meta:
			numMeta, err := reader.ReadUint64(bin.LE)
			require.NoError(t, err)
			require.Equal(t, uint64(1), numMeta)

			key, err := reader.ReadString()
			require.NoError(t, err)
			require.Equal(t, "epoch", key)

			value, err := reader.ReadString()
			require.NoError(t, err)
			require.Equal(t, "test", value)
		}
		// numPrefixes:
		numPrefixes, err := reader.ReadUint64(bin.LE)
		require.NoError(t, err)
		require.Equal(t, uint64(3), numPrefixes)
		// prefix -> offset:
		prefixToOffset := make(map[[2]byte]uint64)
		{
			for i := 0; i < int(numPrefixes); i++ {
				var prefix [2]byte
				_, err := reader.Read(prefix[:])
				require.NoError(t, err)
				offset, err := reader.ReadUint64(bin.LE)
				require.NoError(t, err)
				prefixToOffset[prefix] = offset
			}
		}
		{
			require.Equal(t,
				map[[2]uint8]uint64{
					{0x1, 0x2}:  0x0,
					{0x16, 0x2}: 0x1c,
					{0x63, 0x2}: 0x28,
				}, prefixToOffset)
		}
		contentBuf, err := reader.ReadNBytes(reader.Remaining())
		require.NoError(t, err)
		require.Equal(t,
			[]byte{
				0x3, 0x0, 0x0, 0x0, // num entries
				0x49, 0xd7, 0xaf, 0x9e, 0x94, 0x4d, 0x9a, 0x6f,
				0x2f, 0x12, 0xdb, 0x5b, 0x1, 0x62, 0xae, 0x1a,
				0x3b, 0xb6, 0x71, 0x5f, 0x4, 0x4f, 0x36, 0xf2,
				0x1, 0x0, 0x0, 0x0, // num entries
				0x58, 0xe1, 0x9d, 0xde, 0x7c, 0xfb, 0xeb, 0x5a,
				0x1, 0x0, 0x0, 0x0, // num entries
				0x4c, 0xbd, 0xa3, 0xed, 0xd3, 0x8b, 0xa8, 0x44,
			},
			contentBuf,
		)
		contentReader := bin.NewBorshDecoder(contentBuf)
		{
			for prefix, offset := range prefixToOffset {
				// Now read the bucket:
				{
					err := contentReader.SetPosition(uint(offset))
					require.NoError(t, err)
					numHashes, err := contentReader.ReadUint32(bin.LE)
					require.NoError(t, err)
					switch prefix {
					case [2]byte{1, 2}:
						require.Equal(t, uint32(3), numHashes)
					case [2]byte{22, 2}:
						require.Equal(t, uint32(1), numHashes)
					case [2]byte{99, 2}:
						require.Equal(t, uint32(1), numHashes)
					}

					for i := 0; i < int(numHashes); i++ {
						hash, err := contentReader.ReadUint64(bin.LE)
						require.NoError(t, err)
						found := false
						for _, h := range wr.prefixToHashes[prefix] {
							if h == hash {
								found = true
								break
							}
						}


portrait."],
				order = 4,
				values = {
					["2D"] = L["2D"],
					["3D"] = L["3D"]
				}
			},
			width = {
				order = 5,
				type = "range",
				name = L["Width"],
				min = 15, max = 150, step = 1
			}
		}
	}

	return config
end

local function GetOptionsTable_Castbar(hasTicks, updateFunc, groupName, numUnits)
	local config = {
		order = 700,
		type = "group",
		name = L["Castbar"],
		get = function(info) return E.db.unitframe.units[groupName].castbar[ info[#info] ] end,
		set = function(info, value) E.db.unitframe.units[groupName].castbar[ info[#info] ] = value updateFunc(UF, groupName, numUnits) end,
		args = {
			header = {
				order = 1,
				type = "header",
				name = L["Castbar"]
			},
			matchsize = {
				order = 2,
				type = "execute",
				name = L["Match Frame Width"],
				func = function() E.db.unitframe.units[groupName].castbar.width = E.db.unitframe.units[groupName].width updateFunc(UF, groupName, numUnits) end
			},
			forceshow = {
				order = 3,
				type = "execute",
				name = L["Show"].." / "..L["Hide"],
				func = function()
					local frameName = E:StringTitle(groupName)
					frameName = "ElvUF_"..frameName
					frameName = frameName:gsub("t(arget)", "T%1")

					if groupName == "party" then
						local header = UF.headers[groupName]
						for i = 1, header:GetNumChildren() do
							local group = select(i, header:GetChildren())
							for j = 1, group:GetNumChildren() do
								--Party unitbutton
								local unitbutton = select(j, group:GetChildren())
								local castbar = unitbutton.Castbar
								if not castbar.oldHide then
									castbar.oldHide = castbar.Hide
									castbar.Hide = castbar.Show
									castbar:Show()
								else
									castbar.Hide = castbar.oldHide
									castbar.oldHide = nil
									castbar:Hide()
								end
							end
						end
					elseif numUnits then
						for i = 1, numUnits do
							local castbar = _G[frameName..i].Castbar
							if not castbar.oldHide then
								castbar.oldHide = castbar.Hide
								castbar.Hide = castbar.Show
								castbar:Show()
							else
								castbar.Hide = castbar.oldHide
								castbar.oldHide = nil
								castbar:Hide()
							end
						end
					else
						local castbar = _G[frameName].Castbar
						if not castbar.oldHide then
							castbar.oldHide = castbar.Hide
							castbar.Hide = castbar.Show
							castbar:Show()
						else
							castbar.Hide = castbar.oldHide
							castbar.oldHide = nil
							castbar:Hide()
						end
					end
				end
			},
			configureButton = {
				order = 4,
				type = "execute",
				name = L["Coloring"],
				desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
				func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "castBars") end,
			},
			enable = {
				order = 5,
				type = "toggle",
				name = L["Enable"]
			},
			width = {
				order = 6,
				type = "range",
				name = L["Width"],
 				softMax = 600,
				min = 50, max = GetScreenWidth(), step = 1
			},
			height = {
				order = 7,
				type = "range",


      ArUcoDrone otherdrone = hitinfo.transform.GetComponent<ArUcoDrone>();
        if(otherdrone != null && otherdrone != spawningDrone)
        {
            otherdrone.TakeDamage(damage);
        }

        if(explosionPrefab)
        {
            Quaternion explosionrotation = (hitinfo.normal.sqrMagnitude <= 0.001f) ? Quaternion.identity : Quaternion.LookRotation(hitinfo.normal, Vector3.up);
            GameObject explosion = Instantiate(explosionPrefab, hitinfo.point, explosionrotation);
        }

        base.OnHitVirtualWorld(hitinfo); //Destroy.
    }

    /// <summary>
    /// Called when the projectile hits the real world. Creates an explosion and destroys the projectile.
    /// </summary>
    public override void OnHitRealWorld(Vector3 collisionpoint, Vector3 collisionnormal)
    {
        if (explosionPrefab)
        {
            Quaternion explosionrotation = (collisionnormal.sqrMagnitude <= 0.001f) ? Quaternion.identity : Quaternion.LookRotation(collisionnormal, Vector3.up);
            GameObject explosion = Instantiate(explosionPrefab, collisionpoint, explosionrotation);
        }

        base.OnHitRealWorld(collisionpoint, collisionnormal); //Destroy.
    }
}


piInterceptor())
                        .connectTimeout(5000, TimeUnit.MILLISECONDS)
                        .build()
                sInstance = Retrofit.Builder()
                        .baseUrl(NEWS_BASE_URL)
                        .client(client)
                        .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                        .addConverterFactory(GsonConverterFactory.create())
                        .build()
                        .create(NewsApi::class.java)
            }
            return sInstance!!
        }

        fun createGson(): Gson {
            if (gson == null) {
                gson = Gson()
            }
            return gson!!
        }
    }
}import org.gradle.api.artifacts.dsl.RepositoryHandler
import java.net.URI

/**
 * Created by idisfkj on 2019/5/29.
 * Email : idisfkj@gmail.com.
 */
object Versions {
    const val kotlin = "1.9.20"
    const val constraint_layout = "2.1.3"
    const val runner = "1.1.0"
    const val espresso_core = "3.1.0"
    const val junit = "4.12"
    const val gradle = "7.2.2"
    const val target_sdk = 31
    const val min_sdk = 21
    const val build_tools = "30.0.3"
    const val arch_version = "2.4.1"
    const val arch_room_version = "2.4.1"
    const val paging_version = "2.1.0"
    const val anko_version = "0.10.8"
    const val glide = "4.8.0"
    const val retrofit = "2.6.0"
    const val okhttp_logging_interceptor = "3.9.0"
    const val rx_android = "2.0.1"
    const val rxjava2 = "2.1.3"
    const val work_version = "2.7.0"
    const val nav_version = "2.3.5"
    const val core_ktx = "1.7.0"
    const val activity_compose = "1.3.1"
    const val common_compose = "1.1.1"
    const val lifecycle_viewmodel_compose = "2.4.1"
    const val constraint_layout_compose = "1.0.0"
}

object Dependencies {
    const val kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
    const val kotlin_plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
    const val junit = "junit:junit:${Versions.junit}"
    const val constraint_layout = "com.android.support.constraint:constraint-layout:${Versions.constraint_layout}"
    const val runner = "com.android.support.test:runner:${Versions.runner}"
    const val espresso_core = "com.android.support.test.espresso:espresso-core:${Versions.espresso_core}"
    const val gradle_plugin = "com.android.tools.build:gradle:${Versions.gradle}"
    const val arch_viewmodel = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.arch_version}"
    const val arch_livedata = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.arch_version}"
    const val arch_runtime = "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.arch_version}"
    const val lifecycle_compiler = "androidx.lifecycle:lifecycle-compiler:${Versions.arch_version}"
    const val arch_room_runtime = "androidx.room:room-runtime:${Versions.arch_room_version}"
    const val arch_room_compiler = "androidx.room:room-compiler:${Versions.arch_room_version}"
    const val arch_room = "androidx.room:room-ktx:${Versions.arch_room_version}"
    const val paging_runtime = "androidx.paging:paging-runtime:${Versions.paging_version}"
    const val anko = "org.jetbrains.anko:


        } catch (IOException e) {
          LOG.error("{}", e);
        }
      }

      LOG.info("Allocated containers: {}", containers.size());

      // build container reports based on container info returned
      totalContainers = containers.size();
      containersPerReport = totalContainers / numDatanodes;
      int from = 0;
      for (int i = 0; i < getNumThreads(); i++) {
        datanodes.get(i).buildContainerReports(containers.subList(
            from, Math.min(from + containersPerReport, totalContainers)));
        from += containersPerReport;
      }

      getScmReportProcessed();
      reportSuccProcessedOnRegister = this.succReportsProcessed;
      reportFailProcessedOnRegister = this.failReportsProcessed;
      this.succReportsProcessed = 0;
      this.failReportsProcessed = 0;

      super.prepare();
      for (int i = 0; i < getNumThreads(); i++) {
        enqueueTask(new ReportTask(datanodes.get(i), numReportRounds));
      }
    }

    @Override
    public void showSummary() {
      super.showSummary();

      long execSecs = TimeUnit.SECONDS.convert(getExecTime(),
          TimeUnit.NANOSECONDS);
      float reportsPerSec = execSecs > 0 ?
          (float) succReportsProcessed / execSecs : succReportsProcessed;

      System.out.println("***************************************");
      System.out.printf("Total container reports processed: %d%n",
          succReportsProcessed);
      System.out.printf("Total container reports failed: %d%n",
          failReportsProcessed);
      System.out.printf("Containers per report: %d%n", containersPerReport);
      System.out.printf("Execution Time: %s%n", getFormattedTime());
      System.out.printf("Throughput: %f (ops)%n", reportsPerSec);
      System.out.println("***************************************");
    }

    @Override
    public void waitForComplete() throws InterruptedException {
      while (succReportsProcessed + failReportsProcessed < numReports) {
        Thread.sleep(CHECK_INTERVAL_MILLIS);
        LOG.info("Processing reports: ({}+{})/{}",
            succReportsProcessed, failReportsProcessed, numReports);
        getScmReportProcessed();
      }
    }

    private void getScmReportProcessed() {
      List<String> metricsLines = getScmReportProcessedMetricsLines();
      for (String line : metricsLines) {
        if (line.startsWith("#")) {
          continue;
        }
        if (line.startsWith(REPORT_SUCC_KEY)) {
          this.succReportsProcessed = Integer.parseInt(getMetricsValue(line))
              - this.reportSuccProcessedOnRegister;
        }
        if (line.startsWith(REPORT_FAIL_KEY)) {
          this.failReportsProcessed = Integer.parseInt(getMetricsValue(line))
              - this.reportFailProcessedOnRegister;
        }
      }
    }

    private List<String> getScmReportProcessedMetricsLines() {
      HttpClient client = HttpClientBuilder.create().build();
      String uri = String.format("http://%s:%d/prom", scm,
          ScmConfigKeys.OZONE_SCM_HTTP_BIND_PORT_DEFAULT);
      HttpGet get = new HttpGet(uri);
      try {
        HttpResponse execute = client.execute(get);
        if (execute.getStatusLine().getStatusCode() != 200) {
          throw new RuntimeException(
              "Can't read prometheus metrics endpoint" + execute.getStatusLine()
                  .getStatusCode());
        }
        try (BufferedReader bufferedReader = new BufferedReader(
            new InputStreamReader(execute.getEntity().getContent(),
                StandardCharsets.UTF_8))) {
          return bufferedReader.lines().collect(Collectors.toList());
        }
      } catch (IOException e) {
        throw new Runtim


e_ES2015_in_your_lib_option:_.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),c)}function hZe(n){let a=wo(0,"NewTargetExpression"),c=wo(4,"target",8);c.parent=a,c.links.type=n;let u=Ua([c]);return a.members=u,ls(a,u,Je,Je,Je)}function rU(n,a){if(!n.body)return ve;let c=pl(n),u=(c&2)!==0,p=(c&1)!==0,h,T,k,O=yt;if(n.body.kind!==238)h=Ic(n.body,a&&a&-9),u&&(h=VC(OD(h,!1,n,_.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(p){let H=CIe(n,a);H?H.length>0&&(h=Gr(H,2)):O=lt;let{yieldTypes:J,nextTypes:de}=gZe(n,a);T=vt(J)?Gr(J,2):void 0,k=vt(de)?so(de):void 0}else{let H=CIe(n,a);if(!H)return c&2?WM(n,lt):lt;if(H.length===0)return c&2?WM(n,yt):yt;h=Gr(H,2)}if(h||T||k){if(T&&CB(n,T,3),h&&CB(n,h,1),k&&CB(n,k,2),h&&O_(h)||T&&O_(T)||k&&O_(k)){let H=Nre(n),J=H?H===rp(n)?p?void 0:h:BB(qo(H),n,void 0):void 0;p?(T=Zne(T,J,0,u),h=Zne(h,J,1,u),k=Zne(k,J,2,u)):h=CXe(h,J,u)}T&&(T=Sd(T)),h&&(h=Sd(h)),k&&(k=Sd(k))}return p?EIe(T||lt,h||O,k||cCe(2,n)||ue,u):u?HM(h||O):h||O}function EIe(n,a,c,u){let p=u?ft:Yt,h=p.getGlobalGeneratorType(!1);if(n=p.resolveIterationType(n,void 0)||ue,a=p.resolveIterationType(a,void 0)||ue,c=p.resolveIterationType(c,void 0)||ue,h===ro){let T=p.getGlobalIterableIteratorType(!1),k=T!==ro?pLe(T,p):void 0,O=k?k.returnType:Se,H=k?k.nextType:Oe;return to(a,O)&&to(H,c)?T!==ro?iD(T,[n]):(p.getGlobalIterableIteratorType(!0),Ki):(p.getGlobalGeneratorType(!0),Ki)}return iD(h,[n,a,c])}function gZe(n,a){let c=[],u=[],p=(pl(n)&2)!==0;return Yse(n.body,h=>{let T=h.expression?Yi(h.expression,a):je;Rf(c,TIe(h,T,Se,p));let k;if(h.asteriskToken){let O=_U(T,p?19:17,h.expression);k=O&&O.nextType}else k=Ru(h,void 0);k&&Rf(u,k)}),{yieldTypes:c,nextTypes:u}}function TIe(n,a,c,u){let p=n.expression||n,h=n.asteriskToken?wy(u?19:17,a,c,p):a;return u?rT(h,p,n.asteriskToken?_.Type_of_iterated_elements


vate suspend fun appendWeights(tensor: TFJSTensor?, graph: TFJSGraph, operator: Operator<TFJSData<*>, TFJSData<*>>) {
        if (tensor == null) {
            logger.warning { "Add weights to the model's initializers, otherwise the LSTM operator inference will be slower than expected" }
        } else {
            val preparedWeights = prepareWeights(tensor)
            graph.addTensorToContext(preparedWeights)

            operator.renameInput(tensor.name!!, preparedWeights.name!!)
            tryRemoveDefaultInitializer(graph, tensor.name!!)
        }
    }

    private suspend fun appendBias(tensor: TFJSTensor?, graph: TFJSGraph, operator: Operator<TFJSData<*>, TFJSData<*>>) {
        if (tensor == null) {
            logger.warning { "Add bias to the model's initializers, otherwise the LSTM operator inference will be slower than expected" }
        } else {
            val preparedBias = prepareBias(tensor)
            graph.addTensorToContext(preparedBias)

            operator.renameInput(tensor.name!!, preparedBias.name!!)
            tryRemoveDefaultInitializer(graph, tensor.name!!)
        }
    }

    private suspend fun appendPeepholes(tensor: TFJSTensor?, graph: TFJSGraph, operator: Operator<TFJSData<*>, TFJSData<*>>) {
        if (tensor == null) {
            logger.warning { "Add peepholes to the model's initializers, otherwise the LSTM operator inference will be slower than expected" }
        } else {
            val preparedPeepholes = preparePeepholes(tensor)
            graph.addTensorToContext(preparedPeepholes)

            operator.renameInput(tensor.name!!, preparedPeepholes.name!!)
            tryRemoveDefaultInitializer(graph, tensor.name!!)
        }
    }

    override fun shouldApply(graph: Graph<TFJSData<*>>, operator: Operator<TFJSData<*>, TFJSData<*>>): Boolean {
        return operator is LSTM
    }

    override suspend fun transform(graph: Graph<TFJSData<*>>, operator: Operator<TFJSData<*>, TFJSData<*>>) {
        graph as TFJSGraph
        val initializers = graph.initializers as List<TFJSTensor>

        val weightsInit = initTensorByDefaultName("W", operator, initializers)
        val recurrentWeightsInit = initTensorByDefaultName("R", operator, initializers)
        val biasInit = initTensorByDefaultName("B", operator, initializers)
        val peepholesInit = initTensorByDefaultName("P", operator, initializers)

        appendWeights(weightsInit, graph, operator)
        appendWeights(recurrentWeightsInit, graph, operator)
        appendBias(biasInit, graph, operator)
        appendPeepholes(peepholesInit, graph, operator)
    }
}
package io.kinference.operators.reduce

import io.kinference.KITestEngine.KIAccuracyRunner
import io.kinference.utils.TestRunner
import kotlin.test.Test

class ReduceL2Ver18Test {
    private fun getTargetPath(dirName: String) = "reduce_l2/v18/$dirName/"

    @Test
    fun test_reduce_l2_default_axes_keepdims_example()  = TestRunner.runTest {
        KIAccuracyRunner.runFromResources(getTargetPath("test_reduce_l2_default_axes_keepdims_example"))
    }

    @Test
    fun test_reduce_l2_default_axes_keepdims_example_expanded()  = TestRunner.runTest {
        KIAccuracyRunner.runFromResources(getTargetPath("test_reduce_l2_default_axes_keepdims_example_expanded"))
    }

    @Test
    fun test_reduce_l2_default_axes_


ge.json'

describe('Distribution', () => {
  it('Name and description', () => {
    expect(packageJson).toHaveProperty('name')
    expect(packageJson).toHaveProperty('description')
  })

  it('Main entry point', () => {
    expect(fs.existsSync(packageJson.main)).toBe(true)
  })

  it('Type definitions', () => {
    expect(fs.existsSync(packageJson.types)).toBe(true)
  })
})

describe('Community', () => {
  it('README', () => {
    const filenames = ['README', 'README.md']
    expect(filenames.some(fs.existsSync)).toBe(true)
  })

  it('Code of conduct', () => {
    const filenames = ['CODE_OF_CONDUCT', 'CODE_OF_CONDUCT.md']
    expect(filenames.some(fs.existsSync)).toBe(true)
  })

  it('Contributing guidelines', () => {
    const filenames = ['CONTRIBUTING', 'CONTRIBUTING.md']
    const locations = ['.', '.github']

    expect(
      filenames.some((filename) => {
        return locations.some((location) => {
          return fs.existsSync(path.resolve(location, filename))
        })
      }),
    )
  })

  it('License', () => {
    expect(packageJson).toHaveProperty('license')

    const filenames = ['LICENSE', 'LICENSE.md']
    expect(filenames.some(fs.existsSync)).toBe(true)
  })
})
import { animate, animation, AnimationTriggerMetadata, keyframes, style, transition, trigger } from '@angular/animations';

import { IAnimationOptions } from '../common/interfaces';
import { useAnimationIncludingChildren } from '../common/use-animation-including-children';

export interface IFlipInYAnimationOptions extends IAnimationOptions {
  /**
   * Angle -number of degrees from which to start animation.
   *
   * Default 90
   */
  degrees?: number;
}

const flipInY = () =>
  animation([
    animate(
      '{{duration}}ms {{delay}}ms',
      keyframes([
        style({
          visibility: 'visible',
          transform: 'perspective(400px) rotate3d(0, 1, 0, {{degrees}}deg)',
          opacity: 0,
          easing: 'ease-in',
          offset: 0
        }),
        style({ transform: 'perspective(400px) rotate3d(0, 1, 0, -20deg)', opacity: 0.5, easing: 'ease-in', offset: 0.4 }),
        style({ transform: 'perspective(400px) rotate3d(0, 1, 0, 10deg)', opacity: 1, easing: 'ease-in', offset: 0.6 }),
        style({ transform: 'perspective(400px) rotate3d(0, 1, 0, -5deg)', easing: 'ease', offset: 0.8 }),
        style({ transform: 'perspective(400px)', easing: 'ease', offset: 1 })
      ])
    )
  ]);

const DEFAULT_DURATION = 1000;

export function flipInYAnimation(options?: IFlipInYAnimationOptions): AnimationTriggerMetadata {
  return trigger((options && options.anchor) || 'flipInY', [
    transition(
      '0 => 1',
      [style({ visibility: 'hidden' }), style({ 'backface-visibility': 'visible' }), ...useAnimationIncludingChildren(flipInY(), options)],
      {
        params: {
          delay: (options && options.delay) || 0,
          duration: (options && options.duration) || DEFAULT_DURATION,
          degrees: (options && options.degrees) || 90
        }
      }
    )
  ]);
}

export function flipInYOnEnterAnimation(options?: IFlipInYAnimationOptions): AnimationTriggerMetadata {
  return trigger((options && options.anchor) || 'flipInYOnEnter', [
    transition(
      ':enter',
      [style({ visibility: 'hidden' }), style({ 'backface-visibility': 'visible' }), ...useAnimationIncludingChildren(flipInY(), options)],
      {
        params: {
          delay: (options && options.delay) || 0,
          duration: (options && options.duration) || DEFAULT_DURATION,
          degrees: (options && options.degrees) || 90
        }
      }
    )
  ]);
}
import {sheets_v4} from 'googleapis';
import {SP


inue;
						} else {
							break;
						}
					}

					return result;
				};

				DoubleArray.prototype.traverse = function (parent, code) {
					var child = this.bc.getBase(parent) + code;
					if (this.bc.getCheck(child) === parent) {
						return child;
					} else {
						return NOT_FOUND;
					}
				};

				DoubleArray.prototype.size = function () {
					return this.bc.size();
				};

				DoubleArray.prototype.calc = function () {
					return this.bc.calc();
				};

				DoubleArray.prototype.dump = function () {
					return this.bc.dump();
				};

				// Array utility functions

				var newArrayBuffer = function (signed, bytes, size) {
					if (signed) {
						switch (bytes) {
							case 1:
								return new Int8Array(size);
							case 2:
								return new Int16Array(size);
							case 4:
								return new Int32Array(size);
							default:
								throw new RangeError("Invalid newArray parameter element_bytes:" + bytes);
						}
					} else {
						switch (bytes) {
							case 1:
								return new Uint8Array(size);
							case 2:
								return new Uint16Array(size);
							case 4:
								return new Uint32Array(size);
							default:
								throw new RangeError("Invalid newArray parameter element_bytes:" + bytes);
						}
					}
				};

				var arrayCopy = function (src, src_offset, length) {
					var buffer = new ArrayBuffer(length);
					var dstU8 = new Uint8Array(buffer, 0, length);
					var srcU8 = src.subarray(src_offset, length);
					dstU8.set(srcU8);
					return dstU8;
				};

				/**
				 * Convert String (UTF-16) to UTF-8 ArrayBuffer
				 *
				 * @param {String} str UTF-16 string to convert
				 * @return {Uint8Array} Byte sequence encoded by UTF-8
				 */
				var stringToUtf8Bytes = function (str) {

					// Max size of 1 character is 4 bytes
					var bytes = new Uint8Array(new ArrayBuffer(str.length * 4));

					var i = 0, j = 0;

					while (i < str.length) {
						var unicode_code;

						var utf16_code = str.charCodeAt(i++);
						if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) {
							// surrogate pair
							var upper = utf16_code;           // high surrogate
							var lower = str.charCodeAt(i++);  // low surrogate

							if (lower >= 0xDC00 && lower <= 0xDFFF) {
								unicode_code =
									(upper - 0xD800) * (1 << 10) + (1 << 16) +
									(lower - 0xDC00);
							} else {
								// malformed surrogate pair
								return null;
							}
						} else {
							// not surrogate code
							unicode_code = utf16_code;
						}

						if (unicode_code < 0x80) {
							// 1-byte
							bytes[j++] = unicode_code;

						} else if (unicode_code < (1 << 11)) {
							// 2-byte
							bytes[j++] = (unicode_code >>> 6) | 0xC0;
							bytes[j++] = (unicode_code & 0x3F) | 0x80;

						} else if (unicode_code < (1 << 16)) {
							// 3-byte
							bytes[j++] = (unicode_code >>> 12) | 0xE0;
							bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80;
							bytes[j++] = (unicode_code & 0x3F) | 0x80;

						} else if (unicode_code < (1 << 21)) {
							// 4-byte
							bytes[j++] = (unicode_code >>> 18) | 0xF0;
							bytes[j++] = ((unicode_code >> 12) & 0x3F) | 0x80;


owerTranslucent, BlockTFTowerTranslucent.META_FAKE_GOLD, 2);
    				worldObj.setBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord + 0, TFBlocks.towerTranslucent, BlockTFTowerTranslucent.META_FAKE_GOLD, 2);

    			}

    			// primary burst
    			int primary = counter - 80;

    			if (primary >= offset && primary <= 249)
    			{
    				drawBlob(this.xCoord, this.yCoord, this.zCoord, (primary - offset) / 40, Blocks.air, 0, primary - offset, false);
    			}
    			if (primary <= 200)
    			{
    				drawBlob(this.xCoord, this.yCoord, this.zCoord, primary / 40, TFBlocks.towerTranslucent, BlockTFTowerTranslucent.META_REACTOR_DEBRIS, counter, false);
    			}

    			// secondary burst
    			int secondary = counter - 120;

    			if (secondary >= offset && secondary <= 129)
    			{
    				drawBlob(this.xCoord + secX, this.yCoord + secY, this.zCoord + secZ, (secondary - offset) / 40, Blocks.air, 0, secondary - offset, false);
    			}
    			if (secondary >= 0 && secondary <= 160)
    			{
    				drawBlob(this.xCoord + secX, this.yCoord + secY, this.zCoord + secZ, secondary / 40, Blocks.air, 0, secondary, true);
    			}

    			// tertiary burst
    			int tertiary = counter - 160;

    			if (tertiary >= offset && tertiary <= 129)
    			{
    				drawBlob(this.xCoord + terX, this.yCoord + terY, this.zCoord + terZ, (tertiary - offset) / 40, Blocks.air, 0, tertiary - offset, false);
    			}
    			if (tertiary >= 0 && tertiary <= 160)
    			{
    				drawBlob(this.xCoord + terX, this.yCoord + terY, this.zCoord + terZ, tertiary / 40, Blocks.air, 0, tertiary, true);
    			}

    		}

			if (counter >= 350)
			{
				// spawn mini ghasts near the secondary & tertiary points
				for (int i = 0; i < 3; i++)
				{
					spawnGhastNear(this.xCoord + secX, this.yCoord + secY, this.zCoord + secZ);
					spawnGhastNear(this.xCoord + terX, this.yCoord + terY, this.zCoord + terZ);
				}

				// deactivate & explode
		        worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 2.0F, true);

				worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.air, 0, 3);
			}

    	}
		else
		{
			if (counter % 5 == 0 && counter <= 250)
			{
				// sound
				worldObj.playSound(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, "portal.portal", counter / 100F, counter / 100F, false);
			}
		}

    }

	private void spawnGhastNear(int x, int y, int z) {
		EntityTFMiniGhast ghast = new EntityTFMiniGhast(worldObj);
		ghast.setLocationAndAngles(x - 1.5 + worldObj.rand.nextFloat() * 3.0, y - 1.5 + worldObj.rand.nextFloat() * 3.0, z - 1.5 + worldObj.rand.nextFloat() * 3.0, worldOb


 3332, 3333, 3334, 3335, 3336,
    3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352,
    3353,
)

internal fun getDecompositionByIndex(index: Int): IntArray {
    val startIndex = decompositionValueIndex[index].toInt()
    val endIndex = decompositionValueIndex[index + 1].toInt()
    val result = IntArray(endIndex - startIndex)
    decompositionValues.copyInto(result, startIndex = startIndex, endIndex = endIndex)
    return result
}
/*
 * Copyright (c) 2021.
 *
 * This file is part of xmlutil.
 *
 * This file is licenced to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You should have received a copy of the license with the source distribution.
 * Alternatively, you may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package nl.adaptivity.xml.serialization

import kotlinx.serialization.Serializable
import nl.adaptivity.xmlutil.serialization.XmlElement
import nl.adaptivity.xmlutil.serialization.XmlSerialName
import kotlin.test.Test

class AChamberOfCommerce : PlatformTestBase<AChamberOfCommerce.Chamber>(
    Chamber(
        "hightech", listOf(
            Business("foo", null),
            Business("bar", null)
        )
    ),
    Chamber.serializer()
) {
    override val expectedXML: String = "<chamber name=\"hightech\">" +
            "<member name=\"foo\"/>" +
            "<member name=\"bar\"/>" +
            "</chamber>"
    override val expectedJson: String =
        "{\"name\":\"hightech\",\"members\":[{\"name\":\"foo\",\"headOffice\":null},{\"name\":\"bar\",\"headOffice\":null}]}"

    @Test
    override fun testGenericDeserializeXml() {
        super.testGenericDeserializeXml()
    }

    @Serializable
    @XmlSerialName("chamber")
    data class Chamber(
        val name: String,
        @XmlSerialName("member", namespace = "", prefix = "")
        val members: List<Business>
    )

    enum class AddresStatus { VALID, INVALID, TEMPORARY }

    @Serializable
    @XmlSerialName("address")
    data class Address(
        val houseNumber: String,
        val street: String,
        val city: String,


时，会自动生成对应的预测模型配置文件，请参考文档：[模型导出](../../docs/model_export.md)。

`inference`源代码(即本目录)的`conf`目录下提供了示例人像分割模型的配置文件`humanseg.yaml`, 相关的字段含义和说明如下：

```yaml
DEPLOY:
    # 是否使用GPU预测
    USE_GPU: 1
    # 是否是PaddleSeg 0.3.0新版本模型
    USE_PR : 1
    # 模型和参数文件所在目录路径
    MODEL_PATH: "/root/projects/models/deeplabv3p_xception65_humanseg"
    # 模型文件名
    MODEL_FILENAME: "__model__"
    # 参数文件名
    PARAMS_FILENAME: "__params__"
    # 预测图片的的标准输入尺寸，输入尺寸不一致会做resize
    EVAL_CROP_SIZE: (513, 513)
    # 均值
    MEAN: [0.40787450980392154, 0.4575254901960784, 0.481078431372549]
    # 方差
    STD: [0.00392156862745098, 0.00392156862745098, 0.00392156862745098]
    # 图片类型, rgb 或者 rgba
    IMAGE_TYPE: "rgb"
    # 分类类型数
    NUM_CLASSES: 2
    # 图片通道数
    CHANNELS : 3
    # 预处理方式，目前提供图像分割的通用处理类SegPreProcessor
    PRE_PROCESSOR: "SegPreProcessor"
    # 预测模式，支持 NATIVE 和 ANALYSIS
    PREDICTOR_MODE: "ANALYSIS"
    # 每次预测的 batch_size
    BATCH_SIZE : 3
```
修改字段`MODEL_PATH`的值为你在**上一步**下载并解压的模型文件所放置的目录即可。

**注意**在使用CPU版本预测库时，`USE_GPU`的值必须设为0，否则无法正常预测。

### 4.3. 执行预测

在终端中切换到生成的可执行文件所在目录为当前目录(Windows系统为`cmd`)。

`Linux` 系统中执行以下命令：
```shell
./demo --conf=/root/projects/PaddleSeg/deploy/cpp/conf/humanseg.yaml --input_dir=/root/projects/PaddleSeg/deploy/cpp/images/humanseg/
```
`Windows` 中执行以下命令:
```shell
D:\projects\PaddleSeg\deploy\cpp\build\Release>demo.exe --conf=D:\\projects\\PaddleSeg\\deploy\\cpp\\conf\\humanseg.yaml --input_dir=D:\\projects\\PaddleSeg\\deploy\\cpp\\images\humanseg\\
```

预测使用的两个命令参数说明如下：

| 参数 | 含义 |
|-------|----------|
| conf | 模型配置的Yaml文件路


                    continue;
                case PAM_HEADER_ENDHDR:
                    flds_endhdr = true;
                    break;
                case PAM_HEADER_HEIGHT:
                    if (flds_height)
                        throw RBS_BAD_HEADER;
                    m_height = ParseInt(value, MAX_PAM_HEADER_VALUE_LENGTH);
                    flds_height = true;
                    break;
                case PAM_HEADER_WIDTH:
                    if (flds_width)
                        throw RBS_BAD_HEADER;
                    m_width = ParseInt(value, MAX_PAM_HEADER_VALUE_LENGTH);
                    flds_width = true;
                    break;
                case PAM_HEADER_DEPTH:
                    if (flds_depth)
                        throw RBS_BAD_HEADER;
                    m_channels = ParseInt(value, MAX_PAM_HEADER_VALUE_LENGTH);
                    flds_depth = true;
                    break;
                case PAM_HEADER_MAXVAL:
                    if (flds_maxval)
                        throw RBS_BAD_HEADER;
                    m_maxval = ParseInt(value, MAX_PAM_HEADER_VALUE_LENGTH);
                    if ( m_maxval > 65535 )
                        throw RBS_BAD_HEADER;
                    m_sampledepth = (m_maxval > 255) ? CV_16U : CV_8U;
                    if (m_maxval == 1)
                        bit_mode = true;
                    flds_maxval = true;
                    break;
                case PAM_HEADER_TUPLTYPE:
                {
                    bool format_found = false;
                    for (uint i=0; i<PAM_FORMATS_NO; i++)
                    {
                        if (0 == strncmp(formats[i].name, value, MAX_PAM_HEADER_VALUE_LENGTH+1))
                        {
                            selected_fmt = formats[i].fmt;
                            format_found = true;
                            break;
                        }
                    }
                    CV_Assert(format_found);
                    break;
                }
                default:
                    throw RBS_BAD_HEADER;
            }
        } while (fieldtype != PAM_HEADER_ENDHDR);

        if (flds_endhdr && flds_height && flds_width && flds_depth && flds_maxval)
        {
            if (selected_fmt == IMWRITE_PAM_FORMAT_NULL)
            {
                if (m_channels == 1 && m_maxval == 1)
                    selected_fmt = IMWRITE_PAM_FORMAT_BLACKANDWHITE;
                else if (m_channels == 1 && m_maxval < 256)
                    selected_fmt = IMWRITE_PAM_FORMAT_GRAYSCALE;
                else if (m_channels == 3 && m_maxval < 256)
                    selected_fmt = IMWRITE_PAM_FORMAT_RGB;
                else
                    CV_Error(Error::StsError, "Can't determine selected_fmt (IMWRITE_PAM_FORMAT_NULL)");
            }
            CV_CheckDepth(m_sampledepth, m_sampledepth == CV_8U || m_sampledepth == CV_16U, "");
            CV_Check(m_channels, m_channels >= 1 && m_channels <= 4, "Unsupported number of channels");
            m_type = CV_MAKETYPE(m_sampledepth, m_channels);
            m_offset = m_strm.getPos();

            return true;
        }

        // failed
        m_offset = -1;
        m_width = m_height =


ata_3_lo.16b
	tbl	v_tmp_hi.16b, {v_gft5_hi.16b}, v_data_3_hi.16b
	eor	v_d5_3.16b, v_tmp_lo.16b, v_d5_3.16b
	eor	v_d5_3.16b, v_d5_3.16b, v_tmp_hi.16b

	/* dest6 */
	tbl	v_tmp_lo.16b, {v_gft6_lo.16b}, v_data_0_lo.16b
	tbl	v_tmp_hi.16b, {v_gft6_hi.16b}, v_data_0_hi.16b
	eor	v_d6_0.16b, v_tmp_lo.16b, v_d6_0.16b
	eor	v_d6_0.16b, v_d6_0.16b, v_tmp_hi.16b

	tbl	v_tmp_lo.16b, {v_gft6_lo.16b}, v_data_1_lo.16b
	tbl	v_tmp_hi.16b, {v_gft6_hi.16b}, v_data_1_hi.16b
	eor	v_d6_1.16b, v_tmp_lo.16b, v_d6_1.16b
	eor	v_d6_1.16b, v_d6_1.16b, v_tmp_hi.16b

	tbl	v_tmp_lo.16b, {v_gft6_lo.16b}, v_data_2_lo.16b
	tbl	v_tmp_hi.16b, {v_gft6_hi.16b}, v_data_2_hi.16b
	eor	v_d6_2.16b, v_tmp_lo.16b, v_d6_2.16b
	eor	v_d6_2.16b, v_d6_2.16b, v_tmp_hi.16b

	tbl	v_tmp_lo.16b, {v_gft6_lo.16b}, v_data_3_lo.16b
	tbl	v_tmp_hi.16b, {v_gft6_hi.16b}, v_data_3_hi.16b
	eor	v_d6_3.16b, v_tmp_lo.16b, v_d6_3.16b
	eor	v_d6_3.16b, v_d6_3.16b, v_tmp_hi.16b

	str	q_d4_0, [x_dest4, #16*0]
	str	q_d4_1, [x_dest4, #16*1]
	str	q_d4_2, [x_dest4, #16*2]
	str	q_d4_3, [x_dest4, #16*3]
	add	x_dest4, x_dest4, #64

	str	q_d5_0, [x_dest5, #16*0]
	str	q_d5_1, [x_dest5, #16*1]
	str	q_d5_2, [x_dest5, #16*2]
	str	q_d5_3, [x_dest5, #16*3]
	add	x_dest5, x_dest5, #64

	str	q_d6_0, [x_dest6, #16*0]
	str	q_d6_1, [x_dest6, #16*1]
	str	q_d6_2, [x_dest6, #16*2]
	str	q_d6_3, [x_dest6, #16*3]
	add	x_dest6, x_dest6, #64

	cmp	x_src, x_src_end
	bls	.Lloop64

.Lloop64_end:
	/* restore d


    font-weight: 600
}

.widget-about p {
    max-width: 260px
}

.cross-txt {
    position: absolute;
    left: -1px;
    right: -1px;
    transform: translateY(-50%);
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center
}

.cross-txt:before,
.cross-txt:after {
    content: '';
    -ms-flex: 1;
    flex: 1;
    height: 1px;
    background: #fff
}

.cross-txt:before {
    margin-right: 2.5rem
}

.cross-txt:after {
    margin-left: 2.5rem
}

.mfp-ready.mfp-bg {
    opacity: .6
}

.quickView-content {
    padding: 4rem 2rem;
    background-color: #fff
}

.quickView-content .owl-theme.owl-light .owl-nav [class*='owl-'] {
    border: none;
    font-size: 3rem;
    color: #fff
}

.quickView-content .owl-theme.owl-light .owl-nav [class*='owl-']:hover,
.quickView-content .owl-theme.owl-light .owl-nav [class*='owl-']:focus {
    color: #c96;
    background-color: transparent
}

.quickView-content .owl-theme.owl-nav-inside .owl-nav .owl-prev {
    left: 30px;
    margin: 0
}

.quickView-content .owl-theme.owl-nav-inside .owl-nav .owl-next {
    right: 30px;
    margin: 0
}

.quickView-content .owl-theme .owl-nav [class*='owl-'] {
    top: 50%
}

.quickView-content .owl-theme.owl-light .owl-nav [class*='owl-'] {
    background-color: transparent
}

.quickView-content .owl-theme.owl-nav-inside .owl-dots {
    left: 50%;
    transform: translateX(-50%);
    right: unset
}

.quickView-content>.row {
    margin-left: 0;
    margin-right: 0
}

.quickView-content>.row>div {
    padding-left: 2rem;
    padding-right: 2rem
}

.quickView-content>.row>div .row {
    margin-left: 0;
    margin-right: 0
}

.quickView-content .product-title {
    margin-top: 3rem
}

.quickView-content .product-title,
.quickView-content .product-price {
    font-size: 2.4rem;
    font-weight: 400;
    letter-spacing: -.025em;
    color: #333;
    margin-bottom: 1rem
}

.quickView-content .rating-container {
    margin-bottom: 2rem
}

.quickView-content p {
    color: #666;
    margin-bottom: 4rem
}

.quickView-content .product-nav-thumbs a,
.quickView-content .product-nav-thumbs span {
    height: 5.4rem
}

.quickView-content .details-filter-row label {
    font-size: 1.4rem;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #333
}

.quickView-content .product-details-action {
    margin-top: 5rem;
    flex-direction: column;
    align-items: normal;
    margin-bottom: 4rem
}

.quickView-content .details-action-wrapper {
    margin-left: 0;
    margin-bottom: 2rem;
    flex-wrap: wrap
}

.quickView-content .btn-product {
    background-color: transparent
}

.quickView-content .btn-product span {
    font-size: 1.3rem;


/*
 * cmdw.c  SYSTEM35 W command
 *
 * Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
 *               1998-                           <masaki-c@is.aist-nara.ac.jp>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
*/
/* $Id: cmdw.c,v 1.15 2003/01/25 01:34:50 chikama Exp $ */

#include <stdio.h>
#include "portab.h"
#include "xsystem35.h"
#include "scenario.h"
#include "ags.h"

void commandWW() {
	int x_size,y_size,color;
	x_size = getCaliValue();
	y_size = getCaliValue();
	color  = getCaliValue();

	ags_setWorldSize(x_size, y_size, color);

        TRACE("WW %d,%d,%d:",x_size, y_size, color);
}

void commandWV() {
	int start_x, start_y, size_x, size_y;
	start_x = getCaliValue();
	start_y = getCaliValue();
	size_x  = getCaliValue();
	size_y  = getCaliValue();

	ags_setViewArea(start_x, start_y, size_x, size_y);
	ags_updateFull();

	TRACE("WV %d,%d,%d,%d:",start_x,start_y,size_x, size_y);
}

void commandWZ() {
	int p1 = sl_getc();
	int sw = getCaliValue();

	switch(p1) {
	case 0:
		ags_setExposeSwitch(sw != 0);
		if (sw == 1) {
			/* う〜ん こんな処理いれなあかんのかぁ〜 (T_T) */
			if (nact->ags.world_depth == 8) nact->ags.pal_changed = true;
			ags_updateFull();
		}
		break;
	case 1:
		ags_setExposeSwitch(sw != 0);
		break;
	default:
		break;
	}
	TRACE("WZ %d,%d:", p1, sw);
}

void commandWX() {
	int x0, y0, cx, cy;
	x0 = getCaliValue();
	y0 = getCaliValue();
	cx = getCaliValue();
	cy = getCaliValue();

	ags_setExposeSwitch(true);
	ags_updateArea(x0, y0, cx, cy);

	TRACE("WX %d,%d,%d,%d:", x0, y0, cx, cy);
}


18c],#app .theme_sort[data-v-0092618c]:hover{border:1px solid #fff;background:rgba(255,255,255,.2)}#app .theme_button[data-v-0092618c]{border:1px solid #fff!important}#app .theme_progress[data-v-0092618c]{background:rgba(0,0,0,.2)}#app .theme_search-label[data-v-0092618c]{background:rgba(0,0,0,.2)}#app[skin=TUF] .theme_active.router-link-exact-active.software-item[data-v-0092618c],#app[skin=tuf] .theme_active.router-link-exact-active.software-item[data-v-0092618c]{background-color:rgba(0,0,0,.5);border-radius:12px 12px 0 0}#app[skin=TUF] .theme_active.router-link-exact-active.software-item span[data-v-0092618c],#app[skin=tuf] .theme_active.router-link-exact-active.software-item span[data-v-0092618c]{color:#d0982c}#app[skin=TUF] .theme_box[data-v-0092618c],#app[skin=tuf] .theme_box[data-v-0092618c]{background-color:rgba(0,0,0,.5)}#app[skin=TUF] .theme_backgroundColor[data-v-0092618c],#app[skin=tuf] .theme_backgroundColor[data-v-0092618c]{background-color:rgba(119,119,119,.12)}#app[skin=TUF] .theme_apps[data-v-0092618c],#app[skin=tuf] .theme_apps[data-v-0092618c]{border:1px solid #d0982c;background-color:rgba(43,43,43,.24)}#app[skin=TUF] .theme_tags[data-v-0092618c],#app[skin=tuf] .theme_tags[data-v-0092618c]{border:1px solid #ffffff00;background:rgba(255,255,255,.1)}#app[skin=TUF] .theme_tags.on[data-v-0092618c],#app[skin=TUF] .theme_tags[data-v-0092618c]:hover,#app[skin=tuf] .theme_tags.on[data-v-0092618c],#app[skin=tuf] .theme_tags[data-v-0092618c]:hover{border:1px solid #d0982c;background:rgba(255,255,255,.2)}#app[skin=TUF] .theme_sort[data-v-0092618c],#app[skin=tuf] .theme_sort[data-v-0092618c]{border:1px solid #ffffff00;background:rgba(255,255,255,.1)}#app[skin=TUF] .theme_sort.on[data-v-0092618c],#app[skin=TUF] .theme_sort[data-v-0092618c]:hover,#app[skin=tuf] .theme_sort.on[data-v-0092618c],#app[skin=tuf] .theme_sort[data-v-0092618c]:hover{border:1px solid #d0982c;background:rgba(255,255,255,.2)}#app[skin=TUF] .theme_button[data-v-0092618c],#app[skin=tuf] .theme_button[data-v-0092618c]{border:1px solid #d0982c!important}#app[skin=TUF] .theme_progress[data-v-0092618c],#app[skin=tuf] .theme_progress[data-v-0092618c]{background:rgba(255,255,255,.22)}#app[skin=TUF] .theme_search-label[data-v-0092618c],#app[skin=tuf] .theme_searc


JvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvblITdW5pbnRlcnByZXRlZE9wdG'
    'lvbhpaCg5FZGl0aW9uRGVmYXVsdBIyCgdlZGl0aW9uGAMgASgOMhguZ29vZ2xlLnByb3RvYnVm'
    'LkVkaXRpb25SB2VkaXRpb24SFAoFdmFsdWUYAiABKAlSBXZhbHVlGpYCCg5GZWF0dXJlU3VwcG'
    '9ydBJHChJlZGl0aW9uX2ludHJvZHVjZWQYASABKA4yGC5nb29nbGUucHJvdG9idWYuRWRpdGlv'
    'blIRZWRpdGlvbkludHJvZHVjZWQSRwoSZWRpdGlvbl9kZXByZWNhdGVkGAIgASgOMhguZ29vZ2'
    'xlLnByb3RvYnVmLkVkaXRpb25SEWVkaXRpb25EZXByZWNhdGVkEi8KE2RlcHJlY2F0aW9uX3dh'
    'cm5pbmcYAyABKAlSEmRlcHJlY2F0aW9uV2FybmluZxJBCg9lZGl0aW9uX3JlbW92ZWQYBCABKA'
    '4yGC5nb29nbGUucHJvdG9idWYuRWRpdGlvblIOZWRpdGlvblJlbW92ZWQiLwoFQ1R5cGUSCgoG'
    'U1RSSU5HEAASCAoEQ09SRBABEhAKDFNUUklOR19QSUVDRRACIjUKBkpTVHlwZRINCglKU19OT1'
    'JNQUwQABINCglKU19TVFJJTkcQARINCglKU19OVU1CRVIQAiJVCg9PcHRpb25SZXRlbnRpb24S'
    'FQoRUkVURU5USU9OX1VOS05PV04QABIVChFSRVRFTlRJT05fUlVOVElNRRABEhQKEFJFVEVOVE'
    'lPTl9TT1VSQ0UQAiKMAgoQT3B0aW9uVGFyZ2V0VHlwZRIXChNUQVJHRVRfVFlQRV9VTktOT1dO'
    'EAASFAoQVEFSR0VUX1RZUEVfRklMRRABEh8KG1RBUkdFVF9UWVBFX0VYVEVOU0lPTl9SQU5HRR'
    'ACEhcKE1RBUkdFVF9UWVBFX01FU1NBR0UQAxIVChFUQVJHRVRfVFlQRV9GSUVMRBAEEhUKEVRB'
    'UkdFVF9UWVBFX09ORU9GEAUSFAoQVEFSR0VUX1RZUEVfRU5VTRAGEhoKFlRBUkdFVF9UWVBFX0'
    'VOVU1fRU5UUlkQBxIXChNUQVJHRVRfVFlQRV9TRVJWSUNFEAgSFgoSVEFSR0VUX1RZUEVfTUVU'
    'SE9EEAkqCQjoBxCAgICAAkoECAQQBUoECBIQEw==');

@$core.Deprecated('Use oneofOptionsDescriptor instead')
const OneofOptions$json = {
  '1': 'OneofOptions',
  '2': [
    {
      '1': 'features',
      '3': 1,
      '4': 1,
      '5': 11,
      '6': '.google.protobuf.FeatureSet',
      '10': 'features'
    },
    {
      '1': 'uninterpreted_option',
      '3': 999,
      '4': 3,
      '5': 11,
      '6': '.google.protobuf.UninterpretedOption',
      '10': 'uninterpretedOption'
    },
  ],
  '5': [
    {'1': 1000, '2': 536870912},
  ],
};

/// Descriptor for `Oneof


anda.Streaming.StreamingManager.Instance:RefreshSceneObjState(1, false)
    end
  }
  self.EventItems[102437] = {
    eventType = E.LevelEventType.TriggerEvent,
    enable = true,
    group = 0,
    eventId = 102437,
    count = -1,
    action = function(localSelf)
      Panda.Streaming.StreamingManager.Instance:RefreshSceneObjState(2, false)
    end
  }
  self.EventItems[102438] = {
    eventType = E.LevelEventType.TriggerEvent,
    enable = true,
    group = 0,
    eventId = 102438,
    count = -1,
    action = function(localSelf)
      Panda.Streaming.StreamingManager.Instance:RefreshSceneObjState(1, true)
      Panda.Streaming.StreamingManager.Instance:RefreshSceneObjState(2, true)
    end
  }
end

return Scene


cartoons=['tom & jerry','dora','bujji','ben-ten','little krishna','doraemon']
print(cartoons)
print("after appending an element:")
cartoons.append('oggy & cockroach')
print(cartoons)
print('after inserting element')
cartoons.insert(2,'roll no 21')
print(cartoons)
print('after popping element')
cartoons.pop()
print(cartoons)
cartoons.pop(3)
print(cartoons)
cartoons.remove('dora')
print(cartoons)
print(cartoons.index('ben-ten'))
print("after reversing the list:")
cartoons.reverse()
print(cartoons)


0.10"},
					{Key: "usage_system", Value: "0.20"},
					{Key: "usage_idle", Value: "99.70"},
				},
				Timestamp: ptr.To(time.Unix(0, 1670000000000000000).UTC()),
			},
			wantLastSample: &Metric{
				Measurement: "mem",
				Tags: []KeyValue{
					{Key: "host", Value: "server02"},
				},
				Fields: []KeyValue{
					{Key: "usage_total", Value: "8192"},
					{Key: "usage_used", Value: "4900"},
					{Key: "usage_free", Value: "3292"},
				},
				Timestamp: ptr.To(time.Unix(0, 1670000049000000000).UTC()),
			},
		},
	}

	for _, tc := range tests {
		t.Run(tc.name, func(t *testing.T) {
			f, err := os.Open(tc.filepath)
			require.NoError(t, err)
			samples, _, invalidLines, err := ParseMetrics(context.Background(), f, tc.filepath)
			require.NoError(t, err)
			assert.Empty(t, invalidLines)
			assert.Len(t, samples, tc.wantSampleCount)
			assert.Equal(t, tc.wantFirstSample, samples[0])
			assert.Equal(t, tc.wantLastSample, samples[len(samples)-1])
		})
	}
}

func TestInfluxDBLineProtocolParser(t *testing.T) {
	t.Parallel()

	parser := NewInfluxDBLineProtocolParser()

	// We'll create a known time value for testing timestamp parsing.
	// For example: 2025-02-14 12:34:56 UTC
	testTime := time.Date(2025, 2, 14, 12, 34, 56, 0, time.UTC)
	testNanos := testTime.UnixNano()

	tests := []struct {
		name          string
		input         string
		wantSample    *Metric
		wantErrSubstr string
	}{
		{
			name:  "Valid with measurement + single field (no tags, no timestamp)",
			input: "cpu usage=50.0",
			wantSample: &Metric{
				Measurement: "cpu",
				Tags:        nil,
				Fields: []KeyValue{
					{Key: "usage", Value: "50.0"},
				},
				Timestamp: nil,
			},
		},
		{
			name:  "Valid with measurement, multiple tags, multiple fields, and timestamp",
			input: "cpu,host=server01,region=uswest usage_idle=55.0,usage_busy=45.0 " + strconv.FormatInt(testNanos, 10),
			wantSample: &Metric{
				Measurement: "cpu",
				Tags: []KeyValue{
					{Key: "host", Value: "server01"},
					{Key: "region", Value: "uswest"},
				},
				Fields: []KeyValue{
					{Key: "usage_idle", Value: "55.0"},
					{Key: "usage_busy", Value: "45.0"},
				},
				Timestamp: &testTime,
			},
		},
		{
			name:          "Invalid line (missing fields part)",
			input:         "cpu",
			wantSample:    nil,
			wantErrSubstr: "invalid line protocol",
		},
		{
			name:          "Invalid tag format",
			input:         "cpu,host=server01=extra, usage=60.0",
			wantSample:    nil,
			wantErrSubstr: "invalid tag",
		},
		{
			name:          "Invalid field format",
			input:         "cpu usage=60.0,brokenfield",
			wantSample:    nil,
			wantErrSubstr: "invalid field",
		},
		{
			name:          "Invalid timestamp",
			input:         "cpu usage=60.0 not_a_timestamp",
			wantSample:    nil,
			wantErrSubstr: "invalid timestamp",
		},
		{
			name:  "Valid line with multiple tags, multiple fields, no timestamp",
			input: "


    .limit(1);
  return results[0];
}import { advanceTo } from 'jest-date-mock';

import EventModel from '@src/model/eventModel';
import TZDate from '@src/time/date';

import type { EventObject } from '@t/events';

describe('model/event basic', () => {
  let event: EventModel;

  beforeEach(() => {
    event = new EventModel();
  });

  it('creation', () => {
    expect(event.isAllday).toBe(false);
  });

  describe('init()', () => {
    beforeEach(() => {
      advanceTo(new Date('2015/05/01 00:00:00').getTime());
    });

    it('initialize event with supplied options.', () => {
      const expected = {
        id: '123',
        title: 'Go home',
        isAllday: false,
        start: new TZDate('2015-05-01T00:00:00'),
        end: new TZDate('2015-05-02T00:00:00'),
      };

      event.init({
        id: '123',
        title: 'Go home',
        isAllday: false,
        start: '2015-05-01T00:00:00',
        end: '2015-05-02T00:00:00',
      });

      expect(event).toMatchObject(expected);
    });
  });

  describe('equals()', () => {
    let event2: EventModel;

    beforeEach(() => {
      event = new EventModel();
      event2 = new EventModel();
    });

    it("return true when event's property are same", () => {
      event.title = 'dance';
      event2.title = 'dance';
      event.isAllday = true;
      event2.isAllday = true;
      event.start = new TZDate('2015/05/01');
      event2.start = new TZDate('2015/05/01');
      event.end = new TZDate('2015/05/02');
      event2.end = new TZDate('2015/05/02');

      expect(event.equals(event2)).toBe(true);
    });

    it('return false when title is not equals.', () => {
      event.title = 'meeting';
      event2.title = 'working';

      expect(event.equals(event2)).toBe(false);
    });

    it('return false when two event has different all day flags.', () => {
      event.title = 'dance';
      event2.title = 'dance';
      event.isAllday = true;
      event2.isAllday = false;

      expect(event.equals(event2)).toBe(false);
    });

    it('return false when two event has different start or end.', () => {
      event.title = 'dance';
      event2.title = 'dance';
      event.isAllday = true;
      event2.isAllday = true;
      event.start = new TZDate('2015/05/01');
      event2.start = new TZDate('2015/04/01');

      expect(event.equals(event2)).toBe(false);

      event2.start = new TZDate('2015/05/01');

      event.end = new TZDate('2015/06/01');
      event2.end = new TZDate('2015/07/01');

      expect(event.equals(event2)).toBe(false);
    });
  });

  describe('duration()', () => {
    beforeEach(() => {
      event.start = new TZDate('2015-09-25T05:00:00');
      event.end = new TZDate('2015-09-26T05:00:00');
    });

    it('can calculate duration between start and end.', () => {
      expect(+Number(event.duration())).toB