, i64),
        velocity: (i64, i64, i64),
        acceleration: (i64, i64, i64),
    ) -> Self {
        Particle {
            position,
            velocity,
            acceleration,
        }
    }

    fn position_at(&self, time: i64) -> (i64, i64, i64) {
        (
            self.position.0 + self.velocity.0 * time + time * (time + 1) / 2 * self.acceleration.0,
            self.position.1 + self.velocity.1 * time + time * (time + 1) / 2 * self.acceleration.1,
            self.position.2 + self.velocity.2 * time + time * (time + 1) / 2 * self.acceleration.2,
        )
    }
}

fn distance_from_origin((x, y, z): (i64, i64, i64)) -> u64 {
    x.abs() as u64 + y.abs() as u64 + z.abs() as u64
}

pub struct ParticleSystem {
    particles: Vec<Particle>,
}

impl ParticleSystem {
    pub fn new() -> Self {
        ParticleSystem { particles: Vec::new() }
    }

    pub fn add_particle(&mut self, particle: Particle) {
        self.particles.push(particle);
    }

    pub fn closest_to_origin(&self) -> usize {
        self.particles
            .iter()
            .enumerate()
            .min_by_key(|&(_, p)| distance_from_origin(p.position_at(10_000)))
            .unwrap()
            .0
    }
}

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

    #[test]
    fn find_closest_particle() {
        let mut particle_system = ParticleSystem::new();

        particle_system.add_particle(Particle::new((3, 0, 0), (2, 0, 0), (-1, 0, 0)));
        particle_system.add_particle(Particle::new((4, 0, 0), (0, 0, 0), (-2, 0, 0)));

        assert_eq!(0, particle_system.closest_to_origin());
    }
}
<gh_stars>0
#[doc = "Reader of register ACR"]
pub type R = crate::R<u16, super::ACR>;
#[doc = "Writer for register ACR"]
pub type W = crate::W<u16, super::ACR>;
#[doc = "Register ACR `reset()`'s with value 0"]
impl crate::ResetValue for super::ACR {
    type Type = u16;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Auto Baud Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ABE_A {
    #[doc = "0: Disable auto baudrate"]
    DIS_AUTOBAUD = 0,
    #[doc = "1: Enable auto baudrate"]
    EN_AUTOBAUD = 1,
}
impl From<ABE_A> for bool {
    #[inline(always)]
    fn from(variant: ABE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `ABE`"]
pub type ABE_R = crate::R<bool, ABE_A>;
impl ABE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ABE_A {
        match self.bits {
            false => ABE_A::DIS_AUTOBAUD,
            true => ABE_A::EN_AUTOBAUD,


ef]">>>   usart_status_view

>>   usart_run_view

>>   atk_8266_wifista_test

UsageFault_Handler (Thumb, 4 bytes, Stack size 0 bytes, stm32f10x_it.o(i.UsageFault_Handler))

[Address Reference Count : 1]

 startup_stm32f10x_hd.o(RESET)

VOICE_Init (Thumb, 46 bytes, Stack size 8 bytes, voice.o(i.VOICE_Init))

[Stack]

Max Depth = 32
Call Chain = VOICE_Init ⇒ GPIO_Init

[Calls]

>>   RCC_APB2PeriphClockCmd

>>   GPIO_Init

>>   GPIO_ResetBits

[Called By]

>>   intelligent_test

__ARM_fpclassify (Thumb, 40 bytes, Stack size 0 bytes, fpclassify.o(i.__ARM_fpclassify))

[Called By]

>>   _printf_fp_dec_real

_is_digit (Thumb, 14 bytes, Stack size 0 bytes, __printf_wp.o(i._is_digit))

[Called By]

>>   __printf

_sys_exit (Thumb, 6 bytes, Stack size 0 bytes, usart.o(i._sys_exit))

[Called By]

>>   __rt_exit_exit

atk_8266_check_cmd (Thumb, 44 bytes, Stack size 16 bytes, common.o(i.atk_8266_check_cmd))

[Stack]

Max Depth = 28
Call Chain = atk_8266_check_cmd ⇒ strstr

[Calls]

>>   strstr

[Called By]

>>   atk_8266_send_cmd

>>   atk_8266_consta_check

atk_8266_consta_check (Thumb, 36 bytes, Stack size 16 bytes, common.o(i.atk_8266_consta_check))

[Stack]

Max Depth = 200 + Unknown Stack Size

Ca


q_sys+8]
	mov	w6, #42982
	movk	w6, #18374, lsl #16
.LBB98_11:                              //   Parent Loop BB98_3 Depth=1
                                        //     Parent Loop BB98_7 Depth=2
                                        // =>    This Inner Loop Header: Depth=3
	ldrb	w11, [x10], #1
	lsr	w12, w6, #2
	add	w12, w12, w6, lsl #5
	subs	x9, x9, #1                      // =1
	add	w11, w12, w11
	eor	w6, w11, w6
	b.ne	.LBB98_11
.LBB98_12:                              //   in Loop: Header=BB98_7 Depth=2
	cmp	w5, w6
	b.ne	.LBB98_4
.LBB98_13:                              //   in Loop: Header=BB98_7 Depth=2
	cmn	w8, #1                          // =1
	b.eq	.LBB98_6
// %bb.14:                              //   in Loop: Header=BB98_7 Depth=2
	ldr	x8, [x25, :lo12:p_sys_data_buf]
	ldr	w8, [x8]
	cmp	w8, w26
	b.ne	.LBB98_6
// %bb.15:                              //   in Loop: Header=BB98_7 Depth=2
	ldr	x8, [x27, :lo12:p_sys_spare_buf]
	ldrsh	w8, [x8]
	cmn	w8, #3932                       // =3932
	b.ne	.LBB98_6
	b	.LBB98_18
.LBB98_16:                              //   in Loop: Header=BB98_7 Depth=2
	ldrh	w8, [x22, :lo12:gSysInfo+4]
	cmp	w23, w8
	b.eq	.LBB98_5
// %bb.17:                              //   in Loop: Header=BB98_3 Depth=1
	adrp	x9, c_ftl_nand_page_pre_slc_blk
	ldrh	w9, [x9, :lo12:c_ftl_nand_page_pre_slc_blk]
	sub	w9, w9, #1                      // =1
	sxth	w24, w9
	mov	w19, w24
	tbz	w9, #15, .LBB98_3
	b	.LBB98_19
.LBB98_18:
	tbz	w19, #15, .LBB98_20
.LBB98_19:
	adrp	x0, .L.str.78
	adrp	x1, .L__func__.FtlLoadSysInfo
	add	x0, x0, :lo12:.L.str.78
	add	x1, x1, :lo12:.L__func__.FtlLoadSysInfo
	mov	w2, #1474
	bl	sftl_printk
.LBB98_20:
	adrp	x19, c_ftl_nand_data_blks_per_plane
	ldrh	w8, [x19, :lo12:c_ftl_nand_data_blks_per_plane]
	ldrh	w9, [x21, :lo12:c_ftl_nand_byte_pre_page]
	lsl	x2, x8, #1
	add	x8, x2, #48                     // =48
	cmp	x8, x9
	b.ls	.LBB98_22
// %bb.21:
	adrp	x0, .L.str.78
	adrp	x1, .L__func__.FtlLoadSysInfo
	add	x0, x0, :lo12:.L.str.78
	add	x1, x1, :lo12:.L__func__.FtlLoadSysInfo
	mov	w2, #1476
	bl	s


 `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04] // 0.4 pt / ptPerEm

}; // This map contains a mapping from font name and character code to character
// metrics, including height, depth, italic correction, and skew (kern from the
// character to the corresponding \skewchar)
// This map is generated via `make metrics`. It should not be changed manually.

 // These are very rough approximations.  We default to Times New Roman which
// should have Latin-1 and Cyrillic characters, but may not depending on the
// operating system.  The metrics do not account for extra height from the
// accents.  In the case of Cyrillic characters which have both ascenders and
// descenders we prefer approximations with ascenders, primarily to prevent
// the fraction bar or root line from intersecting the glyph.
// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.

var extraCharacterMap = {
  // Latin-1
  'Å': 'A',
  'Ç': 'C',
  'Ð': 'D',
  'Þ': 'o',
  'å': 'a',
  'ç': 'c',
  'ð': 'd',
  'þ': 'o',
  // Cyrillic
  'А': 'A',
  'Б': 'B',
  'В': 'B',
  'Г': 'F',
  'Д': 'A',
  'Е': 'E',
  'Ж': 'K',
  'З': '3',
  'И': 'N',
  'Й': 'N',
  'К': 'K',
  'Л': 'N',
  'М': 'M',
  'Н': 'H',
  'О': 'O',
  'П': 'N',
  'Р': 'P',
  'С': 'C',
  'Т': 'T',
  'У': 'y',
  'Ф': 'O',
  'Х': 'X',
  'Ц': 'U',
  'Ч': 'h',
  'Ш': 'W',
  'Щ': 'W',
  'Ъ': 'B',
  'Ы': 'X',
  'Ь': 'B',
  'Э': '3',
  'Ю': 'X',
  'Я': 'R',
  'а': 'a',
  'б': 'b',
  'в': 'a',
  'г': 'r',
  'д': 'y',
  'е': 'e',
  'ж': 'm',
  'з': 'e',
  'и': 'n',
  'й': 'n',
  'к': 'n',
  'л': 'n',
  'м': 'm',
  'н': 'n',
  'о': 'o',
  'п': 'n',
  'р': 'p',
  'с': 'c',
  'т': 'o',
  'у': 'y',
  'ф': 'b',
  'х': 'x',
  'ц': 'n',
  'ч': 'n',
  'ш': 'w',
  'щ': 'w',
  'ъ': 'a',
  'ы': 'm',
  'ь': 'a',
  'э': 'e',
  'ю': 'm',
  'я': 'r'
};

/**
 * This function adds new font metrics to default metricMap
 * It can also override existing metrics
 */
function setFontMetrics(fontName, metrics) {
  fontMetricsData[font


lt(a: u32, b: u32) -> bool {
    if f32_is_nan(a) || f32_is_nan(b) {
        // Unable to compare
        return false;
    }

    // Sign
    let mut a_sign = f32_sign(a);
    let mut b_sign = f32_sign(b);

    if a_sign != b_sign {
        // Different sign
        // FIXME: Add a test for this case
        if (a | b) << 1 != 0 {
            return a_sign == 1;
        }
    } else {
        // Same sign
        if a != b {
            if a_sign != 0 {
                return a > b;
            } else {
                return a < b;
            }
        }
    }
    false
}

pub fn f32_gt(a: u32, b: u32) -> bool {
    if f32_is_nan(a) || f32_is_nan(b) {
        // Unable to compare
        return false;
    }

    !f32_le(a, b)
}

pub fn f32_le(a: u32, b: u32) -> bool {
    if f32_is_nan(a) || f32_is_nan(b) {
        // Unable to compare
        return false;
    }

    // Sign
    let mut a_sign = f32_sign(a);
    let mut b_sign = f32_sign(b);

    if a_sign != b_sign {
        // Different sign
        // FIXME: Add a test for this case
        if (a | b) << 1 == 0 || a_sign == 1 {
            return true;
        }
    } else {
        // Same sign
        if a == b {
            return true;
        }

        if a_sign != 0 {
            return a > b;
        } else {
            return a < b;
        }
    }
    false
}

#[cfg(test)]
mod tests {
    #[test]
    fn test_f32_eq() {
        // 0.3 == 0.2 - false
        assert_eq!(crate::soft_f32::f32_eq(0x3E99999A, 0x3E4CCCCD), false);

        // 0.2 == 0.3 - false
        assert_eq!(crate::soft_f32::f32_eq(0x3E4CCCCD, 0x3E99999A), false);

        // -0.1 == -0.2 - false
        assert_eq!(crate::soft_f32::f32_eq(0xBDCCCCCD, 0xBE4CCCCD), false);

        // -0.2 == -0.1 - false
        assert_eq!(crate::soft_f32::f32_eq(0xBE4CCCCD, 0xBDCCCCCD), false);

        // 0.2 == 0.2 - true
        assert_eq!(crate::soft_f32::f32_eq(0x3E4CCCCD, 0x3E4CCCCD), true);

        // -0.2 == 0.2 - false
        assert_eq!(crate::soft_f32::f32_eq(0xBE4CCCCD, 0x3E4CCCCD), false);

        // Inf == 0.004 - false
        assert_eq!(crate::soft_f32::f32_eq(0x7F800000, 0x3B83126F), false);

        // -Inf < 0.004 - true
        assert_eq!(crate::soft_f32::f32_eq(0xFF800000, 0x3B83126F), false);

        // -Inf == Inf - true
        assert_eq!(crate::soft_f32::f32_eq(0xFF800000, 0x7F800000), false);

        // -Inf == Nan - false
        assert_eq!(crate::soft_f3


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.DotNet.Cli.Utils.Extensions;

namespace Microsoft.DotNet.Cli.Utils;

public class EnvironmentProvider(
    IEnumerable<string>? extensionsOverride = null,
    IEnumerable<string>? searchPathsOverride = null) : IEnvironmentProvider
{
    private static char[] s_pathSeparator = [Path.PathSeparator];
    private static char[] s_quote = ['"'];
    private IEnumerable<string>? _searchPaths = searchPathsOverride;
    private readonly Lazy<string> _userHomeDirectory = new(() => Environment.GetEnvironmentVariable("HOME") ?? string.Empty);
    private IEnumerable<string>? _executableExtensions = extensionsOverride;

    public IEnumerable<string> ExecutableExtensions
    {
        get
        {
            if (_executableExtensions == null)
            {
                _executableExtensions = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
                    ? Environment.GetEnvironmentVariable("PATHEXT")?
                        .Split(';')
                        .Select(e => e.ToLower().Trim('"')) ?? [string.Empty]
                    : [string.Empty];
            }

            return _executableExtensions;
        }
    }

    private IEnumerable<string> SearchPaths
    {
        get
        {
            if (_searchPaths == null)
            {
                var searchPaths = new List<string> { AppContext.BaseDirectory };

                searchPaths.AddRange(Environment
                    .GetEnvironmentVariable("PATH")?
                    .Split(s_pathSeparator)
                    .Select(p => p.Trim(s_quote))
                    .Where(p => !string.IsNullOrWhiteSpace(p))
                    .Select(p => ExpandTildeSlash(p)) ?? []);

                _searchPaths = searchPaths;
            }

            return _searchPaths;
        }
    }

    private string ExpandTildeSlash(string path)
    {
        const string tildeSlash = "~/";
        if (path.StartsWith(tildeSlash, StringComparison.Ordinal) && !string.IsNullOrEmpty(_userHomeDirectory.Value))
        {
            return Path.Combine(_userHomeDirectory.Value, path.Substring(tildeSlash.Length));
        }
        else
        {
            return path;
        }
    }

    public string? GetCommandPath(string command


/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * ARC CPU startup Code
 *
 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
 *
 * Vineetg: Dec 2007
 *  -Check if we are running on Simulator or on real hardware
 *      to skip certain things during boot on simulator
 */

#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/entry.h>
#include <asm/arcregs.h>
#include <asm/cache.h>
#include <asm/dsp-impl.h>
#include <asm/irqflags.h>

.macro CPU_EARLY_SETUP

	; Setting up Vectror Table (in case exception happens in early boot
	sr	@_int_vec_base_lds, [AUX_INTR_VEC_BASE]

	; Disable I-cache/D-cache if kernel so configured
	lr	r5, [ARC_REG_IC_BCR]
	breq    r5, 0, 1f		; I$ doesn't exist
	lr	r5, [ARC_REG_IC_CTRL]
#ifdef CONFIG_ARC_HAS_ICACHE
	bclr	r5, r5, 0		; 0 - Enable, 1 is Disable
#else
	bset	r5, r5, 0		; I$ exists, but is not used
#endif
	sr	r5, [ARC_REG_IC_CTRL]

1:
	lr	r5, [ARC_REG_DC_BCR]
	breq    r5, 0, 1f		; D$ doesn't exist
	lr	r5, [ARC_REG_DC_CTRL]
	bclr	r5, r5, 6		; Invalidate (discard w/o wback)
#ifdef CONFIG_ARC_HAS_DCACHE
	bclr	r5, r5, 0		; Enable (+Inv)
#else
	bset	r5, r5, 0		; Disable (+Inv)
#endif
	sr	r5, [ARC_REG_DC_CTRL]

1:

#ifdef CONFIG_ISA_ARCV2
	; Unaligned access is disabled at reset, so re-enable early as
	; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access
	; by default
	lr	r5, [status32]
#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
	bset	r5, r5, STATUS_AD_BIT
#else
	; Although disabled at reset, bootloader might have enabled it
	bclr	r5, r5, STATUS_AD_BIT
#endif
	kflag	r5

#ifdef CONFIG_ARC_LPB_DISABLE
	lr	r5, [ARC_REG_LPB_BUILD]
	breq    r5, 0, 1f		; LPB doesn't exist
	mov	r5, 1
	sr	r5, [ARC_REG_LPB_CTRL]
1:
#endif /* CONFIG_ARC_LPB_DISABLE */

	/* On HSDK, CCMs need to remapped super early */
#ifdef CONFIG_ARC_SOC_HSDK
	mov	r6, 0x60000000
	lr	r5, [ARC_REG_ICCM_BUILD]
	breq	r5, 0, 1f
	sr	r6, [ARC_REG_AUX_ICCM]
1:
	lr	r5, [ARC_REG_DCCM_BUILD]
	breq	r5, 0, 2f
	sr	r6, [ARC_REG_AUX_DCCM]
2:
#endif	/* CONFIG_ARC_SOC_HSDK */

#endif	/* CONFIG_ISA_ARCV2 */

	; Config DSP_CTRL properly, so kernel may use integer multiply,
	; multiply-accumulate, and divide operations
	DSP_EARLY_INIT
.endm

	.section .init.text, "ax",@progbits

;--


load/doppelganger_assistant_linux_arm64.deb
   sudo dpkg -i doppelganger_assistant_linux_arm64.deb
   ```

3. Fix any missing dependencies (if needed):
   ```sh
   sudo apt-get install -f -y
   ```

**Option 2: Using tar.xz archive (Other distributions)**

1. Install dependencies:
   ```sh
   sudo apt update && sudo apt upgrade -y
   sudo apt install libgl1 xterm make git wget -y
   ```

2. Download and install for your architecture:
   ```sh
   # For x86_64/amd64 systems:
   wget https://github.com/tweathers-sec/doppelganger_assistant/releases/latest/download/doppelganger_assistant_linux_amd64.tar.xz

   # For ARM64 systems:
   wget https://github.com/tweathers-sec/doppelganger_assistant/releases/latest/download/doppelganger_assistant_linux_arm64.tar.xz

   # Extract and install:
   tar xvf doppelganger_assistant_linux_*.tar.xz
   cd doppelganger_assistant
   sudo make install
   cd ..
   rm -rf doppelganger_assistant
   ```

To launch the Doppelganger Assistant GUI:

```sh
doppelganger_assistant
```

#### Manual Windows (WSL) Installation

1. **Enable WSL and install a Linux distribution**. Open PowerShell as Administrator:
   ```powershell
   # For Kali Linux (recommended):
   wsl --install -d kali-linux

   # OR for Ubuntu 24.04 LTS:
   wsl --install -d Ubuntu-24.04
   ```

2. **Reboot Windows**. After reboot, WSL will finish setup. When prompted, create a username and password for your Linux environment.

3. **Install Doppelganger Assistant** (inside WSL):
   ```sh
   sudo apt update && sudo apt upgrade -y
   sudo apt install libgl1 xterm wget -y

   # For x86_64/amd64 systems:
   wget https://github.com/tweathers-sec/doppelganger_assistant/releases/latest/download/doppelganger_assistant_linux_amd64.deb
   sudo dpkg -i doppelganger_assistant_linux_amd64.deb

   # For ARM64 systems:
   wget https://github.com/tweathers-sec/doppelganger_assistant/releases/latest/download/doppelganger_assistant_linux_arm64.deb
   sudo dpkg -i doppelganger_assistant_linux_arm64.deb
   ```

4. **Install Proxmark3 dependencies**:
   ```sh
   sudo apt install --no-install-recommends -y git ca-certificates build-essential pkg-config \
   libreadline-dev gcc-arm-none-eabi libnewlib-dev qtbase5-dev \
   libbz2-dev liblz4-dev libbluetooth-dev libpython3-dev libssl-dev libgd-dev
   ```

5. **Clone and build Proxmark3**:
   ```sh
   mkdir -p ~/src && cd ~/src
   git clone https://github.com/RfidResearchGroup/proxmark3.git
   cd proxmark3

   # Configure for your Proxmark3 device type:
   cp Makefile.platform.sample Makefile.platform

   # Edit Makefile.platform for your device:
   # - For RDV4 with Blueshark: Uncomment PLATFORM=PM3RDV4 and PLATFORM_EXTRAS=BTADDON
   # - For RDV4 without Blueshark: Uncomment PLATFORM=PM3RDV4 only
   # - For Proxmark3 Easy (512KB): Uncomment PLATFORM=PM3GENERIC and PLATFORM_SIZE=512
   nano Makefile.platform

   # Build and install
   make clean && make -j$(nproc)
   sudo make install PREFIX=/usr/local
   ```

6. **Install USBipd** (from Windows PowerShell as Administrator):


 * sintaxis familiar con características únicas del lenguaje.
 */

import 'dart:io' show stdout;

void main() {
  print('=== Demostración de Mecanismos de Iteración en Dart ===\n');

  // 1. Bucle for tradicional
  print('1. Usando bucle for tradicional:');
  void forLoop() {
    for (int i = 1; i <= 10; i++) {
      stdout.write('$i ');
    }
    print(''); // Nueva línea
  }
  forLoop();

  // 2. Bucle while
  print('\n2. Usando bucle while:');
  void whileLoop() {
    int contador = 1;
    while (contador <= 10) {
      stdout.write('$contador ');
      contador++;
    }
    print('');
  }
  whileLoop();

  // 3. Bucle do-while
  print('\n3. Usando bucle do-while:');
  void doWhileLoop() {
    int num = 1;
    do {
      stdout.write('$num ');
      num++;
    } while (num <= 10);
    print('');
  }
  doWhileLoop();

  // 4. forEach con List
  print('\n4. Usando forEach con List:');
  void forEachLoop() {
    List<int> numeros = List.generate(10, (index) => index + 1);
    numeros.forEach((numero) => stdout.write('$numero '));
    print('');
  }
  forEachLoop();

  // 5. for-in loop
  print('\n5. Usando for-in loop:');
  void forInLoop() {
    var numeros = List.generate(10, (index) => index + 1);
    for (var numero in numeros) {
      stdout.write('$numero ');
    }
    print('');
  }
  forInLoop();

  // 6. Usando Iterable.generate
  print('\n6. Usando Iterable.generate:');
  void iterableGenerate() {
    var numeros = Iterable.generate(10, (index) => index + 1);
    numeros.forEach((numero) => stdout.write('$numero '));
    print('');
  }
  iterableGenerate();

  // 7. Usando map
  print('\n7. Usando map:');
  void mapExample() {
    var numeros = List.generate(10, (index) => index + 1);
    numeros.map((numero) => stdout.write('$numero ')).toList();
    print('');
  }
  mapExample();

  // 8. Usando Iterador personalizado
  print('\n8. Usando Iterador personalizado:');
  class NumberIterator implements Iterator<int> {
    int _current = 0;

    @override
    int get current => _current;

    @override
    bool moveNext() {
      if (_current < 10) {
        _current++;
        return true;
      }
      return false;
    }
  }

  class NumberIterable extends Iterable<int> {
    @override
    Iterator<int> get iterator => NumberIterator();
  }

  void customIterator() {
    var numbers = NumberIterable();
    for (var number in numbers) {
      stdout.write('$number ');
    }
    print('');
  }
  customIterator();

  // 9. Usando async* para generar un stream
  print('\n9. Usando async* para generar un stream:');
  Stream<int> countStream() async* {
    for (int i = 1; i <= 10; i++) {
      yield i;
    }
  }

  void streamExample() async {
    await for (var number in countStream()) {
      stdout.write('$number ');
    }
    print('');
  }
  // Nota: Este


/  lw         $s6, 0xA0($sp)
/* 37FF6E8 80087920 9C00B58F */  lw         $s5, 0x9C($sp)
/* 37FF6EC 80087924 9800B48F */  lw         $s4, 0x98($sp)
/* 37FF6F0 80087928 9400B38F */  lw         $s3, 0x94($sp)
/* 37FF6F4 8008792C 9000B28F */  lw         $s2, 0x90($sp)
/* 37FF6F8 80087930 8C00B18F */  lw         $s1, 0x8C($sp)
/* 37FF6FC 80087934 8800B08F */  lw         $s0, 0x88($sp)
/* 37FF700 80087938 B000BD27 */  addiu      $sp, $sp, 0xB0
/* 37FF704 8008793C 0800E003 */  jr         $ra
/* 37FF708 80087940 00000000 */   nop
.size func_level_41_800866D8, . - func_level_41_800866D8


  const int kTimestampOffset = 160;
  // Create first packet, with 3 RED payloads.
  PacketList packet_list;
  packet_list.push_back(CreateRedPayload(3, payload_types, kTimestampOffset));
  // Create first packet, with 3 RED payloads.
  {
    Packet packet = CreateRedPayload(3, payload_types, kTimestampOffset);
    // Manually change timestamp and sequence number of second packet.
    packet.timestamp += kTimestampOffset;
    packet.sequence_number++;
    packet_list.push_back(std::move(packet));
  }
  RedPayloadSplitter splitter;
  EXPECT_TRUE(splitter.SplitRed(&packet_list));
  ASSERT_EQ(6u, packet_list.size());
  // Check first packet, A1.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[2],
               kSequenceNumber, kBaseTimestamp, 2, {0, 0});
  packet_list.pop_front();
  // Check second packet, A2.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[1],
               kSequenceNumber, kBaseTimestamp - kTimestampOffset, 1, {0, 1});
  packet_list.pop_front();
  // Check third packet, A3.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
               kSequenceNumber, kBaseTimestamp - 2 * kTimestampOffset, 0,
               {0, 2});
  packet_list.pop_front();
  // Check fourth packet, B1.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[2],
               kSequenceNumber + 1, kBaseTimestamp + kTimestampOffset, 2,
               {0, 0});
  packet_list.pop_front();
  // Check fifth packet, B2.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[1],
               kSequenceNumber + 1, kBaseTimestamp, 1, {0, 1});
  packet_list.pop_front();
  // Check sixth packet, B3.
  VerifyPacket(packet_list.front(), kPayloadLength, payload_types[0],
               kSequenceNumber + 1, kBaseTimestamp - kTimestampOffset, 0,
               {0, 2});
}

// Creates a list with 4 packets with these payload types:
// 0 = CNGnb
// 1 = PCMu
// 2 = DTMF (AVT)
// 3 = iLBC
// We expect the method CheckRedPayloads to discard the iLBC packet, since it
// is a non-CNG, non-DTMF payload of another type than the first speech payload
// found in the list (which is PCMu).
TEST(RedPayloadSplitter, CheckRedPayloads) {
  PacketList packet_list;
  for (uint8_t i = 0; i <= 3; ++i) {
    // Create packet with payload type `i`, payload length 10 bytes, all 0.
    packet_list.push_back(CreatePacket(i, 10, 0));
  }

  // Use a real DecoderDatabase object here instead of a mock, since it is
  // easier to just register the payload types and let the actual implementation
  // do its job.
  DecoderDatabase decoder_database(
      rtc::make_ref_counted<MockAudioDecoderFactory>(), absl::nullopt);
  decoder_database.RegisterPayload(0, SdpAudioFormat("cn", 8000, 1));
  decoder_database.RegisterPayload(1, SdpAudioFormat("pcmu", 8000, 1));
  decoder_database.RegisterPayload(2,
                                   SdpAudioFormat("telephone-event", 8000, 1));
  decoder_database.RegisterPayload(3, SdpAudioFormat("ilbc", 8000, 1));

  RedPayloadSplitter splitter;
  splitter.CheckRedPayloads(&packet_list, decoder_database);

  ASSERT_EQ(3u, packet_list.size());  // Should have dropped the last packet.
  // Verify packets. The loop verifies that payload types 0, 1, and 2 are in the
  // list.
  for (int i = 0; i <= 2;


息发送失败时是否重发消息
     */
    var resendOnSendFailed: Boolean = false,

    /**
     * 重新登录时是否发送测试消息
     */
    var sendTestMessageOnRelogin: Boolean = false,

    var framework: Framework = Framework()
) {

    data class Framework(

        /**
         * 使用哪个框架作为实现（默认为tester）
         */
        var impl: FrameworkEnum = FrameworkEnum.TESTER
    )
}
package de.honoka.sdk.util.kotlin.text

import cn.hutool.json.JSON
import cn.hutool.json.JSONArray
import cn.hutool.json.JSONObject
import kotlin.reflect.KClass

@Suppress("MemberVisibilityCanBePrivate")
class JsonWrapper internal constructor(private val json: JSON) {

    operator fun get(path: String): JSONObject = getObj(path)

    //not null

    fun getObj(path: String): JSONObject = getObjOrNull(path)!!

    fun getArray(path: String): JSONArray = getArrayOrNull(path)!!

    inline fun <reified T> getBean(path: String): T = getBeanOrNull<T>(path)!!

    inline fun <reified T> getList(path: String): List<T> = getListOrNull<T>(path)!!

    fun getStr(path: String): String = getStrOrNull(path)!!

    fun getInt(path: String): Int = getIntOrNull(path)!!

    fun getLong(path: String): Long = getLongOrNull(path)!!

    fun getBool(path: String): Boolean = getBoolOrNull(path)!!

    fun getDouble(path: String): Double = getDoubleOrNull(path)!!

    //nullable

    fun getObjOrNull(path: String): JSONObject? = json.getByPath(path) as JSONObject?

    fun getArrayOrNull(path: String): JSONArray? = json.getByPath(path) as JSONArray?

    inline fun <reified T> getBeanOrNull(path: String): T? = getObjOrNull(path)?.toBean(T::class.java)

    inline fun <reified T> getListOrNull(path: String): List<T>? = getArrayOrNull(path)?.toList(T::class.java)

    fun getStrOrNull(path: String): String? = json.getByPath(path)?.toString()

    fun getIntOrNull(path: String): Int? = (json.getByPath(path) as Number?)?.toInt()

    fun getLongOrNull(path: String): Long? = (json.getByPath(path) as Number?)?.toLong()

    fun getBoolOrNull(path: String): Boolean? = json.getByPath(path) as Boolean?

    fun getDoubleOrNull(path: String): Double? = (json.getByPath(path) as Number?)?.toDouble()

    //others

    override fun toString(): String = json.toString()

    fun <T : Any> toBean(clazz: KClass<T>): T = json.toBean(clazz.java)
}
package de.honoka.sdk.spring.starter.config

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.web.cors.CorsConfiguration
import org.springframework.web.cors.UrlBasedCorsConfigurationSource
import org.springframework.web.filter.CorsFilter

@ComponentScan("de.honoka.sdk.spring.starter.core")
@EnableConfigurationProperties(MainProperties::class)
@Configuration("${MainConfig.STARTER_BEAN_NAME_PREFIX}MainConfig")
class MainConfig(private val mainProperties: MainProperties) {

    companion object {


global", ".gitattributes", ".gitattributes-global", ".gitattributes_global", ".gitconfig", ".gitmodules", ".gitkeep", ".keep", ".gitpreserve", ".gitinclude", ".git-blame-ignore", ".git-blame-ignore-revs", ".git-for-windows-updater", "git-history" -> FileType.GIT
    "go.mod", "go.sum", "go.work", "go.work.sum" -> FileType.GO_MOD
    "CNAME" -> FileType.HTTP
    ".jscsrc", ".jshintrc", "composer.lock", ".jsbeautifyrc", ".esformatter", "cdp.pid", ".whitesource" -> FileType.JSON
    "prisma.config.ts", "prisma.config.js", "prisma.config.cts", "prisma.config.cjs", "prisma.config.mts", "prisma.config.mjs", "prisma.yml" -> FileType.PRISMA
    ".rhistory" -> FileType.R
    ".ruby-version" -> FileType.RUBY
    ".htaccess" -> FileType.XML
    ".env.defaults", ".env.example", ".env.sample", ".env.template", ".env.schema", ".env.local", ".env.dev", ".env.development", ".env.alpha", ".env.e2e", ".env.qa", ".env.dist", ".env.prod", ".env.production", ".env.stage", ".env.staging", ".env.preview", ".env.test", ".env.testing", ".env.dev.local", ".env.development.local", ".env.qa.local", ".env.prod.local", ".env.production.local", ".env.staging.local", ".env.test.local", ".env.uat", ".env.cat" -> FileType.ENV
    "cmakelists.txt", "cmakecache.txt" -> FileType.CMAKE
    "firebase.json", ".firebaserc", "firestore.rules", "storage.rules", "firestore.indexes.json" -> FileType.FIREBASE
    "procfile" -> FileType.HEROKU
    ".adonisrc.json", "ace" -> FileType.ADONIS
    ".alexrc", ".alexrc.yaml", ".alexrc.yml", ".alexrc.js" -> FileType.ALEX
    "androidmanifest.xml" -> FileType.ANDROID
    "apollo.config.js", "apollo.config.ts" -> FileType.APOLLO
    "astro.config.js", "astro.config.mjs", "astro.config.cjs", "astro.config.ts", "astro.config.cts", "astro.config.mts" -> FileType.ASTRO_CONFIG
    "azure-pipelines.yml", "azure-pipelines.yaml", "azure-pipelines-main.yml", "azure-pipelines-main.yaml" -> FileType.AZURE_PIPELINES
    ".babelrc", ".babelrc.cjs", ".babelrc.js", ".babelrc.mjs", ".babelrc.json", "babel.config.cjs", "babel.config.js", "babel.config.mjs", "babel.config.json", "babel-transform.js", ".babel-plugin-macrosrc", ".babel-plugin-macrosrc.json", ".babel-plugin-macrosrc.yaml", ".babel-plugin-macrosrc.yml", ".babel-plugin-macrosrc.js", "babel-plugin-macros.config.js" -> FileType.BABEL
    "biome.json", "biome.jsonc" -> FileType.BIOME
    "bitbucket-pipelines.yaml", "bitbucket-pipelines.yml" -> FileType.BITBUCKET
    "blitz.config.js", "blitz.config.ts", ".blitz.config.compiled.js" -> FileType.BLITZ
    ".bowerrc", "bower.json" -> FileType.BOWER
    "browserslist", ".browserslistrc" ->


pathname

port

protocol

search

hashCode

runtimeType

Methods

noSuchMethod

toString

Operators

operator ==

hash property

          String
                  hash

Implementation

String get hash native;

    keepapp
      1.0.1+2

<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the actualBoundingBoxLeft property from the TextMetrics class, for the Dart programming language.">
  <title>actualBoundingBoxLeft property - TextMetrics class - dart:html library - Dart API</title>

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesh


//
//  MDXLight.cs
//
//  Author:
//       Jarl Gullberg <jarl.gullberg@gmail.com>
//
//  Copyright (c) 2017 Jarl Gullberg
//
//  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/>.
//

using System.IO;
using System.Numerics;
using Warcraft.Core;
using Warcraft.Core.Extensions;
using Warcraft.Core.Interfaces;
using Warcraft.Core.Structures;
using Warcraft.MDX.Animation;

namespace Warcraft.MDX.Visual
{
    /// <summary>
    /// Represents a light source in a model.
    /// </summary>
    public class MDXLight : IVersionedClass
    {
        /// <summary>
        /// Gets or sets the light type.
        /// </summary>
        public MDXLightType Type { get; set; }

        /// <summary>
        /// Gets or sets the bone the light is attached to. -1 means no attachment.
        /// </summary>
        public short Bone { get; set; }

        /// <summary>
        /// Gets or sets the relative position of the light.
        /// </summary>
        public Vector3 Position { get; set; }

        /// <summary>
        /// Gets or sets the ambient colour track.
        /// </summary>
        public MDXTrack<RGB> AmbientColour { get; set; }

        /// <summary>
        /// Gets or sets the ambient intensity track.


izes a drm_device structures,registering the
 * stubs
 *
 * Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
 * after the initialization for driver customization.
 */

int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device)
{
	DRM_DEBUG("\n");

	driver->kdriver.platform_device = platform_device;
	driver->bus = &drm_platform_bus;
	INIT_LIST_HEAD(&driver->device_list);
	return drm_get_platform_dev(platform_device, driver);
}
EXPORT_SYMBOL(drm_platform_init);

void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device)
{
	struct drm_device *dev, *tmp;
	DRM_DEBUG("\n");

	list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item)
		drm_put_dev(dev);
	DRM_INFO("Module unloaded\n");
}
EXPORT_SYMBOL(drm_platform_exit);


u 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 ghidra.app.plugin.core.codebrowser;

import static org.junit.Assert.assertEquals;

import org.junit.*;

import ghidra.app.plugin.core.navigation.locationreferences.LocationReferencesPlugin;
import ghidra.app.services.ProgramManager;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.database.ProgramBuilder;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressFactory;
import ghidra.program.model.data.DWordDataType;
import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.RefType;
import ghidra.program.model.symbol.SourceType;
import ghidra.program.util.OperandFieldLocation;
import ghidra.program.util.VariableNameFieldLocation;
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
import ghidra.test.TestEnv;

public class CodeBrowserNavigationx86Test extends AbstractGhidraHeadedIntegrationTest {
	private TestEnv env;
	private PluginTool tool;
	private AddressFactory addrFactory;
	private Program program;
	private CodeBrowserPlugin cb;

	public CodeBrowserNavigationx86Test() {
		super();
	}

	private Address addr(String address) {
		return addrFactory.getAddress(address);
	}

    @Before
    public void setUp() throws Exception {
		env = new TestEnv();
		tool = env.getTool();
		tool.addPlugin(CodeBrowserPlugin.class.getName());
		tool.addPlugin(LocationReferencesPlugin.class.getName());
		cb = env.getPlugin(CodeBrowserPlugin.class);
	}

    @After
    public void tearDown() {
		env.dispose();
	}

	private void loadProgram(String programName) throws Exception {
		program = buildProgram();
		ProgramManager pm = tool.getService(ProgramManager.class);
		pm.openProgram(program.getDomainFile());
		addrFactory = program.getAddressFactory();
	}

	private Program buildProgram() throws Exception {
		ProgramBuilder builder = new ProgramBuilder("Test", ProgramBuilder._X86);
		builder.createMemory(".text", "0x1001000", 0x6600);
		builder.createMemory(".data", "0x1008000", 0x600);
		builder.createMemory(".rsrc", "0x100a000", 0x5400);
		builder.setBytes("1002cf5", "55 8b ec 83 7d 14 00 c2 14 00");
		builder.disassemble("1002cf5", 10);
		DataType dt = new DWordDataType();
		ParameterImpl param = new ParameterImpl(null, dt, builder.getProgram());
		builder.createEmptyFunction("ghidra", "1002cf5", 20, DataType.DEFAULT, param, param, param,
			param, param, param);
		builder.createStackReference("1002cf8", RefType.DATA, 0x14, SourceType.ANALYSIS, 0);
		return builder.getProgram();
	}

@Test
    public void testStackReferenceNavigation() throws Exception {
		loadProgram("notepad");
		env.showTool();
		waitForSwing();
		cb.goTo(new OperandFieldLocation(program, addr("1002cf8"), null, null, null, 0, 0));
		assertEquals(addr("1002cf8"), cb.getCurrentAddress());


4BD0FgwG54HYfE8R3cTSyuEvvKAbChlSyHQt9GTEaaeEsLCWcR06kanRJWy1QfE94oGOUO4T/b9ScggZ35t+o8QyqG1wOHq+JO+18gqjRPpCOJWgQxExYbzxqcQaI6dpQg0O+BV53GawjmL0lAn6QQ05r/sC5wTTExdGwLDMO9r0aEmqJg/fHmZGDCi/HaBRswVBwAX3BdUOLeCqu529ng9LmGwodZKhQ7QDOkC4MwMy0ivxoYF7oxnNvJd+0AqVh6TmhP+tlEpDRboOcK4A+wYQeAZDVZb7sM523tosImIUQX1jXgT4zVqoZ5IZAecEhjgCMSgA+eeCzo/ZdwUdeEv8FisLvY+RcLdTXguAlIOgC71uxVdethPDjrdQHR9LQv5UJrvy2cNf9QsGg7XbbYcAmmw1Ry5crz0pqVQYN2mSLPjpqNbbpkUOtzBZbqDVheOet3JfO9dlhxJZ7u+p1Nhqq/AEbwS+s0WPQNgvryibDO+WNms2Fh87yjhf3iSjnYFGtuGUS7L4wX55sq0SLZw7q7zQAKavXnNPsWETUuHbKluQGeT2VP0E+) format('woff2'),url(https://cdnjs.cat.net/ajax/libs/material-design-icons/3.0.1/iconfont/MaterialIcons-Regular.woff) format('woff')}@charset "utf-8";
/* CSS Document */
/* --- Common Rules --- */
body {
	background:#10384a url(../images/bg.png) repeat-x center top;
	font-family:Arial, Helvetica, sans-serif;
	margin:0px;
	font-size:13px;
	line-height:1.5em;
	overflow:hidden;
	color:#fff;
}
#wrapper {
	background:url(../images/bg-image.jpg) no-repeat center top;
	overflow:hidden;
	min-height:780px;
	height:100%;
	width:100%;
}
p { margin:0px 0px 10px; }
h1, h2, h3, h4, h5, h6 { margin:0px 0px 10px; }
h5 { text-transform:uppercase }
h2.content-heading {
	font-size:160%;
	margin-bottom:15px;
}
h3.window-title {
	font-size:100%;
	font-weight:bold;
	line-height:30px;
	margin:0;
	color:#FFFFFF;
	text-shadow:0 0 1px #000000;
}
img { border:none }
a {
	font-weight:bold;
	text-decoration:none;
	color:#ffde00;
}
ul, ol {
	margin:0 0 10px;
	padding:0 0 0 20px;


aps.s	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovaps	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovaps.s	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovaps	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovaps.s	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa32	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa32.s	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa32	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa32.s	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa32	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa32.s	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa32	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa32.s	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa32	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa32.s	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa32	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa32.s	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa32	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa32.s	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa32	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa32.s	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa64	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa64.s	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa64	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa64.s	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa64	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa64.s	xmm6{k7}, xmm5	 # AVX512{F,VL}
	vmovdqa64	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa64.s	xmm6{k7}{z}, xmm5	 # AVX512{F,VL}
	vmovdqa64	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa64.s	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa64	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa64.s	ymm6{k7}{z}, ymm5	 # AVX512{F,VL}
	vmovdqa64	ymm6{k7}, ymm5	 # AVX512{F,VL}
	vmovdqa64.s	ymm


/*
 * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "unity.h"
#include "unity_test_runner.h"
#include "unity_test_utils_memory.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "usb_device_uvc.h"
#include "esp_timer.h"

static const char *TAG = "usb_device_uvc_test";

// Some resources are lazy allocated in GPTimer driver, the threshold is left for that case
#define TEST_MEMORY_LEAK_THRESHOLD (-300)
#define UVC_MAX_FRAMESIZE_SIZE     (60*1024)
#define WIDTH   CONFIG_UVC_CAM1_FRAMESIZE_WIDTH
#define HEIGHT  CONFIG_UVC_CAM1_FRAMESIZE_HEIGT
#define TEST_COUNT (15)

extern const unsigned char jpg_start[] asm("_binary_esp_1280_720_jpg_start");
extern const unsigned char jpg_end[]   asm("_binary_esp_1280_720_jpg_end");

static uvc_fb_t s_fb;

static void camera_stop_cb(void *cb_ctx)
{
    ESP_LOGI(TAG, "camera stop");
}

static esp_err_t camera_start_cb(uvc_format_t format, int width, int height, int rate, void *cb_ctx)
{
    (void)cb_ctx;
    ESP_LOGI(TAG, "Camera: Start");
    ESP_LOGI(TAG, "Format: %d, width: %d, height: %d, rate: %d", format, width, height, rate);

    return ESP_OK;
}

static void camera_fb_return_cb(uvc_fb_t *fb, void *cb_ctx)
{
    (void)cb_ctx;
    assert(fb == &s_fb);
}

static uvc_fb_t* camera_fb_get_cb(void *cb_ctx)
{
    (void)cb_ctx;
    uint64_t us = (uint64_t)esp_timer_get_time();
    s_fb.buf = (uint8_t *)jpg_start;
    s_fb.len = jpg_end - jpg_start;
    s_fb.width = WIDTH;
    s_fb.height = HEIGHT;
    s_fb.format = UVC_FORMAT_JPEG;
    s_fb.timestamp.tv_sec = us / 1000000UL;
    s_fb.timestamp.tv_usec = us % 1000000UL;

    if (s_fb.len > UVC_MAX_FRAMESIZE_SIZE) {
        ESP_LOGE(TAG, "Frame size %d is larger than max frame size %d", s_fb.len, UVC_MAX_FRAMESIZE_SIZE);
        return NULL;
    }

    return &s_fb;
}

TEST_CASE("usb_device_uvc_test", "[usb_device_uvc]")
{

    uint8_t *uvc_buffer = (uint8_t *)malloc(UVC_MAX_FRAMESIZE_SIZE);
    TEST_ASSERT_NOT_NULL(uvc_buffer);

    uvc_device_config_t config = {
        .uvc_buffer = uvc_buffer,
        .uvc_buffer_size = UVC_MAX_FRAMESIZE_SIZE,
        .start_cb = camera_start_cb,
        .fb_get_cb = camera_fb_get_cb,
        .fb_return_cb = camera_fb_return_cb,
        .stop_cb = camera_stop_cb,
        .cb_ctx = NULL,
    };
    uvc_device_config(0, &config);
    uvc_device_init();
    for (int i = 0; i < TEST_COUNT; i++) {
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        ESP_LOGI(TAG, "UVC Device Test: %d", i);
    }
    uvc_device_deinit();
    free(uvc_buffer);
}

static size_t before_free_8bit;
static size_t before_free_32bit;

void setUp(void)
{
    before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT);
    before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT);
}

void tearDown(void)
{
    size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT);
    size_t after_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT);
    unity_utils_check_leak(before_free_8bit, after_free_8bit, "8BIT", TEST_MEMORY_LEAK_THRESHOLD);
    unity_utils_check_leak(before_free_32bit, after_free_32bit, "32BIT", TEST_MEMORY_LEAK_THRESHOLD);
}

void app_main(void)
{

    //  _   _ _   _ _____     _____ _____ _____ _____
    // | | | | | | /  __ \   |_   _|  ___/  ___|_   _|
    // | | | | | | | /  \/_____| | | |__ \ `--.  | |
    // | | | | | | | |  |______| | |  __| `--. \ | |
    // | |_| \ \_/ / \__/\     | | | |___/\__/ / | |
    //  \___/ \___/ \____/     \_/ \____/\____/  \_/
    printf(" _   _ _   _ _____     _____ _____ _____ _____ \n");
    printf("| | | | | | /  __ \\   |_   _|  ___/  ___|_   _|\n");
    printf("| | | | | | | /  \\/_____| | | |__ \\ `--.  | |  \n");
    printf("| | | | | | | |  |______| | |  __| `--. \\ | |  \n");
    printf("| |_| \\ \\_/ / \\__/\\     | | | |___/\\__/ / | |  \n");
    printf(" \\___/ \\___/ \\____/     \\_/ \\____/\\____/  \\_/  \n");
    unity_run_menu();
}


ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K"); }

.mdl-checkbox__label {
  position: relative;
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
  margin: 0; }
  fieldset[disabled] .mdl-checkbox .mdl-checkbox__label,
  .mdl-checkbox.is-disabled .mdl-checkbox__label {
    color: rgba(0,0,0, 0.26);
    cursor: auto; }

.mdl-checkbox__ripple-container {
  position: absolute;
  z-index: 2;
  top: -6px;
  left: -10px;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(circle, white, black); }
  .mdl-checkbox__ripple-container .mdl-ripple {
    background: rgb(63,81,181); }
  fieldset[disabled] .mdl-checkbox .mdl-checkbox__ripple-container,
  .mdl-checkbox.is-disabled .mdl-checkbox__ripple-container {
    cursor: auto; }
  fieldset[disabled] .mdl-checkbox .mdl-checkbox__ripple-container .mdl-ripple,
  .mdl-checkbox.is-disabled .mdl-checkbox__ripple-container .mdl-ripple {
    background: transparent; }

/**
 * Copyright 2015 Google Inc. 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.
 */
/**
 * Copyright 2015 Google Inc. 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.
 */
/*------------------------------------*    $CONTENTS
\*------------------------------------*/
/**
 * STYLE GUIDE VARIABLES------------------Declarations of Sass variables
 * -----Typography
 * -----Colors
 * -----Textfield
 * -----Switch
 * -----Spinner
 * -----Radio
 * -----Menu
 * -----List
 * -----Layout
 * -----Icon toggles
 * -----Footer
 * -----Column
 * -----Checkbox
 * -----Card
 * -----Button
 * -----Animation
 * -----Progress
 * -----Badge
 * -----Shadows
 * -----Grid
 * -----Data table
 * -----Dialog
 * -----Snackbar
 * -----Tooltip
 * -----Chip
 *
 * Even though all variables have the `!default` directive, most of them
 * should not be changed as they are dependent one a


/www.zhangxinxu.com/wordpress/2010/01/%E5%9B%9E%E6%B5%81%E4%B8%8E%E9%87%8D%E7%BB%98%EF%BC%9Acss%E6%80%A7%E8%83%BD%E8%AE%A9javascript%E5%8F%98%E6%85%A2%EF%BC%9F/  "重绘,回流参考"
[src="" 问题]: http://js8.in/555.html "src="" 问题"
[a标签占位符问题]: http://www.v2ex.com/t/48511/ "a标签占位符问题"

[匈牙利命名法]: http://zh.wikipedia.org/wiki/%E5%8C%88%E7%89%99%E5%88%A9%E5%91%BD%E5%90%8D%E6%B3%95 "Wiki:匈牙利命名法"
[小駝峰式命名法]:http://zh.wikipedia.org/wiki/%E9%A7%9D%E5%B3%B0%E5%BC%8F%E5%A4%A7%E5%B0%8F%E5%AF%AB "小駝峰式命名法"
[CSS Compressor]: http://www.csscompressor.com/ "CSS 压缩"
[JS Compressor]: http://javascriptcompressor.com/ "JS 压缩和混淆"
[HTML 符号实体]: http://www.w3school.com.cn/html/html_entities.asp
[Google JSON Style Guide]:http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml
[JSON Style Guide翻译]:https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md
[meta viewport]: https://developer.mozilla.org/en-US/docs/Mobile/Viewport_meta_tag "<meta> ViewPort"
[CSS Media Queries]: http://css-tricks.com/css-media-queries/
[resize 事件]: http://api.jquery.com/resize/

[Lesselements]: http://lesselements.com/
[Bootstrap]: http://twitter.github.com/bootstrap/ "Bootstrap, from Twitter"
[reset.css]: https://github.com/hzlzh/cool-head/blob/master/Template/css/libs/reset.css "CSS reset 文件"
[reset.less]: https://github.com/hzlzh/cool-head/blob/master/Template/css/libs/reset.less "reset.less from HTML5 Boilerplate"
[elements.less]: https://github.com/hzlzh/cool-head/blob/master/Template/css/libs/elements.less "elements.less from lesselements"
[HTML5 验证]: http://html5.validator.nu/

[Modernizr]: http://modernizr.com/download/
[DD_belatedPNG]: http://www.dillerdesign.com/experiment/DD_belatedPNG/
[html5shiv]: https://github.com/aFarkas/html5shiv
[jquery-scroll]: https://github.com/thomd/jquery-scroll/
[Lionbars]: https://github.com/Charuru/lionbars
[bootstrap-tooltips]: http://twitter.github.com/bootstrap/javascript.html#tooltips
[bootstrap-scrollspy]: http://twitter.github.com/bootstrap/javascript.html#scrollspy
[grumble.js]: https://github.com/jamescryer/grumble


    let file_path_str = match cc_metadata.file_path() {
        None => "N/A",
        Some(ref fp) => *fp,
    };
    writeln!(out, "file path: {}", file_path_str);
    writeln!(out, "file offset: {}", cc_metadata.file_offset());
    writeln!(out, "num of values: {}", cc_metadata.num_values());
    writeln!(
        out,
        "total compressed size (in bytes): {}",
        cc_metadata.compressed_size()
    );
    writeln!(
        out,
        "total uncompressed size (in bytes): {}",
        cc_metadata.uncompressed_size()
    );
    writeln!(out, "data page offset: {}", cc_metadata.data_page_offset());
    let index_page_offset_str = match cc_metadata.index_page_offset() {
        None => "N/A".to_owned(),
        Some(ipo) => ipo.to_string(),
    };
    writeln!(out, "index page offset: {}", index_page_offset_str);
    let dict_page_offset_str = match cc_metadata.dictionary_page_offset() {
        None => "N/A".to_owned(),
        Some(dpo) => dpo.to_string(),
    };
    writeln!(out, "dictionary page offset: {}", dict_page_offset_str);
    let statistics_str = match cc_metadata.statistics() {
        None => "N/A".to_owned(),
        Some(stats) => stats.to_string(),
    };
    writeln!(out, "statistics: {}", statistics_str);
    writeln!(out);
}

#[allow(unused_must_use)]
fn print_dashes(out: &mut io::Write, num: i32) {
    for _ in 0..num {
        write!(out, "-");
    }
    writeln!(out);
}

const INDENT_WIDTH: i32 = 2;

/// Struct for printing Parquet message type.
struct Printer<'a> {
    output: &'a mut fmt::Write,
    indent: i32,
}

#[allow(unused_must_use)]
impl<'a> Printer<'a> {
    fn new(output: &'a mut fmt::Write) -> Self {
        Printer { output, indent: 0 }
    }

    fn print_indent(&mut self) {
        for _ in 0..self.indent {
            write!(self.output, " ");
        }
    }
}

#[allow(unused_must_use)]
impl<'a> Printer<'a> {
    pub fn print(&mut self, tp: &Type) {
        self.print_indent();
        match *tp {
            Type::PrimitiveType {
                ref basic_info,
                physical_type,
                type_length,
                scale,
                precision,
            } => {
                let phys_type_str = match physical_type {
                    PhysicalType::FIXED_LEN_BYTE_ARRAY => {
                        // We need to include length for fixed byte array
                        format!("{} ({})", physical_type, type_length)
                    }
                    _ => format!("{}", physical_type),
                };
                // Also print logical type if it is available
                let converted_type_str = match basic_info.converted_type() {
                    ConvertedType::NONE => format!(""),
                    decimal @ ConvertedType::DECIMAL => {
                        // For decimal type we should print precision and scale if they
                        // are > 0, e.g. DECIMAL(9, 2) -
                        // DECIMAL(9) - DECIMAL
                        let precision_scale = match (precision, scale) {
                            (p, s) if p > 0 && s > 0 => format!(" ({}, {})", p, s),
                            (p, 0) if p > 0 => format!(" ({})", p),
                            _ => format!(""),
                        };
                        format!(" ({}{})", decimal, precision_scale)
                    }
                    other_converted_type => format!(" ({})", other_converted_type),
                };
                write!(


    Helps to list all specified files in package including files in directories
    since `package_data` ignores directories.
    """
    if package_dir is None:
        package_dir = os.path.join(*package.split("."))
    all_files = []
    for f in data:
        path = os.path.join(package_dir, f)
        if os.path.isfile(path):
            all_files.append(f)
            continue
        for root, _dirs, files in os.walk(path, followlinks=True):
            root = os.path.relpath(root, package_dir)
            for file in files:
                file = os.path.join(root, file)
                if file not in all_files:
                    all_files.append(file)
    return all_files

if commit != "unknown":
    write_version_py(filename="paddlenlp/version/__init__.py")

try:
    setuptools.setup(
        name="paddlenlp",
        version=__version__,
        author="PaddleNLP Team",
        author_email="paddlenlp@baidu.com",
        description="Easy-to-use and powerful NLP library with Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including Neural Search, Question Answering, Information Extraction and Sentiment Analysis end-to-end system.",
        long_description=read("README_en.md"),
        long_description_content_type="text/markdown",
        url="https://github.com/PaddlePaddle/PaddleNLP",
        license_files=("LICENSE",),
        packages=setuptools.find_packages(
            where=".",
            exclude=("examples*", "tests*", "applications*", "fast_generation*", "model_zoo*"),
        ),
        package_data={
            "paddlenlp.ops": get_package_data_files(
                "paddlenlp.ops", ["CMakeLists.txt", "README.md", "cmake", "fast_transformer", "patches", "optimizer"]
            ),
            "paddlenlp.transformers.layoutxlm": get_package_data_files(
                "paddlenlp.transformers.layoutxlm", ["visual_backbone.yaml"]
            ),
            "paddlenlp.experimental": get_package_data_files("paddlenlp.experimental", ["transformers"]),
        },
        setup_requires=["cython", "numpy"],
        install_requires=REQUIRED_PACKAGES,
        entry_points={"console_scripts": ["paddlenlp = paddlenlp.cli:main"]},
        extras_require=extras,
        python_requires=">=3.8",
        classifiers=[
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.8",
            "Programming Language :: Python :: 3.9",
            "Programming Language :: Python :: 3.10",
            "License :: OSI Approved :: Apache Software License",
            "Operating System :: OS Independent",
        ],
        license="Apache 2.0",
    )
except Exception as e:
    git_checkout(paddlenlp_dir, "paddlenlp/version/__init__.py") if commit != "unknown" else None
    git_checkout(paddlenlp_dir, "paddlenlp/__init__.py") if commit != "unknown" else None
    raise e

git_checkout(paddlenlp_dir, "paddlenlp/version/__init__.py") if commit != "unknown" else None
git_checkout(paddlenlp_dir, "paddlenlp/__init__.py") if commit != "unknown" else None


40%">
//          40
//

//

//  ```

.example-rating-summary-3 {
    .lib-rating-summary(
        @_icon-color: #aff5e3,
        @_icon-color-active: #0a6767
    );
}

// # Rating summary icons symbol customization
//
//  To set up the icons symbol use variable:
//  ```css
//  @_icon-content: icon_code
//  ```
//
//  ``` html
//

//      Rating
//

//          40
//

//

//  ```

.example-rating-summary-4 {
    .lib-rating-summary(
        @_icon-content: @icon-wishlist-full
    );
}

//  # Rating summary hide label
//
//  To hide the rating summary label set:
//  ```css
//  @_label-hide: true
//  ```
//
//  ``` html
//

//      Rating
//

//          40
//

//

//  ```

.example-rating-summary-5 {
    .lib-rating-summary(
        @_label-hide: true
    );
}

//  # Rating summary multiple ratings
//
//  ``` html
//

//      Your Rating:
//

//          Value
//

//              100%
//

//

//

//          Quality
//

//              100%
//

//

//

//          rating +
//

//              20%
//

//

//

//          Price
//

//              40%
//

//

//

//  ```

.example-rating-summary-6 {
    .rating-summary {
        .lib-rating-summary();
    }
}

//  # Rating hide label mixin
//
//  The <code>.lib-rating-summary-label-hide()</code> mixin is used to hide rating label in summary rating.
//
//  ``` html
//

//      Rating
//

//          40
//

//

//  ```

.example-rating-summary-7 {
    .lib-rating-summary();
    .lib-rating-summary-label-hide();
}
// /**
//  * Copyright © Magento, Inc. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//


x2c>
  43aefc:	d503201f 	nop
  43af00:	aa1803e1 	mov	x1, x24
  43af04:	aa1303e2 	mov	x2, x19
  43af08:	97ff7436 	bl	417fe0 <__wmempcpy>
  43af0c:	f9001320 	str	x0, [x25, #32]
  43af10:	8b130b15 	add	x21, x24, x19, lsl #2
  43af14:	cb130294 	sub	x20, x20, x19
  43af18:	b5fffe34 	cbnz	x20, 43aedc <_IO_wdefault_xsputn+0x8c>
  43af1c:	aa1703e0 	mov	x0, x23
  43af20:	f94023f9 	ldr	x25, [sp, #64]
  43af24:	a94153f3 	ldp	x19, x20, [sp, #16]
  43af28:	a9425bf5 	ldp	x21, x22, [sp, #32]
  43af2c:	a94363f7 	ldp	x23, x24, [sp, #48]
  43af30:	a8c57bfd 	ldp	x29, x30, [sp], #80
  43af34:	d65f03c0 	ret
  43af38:	d2800000 	mov	x0, #0x0                   	// #0
  43af3c:	d65f03c0 	ret
  43af40:	cb1402f7 	sub	x23, x23, x20
  43af44:	f94023f9 	ldr	x25, [sp, #64]
  43af48:	aa1703e0 	mov	x0, x23
  43af4c:	a94153f3 	ldp	x19, x20, [sp, #16]
  43af50:	a9425bf5 	ldp	x21, x22, [sp, #32]
  43af54:	a94363f7 	ldp	x23, x24, [sp, #48]
  43af58:	a8c57bfd 	ldp	x29, x30, [sp], #80
  43af5c:	d65f03c0 	ret

000000000043af60 <_IO_wdoallocbuf>:
  43af60:	f9405001 	ldr	x1, [x0, #160]
  43af64:	f9401823 	ldr	x3, [x1, #48]
  43af68:	b4000043 	cbz	x3, 43af70 <_IO_wdoallocbuf+0x10>
  43af6c:	d65f03c0 	ret
  43af70:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  43af74:	910003fd 	mov	x29, sp
  43af78:	b9400002 	ldr	w2, [x0]
  43af7c:	f9000bf3 	str	x19, [sp, #16]
  43af80:	aa0003f3 	mov	x19, x0
  43af84:	37080142 	tbnz	w2, #1, 43afac <_IO_wdoallocbuf+0x4c>
  43af88:	f9409821 	ldr	x1, [x1, #304]
  43af8c:	f9403421 	ldr	x1, [x1, #104]
  43af90:	d63f0020 	blr	x1
  43af94:	3100041f 	cmn	w0, #0x1
  43af98:	54000080 	b.eq	43afa8 <_IO_wdoalloc


架，1--下架（仓库中），2--已售完)")
    private Integer goodsStatus;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 小程序模块id
     */
    @Column(name = "appmodel_id")
    @ApiModelProperty(value = "小程序模板id")
    private String appmodelId;

    /**
     * 商品图片
     */
    @Column(name = "goods_img")
    @ApiModelProperty(value = "商品图片地址，多个地址用逗号分隔")
    private String goodsImg;

    /**
     * 商品主图视频url
     */
    @Column(name = "goods_video_url")
    @ApiModelProperty(value = "商品主图视频url")
    private String goodsVideoUrl;

}/*
 * Copyright Ningbo Qishan Technology Co., Ltd
 *
 * 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 com.mds.group.purchase.goods.vo;

import com.mds.group.purchase.goods.model.Goods;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * The type Update goods v 12 vo.
 *
 * @author shuke
 * @since v1.2
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class UpdateGoodsV12Vo extends UpdateGoodsV119Vo {

    @ApiModelProperty(value = "商品主图视频链接")
    private String goodsVideoUrl;

    @Override
    public Goods resolveGoodsFromVo() {
        Goods goods = super.resolveGoodsFromVo();
        goods.setGoodsVideoUrl(goodsVideoUrl);
        return goods;
    }
}
/*
 * Copyright Ningbo Qishan Technology Co., Ltd
 *
 * 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 com.mds.group.purchase.goods.vo;

import com.mds.group.purchase.goods.model.Goods;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 新增商品的参数类
 * 增加新字段  商品主图视频链接
 *
 * @author shuke
 * @since v1.2
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SaveGoodsV12Vo extends SaveGoodsV119Vo {

    @ApiModelProperty(value = "商品主图视频链接")
    private String goodsVideoUrl;

    @Override
    public Goods resolveGoodsFromVo() {
        Goods goods = super.resolveGoodsFromVo


/*
 * Notified.h
 *
 * This source file is part of the FoundationDB open source project
 *
 * Copyright 2013-2024 Apple Inc. and the FoundationDB project authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FDBCLIENT_NOTIFIED_H
#define FDBCLIENT_NOTIFIED_H
#pragma once

#include "fdbclient/FDBTypes.h"
#include "flow/TDMetric.actor.h"
#include "flow/swift_support.h"
#include <queue>

template <class T>
struct IsMetricHandle : std::false_type {};
template <class T>
struct IsMetricHandle<MetricHandle<T>> : std::true_type {};

template <class T, class ValueType = T>
struct Notified {
	explicit Notified(ValueType v = 0) { val = v; }

	[[nodiscard]] Future<Void> whenAtLeast(const ValueType& limit) {
		if (val >= limit)
			return Void();
		Promise<Void> p;
		waiting.emplace(limit, p);
		return p.getFuture();
	}

	[[nodiscard]] ValueType get() const { return val; }

	void initMetric(const StringRef& name, const StringRef& id) {
		if constexpr (IsMetricHandle<T>::value) {
			ValueType v = val;
			val.init(name, id);
			val = v;
		} else {
			TraceEvent(SevError, "InvalidNotifiedOperation")
			    .detail("Reason", "Notified<T> where T is not a metric: Can't use initMetric");
		}
	}

	void set(const ValueType& v) {
		ASSERT(v >= val);
		if (v != val) {
			val = v;

			std::vector<Promise<Void>> toSend;
			while (waiting.size() && v >= waiting.top().first) {
				Promise<Void> p = std::move(waiting.top().second);
				waiting.pop();
				toSend.push_back(p);
			}
			for (auto& p : toSend) {
				p.send(Void());
			}
		}
	}

	void operator=(const ValueType& v) { set(v); }

	Notified(Notified&& r) noexcept : waiting(std::move(r.waiting)), val(std::move(r.val)) {}
	void operator=(Notified&& r) noexcept {
		waiting = std::move(r.waiting);
		val = std::move(r.val);
	}

	int numWaiting() { return waiting.size(); }

private:
	using Item = std::pair<ValueType, Promise<Void>>;
	struct ItemCompare {
		bool operator()(const Item& a, const Item& b) { return a.first > b.first; }
	};
	std::priority_queue<Item, std::vector<Item>, ItemCompare> waiting;
	T val;
};

using NotifiedVersion = Notified<VersionMetricHandle, VersionMetricHandle::ValueType>;
using NotifiedDouble = Notified<double>;

#endif


 of the block without finding any branch or jump instruction?");
        let opcode = cur.func.dfg[inst].opcode();
        if opcode.can_load() || opcode.can_store() {
            break;
        }
        if opcode.is_branch() || opcode.is_indirect_branch() || opcode.is_call() {
            break;
        }
        if opcode.writes_cpu_flags() {
            break;
        }
        if opcode == Opcode::SetCfiLabel || opcode == Opcode::JumpTableEntryCfi {
            break;
        }
        if needs_cfi_inst_check(cur, inst) {
            break;
        }

        // Additionally, if it's an unconditional trap, we do the CFI check before the trap
        if opcode == Opcode::Trap {
            break;
        }

        // safe to delay the CFI check past this instruction
        cur.next_inst();
    }

    let label = cur.ins().iconst(types::I64, label as i64);
    cur.ins().cfi_check_that_label_is_equal_to(label);
}

/// Does the current instruction need a CFI "top-of-block" check instruction despite
/// being in the middle of the block?
///
/// This is true for call instructions and some conditional branch instructions;
/// it's obviously not true for any terminators.
///
/// This function preserves the cursor position.
fn needs_cfi_inst_check(cur: &mut EncCursor, inst: Inst) -> bool {
    let opcode = cur.func.dfg[inst].opcode();
    if opcode.is_terminator() {
        false
    } else if opcode.is_call() {
        true
    } else if opcode.is_branch() || opcode.is_indirect_branch() {
        is_followed_by_non_jump_or_fallthrough(cur)
    } else {
        false
    }
}

/// Add CFI "top-of-block" check instruction for "blocks" which are only parts of
/// Cranelift blocks.
///
/// This function should only be called on an instruction which needs it,
/// according to `needs_cfi_inst_check()`.
///
/// This function preserves the cursor position.
fn add_cfi_inst_check(cur: &mut EncCursor, inst: Inst) {
    let saved_position = cur.position();
    debug_assert!(needs_cfi_inst_check(cur, inst));
    let label = cur.func.cfi_inst_nums[inst].unwrap();
    cur.next_inst(); // we want to insert _after_ the call or condbr
    let label = cur.ins().iconst(types::I64, label as i64);
    cur.ins().cfi_check_that_label_is_equal_to(label);
    cur.set_position(saved_position);
}

/*
/// Put in the correct real CFI numbers prior to conditional branch, replacing
/// the placeholder numbers added in a previous pass.
///
/// `inst` should be a conditional branch instruction.
///
/// This function preserves the cursor position.
fn set_labels_for_condbranch(cur: &mut EncCursor, inst: Inst) {
    let cfi_label_inst = get_previous_cfi_label_inst(cur).unwrap();
    let br_block = match cur.func.dfg.analyze_branch(inst) {
        BranchInfo::SingleDest(dest, _) => dest,
        _ => {
            panic!("set_labels_for_branch: expected inst to be a SingleDest branch but it wasn't: {:?}", cur.func.dfg[inst].opcode());
        }
    };
    let br_block_label = cur.func.cfi_block_nums[br_block].unwrap();
    let fallthrough_block_label = {
        let next_inst = get_next_inst(cur);
        match next_inst.map(|next_inst| cur.func.dfg[next_inst].opcode()) {
            Some(Opcode::Jump) | Some(O


const n in t){const r=o(t[n]);e[n]=r}return e}(s))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:Object(r.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp("\\b".concat(t.old,"\\("));break;default:t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))}}),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},n=this.uniforms;for(const i in n){const o=n[i];i in t&&!o.private?(o.validate&&Object(r.a)(o.validate(t[i],o),"".concat(this.name,": invalid ").concat(i)),e[i]=t[i]):e[i]=o.value}return e}}function u(t){if(!t.normalized&&(t.normalized=!0,t.uniforms&&!t.getUniforms)){const e=new s(t);t.getUniforms=e.getUniforms.bind(e)}return t}},function(t,e,n){"use strict";var r=n(33),i=n(74),o=n(54),a=n(7),s=n(53),u=n(10);function c(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(u.a)(!1),0}}var l=n(236);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:n=0,sourceY:r=0,sourceFormat:i=6408}=e;let{sourceAttachment:o=36064,target:a=null,sourceWidth:c,sourceHeight:l,sourceType:h}=e;const{framebuffer:f,deleteFramebuffer:p}=A(t);Object(u.a)(f);const{gl:d,handle:m,attachments:y}=f;c=c||f.width,l=l||f.height,36064===o&&null===m&&(o=1028),Object(u.a)(y[o]),h=h||y[o].type,a=g(a,h,i,c,l),h=h||Object(s.b)(a);const v=d.bindFramebuffer(36160,m);return d.readPixels(n,r,c,l,i,h,a),d.bindFramebuffer(36160,v||null),p&&f.delete(),a}function f(t,e){let{sourceX:n=0,sourceY:i=0,sourceFormat:o=6408,target:s=null,targetByteOffset:l=0,sourceWidth:h,sourceHeight:f,sourceType:p}=e;const


%arg lá %card",
  ["$MoveCards"] = "%to đã nhận được %arg lá %card từ %from",
  ["$PreyCardsFromPile"] = "%from đã thu lấy %arg lá %card",
  ["$GotCardBack"] = "%from đã lấy lại %arg lá %card",
  ["$RecycleCard"] = "%from đã lấy lại %arg lá %card từ chồng bỏ",

  ["$InstallEquip"] = "%from đã trang bị %card",
  ["$UninstallEquip"] = "%from đã tháo %card",

  ["$LightningMove"] = "%card đã chuyển từ %from sang %to",
  ["$PasteCard"] = "%from đã sử dụng %card với %to",

  ["$AddToPile"] = "%arg2 lá %card đã bị loại khỏi trò chơi, trở thành %arg của %from",

  ["$PutCard"] = "%arg lá của %from được đặt vào chồng bài",
  ["$PutKnownCard"] = "%card của %from được đặt vào chồng bài",
  ["$DiscardCards"] = "%from đã bỏ %arg lá %card",
  ["$DiscardOther"] = "%to đã bỏ %arg lá %card từ %from",
  ["$PutToDiscard"] = "%arg lá %card đã được đặt vào chồng bài bỏ",
  ["$ViewCardFromDrawPile"] = "%from đã xem %arg lá",
  ["$TurnOverCardFromDrawPile"] = "%from đã lật %arg lá %card",

  ["#AbortArea"] = "%arg của %from đã bị vô hiệu hóa",
  ["#ResumeArea"] = "%arg của %from đã được khôi phục",

  ["#ShowCard"] = "%from đã công khai thẻ %card",
  ["#Recast"] = "%from đã tái chế %card",
  ["#RecastBySkill"] = "%from đã tái chế %card bằng %arg",

  -- phase
  ["#PhaseSkipped"] = "%from đã bỏ qua %arg",
  ["#GainAnExtraTurn"] = "%from bắt đầu lượt thêm",
  ["#GainAnExtraPhase"] = "%from bắt đầu giai đoạn thêm (%arg)",

  -- useCard
  ["#UseCard"] = "%from đã sử dụng %card",
  ["#UseCardToTargets"] = "%from đã sử dụng %card nhắm vào %to",
  ["#CardUseCollaborator"] = "%from đã chọn %to làm mục tiêu phụ của %arg",
  ["#UseCardToCard"] = "%from đã sử dụng %card, và mục tiêu là %arg",
  ["#ResponsePlayCard"] = "%from đã đánh ra %card",

  ["#UseVCard"] = "%from đã sử dụng %card như %arg",
  ["#UseVCardToTargets"] = "%from đã sử dụng %card như %arg, và mục tiêu là %to",
  ["#UseVCardToCard"] = "%from đã sử dụng %card như %arg2, và mục tiêu là %arg",
  ["#ResponsePlayVCa


/*
;  lzma_d.S --
;
;  This file is part of the UPX executable compressor.
;
;  Copyright (C) 2006-2023 Markus Franz Xaver Johannes Oberhumer
;  All Rights Reserved.
;
;  UPX and the UCL library are free software; you can redistribute them
;  and/or modify them under the terms of the GNU General Public License as
;  published by the Free Software Foundation; either version 2 of
;  the License, or (at your option) any later version.
;
;  This program is distributed in the hope that it will be useful,
;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;  GNU General Public License for more details.
;
;  You should have received a copy of the GNU General Public License
;  along with this program; see the file COPYING.
;  If not, write to the Free Software Foundation, Inc.,
;  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;
;  Markus F.X.J. Oberhumer
;  <markus@oberhumer.com>
;  http://www.oberhumer.com/opensource/upx/
;

; ------------- DECOMPRESSION -------------

; decompress from a3 to d4
;   note: must preserve d4 and a5-a7
;
; On entry:
;   a3  src pointer
;   d4  dest pointer
;
; On exit:
;   d3.l = 0
*/

section lzma.init
        move.l  sp,d7                   // save stack
        lea     lzma_stack_adjust:w(sp),sp

        addq.l  #2,a3                   // skip 2 bytes for properties

        move.l  sp,a2


con_group.draw(screen)
        self.intro_text.draw()
        pygame.display.flip()

    def check_events(self):
        global game_state
        for event in pygame.event.get(): # pygame.event.get() vrati seznam eventu
                if event.type == pygame.QUIT:
                    pygame.quit()
                    exit()
                if event.type == pygame.MOUSEBUTTONDOWN:
                    if self.start_game_button.mouse_over():
                        game_state = StateRunning()
                        game_state.reset()
                    if StateMenu.quit_game_button.mouse_over():
                        pygame.quit()
                        exit()

class EventEnemySpawner:

    cactus_image = pygame.image.load("Tabor_Code/W2D1/trexgraphics/cactus1.png")
    flying_image = pygame.image.load("Tabor_Code/W2D1/trexgraphics/flying2.png")

    spawn_event = pygame.event.custom_type()

    level_base_speed = [9,10,12,14,18]
    level_spawn_delay = [1500,1400,1300,1200,1200]
    spawn_diff_ratio = 1/3

    def __init__(self):
        global level
        self.last_level = level
        pygame.time.set_timer(EventEnemySpawner.spawn_event,EventEnemySpawner.level_spawn_delay[level-1])

    def update(self):
        global level
        if level > self.last_level:
            self.last_level = level
            pygame.time.set_timer(EventEnemySpawner.spawn_event,EventEnemySpawner.level_spawn_delay[level-1])

    def create_cactus(self):
        global level
        cactus = Enemy(EventEnemySpawner.cactus_image,(-EventEnemySpawner.level_base_speed[level-1],0))
        cactus.rect.bottomleft = (WIDTH, GROUND_HEIGHT+10)
        return cactus

    def create_flying(self,speed_offset):
        global level
        flying = FlyingEnemy(EventEnemySpawner.flying_image,(-EventEnemySpawner.level_base_speed[level-1]+speed_offset,0))
        flying.rect.bottomleft = (WIDTH, GROUND_HEIGHT-Player.player_standing_height+10)
        return flying

    def spawn_enemy(self):
        percentage = random.randint(0,100)

        if percentage < 30:
            speed_offset = random.randint(-2,0)
            enemy = self.create_flying(speed_offset)
            flying_group.add(enemy)
        else:
            enemy = self.create_cactus()
            cactus_group.add(enemy)

player_group = pygame.sprite.GroupSingle(Player(dino_image,(0,0)))
cactus_group = pygame.sprite.Group()
flying_group = pygame.sprite.Group()

spawner = EventEnemySpawner()

game_state = StateMenu("Start Game","Retro-Rex")

def get_level():
    i = 0
    while i < len(LEVEL_SCORES) and LEVEL_SCORES[i] <= score:
        i += 1
    return i

while True:

    game_state.check_events()
    game_state.update()
    game_state.draw()

    clock.tick(60)


isten("tcp", ":4444")
				if err != nil {
					return err
				}
				closers = append([]io.Closer{cpListener}, closers...)

				// hlog("File transfer server " + pretty.Sprint(cliui.DefaultStyles.Enabled, "enabled"))
				go func() {
					err := http.Serve(cpListener, http.HandlerFunc(cpHandler))
					if err != nil {
						hlog("File transfer server exited: " + err.Error())
					}
				}()
			} else {
				hlog("File transfer server " + pretty.Sprint(cliui.DefaultStyles.Disabled, "disabled"))
			}

			if xslices.Contains(enabled, "port-forward") && !xslices.Contains(disabled, "port-forward") {
				ts.RegisterFallbackTCPHandler(func(src, dst netip.AddrPort) (handler func(net.Conn), intercept bool) {
					return func(src net.Conn) {
						dst, err := net.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", dst.Port()))
						if err != nil {
							hlog(pretty.Sprint(cliui.DefaultStyles.Warn, "Failed to dial forwarded connection:", err.Error()))
							src.Close()
							return
						}

						bicopy(ctx, src, dst)
					}, true
				})
				// hlog("Port-forward server " + pretty.Sprint(cliui.DefaultStyles.Enabled, "enabled"))
			} else {
				hlog("Port-forward server " + pretty.Sprint(cliui.DefaultStyles.Disabled, "disabled"))
			}

			ctx, ctxCancel := inv.SignalNotifyContext(ctx, os.Interrupt)
			defer ctxCancel()

			closers = append(closers, ts)
			<-ctx.Done()
			for _, closer := range closers {
				closer.Close()
			}
			return nil
		},
		Options: []serpent.Option{
			{
				Flag:    "overlay-type",
				Default: "derp",
				Value:   serpent.EnumOf(&overlayType, "derp", "stun"),
			},
			{
				Flag:          "verbose",
				FlagShorthand: "v",
				Description:   "Enable verbose logging.",
				Default:       "false",
				Value:         serpent.BoolOf(&verbose),
			},
			{
				Flag:        "enable",
				Description: "Server options to enable.",
				Default:     "ssh,cp,port-forward",
				Value:       serpent.EnumArrayOf(&enabled, "ssh", "cp", "port-forward"),
			},
			{
				Flag:        "disable",
				Description: "Server options to disable.",
				Default:     "",
				Value:       serpent.EnumArrayOf(&disabled, "ssh", "cp", "port-forward"),
			},
			{
				Flag:        "derp-config-file",
				Description: "File which specifies the DERP config to use. In the structure of https://pkg.go.dev/tailscale.com@v1.74.1/tailcfg#DERPMap.",
				Default:     "",
				Value:       serpent.StringOf(&derpmapFi),
			},
		},
	}
}

func newTSNet(direction string, verbose bool) (*tsnet.Server, error) {
	var err error
	tmp := os.TempDir()
	srv := new(tsnet.Server)
	srv.Dir = tmp
	srv.Hostname = "wush-" + direction
	srv.Ephemeral = true
	srv.AuthKey = direction
	srv.ControlURL = "http://127.0.0.1:8080"
	srv.Logf = func(format string, args ...any) {}
	srv.UserLogf = func(format string, args ...any) {}
	if verbose {
		logf := func(format string, args ...any) {
			fmt.Fprintf(os.Stderr, format


').click();
    await page.keyboard.type(user.password, {
      delay: 50,
    });
    await expect(page.locator('auth-sign-up-form').locator('[placeholder=password]')).toHaveValue(user.password);

    await page.locator('auth-sign-up-form').locator('[placeholder=confirm_password]').click();
    await page.keyboard.type(user.password, {
      delay: 50,
    });
    await expect(page.locator('auth-sign-up-form').locator('[placeholder=confirm_password]')).toHaveValue(user.password);

    await expect(page.locator('auth-sign-up-form').locator('button[type=submit]')).toHaveText('Sign-up');

    await page.locator('auth-sign-up-form').locator('button[type=submit]').click();

    await setTimeout(5000);

    await expect(page.locator('nz-header').locator('[nz-submenu]').first()).toContainText(`You are logged in as ${user.email.toLowerCase()}`);
  });

  test('should change language to RU', async () => {
    await expect(page.locator('nz-header').locator('[nz-submenu]').last()).toContainText(`EN`);
    await page.locator('nz-header').locator('[nz-submenu]').last().click();

    await expect(page.locator('[nz-submenu-none-inline-child]').locator('[nz-menu-item]').last()).toContainText(`Russian`);

    await page.locator('[nz-submenu-none-inline-child]').locator('[nz-menu-item]').last().click();

    await setTimeout(4000);
    //

    await expect(page.locator('nz-header').locator('[nz-submenu]').last()).toContainText(`RU`);
  });

  test('change lang to en in localStorage', async () => {
    await page.evaluate(() => localStorage.setItem('activeLang', 'en'));

    const activeLang = await page.evaluate(() => localStorage.getItem('activeLang'));

    expect(activeLang).toEqual('en');
  });

  test('should catch error on create new webhook', async () => {
    await page.locator('webhook-grid').locator('button').first().click();

    await setTimeout(7000);

    await page.locator('[nz-modal-footer]').locator('button').last().click();

    await setTimeout(4000);

    await expect(page.locator('webhook-form').locator('formly-validation-message').first()).toContainText('поле "адрес" не может быть пустым');
    await expect(page.locator('webhook-form').locator('formly-validation-message').last()).toContainText('поле "событие" не может быть пустым');
  });
});
```

### 10. Run all "E2E" level tests for both server and client

Let's run all `E2E` level tests for both server and client to make sure all functionality works correctly and without errors.

_Commands_

```bash
npm run pm2-full:dev:test:e2e
```

### Conclusion

Despite the apparent simplicity of the task, its solution required a significant amount of time and writing a considerable amount of code.

However, even for such minimal changes it is extremely important to ensure `E2E` test coverage, which was demonstrated in this post.

### Plans

In the previous article, I implemented the function of automatic conversion of output data containing fields of type `Date` or strings in `ISOString` format. However, I have not yet implemented automatic conversion of input data. In the next post, I will deal with this issue.

### Links

- https://nestjs.com - the official website of the framework
- https://nestjs-mod.com - the official website of additional utilities
- https://fullstack.nestjs-mod


eyword.BALANCE.toVar()
    val creationCount = TACKeyword.CONTRACT_COUNT.toVar()
    val origin = TACKeyword.ORIGIN.toVar()
    val gasLimit = TACKeyword.GASLIMIT.toVar()
    val chainId = TACKeyword.CHAINID.toVar()
    val basefee = TACKeyword.BASEFEE.toVar()
    val blobHashes = TACKeyword.BLOBHASHES.toVar()
    val blobbasefee = TACKeyword.BLOBBASEFEE.toVar()
    val difficulty = TACKeyword.DIFFICULTY.toVar()
    val extcodehash = TACKeyword.EXTCODEHASH.toVar()
    val number = TACKeyword.NUMBER.toVar()
    val timestamp = TACKeyword.TIMESTAMP.toVar()
    val coinbase = TACKeyword.COINBASE.toVar()
    val blockhash = TACKeyword.BLOCKHASH.toVar()
    val extcodesize = TACKeyword.EXTCODESIZE.toVar()

    val gasprice = TACKeyword.GASPRICE.toVar()
    val codesize = TACKeyword.CODESIZE.toVar()
    val calldatasize = TACKeyword.CALLDATASIZE.toVar()
    val calldata = TACKeyword.CALLDATA.toVar()
    val callvalue = TACKeyword.CALLVALUE.toVar()
    val caller = TACKeyword.CALLER.toVar()
    val returnsize = TACKeyword.RETURN_SIZE.toVar()
    val returndata = TACKeyword.RETURNDATA.toVar()
    val rc = TACKeyword.RETURNCODE.toVar()

    val nonce = TACKeyword.NONCE.toVar()

    @Suppress("unused")
    val counts = TACKeyword.CONTRACT_COUNT.toVar()

    fun getRC() =
        CommandWithRequiredDecls<TACCmd.Simple>(TACCmd.Simple.AssigningCmd.AssignHavocCmd(rc), rc)

    fun simplifyIsZero(c: TACCmd.EVM.AssignIszeroCmd): CommandWithRequiredDecls<TACCmd.Simple> =
        CommandWithRequiredDecls(
            TACCmd.Simple.AssigningCmd.AssignExpCmd(
                c.lhs,
                TACExpr.BinRel.Eq(
                    c.op1.asSym(),
                    TACSymbol.Const(BigInteger.ZERO).asSym()
                )
            )
        )

    fun simplifyAddress(c: TACCmd.EVM.AssignAddressCmd) =
        CommandWithRequiredDecls(
            listOf(TACCmd.Simple.AssigningCmd.AssignExpCmd(c.lhs, address, c.meta)),
            setOf(address)
        )

    fun simplifyBalance(c: TACCmd.EVM.AssignBalanceCmd) =
        CommandWithRequiredDecls(
            listOf(TACCmd.Simple.AssigningCmd.WordLoad(c.lhs, c.op1, balance, c.meta)),
            setOf(balance)
        )

    fun simplifyOrigin(c: TACCmd.EVM.AssignOriginCmd) =
        CommandWithRequiredDecls(
            listOf(TACCmd.Simple.AssigningCmd.AssignExpCmd(c.lhs, origin, c.meta)),
            setOf(origin)
        )

    fun simplifyGaslimit(c: TACCmd.EVM.AssignGaslimitCmd) =
        CommandWithRequiredDecls(

            listOf(TACCmd.Simple.AssigningCmd.AssignExpCmd(c.lhs, gasLimit, c.meta)),
            setOf(gasLimit)
        )

    fun simplifyChainid(c: TACCmd.EVM.AssignChainidCmd) =
        CommandWithRequiredDecls(

            listOf(TACCmd.Simple.AssigningCmd.AssignExpCmd(c.lhs, chainId, c.meta)),
            setOf(chainId)
        )

    fun simplifySelfBalance(c: TACCmd.EVM.AssignSelfBalanceCmd) =
        simplifyBalance(TACCmd.EVM.AssignBalanceCmd(c.lhs, address, c


import Sentry from 'src/lib/sentry'

const SentryLayout = ({ children }) => {
  const { currentUser } = useAuth()

  useEffect(() => Sentry.setUser(currentUser), [currentUser])

  return <>{children}</>
}

export default SentryLayout

```

</TabItem>
<TabItem value="ts" label="TypeScript">

```tsx title="web/src/layouts/SentryLayout/SentryLayout.tsx"
import React, { useEffect } from 'react'

import { useAuth } from 'src/lib/auth'
import Sentry from 'src/lib/sentry'

interface Props {
  children: React.ReactNode
}

const SentryLayout = ({ children }: Props) => {
  const { currentUser } = useAuth()

  useEffect(() => Sentry.setUser(currentUser), [currentUser])

  return <>{children}</>
}

export default SentryLayout
```

</TabItem>
</Tabs>

## Capturing exceptions

You can make use of Sentry to capture exceptions which occur while executing API [Functions](#generate-function).

```ts title="api/src/functions/foo.{js,ts}"
import Sentry from 'src/lib/sentry'

export const handler = async (event, context) => {
  try {
    ...
  } catch (err) {
    Sentry.captureException(err)
  }
}
```
# A Second Page and a Link

Let's create an "About" page for our blog so everyone knows about the geniuses behind this achievement. We'll create another page using `redwood`:

```bash
yarn redwood generate page about
```

Notice that we didn't specify a route path this time. If you leave it off the `redwood generate page` command, Redwood will create a `Route` and give it a path that is the same as the page name you specified, prepended with a slash. In this case it will be `/about`.

:::info Code-splitting each page

As you add more pages to your app, you may start to worry that more and more code has to be downloaded by the client on any initial page load. Fear not! Redwood will automatically code-split on each Page, which means that initial page loads can be blazingly fast, and you can create as many Pages as you want without having to worry about impacting overall bundle size. If, however, you do want specific Pages to be included in the main bundle, you can [override the default behavior](../../router.md#not-code-splitting).

:::

[http://localhost:8910/about](http://localhost:8910/about) should show our new page:

![About page](https://user-images.githubusercontent.com/300/145647906-56b02a6c-b92c-40c6-9d37-860584ffaa6b.png)

But no one's going to find it by manually changing the URL so let's add a link from our homepage to the About page and vice versa. We'll start by creating a simple header and nav bar at the same time on the HomePage:

<Tabs groupId="js-ts">
<TabItem value="js" label="JavaScript">

```jsx title="web/src/pages/HomePage/HomePage.jsx"
import { Link, routes } from '@cedarjs/router'
import { Metadata } from '@cedarjs/web'

const HomePage = () => {
  return (
    <>
      <Metadata title="Home" description="Home page" />

      // highlight-start

Redwood Blog

              <Link to={routes.about()}>About</Link>

      Home
      // highlight-end
    </>
  )
}

export default HomePage
```

</TabItem>
<TabItem value="ts" label="TypeScript">

```jsx title="web/src/pages/HomePage/HomePage.tsx"
import


 --s) {
			let n = n_stack[s]
			if (d_stack[s] <= 0) {
				n.setLeftId(n_stack[s + 1] ? n_stack[s + 1].id : undefined)
				n.setCount(n.count + 1)
			} else {
				n.setRightId(n_stack[s + 1] ? n_stack[s + 1].id : undefined)
				n.setCount(n.count + 1)
			}
		}

		// 8 types of rotations.
		// Rebalance tree using rotations
		// console.log("start insert", key, d_stack)
		for (let s = n_stack.length - 1; s > 1; --s) {
			let p = n_stack[s - 1]
			let n = n_stack[s]
			if (p.color === BLACK || n.color === BLACK) {
				break
			}

			let pp = n_stack[s - 2]
			if (pp.leftId === p.id) {
				if (p.leftId === n.id) {
					let y = await pp.getRight()
					if (y && y.color === RED) {
						//
						//      (pp)
						//      /  \
						//    (p)  (y)
						//    /
						//  (n)
						//
						// console.log("LLr")
						p.setColor(BLACK)
						const yy = transaction.clone(y)
						yy.setColor(BLACK)
						pp.setRightId(yy.id)
						pp.setColor(RED)
						s -= 1
					} else {
						// console.log("LLb")
						pp.setColor(RED)
						pp.setLeftId(p.rightId)
						p.setColor(BLACK)
						p.setRightId(pp.id)
						n_stack[s - 2] = p
						n_stack[s - 1] = n
						await recount(pp)
						await recount(p)
						if (s >= 3) {
							let ppp = n_stack[s - 3]
							if (ppp.leftId === pp.id) {
								ppp.setLeftId(p.id)
							} else {
								ppp.setRightId(p.id)
							}
						}
						break
					}
				} else {
					let y = await pp.getRight()
					if (y && y.color === RED) {
						// console.log("LRr")
						p.setColor(BLACK)
						const yy = transaction.clone(y)
						yy.setColor(BLACK)
						pp.setRightId(yy.id)
						pp.setColor(RED)
						s -= 1
					} else {
						// console.log("LRb")
						p.setRightId(n.leftId)
						pp.setColor(RED)
						pp.setLeftId(n.rightId)
						n.setColor(BLACK)
						n.setLeftId(p.id)
						n.setRightId(pp.id)
						n_stack[s - 2] = n
						n_stack[s - 1] = p
						await recount(pp)
						await recount(p)
						await recount(n)
						if (s >= 3) {
							let ppp = n_stack[s - 3]
							if (ppp.leftId === pp.id) {
								ppp.setLeftId(n.id)
							} else {
								ppp.setRightId(n.id)
							}
						}
						break
					}
				}
			} else {
				if (p.rightId === n.id) {
					let y = await pp.getLeft()
					if (y && y.color === RED) {
						// console.log("RRr", y.key)
						p.setColor(BLACK)
						const yy = transaction.clone(y)
						yy.setColor(BLACK)
						pp.setLeftId(yy.id)
						pp.setColor(RED)
						s -= 1
					} else {
						// consol


ram T2 An std vector with inner integral type.
 * @param f function to test
 * @param x argument to test
 * @param y argument to test
 */
template <typename F, typename T1, typename T2, require_eigen_t<T1>* = nullptr,
          require_std_vector_vt<std::is_integral, T2>* = nullptr>
inline void expect_ad_vectorized_matvar(const ad_tolerances& tols, const F& f,
                                        const T1& x, const T2& y) {
  auto g = [&f](const auto& x, const auto& y) { return f(y, x); };
  expect_ad_vectorized_matvar(tols, g, y, x);
}

/**
 * Overload with default tolerances
 *
 * @tparam F Type of function to test
 * @tparam EigVec Test input type
 * @param tols Test tolerances
 * @param f Function to test
 * @param x Test input
 */
template <typename F, typename T1, typename T2>
inline void expect_ad_vectorized_matvar(const F& f, const T1& x, const T2& y) {
  ad_tolerances tols;
  expect_ad_vectorized_matvar(tols, f, x, y);
}
///@}

}  // namespace test
}  // namespace stan
#endif
#ifdef STAN_OPENCL
#include <stan/math/prim.hpp>
#include <stan/math/opencl/prim.hpp>
#include <test/unit/util.hpp>
#include <gtest/gtest.h>
#include <algorithm>
#include <vector>

TEST(MathMatrixOpenCL, cholesky_decompose_cpu_vs_cl_small) {
  stan::math::matrix_d m0(3, 3);
  m0 << 25, 15, -5, 15, 18, 0, -5, 0, 11;

  stan::math::matrix_d m1(4, 4);
  m1 << 18, 22, 54, 42, 22, 70, 86, 62, 54, 86, 174, 134, 42, 62, 134, 106;

  stan::math::matrix_cl<double> m0_cl(m0);
  stan::math::matrix_cl<double> m1_cl(m1);

  stan::math::matrix_d m0_res = stan::math::cholesky_decompose(m0);
  stan::math::matrix_d m1_res = stan::math::cholesky_decompose(m1);

  stan::math::opencl::cholesky_decompose(m0_cl);
  stan::math::opencl::cholesky_decompose(m1_cl);

  m0 = stan::math::from_matrix_cl(m0_cl);
  m1 = stan::math::from_matrix_cl(m1_cl);

  EXPECT_MATRIX_NEAR(m0, m0_res, 1e-8);
  EXPECT_MATRIX_NEAR(m1, m1_res, 1e-8);
}

namespace {
inline void cholesky_decompose_test(int size) {
  stan::math::matrix_d m1 = stan::math::matrix_d::Random(size, size);
  stan::math::matrix_d m1_pos_def
      = m1 * m1.transpose() + size * Eigen::MatrixXd::Identity(size, size);

  stan::math::matrix_d m1_cpu(size, size);
  stan::math::matrix_d m1_cl(size, size);

  stan::math::check_symmetric("cholesky_decompose", "m", m1_pos_def);
  Eigen::LLT<stan::math::matrix_d> llt(m1_pos_def.rows());
  llt.compute(m1_pos_def);
  stan::math::check_pos_definite("cholesky_decompose", "m", llt);
  m1_cpu = llt.matrixL();

  m1_cl = stan::math::cholesky_decompose(m1_pos_def);

  double max_error = 0;
  for (int i = 0; i < size; i++) {
    for (int j = 0; j <= i; j++) {


by @egeberkina)](#cases-78)
*   [Case 77: Story Scene in Crystal Ball (by @dotey)](#cases-77)
*   [Case 76: Nostalgic Anime Film Poster (by photis (Sora))](#cases-76)
*   [Case 75: Social Media Frame Integration (by @dotey)](#cases-75)
*   [Case 74: Creative Logo Shaped Bookshelf (by @umesh_ai)](#cases-74)
*   [Case 73: Cute Chibi Keychain (by @azed_ai)](#cases-73)
*   [Case 72: Gold Pendant Necklace (by @azed_ai)](#cases-72)
*   [Case 71: Miniature Cyberpunk Tilt-Shift Landscape (by terry623)](#cases-71)
*   [Case 70: Original Pokemon Creation (by @Anima_Labs)](#cases-70)
*   [Case 69: Silhouette Art (by @umesh_ai)](#cases-69)
*   [Case 68: Futuristic Logo Trading Card (by @hewarsaber)](#cases-68)
*   [Case 67: Ultra-realistic 3D Game (by @ZHO_ZHO_ZHO)](#cases-67)
*   [Case 66: Creative Silk Universe (by @ZHO_ZHO_ZHO)](#cases-66)
*   [Case 65: Surreal Underwater Scene Popsicle (by @madpencil_)](#cases-65)
*   [Case 64: Steampunk Mechanical Fish (by @f-is-h)](#cases-64)
*   [Case 63: Emoji Cream Popsicle (by @ZHO_ZHO_ZHO)](#cases-63)
*   [Case 62: Kawaii Enamel Pin (by @gnrlyxyz)](#cases-62)
*   [Case 61: Fake Tweet Screenshot (Einstein) (by @egeberkina)](#cases-61)
*   [Case 60: Emoji Tufted Rug (by @gizakdag)](#cases-60)
*   [Case 59: Colorful Vector Art Poster (by @michaelrabone)](#cases-59)
*   [Case 58: Cloud Art (by @umesh_ai)](#cases-58)
*   [Case 57: 8-Bit Pixel Icon (by @egeberkina)](#cases-57)
*   [Case 56: Miniature 3D Building (by @dotey)](#cases-56)
*   [Case 55: Cute Plant Planter (by @azed_ai)](#cases-55)
*   [Case 54: Extremely Ordinary iPhone Selfie (by @jiamimaodashu)](#cases-54)
*   [Case 53: Emoji Inflatable Cushion (by @gizakdag)](#cases-53)
*   [Case 52: Paper Craft Style Emoji Icon (by @egeberkina)](#cases-52)
*   [Case 51: Passport Entry Stamp (by @M_w14_)](#cases-51)
*   [Case 50: Physical Destruction Effect Card (Lara Croft) (by @op7418)](#cases-50)
*   [Case 49: Fashion Magazine Cover Style (by @dotey)](#cases-49)
*   [Case 48: Voxel Style 3D Icon Conversion (by @BrettFromDJ)](#cases-48)
*   [Case 47: ESC Keycap Miniature Diorama (by @egeberkina)](#cases-47)
*   [Case 46: Happy Capsule Creation (by @ZHO_ZHO_ZHO)](#cases-46)
*   [Case 45: 3D Chibi-style University Anthropomorphic Mascot (by @dotey)](#cases-45)
*   [Case 44: RPG-Style Character Card Creation (by @berryxia_ai)](#cases-44)
*   [Case 43: Cute Chibi Matryoshka Dolls (Girl with a Pearl Earring) (by @ZHO_ZHO_ZHO)](#cases-43)
*   [Case 42: 3D Q-version Couple Snow Globe (by @balconychy)](#cases-42)
*   [Case 41: Miniature Three-dimensional Scene Presentation (by @dotey)](#cases-41)
*   [Case 40: Japanese-s


RDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW);

SELECT group_concat(b, '.') OVER (
  win ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
)
FROM t1
WINDOW win AS (PARTITION BY a ORDER BY c);


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mntent.h>

struct mntent *getmntent(FILE *filep)
{
  char *cp, *sep = " \t\n";
  static char buff[MNTMAXSTR];
  static struct mntent mnt;

  /* Loop on the file, skipping comment lines. - FvK 03/07/93 */
  while(fgets(buff, sizeof buff, filep) != NULL) {
	if (buff[0] == '#' || buff[0] == '\n') continue;
	break;
  }

  mnt.mnt_fsname = strtok(buff, sep);
  if (mnt.mnt_fsname == NULL)
    return NULL;

  mnt.mnt_dir = strtok(NULL, sep);
  if (mnt.mnt_dir == NULL)
    return NULL;

  mnt.mnt_type = strtok(NULL, sep);
  if (mnt.mnt_type == NULL)
#if 0
    mnt.mnt_type = MNTTYPE_MINIX;
#else
    return NULL;
#endif

  mnt.mnt_opts = strtok(NULL, sep);
  if (mnt.mnt_opts == NULL)
    mnt.mnt_opts = "";

  cp = strtok(NULL, sep);
  mnt.mnt_freq = (cp != NULL) ? atoi(cp) : 0;

  cp = strtok(NULL, sep);
  mnt.mnt_passno = (cp != NULL) ? atoi(cp) : 0;

  return &mnt;
}

int addmntent(FILE *filep, const struct mntent *mnt)
{
  if (fseek(filep, 0, SEEK_END) < 0)
    return 1;

  if (fprintf(filep, "%s %s %s %s %d %d\n", mnt->mnt_fsname, mnt->mnt_dir,
	      mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq, mnt->mnt_passno)
      < 1)
    return 1;

  return 0;
}

char *hasmntopt(const struct mntent *mnt, const char *opt)
{
  return strstr(mnt->mnt_opts, opt);
}

int endmntent(FILE *filep)
{
  fclose(filep);
  return 1;
}