/*
 * Copyright (C) 2018 Bas Stottelaar <basstottelaar@gmail.com>
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @ingroup     tests
 * @{
 *
 * @file
 * @brief       Test application for the Ucglib package.
 *
 * @author      Bas Stottelaar <basstottelaar@gmail.com>
 *
 * @}
 */

#define TEST_OUTPUT_DUMMY 1
#define TEST_OUTPUT_SDL 2
#define TEST_OUTPUT_SPI 3

#ifndef TEST_OUTPUT
#error "TEST_OUTPUT not defined"
#endif

#if TEST_OUTPUT == TEST_OUTPUT_SPI
#ifndef TEST_SPI
#error "TEST_SPI not defined"
#endif
#ifndef TEST_DISPLAY
#error "TEST_DISPLAY not defined"
#endif
#ifndef TEST_DISPLAY_EXT
#error "TEST_DISPLAY_EXT not defined"
#endif
#ifndef TEST_PIN_CS
#error "TEST_PIN_CS not defined"
#endif
#ifndef TEST_PIN_CD
#error "TEST_PIN_CD not defined"
#endif
#ifndef TEST_PIN_RESET
#error "TEST_PIN_RESET not defined"
#endif
#endif

#include <stdio.h>

#include "periph/gpio.h"
#if TEST_OUTPUT == TEST_OUTPUT_SPI
#include "periph/spi.h"
#endif

#include "timex.h"
#include "ztimer.h"

#include "ucg.h"
#include "ucg_riotos.h"

#include "logo.h"

#if TEST_OUTPUT == TEST_OUTPUT_SDL
int ucg_sdl_get_key(void);
#endif

int main(void)
{
    uint32_t screen = 0;
    ucg_t ucg;

#if TEST_OUTPUT == TEST_OUTPUT_DUMMY
    /* initialize dummy output */
    puts("Initializing dummy output.");

    ucg_Init(&ucg, ucg_dev_dummy_riotos, ucg_ext_none, NULL);
#endif

#if TEST_OUTPUT == TEST_OUTPUT_SDL
    /* initialize to virtual SDL (native only) */
    puts("Initializing to SDL.");

    ucg_Init(&ucg, ucg_sdl_dev_cb, ucg_ext_none, NULL);
#endif

#if TEST_OUTPUT == TEST_OUTPUT_SPI
    /* initialize to SPI */
    puts("Initializing to SPI.");

    ucg_riotos_t user_data =
    {
        .device_index = TEST_SPI,
        .pin_cs = TEST_PIN_CS,
        .pin_cd = TEST_PIN_CD,
        .pin_reset = TEST_PIN_RESET,
    };

    ucg_SetUserPtr(&ucg, &user_data);

    ucg_Init(&ucg, TEST_DISPLAY, TEST_DISPLAY_EXT, ucg_com_hw_spi_riotos);
#endif

    /* initialize the display */
    puts("Initializing display.");

    ucg_SetFontMode(&ucg, UCG_FONT_MODE_TRANSPARENT);
    ucg_SetFont(&ucg, ucg_font_helvB12_tf);

    /* start drawing in a loop */
    puts("Drawing on screen.");

    while (1) {
        ucg_ClearScreen(&ucg);

        switch (screen) {
            case 0:
                ucg_SetColor(&ucg, 0, 189, 32, 43);
                ucg_DrawString(&ucg, 0, 20, 0, "THIS");
                break;
            case 1:
                ucg_SetColor(&ucg, 0, 63, 167, 136);
                ucg_DrawString(&ucg, 0, 20, 0, "IS");
                break;
            case 2:
                for (int y = 0; y < 48; y++) {
                    for (int x = 0; x < 96; x++) {
                        uint32_t offset = (x + (y * 96)) * 3;

                        ucg_SetColor(&ucg, 0, logo[offset + 0], logo[offset + 1], logo[offset + 2]);
                        ucg_DrawPixel(&ucg, x, y);
                    }
                }
                break;
        }

#if TEST_OUTPUT == TEST_OUTPUT_SDL
        /* handle SDL events */
        ucg_sdl_get_key();
#endif

        /* show screen in next iteration */
        screen = (screen + 1) % 3;

        /* sleep a little */
        ztimer_sleep(ZTIMER_USEC, US_PER_SEC);
    }

    return 0;
}


latin，小写罗马数字：lower-roman
    type: variable-text
    default: lower-roman
  -
    id: list-ol-marker-4
    title: List symbol (4th level)
    title.zh: 有序列表第四层符号
    description: 数字：decimal，小写字母：lower-latin，小写罗马数字：lower-roman
    type: variable-text
    default: decimal
  -
    id: list-style-change-options
    title: List style in reading view
    title.zh: 阅读视图列表样式
    type: class-select
    allowEmpty: false
    default: list-no-border
    options:
      -
        label: Bracket 1
        value: list-bracket-style
      -
        label: Bracket 2 (1.1.1)
        value: list-bracket-style-two
      -
        label: Bracket 3
        value: list-bracket-style-three
      -
        label: Vertical line 1 (1.1.1)
        value: list-vertical-line-one
      -
        label: Using Ob Settings
        value: list-no-border
  -
    id: indentation-line-styles
    title: 2.3.2.3 Indentation lines
    title.zh: 2.3.2.3 层级线设置
    type: heading
    level: 4
    collapsed: false
  -
    id: bt-connected-indent-hover
    title: Toggle connected indent (Hovering)
    title.zh: 启用Connected indent lines（鼠标悬浮）
    description: Inspired from the CSS snippet by KillyMXI (https://gist.github.com/KillyMXI/cbef8edff6dd55d9e6ea4df66567e9b1)
    type: class-toggle
    default: true
  -
    id: bt-connected-indent-line-color
    title: Connected indent line color (Hovering)
    type: variable-themed-color
    format: hex
    opacity: true
    default-light: '#FFA8A8'
    default-dark: '#926a6a'
  -
    id: bt-colorful-connected-indent-hover
    title: Toggle colorful indentation lines (Hovering)
    title.zh: 启用彩色Connected indent lines（鼠标悬浮）
    type: class-toggle
    default: true
  -
    id: bt-indentation-width-hover
    title: Width of indentation lines (Hovering)
    title.zh: 层级线宽度 （Hovering）
    type: variable-text
    default: 3px
  -
    id: bt-list-indentation-margin-left-editing
    title: Move to right by ?px (Editing)
    title.zh: 向右移动 ?px (Editing)
    type: variable-text
    default: 1px
  -
    id: indentation-guide-color
    title: Inactive line color (Editing)
    type: variable-themed-color
    format: rgb
    opacity: true
    default-light: 'rgba(0, 0, 0, 0.06)'
    default-dark: 'rgba(255, 255, 255, 0.08)'
  -
    id: indentation-guide-color-active
    title: Active line color (Editing)
    type: variable-themed-color
    format: rgb
    opacity: true
    default-light: 'rgba(0, 0, 0, 0.14)'
    default-dark: 'rgba(255, 255, 255, 0.17)'
  -
    id: bt-colorful-indentation-lines-editing
    title: Toggle colorful indentation lines (Editing)
    title.zh: 启用彩色层级线 （编辑）
    type: class-toggle
    default: false
  -
    id: indentation-guide-width
    title: Indent line width (Editing)
    type: variable-num


});
      expect.fail('Should have thrown an error');
    } catch (error) {
      expect(error.status).toBe(1);
      expect(error.stdout).toContain('🚨 CRITICAL VERSION MISMATCHES:');
      expect(error.stdout).toContain('ethers:');
      expect(error.stdout).toContain('node-forge:');
    }
  });

  test('should detect workflow version mismatches', async () => {
    // Create workflow with different Node.js version
    const workflowContent = `
name: Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: 20
    `;

    await fs.mkdir(path.join(testDir, '.github', 'workflows'), {
      recursive: true,
    });
    await fs.writeFile(
      path.join(testDir, '.github', 'workflows', 'test.yml'),
      workflowContent,
    );

    // Create package.json with Node 22 engine
    const pkg = {
      engines: { node: '>=22 <23' },
    };
    await fs.writeFile(
      path.join(testDir, 'package.json'),
      JSON.stringify(pkg, null, 2),
    );

    try {
      execSync(`node ${scriptPath}`, {
        cwd: testDir,
        encoding: 'utf8',
      });
      expect.fail('Should have thrown an error');
    } catch (error) {
      expect(error.status).toBe(1);
      expect(error.stdout).toContain('Expected: >=22 <23');
      expect(error.stdout).toContain('Found: 20');
    }
  });

  test('should detect React Native ecosystem inconsistencies', async () => {
    await fs.mkdir(path.join(testDir, 'pkg1'), { recursive: true });
    await fs.mkdir(path.join(testDir, 'pkg2'), { recursive: true });

    const pkg1 = {
      dependencies: {
        react: '^18.3.1',
        'react-native': '0.76.9',
      },
    };
    const pkg2 = {
      dependencies: {
        react: '^18.0.0',
        'react-native': '0.74.0',
      },
    };

    await fs.writeFile(
      path.join(testDir, 'pkg1', 'package.json'),
      JSON.stringify(pkg1, null, 2),
    );
    await fs.writeFile(
      path.join(testDir, 'pkg2', 'package.json'),
      JSON.stringify(pkg2, null, 2),
    );

    try {
      execSync(`node ${scriptPath}`, {
        cwd: testDir,
        encoding: 'utf8',
      });
      expect.fail('Should have thrown an error');
    } catch (error) {
      expect(error.status).toBe(1);
      expect(error.stdout).toContain('react:');
      expect(error.stdout).toContain('react-native:');
    }
  });

  test('should detect Tamagui version inconsistencies', async () => {
    await fs.mkdir(path.join(testDir, 'pkg1'), { recursive: true });
    await fs.mkdir(path.join(testDir, 'pkg2'), { recursive: true });

    const pkg1 = {
      dependencies: {
        '@tamagui/config': '1.126.14',
        '@tamagui/lucide-icons': '1.126.14',
      },
    };
    const pkg2 = {
      dependencies: {
        '@tamagui/config': '1.129.3',
        '@tamagui/lucide-icons': '1.129.3',
      },
    };

    await fs.writeFile(
      path.join(testDir, 'pkg1', 'packa


let result = match opt.part {
        Part::Part1 => lib::parse_lines_as_nums(&input).map(|nums| part1(&nums)),
        Part::Part2 => lib::parse_lines_as_nums(&input).map(|nums| part2(&nums)),
    }?;
    println!("{}", result);
    Ok(())
}

fn part1(input: &[u32]) -> u32 {
    input
        .iter()
        .zip(input.iter().skip(1))
        .filter(|(x, y)| x < y)
        .count() as u32
}

fn part2(input: &[u32]) -> u32 {
    if input.len() <= 3 {
        return 0;
    }
    let mut x = input[0];
    let mut y = input[1];
    let mut z = input[2];
    let mut increases = 0;
    for v in input.iter().skip(3) {
        if v > &x {
            increases += 1;
        }
        x = y;
        y = z;
        z = *v;
    }
    increases
}

#[cfg(test)]
mod tests {
    use super::*;

    const INPUT: &[u32] = &[199, 200, 208, 210, 200, 207, 240, 269, 260, 263];

    #[test]
    fn test_1() {
        assert_eq!(part1(INPUT), 7);
    }

    #[test]
    fn test_2() {
        assert_eq!(part2(INPUT), 5);
    }
}
<reponame>indutny/dumb-crypto<gh_stars>100-1000
//! # Scrypt
//!
//! Implementation of scrypt key derivation algorithm according to
//! [RFC][rfc].
//!
//! [rfc]: https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-03
//!

use crate::pbkdf2::pbkdf2_sha256;
use crate::salsa20::{salsa20, BLOCK_SIZE as SALSA_BLOCK_SIZE};

const SALSA_ROUNDS: usize = 4;
const PBKDF2_ROUNDS: usize = 1;
const BLOCK_SIZE: usize = 64;

use std::error::Error;
use std::fmt;
use std::fmt::Display;

type Block = Vec<u8>;

#[derive(Debug, PartialEq)]
pub enum ScryptError {
    RIsTooSmall,
    NIsTooSmall,
    NIsNotAPowerOfTwo,
    PIsTooSmall,
}

impl Display for ScryptError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "ScryptError: {}", self.description())
    }
}

impl Error for ScryptError {
    fn description(&self) -> &str {
        match self {
            ScryptError::RIsTooSmall => "`r` must be larger than 1",
            ScryptError::NIsTooSmall => "`n` must be larger than 1",
            ScryptError::NIsNotAPowerOfTwo => "`n` must be a power of two",
            ScryptError::PIsTooSmall => "`p` must be larger than 1",
        }
    }
}

///
/// Main scrypt structure.
///
/// Usage:
/// ```rust
/// extern crate dumb_crypto;
///
/// use dumb_crypto::scrypt::Scrypt;
///
/// let scrypt = Scrypt::new(1, 128, 1);
///
/// let mut out: [u8; 8] = [0; 8];
///
/// scrypt.derive(b"passphrase", b"salt", &mut out).unwrap();
///
/// assert_eq!(out.to_vec(), vec![
///     79, 35, 225, 99, 145, 145, 172, 245,
/// ]);
/// ```
///
pub struct Scrypt {
    r: usize,
    n: usize,
    p: usize,
}

fn block_xor(a: &[u8], b: &[u8]) -> Block {
    a.iter().zip(b.iter()).map(|(a, b)| a ^ b).collect()
}

fn


}

#button-fake {
	width: 50px;
	height: 50px;
	border-radius: 50px;
	position: absolute;
	background: #523E5B;
	bottom: 30px;
	left: calc(50% - 12.5px);
	cursor: pointer;
}

.buildings {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}

.building {
	background: #FEFEFC;
	position: absolute;
}

.building.naver {
	display: flex;
	width: 200px;
	height: 100px;
	bottom: 180px;
	left: 140px;
	align-items: center;
	justify-content: center;
}

.building.michellan {
	width: 310px;
	height: 100px;
	bottom: 180px;
	left: 390px;
}

#naver-logo {
	height: 30px;
}

.building.benz {
	width: 120px;
	height: 100px;
	bottom: 330px;
	left: 220px;
}

#middle1 {
	bottom: 450px;
	left: 220px;
}
#small1 {
	bottom: 500px;
	left: 270px;
}

.building.gas {
	width: 60px;
	height: 100px;
	bottom: 330px;
	left: 92px;
}

.building.aptA {
	width: 150px;
	height: 80px;
	bottom: 330px;
	left: 390px;
}

.building.aptB {
	width: 150px;
	height: 80px;
	bottom: 460px;
	left: 390px;
}

.building.aptC {
	width: 150px;
	height: 80px;
	bottom: 590px;
	left: 390px;
}

.building.aptSA {
	width: 110px;
	height: 80px;
	bottom: 330px;
	left: 590px;
}

.building.aptSB {
	width: 110px;
	height: 80px;
	bottom: 460px;
	left: 590px;
}

.building.aptSC {
	width: 110px;
	height: 80px;
	bottom: 590px;
	left: 590px;
}

.building.small {
	width: 50px;
	height: 50px
}

.building.middle {
	width: 100px;
	height: 50px
}

.building.big {
	width: 100px;
	height: 100px;
}

#small2 {
	left: 935px;
	bottom: 330px;
}

#small3 {
	left: 390px;
	top: 100px;
}
#small4 {
	left: 440px;
	top: 100px;
}
#small5 {
	left: 490px;
	top: 100px;
}
#small6 {
	width: 55px;
	left: 590px;
	top: 100px;
}
#small7 {
	width: 55px;
	left: 645px;
	top: 100px;
}

#big1 {
	left: 240px;
	top: 50px;
}

.stem {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.leaf {
	position: absolute;
	width: 40px;
	height: 40px;
	background: #98BD92;
}

#tree-1 {
	left: 130px;
	bottom: 500px;
}

#tree-2 {
	left: 280px;
	top: 220px;
}

#tree-3 {
	left: 130px;
	bottom: 500px;
}

#tree-4 {
	right: 120px;
	top: 120px;
}

#tree-5 {
	right: 290px;
	bottom: 250px;
}

.cloud {
	background: #fff;
	-webkit-border-radius: 100px;
	-moz-border-radius: 100px;
	border-radius: 100px;

	-webkit-box-shadow: 0 8px 5px rgba(0,


class DiceRoller:
    """A class that takes input from a user and creates dice based on the user input."""
    def __init__(self):
        self.min_sides = 2
        self.max_sides = 100
        self.min_rolls = 1
        self.max_rolls = 10_000_000
        self.num_dice = 1

    def run(self):
        """Main method to run the die roll analyzer."""
        print("\nWelcome to the Die Roll Analyzer!\n")
        while True:
            # Prompt the user for the dice specifications
            formated_max_rolls = "{:,}".format(self.max_rolls)
            num_sides_prompt = f"\nHow many sides should the die have? (Enter a whole number between {self.min_sides} and {self.max_sides}): "
            num_rolls_prompt = f"How many times would you like to roll the die? (Enter a whole number between {self.min_rolls} and {formated_max_rolls}): "
            num_sides = self.get_user_num_input(num_sides_prompt, self.min_sides, self.max_sides)
            num_rolls = self.get_user_num_input(num_rolls_prompt, self.min_rolls, self.max_rolls)

            # Create the die
            dice = self.create_single_dice_type(self.num_dice, num_sides)

            # Roll the die, analyze and display the results
            from .dice_roll_analyzer import DiceRollAnalyzer
            # self.roll_dice_and_display_results(num_rolls, num_sides, dice)
            dice_roll_analyzer = DiceRollAnalyzer(num_rolls, dice)
            dice_roll_analyzer.create_and_display_results_graph()

            self.ask_to_roll_again()

    def get_user_input_y_n(self, prompt):
        """Prompt the user for input, validate the responce and send a boolean value back if valid"""
        while True:
            try:
                responce = input(prompt)
                if responce == "y":
                    return True
                elif responce == 'n':
                    return False
                else:
                    raise ValueError("Invalid input! Enter either 'y' or 'n'.")
            except ValueError as e:
                print(e)

    def get_user_num_input(self, prompt, min_value, max_value):
        """Prompt the user for input and validate it as an integer greater than or equal to min_value."""
        while True:
            try:
                value = int(input(prompt))
                if value < min_value or value > max_value:
                    raise ValueError(f"Value must be a whole number greater than {min_value - 1} and less than to {max_value + 1}.")
                return value
            except ValueError as e:
                print(f"Invalid input! Please try again with a valid number.")

    def create_single_dice_type(self, num_dice, num_sides):
        """Create a list of Die objects of a single type based on user input."""
        from .die import Die  # Import Die class here instead of at the top of the file to avoid circular imports in __init__.py
        return [Die(num_sides) for _ in range(num_dice)]

    def ask_to_roll_again(self):
        """Ask the user if they want to roll again"""
        prompt = "Would you like to roll more dice? (y/n): "
        roll_again = self.get_user_input_y_n(prompt)
        if roll_again == False:
            print("\nGoodbye!\n")
            exit()


td.details{background-color:#d1cfd0;border:2px solid #A19B9E}.example_alt_pagination div.dataTables_info{width:40%}.paging_full_numbers{width:400px;height:22px;line-height:22px}.paging_full_numbers a:active{outline:none}.paging_full_numbers a:hover{text-decoration:none}.paging_full_numbers a.paginate_button,.paging_full_numbers a.paginate_active{border:1px solid #aaa;-webkit-border-radius:5px;-moz-border-radius:5px;padding:2px 5px;margin:0 3px;cursor:pointer}.paging_full_numbers a.paginate_button{background-color:#ddd}.paging_full_numbers a.paginate_button:hover{background-color:#ccc;text-decoration:none !important}.paging_full_numbers a.paginate_active{background-color:#99B3FF}table.display tr.even.row_selected td{background-color:#B0BED9}table.display tr.odd.row_selected td{background-color:#9FAFD1}div.box{height:100px;padding:10px;overflow:auto;border:1px solid #8080FF;background-color:#E5E5FF}ul.msg_list li{background:#f7f7f7;padding:5px;display:-ms-flexbox;display:flex;margin:6px 6px 0;width:96% !important}ul.msg_list li:last-child{margin-bottom:6px;padding:10px}ul.msg_list li a{padding:3px 5px !important}ul.msg_list li a .image img{border-radius:2px 2px 2px 2px;-webkit-border-radius:2px 2px 2px 2px;float:left;margin-right:10px;width:11%}ul.msg_list li a .time{font-size:11px;font-style:italic;font-weight:bold;position:absolute;right:35px}ul.msg_list li a .message{display:block !important;font-size:11px}.dropdown-menu.msg_list span{white-space:normal}.dropdown-menu{border:medium none;box-shadow:none;display:none;float:left;font-size:12px;left:0;list-style:none outside none;padding:0;position:absolute;text-shadow:none;top:100%;z-index:9998;border:1px solid #D9DEE4;border-top-left-radius:0;border-top-right-radius:0}.dropdown-menu>li>a{color:#5A738E}.navbar-nav .open .dropdown-menu{position:absolute;background:#fff;margin-top:0;border:1px solid #D9DEE4;-webkit-box-shadow:none;right:0;left:auto;width:220px}.navbar-nav .open .dropdown-menu.msg_list{width:300px}.info-number .badge{font-size:10px;font-weight:normal;line-height:13px;padding:2px 6px;position:absolute;right:2px;top:8px}ul.to_do{padding:0}ul.to_do li{background:#f3f3f3;border-radius:3px;position:relative;padding:7px;margin-bottom:5px;list-style:none}ul.to_do p{margin:0}.dashboard-widget{background:#f6f6f6;border-top:5px solid #79C3DF;border-radius:3px;padding:5px 10px 10px}.dashboard-widget .dashboard-widget-title{font-weight:normal;border-bottom:1px solid #c1cdcd;margin:0 0 10px 0;padding-bottom:5px;padding-left:40px;line-height:30px}.dashboard-widget .dashboard-widget-title i{font-size:100%;margin-left:-35px;margin-right:10px;color:#33a1c9;padding:3px 6px;border:1px solid #abd9ea;


 nil {
		return err
	}

	if err := cmd.checkTarget(); err != nil {
		return err
	}

	switch cmd.canonicalResourceTypeForName() {
	case App:
		cmd.displayMessageWithOrgAndSpace()
		labels, warnings, err = cmd.Actor.GetApplicationLabels(cmd.RequiredArgs.ResourceName, cmd.Config.TargetedSpace().GUID)
	case Buildpack:
		cmd.displayMessageWithStackAndLifecycle()
		labels, warnings, err = cmd.Actor.GetBuildpackLabels(cmd.RequiredArgs.ResourceName, cmd.BuildpackStack, cmd.BuildpackLifecycle)
	case Domain:
		cmd.displayMessageDefault()
		labels, warnings, err = cmd.Actor.GetDomainLabels(cmd.RequiredArgs.ResourceName)
	case Org:
		cmd.displayMessageDefault()
		labels, warnings, err = cmd.Actor.GetOrganizationLabels(cmd.RequiredArgs.ResourceName)
	case Route:
		cmd.displayMessageWithOrgAndSpace()
		labels, warnings, err = cmd.Actor.GetRouteLabels(cmd.RequiredArgs.ResourceName, cmd.Config.TargetedSpace().GUID)
	case ServiceBroker:
		cmd.displayMessageDefault()
		labels, warnings, err = cmd.Actor.GetServiceBrokerLabels(cmd.RequiredArgs.ResourceName)
	case ServiceInstance:
		cmd.displayMessageWithOrgAndSpace()
		labels, warnings, err = cmd.Actor.GetServiceInstanceLabels(cmd.RequiredArgs.ResourceName, cmd.Config.TargetedSpace().GUID)
	case ServiceOffering:
		cmd.displayMessageForServiceCommands()
		labels, warnings, err = cmd.Actor.GetServiceOfferingLabels(cmd.RequiredArgs.ResourceName, cmd.ServiceBroker)
	case ServicePlan:
		cmd.displayMessageForServiceCommands()
		labels, warnings, err = cmd.Actor.GetServicePlanLabels(cmd.RequiredArgs.ResourceName, cmd.ServiceOffering, cmd.ServiceBroker)
	case Space:
		cmd.displayMessageWithOrg()
		labels, warnings, err = cmd.Actor.GetSpaceLabels(cmd.RequiredArgs.ResourceName, cmd.Config.TargetedOrganization().GUID)
	case Stack:
		cmd.displayMessageDefault()
		labels, warnings, err = cmd.Actor.GetStackLabels(cmd.RequiredArgs.ResourceName)
	default:
		err = fmt.Errorf("Unsupported resource type of '%s'", cmd.RequiredArgs.ResourceType)
	}
	cmd.UI.DisplayWarnings(warnings)
	if err != nil {
		return err
	}

	cmd.printLabels(labels)
	return nil
}

func (cmd LabelsCommand) Usage() string {
	return `CF_NAME labels RESOURCE RESOURCE_NAME`
}

func (cmd LabelsCommand) Examples() string {
	return `
cf labels app dora
cf labels org business
cf labels buildpack go_buildpack --stack cflinuxfs4`
}

func (cmd LabelsCommand) Resources() string {
	return `
app
buildpack
domain
org
route
service-broker
service-instance
service-offering
service-plan
space
stack`
}

func (cmd LabelsCommand) canonicalResourceTypeForName() ResourceType {
	return ResourceType(strings.ToLower(cmd.RequiredArgs.ResourceType))
}

func (cmd LabelsCommand) printLabels(labels map[string]types.NullString) {
	cmd.UI.DisplayNewline()

	if len(labels) == 0 {
		cmd.UI.DisplayText("No labels found.")
		return
	}

	keys := make([]string, 0, len(labels))
	for key := range labels {
		keys = append(keys, key)
	}
	sort.Strings(keys)

	table := [][]string{
		{
			cmd.UI.TranslateText("key"),
			cmd.UI.TranslateText("value"),
		},
	}

	for _, key := range keys {
		table = append(table, []string{key, labels[key].Value})
	}

	cmd.UI.DisplayTableWithHeader("", table, ui.DefaultTableSpacePadding)
}

fun


esholdCurve.html?rev=1.21&content-type=text/x-cvsweb-markup">classifiers/evaluation/ThresholdCurve.html (1.21)

classifiers/evaluation/TwoClassStats.html (1.8)

classifiers/functions/IsotonicRegression.html (1.6)

classifiers/functions/LinearRegression.html (1.23)

classifiers/functions/Logistic.html (1.37)

classifiers/functions/MultilayerPerceptron.html (1.11)

classifiers/functions/PaceRegression.html (1.8)

classifiers/functions/RBFNetwork.html (1.9)

classifiers/functions/SMO.html (1.64)

2007-05-01 01:24 fracpete

replaced existing copyright notices with correct ones (the university owns the copyright of stuff developed by people working for the university or what students produce during their projects/theses)

gui/InstancesSummaryPanel.html (1.6)

gui/JTableHelper.html (1.2)

gui/ListSelectorDialog.html (1.9)

gui/Loader.html (1.2)

gui/LogPanel.html (1.


f), Vec2(0.5f, 1.0f), TextureTransparencies.OPAQUE)))
    }

    fun eastSlab() {
        val from = Vec3(0.5f, 0.0f, 0.0f)
        val to = Vec3(1.0f, 1.0f, 1.0f)
        val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = BakedModelTestUtil.createFaces())), textures = mapOf("test" to minecraft("block/test").texture())))

        val baked = model.bake(BakedModelTestUtil.createTextureManager("block/test"))!!

        assertEquals(baked.getProperties(Directions.EAST)?.faces, arrayOf(FaceProperties(Vec2(0.0f, 0.0f), Vec2(1.0f, 1.0f), TextureTransparencies.OPAQUE)))
        assertNull(baked.getProperties(Directions.WEST)?.faces)

        assertEquals(baked.getProperties(Directions.DOWN)?.faces, arrayOf(FaceProperties(Vec2(0.5f, 0.0f), Vec2(1.0f, 1.0f), TextureTransparencies.OPAQUE)))
        assertEquals(baked.getProperties(Directions.UP)?.faces, arrayOf(FaceProperties(Vec2(0.5f, 0.0f), Vec2(1.0f, 1.0f), TextureTransparencies.OPAQUE)))
        assertEquals(baked.getProperties(Directions.NORTH)?.faces, arrayOf(FaceProperties(Vec2(0.5f, 0.0f), Vec2(1.0f, 1.0f), TextureTransparencies.OPAQUE)))
        assertEquals(baked.getProperties(Directions.SOUTH)?.faces, arrayOf(FaceProperties(Vec2(0.5f, 0.0f), Vec2(1.0f, 1.0f), TextureTransparencies.OPAQUE)))
    }

    fun `mini cube`() {
        val from = Vec3(0.1f, 0.2f, 0.3f)
        val to = Vec3(0.7f, 0.8f, 0.9f)
        val model = SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = BakedModelTestUtil.createFaces())), textures = mapOf("test" to minecraft("block/test").texture())))

        val baked = model.bake(BakedModelTestUtil.createTextureManager("block/test"))!!

        assertNull(baked.getProperties(Directions.DOWN)?.faces)
        assertNull(baked.getProperties(Directions.UP)?.faces)
        assertNull(baked.getProperties(Directions.NORTH)?.faces)
        assertNull(baked.getProperties(Directions.SOUTH)?.faces)
        assertNull(baked.getProperties(Directions.WEST)?.faces)
        assertNull(baked.getProperties(Directions.EAST)?.faces)
    }

    fun `full cube weighted model`() { // TODO: still wrong, grass block is failing
        val from = Vec3(0.0f)
        val to = Vec3(1.0f)

        val weighted = WeightedBlockStateApply(listOf(
            WeightedBlockStateApply.WeightedApply(1, SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = BakedModelTestUtil.createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), y = 0)),
            WeightedBlockStateApply.WeightedApply(1, SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = BakedModelTestUtil.createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), y = 1)),
            WeightedBlockStateApply.WeightedApply(1, SingleBlockStateApply(BlockModel(elements = listOf(ModelElement(from, to, faces = BakedModelTestUtil.createFaces())), textures = mapOf("test" to minecraft("block/test").texture())), y = 2)),
            WeightedBlockStateApply.WeightedApply(1, SingleBlockStateAppl


odsSpecificationExample example);

    int updateByExample(@Param("record") GoodsSpecification record, @Param("example") GoodsSpecificationExample example);

    int updateByPrimaryKeySelective(GoodsSpecification record);

    int updateByPrimaryKey(GoodsSpecification record);

    @ResultMap("BaseResultMap")
    @Select("<script>select s.* from tb_goods_specification s " +
            "<where> 1=1 " +
            "<if test=\"goodsSpecification.id != null\"> AND s.id = #{goodsSpecification.id} </if>" +
            "<if test=\"goodsSpecification.goodsId != null\"> AND s.goods_id = #{goodsSpecification.goodsId} </if>" +
            "<if test=\"goodsSpecification.name != null and goodsSpecification.name !=''\"> AND s.name like '%${goodsSpecification.name}%' </if>" +
            "<if test=\"goodsSpecification.sortNumber != null\"> AND s.sort_number = #{goodsSpecification.sortNumber} </if>" +
            "</where> order by s.id asc" +
            "</script>")
    Page<GoodsSpecification> getListByPage(@Param("page") Page page, @Param("specList") GoodsSpecification goodsSpecification);

    @ResultMap("CustomResultMap")
    @Select("<script>select s.*, g.name AS goodsName, g.main_image AS goodsMainImage from tb_goods_specification s " +
            "LEFT JOIN tb_goods g ON g.id = s.goods_id " +
            "<where> 1=1 " +
            "<if test=\"goodsSpecificationDto.id != null\"> AND s.id = #{goodsSpecificationDto.id} </if>" +
            "<if test=\"goodsSpecificationDto.goodsId != null\"> AND s.goods_id = #{goodsSpecificationDto.goodsId} </if>" +
            "<if test=\"goodsSpecificationDto.name != null and goodsSpecificationDto.name !=''\"> AND s.name like '%${goodsSpecificationDto.name}%' </if>" +
            "<if test=\"goodsSpecificationDto.sortNumber != null\"> AND s.sort_number = #{goodsSpecificationDto.sortNumber} </if>" +
            "<if test=\"goodsSpecificationDto.goodsName != null and goodsSpecificationDto.goodsName !=''\"> AND g.name like '%${goodsSpecificationDto.goodsName}%' </if>" +
            "<if test=\"goodsSpecificationDto.goodsMainImage != null and goodsSpecificationDto.goodsMainImage !=''\"> AND g.main_image like '%${goodsSpecificationDto.goodsMainImage}%' </if>" +
            "</where> order by g.id desc, s.sort_number asc" +
            "</script>")
    Page<Map<String, Object>> getListByPageJoinGoods(@Param("goodsSpecificationDto") GoodsSpecificationDto goodsSpecificationDto);

    @Select("select IFNULL(max(s.sort_number), 0) from tb_goods_specification s where s.goods_id = #{goodsId}")
    int selectMaxSortNumberByGoodsId(@Param("goodsId") Integer goodsId);

    @Select("select s.* from tb_goods_specification s where s.goods_id = #{goodsId} and s.name = #{name}")
    GoodsSpecification selectByGoodsIdAndName(@Param("goodsId") Integer goodsId, @Param("name") String name);

    @Delete("delete from tb_goods_specification where goods_id = #{goodsId}")
    void deleteByGoodsId(@Param("goodsId") int goodsId);
}package com.siam.system.modular.package_goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.siam.system.modular.package_goods.entity.FullReductionRule;
import com.siam.system.modular.package_goods.model.example.FullReductionRuleExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis


b7be43L, 0x60b08ed5L,
  0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
  0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
  0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
  0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
  0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
  0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
  0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
  0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
  0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
  0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
  0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
  0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
  0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
  0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
  0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
  0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
  0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
  0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
  0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
  0x2d02ef8dL
};

#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
#define DO1(buf)  crc = CRC32(crc, *buf++)
#define DO2(buf)  DO1(buf); DO1(buf)
#define DO4(buf)  DO2(buf); DO2(buf)
#define DO8(buf)  DO4(buf); DO4(buf)

ulg crc32(ulg crc, const uch *buf, extent len)
{ if (buf==NULL) return 0L;
  crc = crc ^ 0xffffffffL;
  while (len >= 8) {DO8(buf); len -= 8;}
  if (len) do {DO1(buf);} while (--len);
  return crc ^ 0xffffffffL;  // (instead of ~c for 64-bit machines)
}

void update_keys(unsigned long *keys, char c)
{ keys[0] = CRC32(keys[0],c);
  keys[1] += keys[0] & 0xFF;
  keys[1] = keys[1]*134775813L +1;
  keys[2] = CRC32(keys[2], keys[1] >> 24);
}
char decrypt_byte(unsign


t {
        let mut ptr = std::ptr::null_mut();
        let mut sizeloc = crate::MAX_BUFFER_LENGTH;
        let cstring = unsafe {
            let file = bind_ceed::open_memstream(&mut ptr, &mut sizeloc);
            bind_ceed::CeedBasisView(self.ptr, file);
            bind_ceed::fclose(file);
            CString::from_raw(ptr)
        };
        cstring.to_string_lossy().fmt(f)
    }
}

// -----------------------------------------------------------------------------
// Implementations
// -----------------------------------------------------------------------------
impl<'a> Basis<'a> {
    // Constructors
    pub fn create_tensor_H1(
        ceed: &'a crate::Ceed,
        dim: usize,
        ncomp: usize,
        P1d: usize,
        Q1d: usize,
        interp1d: &[crate::Scalar],
        grad1d: &[crate::Scalar],
        qref1d: &[crate::Scalar],
        qweight1d: &[crate::Scalar],
    ) -> crate::Result<Self> {
        let mut ptr = std::ptr::null_mut();
        let (dim, ncomp, P1d, Q1d) = (
            i32::try_from(dim).unwrap(),
            i32::try_from(ncomp).unwrap(),
            i32::try_from(P1d).unwrap(),
            i32::try_from(Q1d).unwrap(),
        );
        let ierr = unsafe {
            bind_ceed::CeedBasisCreateTensorH1(
                ceed.ptr,
                dim,
                ncomp,
                P1d,
                Q1d,
                interp1d.as_ptr(),
                grad1d.as_ptr(),
                qref1d.as_ptr(),
                qweight1d.as_ptr(),
                &mut ptr,
            )
        };
        ceed.check_error(ierr)?;
        Ok(Self {
            ptr,
            _lifeline: PhantomData,
        })
    }

    pub fn create_tensor_H1_Lagrange(
        ceed: &'a crate::Ceed,
        dim: usize,
        ncomp: usize,
        P: usize,
        Q: usize,
        qmode: crate::QuadMode,
    ) -> crate::Result<Self> {
        let mut ptr = std::ptr::null_mut();
        let (dim, ncomp, P, Q, qmode) = (
            i32::try_from(dim).unwrap(),
            i32::try_from(ncomp).unwrap(),
            i32::try_from(P).unwrap(),
            i32::try_from(Q).unwrap(),
            qmode as bind_ceed::CeedQuadMode,
        );
        let ierr = unsafe {
            bind_ceed::CeedBasisCreateTensorH1Lagrange(ceed.ptr, dim, ncomp, P, Q, qmode, &mut ptr)
        };
        ceed.check_error(ierr)?;
        Ok(Self {
            ptr,
            _lifeline: PhantomData,
        })
    }

    pub fn create_H1(
        ceed: &'a crate::Ceed,
        topo: crate::ElemTopology,
        ncomp: usize,
        nnodes: usize,
        nqpts: usize,
        interp: &[crate::Scalar],
        grad: &[crate::Scalar],
        qref: &[crate::Scalar],
        qweight: &[crate::Scalar],
    ) -> crate::Result<Self> {
        let mut ptr = std::ptr::null_mut();
        let (topo, ncomp, nnodes, nqpts) = (
            topo as bind_ceed::CeedElemTopology,
            i32::try_from(ncomp).unwrap(),
            i32::try_from(nnodes).unwrap(),
            i32::try_from(nqpts).unwrap(),
        );
        let ierr = unsafe {
            bind_ceed::Ceed


   NotFree,
        Free,
        Keyword,
        BeginImage,
        BeginImageData,
        EndImage,
        BeginCodeSpaceRange,
        EndCodeSpaceRange,
        BeginBfChar,
        EndBfChar,
        BeginBfRange,
        EndBfRange,
        BeginCidChar,
        EndCidChar,
        BeginCidRange,
        EndCidRange,
        BeginNotDefChar,
        EndNotDefChar,
        BeginNotDefRange,
        EndNotDefRange,
        BeginBlock,
        EndBlock,
        UseCMap,
        Def,
        Dup,
        Array,
        Begin,
        Dict,
        RD,
        ND,
        NP,
    }
}


angle);
    if(_type == WindRoseType.closeHaul) {
      if(adjustedA.abs() <= 60) {
        adjustedA *= 2;
      } else {
        adjustedA -= (_angle < 0) ? -60 : 60;
        adjustedA ~/= 2;
        adjustedA += (_angle < 0) ? -120 : 120;
      }
    }

    canvas.translate(size/2, size/2);
    canvas.rotate(deg2Rad(adjustedA));
    canvas.drawPath(needle, paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

class WindRoseBox extends BoxWidget {
  late final _Settings _settings;

   WindRoseBox(super.config, {super.key}) {
    _settings = _$SettingsFromJson(config.settings);
  }

  @override
  State<WindRoseBox> createState() => _WindRoseBoxState();

  static String sid = 'wind-rose';
  @override
  String get id => sid;

  @override
  bool get hasPerBoxSettings => true;

  @override
  BoxSettingsWidget getPerBoxSettingsWidget() {
    return _SettingsWidget(_settings);
  }

  @override
  Widget? getPerBoxSettingsHelp() => const HelpPage(text: '''In **Auto** mode the Rose will switch between the "Normal" and "Close Haul" displays if the needle transitions over 60 degrees for more than the **Auto Switch Delay**.

The **Switch Button** allows you to cycle through the Wind Rose types from the display. If the button is "Unlocked" the display is in "Auto" mode.''');
}

class _WindRoseBoxState extends State<WindRoseBox> {
  double? _windAngleApparent;
  double? _windAngleTrue;
  double? _windSpeedApparent;
  double? _windSpeedTrue;
  WindRoseType _displayType = WindRoseType.normal;
  Timer? _autoTimer;

  @override
  void initState() {
    super.initState();
    Set<String> paths = {
      'environment.wind.angleApparent',
      'environment.wind.angleTrueWater'
    };
    if(widget._settings.showSpeeds) {
      paths.addAll({
        'environment.wind.speedApparent',
        'environment.wind.speedTrue'});
    }
    widget.config.controller.configure(onUpdate: _processData, paths: paths);
  }

  @override
  void dispose() {
    _autoTimer?.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if(widget.config.editMode) {
      _windAngleApparent = deg2Rad(123);
      _windAngleTrue = deg2Rad(90);
      _windSpeedApparent = _windSpeedTrue = widget.config.controller.windSpeedFromDisplay(12.3);
    }

    if(widget._settings.type == WindRoseType.auto) {
      if((_displayType == WindRoseType.normal && rad2Deg(_windAngleApparent).abs() <= 60) ||
         (_displayType == WindRoseType.closeHaul && rad2Deg(_windAngleApparent).abs() > 60)) {
        _autoTimer ??= Timer(Duration(seconds: widget._settings.autoSwitchingDelay), () {
          _displayType = (_displayType == WindRoseType.normal) ? WindRoseType.closeHaul : WindRoseType.normal;
        });
      } else {
        _autoTimer?.cancel();
        _autoTimer = null;
      }
    } else {
      _autoTimer?.cancel();
      _autoTimer = null;

      _displayType = widget._settings.type;
    }

    List<Widget> stack = [
      CustomPaint(size: Size.infinite, painter: _RosePainter(widget.config.controller, context, widget._settings, _displayType))
    ];

    if(widget._settings.showTrueWind && _windAngleTrue != null && !widget._settings.trueWindNeedleOnTop) {
      stack.add(CustomPaint(size: Size.infinite, painter: _NeedlePainter(_displayType, Colors.yellow, _windAngleTrue!)));
    }

    if(widget._settings.showSpeeds) {
      stack.add(CustomPaint(size: Si


;
  items: T[] = [];
  filter = {};
  sort = {};

  public static fromJSON<T>(input: any): Page<T> {
    const page = new Page<T>();
    if (input) {
      page.pageNumber = input.number;
      page.pageSize = input.size;
      page.totalElements = input.totalElements;
      page.totalPages = input.totalPages;
    } else {
      console.error('input', input);
      throw new Error('Was expecting a page property.');
    }
    return page;
  }

  public getItemsAsObservable(): Observable<T[]> {
    return of(this.items);
  }

  public update(page: Page<T> ) {
    this.items.length = 0;
    this.items.push(...page.items);
    this.pageNumber = page.pageNumber;
    this.pageSize = page.pageSize;
    this.totalElements = page.totalElements;
    this.totalPages = page.totalPages;
  }

}
/** Determines if the input is a permutation of a palindrome */
export function palindromePermutation(input: string): boolean {
  const dict = input.toLowerCase()
    .replace(/ /g, '')
    .split('')
    .reduce<Map<string, number>>((previous, current) => {
      let charCount = previous.get(current);
      if (charCount === undefined) {
        previous.set(current, 1);
      } else {
        previous.set(current, ++charCount);
      }
      return previous;
    }, new Map<string, number>());

  let numberOfOddCharacters = 0;
  for (const count of dict.values()) {
    if (count % 2 !== 0) {
      numberOfOddCharacters++;
      if (numberOfOddCharacters > 1) {
        return false;
      }
    }
  }

  return true;
}
import { MedusaError } from "medusa-core-utils"
import { EntityManager } from "typeorm"
import { TransactionBaseService } from "../interfaces"
import { AnalyticsConfig } from "../models"
import { AnalyticsConfigRepository as AnalyticsRepository } from "../repositories/analytics-config"
import {
  CreateAnalyticsConfig,
  UpdateAnalyticsConfig,
} from "../types/analytics-config"
import UserService from "./user"

type InjectedDependencies = {
  analyticsConfigRepository: typeof AnalyticsRepository
  manager: EntityManager
}

class AnalyticsConfigService extends TransactionBaseService {
  protected readonly analyticsConfigRepository_: typeof AnalyticsRepository
  protected readonly userService_: UserService

  constructor({ analyticsConfigRepository }: InjectedDependencies) {
    // eslint-disable-next-line prefer-rest-params
    super(arguments[0])

    this.analyticsConfigRepository_ = analyticsConfigRepository
  }

  async retrieve(userId: string): Promise<AnalyticsConfig> {
    const analyticsRepo = this.activeManager_.withRepository(
      this.analyticsConfigRepository_
    )

    const analyticsConfig = await analyticsRepo.findOne({
      where: { user_id: userId },
    })

    if (!analyticsConfig) {
      throw new MedusaError(
        MedusaError.Types.NOT_FOUND,
        `No analytics config found for user with id: ${userId}`
      )
    }

    return analyticsConfig
  }

  /**
   * Creates an analytics config.
   */
  async create(
    userId: string,
    data: CreateAnalyticsConfig
  ): Promise<AnalyticsConfig> {
    const analyticsRepo = this.activeManager_.withRepository(
      this.analyticsConfigRepository_
    )

    const config = analyticsRepo.create({ user_id: userId, ...data })
    return await analyticsRepo.save(config)
  }

  /**
   * Updates an analytic


buffer, offset)) {
            return offset
        }

        var i = offset + buffer.readerIndex()
        while (i < buffer.writerIndex() - 2) {
            if (
                ((buffer.getByte(i) == CR && buffer.getByte(i + 1) == LF)
                        || (buffer.getByte(i) == DASH && buffer.getByte(i + 1) == DASH))
                && startsWithSipWord(buffer, i + 2 - buffer.readerIndex())
            ) {
                return i + 2 - buffer.readerIndex()
            }

            i++
        }

        return -1
    }
}
/*
 * Copyright 2018-2025 SIP3.IO, Corp.
 *
 * 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 io.sip3.captain.ce.pipeline

import io.sip3.captain.ce.domain.Packet
import io.sip3.commons.domain.payload.Encodable
import io.vertx.core.Vertx
import io.vertx.core.json.JsonObject

/**
 * Handles ERSPAN packets
 */
class ErspanHandler(vertx: Vertx, config: JsonObject, bulkOperationsEnabled: Boolean) : Handler(vertx, config, bulkOperationsEnabled) {

    private val ethernetHandler: EthernetHandler by lazy {
        EthernetHandler(vertx, config, bulkOperationsEnabled)
    }

    override fun onPacket(packet: Packet) {
        val buffer = (packet.payload as Encodable).encode()

        // Important! To make it easier we decided to skip header and send payload to `EthernetHandler`.
        // So far `sip3-captain` works with such type of encapsulations only.
        buffer.skipBytes(8)

        ethernetHandler.handle(packet)
    }
}
/*
 * Copyright 2018-2025 SIP3.IO, Corp.
 *
 * 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 io.sip3.captain.ce.pipeline

import io.sip3.captain.ce.RoutesCE
import io.sip3.captain.ce.domain.Packet
import io.sip3.captain.ce.util.SmppUtil
import io.sip3.commons.ProtocolCodes
import io.sip3.commons.domain.payload.ByteArrayPayload
import io.sip3.commons.domain.payload.Encodable
import io.sip3.commons.util.getBytes
import io.sip3.commons.vertx.util.localSend
import io.vertx.core.Vertx
import io.vertx.core.json.JsonObject

/**
 * Handles SMPP packets
 */
class SmppHandler(vertx: Vertx, config: JsonObject, bulkOperationsEnabled: Boolean) : Handler(vertx, config, bulkOperationsEnabled) {

    private val packets = mutableListOf<Packet>()
    private var bulkSize = 1

    init {
        if (bulkOperationsEnabled) {
            config.getJsonObject("smpp")?.let { smppConfig ->
                smppConfig.getInteger("bulk_size")?.let { bulkSize = it }
            }
        }
    }

    override fun onPacket(packet: Packet) {
        val buffer = (packet.payload as Encodable).encode()

        if (S


38 00 00 00 */	li r0, 0
/* 80395790 003926D0  3C 80 72 64 */	lis r4, 0x72643032@ha
/* 80395794 003926D4  98 1A 00 B0 */	stb r0, 0xb0(r26)
/* 80395798 003926D8  7F A3 EB 78 */	mr r3, r29
/* 8039579C 003926DC  38 C4 30 32 */	addi r6, r4, 0x72643032@l
/* 803957A0 003926E0  38 A0 50 33 */	li r5, 0x5033
/* 803957A4 003926E4  81 9D 00 00 */	lwz r12, 0(r29)
/* 803957A8 003926E8  81 8C 00 3C */	lwz r12, 0x3c(r12)
/* 803957AC 003926EC  7D 89 03 A6 */	mtctr r12
/* 803957B0 003926F0  4E 80 04 21 */	bctrl
/* 803957B4 003926F4  7C 7A 1B 79 */	or. r26, r3, r3
/* 803957B8 003926F8  40 82 00 18 */	bne .L_803957D0
/* 803957BC 003926FC  38 7F 01 30 */	addi r3, r31, 0x130
/* 803957C0 00392700  38 BF 01 48 */	addi r5, r31, 0x148
/* 803957C4 00392704  38 80 04 A1 */	li r4, 0x4a1
/* 803957C8 00392708  4C C6 31 82 */	crclr 6
/* 803957CC 0039270C  4B C9 4E 75 */	bl panic_f__12JUTExceptionFPCciPCce
.L_803957D0:
/* 803957D0 00392710  38 00 00 00 */	li r0, 0
/* 803957D4 00392714  3C 80 72 64 */	lis r4, 0x72643033@ha
/* 803957D8 00392718  98 1A 00 B0 */	stb r0, 0xb0(r26)
/* 803957DC 0039271C  7F A3 EB 78 */	mr r3, r29
/* 803957E0 00392720  38 C4 30 33 */	addi r6, r4, 0x72643033@l
/* 803957E4 00392724  38 A0 50 33 */	li r5, 0x5033
/* 803957E8 00392728  81 9D 00 00 */	lwz r12, 0(r29)
/* 803957EC 0039272C  81 8C 00 3C */	lwz r12, 0x3c(r12)
/* 803957F0 00392730  7D 89 03 A6 */	mtctr r12
/* 803957F4 00392734  4E 80 04 21 */	bctrl
/* 803957F8 00392738  7C 7A 1B 79 */	or. r26, r3, r3
/* 803957FC 0039273C  40 82 00 18 */	bne .L_80395814
/* 80395800 00392740  38 7F 01 30 */	addi r3, r31, 0x130
/* 80395804 00392744  38 BF 01 48 */	addi r5, r31, 0x148
/* 80395808 00392748  38 80 04 A5 */	li r4, 0x4a5
/* 8039580C 0039274C  4C C6 31 82 */	crclr 6
/* 80395810 00392750  4B C9 4E 31 */	bl panic_f__12JUTExceptionFPCciPCce
.L_80395814:
/* 80395814 00392754  38 00 00 00 */	li r0, 0
/* 80395818 00392758


ization()

# Get searches by category
function_searches = history.get_searches_by_category(SearchCategory.FUNCTION)
class_searches = history.get_searches_by_category(SearchCategory.CLASS)

# Manual categorization
history.categorize_search(search_id, SearchCategory.REFACTORING)
```

### Bookmarks and Favorites

```python
# Bookmark useful searches
bookmark_id = history.bookmark_search(
    pattern="def.*handler",
    name="Handler Functions",
    description="Find all handler function definitions"
)

# Get bookmarked searches
bookmarks = history.get_bookmarks()
for bookmark in bookmarks:
    print(f"{bookmark.name}: {bookmark.pattern}")

# Execute bookmarked search
results = history.execute_bookmark(bookmark_id)
```

### Session Management

```python
# Start a new search session
session_id = history.start_session("refactoring-session")

# All searches in this session will be grouped
query1 = Query(pattern="old_function_name")
history.record_search(query1, results1, session_id=session_id)

query2 = Query(pattern="new_function_name")
history.record_search(query2, results2, session_id=session_id)

# Get session summary
session = history.get_session(session_id)
print(f"Session: {session.name}")
print(f"Searches: {len(session.searches)}")
print(f"Duration: {session.duration_minutes:.1f} minutes")
```

## Advanced Features

### Search Pattern Analysis

```python
# Analyze search patterns
patterns = history.analyze_search_patterns()
print(f"Most common regex patterns: {patterns.regex_patterns}")
print(f"Most searched file types: {patterns.file_types}")
print(f"Peak search times: {patterns.peak_hours}")
```

### Export and Import

```python
# Export history
history_data = history.export_history(format="json")
with open("search_history.json", "w") as f:
    f.write(history_data)

# Import history
with open("search_history.json", "r") as f:
    history_data = f.read()
history.import_history(history_data)
```

### Performance Optimization

```python
# Configure history limits
history = SearchHistory(
    config,
    max_entries=10000,
    cleanup_interval_days=30,
    enable_analytics=True
)

# Periodic cleanup
history.cleanup_old_entries(days=90)
```

## Integration

### CLI Integration

The history system integrates with the CLI:

```bash
# Show recent searches
pysearch history --recent 10

# Search history
pysearch history --search "def.*handler"

# Show analytics
pysearch history --analytics

# Execute bookmarked search
pysearch history --bookmark "handler-functions"
```

### API Integration

```python
# Automatic history tracking
engine = PySearch(config, enable_history=True)

# All searches are automatically recorded
results = engine.search("def main")  # Recorded in history

# Access history
history = engine.history
recent_searches = history.get_recent_searches()
```

## Related

- [PySearch API](pysearch.md) - Main search engine with history integration
- [Types](types.md) - Query and result types
- [Configuration](config.md) - History configuration options
# Utils API

Utility functions and helpers used throughout the PySearch system.

## File Operations

### read_text_safely

::: pysearch.utils.read_text_safely
    options:
      show_root_heading: true
      show_source: false
      heading_level: 3
      separate_signature: true
      show_signature_annotations: true
      signature_crossrefs: true
      do


;
  }

  if (item.count("result-type"))
  {
      ResultType result =  item["result-type"] == "mate"      ? ResultMate
                         : item["result-type"] == "stalemate" ? ResultStalemate
                                                              : ResultNone;
      if (result != ResultNone)
      {
          cond.resultType = result;
          cond.rules.push_back(RuleResultType);
      }
  }

  if (item.count("sub-fen"))
  {
      for (const auto& fen : item["sub-fen"])
      {
          StateInfo st;
          Position pos;
          pos.set(fen, false, &st, nullptr, true);

          // Setup the pattern to be searched
          SubFen f;
          f.white = pos.pieces(WHITE);
          f.black = pos.pieces(BLACK);
          for (PieceType pt = PAWN; pt <= KING; ++pt)
              if (pos.pieces(pt))
                  f.pieces.push_back(std::make_pair(pt, pos.pieces(pt)));
          cond.subfens.push_back(f);
      }
      if (cond.subfens.size())
          cond.rules.push_back(RuleSubFen);
  }

  if (item.count("material"))
  {
      StateInfo st;
      for (const auto& mat : item["material"])
          cond.matKeys.push_back(Position().set(mat, WHITE, &st).material_key());
      if (cond.matKeys.size())
          cond.rules.push_back(RuleMaterial);
  }

  if (item.count("imbalance"))
  {
      for (std::string code : item["imbalance"])
      {
          StateInfo st;
          Imbalance imb;
          auto v = code.find('v');
          if (v == std::string::npos)
              continue;
          code.replace(v, 1, "K").insert(0, "K");
          const Position& pos = Position().set(code, WHITE, &st);
          imb.nonPawnMaterial = pos.non_pawn_material(WHITE) - pos.non_pawn_material(BLACK);
          imb.pawnCount = pos.count<PAWN>(WHITE) - pos.count<PAWN>(BLACK);
          cond.imbalances.push_back(imb);
      }
      if (cond.imbalances.size())
          cond.rules.push_back(RuleImbalance);
  }

  if (item.count("white-move"))
      for (const auto& move : item["white-move"])
      {
          const ScoutMove& m = parse_move(move, WHITE);
          if (m.pc != NO_PIECE)
          {
              cond.moves.push_back(m);
              cond.moveSquares |= m.to;
          }
      }

  if (item.count("black-move"))
      for (const auto& move : item["black-move"])
      {
          const ScoutMove& m = parse_move(move, BLACK);
          if (m.pc != NO_PIECE)
          {
              cond.moves.push_back(m);
              cond.moveSquares |= m.to;
          }
      }

  if (cond.moves.size())
      cond.rules.push_back(RuleMove);

  if (item.count("captured"))
  {
      const std::string str = item["captured"];
      for (char ch : str)
          if (PieceToChar.find(ch) != std::string::npos)
          {
              Piece pc = Piece(PieceToChar.find(ch));
              cond.capturedFlags |= 1 << int(type_of(pc));
          }
      cond.rules.push_back(cond.capturedFlags ? RuleCapturedPiece : RuleQuietMove);


(atom))
			{
				lastSafe = processed.size();
				lastSafeBeta = node;
			}

			final AlphaNode alpha = _alphaNet.addNode(atom);
			final List<? extends AtomObject> args = atom.getAllArguments();

			final List<FilterCondition> conditions = new ArrayList<>();
			if (!processed.isEmpty())
				for (int i = 0, n = args.size(); i < n; i++)
				{
					final AtomObject arg = args.get(i);
					if (arg instanceof AtomVariable)
					{
						final TokenNodeProvider provider = createNodeProvider((AtomVariable) arg, processed);
						if (provider != null)
							conditions.add(new JoinCondition(new WMENodeProvider(i), provider));
					}
				}

			processed.add(atom);

			bound.addAll(VariableUtils.getVars(atom));

			// any _builtin that can be evaluated with current bindings should be handled here
			for (final BuiltInCall call : builtins)
				if (bound.containsAll(call.getPrerequisitesVars(bound)))
				{
					final Collection<? extends AtomVariable> bindableVars = call.getBindableVars(bound);
					if (bindableVars.isEmpty() || bound.containsAll(bindableVars))
						conditions.add(call.createCondition(processed));
					// i.remove();
				}

			BetaNode newBeta = null;

			if (canReuseBeta)
				if (node == null) // First beta node.
				{
					for (final BetaNode existingBeta : alpha.getBetas())
						if (existingBeta.isTop())
						{
							newBeta = existingBeta;
							break;
						}
				}
				else
					for (final BetaNode existingBeta : SetUtils.intersection(alpha.getBetas(), node.getBetas()))
						if (existingBeta instanceof BetaMemoryNode && conditions.equals(((BetaMemoryNode) existingBeta).getConditions()))
						{
							newBeta = existingBeta;
							break;
						}

			if (null == newBeta)
			{
				newBeta = node == null ? new BetaTopNode(alpha) : new BetaMemoryNode(alpha, conditions);
				canReuseBeta = false;
			}

			alpha.addChild(newBeta);
			if (node != null)
				node.addChild(newBeta);
			node = newBeta;

			// process builtins at the _end since binding builtins may change
			int bindingCount = -1;
			while (!builtins.isEmpty() && bindingCount != bound.size())
			{
				bindingCount = bound.size();
				for (final Iterator<BuiltInCall> i = builtins.iterator(); i.hasNext();)
				{
					final BuiltInCall call = i.next();
					if (bound.containsAll(call.getPrerequisitesVars(bound)))
					{
						// create the beta _node before updating _processed atoms
						newBeta = call.createBeta(processed);
						node.addChild(newBeta);
						node = newBeta;
						processed.add(call._atom);
						bound.addAll(call.getBindableVars(bound));
						canReuseBeta = false;
						i.remove();
					}
				}
			}
		}

		if (!builtins.isEmpty())
			throw new UnsupportedOperationException("Builtin using unsafe variables: " + builtins);

		if (lastSafe == 0)
			_strategy.addUnsafeRule(rule, explain);
		else
			if (lastSafe > 0)
			{
				final Map<AtomVariable, NodeProvider> args = new HashMap<>();
				for (int i = 0; i < lastSafe; i++)
					for (final AtomObject arg : processed.get(i).getAllArguments())
						if (arg instanceof AtomVariable && !args.containsKey(arg))
							args.put((AtomVariable) arg, createNodeProvider((AtomVariable) arg, processed));
				if (lastSafeBeta != null)
					lastSafeBeta.addChild(new ProductionNode.Produc


#import <Foundation/Foundation.h>
#import "BITHockeyBaseManager.h"
#import "HockeySDKNullability.h"

NS_ASSUME_NONNULL_BEGIN

/**
 The metrics module.

 This is the HockeySDK module that handles users, sessions and events tracking.

 Unless disabled, this module automatically tracks users and session of your app to give you
 better insights about how your app is being used.
 Users are tracked in a completely anonymous way without collecting any personally identifiable
 information.

 Before starting to track events, ask yourself the questions that you want to get answers to.
 For instance, you might be interested in business, performance/quality or user experience aspects.
 Name your events in a meaningful way and keep in mind that you will use these names
 when searching for events in the HockeyApp web portal.

 It is your reponsibility to not collect personal information as part of the events tracking or get
 prior consent from your users as necessary.
 */
@interface BITMetricsManager : BITHockeyBaseManager

/**
 *  A property indicating whether the BITMetricsManager instance is disabled.
 */
@property (nonatomic, assign) BOOL disabled;

/**
 *  This method allows to track an event that happened in your app.
 *  Remember to choose meaningful event names to have the best experience when diagnosing your app
 *  in the HockeyApp web portal.
 *
 *  @param eventName The event's name as a string.
 */
- (void)trackEventWithName:(nonnull NSString *)eventName;

/**
 *  This method allows to track an event that happened in your app.
 *  Remember to choose meaningful event names to have the best experience when diagnosing your app
 *  in the web portal.
 *
 *  @param eventName the name of the event, which should be tracked.
 *  @param properties key value pairs with additional info about the event.
 *  @param measurements key value pairs, which contain custom metrics.
 */
- (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary<NSString *, NSString *> *)properties measurements:(nullable NSDictionary<NSString *, NSNumber *> *)measurements;

@end

NS_ASSUME_NONNULL_END


using System;
using Server.Mobiles;
using Server.Targeting;

namespace Server.Engines.Quests.Collector
{
    public class EnchantedPaints : QuestItem
    {
        [Constructable]
        public EnchantedPaints()
            : base(0xFC1)
        {
            this.LootType = LootType.Blessed;

            this.Weight = 1.0;
        }

        public EnchantedPaints(Serial serial)
            : base(serial)
        {
        }

        public override bool CanDrop(PlayerMobile player)
        {
            CollectorQuest qs = player.Quest as CollectorQuest;

            if (qs == null)
                return true;

            /*return !( qs.IsObjectiveInProgress( typeof( CaptureImagesObjective ) )
            || qs.IsObjectiveInProgress( typeof( ReturnImagesObjective ) ) );*/
            return false;
        }

        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is CollectorQuest)
                {
                    if (qs.IsObjectiveInProgress(typeof(CaptureImagesObjective)))
                    {
                        player.SendAsciiMessage(0x59, "Target the creature whose image you wish to create.");
                        player.Target = new InternalTarget(this);

                        return;
                    }
                }
            }

            from.SendLocalizedMessage(1010085); // You cannot use this.
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }

        private class InternalTarget : Target
        {
            private readonly EnchantedPaints m_Paints;
            public InternalTarget(EnchantedPaints paints)
                : base(-1, false, TargetFlags.None)
            {
                this.CheckLOS = false;
                this.m_Paints = paints;
            }

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Paints.Deleted || !this.m_Paints.IsChildOf(from.Backpack))
                    return;

                Playe


DS"]] != null) {
      source = json["images"]
          [textureExtensions[EXTENSIONS["MSFT_TEXTURE_DDS"]]["source"]];
    } else {
      source = json["images"][textureDef["source"]];
    }

    var loader;

    if (sourceDef["uri"] != null) {
    //  print("xxxx"+sourceDef['uri']);
      loader = options["manager"].getHandler(sourceDef["uri"]);
     // TextLoader loaderii=loader;
     // loaderii.
     // print("ooo"+loader.toString());
    }

    if (loader == null) {
      loader = textureExtensions[EXTENSIONS["MSFT_TEXTURE_DDS"]] != null
          ? parser.extensions[EXTENSIONS["MSFT_TEXTURE_DDS"]]["ddsLoader"]
          : this.textureLoader;
    }

    return this.loadTextureImage(textureIndex, sourceIndex, loader);
  }

  loadTextureImage(textureIndex, sourceIndex, loader) async {
    // print(" GLTFParser.loadTextureImage source: ${source} textureIndex: ${textureIndex} loader: ${loader} ");

    var parser = this;
    var json = this.json;

    Map textureDef = json["textures"][textureIndex];
    Map sourceDef = json["images"][sourceIndex];

    // var URL = self.URL || self.webkitURL;

    var cacheKey =
        '${(sourceDef["uri"] ?? sourceDef["bufferView"])}:${textureDef["sampler"]}';

    //print("xxx"+cacheKey.toString());
    if (this.textureCache[cacheKey] != null) {
      // See https://github.com/mrdoob/three.js/issues/21559.
    //  print("uuu");
      return this.textureCache[cacheKey];
    }

   // print("nnn");
    loader.flipY = false;
    var texture = await this.loadImageSource(sourceIndex, loader);

    texture.flipY = false;

    if (textureDef["name"] != null) texture.name = textureDef["name"];

    var samplers = json["samplers"] ?? {};
    Map sampler = samplers[textureDef["sampler"]] ?? {};

    texture.magFilter = WEBGL_FILTERS[sampler["magFilter"]] ?? LinearFilter;
    texture.minFilter =
        WEBGL_FILTERS[sampler["minFilter"]] ?? LinearMipmapLinearFilter;
    texture.wrapS = WEBGL_WRAPPINGS[sampler["wrapS"]] ?? RepeatWrapping;
    texture.wrapT = WEBGL_WRAPPINGS[sampler["wrapT"]] ?? RepeatWrapping;

    parser.associations[texture] = {"textures": textureIndex};

    this.textureCache[cacheKey] = texture;

    return texture;

    // String sourceURI = sourceDef["uri"] ?? "";
    // var isObjectURL = false;

    // var texture;
    // loader.flipY = false;

    // if (sourceDef["bufferView"] != null) {
    //   // Load binary image data from bufferView, if provided.

    //   // print("GLTFParser.loadTextureImage textureIndex: ${textureIndex} source->bufferView is not null TODO ");

    //   var bufferView =
    //       await parser.getDependency('bufferView', sourceDef["bufferView"]);

    //   if (sourceDef["mimeType"] == 'image/png') {
    //     // Inspect the PNG 'IHDR' chunk to determine whether the image could have an
    //     // alpha channel. This check is conservative — the image could have an alpha
    //     // channel with all values == 1, and the indexed type (colorType == 3) only
    //     // sometimes contains alpha.
    //     //
    //     // https://en.wikipedia.org/wiki/Portable_Network_Graphics#File_header
    //     var colorType = new ByteData.view(bufferView, 25, 1).getUint8(0);
    //   }

    //   // should be in a isolate
    //   // var _image = Image.


ry.memarray<GuestVariant>(vaddr, 1);
		vp->type = Variant::ARRAY;
		vp->v.i = idx;
		return;
	}

	std::optional<const Variant *> opt_array = emu.get_scoped_variant(arr_idx);
	if (!opt_array.has_value() || opt_array.value()->get_type() != Variant::ARRAY) {
		ERR_PRINT("Invalid Array object");
		throw std::runtime_error("Invalid Array object, idx = " + std::to_string(arr_idx));
	}
	godot::Array array = opt_array.value()->operator Array();

	switch (op) {
		case Array_Op::PUSH_BACK:
			array.push_back(machine.memory.memarray<GuestVariant>(vaddr, 1)->toVariant(emu));
			break;
		case Array_Op::PUSH_FRONT:
			array.push_front(machine.memory.memarray<GuestVariant>(vaddr, 1)->toVariant(emu));
			break;
		case Array_Op::POP_AT:
			array.pop_at(idx);
			break;
		case Array_Op::POP_BACK:
			array.pop_back();
			break;
		case Array_Op::POP_FRONT:
			array.pop_front();
			break;
		case Array_Op::INSERT:
			array.insert(idx, machine.memory.memarray<GuestVariant>(vaddr, 1)->toVariant(emu));
			break;
		case Array_Op::ERASE:
			// TODO: Check if we can use pointer to Variant to avoid copying.
			array.erase(machine.memory.memarray<GuestVariant>(vaddr, 1)->toVariant(emu));
			break;
		case Array_Op::RESIZE:
			array.resize(idx);
			break;
		case Array_Op::CLEAR:
			array.clear();
			break;
		case Array_Op::SORT:
			array.sort();
			break;
		case Array_Op::FETCH_TO_VECTOR: {
			CppVector<GuestVariant> *vec = machine.memory.memarray<CppVector<GuestVariant>>(vaddr, 1);
			vec->resize(machine, array.size());
			for (int i = 0; i < array.size(); i++) {
				vec->at(machine, i).create(emu, array[i].duplicate(false));
			}
			break;
		}
		case Array_Op::HAS: {
			auto *vp = machine.memory.memarray<GuestVariant>(vaddr, 1);
			const bool result = array.has(vp->toVariant(emu));
			vp->set(emu, result);
			break;
		}
		default:
			ERR_PRINT("Invalid Array operation");
			throw std::runtime_error("Invalid Array operation");
	}
}

APICALL(api_array_at) {
	auto [arr_idx, idx, vret] = machine.sysargs<unsigned, int, GuestVariant *>();
	Sandbox &emu = riscv::emu(machine);
	PENALIZE(10'000); // Costly Array operations.
	SYS_TRACE("array_at", arr_idx, idx, vret);

	std::optional<const Variant *> opt_array = emu.get_scoped_variant(arr_idx);
	if (!opt_array.has_value() || opt_array.value()->get_type() != Variant::ARRAY) {
		ERR_PRINT("Invalid Array object");
		throw std::runtime_error("Invalid Array object, idx = " + std::to_string(arr_idx));
	}

	godot::Array array = opt_array.value()->operator Array();
	const bool set_mode = idx < 0;
	if (set_mode) {
		idx = -idx - 1;
	}
	if (idx >= array.size()) {
		ERR_PRINT("Array index out of bounds: " + itos(idx));
		throw std::runtime_error("Array index out of


/*
 * =======================================================================================
 *
 *      Filename:  perfmon_hisilicon.h
 *
 *      Description:  Header File of perfmon module for HiSilicon chips.
 *
 *      Version:   <VERSION>
 *      Released:  <DATE>
 *
 *      Author:   Thomas Gruber (tr), thomas.roehl@googlemail.com
 *      Project:  likwid
 *
 *      Copyright (C) 2022 RRZE, University Erlangen-Nuremberg
 *
 *      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 3 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, see <http://www.gnu.org/licenses/>.
 *
 * =======================================================================================
 */
#ifndef PERFMON_HISILICON_H
#define PERFMON_HISILICON_H

#ifndef NUM_ARCH_EVENTS_A57
#include <perfmon_a57_events.h>
#endif
#include <perfmon_hisilicon_counters.h>

static int perfmon_numCountersHiSiliconTsv110 = NUM_COUNTERS_HISILICON_TSV110;
static int perfmon_numArchEventsHiSiliconTsv110 = NUM_ARCH_EVENTS_A57;

#endif //PERFMON_HISILICON_H


work_values(game_session, game_object_id, template_data.breed)
		local percent = 1 - toughness_damage / max_toughness
		local new_state = percent > 0 and STATES.active or STATES.depleted

		if new_state ~= template_data.state then
			_switch_state(template_data, template_context, new_state, is_toughness_invulnerable)
		end

		if template_data.state == STATES.active then
			local shield_unit = template_data.shield_unit

			_set_shield_power(shield_unit, percent, template_data, t, is_toughness_invulnerable)

			if percent < SHIELD_REDNESS_THRESHOLD then
				local normalized_percent = math.normalize_01(percent, 0, SHIELD_REDNESS_THRESHOLD)
				local redness = math.lerp(1, 0, normalized_percent)

				_set_shield_redness(shield_unit, redness, is_toughness_invulnerable)
			end

			local toughness_extension = template_data.toughness_extension
			local processed_attacks_index = template_data.processed_attacks_index
			local stored_attacks = toughness_extension:stored_attacks()
			local num_stored_attacks = #stored_attacks

			if processed_attacks_index < num_stored_attacks then
				local wwise_world = template_context.wwise_world

				WwiseWorld.set_global_parameter(wwise_world, "void_shield_health", percent)

				local start_time = World.time(Unit.world(shield_unit))
				local start_duration_input = Vector2(start_time, IMPACT_FX_DURATION)
				local include_children = true

				for i = processed_attacks_index + 1, num_stored_attacks do
					local attack_data = stored_attacks[i]
					local impact_world_position = attack_data.impact_world_position:unbox()
					local previous_impact_fx_index = template_data.previous_impact_fx_index
					local next_impact_fx_index = previous_impact_fx_index % NUM_IMPACT_FX_ENTRIES + 1

					template_data.previous_impact_fx_index = next_impact_fx_index

					local impact_fx_keys = IMPACT_FX_KEYSET[next_impact_fx_index]
					local position_key = impact_fx_keys.impact_position_key

					Unit.set_vector3_for_materials(shield_unit, position_key, impact_world_position, include_children)

					local start_duration_key = impact_fx_keys.impact_start_duration_key

					Unit.set_vector2_for_materials(shield_unit, start_duration_key, start_duration_input, include_children)
				end

				template_data.processed_attacks_index = num_stored_attacks
				template_data.hit_shield_duration = t + HIT_SHIELD_EXTRA_LIGHT_DURATION
			end
		elseif template_data.state == STATES.depleted and not template_data.toughness_template.ignore_flickering_on_depleted then
			local shield_unit = template_data.shield_unit

			_flicker_shield(shield_unit, template_data, t)
		end
	end,
	stop = function (template_data, template_context)
		if DEDICATED_SERVER then
			return
		end

		local shield_unit = template_data.shield_unit

		if Unit.alive(shield_unit) then
			_set_shield_power(shield_unit, 1, template_data)
		end

		local wwise_world = template_context.wwise_world
		local source_id = template_data.source_id

		WwiseWorld.destroy


using System.Linq;
using NHibernate.Linq;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.GH3263
{
	[TestFixture]
	public class ReuseFetchJoinFixture : BugTestCase
	{
		protected override void OnSetUp()
		{
			using var s = OpenSession();
			using var t = s.BeginTransaction();
			var em = new Employee() { Name = "x", OptionalInfo = new OptionalInfo() };
			em.OptionalInfo.Employee = em;
			s.Save(em);
			t.Commit();
		}
		protected override void OnTearDown()
		{
			using var session = OpenSession();
			using var transaction = session.BeginTransaction();
			session.CreateQuery("delete from System.Object").ExecuteUpdate();

			transaction.Commit();
		}

		[Test]
		public void ReuseJoinScalarSelect()
		{
			using var session = OpenSession();
			session.Query<Employee>()
				.Fetch(x => x.OptionalInfo)
				.Where(x => x.OptionalInfo != null)
				.Select(x => new { x.OptionalInfo.Age })
				.ToList();
		}

		[Test]
		public void ReuseJoinScalarSelectHql()
		{
			using var session = OpenSession();
			session.CreateQuery(
				"select x.OptionalInfo.


, BuildBucketCIS, "Test-iPhone-RGB", Tryjob01FileIPhoneRGB, "2020-12-10T04:05:06Z")
	ps.DataWithCommonKeys(paramtools.Params{
		OSKey: IOS, DeviceKey: IPadDevice,
	}).Digests(DigestA01Pos, // same as primary branch
		DigestB01Pos,    // on this CL, the digest has been (incorrectly) marked as untriaged.
		DigestC06Pos_CL, // not on primary branch, triaged on CL.
		DigestA02Pos,    // same as primary branch
		DigestB02Pos,    // same as primary branch
		DigestC02Pos).   // Now correct (primary branch is producing untriaged).
		Keys([]paramtools.Params{
			{types.CorpusField: CornersCorpus, types.PrimaryKeyField: SquareTest, ColorModeKey: RGBColorMode},
			{types.CorpusField: CornersCorpus, types.PrimaryKeyField: TriangleTest, ColorModeKey: RGBColorMode},
			{types.CorpusField: RoundCorpus, types.PrimaryKeyField: CircleTest, ColorModeKey: RGBColorMode},
			{types.CorpusField: CornersCorpus, types.PrimaryKeyField: SquareTest, ColorModeKey: GreyColorMode},
			{types.CorpusField: CornersCorpus, types.PrimaryKeyField: TriangleTest, ColorModeKey: GreyColorMode},
			{types.CorpusField: RoundCorpus, types.PrimaryKeyField: CircleTest, ColorModeKey: GreyColorMode},
		}).
		OptionsAll(paramtools.Params{"ext": "png"}).
		FromTryjob(Tryjob02IPad, BuildBucketCIS, "Test-iPad-ALL", Tryjob02FileIPad, "2020-12-10T03:02:01Z")
	ps.DataWithCommonKeys(paramtools.Params{
		OSKey: AndroidOS, DeviceKey: TaimenDevice, ColorModeKey: RGBColorMode,
	}).Digests(DigestA09Neg, // On primary branch, should be ignored.
		DigestB01Pos, // on this CL, the digest has been (incorrectly) marked as untriaged.
		DigestC05Unt, // On primary branch, should be ignored.
	).Keys([]paramtools.Params{
		{types.CorpusField: CornersCorpus, types.PrimaryKeyField: SquareTest},
		{types.CorpusField: CornersCorpus, types.PrimaryKeyField: TriangleTest},
		{types.CorpusField: RoundCorpus, types.PrimaryKeyField: CircleTest},
	}).OptionsPerPoint([]paramtools.Params{
		{"ext": "png"},
		{"ext": "png", "disallow_triaging": "true", "image_matching_algorithm": "positive_if_only_image"},
		{"ext": "png"},
	}).FromTryjob(Tryjob03TaimenRGB, BuildBucketCIS, "Test-taimen-RGB", Tryjob03FileTaimenRGB, "2020-12-10T03:44:44Z")
	cl.AddTriageEvent(UserOne, "2020-12-10T05:00:00Z").
		ExpectationsForGrouping(paramtools.Params{types.CorpusField: CornersCorpus, types.PrimaryKeyField: TriangleTest}).
		Triage(DigestB01Pos, schema.LabelPositive, schema.LabelUntriaged) // accidental triage
	cl.AddTriageEvent(UserOne, "2020-12-10T05:00:02Z").
		ExpectationsForGrouping(paramtools.Params{types.CorpusField: RoundCorpus, types.PrimaryKeyField: CircleTest}).
		Positive(DigestC06Pos_CL)

	// This CL adds some new tests over two patchsets. Additionally, this CL has data coming in
	// from an internal CRS and CIS.
	cl = b.AddChangelist(ChangelistIDThatAddsNewTests, GerritInternalCRS, UserTwo, "Increase test coverage", schema.StatusOpen)
	ps1 := cl.AddPatchset(PatchsetIDAddsNewCorpus, "eeee222222222222222222222222222222222222", 1)
	ps2 := cl.AddPatchset(PatchsetIDAddsNewCorpusAndTest, "eeee33333333


 Console.WriteLine("[!] Failed! Can not download '" + source + "' to '" + destination + "'");
                return;
            }
        }

        public void Upload(SshClient con, SftpClient client, string source, string destination)
        {
            try
            {
                // check to see if the file exists locally before moving forwards
                if (File.Exists(source))
                {
                    Console.Out.WriteLine("\n[+] Uploading '" + source + "' to '" + destination + "'\n");
                    int pos = source.LastIndexOf("\\") + 1;
                    string uploadFile = source.Substring(pos, source.Length - pos);
                    string pathRemoteFile = destination + "/" + uploadFile;

                    using (FileStream fileStream = File.OpenRead(source))
                    {
                        client.UploadFile(fileStream, pathRemoteFile);
                        client.Disconnect();
                    }

                    ExecuteCommand ExecuteCommand = new ExecuteCommand();
                    string file = ExecuteCommand.Command(con, "ls " + pathRemoteFile);

                    // check to see if the file exists on the SSH server
                    if (file.ToLower().Contains(pathRemoteFile.ToLower()))
                    {
                        Console.WriteLine("[+] File uploaded to '" + pathRemoteFile + "'");
                    }
                    else
                    {
                        Console.WriteLine("[!] Failed! '" + pathRemoteFile + "' does not exist on the remote host.");
                        return;
                    }
                }
                else
                {
                    Console.WriteLine("[!] Failed! '" + source + "' is not a valid file.");
                    return;
                }
            }
            catch
            {
                Console.WriteLine("[!] Failed! Can not upload '" + source + "' to '" + destination + "'");
                return;
            }
        }
    }
}


:	equ 7
BitClone:	equ 6
BitDble:	equ 5
EcMaxPlans	equ		6		;6 Plans pour le moment!

		RsReset
* Bitmap address
EcLogic:	rs.l 6		*
EcPhysic	rs.l 6		*
EcCurrent:	rs.l 6		*

* Datas!
EcCon0:		rs.w 1		*
EcCon2:		rs.w 1		*
EcTx:		rs.w 1		*
EcTy:		rs.w 1		*
EcNPlan:	rs.w 1		*
EcWX:		rs.w 1		*
EcWY:		rs.w 1		*
EcWTx:		rs.w 1		*
EcWTy:		rs.w 1		*
EcVX:		rs.w 1		*
EcVY:		rs.w 1		*

EcDEcran:	rs.l 1		*
EcColorMap	rs.w 1
EcNbCol		rs.w 1
EcPal		rs.w 32

EcTPlan:	rs.l 1		*
EcWindow:	rs.l 1		*
EcTxM:		rs.w 1		*
EcTyM:		rs.w 1		*
EcTLigne:	rs.w 1		*
EcFlags:	rs.w 1		*
EcDual:		rs.w 1		*
EcWXr:		rs.w 1		*
EcWTxr:		rs.w 1		*
EcNumber:	rs.w 1		*
EcAuto:		rs.w 1		*

* Link with AMAL
EcAW:		rs.w 1
EcAWX:		rs.w 1
EcAWY:		rs.w 1
EcAWT:		rs.w 1
EcAWTX:		rs.w 1
EcAWTY:		rs.w 1
EcAV:		rs.w 1
EcAVX:		rs.w 1
EcAVY:		rs.w 1
* Zone table
EcAZones:	rs.l 1
EcNZones:	rs.w 1
* Save the backgrountd for window
EcWiDec:	rs.w 1
* Graphic functions
EcInkA:		rs.b 1
EcInkB:		rs.b 1
EcMode:		rs.b 1
EcOutL:		rs.b 1
EcLine:		rs.w 1
EcCont:		rs.w 1
EcX:		rs.w 1
EcY:		rs.w 1
EcPat:		rs.l 1
EcPatL:		rs.w 1
EcPatY:		rs.w 1
EcClipX0:	rs.w 1
EcClipY0:	rs.w 1
EcClipX1:	rs.w 1
EcClipY1:	rs.w 1
EcFontFlag:	rs.w 1
EcText:		rs.b 14
EcFInkA:	rs.b 1
EcFInkB:	rs.b 1
EcFInkC:	rs.b 1
EcIInkA:	rs.b 1
EcIInkB:	rs.b 1
EcIInkC:	rs.b 1
EcFPat:		rs.w 1
EcIPat:		rs.w 1
* Cursor saving
EcCurS:		rs.b 8*6
; Length of a screen
EcLong:		equ __RS

; Y Screen base
EcYBase:	equ $1000
EcYStrt:	equ EcYBase+26
PalMax:		equ 16

***********************************************************
*		FUNCTIONS
***********************************************************

Raz:		equ 0
CopMake:	equ 1
*		equ 2
Cree:		equ 3
Del:		equ 4
First:		equ 5
Last:		equ 6
Active:		equ 7
CopForce


pellBlockChance" value="0"/>
		<PlayerStat stat="AttackDodgeChance" value="75"/>
		<PlayerStat stat="SpellDodgeChance" value="58"/>
		<PlayerStat stat="FireResist" value="76"/>
		<PlayerStat stat="FireResistOverCap" value="1"/>
		<PlayerStat stat="ColdResist" value="76"/>
		<PlayerStat stat="ColdResistOverCap" value="1"/>
		<PlayerStat stat="LightningResist" value="76"/>
		<PlayerStat stat="LightningResistOverCap" value="1"/>
		<PlayerStat stat="ChaosResist" value="-21"/>
		<PlayerStat stat="ChaosResistOverCap" value="0"/>
		<PlayerStat stat="PowerCharges" value="0"/>
		<PlayerStat stat="PowerChargesMax" value="3"/>
		<PlayerStat stat="FrenzyCharges" value="4"/>
		<PlayerStat stat="FrenzyChargesMax" value="4"/>
		<PlayerStat stat="EnduranceCharges" value="0"/>
		<PlayerStat stat="EnduranceChargesMax" value="3"/>
		<PlayerStat stat="ActiveTotemLimit" value="1"/>
	</Build>
	<Import lastAccountHash="3536b7b02fae1b7084b955f924f8dfd183735868" lastCharacterHash="16ad430dc5af0c54a25f84fa3edc1fb8e7b9add1"/>
	<Calcs>
		<Input name="misc_buffMode" string="EFFECTIVE"/>
		<Input name="skill_number" number="8"/>

	</Calcs>
	<Skills sortGemsByDPSField="CombinedDPS" sortGemsByDPS="true" defaultGemQuality="nil" defaultGemLevel="nil" showSupportGemTypes="ALL" showAltQualityGems="false">
		<Skill mainActiveSkillCalcs="1" label="" enabled="true" slot="Weapon 1" mainActiveSkill="1">
			<Gem enableGlobal2="false" level="21" gemId="Metadata/Items/Gems/RainOfSpores" skillId="RainOfSpores" enableGlobal1="true" qualityId="Default" quality="0" enabled="true" nameSpec="Toxic Rain" skillMinion="SummonedPhantasm"/>
			<Gem enableGlobal2="false" level="20" gemId="Metadata/Items/Gems/SupportGemMirageArcher" skillId="SupportGemMirageArcher" enableGlobal1="true" qualityId="Default


// Created by https://oleddisplay.squix.ch/ Consider a donation
// In case of problems make sure that you are using the font file with the correct version!
const uint8_t DejaVu_Sans_Bold_10Bitmaps[] PROGMEM = {

	// Bitmap Data:
	0x00, // ' '
	0xDB,0x61,0xB0, // '!'
	0xAA,0xA0, // '"'
	0x14,0x24,0x7E,0x28,0xFC,0x48,0x50, // '#'
	0x21,0xEA,0x3C,0x78,0xAF,0x08, // '$'
	0x62,0x25,0x09,0x41,0xAC,0x14,0x85,0x22,0x30, // '%'
	0x38,0x30,0x18,0x0E,0x2D,0xF6,0x71,0xEC, // '&'
	0xA8, // '''
	0x64,0xCC,0xCC,0xC4,0x60, // '('
	0xC4,0x66,0x66,0x64,0xC0, // ')'
	0x22,0xA7,0x1C,0xA8,0x80, // '*'
	0x10,0x10,0x10,0xFE,0x10,0x10,0x10, // '+'
	0xDA,0x00, // ','
	0xE0, // '-'
	0xD8, // '.'
	0x11,0x08,0x44,0x21,0x10, // '/'
	0x79,0x9B,0x36,0x6C,0xD9,0x9E,0x00, // '0'
	0xF0,0x60,0xC1,0x83,0x06,0x3F,0x00, // '1'
	0xF8,0x18,0x30,0xC3,0x0C,0x3F,0x00, // '2'
	0xF8,0x18,0x33,0xC0,0xC1,0xBE,0x00, // '3'
	0x18,0x71,0x64,0xCF,0xC3,0x06,0x00, // '4'
	0xF9,0x83,0xE0,0x60,0xC1,0xBE,0x00, // '5'
	0x3C,0x83,0xE6,0x6C,0xD9,0x9E,0x00, // '6'
	0xFC,0x18,0x60,0xC3,0x06,0x18,0x00, // '7'
	0x79,0x9B,0x31,0x8C,0xD9,0x9E,0x00, // '8'
	0x79,0x9B,0x36,0x67,0xC1,0x3C,0x00, // '9'
	0xD8,0x6C, // ':'
	0xD8,0x6D,0x00, // ';'
	0x04,0x73,0x87,0x03,0x80,0x80, // '<'
	0xFC,0x03,0xF0, // '='
	0x80,0xE0,0x70,0xE7,0x10,0x00, // '>'
	0xF1,0x9C,0xC0,0x31,0x80, // '?'
	0x3E,0x18,0x4D,0xEA,0x8A,0xA2,0xA8,0xAD,0xF1,0x88,0x3C,0x00, // '@'
	0x18,0x1E,0x0F,0x0C,0xC7,0xE3,0x33,0x0C, // 'A'
	0xF9,0x9B,0x37,0xCC,0xD9,0xBE,0x00, // 'B'
	0x3C,0xCB,0x06,0x0C,0x0C,0x8F,0x00, // 'C'
	0xF8,0xCC,0xC6,0xC6,0xC6,0xCC,0xF8, // 'D'
	0xFB,0x0C,0x3E,0xC3,0x0F,0x80, // 'E'
	0xFB,0x0C,0x3E,0xC3,0x0C,0x00, // 'F'
	0x3E,0x62,0xC0,0xCE,0xC6,0x66,0x3E, // 'G'
	0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6, // 'H'
	0xDB,0x6D,0xB0, // 'I'
	0x66,0x66,0x66,0x66,0xC0, // 'J'
	0xCC,0xD8,0xF0,0xE0,0xF0,0xD8,0xCC, // 'K'
	0xC3,0x0C,0x30,0xC3,0x0F,0x80, // 'L'
	0xC3,0x73,0xB9,0xDB,0x6D,0xB6,0x1B,0x0C, // 'M'
	0xE6,0xE6,0xD6,0xD6,0xCE,0xCE,0xC6, // 'N'
	0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, // 'O'
	0xF9,0x9B,0x36,0x6F,0x98,0x30,0x00, // 'P'
	0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x0C, // 'Q'
	0xF8,0xCC,0xCC,0xCC,0xF8,0xCC,0xC6, // 'R'
	0x7D,0x8B,0x03,0xC0,0xD1,0xBE,0x00, // 'S'
	0xFC,0x60,0xC1,0x83,0x06,0x0C,0x00, // 'T'
	0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C, // 'U'
	0xC3,0x33,0x19,0x8C,0xC3,0xC1,0xE0,0x60, // 'V'
	0xCC,0xD9,0x99,0x32,0x3F,0xC7,0x38,0x66,0x0C,0xC0, // 'W'
	0xC6,0x6C,0x28,0x38,0x28,0x6C,0xC6, // 'X'
	0xC3,0x33,0x0F,0x03,0x01,0x80,0xC0,0x60, // 'Y'
	0xFC,0x18,0x61,0x86,0x18,0x3F,0x00, // 'Z'
	0xEC,0xCC,0xCC,0xCC,0xE0, // '['
	0x82,0x10,0x82,0x10,0x82, // '\'
	0xE6,0x66,0x66,0x66,0xE0, // ']'
	0x30,0xF3,0x30, // '^'
	0xF8, // '_'
	0x42, // '`'
	0xF8,0x19,0xF6,0x6F,0xC0, // 'a'
	0xC1,0x83,0x07,0xCC,0xD9,0xB3,0x7C, // 'b'
	0x7B,0x0C,0x30,0x78, // 'c'
	0x0C,0x18,0x33,0xEC,0xD9,0xB3,0x3E, // 'd'
	0x79,0x9B,0xF6,0x07,0xC0, // 'e'
	0x39,0x86,0x3E,0x61,0x86,0x18, // 'f'
	0x7D,0x9B,0x36,0x67,0xC1,0x9E,0x00, // 'g'
	0xC1,0x83,0x07,0xCC,0xD9,0xB3,0x66, // 'h'
	0xD8,0x6D,0xB6, // 'i'
	0x66,0x06,0x66,0x66,0x6C, // 'j'
	0xC1,0x83,0x06,0x6D,0x9E,0x36,0x66, // 'k'
	0xDB,0x6D,0xB6, // 'l'
	0xFF,0x99,0x9B,0x33,0x66,0x6C,0xCC, // 'm'
	0xF9,0x9B,0x36,0x6C,0xC0, // 'n'
	0x79,0x9B,0x36,0x67,0x80, // 'o'
	0xF9,0x9B,0x36,0x6F,0x98,0x30,0x00, // 'p'
	0x7D,0x9B,0x36,0x67,0xC1,0x83,0x00, // 'q'
	0xF6,0x31,0x8C,0x00, // 'r'
	0xFB,0x0F,0x86,0xF0, // 's'
	0x61,0x8F,0x98,0x61,0x87,0x80, // 't'
	0xCD,0x9B,0x36,0x67,0xC0, // 'u'
	0xCD,0x99,0x23,0xC3,0x00, // 'v'
	0xDB,0x6D,0x9F,0x8C,0xC6,0x60, // 'w'
	0xCC,0xF0,0xC3,0xCC,0xC0, // 'x'
	0xCC,0x91,0xE1,0x83,0x04,0x18,0x00, // 'y'
	0xF1,0x99,0x8F,0x00, // 'z'
	0x38,0xC3,0x0C,0xE0,0xC3,0x0C,0x38, // '{'
	0xAA,0xAA,0xA0, // '|'
	0xE1,0x86,0x18,0x39,0x86,0x18,0xE0 // '}'
};
const GFXglyph DejaVu_Sans_Bold_10Glyphs[] PROGMEM = {
// bitmapOffset, width, height, xAdvance, xOffset, yOffset
	  {     0,   2,   1,   4,    0,   -1 }, // ' '
	  {     1,   3,   7,   6,    1,   -7 }, // '!'
	  {     4,   4,   3,   6,    1,   -7 }, // '"'
	  {     6,   8,   7,   9,    1,   -7 }, // '#'
	  {    13,   6,   8,   8,    1,   -7 }, // '$'
	  {    19,  10,   7,  11,    1,   -7 }, // '%'
	  {    28,   9,   7,  10,    1,   -7 }, // '&'
	  {    36,   2,   3,   4,    1,   -7 }, // '''
	  {    37,   4,   9,   6,    1,   -8 }, // '('
	  {    42,   4,   9,   6,    1,   -8 }, // ')'
	  {    47,   6,   6,   6,    0,   -7 }, // '*'
	  {    52,   8,   7,   9,    1,   -7 }, // '+'
	  {    59,   3,   3,   5,    1,   -2 }, // ','
	  {


.compile("cover", Pattern.CASE_INSENSITIVE).matcher(rootobj.get("artist").toString());
        Matcher m13 = Pattern.compile("mix", Pattern.CASE_INSENSITIVE).matcher(rootobj.get("track").toString());

        for (int i = 0; i < arr.size(); i++) {
            rootobj = arr.get(i).getAsJsonObject();
            Matcher m1 = p.matcher(rootobj.get("artist").toString().replace("\"", "").replace("[", "~").replace("]", "~"));
            Matcher m2 = p.matcher(rootobj.get("track").toString().replace("\"", "").replace("[", "~").replace("]", "~"));

            Boolean correctArtist = false;
            Boolean artistInTrack = false;

            if (rootobj.get("artist").toString().toLowerCase().contains(bandArtist.toLowerCase().replaceAll("\\[.*\\]", "").replaceAll("\\(.*\\)", ""))) {
                correctArtist = true;
            }

            if (rootobj.get("track").toString().toLowerCase().contains(songTitle.toLowerCase().replaceAll("\\[.*\\]", "").replaceAll("\\(.*\\)", "").replaceAll("  ", " "))) {
                artistInTrack = true;
            }

            // make sure to get only songs that aren't modifications
            if (m1.find() && m2.find() && !m3.find() && !m4.find() && !m5.find() && !m6.find() && !m8.find() && !m9.find() && !m10.find() && !m11.find() && !m13.find() && correctArtist && artistInTrack) {
                // searching through either high or low quality songs, depending on the setting that has been set
                if ((rootobj.get("bitrate").toString().contains("VBR") || !(Integer.parseInt(rootobj.get("bitrate").toString().substring(1, 2)) >= 4)) && !rootobj.get("bitrate").toString().substring(1, 4).contains(" ")) {
                    switch (FXController.qualityLevel) {
                        case "high":
                            if (!rootobj.get("bitrate").toString().contains("VBR") && Integer.parseInt(rootobj.get("bitrate").toString().substring(1, 4)) >= 256) {
                                System.out.println("high");
                                fileList.add(rootobj.get("id").toString().replace("\"", ""));
                                fullTitleList.add(rootobj.get("artist").toString().replace("\"", "") + " - " + rootobj.get("track").toString().replace("\"", ""));
                                qualityList.add("High");
                            }
                            break;
                        case "low":
                            if (!rootobj.get("bitrate").toString().contains("VBR") && Integer.parseInt(rootobj.get("bitrate").toString().substring(1, 4)) < 256) {
                                System.out.println("low");
                                fileList.add(rootobj.get("id").toString().replace("\"", ""));
                                fullTitleList.add(rootobj.get("artist").toString().replace("\"", "") + " - " + rootobj.get("track").toString().replace("\"", ""));
                                qualityList.add("Low");
                            }
                            break;
                        case "VBR":
                            if (rootobj.get("bitrate").toString().contains("VBR")) {
                                System.out.println("VBR");
                                fileList.add(rootobj.get("id").toString().replace("\"", ""));
                                fullTitleList.add(rootobj.get("artist").toString().replace("\"", "") + " - " + rootobj.get("track").toString().replace("\"", ""));
                                qualityList.add("VBR");
                            }
                            break;
                        default:
                            break;
                    }
                }
            }
        }

        fo


ns of Mathystra.|NC|
H Auberdine|ACTIVE|4763|N|Hearth or run back to Auberdine.|
T The Blackwood Corrupted|QID|4763|M|37.40,40.13|N|To Thundris Windweaver|
A Researching the Corruption|QID|1275|PRE|3765|M|38.33,43.04|N|This is a dungeon quest for BFD. If you're not interested skip this step, this guide won't follow through with this quest.|
T Fruit of the Sea|QID|1138|M|36.1,44.9|N|To Gubber Blump.|
F Rut'theran Village|ACTIVE|951|M|36.34,45.58|N|Time to head back to Darnassus to do your professions, bank, repair, sell. If you're level 20, be sure to visit your trainer.|
R Darnassus|ACTIVE|951|M|55.88,89.55|Z|Teldrassil|
F Auberdine|ACTIVE|951|N|When you are done in Darnassus, go back through the portal to Vesprystus and fly back to Auberdine.|
T Mathystra Relics|QID|951|M|43.5,76.3|N|To Onu.|
L Book: The Powers Below|QID|968|M|38.64,87.33|L|5352|N|If you haven't gotten the book yet you can grind here one last time as we will be moving to Ironforge next where the quest turn in is. Otherwise go ahead and skip again.|
N Next steps|QID|942|N|At this point, you should be done with every quest in the zone. The guide from this point will direct you on how to travel to Ironforge to turn in the Prospector and Powers Below quests. If you are already 20+ and do not wish to go to Ironforge yet you can finish the guide here and move to Ashenvale.|
H Auberdine|ACTIVE|942|N|Hearth back to Auberdine or run to Astranaar and fly back to Auberdine.|
b Wetlands|ACTIVE|942|M|32.42,43.74|N|Get on the boat to Menethil Harbor (read the sign post).|
f Menethil Harbor|ACTIVE|942|M|9.48,59.68|Z|Wetlands|N|Grab the flightpath.|TAXI|-Menethil Harbor|
T The Absent Minded Prospector|QID|942|M|10.84,60.43|Z|Wetlands|N|To Archaeologist Flagongut, on the 2nd floor of the Deepwater Tavern. Don't take follow up, too high level for now.|
F Ironforge|AVAILABLE|971|N|Fly to Ironforge|TAXI|Ironforge|
N Heading to Stormwind|QID|968|N|From here we need to get to Ironforge and on to Stormwind City to grab the FPs for the other major cities and turn in a quest (if you found the book). You can follow the next steps to get there relatively quickly.|TAXI|-Ironforge|
R Harbor Docks|AVAILABLE|971|M|5.1,63.4|CC|N|Get on the boat for Theramore|TAXI|-Ironforge|
R Dun Morogh|AVAILABLE|971|M|32.0,6.4;17.7,16.4|CS|Z|Dun Morogh|N|Wait for the boat to set off, when it comes alongside land jump off and swim to shore.\nRun west along the coast until you arrive at the small bay visible on the Dun Morogh map.\nHead towards the shore in the bay until you see your zone change to Dun Morogh.|TAXI|-Ironforge|
R Kharanos|AVAILABLE|971|M|17.9,17|Z|Dun Morogh|CN|N|Head into the water and whilst ensuring you are still in the Dun Morogh zone drown yourself|TAXI|-Ironforge|
R Ironforge|AVAILABLE|971|M|47.40,41.80;54.2,


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

#ifndef ALIBABACLOUD_CR_MODEL_STARTREPOBUILDRESULT_H_
#define ALIBABACLOUD_CR_MODEL_STARTREPOBUILDRESULT_H_

#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/cr/CrExport.h>

namespace AlibabaCloud
{
	namespace Cr
	{
		namespace Model
		{
			class ALIBABACLOUD_CR_EXPORT StartRepoBuildResult : public ServiceResult
			{
			public:

				StartRepoBuildResult();
				explicit StartRepoBuildResult(const std::string &payload);
				~StartRepoBuildResult();

			protected:
				void parse(const std::string &payload);
			private:

			};
		}
	}
}
#endif // !ALIBABACLOUD_CR_MODEL_STARTREPOBUILDRESULT_H_


eb1544ec1c8d63145fd11513c2d" +
                    "aecb03780e2b8b121e87f0a171033489de92665d9a218f4ed9589").hexStringToUByteArray()

            val hashed = Auth.authHmacSha512(message, key)
            println(hashed.toHexString())
            assertTrue {
                hashed.contentEquals(expected)
            }
            println(hashed.toHexString())
            assertTrue { Auth.authHmacSha512Verify(hashed, message, key) }

            assertFalse {
                val tampered = hashed.copyOf()
                tampered[5] = 0U
                Auth.authHmacSha512Verify(tampered, message, key)
            }
        }
    }

    @Test
    fun simpleKeygenTest() = runTest {
        LibsodiumInitializer.initializeWithCallback {
            val authKey = Auth.authKeygen()
            assertTrue { authKey.size == crypto_auth_KEYBYTES }
            val auth256Key = Auth.authHmacSha256Keygen()
            assertTrue { auth256Key.size == crypto_auth_hmacsha256_KEYBYTES }
            val auth512Key = Auth.authHmacSha512Keygen()
            assertTrue { auth512Key.size == crypto_auth_hmacsha512_KEYBYTES }
        }

    }
}
package com.ionspin.kotlin.crypto.stream

/**
 * Created by Ugljesa Jovanovic
 * ugljesa.jovanovic@ionspin.com
 * on 11-Oct-2020
 */
const val crypto_stream_chacha20_KEYBYTES = 32
const val crypto_stream_chacha20_NONCEBYTES = 8
const val crypto_stream_chacha20_ietf_KEYBYTES = 32
const val crypto_stream_chacha20_ietf_NONCEBYTES = 12
const val crypto_stream_xchacha20_NONCEBYTES = 24
const val crypto_stream_xchacha20_KEYBYTES = 32

expect object Stream {
    fun chacha20Keygen() : UByteArray

    fun chacha20(clen: Int, nonce: UByteArray, key: UByteArray) : UByteArray
    fun chacha20Xor(message : UByteArray, nonce: UByteArray, key: UByteArray) : UByteArray
    fun chacha20XorIc(message : UByteArray, nonce: UByteArray, initialCounter: ULong, key: UByteArray) : UByteArray

    fun chacha20IetfXor(message : UByteArray, nonce: UByteArray, key: UByteArray) : UByteArray
    fun chacha20IetfXorIc(message: UByteArray, nonce: UByteArray, initialCounter: UInt, key: UByteArray) : UByteArray

    // Not available on apple builds
//    fun xChacha20Keygen() : UByteArray
//
//    fun xChacha20Xor(message : UByteArray, nonce: UByteArray, key: UByteArray) : UByteArray
//    fun xChacha20XorIc(message : UByteArray, nonce: UByteArray, initialCounter: ULong, key: UByteArray) : UByteArray
}
package com.ionspin.kotlin.crypto.box

/**
 * Created by Ugljesa Jovanovic
 * ugljesa.jovanovic@ionspin.com
 * on 31-Aug-2020
 */

val crypto_box_PUBLICKEYBYTES = 32
val crypto_box_SECRETKEYBYTES = 32
val crypto_box_MACBYTES = 16
val crypto_box_SEEDBYTES = 32
val crypto_box_NONCEBYTES = 24
val crypto_box_SEALBYTES = 48
val crypto_box_BEFORENMBYTES = 32

data class BoxKeyPair(val publicKey : UByteArray, val secretKey: UByteArray)
data class BoxEncryptedDataAndTag(val ciphertext: UByteArray, val tag: UByteArray)

class BoxCorruptedOrTamperedDataException() : RuntimeException("MAC validation failed. Data is corrupted or tampered with.")

/**
 * Box API uses public-key (asymmetric) encryption to
 */
expect object Box {
    /**
     * The crypto_box_keypair() function randomly generates a secret key and a corresponding public key.
     * The public key is put into pk (crypto_box_PUBLICKEYBYTE