es](#testing-examples)

This application is used to check everything is ok and running as fast as expected.
The information about the maximum frame rate could be checked using this application.
It's open source and doesn't require registration or license key.

More information about the benchmark rules at [https://www.doubango.org/SDKs/credit-card-ocr/docs/Benchmark.html](https://www.doubango.org/SDKs/credit-card-ocr/docs/Benchmark.html).

# GPU acceleration #
By default GPU acceleration is disabled. Check [here](../README.md#gpu-acceleration) for more information on how to enable.

# Peformance numbers #

Some performance numbers using **720p (1280x720)** images:

|  | 0.0 rate | 0.2 rate | 0.5 rate | 0.7 rate | 1.0 rate |
|-------- | --- | --- | --- | --- | --- |
| **Xeon® E31230v5, GTX 1070 (Ubuntu 18)** | 976 millis
 **102.43 fps** | 1602 millis
 62.39 fps | 2567 millis
 38.94 fps | 3214 millis
 31.11 fps | 4142 millis
 24.13 fps |
| **i7-4790K (Windows 7)** | 4459 millis
 **22.42 fps** | 8811 millis
 11.34 fps | 15827 millis
 6.31 fps | 20571 millis
 4.86 fps | 27361 millis
 3.65 fps |
| **i7-4770HQ (Windows 10)** | 8653 millis
 **11.55 fps** | 16583 millis
 6.03 fps | 29668 millis
 3.37 fps | 38636 millis
 2.58 fps | 52945 millis
 1.88 fps |
| **Galaxy S10+ (Android)** | 3673 millis
 **27.22 fps** | 13053 millis
 7.66 fps | 28304 millis
 3.53 fps | 38175 millis
 2.61 fps | 52685 millis
 1.89 fps |
| **Raspberry Pi 4 (Raspbian Buster)** | 9731 millis
 **10.21 fps** | 35449 millis
 2.82 fps | 74698 millis
 1.33 fps | 101665 millis
 0.98 fps | 128269 millis
 0.77 fps |

Some notes:
- **Please note that even if Raspberry Pi 4 has a 64-bit CPU [Raspbian OS](https://en.wikipedia.org/wiki/Raspbian>) uses a 32-bit kernel which means we're loosing many SIMD optimizations.**

# Pre-built binaries #

If you don't want to build this sample by yourself then, use the pre-built versions:
 - Windows: [benchmark.exe](../../../binaries/windows/x86_64/benchmark.exe) under [binaries/windows/x86_64](../../../binaries/windows/x86_64)
 - Linux: [benchmark](../../../binaries/linux/x86_64/benchmark) under [binaries/linux/x86_64](../../../binaries/linux/x86_64). Built on Ubuntu 18. **You'll need to download libtensorflow.so as explained [here](../README.md#gpu-acceleration-tensorflow-linux)**.
 - Raspberry Pi: [benchmark](../../../binaries/raspbian/armv7l/benchmark) under [binaries/raspbian/armv7l](../../../binaries/raspbian/armv7l)
 - Android: check [android](../../android) folder

On **Windows**, the easiest way to try this sample is to navigate to [binaries/windows/x86_64](../../../binaries/windows/x86_64/) and run [binaries/windows/x86_64/benchmark.bat](../../../binaries/windows/x86_64/benchmark.bat). You can edit these files to use your own images and configuration options.

# Building #

This sample contains [a single C++ source file](benchmark.cxx) and is easy to build. The documentation about the


종목

종목	가격	등락	포지션

            {% for item in watchlist %}

{{ item.name }}	{{ item.price }}	{{ item.change }}	{{ item.pos }}	<button class="px-2 py-1 border rounded-lg">거래</button>

            {% endfor %}

뉴스 피드

AI 칩 수요 폭증… 관련주 강세

파이낸셜잉글리시 · 12분 전

금리 인하 기대감, 반도체 투자 확대

TechPulse · 45분 전

정부, 첨단 제조업 세제 지원 검토

PolicyWatch · 1시간 전

{% endblock %}

{% block scripts %}


using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;

namespace StackExchange.Redis.Tests;

[Collection(NonParallelCollection.Name)]
public class LoggerTests(ITestOutputHelper output) : TestBase(output)
{
    [Fact]
    public async Task BasicLoggerConfig()
    {
        var traceLogger = new TestLogger(LogLevel.Trace, Writer);
        var debugLogger = new TestLogger(LogLevel.Debug, Writer);
        var infoLogger = new TestLogger(LogLevel.Information, Writer);
        var warningLogger = new TestLogger(LogLevel.Warning, Writer);
        var errorLogger = new TestLogger(LogLevel.Error, Writer);
        var criticalLogger = new TestLogger(LogLevel.Critical, Writer);

        var options = ConfigurationOptions.Parse(GetConfiguration());
        options.LoggerFactory = new TestWrapperLoggerFactory(new TestMultiLogger(traceLogger, debugLogger, infoLogger, warningLogger, errorLogger, criticalLogger));

        await using var conn = await ConnectionMultiplexer.ConnectAsync(options);
        // We expect more at the trace level: GET, ECHO, PING on commands
        Assert.True(traceLogger.CallCount > debugLogger.CallCount);
        // Many calls for all log lines - don't set exact here since every addition would break the test
        Assert.True(debugLogger.CallCount > 30);
        Assert.True(infoLogger.CallCount > 30);
        // No debug calls at this time
        // We expect no error/critical level calls to have happened here
        Assert.Equal(0, errorLogger.CallCount);
        Assert.Equal(0, criticalLogger.CallCount);
    }

    [Fact]
    public async Task WrappedLogger()
    {
        var options = ConfigurationOptions.Parse(GetConfiguration());
        var wrapped = new TestWrapperLoggerFactory(NullLogger.Instance);
        options.LoggerFactory = wrapped;

        await using var conn = await ConnectionMultiplexer.ConnectAsync(options);
        Assert.True(wrapped.Logger.LogCount > 0);
    }

    public class TestWrapperLoggerFactory(ILogger logger) : ILoggerFactory
    {
        public TestWrapperLogger Logger { get; } = new TestWrapperLogger(logger);

        public void AddProvider(ILoggerProvider provider) { }
        public ILogger CreateLogger(string categoryName) => Logger;
        public void Dispose() { }
    }

    public class TestWrapperLogger(ILogger toWrap) : ILogger
    {
        public int LogCount = 0;
        private ILogger Inner { get; } = toWrap;

#if NET8_0_OR_GREATER
        public IDisposable? BeginScope<TS


  override val id: UInt = 310u

    override val crcExtra: Byte = 28

    override fun deserialize(bytes: ByteArray): UavcanNodeStatus {
      val decoder = MavDataDecoder(bytes)

      val timeUsec = decoder.safeDecodeUInt64()
      val uptimeSec = decoder.safeDecodeUInt32()
      val vendorSpecificStatusCode = decoder.safeDecodeUInt16()
      val health = decoder.safeDecodeEnumValue(1).let { value ->
        val entry = UavcanNodeHealth.getEntryFromValueOrNull(value)
        if (entry != null) MavEnumValue.of(entry) else MavEnumValue.fromValue(value)
      }
      val mode = decoder.safeDecodeEnumValue(1).let { value ->
        val entry = UavcanNodeMode.getEntryFromValueOrNull(value)
        if (entry != null) MavEnumValue.of(entry) else MavEnumValue.fromValue(value)
      }
      val subMode = decoder.safeDecodeUInt8()

      return UavcanNodeStatus(
        timeUsec = timeUsec,
        uptimeSec = uptimeSec,
        health = health,
        mode = mode,
        subMode = subMode,
        vendorSpecificStatusCode = vendorSpecificStatusCode,
      )
    }

    public operator fun invoke(builderAction: Builder.() -> Unit): UavcanNodeStatus =
        Builder().apply(builderAction).build()
  }

  public class Builder {
    public var timeUsec: ULong = 0uL

    public var uptimeSec: UInt = 0u

    public var health: MavEnumValue<UavcanNodeHealth> = MavEnumValue.fromValue(0u)

    public var mode: MavEnumValue<UavcanNodeMode> = MavEnumValue.fromValue(0u)

    public var subMode: UByte = 0u

    public var vendorSpecificStatusCode: UShort = 0u

    public fun build(): UavcanNodeStatus = UavcanNodeStatus(
      timeUsec = timeUsec,
      uptimeSec = uptimeSec,
      health = health,
      mode = mode,
      subMode = subMode,
      vendorSpecificStatusCode = vendorSpecificStatusCode,
    )
  }
}
package com.divpundir.mavlink.definitions.common

import com.divpundir.mavlink.api.GeneratedMavEnum
import com.divpundir.mavlink.api.GeneratedMavEnumEntry
import com.divpundir.mavlink.api.MavBitmask
import kotlin.UInt
import kotlin.collections.List

/**
 * Camera capability flags (Bitmap)
 */
@GeneratedMavEnum(bitmask = true)
public enum class CameraCapFlags(
  override val `value`: UInt,
) : MavBitmask {
  /**
   * Camera is able to record video
   */
  @GeneratedMavEnumEntry
  CAPTURE_VIDEO(1u),
  /**
   * Camera is able to capture images
   */
  @GeneratedMavEnumEntry
  CAPTURE_IMAGE(2u),
  /**
   * Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)
   */
  @GeneratedMavEnumEntry
  HAS_MODES(4u),
  /**
   * Camera can capture images while in video mode
   */
  @GeneratedMavEnumEntry
  CAN_CAPTURE_IMAGE_IN_VIDEO_MODE(8u),
  /**
   * Camera can capture videos while in Photo/Image mode
   */
  @GeneratedMavEnumEntry
  CAN_CAPTURE_VIDEO_IN_IMAGE_MODE(16u),
  /**
   * Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)
   */
  @GeneratedMavEnumEntry
  HAS_IMAGE_SURVEY_MODE(32u),
  /**
   * Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)
   */
  @GeneratedMavEnumEntry
  HAS_BASIC_ZOOM(64u),
  /**
   * Camera has basic focus control (MA


"""
Neutrino Parameters: Complete φ-Mathematical Derivation

This module derives all neutrino parameters from pure φ-recursion mathematics:
- Neutrino mass scale from φ-suppression hierarchy
- Mixing angles from φ-geometric structure
- See-saw mechanism from φ-recursive depth
- Mass splittings from φ-generation structure

All derivations trace back to FIRM axioms with complete provenance tracking.
No empirical inputs - pure mathematical derivation from φ-recursion.

Dependencies:
- φ-recursion from foundation.operators.phi_recursion
- Provenance tracking via derivation trees
- Dimensional analysis via Dimensional Bridge (gated outside theory)

Mathematical Foundation:
- A𝒢.3: Grace Operator determines neutrino structure
- φ = (1+√5)/2 from recursive stability condition
- Neutrino masses emerge from maximal φ-suppression (minimal mass carriers)
- Mixing angles from φ-geometric phases in generation space
"""

from typing import Dict, Any, Tuple, Optional, List
import numpy as np
import math
from dataclasses import dataclass
from enum import Enum

@dataclass
class NeutrinoResult:
    """Result of neutrino parameter derivation with complete provenance"""
    name: str
    symbol: str
    theoretical_value: float
    experimental_value: Optional[float]
    experimental_bound: Optional[Tuple[float, float]]  # (lower, upper) bounds
    relative_error_percent: Optional[float]
    phi_formula: str
    derivation_steps: List[str]
    mathematical_necessity: str
    falsification_criterion: str
    units: str

class NeutrinoType(Enum):
    """Types of neutrinos in FIRM theory"""
    ELECTRON = "electron"
    MUON = "muon"
    TAU = "tau"
    STERILE = "sterile"  # Right-handed neutrinos

class MixingAngle(Enum):
    """Neutrino mixing angles"""
    THETA_12 = "theta_12"  # Solar angle
    THETA_23 = "theta_23"  # Atmospheric angle
    THETA_13 = "theta_13"  # Reactor angle

class NeutrinoParametersDerivation:
    """
    Derive all neutrino parameters from pure φ-recursion mathematics.

    This class implements the complete derivation of:
    1. Neutrino mass scale from φ-suppression hierarchy
    2. Mixing angles from φ-geometric structure
    3. See-saw mechanism from φ-recursive depth
    4. Mass splittings from generation structure

    All values derived from pure mathematics - no empirical inputs.
    """

    def __init__(self):
        """Initialize neutrino parameter derivation system"""
        # Import golden ratio from foundation
        from foundation.operators.phi_recursion import PHI_VALUE
        self._phi = PHI_VALUE

        # Fundamental constants from φ-mathematics
        from constants.fine_structure_alpha import FINE_STRUCTURE_ALPHA
        self._alpha_em = FINE_STRUCTURE_ALPHA.derive_primary_phi_expression().alpha_value

        # Suppress absolute mass scales in derivation path; use φ-only relations
        self._planck_mass_gev = None

        # Remove embedded experimental bounds from theory module.
        # Any comparison to experimental ranges must occur via validation layer only.
        self._experimental_bounds = {}

        # Mathematical constants from φ-recursion
        self._recursion_depth_limit = 42  # φ^42 ≈ decoherence threshold
        self._generation_phi_powers = [31, 37, 42]  # For ν_e, ν_μ, ν_τ

    def derive_neutrino_mass_scale(self) -> NeutrinoResult:
        """
        Derive neutrino mass scale from φ-suppression hierarchy.

        Neutrinos are minimal mass carriers in FIRM theory.
        Their masses emerge from maximal φ-suppression relative to charged leptons.

        Mathematical derivation:
        1. Neutrinos have minimal coupling to Fix(𝒢)
        2. Mass suppression: m_ν ~ m_Planck × α³ × φ^(-42)
        3. See-saw mechanism: additional φ^(-6) suppression
        4. Generation structure: slight variations from φ-powers

        Returns:
            NeutrinoResult with complete derivation provenance
        """
        derivation_steps = []

        # Step 1: Base structural scale from fine structure (φ-native, dimensionless)
        base_scale = (self._alpha_em ** 3)
        derivation_steps.append(f"Base scale (φ-native) = α³ = {base_scale:.6e}")

        # Step 2: Maximal φ-suppression (42 = recursion depth limit)
        phi_suppression = self._phi**(-42)
        suppressed_mass = base_scale * phi_suppression
        derivation_steps.append(f"φ-suppression = φ^(-42) = {phi_suppression:.3e}")
        derivation_steps.append(f"Suppressed value (φ-native) =


import requests
from bs4 import BeautifulSoup
import json
import re

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
    "Accept-Language": "en-US,en;q=0.9",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
    "Referer": "https://www.google.com/",
    "DNT": "1",  # Do Not Track Request Header
    "Connection": "keep-alive"
}

def scrape_content(url):
    # Send a request to the URL
    response = requests.get(url, headers=headers)
    response.raise_for_status()  # Check for request errors

    # Parse the page with BeautifulSoup
    soup = BeautifulSoup(response.text, 'html.parser')

    # Remove headers and footers if they are identifiable
    for tag in soup(['header', 'footer', 'nav', 'aside']):
        tag.decompose()  # Remove these tags and their content

    # Identify the main content based on common HTML tags
    content = soup.find('main') or soup.find('article') or soup.body
    text_content = content.get_text(separator='\n', strip=True) if content else "No main content found."

    # Extract and clean the title
    title = soup.title.string.strip() if soup.title and soup.title.string else "No title available"

    # Extract and clean meta description
    meta_description = soup.find('meta', attrs={'name': 'description'})
    meta_description_content = meta_description['content'].strip() if meta_description and meta_description.get('content') else "No meta description found."

    # Extract and clean meta tags (keywords)
    meta_keywords = soup.find('meta', attrs={'name': re.compile(r'(?i)keywords')}) or \
                soup.find('meta', attrs={'property': re.compile(r'(?i)keywords')})

    meta_keywords_content = [tag.strip() for tag in meta_keywords['content'].split(',')] if meta_keywords and meta_keywords.get('content') else []

    # Construct JSON output
    result = {
        'Title': title,
        'Description': meta_description_content,
        'Tags': meta_keywords_content,
        'Content': text_content
    }

    return json.dumps(result, indent=4)

url = "https://www.robi.com.bd/en/personal/vas/all-vas-services"
content = scrape_content(url)
print(content)


ive(Debug)]
/// Represents an error related to the use of an Image Unit
pub enum ImageUnitError {
    /// The texture does not contain a mipmap at the requested level
    NoMipmapAtLevel(u32),
    /// This type of texture is not layered
    LayeringNotSupported(texture::Dimensions),
    /// The layer requested is out of the bounds of this texture
    LayerOutOfBounds(u32),
    /// The format of the texture and the requested format are not compatible
    BadFormatClass(usize, usize),
    /// Error while trying to get the format of the passed texture
    GetFormat(GetFormatError),
}

impl std::fmt::Display for ImageUnitError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        use self::ImageUnitError::*;

        let desc = match *self {
            NoMipmapAtLevel(level) => write!(f, "No mipmap level {} found", level),
            LayeringNotSupported(kind) => write!(f, "Layering is not supported with textures of dimensions {:?}", kind),
            LayerOutOfBounds(layer) => write!(f, "Request layer {} is out of bounds", layer),
            BadFormatClass(tbits, ibits) => write!(f, "Texture format has {} bits but image format has {} bits", tbits, ibits),
            GetFormat(error) => write!(f, "{}", error),
        };
        Ok(())
    }
}

impl std::error::Error for ImageUnitError {}

/// How we bind a texture to an image unit
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub struct ImageUnitBehavior {
    /// The mip level to bind
    pub level: u32,
    pub(crate) layer: Option<u32>,
    /// How the shader will access the image unit
    pub access: ImageUnitAccess,
    /// How the shader should interpret the image
    pub format: ImageUnitFormat,
}

impl Default for ImageUnitBehavior {
    #[inline]
    fn default() -> ImageUnitBehavior {
        ImageUnitBehavior {
            level: 0,
            layer: None,
            access: ImageUnitAccess::ReadWrite,
            format: ImageUnitFormat::R32I,
        }
    }
}

/// An image unit uniform marker
pub struct ImageUnit<'t, T: 't + core::ops::Deref<Target = crate::texture::TextureAny>>(pub &'t T, pub ImageUnitBehavior);

impl<'t, T: 't + core::ops::Deref<Target = crate::texture::TextureAny>> ImageUnit<'t, T> {
    /// Create a new marker
    pub fn new(texture: &'t T, format: ImageUnitFormat) -> Result<ImageUnit<'t, T>, ImageUnitError> {
        let tbits = texture.get_internal_format().unwrap().get_total_bits();
        if tbits != format.get_total_bits() {
            return Err(ImageUnitError::BadFormatClass(tbits, format.get_total_bits()))
        }

        Ok(ImageUnit(texture, ImageUnitBehavior {
	    format,
	    ..Default::default()
	}))
    }

    /// Set the mip level that will be bound
    pub fn set_level(mut self, level: u32) -> Result<Self, ImageUnitError> {
        self.0.mipmap(level).ok_or(ImageUnitError::NoMipmapAtLevel(level))?;
        self.1.level = level;
        Ok(self)
    }


Icon((button.icon as? ImageIcon)?.image?.getScaledInstance(24, 24, Image.SCALE_SMOOTH))
        button.addMouseListener(MouseFillListener(button))
    }

    private fun initInstanceList() {
        instanceScrollPane.border = BorderFactory.createEmptyBorder()
        SwingUtils.fasterScroll(instanceScrollPane)
        loadInstanceList()
        this.addComponentListener(object : ComponentAdapter() {
            override fun componentResized(e: ComponentEvent?) {
                instanceScrollPane.viewport.view.revalidate()
                instanceScrollPane.viewport.view.repaint()
            }
        })
    }

    private fun initInstanceOption() {
//        bottomField.isVisible = false
    }

    fun loadInstanceList() {
        val containerPanel = JPanel(MigLayout("wrap 1", "[grow, fill]", ""))

        for (group in InstanceManager.instances.keys) {
            createInstanceGroup(containerPanel, group)
            containerPanel.add(JSeparator())
        }
        containerPanel.revalidate()
        containerPanel.repaint()
        instanceScrollPane.viewport.view = containerPanel
    }

    private fun createInstanceGroup(panel: JPanel, group: String) {
        val groupTitle = JLabel(group)
        groupTitle.border = BorderFactory.createEmptyBorder(0, 10, 0, 0)
        groupTitle.font = groupTitle.font.deriveFont(Font.BOLD, groupTitle.font.size2D + 6F)
        panel.add(groupTitle)

        val groupPanel = JPanel(WrapLayout(FlowLayout.LEFT, 10, 10))
        for (basicInstance in InstanceManager.instances[group]!!) {
            groupPanel.add(InstanceLaunchButton(this, basicInstance), "gap 10")
        }
        panel.add(groupPanel)
    }

}package com.redlimerl.mcsrlauncher.data.asset

import com.redlimerl.mcsrlauncher.MCSRLauncher
import com.redlimerl.mcsrlauncher.data.asset.game.GameAssetIndex
import com.redlimerl.mcsrlauncher.exception.IllegalRequestResponseException
import com.redlimerl.mcsrlauncher.launcher.GameAssetManager
import com.redlimerl.mcsrlauncher.network.FileDownloader
import com.redlimerl.mcsrlauncher.util.AssetUtils
import com.redlimerl.mcsrlauncher.util.HttpUtils
import com.redlimerl.mcsrlauncher.util.LauncherWorker
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.Serializable
import org.apache.commons.io.FileUtils
import org.apache.hc.client5.http.classic.methods.HttpGet
import java.util.concurrent.atomic.AtomicLong

@Serializable
data class GameAssetObject(
    val id: String,
    private val sha1: String,
    private val size: Long,
    val totalSize: Long,
    private val url: String
) {
    fun getAssetIndexes(worker: LauncherWorker): GameAssetIndex {
        val assetIndexFile = GameAssetManager.INDEXES_PATH.resolve("${this.id}.json").toFile()
        if (!assetIndexFile.exists() || GameAssetManager.getChecksum(this.url) != this.sha1) {
            val assetIndexResponse = HttpUtils.makeJsonRequest(HttpGet(this.url), worker)
            if (!assetIndexResponse.hasSuccess()) throw IllegalRequestResponseException("Failed to get game asset index: ${this.url}")

            val assetIndex = assetIndexResponse.get<GameAssetIndex>()
            FileUtils.writeStringToFile(assetIndexFile, MCSRLauncher.JSON.encodeToString(assetIndex), Charsets.UTF_8)
            GameAssetManager.updateChecksum(this.url, this.sha1)
            return assetIndex


T).MakePicture: Picture is not the Batch's Picture", b))
	}
	bp := &batchPicture{
		pic: p,
		dst: b,
	}
	return bp
}

type batchTriangles struct {
	tri Triangles
	tmp *TrianglesData
	dst *Batch
}

func (bt *batchTriangles) Len() int {
	return bt.tri.Len()
}

func (bt *batchTriangles) SetLen(len int) {
	bt.tri.SetLen(len)
	bt.tmp.SetLen(len)
}

func (bt *batchTriangles) Slice(i, j int) Triangles {
	return &batchTriangles{
		tri: bt.tri.Slice(i, j),
		tmp: bt.tmp.Slice(i, j).(*TrianglesData),
		dst: bt.dst,
	}
}

func (bt *batchTriangles) Update(t Triangles) {
	bt.tri.Update(t)
}

func (bt *batchTriangles) Copy() Triangles {
	return &batchTriangles{
		tri: bt.tri.Copy(),
		tmp: bt.tmp.Copy().(*TrianglesData),
		dst: bt.dst,
	}
}

func (bt *batchTriangles) draw(bp *batchPicture) {
	bt.tmp.Update(bt.tri)

	for i := range *bt.tmp {
		(*bt.tmp)[i].Position = bt.dst.mat.Project((*bt.tmp)[i].Position)
		(*bt.tmp)[i].Color = bt.dst.col.Mul((*bt.tmp)[i].Color)
	}

	cont := bt.dst.cont.Triangles
	cont.SetLen(cont.Len() + bt.tri.Len())
	added := cont.Slice(cont.Len()-bt.tri.Len(), cont.Len())
	added.Update(bt.tri)
	added.Update(bt.tmp)
	bt.dst.cont.Dirty()
}

func (bt *batchTriangles) Draw() {
	bt.draw(nil)
}

type batchPicture struct {
	pic Picture
	dst *Batch
}

func (bp *batchPicture) Bounds() Rect {
	return bp.pic.Bounds()
}

func (bp *batchPicture) Draw(t TargetTriangles) {
	bt := t.(*batchTriangles)
	if bp.dst != bt.dst {
		panic(fmt.Errorf("(%T).Draw: TargetTriangles generated by different Batch", bp))
	}
	bt.draw(bp)
}
// Package imdraw implements a basic primitive geometry shape and pictured polygon drawing for Pixel
// with a nice immediate-mode-like API.
package imdraw

import (
	"image/color"
	"math"

	"github.com/faiface/pixel"
)

// IMDraw is an immediate-mode-like shape drawer and BasicTarget. IMDraw supports TrianglesPosition,
// TrianglesColor, TrianglesPicture and PictureColor.
//
// IMDraw, other than a regular BasicTarget, is used to draw shapes. To draw shapes, you first need
// to Push some points to IMDraw:
//
//   imd := pixel.NewIMDraw(pic) // use nil pic if you only want to draw primitive shapes
//   imd.Push(pixel.V(100, 100))
//   imd.Push(pixel.V(500, 100))
//
// Once you have Pushed some points, you can use them to draw a shape, such as a line:
//
//   imd.Line(20) // draws a 20 units thick line
//
// Set exported fields to change properties of Pushed points:
//
//   imd.Color = pixel.RGB(1, 0, 0)
//   imd.Push(pixel.V(200, 200))
//   imd.Circle(400, 0)
//
// Here is the list of all available point properties (need to be set before Pushing a point):
//   - Color     - applies to all
//   - Picture   - coordinates, only applies to filled polygons
//   - Intensity - picture intensity, only applies to filled polygons
//   - Precision - curve drawing precision, only applies to circles


= "Enemy modifiers", modName = { "CannotBeEvaded", "CannotBeDodged", "reduceEnemyDodge" }, enemy = true },
	}, },
	{ label = "Hits before death", { format = "{2:output:TotalNumberOfHits}", { breakdown = "TotalNumberOfHits" }}, },
	{ label = "Effective Hit Pool",{ format = "{0:output:TotalEHP}", { breakdown = "TotalEHP" }, },},
	{ label = "Time before death",{ format = "{2:output:EHPSurvivalTime}s",
		{ breakdown = "EHPSurvivalTime" },
		{ label = "Enemy modifiers", modName = { "TemporalChainsActionSpeed", "ActionSpeed", "Speed", "MinimumActionSpeed" }, enemy = true },
	},}
}, }, { defaultCollapsed = false, label = "Maximum Hit Taken", data = {
	colWidth = 114,
	{
		{ format = colorCodes.PHYS.."Physical:" },
		{ format = colorCodes.LIGHTNING.."Lightning:" },
		{ format = colorCodes.COLD.."Cold:" },
		{ format = colorCodes.FIRE.."Fire:" },
		{ format = colorCodes.CHAOS.."Chaos:" },
	},
	{ label = "Maximum Hit Taken",
		{ format = "{0:output:PhysicalMaximumHitTaken}",
			{ breakdown = "PhysicalMaximumHitTaken" },
		},
		{ format = "{0:output:LightningMaximumHitTaken}",
			{ breakdown = "LightningMaximumHitTaken" },
		},
		{ format = "{0:output:ColdMaximumHitTaken}",
			{ breakdown = "ColdMaximumHitTaken" },
		},
		{ format = "{0:output:FireMaximumHitTaken}",
			{ breakdown = "FireMaximumHitTaken" },
		},
		{ format = "{0:output:ChaosMaximumHitTaken}",
			{ breakdown = "ChaosMaximumHitTaken" },
		},
	}
} }, { defaultCollapsed = true, label = "Recoup and Hit Taken Over Time", data = {
	colWidth = 190,
	extra = colorCodes.LIFE.."{0:output:netLifeRecoupAndLossLostOverTimeAvg}, "..colorCodes.MANA.."{0:output:ManaRecoupRecoveryAvg}, "..colorCodes.ES.."{0:output:EnergyShieldRecoupRecoveryAvg}",
	{
		{ format = colorCodes.LIFE.."Life:" },
		{ format = colorCodes.MANA.."Mana:" },
		{ format = colorCodes.ES.."Energy Shield:" },
	},
	{ label = "Recoup Max.", haveOutput = "anyRecoup",
		{ format = "{0:output:LifeRecoupRecoveryMax}",
			{ breakdown = "LifeRecoupRecoveryMax" },
			{ label = "Sources", modName = { "LifeRecoup", "PhysicalLifeRecoup", "LightningLifeRecoup", "ColdLifeRecoup", "FireLifeRecoup", "ChaosLifeRecoup", "PhysicalDamageMitigatedLifePseudoRecoup" } },
			{ label = "Recovery modifiers", modName = "LifeRecoveryRate" },
			{ label = "Faster Recoup", modName = "3SecondRecoup" },
		},
		{ format = "{0:output:ManaRecoupRecoveryMax}",
			{ breakdown = "ManaRecoupRecoveryMax" },
			{ label = "Sources", modName = "ManaRecoup" },
			{ label = "Recovery modifiers", modName = "ManaRecoveryRate" },
			{ label = "Faster Recoup", modName = "3SecondRecoup" },
		},
		{ format = "{0:output:EnergyShieldRecoupRecoveryMax}",
			{ breakdown = "EnergyShieldRecoupRecoveryMax" },
			{ label = "Sources", modName = { "EnergyShieldRecoup", "ElementalEnergyShieldRecoup", "PhysicalDamageMitigatedEnergyShieldPseudoRecoup" }


: push);
      _syncFromRecentLock = false;
    }
  }

  Future<void> _syncFromRecentWithoutLock({bool push = true}) async {
    bool peerSyncEqual(Peer a, Peer b) {
      return a.hash == b.hash &&
          a.username == b.username &&
          a.platform == b.platform &&
          a.hostname == b.hostname &&
          a.alias == b.alias;
    }

    Future<List<Peer>> getRecentPeers() async {
      try {
        List<String> filteredPeerIDs;
        if (_syncAllFromRecent) {
          _syncAllFromRecent = false;
          filteredPeerIDs = [];
        } else {
          final new_stored_str = await bind.mainGetNewStoredPeers();
          if (new_stored_str.isEmpty) return [];
          filteredPeerIDs = (jsonDecode(new_stored_str) as List<dynamic>)
              .map((e) => e.toString())
              .toList();
          if (filteredPeerIDs.isEmpty) return [];
        }
        final loadStr = await bind.mainLoadRecentPeersForAb(
            filter: jsonEncode(filteredPeerIDs));
        if (loadStr.isEmpty) {
          return [];
        }
        List<dynamic> mapPeers = jsonDecode(loadStr);
        List<Peer> recents = List.empty(growable: true);
        for (var m in mapPeers) {
          if (m is Map<String, dynamic>) {
            recents.add(Peer.fromJson(m));
          }
        }
        return recents;
      } catch (e) {
        debugPrint('getRecentPeers:$e');
      }
      return [];
    }

    try {
      if (!shouldSyncAb()) return;
      final recents = await getRecentPeers();
      if (recents.isEmpty) return;
      bool uiChanged = false;
      bool needSync = false;
      for (var i = 0; i < recents.length; i++) {
        var r = recents[i];
        var index = peers.indexWhere((e) => e.id == r.id);
        if (index < 0) {
          if (!isFull(false)) {
            peers.add(r);
            uiChanged = true;
            needSync = true;
          }
        } else {
          Peer old = Peer.copy(peers[index]);
          merge(r, peers[index]);
          if (!peerSyncEqual(peers[index], old)) {
            needSync = true;
          }
          if (!old.equal(peers[index])) {
            uiChanged = true;
          }
        }
      }
      // Be careful with loop calls
      if (needSync && push) {
        pushAb(toastIfSucc: false, toastIfFail: false);
      } else if (uiChanged) {
        peers.refresh();
      }
    } catch (e) {
      debugPrint('syncFromRecent:$e');
    }
  }

  _saveCache() {
    try {
      var m = _serialize();
      m.addAll(<String, dynamic>{
        "access_token": bind.mainGetLocalOption(key: 'access_token'),
      });
      bind.mainSaveAb(json: jsonEncode(m));
    } catch (e) {
      debugPrint('ab save:$e');
    }
  }

  Future<void> loadCache() async {
    try {
      if (_cacheLoadOnceFlag || abLoading.value || initialized) return;
      _cacheLoadOnceFlag = true;
      final access_token = bind.mainGetLocalOption(key: 'access_token');
      if (access_token.isEmpty) return;
      final cache = await bind.mainLoadAb();
      if (abLoading.value) return;
      final data = jsonDecode(cache);
      if (data =


tFlux.subscribe(item -> System.out.println("Subscriber 1: " * item));
        Thread.sleep(750); // Ждем отправку элементов

        // Вторая подписка (пропускает первый элемент)
        hotFlux.subscribe(item -> System.out.println("Subscriber 2: " * item));

        // Останавливаем работу основного потока, чтобы увидеть выходные данные
        Thread.sleep(2000);
    }
}

```

### Ключевые отличия

| Критерий       | Hot Observables                                        | Cold Observables                                                                          |
|----------------|--------------------------------------------------------|-------------------------------------------------------------------------------------------|
| Обмен данными  | Один поток для всех подписчиков                        | У каждого подписчика свой независимый поток                                               |
| Время подписки | Получает данные в зависимости от времени подписки      | Получает все данные, даже если подпишется позже                                           |
| Жизненный цикл | Работает независимо от подписок                        | Запускает генерацию данных только, когда есть подписка                                    |
| Асинхронность  | Может генерировать и передавать данные без подписчиков | Передача данных начинается после подписки, что часто приводит к синхронной передаче       |

### Практическое применение

Cold Observables полезны для:
* Данные, которые необходимо воспроизвести для каждого подписчика, такие как чтение из файла, выполнение HTTP-запроса или
генерация новой случайной последовательности.
* Сценарии, в которых последовательность элементов должна быть согласованной и воспроизводимой для каждого подписчика.

Hot Observables полезны для:
* Данные, которые создаются непрерывно и которыми необходимо делиться между несколькими подписчиками, такие как события
мыши, обновления цен на акции или данные датчиков.
* Сценарии, в которых подписчики должны получать только текущие и будущие события, а не прошлые.

[к оглавлению](#реактивное-программирование)

## Какова роль Подписки в реактивном программировании?

Подписка абстрагирует от того, как данные получаются или генерируются

### Основные функции
`Subscription` обычно предлагает два основных метода:
* **Request** - информирует источник данных о количестве элементов, которые потребитель готов получить
* **Cancel** - останавливает поток данных, освобождая любые ресурсы, такие как обработчики файлов или сетевые подключения

### Общая концепция
`Subscription` - интерфейс, действующий как соглашение меж


  addDeploymentNode,
  popBoundaryParseStack,
  addRel,
  updateElStyle,
  updateRelStyle,
  updateLayoutConfig,
  autoWrap,
  setWrap,
  getC4ShapeArray,
  getC4Shape,
  getC4ShapeKeys,
  getBoundarys,
  getCurrentBoundaryParse,
  getParentBoundaryParse,
  getRels,
  getTitle,
  getC4Type,
  getC4ShapeInRow,
  getC4BoundaryInRow,
  setAccTitle: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.s,
  getAccTitle: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.g,
  getAccDescription: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.a,
  setAccDescription: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.b,
  getConfig: () => (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_4__.c)().c4,
  clear,
  LINETYPE,
  ARROWTYPE,
  PLACEMENT,
  setTitle,
  setC4Type
  // apply,
};
const drawRect = function(elem, rectData) {
  return (0,_svgDrawCommon_92a8ff2b_js__WEBPACK_IMPORTED_MODULE_5__.d)(elem, rectData);
};
const drawImage = function(elem, width, height, x, y, link) {
  const imageElem = elem.append("image");
  imageElem.attr("width", width);
  imageElem.attr("height", height);
  imageElem.attr("x", x);
  imageElem.attr("y", y);
  let sanitizedLink = link.startsWith("data:image/png;base64") ? link : (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__/* .sanitizeUrl */ .Nm)(link);
  imageElem.attr("xlink:href", sanitizedLink);
};
const drawRels$1 = (elem, rels2, conf2) => {
  const relsElem = elem.append("g");
  let i = 0;
  for (let rel of rels2) {
    let textColor = rel.textColor ? rel.textColor : "#444444";
    let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
    let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
    let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
    let url = "";
    if (i === 0) {
      let line = relsElem.append("line");
      line.attr("x1", rel.startPoint.x);
      line.attr("y1", rel.startPoint.y);
      line.attr("x2", rel.endPoint.x);
      line.attr("y2", rel.endPoint.y);
      line.attr("stroke-width", "1");
      line.attr("stroke", strokeColor);
      line.style("fill", "none");
      if (rel.type !== "rel_b") {
        line.attr("marker-end", "url(" + url + "#arrowhead)");
      }
      if (rel.type === "birel" || rel.type === "rel_b") {
        line.attr("marker-start", "url(" + url + "#arrowend)");
      }
      i = -1;
    } else {
      let line = relsElem.append("path");
      line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
        "d",
        "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
          "controlx",
          rel.startPoint.x


*/
      public Builder addDisplayUp5ItemList(int value) {
        ensureDisplayUp5ItemListIsMutable();
        displayUp5ItemList_.addInt(value);
        onChanged();
        return this;
      }
      /**
       *

       * single OAJAMCHOPFJ (1621, 1921)
       *

       *
       * repeated uint32 display_up5_item_list = 1621;
       * @param values The displayUp5ItemList to add.
       * @return This builder for chaining.
       */
      public Builder addAllDisplayUp5ItemList(
          java.lang.Iterable<? extends java.lang.Integer> values) {
        ensureDisplayUp5ItemListIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, displayUp5ItemList_);
        onChanged();
        return this;
      }
      /**
       *

       * single OAJAMCHOPFJ (1621, 1921)
       *

       *
       * repeated uint32 display_up5_item_list = 1621;
       * @return This builder for chaining.
       */
      public Builder clearDisplayUp5ItemList() {
        displayUp5ItemList_ = emptyIntList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }

      private int wishMaxProgress_ ;
      /**
       *

       * found 3 BHBCHFFGHHE OK
       *

       *
       * uint32 wish_max_progress = 1757;
       * @return The wishMaxProgress.
       */
      @java.lang.Override
      public int getWishMaxProgress() {
        return wishMaxProgress_;
      }
      /**
       *

       * found 3 BHBCHFFGHHE OK
       *

       *
       * uint32 wish_max_progress = 1757;
       * @param value The wishMaxProgress to set.
       * @return This builder for chaining.
       */
      public Builder setWishMaxProgress(int value) {

        wishMaxProgress_ = value;
        onChanged();
        return this;
      }
      /**
       *

       * found 3 BHBCHFFGHHE OK
       *

       *
       * uint32 wish_max_progress = 1757;
       * @return This builder for chaining.
       */
      public Builder clearWishMaxProgress() {

        wishMaxProgress_ = 0;
        onChanged();
        return this;
      }

      private int wishProgress_ ;
      /**
       *

       * found 3 EOFACNPOJBN OK
       *

       *
       * uint32 wish_progress = 1799;
       * @return The wishProgress.
       */
      @java.lang.Override
      public int getWishProgress() {
        return wishProgress_;
      }
      /**
       *

       * found 3 EOFACNPOJBN OK
       *

       *
       * uint32 wish_progress = 1799;
       * @param value The wishProgress to set.
       * @return This builder for chaining.
       */
      public Builder setWishProgress(int value) {

        wishProgress_ = value;
        onChanged();
        return this;
      }
      /**
       *

       * found 3 EOFACNPOJBN OK
       *

       *
       * uint32 wish_progress = 1799;
       * @return This builder for chaining.
       */
      public Builder clearWishProgress() {

        wishProgress_ = 0;
        onChanged();
        return this;
      }

      private com.google.protobuf.Internal.IntList displayChronicle5ItemList_ = emptyInt


shes += getMesh(shape, textureSize, texture.ref)
            } catch (e: NumberFormatException) {
                log(Level.ERROR) { "Tcn file contains malformed integers within its data, ignoring" }
                e.print()
            }
        }
        return Model.of(meshes, listOf(texture))
    }

    @Throws(NumberFormatException::class)
    private fun getMesh(shape: Node, textureSize: IVector2, texture: IMaterialRef): IObjectCube {
        var mirrored = false
        var offset: List<String> = listOf()
        var position: List<String> = listOf()
        var rotation: List<String> = listOf()
        var size: List<String> = listOf()
        var textureOffset: List<String> = listOf()
        val shapeName = shape.attributes.getNamedItem("name").textContent

        val shapeChildren = shape.childNodes
        //extract properties
        for (j in 0 until shapeChildren.length) {

            val shapeChild = shapeChildren.item(j)
            val name = shapeChild.nodeName
            var value = shapeChild.textContent

            if (value != null) {
                value = value.trim { it <= ' ' }

                when (name) {
                    "IsMirrored" -> mirrored = value != "False"
                    "Offset" -> offset = value.split(COMMA).dropLastWhile(String::isEmpty)
                    "Position" -> position = value.split(COMMA).dropLastWhile(String::isEmpty)
                    "Rotation" -> rotation = value.split(COMMA).dropLastWhile(String::isEmpty)
                    "Size" -> size = value.split(COMMA).dropLastWhile(String::isEmpty)
                    "TextureOffset" -> textureOffset = value.split(COMMA).dropLastWhile(String::isEmpty)
                }
            }
        }

        val vSize = vec3Of(size[0].toInt(), size[1].toInt(), size[2].toInt())
        val vOffset = vec3Of(offset[0].toFloat(), offset[1].toFloat(), offset[2].toFloat())
        val vPos = vec3Of(position[0].toFloat(), position[1].toFloat(), position[2].toFloat())
        val vTexture = vec2Of(textureOffset[0].toInt(), textureOffset[1].toInt())
        val vRotation = vec3Of(rotation[0].toFloat(), rotation[1].toFloat(), rotation[2].toFloat())

        val rSize = vSize
        val rOffset = vOffset * vec3Of(1, -1, -1)
        val rPos = vPos * vec3Of(1, -1, -1) - vec3Of(0, vSize.y, vSize.z)
        val rTexture = vTexture
        val rRotation = vRotation * vec3Of(1, 1, -1)
        val rRotPoint = vPos * vec3Of(1, -1, -1) + vec3Of(8, 24, 8)

        val fOffset = rPos + rOffset + vec3Of(8, 24, 8)

        val transformation = TRSTransformation(translation = fOffset, scale = rSize).merge(
                TRSTransformation.fromRotationPivot(rRotPoint, rRotation))

        return ObjectCube(
                name = shapeName,
                transformation = transformation,
                textureOffset = rTexture,
                textureSize = textureSize,
                mirrored = mirrored,
                material = texture
        )
    }
}package com.cout970.modeler.core.model

import com.cout970.modeler.api.animation.IAnimation
import com.cout970.modeler.api.animation.IAnimationRef
import com.cout970.modeler.api.model.IModel
import com.cout970.modeler.api.model.`object`.*
import com.cout970.modeler.api.model.material.IMaterial
import com.cout970.modeler.api.model.material.IMaterialRef
import com.cout970.modeler.api.model.selection.IObjectRef
import com.cout970.modeler.core.animation.ref
import com.cout970.modeler.core.model


fun <A> STM.newTArray(size: Int, a: A): TArray<A> =
  newTArray(size) { a }
fun <A> STM.newTArray(vararg arr: A): TArray<A> =
  TArray(arr.map { newTVar(it) }.toTypedArray())
fun <A> STM.newTArray(xs: Iterable<A>): TArray<A> =
  TArray(xs.map { newTVar(it) }.toTypedArray())

/**
 * A [TArray] is an array of transactional variables.
 *
 * ## Creating [TArray]
 *
 * Similar to normal arrays there are a few ways to create a [TArray]:
 *
 * ```kotlin:ank
 * import arrow.fx.stm.TArray
 * import arrow.fx.stm.atomically
 *
 * suspend fun example() {
 *   //sampleStart
 *   // Create a size 10 array and fill it by using the construction function.
 *   TArray.new(10) { i -> i * 2 }
 *   // Create a size 10 array and fill it with a constant
 *   TArray.new(size = 10, 2)
 *   // Create an array from `vararg` arguments:
 *   TArray.new(5, 2, 10, 600)
 *   // Create an array from any iterable
 *   TArray.new(listOf(5,4,3,2))
 *   //sampleEnd
 * }
 * ```
 *
 * ## Reading a value from the array
 *
 * ```kotlin:ank:playground
 * import arrow.fx.stm.TArray
 * import arrow.fx.stm.atomically
 *
 * suspend fun main() {
 *   //sampleStart
 *   val tarr = TArray.new(size = 10, 2)
 *   val result = atomically {
 *     tarr[5]
 *   }
 *   //sampleEnd
 *   println("Result $result")
 * }
 * ```
 *
 * ## Setting a value in the array
 *
 * ```kotlin:ank:playground
 * import arrow.fx.stm.TArray
 * import arrow.fx.stm.atomically
 *
 * suspend fun main() {
 *   //sampleStart
 *   val tarr = TArray.new(size = 10, 2)
 *   val result = atomically {
 *     tarr[5] = 3
 *
 *     tarr[5]
 *   }
 *   //sampleEnd
 *   println("Result $result")
 * }
 * ```
 *
 * ## Transform the entire array
 *
 * ```kotlin:ank:playground
 * import arrow.fx.stm.TArray
 * import arrow.fx.stm.atomically
 *
 * suspend fun main() {
 *   //sampleStart
 *   val tarr = TArray.new(size = 10, 2)
 *   val result = atomically {
 *     tarr.transform { it + 1 }
 *   }
 *   //sampleEnd
 * }
 * ```
 *
 * ## Folding the array
 *
 * ```kotlin:ank:playground
 * import arrow.fx.stm.TArray
 * import arrow.fx.stm.atomically
 *
 * suspend fun main() {
 *   //sampleStart
 *   val tarr = TArray.new(size = 10, 2)
 *   val result = atomically {
 *     tarr.fold(0) { acc, v -> acc + v }
 *   }
 *   //sampleEnd
 *   println("Result $result")
 * }
 * ```
 */
data class TArray<A>internal constructor(internal val v: Array<TVar<A>>) {

  fun size(): Int = v.size

  override fun equals(other: Any?): Boolean = this === other
  override fun hashCode(): Int = v.hashCode()

  companion object {
    suspend fun <A> new(size: Int, f: (Int) -> A): TArray<A> =
      TArray(Array(size) { i -> TVar(f(i)) })
    suspend fun <A> new(size: Int, a: A): TArray<A> =
      new(size) { a }
    suspend fun <A> new(vararg arr: A): TArray<A> =
      TArray(arr.map { TVar.new(it) }.toTypedArray())
    suspend fun <A> new(xs: Iterable<A>): TArray<


            val textHeight = mCenterTextPaint.descent() + mCenterTextPaint.ascent()
            val textBaseline = (height - textHeight) / 2.0f
            canvas.drawText(
                mText!!,
                (width - mCenterTextPaint.measureText(mText)) / 2.0f,
                textBaseline,
                mCenterTextPaint
            )
        }
        if (mArcBottomHeight == 0f) {
            val radius = width / 2f
            val angle = (360 - mArcAngle) / 2f
            mArcBottomHeight = radius * (1 - cos(angle / 180 * Math.PI)).toFloat()
        }
        if (!mBottomText.isNullOrEmpty()) {
            mBottomTextPaint.color = mBottomTextColor
            mBottomTextPaint.textSize = mBottomTextSize
            val bottomTextBaseline = (
                    height +
                            (mBottomTextPaint.descent() + mBottomTextPaint.ascent()) / 2 -
                            mProgressWidth * 0.33f
                    )
            canvas.drawText(
                mBottomText!!,
                (width - mBottomTextPaint.measureText(mBottomText)) / 2.0f,
                bottomTextBaseline,
                mBottomTextPaint
            )
        }
    }

    fun setDrawStatus(drawaStatus: ArcProgressDrawStatus ) {
        this.drawStatus = drawaStatus
    }

    fun getDrawStatus(): ArcProgressDrawStatus  {
        return this.drawStatus
    }

    companion object {
        private const val SHADOW_ALPHA_FACTOR_LIGHT = 0.1f
        private const val SHADOW_ALPHA_FACTOR_DARK = 0.1f
    }

    enum class ArcProgressDrawStatus {
        // 没有绘制
        NOTDRAW,
        // 绘制中
        DRAWING,
        // 绘制完成
        COMPLETE
    }
}package com.knight.kotlin.library_widget.citypicker

import androidx.annotation.StyleRes
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import java.lang.ref.WeakReference

/**
 * @author created by luguian
 * @organize
 * @Date 2025/4/17 10:46
 * @descript:
 */
class CityPicker {
    private var mContext: WeakReference<FragmentActivity>? = null
    private var mFragment: WeakReference<Fragment>? = null
    private var mFragmentManager: WeakReference<FragmentManager>? = null

    private var enableAnim = false
    private var mAnimStyle = 0
    private var mLocation: com.knight.kotlin.library_database.entity.CityBean? = null
    private var mHotCities: List<com.knight.kotlin.library_database.entity.CityBean>? = null
    private var mOnPickListener: OnPickListener? = null

    private constructor()

    private constructor(fragment: Fragment) : this(fragment.requireActivity(), fragment) {
        mFragmentManager = WeakReference<FragmentManager>(fragment.getChildFragmentManager())
    }

    private constructor(activity: FragmentActivity) : this(activity, null) {
        mFragmentManager = WeakReference(activity.supportFragmentManager)
    }

    private constructor(activity: FragmentActivity, fragment: Fragment?) {
        mContext = WeakReference(activity)
        mFragment = WeakReference<Fragment>(fragment)
    }

    /**
     * 设置动画效果
     * @param animStyle
     * @return
     */
    fun setAnimationStyle(@StyleRes animStyle: Int): CityPicker {
        this.mAnimStyle = animStyle
        return this
    }

    /**
     * 设置当前已经定位的城市
     * @param location
     * @return
     */
    fun setLocatedCity(location: com.knight.kotlin.library_database.entity.CityBean?): CityPicker {
        this.mLocation = location
        return this
    }

    fun setHotCities(data: List<com.knight.kotlin.library_database.entity.CityBean>?):


ht: auto;
    padding: 50px 0px;
    padding-bottom: 50px;
  }
  .what-box-in {
    height: 500px;
    margin-left: -50px;
  }
  .what-content {
    padding: 50px;
    width: 500px;
  }
  .what-content p {
    font-size: 14px;
  }
  .what-noTouch:hover,
  .what-content-active {
    min-height: 67%;
    padding: 50px;
  }

  .what-noTouch:hover ~ .what-content,
  .what-box-in:hover .what-noTouch:not(:hover),
  .what-content.what-sibling {
    min-height: 33%;
    padding: 10px 50px;
  }
}
@media only screen and (max-width: 900px) {
  .whatIDO {
    flex-direction: column;
  }
  .what-box h2 {
    margin: 50px 0;
    font-size: 55px;
    line-height: 53px;
  }
  .what-box:first-child {
    justify-content: left;
  }
  .what-box:last-child {
    height: 500px;
  }
  .what-box {
    width: 500px;
    max-width: calc(100% - 50px);
    margin: auto;
  }
  .what-content {
    width: 100%;
  }
  .what-box-in {
    margin-left: 0px;
    height: 450px;
  }
  .what-content h5,
  .what-content-flex {
    opacity: 0;
    transition: 0.3s;
  }
  .what-noTouch:hover h5,
  .what-content-active h5,
  .what-noTouch:hover .what-content-flex,
  .what-content-active .what-content-flex {
    opacity: 1;
  }
  .what-content {
    padding: 30px;
  }
  .what-content p {
    font-size: 11px;
  }
  .what-noTouch:hover,
  .what-content-active {
    padding: 10px 30px;
  }
  .what-tags {
    font-size: 11px;
  }

  .what-noTouch:hover ~ .what-content,
  .what-box-in:hover .what-noTouch:not(:hover),
  .what-content.what-sibling {
    padding: 5px 30px;
  }
  .what-content h3 {
    font-size: 25px;
  }
}
@media only screen and (max-width: 550px) {
  .whatIDO {
    place-items: inherit;
    align-items: start;
    justify-content: left;
  }
  .what-box {
    max-width: calc(100% - 25px);
    margin: 0;
  }
}
@media only screen and (min-width: 1950px) {
  .what-box h2 {
    font-size: 7rem;
    line-height: 6.8rem;
  }
}
/*! ========================================================================
 * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
 * http://www.bootstraptoggle.com
 * ========================================================================
 * Copyright 2014 Min Hur, The New York Times Company
 * Licensed under MIT
 * ======================================================================== */

.checkbox label .toggle,
.checkbox-inline .toggle {
	margin-left: -20px;
	margin-right: 5px;
}

.toggle {
	position: relative;
	overflow: hidden;
}
.toggle input[type="checkbox"] {
	display: none;
}
.toggle-group {
	position: absolute;
	width: 200%;
	top: 0;
	bottom


#include <stdlib.h>

#include <grass/config.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/calc.h>

/****************************************************************
rand(lo,hi) random values between a and b
****************************************************************/

int f_rand(int argc, const int *argt, void **args)
{
    int i;

    if (argc < 2)
        return E_ARG_LO;
    if (argc > 2)
        return E_ARG_HI;

    switch (argt[0]) {
    case CELL_TYPE: {
        CELL *res = args[0];
        CELL *arg1 = args[1];
        CELL *arg2 = args[2];

        for (i = 0; i < columns; i++) {
            unsigned int x = (unsigned int)G_mrand48();
            int lo = arg1[i];
            int hi = arg2[i];

            if (lo > hi) {
                int tmp = lo;

                lo = hi;
                hi = tmp;
            }
            res[i] = (lo == hi) ? lo : (int)(lo + x % (unsigned int)(hi - lo));
        }
        return 0;
    }
    case FCELL_TYPE: {
        FCELL *res = args[0];
        FCELL *arg1 = args[1];
        FCELL *arg2 = args[2];

        for (i = 0; i < columns; i++) {
            double x = G_drand48();
            FCELL lo = arg1[i];
            FCELL hi = arg2[i];

            if (lo > hi) {
                FCELL tmp = lo;

                lo = hi;
                hi = tmp;
            }
            res[i] = (FCELL)(lo + x * (hi - lo));
        }
        return 0;
    }
    case DCELL_TYPE: {
        DCELL *res = args[0];
        DCELL *arg1 = args[1];
        DCELL *arg2 = args[2];

        for (i = 0; i < columns; i++) {
            double x = G_drand48();
            DCELL lo = arg1[i];
            DCELL hi = arg2[i];

            if (lo > hi) {
                DCELL tmp = lo;

                lo = hi;
                hi = tmp;
            }
            res[i] = lo + x * (hi - lo);
        }
        return 0;
    }
    default:
        return E_INV_TYPE;
    }
}


",
		kind:   sym_large,
	},
	"bigtriangledown": {
		char:   "▽",
		entity: "▽",
		kind:   sym_other,
	},
	"bigtriangleup": {
		char:   "△",
		entity: "△",
		kind:   sym_other,
	},
	"biguplus": {
		char:   "⨄",
		entity: "⨄",
		kind:   sym_large,
	},
	"bigvee": {
		char:   "⋁",
		entity: "⋁",
		kind:   sym_large,
	},
	"bigwedge": {
		char:   "⋀",
		entity: "⋀",
		kind:   sym_large,
	},
	"bkarow": {
		char:   "⤍",
		entity: "⤍",
		kind:   sym_other,
	},
	"blacklozenge": {
		char:   "⧫",
		entity: "⧫",
		kind:   sym_other,
	},
	"blacksquare": {
		char:   "▪",
		entity: "▪",
		kind:   sym_other,
	},
	"blacktriangle": {
		char:   "▴",
		entity: "▴",
		kind:   sym_other,
	},
	"blacktriangledown": {
		char:   "▾",
		entity: "▾",
		kind:   sym_other,
	},
	"blacktriangleleft": {
		char:   "◂",
		entity: "◂",
		kind:   sym_other,
	},
	"blacktriangleright": {
		char:   "▸",
		entity: "▸",
		kind:   sym_other,
	},
	"bowtie": {
		char:   "⋈",
		entity: "⋈",
		kind:   sym_relation,
	},
	"boxast": {
		char:   "⧆",
		entity: "&astb;",
		kind:   sym_other,
	},
	"boxbslash": {
		char:   "⧅",
		entity: "⧅",
		kind:   sym_other,
	},
	"boxcircle": {
		char:   "⧇",
		entity: "&cirb;",
		kind:   sym_other,
	},
	"boxdiag": {
		char:   "⧄",
		entity: "⧄",
		kind:   sym_other,
	},
	"boxdot": {
		char:   "⊡",
		entity: "⊡",
		kind:   sym_binaryop,
	},
	"boxminus": {
		char:   "⊟",
		entity: "⊟",
		kind:   sym_binaryop,
	},
	"boxplus": {
		char:   "⊞",
		entity: "⊞",
		kind:   sym_binaryop,
	},
	"boxtimes": {
		char:   "⊠",
		entity: "⊠",
		kind:   sym_binaryop,
	},
	"btimes": {
		char:   "⨲",
		entity: "&btimes;",
		kind:   sym_binaryop,
	},
	"bullet": {
		char:   "•",
		entity: "•",
		kind:   sym_binaryop,
	},
	"bumpeq": {
		char:   "≏",
		entity: "≏",
		kind:   sym_relation,
	},
	"bumpeqq": {
		char:   "⪮",
		entity: "⪮",
		kind:   sym_relation,
	},


		stream_EQUAL.add(EQUAL44);

					pushFollow(FOLLOW_phrase_in_propertyQuery665);
					phrase45=phrase();
					state._fsp--;

					stream_phrase.add(phrase45.getTree());
					// C:\\data\\workspace201903\\catma\\grammars\\ast\\CatmaQuery.g:200:26: ( VALUE EQUAL phrase )?
					int alt9=2;
					int LA9_0 = input.LA(1);
					if ( (LA9_0==VALUE) ) {
						alt9=1;
					}
					switch (alt9) {
						case 1 :
							// C:\\data\\workspace201903\\catma\\grammars\\ast\\CatmaQuery.g:200:27: VALUE EQUAL phrase
							{
							VALUE46=(Token)match(input,VALUE,FOLLOW_VALUE_in_propertyQuery668);
							stream_VALUE.add(VALUE46);

							EQUAL47=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_propertyQuery670);
							stream_EQUAL.add(EQUAL47);

							pushFollow(FOLLOW_phrase_in_propertyQuery672);
							phrase48=phrase();
							state._fsp--;

							stream_phrase.add(phrase48.getTree());
							}
							break;

					}

					// AST REWRITE
					// elements: phrase, phrase
					// token labels:
					// rule labels: retval
					// token list labels:
					// rule list labels:
					// wildcard labels:
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 200:48: -> ^( ND_PROPERTY phrase ( phrase )? )
					{
						// C:\\data\\workspace201903\\catma\\grammars\\ast\\CatmaQuery.g:200:51: ^( ND_PROPERTY phrase ( phrase )? )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ND_PROPERTY, "ND_PROPERTY"), root_1);
						adaptor.addChild(root_1, stream_phrase.nextTree());
						// C:\\data\\workspace201903\\catma\\grammars\\ast\\CatmaQuery.g:200:72: ( phrase )?
						if ( stream_phrase.hasNext() ) {
							adaptor.addChild(root_1, stream_phrase.nextTree());
						}
						stream_phrase.reset();

						adaptor.addChild(root_0, root_1);
						}

					}

					retval.tree = root_0;

					}
					break;
				case 2 :
					// C:\\data\\workspace201903\\catma\\grammars\\ast\\CatmaQuery.g:201:4: TAG EQUAL phrase PROPERTY EQUAL phrase ( VALUE EQUAL phrase )?
					{
					TAG49=(Token)match(input,TAG,FOLLOW_TAG_in_propertyQuery691);
					stream_TAG.add(TAG49);

					EQUAL50=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_propertyQuery693);
					stream_EQUAL.add(EQUAL50);

					pushFollow(FOLLOW_phrase_in_propertyQuery695);
					phrase51=phrase();
					state._fsp--;

					stream_phrase.add(phrase51.getTree());
					PROPERTY52=(Token)match(input,PROPERTY,FOLLOW_PROPERTY_in_propertyQuery697);
					stream_PROPERTY.add(PROPERTY52);

					EQUAL53=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_propertyQuery699);
					stream_EQUAL.add(EQUAL53);

					pushFollow(FOLLOW_phrase_in_propertyQuery701);
					phrase54=phrase();
					state._fsp--;

					stream_phrase.add(phrase54.getTree());
					// C:\\data\\workspace201903\\catma\\grammars\\ast\\Cat


r3, r4, r5, r6, r7, lr}
	sub sp, sp, #0x18
	mov r6, r1
	mov r7, r0
	mov r5, r2
	add r1, sp, #8
	mov r0, #0
	mov r2, #0x10
	mov r4, r3
	bl MIi_CpuClear32
	ldrh ip, [sp, #0x34]
	mov r0, #3
	str r0, [sp, #8]
	ldrh lr, [sp, #0x30]
	strh ip, [sp, #0xc]
	strh ip, [sp, #0xe]
	mov r0, r7
	mov r1, r6
	mov r2, r5
	mov r3, r4
	add ip, sp, #8
	str lr, [sp]
	str ip, [sp, #4]
	bl WMi_StartMP
	add sp, sp, #0x18
	ldmia sp!, {r3, r4, r5, r6, r7, pc}
	arm_func_end WM_StartMP

	arm_func_start WM_SetMPDataToPortEx
WM_SetMPDataToPortEx: ; 0x020DFD7C
	stmdb sp!, {r4, r5, r6, r7, r8, sb, lr}
	sub sp, sp, #0x14
	mov sb, r0
	mov r8, r1
	mov r7, r2
	mov r6, r3
	mov r4, #1
	bl WMi_GetSystemWork
	ldr r5, [r0, #4]
	mov r0, #2
	mov r1, #9
	mov r2, #0xa
	bl WMi_CheckStateEx
	cmp r0, #0
	addne sp, sp, #0x14
	ldmneia sp!, {r4, r5, r6, r7, r8, sb, pc}
	add r0, r5, #0x188
	mov r1, #2
	bl DC_InvalidateRange
	add r0, r5, #0x100
	ldrh r0, [r0, #0x88]
	cmp r0, #0
	bne _020DFDFC
	add r0, r5, #0x82
	add r0, r0, #0x100
	mov r1, #2
	bl DC_InvalidateRange
	add r2, r5, #0x100
	add r0, r5, #0x86
	mov r1, #2
	ldrh r4, [r2, #0x82]
	bl DC_InvalidateRange
_020DFDFC:
	cmp r7, #0
	addeq sp, sp, #0x14
	moveq r0, #6
	ldmeqia sp!, {r4, r5, r6, r7, r8, sb, pc}
	cmp r4, #0
	addeq sp, sp, #0x14
	moveq r0, #7
	ldmeqia sp!, {r4, r5, r6, r7, r8, sb, pc}
	add r0, r5, #0x7c
	mov r1, #2
	bl DC_InvalidateRange
	ldr r0, [r5, #0x7c]
	cmp r7, r0
	addeq sp, sp, #0x14
	moveq r0, #6
	ldmeqia sp!, {r4, r5, r6, r7, r8, sb, pc}
	cmp r6, #0x200
	addhi sp, sp, #0x14
	movhi r0, #6
	ldmhiia sp!, {r4, r5, r6, r7, r8, sb, pc}
	cmp r6, #0
	addeq sp, sp, #0x14
	moveq r0, #6
	ldmeqia


} block '${2}' to storage class '${3}' conflicts with storage class setting for external data object associated with that outport. Change one of the specifications to '${4}'.",InvalidIOportDataObjectConfigurationFcnComponent:"Model '${0}' is linked to a shared Embedded Coder Dictionary that defines a service code interface configuration and code mapping for ${1} block '${2}' conflicts with storage class setting for external data object associated with that inport block. Change external data object storage class to 'Auto' or remove external data object.",InvalidIdentifierForData:"For model '${0}', identifier '${1}' specified for ${2} '${3}' is not valid. Valid identifiers start with an alphabetic or '_' character, followed by alphanumeric or '_' characters. Identifiers starting with 'rt' are reserved unless you set model configuration parameter 'rt prefix for identifiers' to 'warning' or 'none'.",InvalidInportDataMappingDueToMessage:"\u5BF9\u4E8E\u6A21\u578B '${0}'\uFF0C\u4ECE '${1}' \u5230 ${2} '${3}' \u7684\u9ED8\u8BA4\u4EE3\u7801\u6620\u5C04\u89E3\u6790\u4E3A Embedded Coder \u5B57\u5178\u4E2D\u5BF9 '${4}' \u65E0\u6548\u7684\u5B9A\u4E49\uFF0C\u56E0\u4E3A\u6A21\u578B\u5305\u542B\u53D1\u9001\u6D88\u606F\u7684\u6839\u7EA7\u8F93\u5165\u7AEF\u53E3\u3002\u8BF7\u5728\u4EE3\u7801\u6620\u5C04\u4E2D\u5C06 '${6}' \u8BBE\u7F6E\u4E3A '${5}'\u3002",InvalidInputError:'\u4E3A "${0}" \u5C5E\u6027\u6307\u5B9A\u7684\u503C\u65E0\u6548\u3002',InvalidInternalDataMappingDueToMessage:"\u5BF9\u4E8E\u6A21\u578B '${0}'\uFF0C\u4ECE '${1}' \u5230 ${2} '${3}' \u7684\u9ED8\u8BA4\u4EE3\u7801\u6620\u5C04\u89E3\u6790\u4E3A Embedded Coder \u5B57\u5178\u4E2D\u5BF9 '${4}' \u65E0\u6548\u7684\u5B9A\u4E49\uFF0C\u56E0\u4E3A\u6A21\u578B\u5305\u542B\u53D1\u9001\u6D88\u606F\u7684\u6839\u7EA7\u8F93\u5165\u7AEF\u53E3\u6216\u63A5\u6536\u6D88\u606F\u7684\u6839\u7EA7\u8F93\u51FA\u7AEF\u53E3\u3002\u8BF7\u5728\u4EE3\u7801\u6620\u5C04\u4E2D\u5C06 '${6}' \u8BBE\u7F6E\u4E3A '${5}'\u3002",InvalidMaxMsgNumValue:"\u6570\u636E\u7C7B\u578B\u65E0\u6548\u3002\u5BB9\u91CF\u5FC5\u987B\u4E3A\u65E0\u7B26\u53F7\u6574\u6570\u3002",InvalidOutportDataMappingDueToMessage:"\u5BF9\u4E8E\u6A21\u578B '${0}'\uFF0C\u4ECE '${1}' \u5230 ${2} '${3}' \u7684\u9ED8\u8BA4\u4EE3\u7801\u6620\u5C04\u89E3\u6790\u4E3A Embedded Coder


7F9FCE5AF196, ___xmlSpaces_3)); }
	inline Stack_t37723B68CC4FFD95F0F3D06A5D42D7DEE7569643 * get_xmlSpaces_3() const { return ___xmlSpaces_3; }
	inline Stack_t37723B68CC4FFD95F0F3D06A5D42D7DEE7569643 ** get_address_of_xmlSpaces_3() { return &___xmlSpaces_3; }
	inline void set_xmlSpaces_3(Stack_t37723B68CC4FFD95F0F3D06A5D42D7DEE7569643 * value)
	{
		___xmlSpaces_3 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___xmlSpaces_3), (void*)value);
	}

	inline static int32_t get_offset_of_xmlSpace_4() { return static_cast<int32_t>(offsetof(SmallXmlParser_t4FF09686422594EF19E2CA54CB877F9FCE5AF196, ___xmlSpace_4)); }
	inline String_t* get_xmlSpace_4() const { return ___xmlSpace_4; }
	inline String_t** get_address_of_xmlSpace_4() { return &___xmlSpace_4; }
	inline void set_xmlSpace_4(String_t* value)
	{
		___xmlSpace_4 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___xmlSpace_4), (void*)value);
	}

	inline static int32_t get_offset_of_buffer_5() { return static_cast<int32_t>(offsetof(SmallXmlParser_t4FF09686422594EF19E2CA54CB877F9FCE5AF196, ___buffer_5)); }
	inline StringBuilder_t * get_buffer_5() const { return ___buffer_5; }
	inline StringBuilder_t ** get_address_of_buffer_5() { return &___buffer_5; }
	inline void set_buffer_5(StringBuilder_t * value)
	{
		___buffer_5 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___buffer_5), (void*)value);
	}

	inline static int32_t get_offset_of_nameBuffer_6() { return static_cast<int32_t>(offsetof(SmallXmlParser_t4FF09686422594EF19E2CA54CB877F9FCE5AF196, ___nameBuffer_6)); }
	inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_nameBuffer_6() const { return ___nameBuffer_6; }
	inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_nameBuffer_6() { return &___nameBuffer_6; }
	inline void set_nameBuffer_6(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
	{
		___nameBuffer_6 = value;
		Il2CppCodeGenWriteBarrier((void**)(&___nameBuffer_6), (void*)value);
	}

	inline static int32_t get_offset_of_isWhitespace_7() { return static_cast<int32_t>(offsetof(SmallXmlParser_t4FF09686422594EF19E2CA54CB877F9FCE5AF196, ___isWhitespace_7)); }
	inline bool get_isWhitespace_7() const { return ___isWhitespace_7; }
	inline bool* get_address_of_isWhitespace_7() { return &___isWhitespace_7; }
	inline void set_isWhitespace_7(bool value)
	{
		___isWhitespace_7 = value;
	}

	inline static int32_t get_offset_of


using System;
using System.Collections.Generic;
using System.IO;

namespace NBehave.EventListeners
{
    public class TextWriterEventListener : EventListener, IDisposable
    {
        private readonly TextWriter writer;

        private readonly List<ScenarioResult> allResults = new List<ScenarioResult>();

        private bool disposed;

        public TextWriterEventListener(TextWriter writer)
        {
            this.writer = writer;
        }

        void IDisposable.Dispose()
        {
            Dispose(true);
        }

        public override void FeatureStarted(Feature feature)
        {
            writer.WriteLine("Feature: {0}", feature.Title);
            writer.WriteLine(feature.Narrative);
        }

        public override void ScenarioStarted(string scenarioTitle)
        {
            writer.WriteLine("Scenario: {0}", scenarioTitle);
        }

        public override void RunFinished()
        {
            WriteSummary();
            writer.Flush();


 write_to_file("out/cpu/1d/magnetization_with_field.dat", magnetization_history);

    return 0;
}
#include <iostream>
#include <vector>
#include <cmath>
#include <random>
#include <fstream>
#include <mpi.h>
#include <filesystem>
#include <chrono>
#include <algorithm>

using namespace std::chrono;

// Parameters for the simulation
const int L = 64;              // Global lattice size (L x L x L grid)
const int num_steps = 1000;     // Number of Monte Carlo steps
const double J = 1;          // Interaction strength
const double T = 2.5 ;          // Temperature (in units of k_B)
const double h = 0;            // External magnetic field
const int save_interval = 100;   // Interval to save the lattice

// RNG and exp table
const int MAX_ENERGY = 24;  // Max possible energy change for 6 neighbors
std::vector<double> exp_table;

// Add initialization before main loop
void init_exp_table() {
    exp_table.resize(MAX_ENERGY + 1);
    for (int dE = 0; dE <= MAX_ENERGY; dE += 4) {
        exp_table[dE] = exp(-dE / T);
    }
}

// Thread-local RNG
thread_local std::mt19937 gen(std::random_device{}());
thread_local std::uniform_real_distribution<> dis(0.0, 1.0);

void init_rng(int rank) {
    gen.seed(std::random_device{}() + rank);
}

// Timer utility
class Timer {

public:
    void start() { start_time = high_resolution_clock::now(); }
    void stop() { end_time = high_resolution_clock::now(); elapsed += duration_cast<duration<double>>(end_time - start_time).count(); }
    double get_elapsed() { return elapsed; }
    void reset() { elapsed = 0.0; }

private:
    high_resolution_clock::time_point start_time, end_time;
    double elapsed = 0.0;
};

// Add after Timer class definition
struct PerformanceCounters {
    long long total_flops = 0;
    long long total_bytes = 0;
    long long total_comm_bytes = 0;  // Track communication separately

    void add_site_update() {
        // Same computation counts as serial version
        total_flops += 15;
        total_bytes += 32;
    }

    void add_halo_exchange(int local_y, int local_z) {
        // Count bytes transferred during halo exchange:
        // 2 faces per dimension * 3 dimensions * size of each face
        int face_xy = local_y * local_z * sizeof(int);
        int face_xz = local_y * local_z * sizeof(int);
        int face_yz = local_y * local_z * sizeof(int);
        total_comm_bytes += 2 * (face_xy + face_xz + face_yz);
    }

    void print_stats(double elapsed_time, MPI_Comm comm) {
        int rank, num_procs;
        MPI_Comm_rank(comm, &rank);
        MPI_Comm_size(comm, &num_procs);

        // Gather statistics from all processes
        long long global_flops = 0, global_bytes = 0, global_comm_bytes = 0;
        MPI_Reduce(&total_flops, &global_flops, 1, MPI_LONG_LONG, MPI_SUM, 0, comm);
        MPI_Reduce(&total_bytes, &global_bytes, 1, MPI_LONG_LONG, MPI_SUM, 0, comm);
        MPI_Reduce(&total_comm_bytes, &global_comm_bytes, 1, MPI_LONG_LONG, MPI_SUM, 0, comm);

        if (rank == 0) {
            double gflops = static_cast<double>(global_flops) / (elapsed_time * 1e9);
            double bandwidth = static_cast<double>(global_bytes) / (el


 right, var(--glyph-color-active), var(--glyph-color-active)) no-repeat 1px 0;

    pointer-events: none;
}

body.window-inactive .timeline-overview-graph.rendering-frame > .frame-marker {
    background-image: linear-gradient(to right, hsl(0, 0%, 60%), hsl(0, 0%, 60%));
}
/*
 * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

.object-tree {
    position: relative;
    display: inline-block;
    color: var(--text-color);
    font-family: Menlo, monospace;
    font-size: 11px;
}

.object-tree > :matches(.title, .object-preview)::before {
    display: inline-block;

    vertical-align: baseline;
    margin-bottom: -2px;
    margin-right: 2px;

    width: 13px;
    height: 13px;

    background-image: url(../Images/DisclosureTriangles.svg#closed-normal);
    background-size: 13px 13px;
    background-repeat: no-repeat;
    background-position: center;

    content: "";
}

.object-tree:not(.lossless-preview) > :matches(.title, .object-preview) {
    margin-left: 0;
}

.object-tree.expanded > :matches(.title, .object-preview)::before {
    background-image: url(../Images/DisclosureTriangles.svg#open-normal);
}

.object-tree.properties-only > :matches(.title, .object-preview) {
    display: none;
}

.object-tree.expanded .object-preview {
    font-style: normal;
}

.object-tree.expanded > .title {
    line-height: 16px;
}

.object-tree.lossless-preview > :matches(.title, .object-preview)::before {
    background: none;
    width: 0px;
}

.object-tree .tree-outline.object {
    display: none;
}

.object-tree.expanded > .tree-outline.object {
    display: block;
}

.tree-outline.object {
    margin: 0;
    padding: 0 6px 2px;
    list-style: none;
    min-height: 18px;
    outline: none;
}

.object-tree .tree-outline.object.compact {
    margin-top: 1px;
}

.tree-outline.object .item,
.object-tree.properties-only .tree-outline.object {
    padding-left: 0;
}

.object-tree.properties-only .object-tree-property .property-name {
    opacity: 1;
}

.object-tree.properties-only.json-only .object-tree-property.prototype-property,
.object-tree.properties-only.json-only .object-tree-property.prototype-property + .children {
    display: none;
}

.tree-outline.object li {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    -web


hodImplOptions.AggressiveInlining), TargetedPatchingOptOut("Inline across assemplies")]
        public static byte ReadByte(this Stream data)
        {
            Debug.Assert(data.CanRead);

            byte[] scratch = EnsureScratch();

            data.Read(scratch, 0, 1);

            return scratch.ReadByte(0);
        }

#if NETSTANDARD2_1_OR_GREATER

        // only implemented for LE because we don't know what the layout of the struct/object is
        // so there is no way to safely swap the endianness
        public static int ReadCountLE<T>(this Stream data, Span<T> output) where T : unmanaged
        {
            Debug.Assert(data.CanRead);
            var bytes = MemoryMarshal.AsBytes(output);
            return data.Read(bytes);
        }

        public static int ReadCountLE<T>(this Stream data, T[] output, int count) where T : unmanaged
        {
            Debug.Assert(data.CanRead);
            var bytes = MemoryMarshal.AsBytes(output.AsSpan(0, count));
            return data.Read(bytes);
        }
#endif
    }
}


admin?;
    let invites = queries.invite.get_invites().await?;

    ok(invites)
}

#[delete("/<invite_code>")]
async fn delete_invite(
    admin: Result<AdminGuard<'_>, ApiError>,
    queries: &State<Queries>,
    invite_code: String,
) -> ApiResult<()> {
    admin?;
    queries.invite.delete_invite(&invite_code).await?;

    ok(())
}

#[post("/")]
async fn create_invite(
    admin: Result<AdminGuard<'_>, ApiError>,
    queries: &State<Queries>,
) -> ApiResult<Invite> {
    admin?;
    let invite = queries.invite.create_invite().await?;

    ok(invite)
}

pub fn invite_routes() -> Vec<Route> {
    routes![invites, delete_invite, create_invite]
}
use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use std::slice::Iter;
use std::sync::Arc;

use crate::compiler::{
    Arg, CommandInfo, CompilationArgs, CompilationTask, InputKind, OutputKind, Scope,
};

enum ParamValue<T> {
    None,
    Single(T),
    Many(Vec<T>),
}

pub fn create_tasks(command: CommandInfo, args: &[String]) -> Result<Vec<CompilationTask>, String> {
    if args.iter().any(|v| v == "--analyze") {
        // Support only compilation steps
        return Ok(Vec::new());
    }
    if args
        .iter()
        .find(|v| match v as &str {
            "-c" => true,
            _ => false,
        })
        .is_none()
    {
        // Support only compilation steps
        return Ok(Vec::new());
    }
    let parsed_args = parse_arguments(args)?;
    // Source file name.
    let input_sources: Vec<PathBuf> = parsed_args
        .iter()
        .filter_map(|arg| match arg {
            Arg::Input {
                ref kind, ref file, ..
            } if *kind == InputKind::Source => Some(Path::new(file).to_path_buf()),
            _ => None,
        })
        .collect();
    if input_sources.is_empty() {
        return Err("Can't find source file path.".to_string());
    }
    // Precompiled header file name.
    let input_precompiled = match find_param(&parsed_args, |arg: &Arg| -> Option<PathBuf> {
        match arg {
            Arg::Input {
                ref kind, ref file, ..
            } if *kind == InputKind::Precompiled => Some(Path::new(file).to_path_buf()),
            _ => None,
        }
    }) {
        ParamValue::None => None,
        ParamValue::Single(v) => Some(v),
        ParamValue::Many(v) => {
            return Err(format!("Found too many precompiled header files: {:?}", v));
        }
    };
    // Precompiled header file name.
    let marker_precompiled = parsed_args
        .iter()
        .filter_map(|arg| match arg {
            Arg::Param {
                ref flag,
                ref value,
                ..
            } if *flag == "include" => Some(value.clone()),
            _ => None,
        })
        .next();
    // Output object file name.
    let output_object = match find_param(&parsed_args, |arg: &Arg| -> Option<PathBuf> {
        match arg {
            Arg::Output {
                ref kind, ref file, ..
            } if *kind == OutputKind::Object => Some(Path::new(file).to_path_buf()),
            _ => None,
        }
    }) {
        ParamValue::None => None,
        ParamValue::Single(v) => {
            if input_sources.len() > 1 {
                return Err("Cannot specify -o when generating multiple output files".to_string());
            }
            Some(v)
        }
        ParamValue::Many(v) => {
            return Err(format!("Found too many output object files: {:?}", v));
        }
    };
    // L


    required this.isReceiveMoneyAlbilad,
    required this.isReceiveMoneyWesternUnion,
  });

  factory ReceiveMoneyFeatureModel.fromRemoteConfig(
      FirebaseRemoteConfig remoteConfig) {
    return ReceiveMoneyFeatureModel(
      isReceiveMoneyShareMyQr:
          remoteConfig.getBool(receive_money_share_my_qr),
      isReceiveMoneyCebuana: remoteConfig.getBool(receive_money_cebuana),
      isReceiveMoneyQuicks: remoteConfig.getBool(receive_money_quicks),
      isReceiveMoneyAlbilad: remoteConfig.getBool(receive_money_albilad),
      isReceiveMoneyWesternUnion:
          remoteConfig.getBool(receive_money_western_union),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      receive_money_share_my_qr: isReceiveMoneyShareMyQr,
      receive_money_cebuana: isReceiveMoneyCebuana,
      receive_money_quicks: isReceiveMoneyQuicks,
      receive_money_albilad: isReceiveMoneyAlbilad,
      receive_money_western_union: isReceiveMoneyWesternUnion,
    };
  }
}
import 'package:flutter/material.dart';
import 'package:flutter_naver_login/flutter_naver_login.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'AuthService.dart';
import 'package:madsports/UserMoreInfo.dart';

class LoginPage extends StatefulWidget {
  @override
  _LoginPageState createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
  String test = '3000';

  void navigateToMoreUserInfo(String email, String? name) async {
    if (mounted) {
      await Navigator.pushReplacement(
        context,
        MaterialPageRoute(
          builder: (context) => MoreUserInfo(
            email: email,
            base_name: name,
            onUpdate: () {
              setState(() {});
            },
          ),
        ),
      );
    }
  }

  Future<void> signInWithNaver() async {

    final url = Uri.parse('http://172.10.7.43:80/auth/google-login');
    final NaverLoginResult result = await FlutterNaverLogin.logIn();
    if (result.status == NaverLoginStatus.loggedIn) {
      // Update login platform using AuthService
      AuthService.saveToken(result.accessToken?.accessToken ?? ''); // Save token
      AuthService.saveUserInfo({
        'id': result.account.id ?? '',
        'email': result.account.email ?? '',
        'name': result.account.name ?? '',
      }, 'naver'); // Save user info

      var res = await http.post(
          url,
          headers: {'Content-Type': 'application/json'},
          body: json.encode({
            'email': result.account.email,  // send naver address to server
            'username': result.account.name,  // send naver user name to server
          })
      );

      if (res.statusCode == 200) {
        var data = json.decode(res.body);
        var flag = data['flag'];
        if (flag == 1) { // 새로운 계정인지 확인
          print("new account");
          if(mounted){
            navigateToMoreUserInfo(result.account.email, result.account.name);
          }
        } else { // 기존 계정인지 확인
          print("existing account");

          // 비동기 함수 내에서 context 사용을 피하기 위해 Future.delayed 사용
          await Future.delayed(Duration.ze


func BenchmarkLargeModNegNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromBytes(modulus2048())
	_benchmarkModNegNat(m, b)
}

func BenchmarkMulNat(b *testing.B) {
	b.StopTimer()

	var x Nat
	x.SetBytes(ones())

	b.StartTimer()
	for n := 0; n < b.N; n++ {
		var z Nat
		z.Mul(&x, &x, _SIZE*2*8)
		resultNat = z
	}
}

func _benchmarkModMulNat(m *Modulus, b *testing.B) {
	b.StopTimer()

	x := new(Nat).SetBytes(ones())
	x.Mod(x, m)

	b.StartTimer()
	for n := 0; n < b.N; n++ {
		var z Nat
		z.ModMul(x, x, m)
		resultNat = z
	}
}

func BenchmarkModMulNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromUint64(13)
	_benchmarkModMulNat(m, b)
}

func BenchmarkLargeModMulNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromBytes(modulus2048())
	_benchmarkModMulNat(m, b)
}

func BenchmarkLargeModMulNatEven(b *testing.B) {
	b.StopTimer()

	m := ModulusFromBytes(modulus2048Even())
	_benchmarkModMulNat(m, b)
}

func _benchmarkModNat(m *Modulus, b *testing.B) {
	b.StopTimer()

	x := new(Nat).SetBytes(doubleOnes())

	b.StartTimer()
	for n := 0; n < b.N; n++ {
		var z Nat
		z.Mod(x, m)
		resultNat = z
	}
}

func BenchmarkModNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromUint64(13)
	_benchmarkModNat(m, b)
}

func BenchmarkLargeModNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromBytes(modulus2048())
	_benchmarkModNat(m, b)
}

func _benchmarkModInverseNat(m *Modulus, b *testing.B) {
	b.StopTimer()

	x := new(Nat).SetBytes(ones())
	x.Mod(x, m)

	b.StartTimer()
	for n := 0; n < b.N; n++ {
		var z Nat
		z.ModInverse(x, m)
		resultNat = z
	}
}

func BenchmarkModInverseNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromUint64(13)
	_benchmarkModInverseNat(m, b)
}

func BenchmarkLargeModInverseNat(b *testing.B) {
	b.StopTimer()

	m := ModulusFromBytes(modulus2048())
	_benchmarkModInverseNat(m, b)
}

func _benchmarkModInverseEvenNat(m *Modulus, b *testing.B) {
	b.StopTimer()

	var x Nat
	x.SetBytes(ones())

	b.StartTimer()
	for n := 0; n < b.N; n++ {
		var z Nat
		z.ModInverse(&x, m)
		resultNat = z
	}
}

func BenchmarkModInverseEvenNat(b *testing.B) {
	b.StopTimer()
	m := ModulusFromUint64(14)
	_benchmarkModInverseEvenNat(m, b)
}

func BenchmarkLargeModInverseEvenNat(b *testing.B


BL")]
    Bl,
    #[serde(rename = "BM")]
    Bm,
    #[serde(rename = "BN")]
    Bn,
    #[serde(rename = "BO")]
    Bo,
    #[serde(rename = "BQ")]
    Bq,
    #[serde(rename = "BR")]
    Br,
    #[serde(rename = "BS")]
    Bs,
    #[serde(rename = "BT")]
    Bt,
    #[serde(rename = "BV")]
    Bv,
    #[serde(rename = "BW")]
    Bw,
    #[serde(rename = "BY")]
    By,
    #[serde(rename = "BZ")]
    Bz,
    #[serde(rename = "CA")]
    Ca,
    #[serde(rename = "CD")]
    Cd,
    #[serde(rename = "CF")]
    Cf,
    #[serde(rename = "CG")]
    Cg,
    #[serde(rename = "CH")]
    Ch,
    #[serde(rename = "CI")]
    Ci,
    #[serde(rename = "CK")]
    Ck,
    #[serde(rename = "CL")]
    Cl,
    #[serde(rename = "CM")]
    Cm,
    #[serde(rename = "CN")]
    Cn,
    #[serde(rename = "CO")]
    Co,
    #[serde(rename = "CR")]
    Cr,
    #[serde(rename = "CV")]
    Cv,
    #[serde(rename = "CW")]
    Cw,
    #[serde(rename = "CY")]
    Cy,
    #[serde(rename = "CZ")]
    Cz,
    #[serde(rename = "DE")]
    De,
    #[serde(rename = "DJ")]
    Dj,
    #[serde(rename = "DK")]
    Dk,
    #[serde(rename = "DM")]
    Dm,
    #[serde(rename = "DO")]
    Do,
    #[serde(rename = "DZ")]
    Dz,
    #[serde(rename = "EC")]
    Ec,
    #[serde(rename = "EE")]
    Ee,
    #[serde(rename = "EG")]
    Eg,
    #[serde(rename = "EH")]
    Eh,
    #[serde(rename = "ER")]
    Er,
    #[serde(rename = "ES")]
    Es,
    #[serde(rename = "ET")]
    Et,
    #[serde(rename = "FI")]
    Fi,
    #[serde(rename = "FJ")]
    Fj,
    #[serde(rename = "FK")]
    Fk,
    #[serde(rename = "FO")]
    Fo,
    #[serde(rename = "FR")]
    Fr,
    #[serde(rename = "GA")]
    Ga,
    #[serde(rename = "GB")]
    Gb,
    #[serde(rename = "GD")]
    Gd,
    #[serde(rename = "GE")]
    Ge,
    #[serde(rename = "GF")]
    Gf,
    #[serde(rename = "GG")]
    Gg,
    #[serde(rename = "GH")]
    Gh,
    #[serde(rename = "GI")]
    Gi,
    #[serde(rename = "GL")]
    Gl,
    #[serde(rename = "GM")]
    Gm,
    #[serde(rename = "GN")]
    Gn,
    #[serde(renam


_ABS(probe)
	QUAD_ABS(initialize)
	QUAD_ABS(disconnect)
 probe:
	QUAD_ABS(kmod_func1) # 50BD4 - struct func {function_ptr, = kmod_func1
        .quad USER_DATA #                      user_data?}

 initialize:
	QUAD_ABS(kmod_func2) # 50C1C - struct func {function_ptr, = kmod_func2
        .quad USER_DATA #                      user_data?}
 disconnect:
	QUAD_ABS(kmod_func3) # 50C78 - struct func {function_ptr, = kmod_func3
        .quad USER_DATA #                      user_data?}
 initialized_flag:
        QUAD_ABS(set_initialized_flag) # 50C84 - ptr to set_initialized_flag (unused)
        .quad USER_DATA #                      user_data?}

# ---------------------------------------------------------------------------

#00050BD4

 kmod_func1:

	stdu    %sp, -0x80(%sp)
	mflr    %r0
	std     %r0, 0x90(%sp)
	li      %r4, 0
	li      %r5, 1
	bl      ABS(unk_D2998)
	lwz     %r5, 8(%r3)
	li      %r3, 0
	lis     %r4, 0xAAAA # 0xAAAAC0DE
	ori     %r4, %r4, 0xC0DE # 0xAAAAC0DE
	cmplw   %r4, %r5
	beq     kmod_func1_ret
	li      %r3, -1

 kmod_func1_ret:

	extsw   %r3, %r3
	ld      %r0, 0x90(%sp)
	mtlr    %r0
	addi    %sp, %sp, 0x80
	blr

# ---------------------------------------------------------------------------
# 00050C1C

 kmod_func2:
	stdu    %sp, -0x80(%sp)
	mflr    %r0
	std     %r0, 0x90(%sp)
	li      %r4, 0
	bl      ABS(unk_D29C4)
	addi    %r4, %sp, 0x70
	li      %r5, 0
	std     %r5, 0(%r4)
	li      %r6, 0x21AA
	sth     %r6, 0(%r4)
	li      %r6, 0
	sth     %r6, 6(%r4)
	MEM_BASE(%r6)
	LOADI_LABEL(%r6, initialized_flag)
	li      %r7, 0
	bl      ABS(unk_D292C)
	li      %r3, 0
	ld      %r0, 0x90(%sp)
	mtlr    %r0
	addi    %sp, %sp, 0x80
	blr

# ---------------------------------------------------------------------------

# 00050C78
 kmod_func3:

	li      %r3, 0
	blr

    # li      %r11, 0xFF
    # sc	1

# ---------------------------------------------------------------------------
# 00050C84

set_initialized_flag:

	cmpwi   %r3, 0
	bne     locret_50CA4

	MEM_BASE(%r3)
	LOADI_LABEL(%r3, GAME_NAME_PTR)
	li      %r4, 1
	stw     %r4, 0x10(%r3)

 locret_50CA4:

        blr

#endif

# ---------------------------------------------------------------------------
# 00050CA8

Syscall_36_activate_virtual_bluray_drive:

	stdu    %sp, -0xD0(%sp)
	mflr    %r0
	std     %r0, 0xE0(%sp)
	std     %r31, 0xC8(%sp)

    mr      %r31, %r3

    MEM_BASE(%r4)
	LOADI_LABEL(%r4, aDev_bdvd); // test if you are using "/dev_bdvd" exactly
	li      %r5, 10


-384 384 384 0 0 1 643.712-282.88z"})]))}}),ue=le,pe=a({name:"Refresh",__name:"refresh",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),oe=pe,ve=a({name:"Refrigerator",__name:"refrigerator",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M256 448h512V160a32 32 0 0 0-32-32H288a32 32 0 0 0-32 32zm0 64v352a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V512zm32-448h448a96 96 0 0 1 96 96v704a96 96 0 0 1-96 96H288a96 96 0 0 1-96-96V160a96 96 0 0 1 96-96m32 224h64v96h-64zm0 288h64v96h-64z"})]))}}),se=ve,ce=a({name:"RemoveFilled",__name:"remove-filled",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"})]))}}),ne=ce,he=a({name:"Remove",__name:"remove",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"}),e("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),ie=he,me=a({name:"Right",__name:"right",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M754.752 480H160a32 32 0 1 0 0 64h594.752L521.344 777.344a32 32 0 0 0 45.312 45.312l288-288a32 32 0 0 0 0-45.312l-288-288a32 32 0 1 0-45.312 45.312z"})]))}}),we=me,de=a({name:"ScaleToOriginal",__name:"scale-to-original",setup(r){return(l,u)=>(t(),_("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e("path",


#!/usr/bin/env python

# This small script subscribes to the FeedbackMsg message of teb_local_planner
# and plots the current velocity.
# publish_feedback must be turned on such that the planner publishes this information.
# Author: christoph.roesmann@tu-dortmund.de

import rospy, math
from teb_local_planner.msg import FeedbackMsg, TrajectoryMsg, TrajectoryPointMsg
from geometry_msgs.msg import PolygonStamped, Point32
import numpy as np
import matplotlib.pyplot as plotter

def feedback_callback(data):
  global trajectory

  if not data.trajectories: # empty
    trajectory = []
    return
  trajectory = data.trajectories[data.selected_trajectory_idx].trajectory

def plot_velocity_profile(fig, ax_v, ax_omega, t, v, omega):
  ax_v.cla()
  ax_v.grid()
  ax_v.set_ylabel('Trans. velocity [m/s]')
  ax_v.plot(t, v, '-bx')
  ax_omega.cla()
  ax_omega.grid()
  ax_omega.set_ylabel('Rot. velocity [rad/s]')
  ax_omega.set_xlabel('Time [s]')
  ax_omega.plot(t, omega, '-bx')
  fig.canvas.draw()

def velocity_plotter():
  global trajectory
  rospy.init_node("visualize_velocity_profile", anonymous=True)

  topic_name = "/test_optim_node/teb_feedback"
  rospy.Subscriber(topic_name, FeedbackMsg, feedback_callback, queue_size = 1) # define feedback topic here!

  rospy.loginfo("Visualizing velocity profile published on '%s'.",topic_name)
  rospy.loginfo("Make sure to enable rosparam 'publish_feedback' in the teb_local_planner.")

  # two subplots sharing the same t axis
  fig, (ax_v, ax_omega) = plotter.subplots(2, sharex=True)
  plotter.ion()
  plotter.show()

  r = rospy.Rate(2) # define rate here
  while not rospy.is_shutdown():

    t = []
    v = []
    omega = []

    for point in trajectory:
      t.append(point.time_from_start.to_sec())
      v.append(point.velocity.linear.x)
      omega.append(point.velocity.angular.z)

    plot_velocity_profile(fig, ax_v, ax_omega, np.asarray(t), np.asarray(v), np.asarray(omega))

    r.sleep()

if __name__ == '__main__':
  try:
    trajectory = []
    velocity_plotter()
  except rospy.ROSInterruptException:
    pass


ollBar.onmousedown = function (event) {
            event.preventDefault();
            let scrollBarOffsetX:any = event.offsetX
            if (scrollBarOffsetX < 0) {
                scrollBarOffsetX = 0;
            } else if (scrollBarOffsetX > (boxWidth+bar.offsetWidth/2)) {
                scrollBarOffsetX = boxWidth+bar.offsetWidth/2;
            }
            bar.style.left =  scrollBarOffsetX+'px'
            mask.style.width = scrollBarOffsetX+'px'
            scrollBar.onmouseup = function (e) {
                e.preventDefault();
                scrollBar.onmouseup = null
                //计算点击后的百分比
                let VolumeCountVal = parseInt(<any>(parseInt(scrollBarOffsetX)/(boxWidth+bar.offsetWidth/2)*100))
                //点击离开事件
                VolumeCountVal > 0 && self.setVolumeColor(false)
                //抛出音量值
                self.setVolumeCb(VolumeCountVal)
             }
        }
        //滑动选择 -touch模式
        // bar.onmousedown = function (event) {
        //     event.stopPropagation()
        //     event.preventDefault()
        //     return
        // }
        // bar.addEventListener('touchstart', function (e) {
        //     var ev = e || window.event;
        //     var touch = ev.targetTouches[0];
        //     console.log(ev,touch);
        //     // oL = touch.clientX - bar.offsetLeft;
        //     // oT = touch.clientY - bar.offsetTop;
        //     bar.addEventListener('touchmove', defaultEvent, false)

        // });
        // //阻止默认事件
        // function defaultEvent(e) {
        //     e.preventDefault();
        // }
        // bar.addEventListener('touchmove', function (e) {
        //     var touch = e.targetTouches[0];
        //     bar.style.left =(touch.clientX-15) + 'px';
        //     var documentEvent = event || window.event;
        //     that.style.left = documentEvent.clientX - leftVal + 'px';
        //     var val = parseInt(that.style.left); // 上面初始化过，所以这里可以直接操作行内样式
        //     if (val < 0) {
        //         that.style.left = 0;
        //     }
        //     else if (val > (boxWidth + self.bar.offsetWidth / 2)) {
        //         that.style.left = (boxWidth + self.bar.offsetWidth / 2) + 'px';
        //     }
        //     mask.style.width = that.style.left; //遮盖盒子的宽度
        // });
        // bar.addEventListener('touchend', function () {
            // let barStyleLeft = parseInt(bar.style.left)+''==='NaN'?scrollBar.offsetWidth/2:parseInt(bar.style.left)
        //     var VolumeCountVal = parseInt((barStyleLeft / (boxWidth + bar.offsetWidth / 2) * 100));
        //     //滑动离开事件
        //     //抛出音量值
        //     VolumeCountVal > 0 && self.setVolumeColor(false)
        //     self.setVolumeCb(VolumeCountVal);
        //     document.removeEventListener("touchmove", defaultEvent);
        // });

        //滑动选择-鼠标模式
        bar.onmousedown = function (event) {
            event.stopPropagation();
            var event = event || window.event;
            var leftVal = event.clientX -this.offsetLeft; //考虑多重盒子
            var that = this;
            document.onmousemove = function (event) {
                let documentEvent:


te.nodeSelector` and
`spec.template.tolerations`.

### EventSource POD Priority

Priority could be set through `spec.template.priorityClassName` or
`spec.template.priority`.

## Sensors

### Replicas

Sensors can run with HA by setting `spec.replicas` to a number `>1`, see more
detail [here](sensors/ha.md).

### Sensor POD Node Selection

Sensor POD `affinity`, `nodeSelector` and `tolerations` could also be set
through `spec.template.affinity`, `spec.template.nodeSelector` and
`spec.template.tolerations`.

### Sensor POD Priority

Priority could be set through `spec.template.priorityClassName` or
`spec.template.priority`.
# Developer Guide

## Setup your DEV environment

Argo Events is native to Kubernetes so you'll need a running Kubernetes cluster.
This guide includes steps for `Minikube` for local development, but if you have
another cluster you can ignore the Minikube specific step 3.

### Requirements

- Golang 1.20+
- Docker

### Installation & Setup

#### 1. Get the project

```
git clone git@github.com:argoproj/argo-events
cd argo-events
```

#### 2. Start Minikube and point Docker Client to Minikube's Docker Daemon

```
minikube start
eval $(minikube docker-env)
```

#### 3. Build the project

```
make build
```

### 4. Changing Types

If you're making a change to the `pkg/apis` package, please ensure you re-run
following command for code regeneration.

```
make codegen
```

### Deploying and testing your changes on a local dev cluster

Make sure you have a local dev cluster running and have the current kubeconfig context set to the local cluster as the following steps will use that to load the images and deploy the controller. The local dev cluster can be Minikube, Kind, or K3D.

#### 1. Building images

If you want a fresh build before building the container image, run the following commands to delete any existing binaries.

```
rm -rf dist
```

The following command will build the images and load/import it into the local cluster.

```
make image
```

#### 2. Make the manifests

To generate the manifests, run the following command:

```
make manifests
```

#### 3. Deploy the custom resource definitions (CRDs) and custom build of the controller

Run the following command to deploy the CRDs and controller:

```
make start
```

> ![NOTE]
> This command will build the images so you don't need to run `make image` before running `make start`.

### Deploying and testing your changes on managed clusters in the cloud

You might want to test certain changes on a managed cluster in the cloud. For example, testing Microsoft Entra ID Workload Identity on AKS. The following steps will guide you through that process.

#### 1. Building images

We can use ephemeral containers for quick testing with images hosted by friends at [ttl.sh](https://ttl.sh/).

If you want a fresh build before building the container image, run the following commands to delete any existing binaries.

```
rm -rf dist
```

The ephemeral container image repository must be unique and the tag is used to determine how long the image is kept.

Run the following commands to generate a unique repository name and tag it so the image will be kept for 1 hour.

```
IMG_REPO=$(uuidgen | tr '[:upper:]' '[:lower:]')
IMG_VERSION=1h
```

Using the ephemeral image repository and version, run the following command to build and push a multi-arch image to ttl.sh.

```
DOCKER_PUSH=true IMAGE_NAMESPACE=ttl.sh/$IMG_REPO VERSION=$IMG_VERSION make image-multi
```

#### 2. Make the manifests

To generate the manifests, run the following command:

```
make manifests
```

#### 3. Deploy the custom resource definitions (