 distance as weighted by Keselj (2003).
 * N.b. this was the AAAC 2004 winner when used with "common N-grams"
 *
 * @author Juola
 * @version 4.2
 */
public class KeseljWeightedDistance extends DistanceFunction {
	public String displayName() {
		return "Keselj-weighted Distance";
	}

	public String tooltipText() {
		return "Histogram Distance (L2 Norm) with Keselj-weighting based on overall frequency";
	}

	public boolean showInGUI() {
		return true;
	}

	/**
	 * Returns Keselj-weighted distance between event sets es1 and es2.
	 *
	 * @param es1
	 *            The first EventSet
	 * @param es2
	 *            The second EventSet
	 * @return the (Euclidean) histogram distance between them
	 */

	@Override
	public double distance(Histogram unknownHistogram, Histogram knownHistogram) {

		double distance = 0.0;

		for (Event event : unknownHistogram.uniqueEvents()) {
			double fa, fx;

			fa = unknownHistogram.relativeFrequency(event);
			fx = knownHistogram.relativeFrequency(event);

			// note denominator for Keselj-weighting
			distance += ( (fa-fx)*(fa-fx) )/
				    ( (fa+fx)*(fa+fx) );
			// also note what happens if fx or fa == 0

			//System.out.println("fa is " + fa);
			//System.out.println("fx is " + fx);
			//System.out.println("distance is " + distance);
		}

		for (Event event : knownHistogram.uniqueEvents()) {

			//  note that if fx == 0, the formula above == 1

			if (!unknownHistogram.contains(event)) {
				// so we simplify a bit
				distance += 1.0;
			}
		}
		//System.out.println("Calculation complete");
		return distance;
	}
}
package com.jgaap.distances;

import java.util.Set;

import com.google.common.collect.Sets;
import com.jgaap.generics.DistanceCalculationException;
import com.jgaap.generics.DistanceFunction;
import com.jgaap.util.Event;
import com.jgaap.util.Histogram;

/**
 * Chord Distance
 * d = sqrt( 2 - 2 * (sum(xi * yi)/sqrt( sum(xi)^2 * sum(yi)^2 )) )
 *
 * @author Adam Sargent
 * @version 1.0
 */

public class ChordDistance extends DistanceFunction {

	@Override
	public String displayName() {
		return "Chord Distance";
	}

	@Override
	public String tooltipText() {
		return "Chord Distance";
	}

	@Override
	public boolean showInGUI() {
		return true;
	}

	@Override
	public double distance(Histogram unknownHistogram, Histogram knownHistogram)
			throws DistanceCalculationException {
		Set<Event> events = Sets.union(unknownHistogram.uniqueEvents(), knownHistogram.uniqueEvents());

		double distance = 0.0, sumNumer = 0.0, sumUnknown = 0.0, sumKnown = 0.0;

		for(Event event : events){
			sumNumer += unknownHistogram.relativeFrequency(event) * knownHistogram.relativeFrequency(event);
			sumUnknown += unknownHistogram.relativeFrequency(event);
			sumKnown += knownHistogram.relativeFrequency(event);
		}
		distance = Math.sqrt(2 - 2 * (sumNumer / Math.sqrt(sumUnknown * sumUnknown * sumKnown * sumKnown)));

		return distance;
	}

}
/*
 * JGAAP -- a graphical program for stylometric authorship attribution
 * Copyright (C) 2009,2011 by Patrick Juola
 *
 * This program 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even


0.625rem;\n  padding-bottom: 0.625rem;\n}\n.py-3 {\n  padding-top: 0.75rem;\n  padding-bottom: 0.75rem;\n}\n.pl-4 {\n  padding-left: 1rem;\n}\n.pt-0 {\n  padding-top: 0px;\n}\n.text-left {\n  text-align: left;\n}\n.text-center {\n  text-align: center;\n}\n.text-right {\n  text-align: right;\n}\n.font-mono {\n  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;\n}\n.text-2xl {\n  font-size: 1.5rem;\n  line-height: 2rem;\n}\n.text-3xl {\n  font-size: 1.875rem;\n  line-height: 2.25rem;\n}\n.text-sm {\n  font-size: 0.875rem;\n  line-height: 1.25rem;\n}\n.text-xs {\n  font-size: 0.75rem;\n  line-height: 1rem;\n}\n.font-bold {\n  font-weight: 700;\n}\n.font-medium {\n  font-weight: 500;\n}\n.font-semibold {\n  font-weight: 600;\n}\n.italic {\n  font-style: italic;\n}\n.text-blue-600 {\n  --tw-text-opacity: 1;\n  color: rgb(37 99 235 / var(--tw-text-opacity, 1));\n}\n.text-gray-500 {\n  --tw-text-opacity: 1;\n  color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n  --tw-text-opacity: 1;\n  color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-700 {\n  --tw-text-opacity: 1;\n  color: rgb(55 65 81 / var(--tw-text-opacity, 1));\n}\n.text-gray-800 {\n  --tw-text-opacity: 1;\n  color: rgb(31 41 55 / var(--tw-text-opacity, 1));\n}\n.text-indigo-700 {\n  --tw-text-opacity: 1;\n  color: rgb(67 56 202 / var(--tw-text-opacity, 1));\n}\n.text-red-700 {\n  --tw-text-opacity: 1;\n  color: rgb(185 28 28 / var(--tw-text-opacity, 1));\n}\n.text-white {\n  --tw-text-opacity: 1;\n  color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.shadow-lg {\n  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n  --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n  --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.filter {\n  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.transition-colors {\n  transition-property: colo


(), 2.);
	}

	// Jump to next valid position with the cursor
	// -13 -> -3 -> -2 -> ... (cursor will be automatically set behind the 3)
	{
		NumberSpinBox sb;
		sb.lineEdit()->setText(QStringLiteral("-13"));
		sb.lineEdit()->setCursorPosition(2);
		QKeyEvent event(QKeyEvent::Type::KeyPress, Qt::Key_Up, Qt::KeyboardModifier::NoModifier);
		sb.keyPressEvent(&event);
		VALUES_EQUAL(sb.value(), -3.);
		sb.keyPressEvent(&event);
		VALUES_EQUAL(sb.value(), -2.);
	}
}

void SpinBoxTest::numberSpinBoxLimit() {
	NumberSpinBox sb(5);
	sb.setMaximum(7);
	sb.setMinimum(3);

	int valueChangedCounter = 0;
	double lastValue = NAN;
	connect(&sb, QOverload<double>::of(&NumberSpinBox::valueChanged), [&valueChangedCounter, &lastValue](double value) {
		lastValue = value;
		valueChangedCounter++;
	});

	sb.lineEdit()->setCursorPosition(1);
	sb.increaseValue();
	VALUES_EQUAL(sb.value(), 6.);
	QCOMPARE(valueChangedCounter, 1);
	QCOMPARE(lastValue, 6);
	sb.increaseValue();
	VALUES_EQUAL(sb.value(), 7.);
	QCOMPARE(valueChangedCounter, 2);
	QCOMPARE(lastValue, 7);
	sb.increaseValue();
	VALUES_EQUAL(sb.value(), 7.); // unable to go beyond
	QCOMPARE(valueChangedCounter, 2);

	sb.setValue(4);
	QCOMPARE(valueChangedCounter, 3);
	sb.lineEdit()->setCursorPosition(1);
	VALUES_EQUAL(sb.value(), 4.);
	QCOMPARE(valueChangedCounter, 3);
	sb.decreaseValue();
	VALUES_EQUAL(sb.value(), 3.);
	QCOMPARE(valueChangedCounter, 4);
	QCOMPARE(lastValue, 3);
	sb.decreaseValue();
	VALUES_EQUAL(sb.value(), 3.);
	QCOMPARE(valueChangedCounter, 4);

	// Try to insert a number
	sb.lineEdit()->setCursorPosition(1);
	// Important: the event text is used by the lineedit. So it has to be filled!
	QKeyEvent event(QKeyEvent::Type::KeyPress, Qt::Key_1, Qt::KeyboardModifier::NoModifier, QStringLiteral("1"));
	sb.keyPressEvent(&event);
	QCOMPARE(valueChangedCounter, 4);
	VALUES_EQUAL(sb.value(), 3.);
}

void SpinBoxTest::numberSpinBoxPrefixSuffix() {
	NumberSpinBox sb(5.01);
	sb.setMaximum(7);
	sb.setMinimum(3);

	int valueChangedCounter = 0;
	double lastValue = NAN;
	connect(&sb, QOverload<double>::of(&NumberSpinBox::valueChanged), [&valueChangedCounter, &lastValue](double value) {
		lastValue = value;
		valueChangedCounter++;
	});

	sb.setPrefix(QStringLiteral("Prefix "));
	sb.setSuffix(QStringLiteral(" Suffix"));

	QCOMPARE(sb.lineEdit()->text(), QStringLiteral("Prefix 5.01 Suffix"));

	sb.lineEdit()->setCursorPosition(14); // In suffix text
	QKeyEvent event(QKeyEvent::Type::KeyPress, Qt::Key_Up, Qt::KeyboardModifier::NoModifier);
	sb.keyPressEvent(&event);

	QCOMPARE(valueChangedCounter, 1);
	QCOMPARE(sb.value(), 5.02);
	QCOMPARE(sb.lineEdit()->text(), QStringLiteral("Prefix 5.02 Suffix"));
}

void SpinBoxTest::numberSpinBoxSuffixFrontToBackSelection() {
	// Select from front to back
	NumberSpinBox sb;
	sb.setSuffix(QStringLiteral(" cm")); // whitespace is important!

	sb.setValue(5);
	QCOMPARE(sb.lineEdit()->text(), QStringLiteral(


), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [indirectwritexferwatermark](indirectwritexferwatermark) module"]
pub type INDIRECTWRITEXFERWATERMARK = crate::Reg<u32, _INDIRECTWRITEXFERWATERMARK>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _INDIRECTWRITEXFERWATERMARK;
#[doc = "`read()` method returns [indirectwritexferwatermark::R](indirectwritexferwatermark::R) reader structure"]
impl crate::Readable for INDIRECTWRITEXFERWATERMARK {}
#[doc = "`write(|w| ..)` method takes [indirectwritexferwatermark::W](indirectwritexferwatermark::W) writer structure"]
impl crate::Writable for INDIRECTWRITEXFERWATERMARK {}
#[doc = "Indirect Write Transfer Watermark Register"]
pub mod indirectwritexferwatermark;
#[doc = "Indirect Write Transfer Start Address Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [indirectwritexferstart](indirectwritexferstart) module"]
pub type INDIRECTWRITEXFERSTART = crate::Reg<u32, _INDIRECTWRITEXFERSTART>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _INDIRECTWRITEXFERSTART;
#[doc = "`read()` method returns [indirectwritexferstart::R](indirectwritexferstart::R) reader structure"]
impl crate::Readable for INDIRECTWRITEXFERSTART {}
#[doc = "`write(|w| ..)` method takes [indirectwritexferstart::W](indirectwritexferstart::W) writer structure"]
impl crate::Writable for INDIRECTWRITEXFERSTART {}
#[doc = "Indirect Write Transfer Start Address Register"]
pub mod indirectwritexferstart;
#[doc = "Indirect Write Transfer Number Bytes Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [indirectwritexfernumbytes](indirectwritexfernumbytes) module"]
pub type INDIRECTWRITEXFERNUMBYTES = crate::Reg<u32, _INDIRECTWRITEXFERNUMBYTES>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _INDIRECTWRITEXFERNUMBYTES;
#[doc = "`read()` method returns [indirectwritexfernumbytes::R](indirectwritexfernumbytes::R) reader structure"]
impl crate::Readable for INDIRECTWRITEXFERNUMBYTES {}
#[doc = "`write(|w| ..)` method takes [indirectwritexfernumbytes::W](indirectwritexfernumbytes::W) writer structure"]
impl crate::Writable for INDIRECTWRITEXFERNUMBYTES {}
#[doc = "Indirect Write Transfer Number Bytes Register"]
pub mod indirectwritexfernumbytes;
#[doc = "Indirect Trigger Address Range Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::gen


=R>,A:?Sized> SubAssign for ModuleString<R,T,A> {
    fn sub_assign(&mut self, rhs:Self) {self.insert(rhs, |r| -r)}
}

impl<T:Hash+Eq,R:AddAssign,A:?Sized> AddAssign<(R,T)> for ModuleString<R,T,A> {
    fn add_assign(&mut self, rhs:(R,T)) {self.insert_term(rhs, |r| r)}
}
impl<T:Hash+Eq,R:AddAssign+Neg<Output=R>,A:?Sized> SubAssign<(R,T)> for ModuleString<R,T,A> {
    fn sub_assign(&mut self, rhs:(R,T)) {self.insert_term(rhs, |r| -r)}
}

impl<T:Hash+Eq,R:AddAssign+One,A:?Sized> AddAssign<T> for ModuleString<R,T,A> {
    fn add_assign(&mut self, rhs:T) {*self+=(R::one(),rhs)}
}
impl<T:Hash+Eq,R:AddAssign+Neg<Output=R>+One,A:?Sized> SubAssign<T> for ModuleString<R,T,A> {
    fn sub_assign(&mut self, rhs:T) {*self-=(R::one(),rhs)}
}

impl<T:Hash+Eq,R:MulAssign+Clone,A:?Sized> MulAssign<R> for ModuleString<R,T,A> {
    fn mul_assign(&mut self, rhs:R) {
        for r2 in self.terms.values_mut() { *r2 *= rhs.clone() }
        self.clean();
    }
}
impl<T:Hash+Eq,R:DivAssign+Clone,A:?Sized> DivAssign<R> for ModuleString<R,T,A> {
    fn div_assign(&mut self, rhs:R) {
        for r2 in self.terms.values_mut() { *r2 /= rhs.clone() }
        self.clean();
    }
}

impl_arith!(impl<T,R,A> AddAssign<&Self>.add_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);
impl_arith!(impl<T,R,A> SubAssign<&Self>.sub_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);

impl_arith!(impl<T,R,A> AddAssign<&T>.add_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);
impl_arith!(impl<T,R,A> SubAssign<&T>.sub_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);

impl_arith!(impl<T,R,A> MulAssign<&R>.mul_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);
impl_arith!(impl<T,R,A> DivAssign<&R>.div_assign for ModuleString<R,T,A> where T:Hash+Eq,A:?Sized);

impl_arith!(impl<T,R,A> Add.add with AddAssign.add_assign for ModuleString<R,T,A> where T:Hash+Eq, A:?Sized);
impl_arith!(impl<T,R,A> Sub.sub with SubAssign.sub_assign for ModuleString<R,T,A> where T:Hash+Eq, A:?Sized);
impl_arith!(impl<T,R,A> Mul.mul with MulAssign.mul_assign for ModuleString<R,T,A> where T:Hash+Eq, A:?Sized);
impl_arith!(impl<T,R,A> Div.div with DivAssign.div_assign for ModuleString<R,T,A> where T:Hash+Eq, A:?Sized);

impl<T:Hash+Eq,R:Neg,A:?Sized> Neg for ModuleString<R,T,A> {
    type Output = ModuleString<R::Output,T,A>;
    fn neg(self) -> Self::Output {
        ModuleString {


 null
        private set

    /* By products of the verification process that may be useful for relying parties to display. */
    private var triedBACEntries: List<BACKey>? = null /* As a result of BAC testing, this contains all tried BAC entries. */
    var hashResults: MutableMap<Int, HashMatchResult>? = null /* As a result of HT testing, this contains stored and computed hashes. */
    private var certificateChain: List<Certificate>? = null /* As a result of CS testing, this contains certificate chain from DSC to CSCA. */
    /**
     * Gets the EAC result.
     *
     * @return the EAC result
     */
    var eacResult: EACTAResult? = null
        private set
    /**
     * Gets the CA result.
     *
     * @return the CA result
     */
    var caResult: EACCAResult? = null
        private set

    /**
     * Outcome of a verification process.
     *
     * @author The JMRTD team (info@jmrtd.org)
     *
     * @version $Revision: 1559 $
     */
    enum class Verdict {
        UNKNOWN, /* Unknown */
        NOT_PRESENT, /* Not present */
        NOT_CHECKED, /* Present, not checked */
        FAILED, /* Present, checked, and not ok */
        SUCCEEDED
        /* Present, checked, and ok */
    }

    /**
     * Constructs a new status with all verdicts
     * set to UNKNOWN.
     */
    constructor() {
        setAll(Verdict.UNKNOWN, null)
    }

    /**
     * Sets the AA verdict.
     *
     * @param v the status to set
     * @param reason a reason string
     */
    fun setAA(v: Verdict, reason: String?) {
        this.aa = v
        this.aaReason = reason
    }

    /**
     * Gets the tried BAC entries.
     *
     * @return a list of BAC keys
     */
    fun getTriedBACEntries(): List<*>? {
        return triedBACEntries
    }

    /**
     * Sets the BAC verdict.
     *
     * @param v the status to set
     * @param reason a reason string
     * @param triedBACEntries the list of BAC entries that were tried
     */
    fun setBAC(v: Verdict, reason: String?, triedBACEntries: List<BACKey>?) {
        this.bac = v
        this.bacReason = reason
        this.triedBACEntries = triedBACEntries
    }

    /**
     * Sets the SAC verdict and reason string.
     *
     * @param v a verdict
     * @param reason a reason string
     */
    fun setSAC(v: Verdict, reason: String) {
        this.sac = v
        this.sacReason = reason
    }

    /**
     * Gets the certificate chain between DS and CSCA.
     *
     * @return a certificate chain
     */
    fun getCertificateChain(): List<*>? {
        return certificateChain
    }

    /**
     * Gets the CS verdict.
     *
     * @param v the status to set
     * @param reason the reason string
     * @param certificateChain the certificate chain between DS and CSCA
     */
    fun setCS(v: Verdict, reason: String?, certificateChain: List<Certificate>?) {
        this.cs = v
        this.csReason = reason
        this.certificateChain = certificateChain
    }

    /**
     * Sets the DS verdict.
     *
     * @param v the status to set
     * @param reason reason string
     */
    fun setDS(v: Verdict, reason: String?) {
        this.ds = v
        this.dsReason = reason
    }

    /**
     * Gets the hash match results.
     *
     * @return a list of hash ma


pred1onA, noPredOnA, pred1onA);
        Assertions.hasEnsuredPredicate(r3, ENSURED_PREDICATE);

        Requires r4 = new Requires();
        r4.notPred1onPos1_OR_notPred1onPos2_OR_pred1onPos3(pred1onA, noPredOnA, noPredOnA);
        Assertions.hasEnsuredPredicate(r4, ENSURED_PREDICATE);

        Requires r5 = new Requires();
        r5.notPred1onPos1_OR_notPred1onPos2_OR_pred1onPos3(noPredOnA, noPredOnA, pred1onA);
        Assertions.hasEnsuredPredicate(r5, ENSURED_PREDICATE);

        Requires r6 = new Requires();
        r6.notPred1onPos1_OR_notPred1onPos2_OR_pred1onPos3(noPredOnA, pred1onA, noPredOnA);
        Assertions.hasEnsuredPredicate(r6, ENSURED_PREDICATE);

        Requires r7 = new Requires();
        r7.notPred1onPos1_OR_notPred1onPos2_OR_pred1onPos3(noPredOnA, noPredOnA, noPredOnA);
        Assertions.hasEnsuredPredicate(r7, ENSURED_PREDICATE);

        // assert false
        Requires r8 = new Requires();
        r8.notPred1onPos1_OR_notPred1onPos2_OR_pred1onPos3(pred1onA, pred1onA, noPredOnA);
        Assertions.notHasEnsuredPredicate(r8);

        // one, because all three parameters belong to the same alternative predicate
        Assertions.predicateErrors(1);
    }

    @Test
    public void pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3() {
        A pred1onA = new A();
        pred1onA.ensurePred1onThis();
        Assertions.hasEnsuredPredicate(pred1onA);

        A noPredOnA = new A();
        Assertions.notHasEnsuredPredicate(noPredOnA);

        // assert true
        Requires r1 = new Requires();
        r1.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(pred1onA, pred1onA, pred1onA);
        Assertions.hasEnsuredPredicate(r1, ENSURED_PREDICATE);

        Requires r2 = new Requires();
        r2.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(noPredOnA, pred1onA, pred1onA);
        Assertions.hasEnsuredPredicate(r2, ENSURED_PREDICATE);

        Requires r3 = new Requires();
        r3.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(pred1onA, noPredOnA, pred1onA);
        Assertions.hasEnsuredPredicate(r3, ENSURED_PREDICATE);

        Requires r4 = new Requires();
        r4.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(pred1onA, noPredOnA, noPredOnA);
        Assertions.hasEnsuredPredicate(r4, ENSURED_PREDICATE);

        Requires r5 = new Requires();
        r5.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(pred1onA, pred1onA, noPredOnA);
        Assertions.hasEnsuredPredicate(r5, ENSURED_PREDICATE);

        Requires r6 = new Requires();
        r6.pred1onPos1_OR_pred1onPos2_OR_notPred1onPos3(noPredOnA, pred1onA, noPred


ses `threading.Thread` for non-blocking ops (e.g., web server, event processing).

**Edge Cases**:
- If no camera: Falls back to mock, but logs error.
- Dev mode (`DEVELOPMENT_MODE=true`): Forces mocks, enables web interface.
- Credential issues (e.g., placeholder token): Notifier skips init, logs warning.

#### 3. **Event Handling: Doorbell Press Workflow**
This is the core runtime flow, triggered by hardware or simulation.

**Flow Trace:**
- **Detection** (in `src/gpio_handler.py`):
  - Real: `GPIO.add_event_detect(DOORBELL_PIN, GPIO.FALLING, callback=_doorbell_interrupt)`.
  - Mock: Simulation via `simulate_doorbell_press()` (called from web interface).
  - Calls user-provided callback (e.g., `DoorbellSecuritySystem.on_doorbell_pressed`).
- **on_doorbell_pressed** (in `src/doorbell_security.py`): Debounces (ignores if < `DEBOUNCE_TIME`), spawns thread for `_process_visitor`.
- **_process_visitor**:
  - Acquires lock to prevent concurrent processing.
  - Sets LED to 'processing' via `self.gpio.set_status_led('processing')` (jumps to `gpio_handler.py`; real PWM blinking or mock log).
  - Captures image: `self.camera.capture_image()` (jumps to `camera_handler.py`; retries up to 3x, optional face check).
  - Saves image: `_save_capture` uses `camera.save_image()` (to `data/captures/`).
  - Detects faces: `self.face_manager.detect_faces(image)` (uses `face_recognition` to get encodings).
  - Identifies: For each encoding, `self.face_manager.identify_face(encoding)` (checks blacklist first, then known; computes distances with tolerance).
  - Determines response: `_determine_response(results)` (prioritizes 'blacklisted' > 'unknown' > 'known').
  - Handles response: Calls handlers like `_handle_blacklist_alert` (sets LED 'alert', sends urgent notification).
- **Notification** (in `src/telegram_notifier.py`):
  - Formats message with priority icon/timestamp.
  - Sends async via `telegram.Bot` (photo if enabled, with retries).
  - Broadcasts to main `chat_id` + additional IDs.
- **Logging/LED Reset**: Logs event, resets LED to 'idle'.

**Key Data Flow**:
- Image (numpy array) from camera → face encodings (via `face_recognition`) → identification results (dicts with status/confidence) → formatted message → Telegram.
- LED states flow to `gpio_handler.py` for hardware control.

**Edge Cases**:
- No faces: Sends "No faces detected" notification.
- Capture failure: Retries, then notifies failure.
- Blacklist match: Urgent priority, overrides others.
- Thread safety: Lock prevents overlapping presses.

#### 4. **Web Interface Workflow (`src/web_interface.py`)**
Enabled in dev/cloud mode for testing/monitoring.

**Flow Trace:**
- Initializes Flask app with templates from `templates/` (e.g., `dashboard.html`).
- Routes (e.g., `/api/status`): Calls system methods like `doorbell_system.camera.get_camer-info()`.
- `/api/trigger-doorbell`: Simulates press via `doorbell_system.gpio.simulate_doorbell_press()` (triggers full visitor flow).
- `/api/capture-photo`: Calls `camera.capture_image()`, saves, returns base64 for display.
- `/api/test-face-recognition`: Captures, detects, identifies, returns results.
- Other: Set LEDs, test notifications, get recent events (from logs).

**Integration**: Holds ref to `DoorbellSecuritySystem`, allo


98, 0.27375340}, {0.00369672, 0.06570602}, {-0.03263341, 0.24113718}, {-0.19071907, -0.39896253}, {0.08429704, 0.08285202}, {-0.04881418, 0.14220452}, {0.05111909, 0.08650327}, {-0.08538977, 0.03112904}, {0.08622192, -0.31306490}, {0.16080345, 0.32263219}, {-0.04235193, -0.13290130}, {-0.32436508, -0.13635625}, {0.09672126, 0.02072133}, {-0.24680537, 0.13919182}, {-0.00849139, 0.14055161}, {0.11280481, 0.15705593}, {0.25950032, -0.44774511}, {-0.00990858, 0.10172448}, {-0.19549949, -0.05440876}, {0.07203695, -0.21604843}, {-0.56293827, -0.18760364}, {-0.08685306, 0.24544269}, {-0.10059841, 0.12751982}, {-0.03092339, 0.02571643}, {0.17090051, 0.13704120}, {0.17781353, -0.11759123}, {0.04589049, 0.07708905}, {-0.19339775, -0.36341566}, {0.00652781, -0.21512806}, {0.02916600, -0.32419300}, {0.01194939, -0.05956293}, {-0.13383478, 0.15089606}, {-0.31585079, 0.21050058}, {-0.07852964, 0.12677391}, {0.13911933, 0.00370506}})}
    },
    {
        desc = "Dot product, 15 ComplexFloat32 tap, 256 ComplexFloat32 input, 256 ComplexFloat32 output",
        args = {radio.types.ComplexFloat32.vector_from_array({{0.07548022, 0.04340435}, {-0.06827312, 0.06362931}, {-0.00651232, 0.05236998}, {-0.05067124, -0.05523250}, {0.06375246, -0.03362350}, {-0.07163523, 0.00016433}, {0.07690644, 0.05259605}, {-0.01625711, 0.07729914}, {0.04650900, 0.05362568}, {0.02290520, -0.01655784}, {0.06360314, -0.00460446}, {0.06813888, 0.00818200}, {0.06425337, -0.00358119}, {-0.01147231, 0.01390273}, {-0.02864025, -0.05496395}}), false},
        inputs = {radio.types.ComplexFloat32.vector_from_array({{0.63713509, 0.90673745}, {-0.18339846, 0.25993049}, {-0.38448119, -0.39617923}, {0.01263470, 0.17253532}, {0.09998894, 0.95315933}, {-0.67405754, 0.27332884}, {0.98906201, 0.47227055}, {0.13181703, -0.26327369}, {-0.19572224, 0.87304616}, {0.79066086, 0.33935255}, {0.79749578, 0.85032725}, {0.69268709, -0.23316762}, {-0.07127071, 0.59181499}, {-0.25473395, 0.4987


// <copyright file="Constants.cs" company="James Jackson-South, Jeavon Leopold, and contributors">
// Copyright (c) James Jackson-South, Jeavon Leopold, and contributors. All rights reserved.
// Licensed under the Apache License, Version 2.0.
// </copyright>

namespace Our.Umbraco.FileSystemProviders.Azure.Installer
{
    /// <summary>
    /// Contains constants related to the installer.
    /// </summary>
    public static class Constants
    {
        public const string MediaProviderPostFix = "media";
        /// <summary>
        /// The installer path for the plugin.
        /// </summary>
        public const string InstallerPath = "~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/";

        /// <summary>
        /// The filesystem provider configuration file name.
        /// </summary>
        public const string FileSystemProvidersConfigFile = "FileSystemProviders.config";

        /// <summary>
        /// The Umbraco configuration path.
        /// </summary>
        public const string UmbracoConfigPath = "~/Config/";

        /// <summary>
        /// The web configuration file name.
        /// </summary>
        public const string WebConfigFile = "web.config";

        /// <summary>
        /// The media web configuration xdt file name.
        /// </summary>
        public const string MediaWebConfigXdtFile = "media-web.config";

        /// <summary>
        /// The full qualified type name for the provider.
        /// </summary>
        public const


886] = "Копье грубой силы",
[175888] = "Фрагмент реликвии высокорожденных",
[175889] = "Древнее яйцо",
[175891] = "Фрагмент реликвии высокорожденных",
[175892] = "Фрагмент реликвии высокорожденных",
[175893] = "Фрагмент реликвии высокорожденных",
[175894] = "Посылка Дженис",
[175924] = "Запертый шкаф",
[175925] = "Уборная",
[175926] = "Дневник миссис Далсон",
[175927] = "Каталог Малифоя",
[175928] = "Огненная агава",
[175944] = "Священный огонь Жизни",
[175948] = "Набатный колокол Пиратской бухты",
[175949] = "Пятая табличка Мошару",
[175950] = "Шестая табличка Мошару",
[175964] = "Шкура Тени",
[175965] = "Бальзамировочный состав Ледяного Шепота",
[175966] = "Зачарованная алая нить",
[175970] = "Заготовка рунической кирасы",
[176089] = "Неопалимые латные рукавицы",
[176090] = "Человеческие останки",
[176091] = "Котел Мертвого Леса",
[176092] = "Ящик с зажигательной смесью",
[176112] = "Сейф Малора",
[176115] = "Разыскивается: Арнак Зловещий Тотем",
[176116] = "Голова куклы Памелы",
[176142] = "Левая половинка куклы Памелы",
[176143] = "Правая половинка куклы Памелы",
[176145] = "Памятник Джозефу Редпату",
[176150] = "Заплесневелый фолиант",
[176151] = "Заплесневелый фолиант",
[176158] = "Жаровня Боли",
[176159] = "Жаровня Злобы",
[176160] = "Жаровня Страдания",
[176161] = "Жаровня Ненависти",
[176188] = "Ритуальная свеча",
[176189] = "Скелет морской черепахи",
[176190] = "Останки морской черепахи",
[176191] = "Останки морской черепахи",
[176192] = "Перечень Заблудших",
[176196] = "Останки морской черепахи",
[176197] = "Останки морской черепахи",
[176198] = "Останки морской черепахи",
[176206] = "Манускрипт Дейвила",
[176207] = "Щит Редпата",
[176208] = "Череп Хоргуса",
[176209] = "


"""
Archivo: programa_01.py
Autor: Edwin Yoner
Fecha: 06/03/2025

Descripción:
    Este script genera un gráfico de líneas simple utilizando Matplotlib.
    Se define una serie de valores en el eje Y y se representan en un gráfico
    con etiquetas y una leyenda.

Requisitos:
    - Instalar Matplotlib si no está disponible: `pip install matplotlib`
"""

# Importamos Matplotlib y su módulo pyplot para la visualización de gráficos
import matplotlib
import matplotlib.pyplot as plt

# Imprimimos la versión de Matplotlib instalada
print(f"Versión de Matplotlib: {matplotlib.__version__}")

# Definir los valores del eje Y
valores_y = [1, 2, 3, 4]

# Crear el gráfico de líneas
plt.plot(valores_y, marker='o', linestyle='-', color='b', label="Valores de muestra")

# Configurar etiquetas de los ejes
plt.xlabel("Índice del dato")
plt.ylabel("Valor del dato")

# Agregar un título al gráfico
plt.title("Gráfico de líneas con Matplotlib")

# Mostrar la leyenda
plt.legend()

# Mostrar el gráfico en pantalla
plt.show()


        LineColumn::Valid { line, column } => write!(f, "L{}:{}", line, column),
        }
    }
}
<gh_stars>0
use std::sync::Arc;
use crate::api::user;
use crate::api::user::datasource::UserDataSource;
use crate::api::user::repository::UserRepository;

pub struct Container {
    pub user_repo: Arc<dyn user::repository::Repository>,
}

pub fn inject() -> Container {
    let user_ds = UserDataSource::new();
    let user_repo = UserRepository::new(user_ds);

    Container {
        user_repo: user_repo.clone(),
    }
}<reponame>bertptrs/cryptonight-hash<filename>src/aesni.rs
//! Module implementing the main digest functions using AES and SSE primitives.
//!
//! This module implements the same digest_main function as the aes module does, but explicitly
//! uses AES and SSE instructions in order to improve performance.
//!
//! This module currently requires the following CPU extensions to work:
//!
//! * AES
//! * SSE2 (for most vector operations)
//! * SSE4.1 (for extracting 64bit integers from vectors)
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
use std::mem::size_of;

use slice_cast::cast_mut;

use crate::ROUNDS;

/// Type for a set of explode/implode AES keys.
type KeysType = [__m128i; 10];

#[target_feature(enable = "aes")]
#[target_feature(enable = "sse2")]
pub unsafe fn digest_main(keccac: &mut [u8], scratchpad: &mut [u8]) {
    // Cast to SSE types
    let scratchpad: &mut [__m128i] = cast_mut(scratchpad);
    let keccac: &mut [__m128i] = cast_mut(&mut keccac[..192]);

    init_scratchpad(keccac, scratchpad);
    main_loop(keccac, scratchpad);
    finalize_state(keccac, &scratchpad);
}

/// Derive 10 round keys based on two initial keys.
///
/// This implementation is based on the whitepaper "Intel® Advanced
/// Encryption Standard (AES) New Instructions Set", figure 26.
///
/// This is pretty much rustified C-code.
///
#[target_feature(enable = "aes")]
#[target_feature(enable = "sse2")]
unsafe fn derive_key(mut temp1: __m128i, mut temp3: __m128i) -> KeysType {
    let mut keys = [_mm_setzero_si128(); 10];
    keys[0] = temp1;
    keys[1] = temp3;

    #[inline(always)]
    unsafe fn key_256_assist_1(temp1: &mut __m128i, mut temp2: __m128i) {
        temp2 = _mm_shuffle_epi32(temp2, 0xff);
        let mut temp4 = _mm_slli_si128(*temp1, 0x4);
        *temp1 = _mm_xor_si128(*temp1, temp4);
        temp4 = _mm_slli_si128(temp4, 0x4);
        *temp1 = _mm_xor_si128(*temp1, temp4);
        temp4 = _mm_slli_si128(temp4, 0x4);
        *temp1 = _mm_xor_si128(*temp1, temp4);
        *temp1 = _mm_xor_si128(*temp1, temp2);
    }

    #[inline(always)]
    unsafe fn key_256_assist_2(temp1: &__m128i, temp3: &mut __m128i) {
        let mut temp4 = _mm_aeskeygenassist_si128(*temp1, 0x0);
        let temp2 = _mm_shuffle_epi32(temp4, 0xaa);
        temp4 = _mm_slli_si128(*temp3, 0x4);
        *temp3 = _mm_xor_si128(*temp3, temp4);
        temp4 = _mm_slli_si128(temp4, 0x4);
        *temp3 = _mm_xor_si128(*temp3, temp4);
        temp


#region License Information
/* HeuristicLab
 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
 *
 * This file is part of HeuristicLab.
 *
 * HeuristicLab is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * HeuristicLab is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
 */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using HeuristicLab.Algorithms.DataAnalysis;
using HeuristicLab.Common;
using HeuristicLab.MainForm;
using HeuristicLab.Optimization;

namespace HeuristicLab.Problems.DataAnalysis.Views {
  [View("Error Characteristics Curve")]
  [Content(typeof(IRegressionSolution))]
  public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView {
    protected const string TrainingSamples = "Training";
    protected const string TestSamples = "Test";
    protected const string AllSamples = "All Samples";

    public RegressionSolutionErrorCharacteristicsCurveView()
      : base() {
      InitializeComponent();

      cmbSamples.Items.Add(TrainingSamples);
      cmbSamples.Items.Add(TestSamples);
      cmbSamples.Items.Add(AllSamples);

      cmbSamples.SelectedIndex = 0;

      residualComboBox.SelectedIndex = 0;

      chart.CustomizeAllChartAreas();
      chart.ChartAreas[0].AxisX.Title = residualComboBox.SelectedItem.ToString();
      chart.ChartAreas[0].AxisX.Minimum = 0.0;
      chart.ChartAreas[0].AxisX.Maximum = 0.0;
      chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
      chart.ChartAreas[0].CursorX.Interval = 0.01;

      chart.ChartAreas[0].AxisY.Title = "Ratio of Residuals";
      chart.ChartAreas[0].AxisY.Minimum = 0.0;
      chart.ChartAreas[0].AxisY.Maximum = 1.0;
      chart.ChartAreas[0].AxisY.MajorGrid.Interval = 0.2;
      chart.ChartAreas[0].CursorY.Interval = 0.01;
    }

    // the view holds one regression solution as content but also contains several other regression solutions for comparison
    // the following invariants must hold
    // (Solutions.IsEmpty && Content == null) ||
    // (Solutions[0] == Content && Solutions.All(s => s.ProblemData.TargetVariable == Content.TargetVariable))

    public new IRegressionSolution Content {
      get { return (IRegressionSolution)base.Content; }
      set { base.Content = value; }
    }

    private readonly IList<IRegressionSolution> solutions = new List<IRegressionSolution>();
    public IEnumerable<IRegressionSolution> Solutions {
      get { return solutions.AsEnumerable(); }
    }

    public IRegressionProblemData ProblemData {
      get {
        if (Content == null) return null;
        return Content.ProblemData;
      }
    }

    protected override void RegisterContentEvents() {
      base.RegisterContentEvents();
      Content.ModelChanged += new EventHandler(Content_ModelChanged);
      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    }
    protected override void DeregisterContentEvents() {
      base.DeregisterContentEvents();
      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
      Content.ProblemDataChanged -= new EventHandler(Conte


	boolean unshrink;	// XXX

	static final double INF = java.lang.Double.POSITIVE_INFINITY;

	double get_C(int i)
	{
		return (y[i] > 0)? Cp : Cn;
	}
	void update_alpha_status(int i)
	{
		if(alpha[i] >= get_C(i))
			alpha_status[i] = UPPER_BOUND;
		else if(alpha[i] <= 0)
			alpha_status[i] = LOWER_BOUND;
		else alpha_status[i] = FREE;
	}
	boolean is_upper_bound(int i) { return alpha_status[i] == UPPER_BOUND; }
	boolean is_lower_bound(int i) { return alpha_status[i] == LOWER_BOUND; }
	boolean is_free(int i) {  return alpha_status[i] == FREE; }

	// java: information about solution except alpha,
	// because we cannot return multiple values otherwise...
	static class SolutionInfo {
		double obj;
		double rho;
		double upper_bound_p;
		double upper_bound_n;
		double r;	// for Solver_NU
	}

	void swap_index(int i, int j)
	{
		Q.swap_index(i,j);
		do {byte _=y[i]; y[i]=y[j]; y[j]=_;} while(false);
		do {double _=G[i]; G[i]=G[j]; G[j]=_;} while(false);
		do {byte _=alpha_status[i]; alpha_status[i]=alpha_status[j]; alpha_status[j]=_;} while(false);
		do {double _=alpha[i]; alpha[i]=alpha[j]; alpha[j]=_;} while(false);
		do {double _=p[i]; p[i]=p[j]; p[j]=_;} while(false);
		do {int _=active_set[i]; active_set[i]=active_set[j]; active_set[j]=_;} while(false);
		do {double _=G_bar[i]; G_bar[i]=G_bar[j]; G_bar[j]=_;} while(false);
	}

	void reconstruct_gradient()
	{
		// reconstruct inactive elements of G from G_bar and free variables

		if(active_size == l) return;

		int i,j;
		int nr_free = 0;

		for(j=active_size;j<l;j++)
			G[j] = G_bar[j] + p[j];

		for(j=0;j<active_size;j++)
			if(is_free(j))
				nr_free++;

		if(2*nr_free < active_size)
			svm.info("\nWarning: using -h 0 may be faster\n");

		if (nr_free*l > 2*active_size*(l-active_size))
		{
			for(i=active_size;i<l;i++)
			{
				float[] Q_i = Q.get_Q(i,active_size);
				for(j=0;j<active_size;j++)
					if(is_free(j))
						G[i] += alpha[j] * Q_i[j];
			}
		}
		else
		{
			for(i=0;i<active_size;i++)
				if(is_free(i))
				{
					float[] Q_i = Q.get_Q(i,l);
					double alpha_i = alpha[i];
					for(j=active_size;j<l;j++)
						G[j] += alpha_i * Q_i[j];
				}
		}
	}

	void Solve(int l, QMatrix Q, double[] p_, byte[] y_,
		   double[] alpha_, double Cp, double Cn, double eps, SolutionInfo si, int shrinking)
	{
		this.l = l;
		this.Q = Q;
		QD = Q


\\_std\\haxe\\ds\\IntMap.hx"
						return ((haxe.lang.Function) (new haxe.lang.Closure(this, "exists")) );
					}

					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					break;
				}

				case 91023059:
				{
					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					if (field.equals("_keys"))
					{
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						__temp_executeDef1 = false;
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						return this._keys;
					}

					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					break;
				}

				case 102230:
				{
					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					if (field.equals("get"))
					{
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						__temp_executeDef1 = false;
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						return ((haxe.lang.Function) (new haxe.lang.Closure(this, "get")) );
					}

					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					break;
				}

				case 3612018:
				{
					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					if (field.equals("vals"))
					{
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						__temp_executeDef1 = false;
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						return this.vals;
					}

					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					break;
				}

				case -1097094790:
				{
					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					if (field.equals("lookup"))
					{
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						__temp_executeDef1 = false;
						//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
						return ((haxe.lang.Function) (new haxe.lang.Closure(this, "lookup")) );
					}

					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_std\\haxe\\ds\\IntMap.hx"
					break;
				}

				case 325636987:
				{
					//line 34 "C:\\HaxeToolkit\\haxe\\std\\java\\_


Key Schedule
*/
void CAST_256::key_schedule(const byte key[], size_t length)
   {
   SecureVector<u32bit> K(8);
   for(size_t j = 0; j != length; ++j)
      K[j/4] = (K[j/4] << 8) + key[j];

   u32bit A = K[0], B = K[1], C = K[2], D = K[3],
          E = K[4], F = K[5], G = K[6], H = K[7];

   for(size_t j = 0; j != 48; j += 4)
      {
      round1(G, H, KEY_MASK[4*j+ 0], KEY_ROT[(4*j+ 0) % 32]);
      round2(F, G, KEY_MASK[4*j+ 1], KEY_ROT[(4*j+ 1) % 32]);
      round3(E, F, KEY_MASK[4*j+ 2], KEY_ROT[(4*j+ 2) % 32]);
      round1(D, E, KEY_MASK[4*j+ 3], KEY_ROT[(4*j+ 3) % 32]);
      round2(C, D, KEY_MASK[4*j+ 4], KEY_ROT[(4*j+ 4) % 32]);
      round3(B, C, KEY_MASK[4*j+ 5], KEY_ROT[(4*j+ 5) % 32]);
      round1(A, B, KEY_MASK[4*j+ 6], KEY_ROT[(4*j+ 6) % 32]);
      round2(H, A, KEY_MASK[4*j+ 7], KEY_ROT[(4*j+ 7) % 32]);
      round1(G, H, KEY_MASK[4*j+ 8], KEY_ROT[(4*j+ 8) % 32]);
      round2(F, G, KEY_MASK[4*j+ 9], KEY_ROT[(4*j+ 9) % 32]);
      round3(E, F, KEY_MASK[4*j+10], KEY_ROT[(4*j+10) % 32]);
      round1(D, E, KEY_MASK[4*j+11], KEY_ROT[(4*j+11) % 32]);
      round2(C, D, KEY_MASK[4*j+12], KEY_ROT[(4*j+12) % 32]);
      round3(B, C, KEY_MASK[4*j+13], KEY_ROT[(4*j+13) % 32]);
      round1(A, B, KEY_MASK[4*j+14], KEY_ROT[(4*j+14) % 32]);
      round2(H, A, KEY_MASK[4*j+15], KEY_ROT[(4*j+15) % 32]);

      RK[j  ] = (A % 32);
      RK[j+1] = (C % 32);
      RK[j+2] = (E % 32);
      RK[j+3] = (G % 32);
      MK[j  ] = H;
      MK[j+1] = F;
      MK[j+2] = D;
      MK[j+3] = B;
      }
   }

}
/*
* S-Box Tables for CAST-128 and CAST-256
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

namespace Botan {

const u32bit CAST_SBOX1[256] = {
   0x30FB40D4, 0x9FA0FF0B, 0x6BECCD2F, 0x3F258C7A, 0x1E213F2F, 0x9C004DD3,
   0x6003E540, 0xCF9FC949, 0xBFD4AF27, 0x88BBBDB5, 0xE2034090, 0x98D09675,
   0x6E63A0E0, 0x15C361D2, 0xC2E7661D, 0x22D4FF8E, 0x28683B6F, 0xC07FD059,
   0xFF2379C8, 0x775


  ! 713: FMOVRLEZ	fmovs	%fcc1, %f0, %f26
	.word 0xbba00540  ! 715: FSQRTd	fsqrt
	.word 0xb1a00040  ! 718: FMOVd	fmovd	%f0, %f24
	.word 0x8394a131  ! 723: WRPR_TNPC_I	wrpr	%r18, 0x0131, %tnpc
	setx	0x1001e, %g1, %o0
#ifdef PORTABLE_CORE
	mov	PORTABLE_CORE, %g1
	sllx	%g1, 10, %g1
	or	%o0, %g1, %o0
#endif
	ta	T_SEND_THRD_INTR
	setx	data_start_3, %g1, %r22
	.word 0xbba00540  ! 731: FSQRTd	fsqrt
	.word 0xbda9c820  ! 735: FMOVVS	fmovs	%fcc1, %f0, %f30
	.word 0xb1a40820  ! 736: FADDs	fadds	%f16, %f0, %f24
	setx	data_start_0, %g1, %r23
	ta	T_CHANGE_HPRIV
	.word 0x81982b8b  ! 743: WRHPR_HPSTATE_I	wrhpr	%r0, 0x0b8b, %hpstate
	.word 0xbf500000  ! 746: RDPR_TPC	<illegal instruction>
	.word 0xb7aa4820  ! 748: FMOVNE	fmovs	%fcc1, %f0, %f27
	.word 0xb3504000  ! 749: RDPR_TNPC	<illegal instruction>
	.word 0xb9aa4820  ! 750: FMOVNE	fmovs	%fcc1, %f0, %f28
	.word 0xb9a98820  ! 753: FMOVNEG	fmovs	%fcc1, %f0, %f28
	.word 0xb5a81820  ! 756: FMOVRGZ	fmovs	%fcc3, %f0, %f26
	.word 0xbfa00560  ! 761: FSQRTq	fsqrt
	setx	0x20221, %g1, %o0
#ifdef PORTABLE_CORE
	mov	PORTABLE_CORE, %g1
	sllx	%g1, 10, %g1
	or	%o0, %g1, %o0
#endif
	ta	T_SEND_THRD_INTR
	.word 0x919560ec  ! 764: WRPR_PIL_I	wrpr	%r21, 0x00ec, %pil
	.word 0xb1a00560  ! 765: FSQRTq	fsqrt
	.word 0xb9aa4820  ! 766: FMOVNE	fmovs	%fcc1, %f0, %f28
	.word 0xb5a50960  ! 768: FMULq	dis not found

	.word 0xbfa4c840  ! 770: FADDd	faddd	%f50, %f0, %f62
	.word 0xb1a81820  ! 772: FMOVRGZ	fmovs	%fcc3, %f0, %f24
	.word 0xb1520000  ! 776: RDPR_PIL	<illegal instruction>
	setx	0x33c, %g1, %o0
#ifdef PORTABLE_CORE
	mov	PORTABLE_CORE, %g1
	sllx	%g1, 10, %g1
	or	%o0, %g1, %o0
#endif
	ta	T_SEND_THRD_INTR
	.word 0xbdaa0820  ! 778: FMOVA	fmovs	%fcc1, %f0, %f30
	.word 0xb15


 date, FK5 system
    double SINEPS(std::sin(EPS));
    double COSEPS(std::cos(EPS));
    double ES(EQCOR*SINEPS);
    double EC(EQCOR*COSEPS);

    Triple res;

    res.theArray[0] = (X-EC*Y+ES*Z)*AU_CONST;
    res.theArray[1] = (EQCOR*X+Y*COSEPS-Z*SINEPS)*AU_CONST;
    res.theArray[2] = (Y*SINEPS+Z*COSEPS)*AU_CONST;

    return res;

} // End MoonPosition::getPositionCIS()

} // end namespace gpstk
#pragma ident "$Id$"

//============================================================================
//
//  This file is part of GPSTk, the GPS Toolkit.
//
//  The GPSTk is free software; you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published
//  by the Free Software Foundation; either version 2.1 of the License, or
//  any later version.
//
//  The GPSTk 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 Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with GPSTk; if not, write to the Free Software Foundation,
//  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
//
//  Octavian Andrei - FGI ( http://www.fgi.fi ). 2008
//
//============================================================================

/**
 * @file IonexStream.hpp
 * File stream for IONEX format files
 */

#ifndef GPSTK_IONEXSTREAM_HPP
#define GPSTK_IONEXSTREAM_HPP

#include "FFTextStream.hpp"
#include "IonexHeader.hpp"

namespace gpstk
{

/** @addtogroup IonosphereMaps */
//@{

/** This class provides access to IONEX files.
 *
 * @sa gpstk::IonexHeader and gpstk::IonexData for more information.
 * @sa main_ionextest.cpp for an example.
 */
class IonexStream : public FFTextStream
{
public:

    /// Default constructor
    IonexStream()
        : headerRead(false) {};

    /** Common constructor.
     *
     * @param fn      IONEX file to open
     * @param mode    Mode to open \a fn.
     */
    IonexStream(const char* fn, std::ios::openmode mode=std::ios::in)
        : FFTextStream(fn, mode), headerRead(false) {};

    /// Destructor
    virtual ~IonexStream() {};

    /// Overrides open to reset the header
    virtual void open(const char* fn, std::ios::openmode mode)
    {

        FFTextStream::open(fn, mode);
        headerRead = false;
        header = IonexHeader();

    };

    /// Whether or not the IonexHeader has been read
    bool headerRead;

    /// The header for this file.
    IonexHeader header;

}; // End of class 'IonexStream'

//@}

}  // End of namespace gpstk
#endif   // GPSTK_IONEXSTREAM_HPP
#pragma ident "$Id$"

/**
 * @file AntexReader.cpp
 * Class to read antenna data from files in Antex format.
 */

//============================================================================
//
//  This file is part of GPSTk, the GPS Toolkit.
//
//  The GPSTk is free software; you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published
//  by the Free Software Foundation; either version 2.1 of the License, or
//  any later version.
//
//  The GPSTk is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNES


:	89bd                	andi	a1,a1,15
  e8:	8abd                	andi	a3,a3,15
  ea:	058a                	slli	a1,a1,0x2
  ec:	068a                	slli	a3,a3,0x2
  ee:	95b2                	add	a1,a1,a2
  f0:	96b2                	add	a3,a3,a2
  f2:	4294                	lw	a3,0(a3)
  f4:	00f7fe13          	andi	t3,a5,15
  f8:	418c                	lw	a1,0(a1)
  fa:	0e0a                	slli	t3,t3,0x2
  fc:	9e32                	add	t3,t3,a2
  fe:	8db5                	xor	a1,a1,a3
 100:	000e2683          	lw	a3,0(t3)
 104:	01b75293          	srli	t0,a4,0x1b
 108:	8db5                	xor	a1,a1,a3
 10a:	00278693          	addi	a3,a5,2
 10e:	8abd                	andi	a3,a3,15
 110:	068a                	slli	a3,a3,0x2
 112:	96b2                	add	a3,a3,a2
 114:	4294                	lw	a3,0(a3)
 116:	0785                	addi	a5,a5,1

00000118 <.LVL12>:
 118:	8db5                	xor	a1,a1,a3
 11a:	00159693          	slli	a3,a1,0x1
 11e:	81fd                	srli	a1,a1,0x1f
 120:	8dd5                	or	a1,a1,a3
 122:	00be2023          	sw	a1,0(t3)
 126:	00571e13          	slli	t3,a4,0x5
 12a:	011846b3          	xor	a3,a6,a7
 12e:	005e6e33          	or	t3,t3,t0
 132:	9e7a                	add	t3,t3,t5
 134:	0066c6b3          	xor	a3,a3,t1
 138:	96f2                	add	a3,a3,t3
 13a:	96ae                	add	a3,a3,a1
 13c:	01e81e13          	slli	t3,a6,0x1e
 140:	00285593          	srli	a1,a6,0x2
 144:	96f6                	add	a3,a3,t4

00000146 <.LVL13>:
 146:	00be6e33          	or	t3,t3,a1

0000014a <.LVL14>:
 14a:	883a                	mv	a6,a4
 14c:	8e9a                	mv	t4,t1
 14e:	17f79263          	bne	a5,t6,2b2 <.L10>
			14e: R_RISCV_BRANCH	.L10
 152:	8f1bcf37          	lui	t5,0x8f1bc
 156:	cdcf0f13          	addi	t5,t5,-804 # 8f1bbcdc <.LASF143+0x8f1bb4e4>
 15a:	03c00f93          	li	t6,60

0000015e <.L7>:
 15e:	00d78813          	addi	a6,a5,13
 1


' id='{Id}_Select' style='color:gray;position:absolute;right:0px'>{SelectButtonText ?? " . . . "}</button>
");
                }
                else
                {
                    output.PostElement.AppendHtml($@"
<button class='layui-btn layui-btn-sm layui-btn-warm' type='button' id='{Id}_Select' style='color:white;position:absolute;right:0px'>{SelectButtonText ?? " . . . "}</button>
<script>
var {Id}filter = {{}};
$('#{Id}_Select').on('click',function(){{
  {(string.IsNullOrEmpty(BeforeOnpenDialogFunc) == true ? "" : "var data={};" + FormatFuncName(BeforeOnpenDialogFunc) + ";")}


Z(effect->effect_specific[1], MTX_MULT);
    Matrix_scale(v2 * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f), v2 * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f),
                 v2 * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f), MTX_MULT);
    gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
    gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, result[4], result[0], result[1], result[2], result[3]);
    gDPSetEnvColor(NEXT_POLY_XLU_DISP, result[5], result[6], result[7], 255);
    gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hanabi_h_00_modelT);
    CLOSE_DISP(game->graph);
}


 0;
}
.impact-side-search-spinner {
  margin-top: 10px;
  text-align: center;
  display: none;
}
.impact-side-search-no-results {
  display: none;
}
.impact-checkbox-label {
  margin-left: 8px;
}
.impact-side-settings h4, .impact-side-settings .h4 {
  white-space: nowrap;
  margin-top: 25px;
}
.impact-side-settings-item {
  margin-bottom: 10px;
  white-space: nowrap;
}
.impact-res-hidden {
  float: right;
}
.impact-res-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}
.impact-res-disabled i {
  cursor: not-allowed !important;
}
/*
 * Hide toolbar for readonly, will be shown in JS if needed
 */
#save_impact, #add_node, #add_edge, #add_compound, #delete_element, #impact_settings {
  display: none;
}
/*!
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */
@media (max-width: 991.98px) {
  .tab_cadre_fixe td {
    display: block;
  }
}
@charset "UTF-8";
/*!
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */
/*!
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under th


s": [stream],
            "id": int(time.time())
        }

        await self.send_ws_message(subscribe_msg)

    async def subscribe_trades(self, symbol: str, callback: Callable) -> None:
        stream = f"{symbol.lower().replace('/', '')}@trade"
        self.subscriptions.add(stream)
        self.add_callback('trade', callback)

        subscribe_msg = {
            "method": "SUBSCRIBE",
            "params": [stream],
            "id": int(time.time())
        }

        await self.send_ws_message(subscribe_msg)

    async def subscribe_order_updates(self, callback: Callable) -> None:
        self.add_callback('order_update', callback)

    async def place_order(self, order: Order) -> str:
        return f"ws_order_{int(time.time())}"

    async def cancel_order(self, symbol: str, order_id: str) -> bool:
        return True

    async def get_order_status(self, symbol: str, order_id: str) -> Order:
        return Order(
            symbol=symbol,
            side=OrderSide.BUY,
            order_type=OrderType.LIMIT,
            quantity=1.0,
            price=50000.0,
            order_id=order_id,
            status=OrderStatus.NEW,
            timestamp=int(time.time() * 1000)
        )

    async def get_open_orders(self, symbol: Optional[str] = None) -> List[Order]:
        return []

    async def get_positions(self) -> List[Position]:
        return []

    async def get_balances(self) -> List[Balance]:
        return []

    async def get_orderbook(self, symbol: str, depth: int = 20) -> OrderBook:
        return OrderBook(
            symbol=symbol,
            bids=[OrderBookLevel(49999.0, 1.0)],
            asks=[OrderBookLevel(50001.0, 1.0)],
            timestamp=int(time.time() * 1000)
        )


stá errada, por favor corrija a hora do sistema___O seu dispositivo não suporta bluetooth___Desculpe, existe um problema na rede. Por favor, tente novamente mais tarde___Analisar agora___Apagar playlist___Memória___APP___Verificação automática___Tem a certeza que deseja eliminar a pasta: {0}?___Quer parar a análise atual?___Outros:___Selecionar codificação___%s foi desmontado com êxito___Brinquedo___Nova conta___O SSID e a palavra-passe não podem estar em branco___Reciclagem___Exibir palavra-passe___Exibir o nome na barra de ferramentas___Também poderá gostar de___Falha na desmontagem___Falha ao carregar!___Nível compressão:___Definições de documentos___VPoderá gerir o seu telefone através do seu PC depois de ativar este serviço___Tamanho: %s___Analise para libertar espaço___A fazer o download…___Extrair para___Por favor, adicione ou desative os gestos nas definições___Exibir o motor de pesquisa na página inicial___Endereço de partilha bluetooth___Mover___Pasta de aplicações___Gestor de compressão___  APKs - instalações falhadas___Backup___Grupo:___Em pausa___Música___- O IP é inválido___Os fich. são listados segundo o espaço que ocupam. Pode ver detalhes e eliminar fich. conforme necessário.___Capturas Ecrã___Colar tudo___Domínio___Nuvem___Desculpe, não existe nenhuma aplicação disponível___Ver no PC___ES Downloader___Enviar ficheiros___Eliminar também os ficheiros de origem___Limpou:___O recurso exibir o ícone da aplicação na pasta das aplicações associadas encontra-se atualmente desativado, deseja ativá-lo?___Não existe nenhum cartão SD montado___Desinstalação - Falhou___Definir como página inicial___Renomear lote___Selecionar ação___ES Zip Viewer___Definições de atualização___Música___Modificado___O Meu Servidor___Recolher tudo___Propriedades___Total:___Não foi possível encontrar o endereço por si especificado, deseja criá-lo?___Analisar Fotografias___Confirma eliminação?___Pasta Associada a Aplicação___O endereço de rede não foi encontrado ou o tempo foi ultrapassado. Por favor, tente novamente___Exibir o nome na barra de fFerramentas___Potência do sinal___Descrição___Tamanho___Diretoria para backups___Este mídia não suporta streaming, o reprodutor iniciará automaticamente após ser completamente transferido___Domínio___Dispositivo limpo___Nome do ficheiro___Caminho inválido___1 mês___Por favor, verifique a sua ligação sem fios!___Tamanho___Quer mesmo parar a descompressão?___\"%1$s\" será renomeado para \"%2$s\" assíncronamente___Exibir ficheiros ocultos___Encriptação concluída___O texto modificado não será guardado porque não é um ficheiro zip.___Foram removidas as seguintes aplicações.\nPode eliminar as pastas associadas___Restaurar___Separador___Desculpe, você não pode renomear o ficheiro/pasta; isto é uma restrição do protocolo bluetooth___O certificado não é válido___Palavra-passe___Data___O explorador de root está aberto___Abrir numa nova janela___Pode desativar Notificações em DEFINIÇÕ


SingleConverter::default()
        }
        .into();

        CombineIndicesTest {
            mesh_to_combine,
            expected_combined_mesh,
            create_single_idx_config: None,
        }
        .test();
    }

    // We create a mesh where our first three triangles have no repeating vertices
    // (across norms, uvs and positions) then our fourth triangle has all repeating vertices
    #[test]
    fn combine_pos_norm_uv_indices() {
        let mesh_to_combine = mesh_to_combine_pos_norm_uv_indices();
        let expected_combined_mesh = expected_mesh_to_combine_pos_norm_uv_indices();

        CombineIndicesTest {
            mesh_to_combine,
            expected_combined_mesh,
            create_single_idx_config: None,
        }
        .test();
    }

    fn mesh_to_combine_pos_norm_uv_indices() -> BlenderMesh {
        BlenderMesh {
            multi_indexed_vertex_attributes: TodoDeleteMeMultiConverter {
                vertex_positions: concat_vecs!(v(0), v(1), v(2), v(3)),
                vertex_normals: concat_vecs!(v(4), v(5), v(6)),
                num_vertices_in_each_face: vec![4, 4, 4, 4],
                vertex_position_indices: concat_vecs!(
                    vec![0, 1, 2, 3],
                    vec![0, 1, 2, 3],
                    vec![0, 1, 2, 3],
                    vec![0, 1, 2, 3]
                ),
                vertex_normal_indices: concat_vecs!(
                    vec![0, 1, 0, 1],
                    vec![2, 2, 2, 2],
                    vec![2, 2, 2, 2],
                    vec![2, 2, 2, 2]
                ),
                vertex_uvs: Some(concat_vecs!(v2(7), v2(8), v2(9), v2(10))),
                vertex_uv_indices: Some(concat_vecs!(
                    vec![0, 1, 0, 1],
                    vec![2, 2, 2, 2],
                    vec![3, 3, 3, 3],
                    vec![3, 3, 3, 3]
                )),
                ..TodoDeleteMeMultiConverter::default()
            }
            .into(),

            // We already tested vertex group indices / weights about so not bothering setting up
            // more test data
            ..BlenderMesh::default()
        }
    }

    fn expected_mesh_to_combine_pos_norm_uv_indices() -> SingleIndexedVertexAttributes {
        TodoDeleteMeSingleConverter {
            vertex_positions: concat_vecs!(v3_x4(0, 1, 2, 3), v3_x4(0, 1, 2, 3), v3_x4(0, 1, 2, 3)),
            vertex_position_indices: concat_vecs![
                // First Triangle
                vec![0, 1, 2, 0, 2, 3,],
                // Second Triangle
                vec![4, 5, 6, 4, 6, 7],
                // Third Triangle
                vec![8, 9, 10, 8, 10, 11],
                // Fourth Triangle
                vec![8, 9, 10, 8, 10, 11]
            ],
            num_vertices_in_each_face: vec![4, 4, 4, 4],
            vertex_normals: concat_vecs!(v3_x4(4, 5, 4, 5), v3_x4(6, 6, 6, 6), v3_x4(6, 6, 6, 6)),
            vertex_uvs: Some(concat_vecs!(
                v2_x4(7, 8, 7, 8),
                v2_x4(9, 9, 9, 9),


lic Input<string>? VswitchId { get; set; }

        public EcsImagePipelineState()
        {
        }
        public static new EcsImagePipelineState Empty => new EcsImagePipelineState();
    }
}


ue, true]
      ],
      [0, 0],
      [2, 3]
    );

    const { waves, isFinishFound } = waveAlgorithm.propagateWave(maze);

    expect(isFinishFound).toBeTruthy();
    expect(waves.length).toEqual(5);

    expectEqualIgnoreOrder(waves[0], [[1, 0], [0, 1]]);
    expectEqualIgnoreOrder(waves[1], [[2, 0], [0, 2]]);
    expectEqualIgnoreOrder(waves[2], [[0, 3], [2, 1], [1, 2]]);
    expectEqualIgnoreOrder(waves[3], [[2, 2], [1, 3]]);
    expectEqualIgnoreOrder(waves[4], [[2, 3]]);
  });

  it('propagates wave', () => {
    const maze = new Maze([[false, false], [false, false]], [0, 0], [1, 1]);

    const { waves, isFinishFound } = waveAlgorithm.propagateWave(maze);

    expect(isFinishFound).toBeTruthy();
    expect(waves.length).toEqual(2);

    expectEqualIgnoreOrder(waves[0], [[0, 1], [1, 0]]);
    expectEqualIgnoreOrder(waves[1], [[1, 1]]);
  });

  it('propagates wave when finish is not found', () => {
    const maze = new Maze(
      [[false, false, true, false], [false, false, true, false], [false, false, true, false]],
      [0, 0],
      [2, 3]
    );

    const { waves, isFinishFound } = waveAlgorithm.propagateWave(maze);

    expect(isFinishFound).toBeFalsy();
    expect(waves.length).toEqual(3);
  });

  it('can generate backtrace', () => {
    const waves: Waves = [
      [[1, 0], [0, 1]],
      [[2, 0], [0, 2]],
      [[0, 3], [2, 1], [1, 2]],
      [[2, 2], [1, 3]],
      [[2, 3]]
    ];

    const backtrace = waveAlgorithm.generateBacktrace(waves, [2, 3]);

    expect(backtrace.length).toEqual(4);
    expect(backtrace[0]).toEqual([2, 2]);
    expect(backtrace[1]).toEqual([2, 1]);
    expect(backtrace[2]).toEqual([2, 0]);
    expect(backtrace[3]).toEqual([1, 0]);
  });
});
// Script to prepare the core to publish at npm
import { walk } from "https://deno.land/std@0.106.0/fs/mod.ts";

const TEMPLATE_DIR = "./templates";
const TEMPLATE_MOD = `${TEMPLATE_DIR}/mod.ts`;

const isYaml = (path: string) =>
  path.endsWith(".yml") || path.endsWith(".yaml");

async function readTemplates() {
  const bucket: Record<string, string> = {};
  for await (const entry of walk(TEMPLATE_DIR, { includeDirs: false })) {
    if (isYaml(entry.path)) {
      bucket[entry.path] = await Deno.readTextFile(entry.path);
    }
  }
  return bucket;
}

async function embedTemplates(bucket: Record<string, string>) {
  const content = `export const templates = ${JSON.stringify(bucket)}`;
  await Deno.writeTextFile(TEMPLATE_MOD, content);
}

async function clearTemplates() {
  await Deno.writeTextFile(TEMPLATE_MOD, "");
}

async function emitTypeScript() {
  const p = Deno.run({
    cmd: [
      "deno",
      "run",
      "--no-check",
      "--unstable",
      "--allow-read",
      "--allow-write=./dist",
      "https://deno.land/x/deno2node@v0.8.0/src/cli.ts",
      "tsconfig.json",
    ],
  });

  const status = await p.status();
  p.close();

  return status.success;
}

async function main() {
  const templates = await readTemplates();
  await embedTemplates(templates);
  await emitTypeScript();
  await clearTemplates();
}
await main();
//loading


的AOV网络，必须先判断它是否是有向无环图。

## 拓扑排序
判断有向无环图的方法是对AOV网络构造它的拓扑有序序列（Topological Order Sequence），即将各个顶点排列成一个线性有序的序列，使得AOV网络中所有存在的前驱和后继关系都能得到满足。

这种构造AOV网络全部顶点的拓扑有序序列的运算称为拓扑排序（TopologicalSort）。如果通过拓扑排序能将AOV网络的所有顶点都排入一个拓扑有序的序列中，则该AOV网络中必定不存在有向环；相反，如果得不到所有顶点的拓扑有序序列，则说明该AOV网络中存在有向环，此AOV网络所代表的工程是不可行的。

一个AOV网络的拓扑有序序列可能是不唯一的。

实现方法：
1. 从AOV网络中选择一个入度为0（即没有直接前驱）的顶点并输出。
2. 从AOV网络中删除该顶点及该顶点发出的所有边。
3. 重复步骤1和2，直至找不到入度为0的顶点。

# AOE网络
与AOV网络密切相关的另一种网络是AOE网络。如果在有向无环图中用有向边表示一个工程中的各项活动（Activity），用有向边上的权值表示活动的持续时间（Duration），用顶点表示事件（Event），则这种有向图叫做用边表示活动的网络（Activity On Edges），简称AOE网络 。

![alt text](AOE.png)

AOE网络在某些方面（如工程估算）非常有用，例如，从AOE网络可以了解到以下两点。
1. 完成整个工程至少需要多长时间（假定网络中没有环）？
2. 为缩短完成工程所需的时间，应加快哪些活动？

成整个工程所需的时间取决于从源点到汇点的最长路径长度，所需时间为这条路径上所有活动的持续时间之和。这条路径长度最长的路径就称为关键路径（Critical Path）。

QS2: 求解AOE的关键路径

# Cline Rules - Project Management with .clineprojects

## 1. Introduction
This rule defines the structure and conventions for project management using the `.clineprojects` system. This system replaces and expands the functionality of the former `.clineplans`.

## 2. Directory Structure
- All projects will be managed within the root directory `.clineprojects/`.
- Each project will reside in its own subdirectory: `.clineprojects/<project-name-slug>/`.
  - The `<project-name-slug>` must be lowercase, with no spaces (use hyphens), and descriptive.
- The primary project definition file will be `project.md` within its respective directory.

## 3. `project.md` File Format
The `project.md` files must adhere to the template and syntax defined in the reference documentation (or include the template here).
Key syntax points:
- Use Markdown.
- Defined sections for Description, Scope, Milestones, Phases, and Tasks.
- Tasks numbered hierarchically (e.g., `Task 1.1`, `Task 1.2.1`).
- Explicit status for Project, Milestones, Phases, and Tasks (e.g., `[STATUS: PENDING]`, `[STATUS: IN PROGRESS]`, `[STATUS: COMPLETED]`).

### `project.md` Template Snippet (Illustrative)
```markdown
# Project: [Descriptive Project Name]

**Project ID:** (Optional, e.g., PJ-2025-001)
**Creation Date:** YYYY-MM-DD
**Owner(s):** [Name/Team]
**Overall Project Status:** [PLANNING | IN PROGRESS | ON HOLD | COMPLETED | CANCELED]
**Priority:** [HIGH | MEDIUM | LOW]
**Estimated Deadline:** (Optional) YYYY-MM-DD

## 1. General Description and Objectives
(Brief project overvi


# -*- coding: utf-8 -*-
"""The volume system factory."""

class Factory(object):
  """Volume system factory."""

  _volume_system_types = {}

  @classmethod
  def DeregisterVolumeSystem(cls, volume_system_type):
    """Deregisters a path specification type.

    Args:
      volume_system_type (type): path specification type.

    Raises:
      KeyError: if path specification type is not registered.
    """
    type_indicator = volume_system_type.TYPE_INDICATOR
    if type_indicator not in cls._volume_system_types:
      raise KeyError(f'Volume system type: {type_indicator:s} not set.')

    del cls._volume_system_types[type_indicator]

  @classmethod
  def NewVolumeSystem(cls, type_indicator):
    """Creates a new path specification for the specific type indicator.

    Args:
      type_indicator (str): type indicator.

    Returns:
      VolumeSystem: path specification.

    Raises:
      KeyError: if path specification is not registered.
    """
    if type_indicator not in cls._volume_system_types:
      raise KeyError(f'Volume system type: {type_indicator:s} not set.')

    volume_system_type = cls._volume_system_types[type_indicator]
    return volume_system_type()

  @classmethod
  def RegisterVolumeSystem(cls, volume_system_type):
    """Registers a path specification type.

    Args:
      volume_system_type (type): path specification type.

    Raises:
      KeyError: if path specification type is already registered.
    """
    type_indicator = volume_system_type.TYPE_INDICATOR
    if type_indicator in cls._volume_system_types:
      raise KeyError(f'Volume system type: {type_indicator:s} already set.')

    cls._volume_system_types[type_indicator] = volume_system_type


  /// The parameters to the media type.
  ///
  /// This map is immutable and the keys are case-insensitive.
  final Map<String, String> parameters;

  /// The media type's MIME type.
  String get mimeType => '$type/$subtype';

  /// Parses a media type.
  ///
  /// This will throw a FormatError if the media type is invalid.
  factory MediaType.parse(String mediaType) =>
      // This parsing is based on sections 3.6 and 3.7 of the HTTP spec:
      // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html.
      wrapFormatException('media type', mediaType, () {
        final scanner = StringScanner(mediaType);
        scanner.scan(whitespace);
        scanner.expect(token);
        final type = scanner.lastMatch![0]!;
        scanner.expect('/');
        scanner.expect(token);
        final subtype = scanner.lastMatch![0]!;
        scanner.scan(whitespace);

        final parameters = <String, String>{};
        while (scanner.scan(';')) {
          scanner.scan(whitespace);
          scanner.expect(token);
          final attribute = scanner.lastMatch![0]!;
          scanner.expect('=');

          String value;
          if (scanner.scan(token)) {
            value = scanner.lastMatch![0]!;
          } else {
            value = expectQuotedString(scanner);
          }

          scanner.scan(whitespace);
          parameters[attribute] = value;
        }

        scanner.expectDone();
        return MediaType(type, subtype, parameters);
      });

  MediaType(String type, String subtype, [Map<String, String>? parameters])
      : type = type.toLowerCase(),
        subtype = subtype.toLowerCase(),
        parameters = UnmodifiableMapView(
            parameters == null ? {} : CaseInsensitiveMap.from(parameters));

  /// Returns a copy of this [MediaType] with some fields altered.
  ///
  /// [type] and [subtype] alter the corresponding fields. [mimeType] is parsed
  /// and alters both the [type] and [subtype] fields; it cannot be passed along
  /// with [type] or [subtype].
  ///
  /// [parameters] overwrites and adds to the corresponding field. If
  /// [clearParameters] is passed, it replaces the corresponding field entirely
  /// instead.
  MediaType change(
      {String? type,
      String? subtype,
      String? mimeType,
      Map<String, String>? parameters,
      bool clearParameters = false}) {
    if (mimeType != null) {
      if (type != null) {
        throw ArgumentError('You may not pass both [type] and [mimeType].');
      } else if (subtype != null) {
        throw ArgumentError('You may not pass both [subtype] and '
            '[mimeType].');
      }

      final segments = mimeType.split('/');
      if (segments.length != 2) {
        throw FormatException('Invalid mime type "$mimeType".');
      }

      type = segments[0];
      subtype = segments[1];
    }

    type ??= this.type;
    subtype ??= this.subtype;
    parameters ??= {};

    if (!clearParameters) {
      final newParameters = parameters;
      parameters = Map.from(this.parameters);
      parameters.addAll(newParameters);
    }

    return MediaType(type, subtype, parameters);
  }

  /// Converts the media type to a string.
  ///
  /// This will produce a valid HTTP media type.
  @override
  String toString() {
    final buffer = StringBuffer()
      ..write(type)
      ..write('/')
      ..write(subtype);

    parameters.forEach((attribute, value) {
      buffer.write('; $attribute=');
      if (nonToken.


q.Key, req.Data)
}

func p9206(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9206]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p9205(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9205]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p9202(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9202]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p9201(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9201]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p9102(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9102]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p9101(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x9101]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p8103(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x8103]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func p8104(_ context.Context, c *app.RequestContext) {
	var req shared.Request[*model.P0x8104]
	if err := c.BindJSON(&req); err != nil {
		c.JSON(http.StatusOK, shared.Response{
			Code: http.StatusBadRequest,
			Msg:  "参数错误",
			Data: err.Error(),
		})
		return
	}
	handleCommand(c, req.Key, req.Data)
}

func handleCommand(


(&self) -> Option<Vec<CommandConfig>> {
        None
    }

    fn exe(&self, ctx: &Context, msg: &Message, _: &ServerInfo) -> Result<(), String> {
        let _ = msg.channel_id.send_message(&ctx.http, |m| {
            m.embed(|e| {
                e.title("About");
                e.description(format!(
                    "**Created by:**\n\
                     Mikołaj '[Noituri](https://github.com/noituri)' Radkowski\n\n\
                     **Source code:**\n\
                     Link -> [click](https://github.com/noituri/utterbot)\n\
                     Discord Library -> [serenity](https://github.com/serenity-rs/serenity)\n\n\
                     **Version:**\n\
                     {}",
                    VERSION
                ));
                e.color(EMBED_REGULAR_COLOR);
                e
            });
            m
        });

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

use std::{error, fmt, result};

/// Result type for Soter operations.
pub type Result<T> = result::Result<T, Error>;

/// Error type for Soter operations.
///
/// Normally you should not look too deep into errors returned by a cryptography library.
/// Bad error handling is an infamous source of security vulnerabilities. Error handling
/// path is often the last consideration for programmers, and it is rarely exercised and
/// verified in tests. Thankfully, Rust makes is hard to accidentally ignore errors, and
/// you should not intentionally ignore _these_ errors. Wrap it into a `Box<dyn Error>`
/// and move on.
///
/// You can inspect the error kind and additional information, but this should be treated
/// more as a debugging aid than anything. A proper response to errors is to abort the
/// high-level operation you are performing, do not trust the source of the input data,
/// and report this incident to the authorities.
#[derive(Debug)]
pub struct Error {
    kind: ErrorKind,
}

/// List of Soter error categories.
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum ErrorKind {
    /// General failure.
    ///
    /// This is the most common error you’ll encounter. It means that something somewhere
    /// has gone wrong. The data may be malformed, encryption context does not match, or
    /// the state of the object is invalid.
    ///
    /// This is also a catch-all for all internal issues that we are able to detect,
    /// such as failure to allocate memory, prevented integer overflow, or malfunction
    /// in the cryptographic backend.
    Failure,
    /// Invalid parameter.
    ///
    /// Static type system should catch most of these, but sometimes we double-check with
    /// runtime validation, or have no other choice but to verify invariants at runtime.
    ///
    /// For example, this error often indicates empty input when a non-empty input is expected.
    /// However, it **never** indicates corrupted input data, invalid encryption keys, etc.
    /// That’s what `Failure` is for.
    InvalidParameter,
    /// Buffer is too small.
    ///
    /// Some APIs require you to provide an output buffer of a sufficient size.
    /// If the buffer does not have a sufficient size,


color:#e53935;background-color:rgba(38, 50, 56, 0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38, 50, 56, 0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
.ewnBNs pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0;border:1px solid rgba(38, 50, 56, 0.1);}/*!sc*/
.ewnBNs pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
.ewnBNs pre code:before,.ewnBNs pre code:after{content:none;}/*!sc*/
.ewnBNs blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
.ewnBNs img{max-width:100%;box-sizing:content-box;}/*!sc*/
.ewnBNs ul,.ewnBNs ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
.ewnBNs ul ul,.ewnBNs ol ul,.ewnBNs ul ol,.ewnBNs ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
.ewnBNs table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
.ewnBNs table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
.ewnBNs table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
.ewnBNs table th,.ewnBNs table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
.ewnBNs table th{text-align:left;font-weight:bold;}/*!sc*/
.ewnBNs .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
.ewnBNs .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbD


}
                        break;
                    case Key.F:
                        if (Keyboard.Modifiers == ModifierKeys.Control)
                        {
                            //CTRL + F
                            FavoriteCodices(codices);
                            e.Handled = true;
                        }
                        break;
                }
            }
        }

        #region Drag & Drop
        void IDropTarget.DragOver(IDropInfo dropInfo)
        {
            if ((dropInfo.Data is TreeViewNode node && !node.Tag.IsGroup)
                || dropInfo.Data is Tag { IsGroup: false })
            {
                dropInfo.DropTargetAdorner = DropTargetAdorners


lier} of {@code Spliterator.OfDouble}.
     *
     *
The {@link Supplier#get()} method will be invoked on the supplier no
     * more than once, and only after the terminal operation of the stream pipeline
     * commences.
     *
     *
For spliterators that report a characteristic of {@code IMMUTABLE}
     * or {@code CONCURRENT}, or that are
     * late-binding, it is likely
     * more efficient to use {@link #doubleStream(java.util.Spliterator.OfDouble, boolean)}
     * instead.
     *
The use of a {@code Supplier} in this form provides a level of
     * indirection that reduces the scope of potential interference with the
     * source.  Since the supplier is only invoked after the terminal operation
     * commences, any modifications to the source up to the start of the
     * terminal operation are reflected in the stream result.  See
     * Non-Interference for
     * more details.
     *
     * @param supplier A {@code Supplier} of a {@code Spliterator.OfDouble}
     * @param characteristics Spliterator characteristics of the supplied
     *        {@code Spliterator.OfDouble}.  The characteristics must be equal to
     *        {@code supplier.get().characteristics()}, otherwise undefined
     *        behavior may occur when terminal operation commences.
     * @param parallel if {@code true} then the returned stream is a parallel
     *        stream; if {@code false} the returned stream is a sequential
     *        stream.
     * @return a new sequential or parallel {@code DoubleStream}
     * @see #doubleStream(java.util.Spliterator.OfDouble, boolean)
     */
    public static DoubleStream doubleStream(Supplier<? extends Spliterator.OfDouble> supplier,
                                            int characteristics,
                                            boolean parallel) {
        return new DoublePipeline.Head<>(supplier,
                                         StreamOpFlag.fromCharacteristics(characteristics),
                                         parallel);
    }
}
/*
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */
package java.util.stream;

import java.util.EnumMap;
import java.util.Map;
import java.util.Spliterator;

/**
 * Flags corresponding to characteristics of streams and operations. Flags are
 * utilized by the stream framework to control, specialize or optimize
 * computation.
 *
 *

 * Stream flags may be used to describe characteristics of several different
 * entities associated with streams: stream sources, intermediate operations,
 * and terminal operations.  Not all stream flags are meaningful for all
 * entities; the following table summarizes which flags are meaningful in what
 * contexts:
 *
 *

 *

 *
Type Characteristics

 *

 *

 *
 *       {@code DISTINCT}
 *       {@code SORTED}
 *       {@code ORDERED}
 *       {@code SIZED}
 *       {@code SHORT_CIRCUIT}
 *

 *

 *

 *

 *        Stream source
 *        Y
 *        Y
 *        Y
 *        Y
 *        N


/values/server.dart';
import 'package:flutter_cloud_music/pages/video/state.dart';
import 'package:get/get.dart';
import 'package:video_player/video_player.dart';

/// Creator: Xing Wei
/// Email: 654206017@qq.com
/// Date: 2022/3/21 3:53 下午
/// Des:

typedef LoadMoreVideo = Future<List<VPVideoController>> Function(
  int index,
  List<VPVideoController> list,
);

/// 提供了预加载/释放/加载更多功能
class VideoListController extends ChangeNotifier {
  VideoListController({
    this.loadMoreCount = 1,
    this.preloadCount = 3,
    this.disposeCount = 5,
  });

  /// 到第几个触发预加载，例如：1:最后一个，2:倒数第二个
  final int loadMoreCount;

  /// 预加载多少个视频
  final int preloadCount;

  /// 超出多少个，就释放视频
  final int disposeCount;

  /// 提供视频的builder
  LoadMoreVideo? _videoProvider;

  void loadIndex(int target, {bool reload = false}) {
    if (!reload) {
      if (index.value == target) return;
    }
    // 播放当前的，暂停其他的
    final oldIndex = index.value;
    final newIndex = target;

    // 暂停之前的视频
    if (!(oldIndex == 0 && newIndex == 0)) {
      playerOfIndex(oldIndex)?.controllerValue?.seekTo(Duration.zero);
      // playerOfIndex(oldIndex)?.controller.addListener(_didUpdateValue);
      // playerOfIndex(oldIndex)?.showPauseIcon.addListener(_didUpdateValue);
      playerOfIndex(oldIndex)?.pause();
      logger.d('暂停$oldIndex');
    }
    // 开始播放当前的视频
    // playerOfIndex(newIndex)?.controllerValue?.addListener(_didUpdateValue);
    playerOfIndex(newIndex)?.controller.listen((p0) {
      p0?.addListener(_didUpdateValue);
    });
    playerOfIndex(newIndex)?.play();
    logger.d('播放$newIndex');
    // 处理预加载/释放内存
    for (var i = 0; i < playerList.length; i++) {
      // 需要释放[disposeCount]之前的视频
      if (i < newIndex - disposeCount || i > newIndex + disposeCount) {
        logger.d('释放$i');
        playerOfIndex(i)?.controllerValue?.removeListener(_didUpdateValue);
        // playerOfIndex(newIndex)?.controller.removeListener(_didUpdateValue);
        playerOfIndex(i)?.dispose();
      } else {
        // 需要预加载
        if (i > newIndex && i < newIndex + preloadCount) {
          logger.d('预加载$i');
          playerOfIndex(i)?.init();
        }
      }
    }
    // 快到最底部，添加更多视频
    if (playerList.length - newIndex <= loadMoreCount + 1) {
      _videoProvider?.call(newIndex, playerList).then(
        (list) async {
          if (list.isNotEmpty) {
            playerList.addAll(list);
            notifyListeners();
          }
        },
      );
    }

    // 完成
    index.value = target;
  }

  Future<void> _didUpdateValue() async {
    notifyListeners();
  }

  /// 获取指定index的player
  VPVideoController? playerOfIndex(int index) {
    if (index < 0 || index > playerList.length - 1) {
      return null;
    }
    return playerList[index];
  }

  /// 视频总数目
  int get videoCount => playerList.length;

  ///


erTools includes advanced Android system support with graphics acceleration for games, PlayStore and more. Run your favorite Android apps on Wubuntu.\n\n####  \u301014\u2020 Accounts Support \u2020www.wubuntu.org\u3011 \n\nPowerTools includes full support for your Microsoft account, Google account and more. PowerTools allows you to integrate your accounts directly into the file manager.\n\n## Embedded Technologies \n\nTechnologies used for the development of Windows Ubuntu\n\n#  Get support when you need it! \n\nYou have access to extensive documentation from the Ubuntu, Cinnamon, KDE and Wubuntu community.\n\n\u30108\u2020 Support Forum \u2020sourceforge.net\u3011 \u301015\u2020 Desktop Documentation \u2020userbase.kde.org\u3011 \n\nCopyright \u00a9 2024 Wubuntu. All Rights Reserved.\n\n\u301016\u2020Joomla!\u2020www.joomla.org\u3011 is Free Software released under the \u301017\u2020GNU General Public License.\u2020www.gnu.org\u3011\nVisible: 0% - 100%", "pub_date": null, "extra": {"cited_message_idx": 5, "search_result_idx": null, "evidence_text": "source", "cloud_doc_url": null}}}, {"start_ix": 587, "end_ix": 597, "citation_format_type": "tether_og", "metadata": {"type": "webpage", "title": "FREE EDITION", "url": "https://www.wubuntu.org/index.php/get/wubuntu", "text": "\nURL: https://www.wubuntu.org/index.php/get/wubuntu\n\n\u30100\u2020 \u3011 \n\n  * \u30101\u2020Home\u3011\n\n    * \u30102\u2020RELEASE NOTES\u3011\n    * \u30103\u2020PROJECT PAGE\u2020sourceforge.net\u3011\n\n  * Downloads\n\n    * \u30104\u2020FREE EDITION\u3011\n    * \u30105\u2020SOURCE CODE\u3011\n    * \u30106\u2020SERIAL KEY\u3011\n\n  * \u30107\u2020POWERTOOLS\u3011\n  * \u30108\u2020Community\u2020sourceforge.net\u3011\n  * \u30109\u2020Contact US\u3011\n\n\u30106\u2020Serial Key\u3011\n\n[Image 0]\n\n### \u00a0\n\n### \u00a0\n\n### \u00a0\n\n### \u00a0\n\n### \u00a0\n\n### Windows Ubuntu 11.4.7 LTS\n\nThe latest LTS version of Wubuntu Cinnamon and Plasma, for desktop PCs and laptops. LTS stands for long-term support \u2014 which means five years of free security and maintenance updates, guaranteed until April 2027.\n\n  1. \u30102\u2020Wubuntu release notes\u3011\n  2. \u301010\u2020Ubuntu release notes\u2020discourse.ubuntu.com\u3011\n  3. \u30105\u2020Source code\u3011\n\nWUBUNTU PLASMA - WINDOWS 11 THEME\n\nRecommended system requirements for Plasma:\n\n  * 2 GHz dual-core processor or better\n  * 2 GB system memory (4 GB is highly recommended)\n  * 25 GB of free hard drive space (SSD is highly recommended)\n  * Internet access is helpful\u00a0\n  * Either a DVD drive or a USB port for the installer media\n  * Virtual Box: It is extremely important to install guest add-ons for the system to run efficiently.\n\n[Image 1]\n\nWUBUNTU CINNAMON - WINDOWS 10 THEME\n\nRecommended system requirements for Cinnamon:\n\n  * 2 GHz processor or better\n  * 1 GB system memory (2 GB is highly recommended)\n  * 25 GB of free hard drive space (SSD is highly recommended)\n  * Internet access is helpful\u00a0\n  * Either a DVD drive or a USB port for the installer media\n  * Virtual Box: It is extremely important to install guest add-ons for the system to run efficiently.\n\n[Image 2]\n\n[Image 3]\n\n### \u00a0\n\n### \u00a0\n\n### \u00a0


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

namespace OpenCensus.Trace.Internal
{
    using System;

    internal class RandomGenerator : IRandomGenerator
    {
        private static readonly Random Global = new Random();


�. 호출할때도 인자를 받아서, `f1(*this)`를 해주는 겁니다. 반면에 `$2`경우에는 그저 외부에 정의된 함수이기 때문에 굳이 인자를 넣어주지 않아도 됩니다.

밖에서는 그저 함수호출에 필요한 객체를 function에 넘겨주기만하면 호출해줍니다. `$3`의 경우, foo를 넘겨주면 잘 호출됩니다. 저같은 경우에는 알고리즘문제 탐색부분에서 좌표를 계산할때 많이 이용하는 편입니다.

```C++
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
typedef pair<int, int> point;

namespace move {//좌표이동 함수들
    point up(const point& p) { return point(p.first - 1, p.second); }
    point down(const point& p) { return point(p.first + 1, p.second); }
    point left(const point& p) { return point(p.first, p.second - 1); }
    point right(const point& p) { return point(p.first, p.second + 1); }
}
class Foo {
    function<point(const point&)> fp[4] = { move::up, move::down, move::left, move::right };
    //함수들을 배열로 저장
    bool visited[100][100] = { 0, };

    void dfs(const point& cur) {
        visited[cur.first][cur.second] = true;
        for (auto& call : fp) {
            point next(call(cur));//함수호출(다음좌표 계산)
            if (condition(next)) {
                doSomething...
            }
        }
    }
}
```

---

## 3. std::unordered_map
c++에도 dictionary와 같은 기능을 하는 std::map 이라는 stl이 있습니다. 어떤 특정한 key값에 대응하는 value값을 저장할 수 있는 컨테이너입니다. map은 키값들을 정렬해서 저장해놓습니다. `std::map`은 키값 비교로 `std::less`를 기본적으로 사용하기 때문에 (`map<int, string, less<int>>`) 키값이 int이든 string이든 pair(less가 정의되어 있습니다.)든 어느 키값이든 다 사용할 수 있죠.

하지만 저같은 경우에는 문제풀이시 굳이 key값에 대한 정렬이 필요없는 경우도 있었습니다. `map`은 O(logN), `unordere


import math

x = 2.9
print(round(x))
y = -2.9
print(abs(y))
print(math.ceil(x))
print(math.floor(x))


z]+`, "az]-bcz", build(2, 0, 4, 6, 7)},
	{`[^\n]+`, "abcd\n", build(1, 0, 4)},
	{`[日本語]+`, "日本語日本語", build(1, 0, 18)},
	{`日本語+`, "日本語", build(1, 0, 9)},
	{`日本語+`, "日本語語語語", build(1, 0, 18)},
	{`()`, "", build(1, 0, 0, 0, 0)},
	{`(a)`, "a", build(1, 0, 1, 0, 1)},
	{`(.)(.)`, "日a", build(1, 0, 4, 0, 3, 3, 4)},
	{`(.*)`, "", build(1, 0, 0, 0, 0)},
	{`(.*)`, "abcd", build(1, 0, 4, 0, 4)},
	{`(..)(..)`, "abcd", build(1, 0, 4, 0, 2, 2, 4)},
	{`(([^xyz]*)(d))`, "abcd", build(1, 0, 4, 0, 4, 0, 3, 3, 4)},
	{`((a|b|c)*(d))`, "abcd", build(1, 0, 4, 0, 4, 2, 3, 3, 4)},
	{`(((a|b|c)*)(d))`, "abcd", build(1, 0, 4, 0, 4, 0, 3, 2, 3, 3, 4)},
	{`\a\f\n\r\t\v`, "\a\f\n\r\t\v", build(1, 0, 6)},
	{`[\a\f\n\r\t\v]+`, "\a\f\n\r\t\v", build(1, 0, 6)},

	{`a*(|(b))c*`, "aacc", build(1, 0, 4, 2, 2, -1, -1)},
	{`(.*).*`, "ab", build(1, 0, 2, 0, 2)},
	{`[.]`, ".", build(1, 0, 1)},
	{`/$`, "/abc/", build(1, 4, 5)},
	{`/$`, "/abc", nil},

	// multiple matches
	{`.`, "abc", build(3, 0, 1, 1, 2, 2, 3)},
	{`(.)`, "abc", build(3, 0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 2, 3)},
	{`.(.)`, "abcd", build(2, 0, 2, 1, 2, 2, 4, 3, 4)},
	{`ab*`, "abbaab", build(3, 0, 3, 3, 4, 4, 6)},
	{`a(b*)`, "abbaab", build(3, 0, 3, 1, 3, 3, 4, 4, 4, 4, 6, 5, 6)},

	// fixed bugs
	{`ab$`, "cab", build(1, 1, 3)},
	{`axxb$`, "axxcb", nil},
	{`data`, "daXY data", build(1, 5, 9)},
	{`da(.)a$`, "daXY data", build(1, 5, 9, 7, 8)},
	{`zx+`, "zzx", build(1, 1, 3)},
	{`ab$`, "abcab", build(1, 3, 5)},
	{`(aa)*$`, "a", build(1, 1, 1, -1, -1)},
	{`(?:.|(?:.a))`, "", nil},
	{`(?:A(?:A|a))`, "Aa", build(1, 0, 2)},
	{`(?:A|(?:A|a))`, "a", build(1, 0, 1)},
	{`(a){0}`, "", build(1, 0, 0, -1, -1)},
	{`(?-s)(?:(?:^).)`, "\n", nil},
	{`(?s)(?:(?:^).)`, "\n", build(1, 0, 1)},
	{`(?:(?:^).)`, "\n", nil},
	{`\b`, "x", build(2, 0, 0, 1, 1)},
	{`\b`, "xx", build(2, 0, 0, 2, 2)},
	{`\b`, "x y", build(4, 0, 0, 1, 1, 2, 2, 3, 3)},
	{`\b`, "xx y


cmp(r->fields[5],"1")==0 ? true : false) , // schema_locked
				false, // (strcmp(r->fields[6],"1")==0 ? true : false) , // transaction_persistent
				false, // (strcmp(r->fields[7],"1")==0 ? true : false), // fast_forward
				( atoi(r->fields[2])>0 ? atoi(r->fields[2]) : 0)  // max_connections
			);
			//if (variables.hash_passwords) {
			//	free(password); // because we always generate a new string
			//}
#ifdef ADDUSER_STMT_RAW
			delete r;
#endif
		}
	}
#ifdef ADDUSER_STMT_RAW
	if (statement) {
		(*proxy_sqlite3_finalize)(statement);
	}
#else
	if (resultset) delete resultset;
#endif
	free(query);
}
#endif /* PROXYSQLCLICKHOUSE */

void ProxySQL_Admin::dump_checksums_values_table() {
	int rc;
	pthread_mutex_lock(&GloVars.checksum_mutex);
	if (GloVars.checksums_values.updates_cnt == GloVars.checksums_values.dumped_at) {
		// exit immediately
		pthread_mutex_unlock(&GloVars.checksum_mutex);
		return;
	} else {
		GloVars.checksums_values.dumped_at = GloVars.checksums_values.updates_cnt;
	}
	char *q = (char *)"REPLACE INTO runtime_checksums_values VALUES (?1 , ?2 , ?3 , ?4)";
	sqlite3_stmt *statement1 = NULL;
	rc = admindb->prepare_v2(q,&statement1);
	ASSERT_SQLITE_OK(rc, admindb);
	admindb->execute((char *)"BEGIN");
	admindb->execute((char *)"DELETE FROM runtime_checksums_values");

	rc=(*proxy_sqlite3_bind_text)(statement1, 1, "admin_variables", -1, SQLITE_TRANSIENT); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_int64)(statement1, 2, GloVars.checksums_values.admin_variables.version); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_int64)(statement1, 3, GloVars.checksums_values.admin_variables.epoch); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_text)(statement1, 4, GloVars.checksums_values.admin_variables.checksum, -1, SQLITE_TRANSIENT); ASSERT_SQLITE_OK(rc, admindb);
	SAFE_SQLITE3_STEP2(statement1);
	rc=(*proxy_sqlite3_clear_bindings)(statement1); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_reset)(statement1); ASSERT_SQLITE_OK(rc, admindb);

	rc=(*proxy_sqlite3_bind_text)(statement1, 1, "mysql_query_rules", -1, SQLITE_TRANSIENT); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_int64)(statement1, 2, GloVars.checksums_values.mysql_query_rules.version); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_int64)(statement1, 3, GloVars.checksums_values.mysql_query_rules.epoch); ASSERT_SQLITE_OK(rc, admindb);
	rc=(*proxy_sqlite3_bind_text)(statement1, 4, GloVars.checksums_values.mysql_query_


1b\u4e0d\u4ec5\u5f00\u653e\u624b\u5de5\u4e1a\u6280\u672f\u9769\u547d\u7684\u9c9c\u82b1\uff0c\u800c\u4e14\u6210\u957f\u4e3a\u624b\u5de5\u4e1a\u793e\u4f1a\u4e3b\u4e49\u6539\u9020\u7684\u4e30\u76db\u679c\u5b9e\uff0c\u8fd9\u662f\u5b8c\u5168\u53ef\u4ee5\u9884\u89c1\u7684\u3002", "type": "paragraph"}, {"text": "\u6765\u6e90\uff1a", "type": "source"}, {"text": "\u6839\u636e\u6587\u4ef6\u7684\u7ffb\u5370\u4ef6\u6253\u5370", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   手工业合作社大闹技术革命

   日期：1958-11-17 作者：手工业管理总局局长, 邓洁

   手工业管理总局局长、邓洁

   一、伟大的时代，光荣的任务

   手工业社会主义改造包括：生产资料所有制的改造、思想改造和生产技术的改造。前两项任务通过1956年春的手工业合作化高潮和1957年的全民整风和反右斗争，已经取得了决定性的胜利。从1958年起，我国的革命已经进入一个以技术革命和文化革命为中心的社会主义建设新阶段，要求全党和全国人民必须把主要注意力集中到技术革命方面来，以便尽快地把我们的祖国建设成一个具有现代工业、现代农业和现代科学文化的伟大的社会主义国家，并为逐步过渡到共产主义准备条件。全体手工业合作社社员和手工业工作者，必须积极完成这一光荣而又艰巨的任务。