 me.echeung.moemoekyun.client.model.SongDescriptor
import me.echeung.moemoekyun.di.SerializationModule
import org.junit.jupiter.api.Test

class ResponseModelTest {

    private val json = SerializationModule.json()

    @Test
    fun `deserializes init websocket message`() {
        val response = json.decodeFromString<WebsocketResponse>(
            """{"op":0,"d":{"message":"Welcome to LISTEN.moe! Enjoy your stay!","heartbeat":35000}}""",
        )

        response.shouldBeInstanceOf<WebsocketResponse.Connect>()
        response.d.heartbeat shouldBe 35000
    }

    @Test
    fun `serializes heartbeat message`() {
        val request = json.encodeToString(WebsocketRequest.Heartbeat())

        request shouldBe """{"op":9}"""
    }

    @Test
    fun `deserializes track update message`() {
        val response = json.decodeFromString<WebsocketResponse>(
            """
            {
              "op": 1,
              "d": {
                "song": {
                  "id": 1611,
                  "title": "Clattanoia",
                  "sources": [],
                  "artists": [
                    {
                      "id": 705,
                      "name": "OxT",
                      "nameRomaji": null,
                      "image": "OxT_image.jpg",
                      "characters": []
                    }
                  ],
                  "characters": [],
                  "albums": [],
                  "duration": 238
                },
                "requester": null,
                "event": {
                  "id": 73,
                  "name": "Throwback to some good stuff",
                  "slug": "throwback",
                  "presence": null,
                  "image": "https://i.imgur.com/G3nzMLQ.png"
                },
                "startTime": "2025-07-06T14:03:17.278Z",
                "lastPlayed": [
                  {
                    "id": 3090,
                    "title": "READY!!",
                    "sources": [
                      {
                        "id": 351,
                        "name": null,
                        "nameRomaji": "THE IDOLM@STER OP",
                        "image": null
                      }
                    ],
                    "artists": [
                      {
                        "id": 1235,
                        "name": "765PRO ALLSTARS",
                        "nameRomaji": null,
                        "image": null,
                        "characters": []
                      }
                    ],
                    "characters": [],
                    "albums": [],
                    "duration": 0
                  },
                  {
                    "id": 3781,
                    "title": "Hear The Universe",
                    "sources": [],
                    "artists": [
                      {
                        "id": 889,
                        "name": "ワルキューレ",
                        "nameRomaji": "Walkure",
                        "image": null,
                        "characters": []
                      }
                    ],
                    "characters": [],
                    "albums": [],
                    "duration": 0
                  }
                ],
                "listeners": 93
              },
              "t": "TRACK_UPDATE"
            }
            """.trimIndent(),
        )

        response.shouldBeInstanceOf<WebsocketResponse.Update>()
        response.d?.song shouldBe Song(
            id = 1611,
            title = "Clattanoia",
            titleRomaji = null,
            artists = listOf(
                SongDescriptor(
                    name = "OxT",
                    nameRomaji = null,
                    image = "OxT_image.jpg",
                ),
            ),
            sources = em


//! (Cargo has the habit of adding the test features in with regular build tests.)
use noodles_sam::record::data::field::Tag;

use tokio::io::{self, AsyncRead, AsyncReadExt};

pub async fn read_tag<R>(reader: &mut R) -> io::Result<Tag>
where
    R: AsyncRead + Unpin,
{
    use std::str;

    let mut buf = [0; 2];
    reader.read_exact(&mut buf).await?;

    str::from_utf8(&buf)
        .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
        .and_then(|s| {
            s.parse()
                .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
        })
}

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

    #[tokio::test]
    async fn test_read_tag() -> io::Result<()> {
        let data = [b'N', b'H'];

        let mut reader = &data[..];
        let actual = read_tag(&mut reader).await?;

        let expected = Tag::AlignmentHitCount;

        assert_eq!(actual, expected);

        Ok(())
    }
}
<gh_stars>1000+
// Check that functions accessible through a field visible to a macro are
// considered reachable

// aux-build:nested-fn-macro.rs
// run-pass

extern crate nested_fn_macro;

fn main() {
    assert_eq!(nested_fn_macro::m!(), 12);
}
use std::io::BufRead;
use std::collections::HashMap;
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, Debug)]
struct JaWikiCountry {
    text: String,
    title: String,
}

fn main() {
    let stdin = std::io::stdin();
    let handle = stdin.lock();
    let mut map = HashMap::new();
    for l in handle.lines() {
        let entry: JaWikiCountry = serde_json::from_str(&l.unwrap()).expect("Invalid JSON format");
        map.entry(entry.title.clone()).or_insert(entry);
    }
    if let Some(country) = map.get("イギリス") {
        println!("{}", country.text);
    }
    else {
        println!("JSON entry 'イギリス' not found");
    }
}
// compile-flags: --document-private-items

// @has issue_46380/struct.Hidden.html
#[doc(hidden)]
pub struct Hidden;
<gh_stars>10-100
//! Marker traits representing properties of memory-mapped registers.

#[doc(inline)]
pub use drone_core::reg::marker::*;

#[cfg(feature = "bit-band")]
use crate::reg::{
    field::{RRRegFieldBitBand, WWRegFieldBitBand},
    tag::{RegTag, Urt},
    RegBitBand,
};
use crate::reg::{
    field::{WRwRegFieldBitAtomic, WRwRegFieldBitsAtomic},
    tag::{Crt, Srt},
    RwRegAtomic,
};
use drone_core::reg::marker as core_marker;

/// Synchronized read-write register.
#[marker]
pub trait SRwReg
where
    Self: core_marker::SRwReg,
    Self: for<'a> RwRegAtomic<'a, Srt>,
{
}

impl<R> SRwReg for R
where
    R: core_marker::SRwReg,
    R: for<'a> RwRegA


anychart.core.settings.deserialize(this, anychart.stockModule.splitter.PreviewSettings.DESCRIPTORS, config, opt_default);
};

/**
 * @inheritDoc
 */
anychart.stockModule.splitter.PreviewSettings.prototype.serialize = function() {
  var json = anychart.stockModule.splitter.PreviewSettings.base(this, 'serialize');
  anychart.core.settings.serialize(this, anychart.stockModule.splitter.PreviewSettings.DESCRIPTORS, json, void 0, void 0, true);
  return json;
};

//endregion

goog.provide('anychart.stockModule.math.cho');
goog.require('anychart.stockModule.math.CycledQueue');
goog.require('anychart.stockModule.math.adl');
goog.require('anychart.stockModule.math.ema');
goog.require('anychart.stockModule.math.sma');
goog.require('anychart.utils');

/**
 * @typedef {{
 *   adlContext: anychart.stockModule.math.adl.Context,
 *   fastMAContext: (anychart.stockModule.math.ema.Context|anychart.stockModule.math.sma.Context),
 *   slowMAContext: (anychart.stockModule.math.ema.Context|anychart.stockModule.math.sma.Context),
 *   maCalculate: Function,
 *   maType: anychart.enums.MovingAverageType,
 *   dispose: Function
 * }}
 */
anychart.stockModule.math.cho.Context;

/**
 * Creates context for CHO indicator calculation.
 * @param {number=} opt_fastPeriod [3] Indicator period. Defaults to 3.
 * @param {number=} opt_slowPeriod [10] Indicator period. Defaults to 10.
 * @param {string=} opt_maType [EMA] Indicator smoothing type. Defaults to EMA.
 * @return {anychart.stockModule.math.cho.Context}
 */
anychart.stockModule.math.cho.initContext = function(opt_fastPeriod, opt_slowPeriod, opt_maType) {
  var fastPeriod = anychart.utils.normalizeToNaturalNumber(opt_fastPeriod, 3, false);
  var slowPeriod = anychart.utils.normalizeToNaturalNumber(opt_slowPeriod, 10, false);
  if (fastPeriod > slowPeriod) {
    var tmp = fastPeriod;
    fastPeriod = slowPeriod;
    slowPeriod = tmp;
  }

  var maType = anychart.enums.normalizeMovingAverageType(opt_maType, anychart.enums.MovingAverageType.EMA);
  var adlContext = anychart.stockModule.math.adl.initContext();

  var fastMAContext;
  var slowMAContext;
  var maCalculate;

  if (maType == anychart.enums.MovingAverageType.SMA) {
    fastMAContext = anychart.stockModule.math.sma.initContext(fastPeriod);
    slowMAContext = anychart.stockModule.math.sma.initContext(slowPeriod);
    maCalculate = anychart.stockModule.math.sma.calculate;
  } else {
    fastMAContext = anychart.stockModule.math.ema.initContext(fastPeriod);
    slowMAContext = anychart.stockModule.math.ema.initContext(slowPeriod);
    maCalculate = anychart.stockModule.math.ema.calculate;
  }

  return {
    adlContext: adlContext,
    fastMAContext: fastMAContext,
    slowMAContext: slowMAContext,
    maCalculate: maCalculate,
    maType: maType,
    /**
     * @this {anychart.stockModule.math.cho.Context}
     */
    'dispose': function() {
      this.adlContext['dispose']();
      this.fastMAContext['dispose']();
      this.slowMAContext['dispose']();
    }
  };
};

/**
 * Start calculation function for  indicator calculation.
 * @param {anychart.stockModule.math.cho.Context} context
 *


        1.974506857221074E182,
        2.2311927486598138E184,
        2.5435597334721877E186,
        2.925093693493016E188,
        3.393108684451898E190,
        3.969937160808721E192,
        4.684525849754291E194,
        5.574585761207606E196,
        6.689502913449127E198,
        8.094298525273444E200,
        9.875044200833601E202,
        1.214630436702533E205,
        1.506141741511141E207,
        1.882677176888926E209,
        2.372173242880047E211,
        3.0126600184576594E213,
        3.856204823625804E215,
        4.974504222477287E217,
        6.466855489220474E219,
        8.47158069087882E221,
        1.1182486511960043E224,
        1.4872707060906857E226,
        1.9929427461615188E228,
        2.6904727073180504E230,
        3.659042881952549E232,
        5.012888748274992E234,
        6.917786472619489E236,
        9.615723196941089E238,
        1.3462012475717526E241,
        1.898143759076171E243,
        2.695364137888163E245,
        3.854370717180073E247,
        5.5502938327393044E249,
        8.047926057471992E251,
        1.1749972043909107E254,
        1.727245890454639E256,
        2.5563239178728654E258,
        3.80892263763057E260,
        5.713383956445855E262,
        8.62720977423324E264,
        1.3113358856834524E267,
        2.0063439050956823E269,
        3.0897696138473508E271,
        4.789142901463394E273,
        7.471062926282894E275,
        1.1729568794264145E278,
        1.853271869493735E280,
        2.9467022724950384E282,
        4.7147236359920616E284,
        7.590705053947219E286,
        1.2296942187394494E289,
        2.0044015765453026E291,
        3.287218585534296E293,
        5.423910666131589E295,
        9.003691705778438E297,
        1.503616514864999E300,
        2.5260757449731984E302,
        4.269068009004705E304,
        7.257415615307999E306
    };

    /** Private constructor. */
    private Factorial() {
        // intentionally empty.
    }

    /**
     * Computes the factorial of {@code n}.
     *
     * @param n Argument.
     * @return {@code n!}
     * @throws IllegalArgumentException if {@code n < 0}.
     * @throws IllegalArgumentException if {@code n > 20} (the factorial
     * value is too large to fit in a {@code long}).
     */
    public static long value(int n) {
        if (n < 0 ||
            n > 20) {
            throw new CombinatoricsException(CombinatoricsException.OUT_OF_RANGE,
                                             n, 0, 20);
        }

        return FACTORIALS[n];
    }

    /**
     * Computes the factorial of {@code n}.
     *
     * <p>The result should be small enough to fit into a {@code double}: The
     * largest {@code n} for which {@code n!} does not exceed
     * {@code Double.MAX_VALUE} is 170. {@code Double.POSITIVE_INFINITY} is
     * returned for {@code n > 170}.
     *
     * @param n Argument.
     * @return {@code n!}
     * @throws IllegalArgumentException if {@code n < 0}.
     * @since 1.1
     */
    public static double doubleValue(int n) {
        if (n < 0) {
            throw new CombinatoricsException(CombinatoricsException.NEGATIVE, n);
        }
        if (n < DOUBLE_FACTORIALS.length


mera_pose.to(self.weight_dtype).to(self.device),
            n_views=n_views,
        )

        model_kwargs = dict(
            c=torch.cat([z_lq] * 2),
            data_info={},
            mask=emb_masks,
            noise_level=torch.cat([noise_level] * 2),
            epipolar_constrains=torch.cat([epipolar_constrains] * 2),
            cam_distances=torch.cat([cam_distances] * 2),
            n_views=n_views,
        )
        dpm_solver = DPMS(
            self.model.forward_with_dpmsolver,
            condition=caption_embs,
            uncondition=null_y,
            cfg_scale=cfg_scale,
            model_kwargs=model_kwargs
        )
        samples = dpm_solver.sample(
            z,
            steps=sample_steps,
            order=2,
            skip_type="time_uniform",
            method="multistep",
            disable_progress_ui=False,
        )

        samples = samples.to(self.weight_dtype)

        output_mv_imgs = self.vae.decode(samples / self.vae.config.scaling_factor).sample

        if color_shift == "adain":
            for i, output_mv_img in enumerate(output_mv_imgs):
                output_mv_imgs[i] = adaptive_instance_normalization(output_mv_img.unsqueeze(0), originial_mv_imgs[i:i+1]).squeeze(0)
        elif color_shift == "wavelet":
            for i, output_mv_img in enumerate(output_mv_imgs):
                output_mv_imgs[i] = wavelet_reconstruction(output_mv_img.unsqueeze(0), originial_mv_imgs[i:i+1]).squeeze(0)

        output_mv_imgs = torch.clamp((output_mv_imgs + 1.) / 2., 0, 1)

        torch.cuda.empty_cache()
        return output_mv_imgs


slot0 = class("RegisterPanelView", import("...base.BaseSubView"))

function slot0.getUIName(slot0)
	return "RegisterPanelView"
end

function slot0.OnLoaded(slot0)
end

function slot0.SetShareData(slot0, slot1)
	slot0.shareData = slot1
end

function slot0.OnInit(slot0)
	slot0.registerPanel = slot0._tf
	slot0.registerUsername = slot0:findTF("account/username", slot0.registerPanel)
	slot0.cancelButton = slot0:findTF("cancel_button", slot0.registerPanel)
	slot0.confirmButton = slot0:findTF("confirm_button", slot0.registerPanel)

	slot0:InitEvent()
end

function slot0.InitEvent(slot0)
	onButton(slot0, slot0.confirmBu


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CoroutineManager : MonoSingletion<CoroutineManager>
{
    public int StartCoroutine<T>(IEnumerator<T> enumerator, bool ignoreFrameTime = false) where T : IEnumerator
    {
        CoroutineItem<T> temp = new();
        temp.Init(enumerator);
        AsyncManager.Instance.Add(temp, ignoreFrameTime);
        return temp.ItemID;
    }
    public void Stop(int id, bool execMark = false)
    {
        if (id < 0) return;
        AsyncManager.Instance.Remove(id, execMark);
    }

    private class CoroutineItem<T> : AsyncItem where T : IEnumerator
    {
        private IEnumerator<T> action;
        private bool nextMark = false;

        public void Init(IEnumerator<T> action)
        {
            base.Init(finish);
            this.action = action;
            nextMark = action.MoveNext();
        }
        public override void Update(float t)
        {
            if (endMark) return;
            if (nextMark) nextM


using System;
using System.Net;
using System.Net.Sockets;

namespace Snowflake.Data.Core.Authenticator.Browser
{
    internal class WebListenerStarter
    {
        public static WebListenerStarter Instance = new WebListenerStarter();

        public virtual HttpListener StartHttpListener(string url)
        {
            return StartHttpListener(new[] { url });
        }

        public virtual HttpListener StartHttpListener(string[] urls)
        {
            var listener = new HttpListener();
            try
            {
                foreach (var url in urls)


        });

        it('should support toPromise', async () => {
            const subj = new Subject<string>();
            const d$ = fromObservable(subj);

            setTimeout(() => subj.next('value'), 0);

            expect(await d$.toPromise()).toBe('value');

            setTimeout(() => subj.error(new Error('my error')), 0);

            try {
                await d$.toPromise();
                throw new Error('should have thrown an error');
            } catch (e) {
                expect(e.message).toBe('my error');
            }
        });
    });
});
/**
 * Необходимо написать функцию, которая может "развернуть" массив в плоскую структуру
 * Пример:
 * [1, [2, 3], [4, 5, 6]] -> [1, 2, 3, 4, 5, 6]
 * [1, [2, 3], [4, 5, 6], [7, [8, 9]]] -> [1, 2, 3, 4, 5, 6, 7, 8, 9]
 */

 function deepFlatten(arr: any[]): any[] {
   return arr.reduce((acc, val) => Array.isArray(val)
    ? acc.concat(deepFlatten(val))
    : acc.concat(val),
    []);
 }
import { gameStore } from "./store";
import { generateTile } from "./tile-generation";

export const saveGame = () => {
  localStorage.setItem("grid", JSON.stringify(gameStore.state.grid));
  localStorage.setItem("score", JSON.stringify(gameStore.state.score));
};

export const loadGame = async () => {
  const loadedScore = localStorage.getItem("score") || ("0" as string);
  const gridDataString = localStorage.getItem("grid") || ("{}" as string);
  const grid = JSON.parse(gridDataString);

  gameStore.set(() => ({
    grid,
    score: parseInt(loadedScore),
  }));

  const scoreElement = document.getElementById("score") as HTMLElement;
  scoreElement.innerHTML = loadedScore;

  for (const tilePos in grid) {
    if (Object.prototype.hasOwnProperty.call(gameStore.state.grid, tilePos)) {
      const [x, y] = tilePos.split(":");
      generateTile(grid[tilePos], parseInt(x), parseInt(y));
    }
  }
};
let Electronics: String[] = ["TV", "Mobile", "Watch"];
let Shoes: String[] = ["nike", "reebok", "leeCoper"];

let Products: String[] = Electronics.concat(Shoes);

console.log(Products.toString());import { RuleObject } from 'ant-design-vue/lib/form/interface';
import { store } from '@/store/store';
import { DictionaryInfoStore } from '@/store/modules/dictionaryInfo';
import { ref } from 'vue';

const EMPTY_DICTIONARY = 'Por favor seleccione el diccionario';
const DICTIONARY_OUT_OF_PERIOD = 'Diccionario fuera del periodo';
const EMPTY_LETTERS = 'Por favor seleccione las letras';

export function validateDictionaryYearByID(
  id: string,
  initYear: number,
  finalYear: number
): boolean {
  let found = false;
  let validYear = false;
  for (
    let i = 0;
    i < (store.dictionariesInfo as DictionaryInfoStore[]).length && !found;
    i++
  ) {
    const sdi = (store.dictionariesInfo as DictionaryInfoStore[])[i];
    if (sdi.id === id) {
      found = true;
      if (
        sdi.annoOfPublication >= initYear &&
        sdi.annoOfPublication <= finalYear
      ) {
        validYear = true;
      }
    }
  }
  return validYear;
}
export function validateDictionaryYear(
  year: number,
  initYear: number,
  finalYear: number
): boolean {
  let outOfPeriod = false;
  if (year < initYea


 + caseBlend.getLocation().y,
				caseMotionBlur.getPreferredSize().width, 23);
		grpImageSequence.add(caseMotionBlur);

		caseMotionBlur.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {

				VideoPlayer.playerSetTime(VideoPlayer.playerCurrentFrame); // Use VideoPlayer.resizeAll and reload the
																			// frame
			}

		});

	}

	private void grpAdvanced() {

		grpAdvanced = new JPanel() {
			@Override
			protected void paintComponent(Graphics g) {
				Graphics2D g2 = (Graphics2D) g.create();
				g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
				g2.setColor(Utils.c25);
				g2.fillRoundRect(2, 9, getWidth() - 4, getHeight() - 11, 10, 10);
				g2.dispose();
				super.paintComponent(g);
			}
		};
		grpAdvanced.setLayout(null);
		grpAdvanced.setOpaque(false);
		grpAdvanced.setVisible(false);
		grpAdvanced.setBorder(BorderFactory.createTitledBorder(
				new FlatLineBorder(new Insets(0, 0, 0, 0), Utils.c42, 1, 10) ,
				language.getProperty("grpAdvanced") + " ", 0, 0, new Font(boldFont, Font.PLAIN, 13),
				new Color(235, 235, 240)));
		grpAdvanced.setBackground(Utils.c30);
		grpAdvanced.setBounds(frame.getWidth(), 396, 312, 17);
		frame.getContentPane().add(grpAdvanced);

		grpAdvanced.addMouseListener(new MouseAdapter() {

			@Override
			public void mousePressed(MouseEvent e) {
				int size = 25;
				for (Component c : grpAdvanced.getComponents()) {
					if (c instanceof JCheckBox)
						size += 17;
				}

				extendSections(grpAdvanced, size);
			}

		});

		caseOpenGop = new JCheckBox(Shutter.language.getProperty("btnOpenGOP"));
		caseOpenGop.setName("caseOpenGop");
		caseOpenGop.setFont(new Font(mainFont, Font.PLAIN, 12));
		caseOpenGop.setSize(caseOpenGop.getPreferredSize().width, 23);

		caseForcerProgressif = new JCheckBox(language.getProperty("caseForcerProgressif"));
		caseForcerProgressif.setName("caseForcerProgressif");
		caseForcerProgressif.setToolTipText(language.getProperty("tooltipProgressif"));
		caseForcerProgressif.setFont(new Font(mainFont, Font.PLAIN, 12));
		caseForcerProgressif.setSize(caseForcerProgressif.getPreferredSize().width + 4, 23);

		caseForcerEntrelacement = new JCheckBox(language.getProperty("caseForcerEntrelacement"));
		caseForcerEntrelacement.setName("caseForcerEntrelacement");
		caseForcerEntrelacement.setToolTipText(language.getProperty("tooltipEntrelacement"));
		caseForcerEntrelacement.setFont(new Font(mainFont, Font.PLAIN, 12));
		caseForcerEntrelacement.setSize(caseForcerEntrelacement.getPreferredSize().width + 4, 23);

		caseForcerInversion = new JCheckBox(language.getProperty("caseForcerInversion"));
		caseForcerInversion.setName("caseForcerInversion");
		caseForcerInversion.setFont(new Font(mainFont, Font.PLAIN, 12));
		caseForcerInversion.setSize(caseForcerInversion.getPreferredSize().width, 23);

		caseForcerDesentrelacement = new JCheckBox(language.getProperty("caseForcerDesentrelacement"));
		caseForcerDesentrelacement.setName("caseForcerDesentrelacement");
		caseForcerDesentrel


        """

        np.testing.assert_allclose(
            exposure_index_values(np.array([0.16439371, 0.08810904, 0.09310904])),
            np.array([60.82957797, 113.49573211, 107.40095699]),
            atol=TOLERANCE_ABSOLUTE_TESTS,
        )

class TestExposureValue100:
    """
    Define :func:`colour_hdri.exposure.dsc.exposure_value_100` definition
    unit tests methods.
    """

    def test_exposure_value_100(self) -> None:
        """
        Test :func:`colour_hdri.exposure.dsc.exposure_value_100`
        definition.
        """

        np.testing.assert_allclose(
            exposure_value_100(
                np.array([8, 5.6, 2.8]),
                np.array([1 / 250, 1 / 500, 1 / 1000]),
                np.array([100, 800, 1600]),
            ),
            np.array([13.96578428, 10.93663794, 8.93663794]),
            atol=TOLERANCE_ABSOLUTE_TESTS,
        )

class TestPhotometricExposureScaleFactorLagarde2014:
    """
    Define :func:`colour_hdri.exposure.dsc.\
photometric_exposure_scale_factor_Lagarde2014` definition unit tests
    methods.
    """

    def test_photometric_exposure_scale_factor_Lagarde2014(self) -> None:
        """
        Test :func:`colour_hdri.exposure.dsc.\
photometric_exposure_scale_factor_Lagarde2014` definition.
        """

        np.testing.assert_allclose(
            photometric_exposure_scale_factor_Lagarde2014(
                np.array([13.96578428, 10.93663794, 8.93663794]),
                np.array([9 / 10, 8 / 10, 9 / 10]),
                np.array([98 / 100, 98 / 100, 94 / 100]),
                np.array([10, 10, 20]),
            ),
            np.array([0.00005221, 0.00037884, 0.00135554]),
            atol=TOLERANCE_ABSOLUTE_TESTS,
        )


()..mergeFromJson(i, r);
  @$core.Deprecated('Using this can add significant overhead to your binary. '
      'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
      'Will be removed in next major version')
  TestProto3Optional clone() => TestProto3Optional()..mergeFromMessage(this);
  @$core.Deprecated('Using this can add significant overhead to your binary. '
      'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
      'Will be removed in next major version')
  TestProto3Optional copyWith(void Function(TestProto3Optional) updates) =>
      super.copyWith((message) => updates(message as TestProto3Optional))
          as TestProto3Optional; // ignore: deprecated_member_use
  $pb.BuilderInfo get info_ => _i;
  @$core.pragma('dart2js:noInline')
  static TestProto3Optional create() => TestProto3Optional._();
  TestProto3Optional createEmptyInstance() => create();
  static $pb.PbList<TestProto3Optional> createRepeated() =>
      $pb.PbList<TestProto3Optional>();
  @$core.pragma('dart2js:noInline')
  static TestProto3Optional getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<TestProto3Optional>(create);
  static TestProto3Optional? _defaultInstance;

  @$pb.TagNumber(1)
  $core.int get optionalInt32 => $_getIZ(0);
  @$pb.TagNumber(1)
  set optionalInt32($core.int v) {
    $_setSignedInt32(0, v);
  }

  @$pb.TagNumber(1)
  $core.bool hasOptionalInt32() => $_has(0);
  @$pb.TagNumber(1)
  void clearOptionalInt32() => clearField(1);

  @$pb.TagNumber(2)
  $fixnum.Int64 get optionalInt64 => $_getI64(1);
  @$pb.TagNumber(2)
  set optionalInt64($fixnum.Int64 v) {
    $_setInt64(1, v);
  }

  @$pb.TagNumber(2)
  $core.bool hasOptionalInt64() => $_has(1);
  @$pb.TagNumber(2)
  void clearOptionalInt64() => clearField(2);

  @$pb.TagNumber(3)
  $core.int get optionalUint32 => $_getIZ(2);
  @$pb.TagNumber(3)
  set optionalUint32($core.int v) {
    $_setUnsignedInt32(2, v);
  }

  @$pb.TagNumber(3)
  $core.bool hasOptionalUint32() => $_has(2);
  @$pb.TagNumber(3)
  void clearOptionalUint32() => clearField(3);

  @$pb.TagNumber(4)
  $fixnum.Int64 get optionalUint64 => $_getI64(3);
  @$pb.TagNumber(4)
  set optionalUint64($fixnum.Int64 v) {
    $_setInt64(3, v);
  }

  @$pb.TagNumber(4)
  $core.bool hasOptionalUint64() => $_has(3);
  @$pb.TagNumber(4)
  void clearOptionalUint64() => clearField(4);

  @$pb.TagNumber(5)
  $core.int get optionalSint32 => $_getIZ(4);
  @$pb.TagNumber(5)
  set optionalSint32($core.int v) {
    $_setSignedInt32(4, v);
  }

  @$pb.TagNumber(5)
  $core.bool hasOptionalSint32() => $_has(4);
  @$pb.TagNumber(5)
  v


     var camera = context.Get<UniversalCameraData>().camera;
        var driver = camera.GetComponent<RecolorEffect>();
        if (driver == null || !driver.enabled || !driver.IsActive) return;

        // Custom context data retrieval
        var contextData = context.Get<RecolorContextData>();

        // Destination texture allocation
        var source = resource.activeColorTexture;
        var desc = graph.GetTextureDesc(source);
        desc.name = "Recolor";
        desc.clearBuffer = false;
        desc.depthBufferBits = 0;
        var dest = graph.CreateTexture(desc);

        // Render pass building
        using var builder = graph.
          AddRasterRenderPass<PassData>("Recolor", out var data);

        // Custom pass data
        data.Material = _material;
        data.Driver = driver;
        data.Source = source;
        data.Alpha = contextData.AlphaBuffer;

        // Texture registration
        builder.UseTexture(data.Source);
        builder.UseTexture(data.Alpha);

        // Color attachment
        builder.SetRenderAttachment(dest, 0);

        // Render function registration
        builder.SetRenderFunc<PassData>((data, ctx) => ExecutePass(data, ctx));

        // Destination texture as the camera texture
        resource.cameraColor = dest;
    }

    static void ExecutePass(PassData data, RasterGraphContext ctx)
    {
        data.Material.SetTexture(ShaderID.SourceTexture, data.Source);
        data.Material.SetTexture(ShaderID.AlphaTexture, data.Alpha);
        CoreUtils.DrawFullScreen(ctx.cmd, data.Material, data.Driver.Properties, 1);
    }
}

public sealed class RecolorFeature : ScriptableRendererFeature
{
    [SerializeField, HideInInspector] Shader _shader = null;

    Material _material;
    RecolorCapturePass _capturePass;
    RecolorEffectPass _effectPass;

    public override void Create()
    {
        _material = CoreUtils.CreateEngineMaterial(_shader);
        _capturePass = new RecolorCapturePass(_material);
        _effectPass = new RecolorEffectPass(_material);
        _capturePass.renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
        _effectPass.renderPassEvent = RenderPassEvent.AfterRenderingPostProcessing;
    }

    protected override void Dispose(bool disposing)
      => CoreUtils.Destroy(_material);

    public override void AddRenderPasses
      (ScriptableRenderer renderer, ref RenderingData data)
    {
        if (data.cameraData.cameraType != CameraType.Game) return;
        renderer.EnqueuePass(_capturePass);
        renderer.EnqueuePass(_effectPass);
    }
}

} // namespace Rcam4


sName="pr0">车险 有钱 有道词典 翻译 云笔记 印像派 公开课 严选 云课堂 云阅读 云音乐 火车票 商城 公正邮 1元夺宝 财经客户端 新闻客户端 大学MOOC

                                社区
                                考拉海购 LOFTER 博客 CC语音 BoBo直播 美聊 跟贴 秀品 相册 花田</


, buttons)
- Synchronization with WhatsApp API
- Bulk sending of template-based messages
- Advanced editing with real-time validation

### 📚 Table of Contents
1. Template Administration
    - Get all templates
    - Get by name
    - Get by ID
    - Delete templates
    - Soft delete
    - Hard delete

2. Edit Templates
    - Component management
    - Validations
    - Error handling

3. Create Templates
    - Utility templates
    - Marketing templates
    - With images
    - With buttons
    - Variations

4. Send Messages with Templates

## Template Administration

- **Get all templates for a WhatsApp business account**
    Retrieves all templates for a WhatsApp business account and stores them in the database.
    Makes a request to the WhatsApp API to get all templates associated with the account.

    ```php
    use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
    use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;

    // Get a WhatsApp Business Account instance
    $account = WhatsappBusinessAccount::find($accountId);

    // Get all templates for the account
    Whatsapp::template()->getTemplates($account);
    ```

- **Get a template by name**
    Makes a request to the WhatsApp API to get a template by name and stores it in the database.

    ```php
    use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
    use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;

    // Get a WhatsApp Business Account instance
    $account = WhatsappBusinessAccount::find($accountId);

    // Get template by name
    $template = Whatsapp::template()->getTemplateByName($account, 'order_confirmation');
    ```

- **Get a template by ID**
    Makes a request to the WhatsApp API to get a template by ID and stores it in the database.

    ```php
    use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
    use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;

    // Get a WhatsApp Business Account instance
    $account = WhatsappBusinessAccount::find($accountId);

    // Get template by ID
    $template = Whatsapp::template()->getTemplateById($account, '559947779843204');
    ```

- **Delete template from API and database simultaneously**
    Makes a request to the WhatsApp API to delete the selected template. There are two deletion methods: Soft Delete and Hard Delete.

    ```php
    use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
    use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;

    // Get a WhatsApp Business Account instance
    $account = WhatsappBusinessAccount::find($accountId);

    // Soft delete
    // Delete template by ID
    $template = Whatsapp::template()->deleteTemplateById($account, $templateId);

    // Delete template by name
    $template = Whatsapp::template()->deleteTemplateByName($account, 'order_confirmation');

    // Hard delete
    // Delete template by ID
    $template = Whatsapp::template()->deleteTemplateById($account, $templateId, true);

    // Delete template by name
    $template = Whatsapp::template()->deleteTemplateByName($account, 'order_confirmation', true);
    ```

- **Edit template in API and database simultaneously**
    Makes a request to the WhatsApp API to edit the selected template.

    ```php
    use ScriptDevelop\WhatsappManager\Models\Template;
    use ScriptDevelop\WhatsappManager\Exceptions\TemplateComponentException;
    use ScriptDevelop\WhatsappManager\Exceptions\TemplateUpdateException;

    $template = Template::find('template-id');

    try {
        $updatedTemplate = $template->edit()
            ->setName('new-template-name')
            ->changeBody('New body content {{1}}', [['New example']])
            ->removeHeader()
            ->addFooter('New footer text')
            ->removeAllButtons()
            ->add


scriptor: PropertyDescriptor): PropertyDescriptor {

        return {
            ...descriptor,
            value: (...args: unknown[]): void => {
                timeout ? clearTimeout(timeout) : null;
                timeout = setTimeout(() => {
                    console.log(`Call ${key.toString()}(${args.join()})`);
                    timeout = null;
                    descriptor.value(...args);
                }, ms);
            }
        };
    };
}

class MathLib {
    @debounce(5000)
    public areaOfCircle(r: number): void {
        const result: number = Math.PI * r ** 2;
        console.log(result);
    }
}

const lib: MathLib = new MathLib();
lib.areaOfCircle(2);
lib.areaOfCircle(3);
lib.areaOfCircle(10);
lib.areaOfCircle(16);
lib.areaOfCircle(22);
export interface GetSafeValueFn {
  (params: GetSafeValueFnParams): any
}

export interface GetSafeValueFnModel {
  type: string,
  safeValue?: any,
  items?: GetSafeValueFnModel,
  props?: { [propsName: string]: GetSafeValueFnModel },
  required?: boolean
}

export interface GetSafeValueFnParams {
  value: any,
  model: GetSafeValueFnModel,
  onError?: (error: Error) => void,
  paths?: string[]
}

export interface ValidateFn {
  (value: any): boolean
}

const isObject = value => value != null && typeof value === 'object' && Array.isArray(value) === false

const isArray = value => Array.isArray(value)

const isNumber = value => typeof value === 'number' && !isNaN(value)

const isBoolean = value => typeof value === 'boolean'

const isString = value => typeof value === 'string'

const isAny = value => true

const OBJECT = 'Object',
  ARRAY = "Array",
  NUMBER = "Number",
  BOOLEAN = "Boolean",
  STRING = "String",
  ANY = "Any"

const modelDefaultOption = {
  [STRING]: {
    safeValue: "",
    required: false
  },
  [OBJECT]: {
    safeValue: {},
    required: false,
    props: {}
  },
  [ARRAY]: {
    safeValue: [],
    required: false,
    items: {
      type: ANY
    }
  },
  [NUMBER]: {
    safeValue: 0,
    required: false
  },
  [ANY]: {
    safeValue: null,
    required: false,
  },
  [BOOLEAN]: {
    safeValue: false,
    required: true,
  }
}

const registeredValidateFn = {
  [STRING]: isString,
  [OBJECT]: isObject,
  [ARRAY]: isArray,
  [NUMBER]: isNumber,
  [ANY]: isAny
}

const registerValidateFn = (type: string, validateFn: ValidateFn) => {
  if (type in registeredValidateFn) {
    console.warn(`Type:${type} has registered`)
  } else {
    registeredValidateFn[type] = validateFn
  }
}

const is = (model: GetSafeValueFnModel, value) => {
  try {
    if (model.type in registeredValidateFn) {
      return registeredValidateFn[model.type](value)
    }
    return false
  } catch (e) {
    console.error(`is:`, e)
    return false
  }
}

const fillDefaultOptionByModel = (model: GetSafeValueFnModel): GetSafeValueFnModel => {
  try {
    if (model.type in modelDefaultOption) {
      return { ...modelDefaultOption[model.type], ...model }
    }
  } catch (e) {
    console.error("fillDefaultOptionByModel:", e)
    return model
  }
}

const getError = (value, paths: string[], model: GetSafeValueFnModel) => {

  return new Error


le = new StyleRule(name, decl, this.options)
    } else {
      rule = new StyleRule(name, {}, this.options)
      rule[fnRuleNamespace] = decl
    }

    if (!rule) return null

    this.register(rule)
    return rule

  }

  /**
   * 添加新的rule之后需要將新的rule存入集合中,
   * 并更新`classes`
   */
  register(rule: StyleRule) {
    this.collection.push(rule)
    if (rule.className) {
      this.classes[rule.ruleName] = rule.className
    }
  }

  update(rule: StyleRule, data: any, updateOptions?: updatePropOptions) {
    if (rule) {
      this.onUpdate(rule, data, updateOptions)
    } else {
      this.collection.forEach(item => {
        this.onUpdate(item, data, updateOptions)
      })
    }
  }

  onUpdate(rule: StyleRule, data: any, options: updatePropOptions = defaultUpdateOptions): void {
    const ruleCopy: StyleRule = Object.assign(rule)
    const {style} = ruleCopy
    const fnRule = ruleCopy[fnRuleNamespace]
    if (fnRule) {
      // 执行该更新函数
      ruleCopy.style = fnRule(data) || {}
    }

    const fnValues = ruleCopy[fnValueNamespace]

    if (fnValues) {
      Object.keys(fnValues).forEach((_prop: CSSPropertiesKeys) => {
        ruleCopy.prop(_prop, fnValues[_prop](data), options);
      })
    }

    if (options.process && style && style !== ruleCopy.style) {
      // TODO
      // operateFn((style as RuleBodyDeclaration), rule)
    }
  }

  toString(options?: RuleToStringOptions) {
    return this.collection.map(rule => {
      return rule.toString(options)
    }).join('\n')
  }

}import * as fs from "fs/promises";
import * as path from "path";

// Map of <color> contained by Set<color>
type Containments = Map<string, Map<string, number>>;

function stringSplitWithTail(input: string, partCount: number): string[] {
  const words = input.split(" ");
  return [...words.slice(0, partCount - 1), words.slice(partCount - 1).join(" ")];
}

function parseLine(
  line: string,
  containmentCallback: (container: string, contained: string, n: number) => void
) {
  // line structure:
  // <colorA.1> SP <colorA.2> SP 'bags' SP 'contain'
  //     N <colorB.1> SP <colorB.2> SP ('bag'|'bags')
  //     [ ',' SP N <colorB.1> SP <colorB.2> SP ('bag'|'bags') ]* '.'
  const [container1, container2, , , containedAll] = stringSplitWithTail(line, 5);
  const containerColor = container1 + " " + container2;

  if (containedAll == "no other bags") {
    return;
  }

  containedAll
    .split(", ")
    .map((containedPart) => {
      if (containedPart == "no other bags.") {
        return { color: "", n: 0 };
      }
      const [nStr, containedColor1, containedColor2] = containedPart.split(" ", 4);
      const containedColor = containedColor1 + " " + containedColor2;
      return { color: containedColor, n: parseInt(nStr, 10) };
    })
    .filter((it) => it.n)
    .forEach((contained) => containmentCallback(containerColor, contained.color, contained.n));
}


letType extends BulletType{
    public Effect pierceEffect = Fx.hitBulletSmall, pointEffect = Fx.none, lineEffect = Fx.none;
    public Effect endEffect = Fx.none;

    public float length = 100f;

    public float pointEffectSpace = 20f;

    public RailBulletType(){
        speed = 0f;
        pierceBuilding = true;
        pierce = true;
        reflectable = false;
        hitEffect = Fx.none;
        despawnEffect = Fx.none;
        collides = false;
        keepVelocity = false;
        lifetime = 1f;
        delayFrags = true;
    }

    @Override
    protected float calculateRange(){
        return length;
    }

    @Override
    public void handlePierce(Bullet b, float initialHealth, float x, float y){
        float sub = Math.max(initialHealth * pierceDamageFactor, 0);

        if(b.damage <= 0){
            b.fdata = Math.min(b.fdata, b.dst(x, y));
            return;
        }

        if(b.damage > 0){
            pierceEffect.at(x, y, b.rotation());
        }

        //subtract health from each consecutive pierce
        b.damage -= Math.min(b.damage, sub);

        //bullet was stopped, decrease furthest distance
        if(b.damage <= 0f){
            b.fdata = Math.min(b.fdata, b.dst(x, y));
        }
    }

    @Override
    public void init(Bullet b){
        super.init(b);

        b.fdata = length;
        Damage.collideLine(b, b.team, b.x, b.y, b.rotation(), length, false, false, pierceCap);
        float resultLen = b.fdata;

        Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor();
        if(pointEffect != Fx.none){
            for(float i = 0; i <= resultLen; i += pointEffectSpace){
                pointEffect.at(b.x + nor.x * i, b.y + nor.y * i, b.rotation(), trailColor);
            }
        }

        boolean any = b.collided.size > 0;

        if(!any && endEffect != Fx.none){
            endEffect.at(b.x + nor.x * resultLen, b.y + nor.y * resultLen, b.rotation(), hitColor);
        }

        if(lineEffect != Fx.none){
            lineEffect.at(b.x, b.y, b.rotation(), hitColor, new Vec2(b.x, b.y).mulAdd(nor, resultLen));
        }
    }

    @Override
    public boolean testCollision(Bullet bullet, Building tile){
        return bullet.team != tile.team;
    }

    @Override
    public void hitTile(Bullet b, Building build, float x, float y, float initialHealth, boolean direct){
        handlePierce(b, initialHealth, x, y);
    }
}
package mindustry.entities.bullet;

import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;

public class ContinuousLaserBulletType extends ContinuousBulletType{
    public float fadeTime = 16f;
    public float lightStroke = 40f;
    public int divisions = 13;
    public Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white};
    public float strokeFrom = 2f, strokeTo = 0.5f, pointyScaling = 0.75f;
    public float backLength = 7f, frontLength = 35f;
    public float width = 9f, oscScl = 0.8f, oscMag = 1.5f;

    public ContinuousLaserBulletType(float damage){
        this.damage = damage;
    }

    public ContinuousLaserBulletType(){


[i].Mul(&interpolationPoly[i], &wPow)
		wPow.Mul(&wPow, &w)
	}

	err := g.Fs.InplaceFFT(shiftedInterpolationPoly, evals, false)
	if err != nil {
		return nil, fmt.Errorf("fft on shifted interpolation poly: %w", err)
	}
	return evals, nil
}

// Since both F W are invertible, c = W^-1 F^-1 d, convert it back. F W W^-1 F^-1 d = c
func (g *ParametrizedEncoder) getInterpolationPolyCoeff(chunk []fr.Element, k uint32) ([]fr.Element, error) {
	coeffs := make([]fr.Element, g.Params.ChunkLength)
	shiftedInterpolationPoly := make([]fr.Element, len(chunk))
	err := g.Fs.InplaceFFT(chunk, shiftedInterpolationPoly, true)
	if err != nil {
		return coeffs, fmt.Errorf("ifft on shifted interpolation poly: %w", err)
	}

	mod := int32(len(g.Fs.ExpandedRootsOfUnity) - 1)

	for i := 0; i < len(chunk); i++ {
		// We can lookup the inverse power by counting RootOfUnity backward
		j := (-int32(k)*int32(i))%mod + mod
		coeffs[i].Mul(&shiftedInterpolationPoly[i], &g.Fs.ExpandedRootsOfUnity[j])
	}

	return coeffs, nil
}
package verifier

import (
	"fmt"
	"math"
	"math/big"

	"github.com/Layr-Labs/eigenda/encoding"
	"github.com/Layr-Labs/eigenda/encoding/fft"
	"github.com/Layr-Labs/eigenda/encoding/kzg"
	"github.com/Layr-Labs/eigenda/encoding/rs"
	"github.com/Layr-Labs/eigenda/resources/srs"
	"github.com/consensys/gnark-crypto/ecc"
	"github.com/consensys/gnark-crypto/ecc/bn254"
	"github.com/consensys/gnark-crypto/ecc/bn254/fr"
)

type ParametrizedVerifier struct {
	*kzg.KzgConfig
	g1SRS kzg.G1SRS
	Fs    *fft.FFTSettings
}

// VerifyFrame verifies a single frame against a commitment.
// If needing to verify multiple frames of the same chunk length, prefer [Verifier.UniversalVerify].
func (v *ParametrizedVerifier) VerifyFrame(
	frame *encoding.Frame, frameIndex uint64, commitment *bn254.G1Affine, numChunks uint64,
) error {
	j, err := rs.GetLeadingCosetIndex(frameIndex, numChunks)
	if err != nil {
		return fmt.Errorf("GetLeadingCosetIndex: %w", err)
	}

	exponent := uint64(math.Log2(float64(len(frame.Coeffs))))
	G2atD := srs.G2PowerOf2SRS[exponent]

	err = verifyFrame(frame, v.g1SRS, commitment, &v.Fs.ExpandedRootsOfUnity[j], &G2atD)
	if err != nil {
		return fmt.Errorf("VerifyFrame: %w", err)
	}
	return nil
}

// Verify function assumes the Data stored is coefficients of coset's interpolating poly
func verifyFrame(
	frame *encoding.Frame, g1SRS kzg.G1SRS, commitment *bn254.G1Affine, x *fr.Element, g2Atn *bn254.G2Affine,
) error {
	var xPow fr.Element
	xPow.SetOne()

	for i := 0; i < len(frame.Coeffs); i++ {
		xPow.Mul(&xPow, x)
	}

	var xPowBigInt big.Int

	// [x^n]_2
	var


Point::Native pt;
		DerivePkInternal(pt, Blob(pID, nID));
		pt.Export(pubKey);
	}

	BVM_METHOD(get_Pk)
	{
		DerivePkInternal(m_Secp.m_Point.FindStrict(res).m_Val, Blob(get_AddrR(pID, nID), nID));
	}
	BVM_METHOD_HOST(get_Pk)
	{
		DerivePkInternal(m_Secp.m_Point.FindStrict(Secp::Point::From(res)).m_Val, Blob(pID, nID));
	}

	void ProcessorManager::DeriveKeyPreimage(ECC::Hash::Value& hv, const Blob& b)
	{
		ECC::Hash::Processor()
			<< "bvm.m.key"
			<< b
			>> hv;
	}

	BVM_METHOD(get_PkEx)
	{
		ECC::Hash::Value hv;
		DeriveKeyPreimage(hv, Blob(get_AddrR(pID, nID), nID));
		get_DH_Internal(res, hv, gen);
	}
	BVM_METHOD_HOST(get_PkEx)
	{
		ECC::Hash::Value hv;
		DeriveKeyPreimage(hv, Blob(pID, nID));
		get_DH_Internal(Secp::Point::From(res), hv, Secp::Point::From(gen));
	}

	BVM_METHOD(get_SlotImage)
	{
		ECC::Hash::Value hv;
		get_SlotPreimageInternal(hv, iSlot);

		Exc::Test(m_pPKdf != nullptr);
		m_pPKdf->DerivePKeyG(m_Secp.m_Point.FindStrict(res).m_Val, hv);

	}
	BVM_METHOD_HOST_AUTO(get_SlotImage)

	void ProcessorManager::get_DH_Internal(uint32_t res, const ECC::Hash::Value& hv, uint32_t gen)
	{
		Exc::Test(m_pKdf != nullptr);
		ECC::Scalar::Native sk;
		m_pKdf->DeriveKey(sk, hv);

		// careful: res and gen may not be distinct
		ECC::Point::Native pt = m_Secp.m_Point.FindStrict(gen).m_Val * sk;
		m_Secp.m_Point.FindStrict(res).m_Val = pt;
	}

	BVM_METHOD(get_SlotImageEx)
	{
		ECC::Hash::Value hv;
		get_SlotPreimageInternal(hv, iSlot);

		get_DH_Internal(res, hv, gen);
	}
	BVM_METHOD_HOST_AUTO(get_SlotImageEx)

	BVM_METHOD(SlotInit)
	{
		OnHost_SlotInit(get_AddrR(pExtraSeed, nExtraSeed), nExtraSeed, iSlot);
	}

	BVM_METHOD_HOST(SlotInit)
	{
		Exc::Test(iSlot < Shaders::s_NonceSlots);

		ECC::Hash::Value hv;
		SlotRenegerateInternal(hv, iSlot, pExtraSeed, nExtraSeed);
	}

	BVM_METHOD(get_BlindSk)
	{
		get_BlindSkInternal(res, mul, iSlot, Blob(get_AddrR(pID, nID), nID));
	}
	BVM_METHOD_HOST(get_BlindSk)
	{
		get_BlindSkInternal(Secp::Scalar::From(res), Secp::Scalar::From(mul), iSlot, Blob(pID, nID));
	}

	void ProcessorManager::get_SlotPreimageInternal(ECC::Hash::Value& hv, uint32_t iSlot)
	{
		Exc::Test(iSlot < Shaders::s_NonceSlots);

		if (!SlotLoad(hv, iSlot))
			SlotRenegera


    return successfully.
 */
__API__ k_err_t tos_sem_post(k_sem_t *sem);

/**
 * @brief Post a semaphore.
 * post a semaphore and wakeup all the pending task.
 *
 * @attention when tos_sem_post_all return successfully, all of the tasks who are waitting for the semaphore will be woken up.
 *
 * @param[in]   sem     pointer to the handler of the semaphore.
 *
 * @return  errcode
 * @retval  #K_ERR_SEM_OVERFLOW               we are nesting post a semaphore too much.
 * @retval  #K_ERR_NONE                       return successfully.
 */
__API__ k_err_t tos_sem_post_all(k_sem_t *sem);

#endif

__CDECLS_END

#endif /* _TOS_SEM_H_ */


_SIZE_T)Data < (CX_SIZE_T)Allocator->Allocations)
    {
        FA_ERROR("Data=%p < Allocator->Allocations=%p\n", Data, Allocator->Allocations);
        return CX_STATUS_DATA_NOT_FOUND;
    }
    CX_SIZE_T freedIndex = ((CX_SIZE_T)Data - (CX_SIZE_T)Allocator->Allocations) / Allocator->Header.ManagedAllocations.ElementSize;
    if (freedIndex >= Allocator->Header.ManagedAllocations.TotalEntries)
    {
        FA_ERROR("(freedIndex=%lld >= Allocator->Header.ManagedAllocations.TotalEntries=%d)\n", (CX_UINT64)freedIndex, Allocator->Header.ManagedAllocations.TotalEntries);
        return CX_STATUS_INVALID_PARAMETER_2;
    }

    return _FaPushLinked(Allocator, Allocator->Allocations + freedIndex * Allocator->Header.ManagedAllocations.ElementSize, (CX_UINT32)freedIndex);
}

///
/// @brief        Low-level memory allocation function, fills-in the Data pointer's value with the address of a new allocation from the given Allocator
/// @param[in]    Allocator                        Address of the allocator descriptor of the memory pool to allocate from
/// @param[out]   Data                             Output pointer to receive the address of the allocated element
/// @returns      CX_STATUS_SUCCESS                on success
///
CX_STATUS
FaAllocEx(
    _In_ FA_ALLOCATOR *Allocator,
    _Out_ CX_VOID **Data
)
{
    return _FaAllocLinkedStack(Allocator, Data);
}

///
/// @brief        Low-level function for freeing up an address allocated previously by a call to FaAllocEx
/// @param[in]    Allocator                        Address of the allocator descriptor that manages the memory pool
/// @param[in]    Data                             Address of the allocated memory that is to be freed
/// @returns      CX_STATUS_SUCCESS                on success
///
CX_STATUS
FaFreeEx(
    _In_ FA_ALLOCATOR *Allocator,
    _In_ CX_VOID *Data
)
{
    return _FaFreeLinkedStack(Allocator, Data);
}
/// @}


re,
.nav-file-title .nav-file-title-content::before {
    font-family: 'its';
    margin-right: 6px;
    vertical-align: top;
    font-size: 13px;
    font-weight: 10 !important;
}

.nav-folder-children .nav-folder-title-content::before {
    content: '\e801';
    color: var(--folder);
}
.nav-file-title .nav-file-title-content::before {
    content: '\e800';
    text-align: center;
    color: var(--file);
}

/*Move File Extension to Right*/
.nav-folder-title-content,
.nav-file-title-content {
    width: 100%;
    line-height: 20px;
}
.workspace-leaf-content[data-type="file-explorer"] .nav-file-title {
    flex-direction: row-reverse;
}

/*Inactive Folder Color*/
.is-collapsed .nav-folder-title-content:before {
    color: var(--headers);
}

/*Nav Folder Lines*/
.nav-folder,
.nav-file {
    margin: 0 -2px;
    margin-right: 0px;
    border-left: 2px solid var(--table);
}
/*Align Folder Line*/
.nav-folder-children {
    padding-left: 18px;
}
/*Nav Hover Line Colors*/
.nav-folder:hover,
.nav-file:hover {
    border-color: var(--accent);
}

/*Text wrap*/
.nav-file-title,
.nav-folder-title {
    white-space: normal;
    width: auto;
    border-radius: var(--radius);
    border: 0;
    font-size: calc(var(--f-text) - .12em);
}

/*Folder Bold*/
.nav-folder-title-content {
    font-weight: 600;
}

/*Folder Push Left*/
.nav-folder-title {
    padding-left: 4px;
}
.nav-folder-title:hover {
    color: var(--f-hover) !important;
}

/*File Colors|File Under Folder*/
.nav-file-title {
    padding-left: 5px;
    color: var(--file);
}
.nav-file-title:hover {
    color: var(--f-hover) !important;
    font-weight: 600;
}
.nav-folder-children .nav-file-title-content::before{
    color: var(--f-icon);
}

/*File selected*/
.nav-file-title.is-active {
    background-color: var(--dark-accent);
    color: var(--fg);
}
.nav-file-title.is-active .nav-file-title-content::before {
    color: var(--soft-text);
}

/*Dragged*/
.nav-folder-title.is-being-dragged-over,
.drag-ghost,
.workspace-drop-overlay:before {
    border:none;
    border-radius: var(--radius);
}

/*Arrows*/
.nav-folder .collapse-icon {
    display: none;
}

/*Tooltip Popup*/
.tooltip {
    border-radius: var(--radius);
}

/*-Core Plugin Panes-*/
/*Word Wrap Pane*/
.tree-item-inner {
    word-wrap: break-word;
    width: 100%;
}

/*--Tag Pane--*/
/*Text*/
.tree-item-self {
    color: var(--soft-text);
    border-radius: var(--radius);
}
.tag-container .tree-item-self:hover {
    color: var(--accent);
    font-weight: 600;
}

/*Count Squared*/
.tree-item-flair {
    border-radius: var(--radius);
}

/*Tag Pane Lines*/
.tag-container .tree-item-children {
    margin-left: .7em;
    border-left: 1px


;e ≤ 2.

     *
     * @return the value as a float
     * @throws FIXValueFormatException if the value is not a float
     * @see Fast Path Decimal to Floating-Point Conversion
     */
    public double asFloat() {
        boolean negative = false;

        int i = offset;

        if (bytes[i] == '-') {
            negative = true;

            i++;
        }

        long significand = 0;

        byte b = 0;

        while (i < offset + length) {
            b = bytes[i++];

            if (b < '0' || b > '9')
                break;

            significand = 10 * significand + b - '0';
        }

        if (b != '.' && i < offset + length)
            notFloat();

        int exponent = 0;

        while (i < offset + length) {
            b = bytes[i++];

            if (b < '0' || b > '9')
                notFloat();

            significand = 10 * significand + b - '0';

            exponent++;
        }

        double x = significand / POWERS_OF_TEN[exponent];

        return negative ? -x : +x;
    }

    /**
     * Set the value to a float.
     *
     * @param x a float
     * @param decimals the number of decimals
     * @see #asFloat
     */
    public void setFloat(double x, int decimals) {
        if (x < 0.0) {
            setNegativeFloat(x, decimals);
            return;
        }

        int i = end;

        bytes[--i] = SOH;

        long y = Math.round(POWERS_OF_TEN[decimals] * x);

        for (int j = 0; j < decimals; j++) {
            bytes[--i] = (byte)('0' + y % 10);

            y /= 10;
        }

        if (decimals > 0)
            bytes[--i] = '.';

        do {
            bytes[--i] = (byte)('0' + y % 10);

            y /= 10;
        } while (y > 0);

        offset = i;
        length = end - offset - 1;
    }

    private void setNegativeFloat(double x, int decimals) {
        int i = end;

        bytes[--i] = SOH;

        long y = Math.round(POWERS_OF_TEN[decimals] * -x);

        for (int j = 0; j < decimals; j++) {
            bytes[--i] = (byte)('0' + y % 10);

            y /= 10;
        }

        if (decimals > 0)
            bytes[--i] = '.';

        do {
            bytes[--i] = (byte)('0' + y % 10);

            y /= 10;
        } while (y > 0);

        bytes[--i] = '-';

        offset = i;
        length = end - offset - 1;
    }

    /**
     * Get the value as a string.
     *
     * @return the value as a string
     */
    public CharSequence asString() {
        return this;
    }

    /**
     * Set the value to a string.
     *
     * @param x a string
     * @throws IndexOutOfBoundsException if the string is too long
     */
    public void setString(CharSequence x) {
        offset = 0;
        length = x.length();

        for (int i = 0; i < length; i++)
            bytes[i] = (byte)x.charAt(i);

        bytes[length] = SOH;
    }

    /**
     * Get the value as a date.
     *
     * @param x a date


  logOut(): Observable<any> {
    return this.http.post("/api/users/me/logout", this.httpOptions).pipe(
      tap((data) => {
        data;
      }),
      catchError(this.handleError("logout operation"))
    );
  }

  logOutAll(): Observable<any> {
    return this.http.post("/api/users/me/logoutall", this.httpOptions).pipe(
      tap((data) => {
        data;
      }),
      catchError(this.handleError("logout all operation"))
    );
  }

  /**
   * Handle Http operation that failed.
   * Let the app continue.
   * @param operation - name of the operation that failed
   * @param result - optional value to return as the observable result
   */

  private handleError<T>(operation = "operation", result?: T) {
    return (error: any): Observable<T> => {
      // TODO: send the error to remote logging infrastructure
      console.error(error); // log to console instead
      console.log(operation);
      // TODO: better job of transforming error for user consumption
      // this.log(`${operation} failed: ${error.message}`);

      // Let the app keep running by returning an empty result.
      return of(error as T);
    };
  }
}
import { StyleSheet } from 'react-native';

export default function themer(themes: any, selectedTheme: any, useSheet: boolean = true): object {

  return function theme(styles: any) {

    const cache = {};

    for (const key in styles) {
      (cache as any)[key] = {};
      for (const name in styles[key]) {
        const value = styles[key][name];
        (cache as any)[key][name] = value;
        if (typeof value === 'string') {
          const matchVar = value.match(/var\((.*?)(,.*?)?\)/);
          if (matchVar) {
            const varName = matchVar[1].trim();
            for (const theme in themes) {
              if (themes[theme][varName]) {
                const themeKey = `${key}__theme_${theme}`;
                const themeValue = themes[theme][varName];
                (cache as any)[themeKey] = (cache as any)[themeKey] || {};
                (cache as any)[themeKey][name] = themeValue;
              }
            }
            if (matchVar[2]) {
              const defaultValue = matchVar[2].replace(/^,/, '').trim();
              (cache as any)[key][name] = defaultValue;
            } else {
              delete (cache as any)[key][name];
            }
          }
        }
      }
    }

    function themeSolver() {
      // classNames?
    };

    (themeSolver as any).theme = selectedTheme;

    const sheet = useSheet ? StyleSheet.create(cache) : cache;

    for (const key in sheet) {
      (themeSolver as any)[key] = (sheet as any)[key];
      Object.defineProperty(themeSolver, key, {
        get() {
          const result = [(sheet as any)[key]];
          if ((themeSolver as any).theme) {
            result.push(
              (sheet as any)[`${key}__theme_${(themeSolver as any).theme}`],
            );
          }
          return result;
        },
      });
    }

    return themeSolver;

  };
};

/**
 * Uses radio to synchronize a mesh of devices
 */
namespace radio {
    const RADIO_ID_FIREFLY = 2100;
    const RADIO_FIREFLY_TICK = 1;
    const RADIO_FIREFLY_SYNC = 1;
    // the clock ticker
    let fireflyInterval = 400;
    let fireflyTickInterval = fireflyInterval / 8;
    let fireflyTicks = 0
    control.onEvent(RADIO_ID_FIRE


rimarni naslov za povezavo",
  "primary_connection_address_title": "Primarni naslov za povezavo",
  "primary_connection_title": "Primarna povezava",
  "privacy_policy_title": "Politika zasebnosti",
  "product_title": "Izdelek",
  "progress_title": "Napredek",
  "published_title": "Objavljen",
  "qr_code_scan_error_snackbar_message": "Napaka pri skeniranju kode QR",
  "recently_added_empty_message": "Nedavno dodanih rezultatov ni bilo mogoče najti.",
  "recently_added_title": "Nedavno dodano",
  "recently_watched_title": "Nedavno gledano",
  "reddit_title": "Reddit",
  "request_a_new_language_title": "Zahtevajte nov jezik",
  "search_history_title": "Zgodovina iskanja",
  "seasons": "Sezone",
  "seasons_title": "Sezoni",
  "sec": "sek",
  "secondary_connection_address_explanation_one": "Sekundarni naslov povezave bo uporabljen, če primarni naslov povezave ni dosegljiv.",
  "secondary_connection_address_explanation_two": "To je še posebej uporabno, če vaš javni naslov IP ni dostopen znotraj vašega omrežja.",
  "secondary_connection_address_hint": "Vnesite naslov sekundarne povezave",
  "secondary_connection_address_title": "Sekundarni naslov povezave",
  "secondary_connection_title": "Sekundarna povezava",
  "secs": "sek",
  "select_user_title": "Izberi uporabnika",
  "server_connection_address_dialog_primary_validation": "Vnesite veljavno obliko URL-ja",
  "server_connection_address_dialog_secondary_validation": "Pustite prazno ali vnesite veljavno obliko URL-ja",
  "server_delete_dialog_title": "Ali ste prepričani, da želite izbrisati '{}'?",
  "server_registration_bullet_four": "Prepričajte se, da je Tautullijev naslov dostopen iz drugih naprav.",
  "server_registration_bullet_one": "Odprite spletni vmesnik Tautulli na drugi napravi.",
  "server_registration_bullet_three": "Izberite »Registriraj novo napravo«.",
  "server_registration_bullet_two": "Pomaknite se do Nastavitve > Tautulli Remote App.",
  "server_registration_exit_dialog_content": "Vse trenutno vnesene informacije bodo zavržene.",
  "server_registration_exit_dialog_title": "Ali si prepričan da želiš oditi?",
  "server_registration_title": "Registracija strežnika",
  "server_registration_updated_snackbar_message": "Posodobljena registracija {}",
  "server_timeout_title": "Časovna omejitev strežnika",
  "servers_title": "Strežniki",
  "settings_and_operations_title": "Nastavitve in operacije",
  "settings_load_error_message": "Neznana napaka z nastavitvami.",
  "settings_load_failed_message": "Nastavitev ni bilo mogoče naložiti.",
  "settings_loading_message": "Nastavit


 Plugin#initializePlugin(PluginManager, File)
     */
    public void initializePlugin(PluginManager manager, File pluginDirectory)
    {
        PropertyEventDispatcher.addListener(this);

        // The ComponentImpl implementation expects to be an External Component,
        // which in the case of an Openfire plugin is untrue. As a result, most
        // of its constructor arguments are unneeded when the instance is
        // deployed as an Openfire plugin. None of the values below are expected
        // to be used (but where possible, valid values are provided for good
        // measure).
        final XMPPServerInfo info = XMPPServer.getInstance().getServerInfo();
        final String hostname = info.getHostname();
        final int port = -1;
        final String domain = info.getXMPPDomain();
        final String secret = null;

        final List<String> allowedInterfaces = JiveGlobals.getListProperty( INTERFACES_ALLOWED_PROPERTY_NAME, null );
        if ( allowedInterfaces != null )
        {
            System.setProperty( StackProperties.ALLOWED_INTERFACES, String.join( ";", allowedInterfaces ) );
            System.clearProperty( StackProperties.BLOCKED_INTERFACES );
        }
        else
        {
            System.clearProperty( StackProperties.ALLOWED_INTERFACES );
            System.clearProperty( StackProperties.BLOCKED_INTERFACES );
        }

        final List<String> allowedAddresses = JiveGlobals.getListProperty( ADDRESSES_ALLOWED_PROPERTY_NAME, null );
        if ( allowedAddresses != null )
        {
            System.setProperty( StackProperties.ALLOWED_ADDRESSES, String.join( ";", allowedAddresses ) );
            System.clearProperty( StackProperties.BLOCKED_ADDRESSES );
        }
        else
        {
            System.clearProperty( StackProperties.ALLOWED_ADDRESSES );
            System.clearProperty( StackProperties.BLOCKED_ADDRESSES );
        }

        if ( JiveGlobals.getProperty( AWS_HARVESTER_CONFIG_PROPERTY_NAME ) != null )
        {
            switch ( JiveGlobals.getProperty( AWS_HARVESTER_CONFIG_PROPERTY_NAME ) ) {
                case "disabled":
                    System.setProperty( "org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER", "true" );
                    System.clearProperty( "org.ice4j.ice.harvest.FORCE_AWS_HARVESTER" );
                    break;
                case "forced":
                    System.setProperty( "org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER", "false" );
                    System.setProperty( "org.ice4j.ice.harvest.FORCE_AWS_HARVESTER", "true" );
                    break;
                default:
                    System.clearProperty( "org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER" );
                    System.clearProperty( "org.ice4j.ice.harvest.FORCE_AWS_HARVESTER" );
                    break;
            }
        }
        else
        {
            System.clearProperty( "org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER" );
            System.clearProperty( "org.ice4j.ice.harvest.FORCE_AWS_HARVESTER" );
        }

        if ( JiveGlobals.getProperty( MANUAL_HARVESTER_LOCAL_PROPERTY_NAME ) != null ) {
            System.setProperty( MappingCandidateHarvesters.NAT_HARVESTER_LOCAL_ADDRESS_PNAME, JiveGlobals.getProperty( MANUAL_HARVESTER_LOCAL_PROPERTY_NAME ) );
        } else {
            System.clearProperty( MappingCandidateHarvesters.NAT_HARVESTER_LOCAL_ADDRESS_PNAME );
        }

        if ( JiveGlobal


��', '↙', '⬅', '↖'];

/**
 * Starts a game of Emoji Emoji Revolution.
 *
 * @export
 * @class EmojiEmojiRevolutionCommand
 * @extends {Command}
 */
export default class EmojiEmojiRevolutionCommand extends Command {

	private playing: Set<string> = new Set();

	/**
	 * Creates an instance of EmojiEmojiRevolutionCommand.
	 *
	 * @param {CommandoClient} client
	 * @memberof EmojiEmojiRevolutionCommand
	 */
	public constructor(store: CommandStore, file: string[], directory: string) {
		super(store, file, directory, {
			aliases: ['eer', 'emojiemojirevolution'],
			description: 'Can you type arrow emoji faster than anyone else has ever typed them before?',
			usage: '<opponent:user>'
		});

	}

	/**
	 * Run the "EmojiEmojiRevolution" command.
	 *
	 * @param {KlasaMessage} msg
	 * @returns {(Promise<KlasaMessage | KlasaMessage[]>)}
	 * @memberof EmojiEmojiRevolutionCommand
	 */
	public async run(msg: KlasaMessage, [opponent]: [User]): Promise<KlasaMessage | KlasaMessage[]> {
		if (opponent.bot) return msg.sendSimpleEmbedReply('Bots may not be played against.');
		if (opponent.id === msg.author.id) return msg.sendSimpleEmbedReply('You may not play against yourself.');
		if (this.playing.has(msg.channel.id)) return msg.sendSimpleEmbedReply('Only one fight may be occurring per channel.');

		this.playing.add(msg.channel.id);

		try {
			await msg.sendMessage(`${opponent}, do you accept this challenge?`);

			const verification = await verify(msg.channel, opponent);

			if (!verification) {
				this.playing.delete(msg.channel.id);

				return msg.sendMessage('Looks like they declined...');
			}

			let turn = 0;
			let aPts = 0;
			let oPts = 0;

			while (turn < 10) {
				++turn;
				const emoji = emojis[Math.floor(Math.random() * emojis.length)];

				await msg.sendMessage(emoji);

				const filter = (res: any): boolean => [msg.author.id, opponent.id].includes(res.author.id) && res.content === emoji;
				const win: any = await msg.channel.awaitMessages(filter, {
					max: 1,
					time: 30000
				});

				if (!win.size) {
					await msg.sendMessage('Hmm... No one even tried that round.');

					await delay(1500);

					continue;
				}

				const winner = win.first().author;

				if (winner.id === msg.author.id) {
					++aPts;
				} else {
					++oPts;
				}

				await win.array().forEach((message: Message) => message.delete());

				await msg.sendMessage(stripIndents`
					${winner} won this round!
					**${msg.author.username}**: ${aPts}
					**${opponent.username}**: ${oPts}
				`);

				await delay(1500);
			}

			this.playing.delete(msg.channel.id);

			if (aPts === oPts) return msg.sendMessage('It\'s a tie!');

			const userWin = aPts > oPts;

			return msg.sendMessage(`You win ${userWin ? msg.author : opponent} with ${userWin ? aPts : oPts} points!`);
		} catch (err) {
			this.playing.delete(msg.channel.id);

			throw err;
		}
	}

}
export const enum TileType
  { Straight
  , Corner
  }

export function toImage (type: TileType) {
  switch (type)
  {
    case TileType.Straight:
      return new createjs.Bitmap("images/straight.png");
    case TileType.Corner:
      return new createjs.Bitmap("images/corner.png");
  }
}
import { Identifier } from "../models";
import { ICheckbox } from "../ui/interfaces/Checkbox";
import { CategoryList } from "../ui/molecules/select-multi"


 this._feeds[feedId].proxy;

    }

    removeFeed(feedId) {

        delete this._feeds[feedId];
    }

    /// FEED MANAGEMENT
    _requestFeed(id){
        this._changeState(id, FeedSocketManager.FEED_STATE.REQUESTING_FEED);

        this._socketSend(id, {
            feedId: id
        });
    }

    /// SOCKET MANAGEMENT

    _socketOpened(id, e) {
        this.log(`<${id}> Opened`);

        this._changeState(id, FeedSocketManager.FEED_STATE.OPEN);
    }

    _socketClosed(feedId, e) {
        this.log(`<${feedId}> Closed: ${e.code}`);

        // If the feed as been removed, we no longer care for updates of this socket.
        if(this._feeds[feedId]) {
            // Manually push for socket closure
            // Cases where the server sends ADNORMAL (1006) close event and continues sending messages as if the socket is open.
            this._feeds[feedId].socket.close();

            this._changeState(feedId, FeedSocketManager.FEED_STATE.CLOSED);
        }

    }

    _socketError(id, e) {
        this.log(`<${id}> ERROR`);

        this._changeState(id, FeedSocketManager.FEED_STATE.CLOSED);
    }

    _socketMessageReceived(id, e) {
        //this.log(`<${id}> Rx`)

        this.broadcastEvent(FeedSocketManager.EVENTS.RX, { feedId: id, value: JSON.parse(e.data).value })

        switch(this._feeds[id].state) {
            case FeedSocketManager.FEED_STATE.REQUESTING_FEED:
                let jsonResponse = JSON.parse(e.data);

                if(jsonResponse.status === "accepted") {
                    this._changeState(id, FeedSocketManager.FEED_STATE.RECEIVING);

                } else {
                    throw "Feed Request Rejected :("
                }

                break;

            case FeedSocketManager.FEED_STATE.RECEIVING:
                //this.log(`<${id}>Got a data packet.`);
                this._feeds[id].proxy.broadcastEvent(FeedSocketProxy.EVENTS.NEW_DATA, {data: JSON.parse(e.data)});

                break;
        }
    }

    _socketSend(id, payload) {
        try {
            if(typeof payload !== "string") {
                payload = JSON.stringify(payload);
            }
            this.log(`<${id}> Tx: ` + payload);

            this._feeds[id].socket.send(payload);
        } catch(e) {
            // TODO
            throw "Unhandled Socket Send Exception";
        }
    }

    /// NISC
    _changeState(id, newState) {
        this.log(`<${id}> CHANGE STATE TO: ${newState.toString()}`)
        this.broadcastEvent(FeedSocketManager.EVENTS.FEED_STATE_CHANGE, {
            feedId: id,
            state: newState
        })

        this._feeds[id].state = newState;
    }

    stopFeed(id) {
        this._feeds[id].socket.close();
        this._changeState(id, FeedSocketManager.FEED_STATE.CLOSED);
    }

    restartFeed(id) {
        if(this._feeds[id].state === FeedSocketManager.FEED_STATE.CLOSED){

            delete this._feeds[id].socket;
            this._feeds[id].socket = this._createWebSocket(id);
        } else {
            throw "Cannot restart when feed socket is not in CLOSED state."
        }
    }

    processEvent(event, params) {


_PP_LIST_FOR_EACH_O_D(r, m, d, elem) m(r, d, elem)
#
# /* BOOST_PP_LIST_FOR_EACH_R */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
#    define BOOST_PP_LIST_FOR_EACH_R(r, macro, data, list) BOOST_PP_LIST_FOR_EACH_I_R(r, BOOST_PP_LIST_FOR_EACH_O, (macro, data), list)
# else
#    define BOOST_PP_LIST_FOR_EACH_R(r, macro, data, list) BOOST_PP_LIST_FOR_EACH_R_X(r, macro, data, list)
#    define BOOST_PP_LIST_FOR_EACH_R_X(r, macro, data, list) BOOST_PP_LIST_FOR_EACH_I_R(r, BOOST_PP_LIST_FOR_EACH_O, (macro, data), list)
# endif
#
# endif
# /* Copyright (C) 2001
#  * Housemarque Oy
#  * http://www.housemarque.com
#  *
#  * Distributed under the Boost Software License, Version 1.0. (See
#  * accompanying file LICENSE_1_0.txt or copy at
#  * http://www.boost.org/LICENSE_1_0.txt)
#  *
#  * See http://www.boost.org for most recent version.
#  */
#
# /* Revised by Paul Mensonides (2002) */
#
# ifndef BOOST_PREPROCESSOR_LIST_ADT_HPP
# define BOOST_PREPROCESSOR_LIST_ADT_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/detail/is_binary.hpp>
# include <boost/preprocessor/logical/compl.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
#
# /* BOOST_PP_LIST_CONS */
#
# define BOOST_PP_LIST_CONS(head, tail) (head, tail)
#
# /* BOOST_PP_LIST_NIL */
#
# define BOOST_PP_LIST_NIL BOOST_PP_NIL
#
# /* BOOST_PP_LIST_FIRST */
#
# define BOOST_PP_LIST_FIRST(list) BOOST_PP_LIST_FIRST_D(list)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
#    define BOOST_PP_LIST_FIRST_D(list) BOOST_PP_LIST_FIRST_I list
# else
#    define BOOST_PP_LIST_FIRST_D(list) BOOST_PP_LIST_FIRST_I ## list
# endif
#
# define BOOST_PP_LIST_FIRST_I(head, tail) head
#
# /* BOOST_PP_LIST_REST */
#
# define BOOST_PP_LIST_REST(list) BOOST_PP_LIST_REST_D(list)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
#    define BOOST_PP_LIST_REST_D(list) BOOST_PP_LIST_REST_I list
# else
#    define BOOST_PP_LIST_REST_D(list) BOOST_PP_LIST_REST_I ## list
# endif
#
# define BOOST_PP_LIST_REST_I(head, tail) tail
#
# /* BOOST_PP_LIST_IS_CONS */
#
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()
#    define BOOST_PP_LIST_IS_CONS(list) BOOST_PP_LIST_IS_CONS_D(list)
#    define BOOST_PP_LIST_IS_CONS_D(list) BOOST_PP_LIST_IS_CONS_ ## list
#    define BOOST_PP_LIST_IS_CONS_(head, tail) 1
#    define BOOST_PP_LIST_IS_CONS_BOOST_PP_NIL 0
# else
#    define BOOST_PP_LIST_IS_CONS(list) BOOST_PP_IS_BINARY(list)
# endif
#
#


0];

	 data->axis1 =
                *(CFVector3*)pBase.Names().vertices["Axis1"][0];

         data->vbmi0 = &pBase.KFSet().Mod0("RDoor");
         data->vbmi1 = &pBase.KFSet().Mod0("LDoor");

         pBld_v00->SetAnimationCallback(Bld_v00Callback);
         pBld_v00->SetUserAttrib(data);
    }

    CNameDecl     &ctl_09Arr = refNames["ctl_09"];
    int       nctl_09Count = ctl_09Arr.Count();

    for( int i = 0 ; i < nctl_09Count ; i++ )
    {
         CViewObjectRef  *pctl_09 = (CViewObjectRef*)ctl_09Arr[i];
         CViewObjectBase &pBase = pctl_09->Model()->BaseSet(0).Base(0);

         KR_ObjectID oID = g_arena.newObject(ctID,"static.ctl_09");
         IStaticObj *data = (IStaticObj*)(g_arena.context->queryInterface(oID,IStaticObjIID));

         data->axis0 =
               (
                *(CFVector3*)pBase.Names().vertices["Axis0"][0]
               -*(CFVector3*)pBase.Names().vertices["Axis0"][1]
               );

         data->vbmi0 = &pBase.KFSet().Mod0("Door");

         pctl_09->SetAnimationCallback(Door_Callback);
         pctl_09->SetUserAttrib(data);
    }

    CNameDecl  &Bld_a02Arr = refNames["bld_a02"];      // array of objects named "mill"
    int       nBld_a02Count = Bld_a02Arr.Count(); // number of objects named "mill"

    for( int i = 0 ; i < nBld_a02Count ; i++ )
    {
         CViewObjectRef  *pBld_a02 = (CViewObjectRef*)Bld_a02Arr[i];
         CViewObjectBase &pBase = pBld_a02->Model()->BaseSet(0).Base(0);

         KR_ObjectID oID = g_arena.newObject(ctID,"static.Bld_a02");
         IStaticObj *data = (IStaticObj*)(g_arena.context->queryInterface(oID,IStaticObjIID));

         data->axis0 =
               (
                *(CFVector3*)pBase.Names().vertices["Axis0"][0]
               +*(CFVector3*)pBase.Names().vertices["Axis0"][1]
               ) * 0.5;

         data->axis1 =
               (
                *(CFVector3*)pBase.Names().vertices["Axis1"][0]
               +*(CFVector3*)pBase.Names().vertices["Axis1"][1]
               ) * 0.5;

	 data->axis2 =
               (
                *(CFVector3*)pBase.Names().vertices["Axis2"][0]
               -*(CFVector3*)pBase.Names().vertices["Axis2"][1]
               );

         data->vbmi0 = &pBase.KFSet().Mod0("Vorot");
         data->vbmi1 = &pBase.KFSet().Mod0("Porsh");
         data->vbmi2 = &pBase.KFSet().Mod0("Guns");

         pBld_a02->SetAnimationCallback(Bld_a02Callback);
         pBld_a02->SetUserAttrib(data);
    }

    CNameDecl  &Bld_a03Arr = refNames["bld_a03"];      // array of objects named "mill"
    int       nBld_a03Count = Bld_a03Arr.Count(); // number of objects named "mill"

    for( int i = 0 ; i < nBld_a03Count ; i++ )
    {
         CViewObjectRef  *pBld_a03 = (CViewObjectRef*)Bld_a03Arr[i];
         CViewObjectBase &pBase = pBld_a03->Model()->BaseSet(0).Base(0);

         KR_O


哪一部分进行扫描。如下截图中，将按 star 数量逆序排序，并扫描第 11 和第 12 个仓库

![](https://mmbiz.qpic.cn/sz_mmbiz_png/79gZQNibQ6ud9Brw2KzO85FxykXOibiaRsH50UNtaZT53icVBHnjBlk5euHNDQ2uoWf02QwXiavxluibdHUn13lj9qnA/640?wx_fmt=png&from=appmsg)

**下载地址**

**点击下方名片进入公众号**

**回复关键字【****240403****】获取******下载链接****

**知 识 星 球**

不做过多吹嘘和夸大宣传，至于分享的内容值不值，大家最好自己去看下，3 天不满意可随时申请退款...。

![](https://mmbiz.qpic.cn/sz_mmbiz_jpg/79gZQNibQ6ufDmpcoyC5XibXzJB5W7U9Le20DCcRicTkgicmjHKDdvoXhvaQPuMpibvrt7OCWbRQokMTmHxMZ44WVWw/640?wx_fmt=jpeg&from=appmsg)

往期推荐工具

[Commando VM 3.0 红队渗透工具集](http://mp.weixin.qq.com/s?__biz=MzA4NzU1Mjk4Mw==&mid=2247488119&idx=1&sn=46b3e67c8df3371ed89345483a28fd81&chksm=9036f4cfa7417dd99eb192885f0027d772137ad5aa5492b11e497e07c99094dd1224202510a0&scene=21#wechat_redirect)

[Hikvision 海康威视数据库账号解密工具](http://mp.weixin.qq.com/s?__biz=MzA4NzU1Mjk4Mw==&mid=2247487695&idx=1&sn=abc501bf88daa8fc338d1d9e8ddafa2d&chksm=9036f677a7417f61ee0ddae07cf2e3158223c862ac7510dd5f35c70f84b4d700d64d0e19f273&scene=21#wechat_redirect)

[很强！Windows11 渗透测试工具包](http://mp.weixin.qq.com/s?__biz=MzA4NzU1Mjk4Mw==&mid=2247486427&idx=1&sn=4a229ee22d428a2c926f9250e6de6a56&chksm=9036ed63a741647536b01e6397483c6cee5eb4dd0ee551728c34e8d0b1a73cfdc64c6c69922b&scene=21#wechat_redirect)

[N！9 个 OA 高危漏洞利用工具 v1.1.6](http://mp.weixin.qq.com/s?__biz=MzA4NzU1Mjk4Mw==&mid=2247486468&idx=1&sn=67e6dc1a332769490a2b3062b6c7a909&chksm=9036eabca74163aa9572b4baee14ad2bc1b16c990c64c9e865b8319a31bc23b0b021a03d4b51&scene=21#wechat_redirect)

[v1.1！最新版 Weblogic 漏洞利用工具](http://mp.weixin.qq.com/s?__biz=MzA4NzU1Mjk4


x<dyn Error>> {
        let mut content = PartialContent::new(ctx);

        let cause = self.cause.compile_as_vec(ctx);
        let effect = self.effect.compile_as_vec(ctx);

        let mut debug_mess = if log_enabled!(Debug) {
            if cause.is_empty() {
                format!("E{:?} @ {{", effect)
            } else if effect.is_empty() {
                format!("C{:?} @ {{", cause)
            } else {
                format!("C{:?} E{:?} @ {{", cause, effect)
            }
        } else {
            String::new()
        };

        for dot in self.get_dots() {
            let id = {
                let mut ctx = ctx.lock().unwrap();
                ctx.share_dot_name(dot)
            };

            if log_enabled!(Debug) {
                debug_mess.push_str(&format!(" {:?}:{:?}", dot, id));
            }

            if !cause.is_empty() {
                content.add_to_causes(id, &cause);
            }

            if !effect.is_empty() {
                content.add_to_effects(id, &effect);
            }
        }

        debug!("TAR compile {} }}", debug_mess);

        Ok(content)
    }
}

#[derive(Clone, PartialEq, Eq, Default, Debug)]
struct FatArrow {
    cause:  Polynomial,
    effect: Polynomial,
}

#[derive(Clone, PartialEq, Eq, Default, Debug)]
pub struct FatArrowRule {
    parts: Vec<FatArrow>,
}

impl FatArrowRule {
    pub(crate) fn from_parts(head: Polynomial, tail: Vec<(BinOp, Polynomial)>) -> Self {
        assert!(!tail.is_empty(), "Single-polynomial fat arrow rule");

        let mut far = Self::default();
        let mut prev = head;

        for (op, poly) in tail.into_iter() {
            match op {
                BinOp::FatTx => {
                    far.parts.push(FatArrow { cause: prev, effect: poly.clone() });
                }
                BinOp::FatRx => {
                    far.parts.push(FatArrow { cause: poly.clone(), effect: prev });
                }
                BinOp::FatDx => {
                    far.parts.push(FatArrow { cause: prev.clone(), effect: poly.clone() });
                    far.parts.push(FatArrow { cause: poly.clone(), effect: prev });
                }
                _ => panic!("Operator not allowed in a fat arrow rule: '{}'.", op),
            }
            prev = poly;
        }
        far
    }
}

impl From<FatArrowRule> for Vec<ThinArrowRule> {
    fn from(far: FatArrowRule) -> Self {
        // FIXME specialize, cloning less than in the borrowed version.
        Vec::from(&far)
    }
}

impl From<&FatArrowRule> for Vec<ThinArrowRule> {
    fn from(far: &FatArrowRule) -> Self {
        // FIT (fat-into-thin) transformation steps.

        // 0. Fat arrow rule with more than two polynomials is first
        // transformed into a sum of two-polynomial fat arrow rules,
        // represented here by parts of `FatArrowRule` type.

        // Step 0. is done in FatArrowRule::from_parts().

        // 1. Each two-polynomial (part of a) fat arrow rule is
        // replaced with a sum of two thin arrow rules, one
        // effect-only, another cause-only.

        let mut tx_tars = Vec::new();
        let mut rx_tars = Vec::new();

        for part in far.parts.iter() {
            let sources = part.cause.flattened_clone();
            let sinks = part.effect.flattened_clone();


TGAN";
    let qgrams = QGrams::new(seq, 3, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![Some(0b_111000), None]);
}

#[test]
fn test_infix_iupac() {
    let seq = b"NAANAAN";
    let qgrams = QGrams::new(seq, 3, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![None]);

    let seq = b"NAANAANTTTNAAN";
    let qgrams = QGrams::new(seq, 3, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![None, Some(0b_111111), None]);

    let seq = b"TTTT!!!TTTT";
    let qgrams = QGrams::new(seq, 4, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![Some(0b_11111111), None, Some(0b_11111111)]);
}

#[test]
fn test_capitalization() {
    let seq_lower_case = b"acgttgca";
    let qgrams_lower_case = QGrams::new(seq_lower_case, 3, Canonical::No, HashFunction::No, false)
        .collect::<Vec<Option<u64>>>();
    let seq_upper_case = b"ACGTTGCA";
    let qgrams_upper_case = QGrams::new(seq_upper_case, 3, Canonical::No, HashFunction::No, false)
        .collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams_lower_case, qgrams_upper_case);
}

#[test]
fn test_qgram_generation_small() {
    let seq = b"ACGT";
    /*
    ACGT
    forward:    00011011
    rev comp:   00011011
    canonical:  00011011
     */
    let qgrams = QGrams::new(seq, 4, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![Some(0b_00_01_10_11)],);

    let qgrams =
        QGrams::new(seq, 4, Canonical::Min, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![Some(0b_00_01_10_11)],);

    let qgrams =
        QGrams::new(seq, 4, Canonical::Max, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(qgrams, vec![Some(0b_00_01_10_11)],);

    let seq = b"TGACT";
    /*
    TGACT  (rc: AGTCA)
    forward:    1110000111 -> 111000, 100001, 000111
    rev comp:              -> 110100, 101101, 001011
    canonical:                110100, 100001, 000111
     */
    let qgrams = QGrams::new(seq, 3, Canonical::No, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(
        qgrams,
        vec![Some(0b_111000), Some(0b_100001), Some(0b_000111)],
    );

    let qgrams =
        QGrams::new(seq, 3, Canonical::Min, HashFunction::No, false).collect::<Vec<Option<u64>>>();
    assert_eq!(
        qgrams,
        vec![Some(0b_110100), Some(0b_100001), Some(0b_000111)],
    );

    let qg


"ลบ ลิงค์","upload":"อัพโหลดไฟล์"},"list":{"bulletedlist":"ลำดับรายการแบบสัญลักษณ์","numberedlist":"ลำดับรายการแบบตัวเลข"},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"ขยายใหญ่","minimize":"ย่อขนาด"},"pastetext":{"button":"วางแบบตัวอักษรธรรมดา","title":"วางแบบตัวอักษรธรรมดา"},"pastefromword":{"confirmCleanup":"ข้อความที่คุณต้องการวางลงไปเป็นข้อความที่คัดลอกมาจากโปรแกรมไมโครซอฟท์เวิร์ด คุณต้องการล้างค่าข้อความดังกล่าวก่อนวางลงไปหรือไม่?","error":"ไม่สามารถล้างข้อมูลที่ต้องการวางได้เนื่องจากเกิดข้อผิดพลาดภายในระบบ","title":"วางสำเนาจากตัวอักษรเวิร์ด","toolbar":"วางสำเนาจากตัวอักษรเวิร์ด"},"removeformat":{"toolbar":"ล้างรูปแบบ"},"sourcearea":{"toolbar":"ดูรหัส HTML"},"specialchar":{"options":"Special Character Options","title":"แทรกตัวอักษรพิเศษ","toolbar":"แทรกตัวอักษรพิเศษ"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with


int 6: -180 ~ +180

Connect Status: %s

Servo Infomation: %s

Servo Temperature: %s

Atom Version: %s
"""

def output_robot_message():
    connect_status = False
    servo_infomation = "unknown"
    servo_temperature = "unknown"
    atom_version = "unknown"

    if mc:
        lock = acquire("/tmp/mycobot_lock")
        cn = mc.is_controller_connected()
        release(lock)
        if cn == 1:
            connect_status = True
        time.sleep(0.1)
        lock = acquire("/tmp/mycobot_lock")
        si = mc.is_all_servo_enable()
        release(lock)
        if si == 1:
            servo_infomation = "all connected"

    print(
        robot_msg % (connect_status, servo_infomation,
                     servo_temperature, atom_version)
    )

if __name__ == "__main__":
    # print(MyCobot.__dict__)
    create_handle()
    output_robot_message()
    create_services()


8sApiCoreV1ServiceAccountTokenProjection-objects as value to a dart map
  static Map<String, List<IoK8sApiCoreV1ServiceAccountTokenProjection>> mapListFromJson(dynamic json, {bool growable = false,}) {
    final map = <String, List<IoK8sApiCoreV1ServiceAccountTokenProjection>>{};
    if (json is Map && json.isNotEmpty) {
      // ignore: parameter_assignments
      json = json.cast<String, dynamic>();
      for (final entry in json.entries) {
        map[entry.key] = IoK8sApiCoreV1ServiceAccountTokenProjection.listFromJson(entry.value, growable: growable,);
      }
    }
    return map;
  }

  /// The list of required keys that must be present in a JSON.
  static const requiredKeys = <String>{
    'path',
  };
}

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12

// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars

part of models.k8s;

class IoK8sApiAppsV1ReplicaSetCondition {
  /// Returns a new [IoK8sApiAppsV1ReplicaSetCondition] instance.
  IoK8sApiAppsV1ReplicaSetCondition({
    this.lastTransitionTime,
    this.message,
    this.reason,
    required this.status,
    required this.type,
  });

  /// Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.  Wrappers are provided for many of the factory methods that the time package offers.
  ///
  /// Please note: This property should have been non-nullable! Since the specification file
  /// does not include a default value (using the "default:" property), however, the generated
  /// source code must fall back to having a nullable type.
  /// Consider adding a "default:" property in the specification file to hide this note.
  ///
  DateTime? lastTransitionTime;

  /// A human readable message indicating details about the transition.
  ///
  /// Please note: This property should have been non-nullable! Since the specification file
  /// does not include a default value (using the "default:" property), however, the generated
  /// source code must fall back to having a nullable type.
  /// Consider adding a "default:" property in the specification file to hide this note.
  ///
  String? message;

  /// The reason for the condition's last transition.
  ///
  /// Please note: This property should have been non-nullable! Since the specification file
  /// does not include a default value (using the "default:" property), however, the generated
  /// source code must fall back to having a nullable type.
  /// Consider adding a "default:" property in the specification file to hide this note.
  ///
  String? reason;

  /// Status of the condition, one of True, False, Unknown.
  String status;

  /// Type of replica set condition.
  String type;

  @override
  bool operator ==(Object other) => identical(this, other) || other is IoK8sApiAppsV1ReplicaSetCondition &&
    other.lastTransitionTime == lastTransitionTime &&
    other.message == message &&
    other.reason == reason &&
    other.status == status &&
    other.type == type;

  @override
  int get hashCode =>
    // ignore: unnecessary_parenthesis
    (lastTransitionTime == null ? 0 : lastTransitionTime!.hashCode) +
    (message == null ? 0 : message!.hashCode) +
    (reaso


 result",
		"netuid", netuid,
		"mechanism_type", mechanismType.String(),
		"subnet_hetu", subnetHetu.String(),
		"reserved", reserved.String(),
		"subnet_alpha_in", subnetAlphaIn.String(),
		"subnet_alpha_out", subnetAlphaOut.String(),
		"current_price", currentPrice.String(),
		"moving_price", movingPrice.String(),
		"total_volume", totalVolume.String())

	// 6. Get the chain state
	currentTaoIn := k.eventKeeper.GetSubnetTAO(ctx, netuid)
	currentAlphaIn := k.eventKeeper.GetSubnetAlphaIn(ctx, netuid)
	currentAlphaOut := k.eventKeeper.GetSubnetAlphaOut(ctx, netuid)

	k.Logger(ctx).Debug("Current chain state",
		"netuid", netuid,
		"current_tao_in", currentTaoIn.String(),
		"current_alpha_in", currentAlphaIn.String(),
		"current_alpha_out", currentAlphaOut.String())

	// 7. Check if the chain state is consistent with the contract state
	contractTaoIn := math.NewIntFromBigInt(subnetHetu)
	contractAlphaIn := math.NewIntFromBigInt(subnetAlphaIn)
	// No longer use the AlphaOut value of the contract
	// contractAlphaOut := math.NewIntFromBigInt(subnetAlphaOut)

	// 8. Only update TaoIn and AlphaIn, do not update AlphaOut

	// 8.1 Handle TaoIn
	if !currentTaoIn.Equal(contractTaoIn) {
		k.Logger(ctx).Info("Updating chain TaoIn to match contract",
			"netuid", netuid,
			"old_tao_in", currentTaoIn.String(),
			"new_tao_in", contractTaoIn.String())
		k.eventKeeper.SetSubnetTaoIn(ctx, netuid, contractTaoIn)
	}

	// 8.2 Handle AlphaIn
	if !currentAlphaIn.Equal(contractAlphaIn) {
		k.Logger(ctx).Info("Updating chain AlphaIn to match contract",
			"netuid", netuid,
			"old_alpha_in", currentAlphaIn.String(),
			"new_alpha_in", contractAlphaIn.String())
		k.eventKeeper.SetSubnetAlphaIn(ctx, netuid, contractAlphaIn)
	}

	// 8.3 No longer handle AlphaOut, keep the chain value
	k.Logger(ctx).Debug("Keeping chain AlphaOut value (not syncing from contract)",
		"netuid", netuid,
		"chain_alpha_out", currentAlphaOut.String(),
		"contract_alpha_out", subnetAlphaOut.String())

	// 9. Update the moving average price
	// Get the current moving average price
	currentMovingPrice := k.eventKeeper.GetMovingAlphaPrice(ctx, netuid)
	contractMovingPriceDec := math.LegacyNewDecFromBigInt(movingPrice)

	// If the moving average price is inconsistent, update the chain state
	if !currentMovingPrice.Equal(contractMovingPriceDec) {
		k.Logger(ctx).Info("Updating moving price",
			"netuid", netuid,
			"old_moving_price", currentMovingPrice.String(),
			"new_moving_price", contractMovingPriceDec.String())

		// Use the UpdateMovingPrice method to update the moving average price
		// Get the EMAPriceHalvingBlocks of the subnet
		halvingBlocks := subnet.EMAPriceHalvingBlocks
		// Use the moving average price of the contract as the basis, call UpdateMovingPrice to update
		params := k.GetParams(ctx)

		// Apply the contract moving price to the chain state
		// First, set the current moving price from the contract to ensure synchronization
		k.eventKeeper.SetSubnetMovingPrice(ctx, netuid, contractMovingPriceDec)

		// Then apply the EMA update for future price movements
		k.eventKeeper.UpdateMovingPrice(ctx, netu


/*
 *
 * Copyright 2021-2025 Software Radio Systems Limited
 *
 * This file is part of srsRAN.
 *
 * srsRAN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * srsRAN is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#pragma once

#include <yaml-cpp/yaml.h>

namespace srsran {

struct fapi_unit_config;

/// Fills the given node with the FAPI configuration values.
void fill_fapi_config_in_yaml_schema(YAML::Node& node, const fapi_unit_config& config);

} // namespace srsran


/*
 * ext_dsplib.c
 *
 *  Created on: 23 Dec 2016
 *      Author: Gopalakrishna  Hegde, NTU Singapore.
 */

#include "dsplib.h"

#pragma CODE_SECTION(DSP_vs_add16_unroll_4, ".text:optimized");
void DSP_vs_add16_unroll_4 (
    short * restrict x,   /* Input array of length nx  */
    short y,   			  /* Scalar value to be added */
    short * restrict r,   /* Output array of length nx. even though the output array can be same as input in this case(because it is pointwise op) using restrict to fool the compiler*/
    int              nx   /* Number of elements.       */
)
{
    int i;

    _nassert(((int)x & 4) ==0);
    _nassert(((int)r & 4) ==0);
    #pragma MUST_ITERATE(4,,4);
    #pragma UNROLL(4);

    for(i=0; i<nx; i++) {
        r[i] = x[i] + y;
    }
}

#pragma CODE_SECTION(DSPF_vs_add_unroll_4, ".text:optimized");
void DSPF_vs_add_unroll_4 (
    float * restrict x,   /* Input array of length nx  */
    float y,   			  /* Scalar to be added */
    float * restrict r,   /* Output array of length nx */
    int              nx   /* Number of elements.       */
)
{
    int i;

    _nassert(((int)x & 7) ==0);
    _nassert(((int)y & 7) ==0);
    _nassert(((int)r & 7) ==0);
    #pragma MUST_ITERATE(4,,4);
    #pragma UNROLL(4);

    for(i=0; i<nx; i++) {
        r[i] = x[i] + y;
    }
}

#pragma CODE_SECTION(DSP_vs_add_unroll_8, ".text:optimized");
void DSP_vs_add_unroll_8 (
    short * restrict x,   /* Input array of length nx  */
    short y,   			  /* Scalar to be added */
    int              nx   /* Number of elements.       */
)
{
    int i, n, rem;

    // Perform scalar computations until x is 8byte aligned.
    while((int)x % 8 != 0) {
    	*x = *x + y;
    	x++;
    	nx--;
    }

    n = (nx / 8) * 8;
    rem = nx % 8;

    #pragma MUST_ITERATE(8,,8);
    #pragma UNROLL(8);
    for(i = 0; i < n; i++) {
        x[i] += y;
    }

    for(i = n; i < n + rem; i++) {
    	x[i] += y;
    }
}

// This does x * s + t where x is a vector of length nx and s,t are scalars
#pragma CODE_SECTION(DSP_vector_scale_translate, ".text.optimized");
void DSP_vector_scale_translate(
		short * restrict x,
		short * restrict y,
		short s,
		short t,
		int nx,
		short shift
	) {
    int i, n, rem;

    // Perform scalar computations until x is 8byte aligned.
    while((int)x % 8 != 0) {
    	*y = ((*x * s) >> shift ) + t;
    	x++; y++;
    	nx--;
    }

    n = (nx / 8) * 8;
    rem = nx % 8;
    #pragma MUST_ITERATE(8,,8);
    #pragma UNROLL(8);
    for(i = 0; i < n; i++) {
        y[i] = ((x[i] * s) >> shift) + t;
    }

    for(i = n; i < n + rem; i++) {
    	y[i] = ((x[i] * s) >> shift) + t;
    }
}

#pragma CODE_SECTION(DSP_fix_max_pool, ".text:optimized");
void DSP_fix_max_pool(
		short * restrict p_mat, // must be 8 byte aligned
		int n_rows,
		int n_cols,		//must be multiple of 8
		short *restrict p_out
		) {
	int row;

	for(row = 0; row < n_rows; row++) {
		p_out[row] = DSP_maxval(p_mat + row * n_cols, n_cols);
	}
}


st       D5,     C1,    0x00 //c1: 0 1 2 3

    addi.d     C0,     C0,    0x10
    addi.d     C1,     C1,    0x10
#endif

#if defined(TRMMKERNEL)
#if (defined(LEFT) && defined(TRANSA)) || (!defined(LEFT) && !defined(TRANSA))
    sub.d      TL,     K,    OFF
#ifdef LEFT
    addi.d     TL,     TL,   -4
#else
    addi.d     TL,     TL,   -2
#endif
    slli.d     T3,     TL,   0x05
    add.d      A0,     A0,   T3
    slli.d     T3,     TL,   0x04
    add.d      B0,     B0,   T3
#endif

#ifdef LEFT
    addi.d     OFF,    OFF,   4
#endif
#endif   // #if defined(TRMMKERNEL)

.L280:   /* if ( bm & 2 )*/
    move       I,      $r0
    andi       T1,     M,     2    //bm&2
    beq        I,      T1,    .L284

.L281:
    move       B0,     B      //ptrbb
    move       TL,     K      /* TL = bk */
#if defined(TRMMKERNEL)
#if (defined(LEFT) &&  defined(TRANSA)) ||(!defined(LEFT) && !defined(TRANSA))
    move       B0,     B    //ptrbb
#else
    slli.d     T3,     OFF,   0x04
    add.d      A0,     A0,    T3
    add.d      B0,     B,     T3
#endif

#if (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
    sub.d      TL,     K,     OFF
#elif defined(LEFT)
    addi.d     TL,     OFF,   2
#else
    addi.d     TL,     OFF,   2
#endif

#endif  // #if defined(TRMMKERNEL)

    vxor.v    U0,     U0,   U0
    vxor.v    U1,     U1,   U1

    move       L,      $r0   //cycle param k
    beq        L,      TL,    .L283
    blt        TL,     L,     .L283

.L282:  /* for (k=0; k<temp; k++) */
    vld       D0,     A0,    0x00  // a0ri a1ri
    vld       D2,     B0,    0x00  // b0ri b1ri

    vshuf4i.w  D4,     D0,    0xa0  //a0rr a1rr
    vshuf4i.w  D5,     D0,    0xf5  //a0ii a1ii

    vshuf4i.w  D6,     D2,    0x88  //b0r b1r b0r b1r
    vshuf4i.w  D7,     D2,    0xdd  //b0i b1i b0i b1i

    VMADD1    U0,     D4,    D6,     U0  //00r 10r 01r 11r
    VMADD2    U1,     D5,    D6,     U1  //00i 10i 01i 11i
    VMADD3    U0,     D5,    D7,     U0
    VMADD4    U1,     D4,    D7,     U1

    addi.d     A0,     A0,    0x10
    addi.d     B0,     B0,    0x10

    addi.d     L,      L,     1
    blt        L,      TL,    .L282

.L283:
#i