* (tmp1 + tmp2) * invs;
        final double r01 = 2.0 * (tmp1 - tmp2) * invs;

        tmp1 = i * k;
        tmp2 = j * s;
        final double r20 = 2.0 * (tmp1 - tmp2) * invs;
        final double r02 = 2.0 * (tmp1 + tmp2) * invs;

        tmp1 = j * k;
        tmp2 = i * s;
        final double r21 = 2.0 * (tmp1 + tmp2) * invs;
        final double r12 = 2.0 * (tmp1 - tmp2) * invs;

        retVal.set(0L, r00);
        retVal.set(1L, r10);
        retVal.set(2L, r20);
        retVal.set(3L, r01);
        retVal.set(4L, r11);
        retVal.set(5L, r21);
        retVal.set(6L, r02);
        retVal.set(7L, r12);
        retVal.set(8L, r22);

        return retVal;
    }

    /**
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {

        final StringBuilder retVal = new StringBuilder("(");

        retVal.append(Double.toString(myScalar));

        if (i < PrimitiveMath.ZERO) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(Double.toString(PrimitiveMath.ABS.invoke(i)));
        retVal.append("i");

        if (j < PrimitiveMath.ZERO) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(Double.toString(PrimitiveMath.ABS.invoke(j)));
        retVal.append("j");

        if (k < PrimitiveMath.ZERO) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(Double.toString(PrimitiveMath.ABS.invoke(k)));
        retVal.append("k)");

        return retVal.toString();
    }

    @Override
    public String toString(final NumberContext context) {

        final StringBuilder retVal = new StringBuilder("(");

        final BigDecimal tmpScalar = context.enforce(new BigDecimal(myScalar, PrimitiveScalar.CONTEXT.getMathContext()));
        final BigDecimal tmpI = context.enforce(new BigDecimal(i, PrimitiveScalar.CONTEXT.getMathContext()));
        final BigDecimal tmpJ = context.enforce(new BigDecimal(j, PrimitiveScalar.CONTEXT.getMathContext()));
        final BigDecimal tmpK = context.enforce(new BigDecimal(k, PrimitiveScalar.CONTEXT.getMathContext()));

        retVal.append(tmpScalar.toString());

        if (tmpI.signum() < 0) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(tmpI.abs().toString());
        retVal.append("i");

        if (tmpJ.signum() < 0) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(tmpJ.abs().toString());
        retVal.append("j");

        if (tmpK.signum() < 0) {
            retVal.append(" - ");
        } else {
            retVal.append(" + ");
        }
        retVal.append(tmpK.abs().toString());
        retVal.append("k)");

        return retVal.toString();
    }

    @Override
    public <T extends ModifiableReceiver<Double>> void transform(final T transformable) {

        final double s = myScalar;

        final double ss = s * s;


  -moz-opacity: 0.25;
  opacity: 0.25;
}
.close:hover {
  color: #000000;
  text-decoration: none;
  filter: alpha(opacity=40);
  -khtml-opacity: 0.4;
  -moz-opacity: 0.4;
  opacity: 0.4;
}
.alert-message {
  position: relative;
  padding: 7px 15px;
  margin-bottom: 18px;
  color: #404040;
  background-color: #eedc94;
  background-repeat: repeat-x;
  background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));
  background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
  background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));
  background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
  background-image: -o-linear-gradient(top, #fceec1, #eedc94);
  background-image: linear-gradient(top, #fceec1, #eedc94);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  border-color: #eedc94 #eedc94 #e4c652;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  border-width: 1px;
  border-style: solid;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.alert-message .close {
  margin-top: 1px;
  *margin-top: 0;
}
.alert-message a {
  font-weight: bold;
  color: #404040;
}
.alert-message.danger p a,
.alert-message.error p a,
.alert-message.success p a,
.alert-message.info p a {
  color: #ffffff;
}
.alert-message h5 {
  line-height: 18px;
}
.alert-message p {
  margin-bottom: 0;
}
.alert-message div {
  margin-top: 5px;
  margin-bottom: 2px;
  line-height: 28px;
}
.alert-message .btn {
  -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.alert-message.block-message {
  background-image: none;
  background-color: #fdf5d9;
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  padding: 14px;
  border-color: #fceec1;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
.alert-message.block-message ul,


lign:-1px}
._3q6c{display:table-row;width:100%}._3q6p,._3q6q{display:table-cell;padding-bottom:24px;vertical-align:middle}._3q6d ._3q6p{padding-right:24px}._3q6o ._3q6p{padding-right:12px}._3q6p{text-align:center}._3q6c:last-child ._3q6p,._3q6c:last-child ._3q6q{padding-bottom:0}
._3dg{background:#fff;background:rgba(255, 255, 255, .6);bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:100}._4t2a ._3dg{border-radius:3px}._51l0 ._4t2a ._3dg{border-radius:6px}._3df{bottom:0;height:24px;left:0;margin:auto;position:absolute;right:0;text-align:center;top:0;width:24px;z-index:101}
.audienceSelector{text-align:left}html .audienceSelector .uiSelectorButton .uiButtonText{max-width:120px}.audienceSelectorNoTruncate,.audienceSelectorNoTruncate .uiSelectorButton,.audienceSelectorNoTruncate .uiSelectorButton:active,.audienceSelectorNoTruncate .uiSelectorButton:focus .audienceSelectorNoTruncate .uiSelectorButton:hover,.audienceSelectorNoTruncate .uiButtonSuppressed:active,.audienceSelectorNoTruncate .uiButtonSuppressed:focus,.audienceSelectorNoTruncate .uiButtonSuppressed:hover,.audienceSelectorNoTruncate .uiSelectorButton .uiButtonText{max-width:none !important}.audienceSelector .uiSelectorButton .customimg{margin-left:-2px;margin-right:2px}.audienceSelector .uiButtonNoText .customimg{margin-right:-5px}.showSecondaryOptions li,.audienceSelector .secondaryOption,.audienceSelector .returnOption{display:none}.showSecondaryOptions li,.audienceSelector .secondaryOption,.audienceSelector .returnOption{display:none}.showSecondaryOptions .returnOption,.showSecondaryOptions .secondaryOption,.friendList .friendListOption{display:block}.showSecondaryOptions .uiSelectorMenu{max-height:214px;overflow-y:auto;overflow-x:hidden}.permalink_stream .fbStreamPermalinkHeader .audienceSelector .uiSelectorButton,.uiStream .uiStreamMinistoryGroup .uiStreamPrivacyContainer .audienceSelector .uiSelectorButton,.uiStream .uiStreamStory .uiStreamFooter .audienceSelector .uiSelectorButton{padding-bottom:1px;padding-left:6px;padding-right:18px;padding-top:1px;vertical-align:middle}.permalink_stream .fbStreamPermalinkHeader .audienceSelector .wrap .uiSelectorButton{margin-top:2px}.permalink_stream .fbStreamPermalinkHeader .audienceSelector .wrap .uiSelectorButton,.uiStream .uiStreamMinistoryGroup .uiStreamPrivacyContainer .audienceSelector .wrap .uiSelectorButton,.uiStreamFooter .audienceSelector .wrap .uiSelectorButton{background-color:transparent;background-image:none}.permalink_stream .fbStreamPermalinkHeader .audienceSelector .uiSelectorButton:hover,.uiStream .uiStreamMinistoryGroup .ui


M12,15.4C9.75,13.09 8,9.54 8,6C2,4 8,6 2,4C2,9.65 6.33,14.11 10.55,16.66C9.38,17.5 8.15,18 7,18C7,19 7,18 7,19C8.2,19 10.03,18.46 12,17.46C13.97,18.46 15.8,19 17,19C17,18 17,19 17,18C15.85,18 14.62,17.5 13.45,16.66C17.66,14.11 22,9.65 22,4C16,6 22,4 16,6C16,9.54 14.25,13.09 12,15.4Z",mdiYahoo:"M10.5 7.59L8.16 13.2L5.85 7.59H2L6.29 17.23L4.75 20.7H8.5L14.24 7.59H10.5M15 12.73C13.63 12.73 12.59 13.77 12.59 15C12.59 16.17 13.59 17.16 14.93 17.16C16.32 17.16 17.36 16.13 17.36 14.9C17.36 13.69 16.36 12.73 15 12.73M17.72 3.3L13.89 11.89H18.17L22 3.3H17.72Z",mdiYeast:"M18,14A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18L14.09,17.15C14.05,16.45 13.92,15.84 13.55,15.5C13.35,15.3 13.07,15.19 12.75,15.13C11.79,15.68 10.68,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3A6.5,6.5 0 0,1 16,9.5C16,10.68 15.68,11.79 15.13,12.75C15.19,13.07 15.3,13.35 15.5,13.55C15.84,13.92 16.45,14.05 17.15,14.09L18,14M7.5,10A1.5,1.5 0 0,1 9,11.5A1.5,1.5 0 0,1 7.5,13A1.5,1.5 0 0,1 6,11.5A1.5,1.5 0 0,1 7.5,10M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",mdiYinYang:"M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A4,4 0 0,1 8,16A4,4 0 0,1 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,6.5A1.5,1.5 0 0,1 13.5,8A1.5,1.5 0 0,1 12,9.5A1.5,1.5 0 0,1 10.5,8A1.5,1.5 0 0,1 12,6.5M12,14.5A1.5,1.5 0 0,0 10.5,16A1.5,1.5 0 0,0 12,17.5A1.5,1.5 0 0,0 13.5,16A1.5,1.5 0 0,0 12,14.5Z",mdiYoga:"M13 2C11.9 2 11 2.9 11 4C11 5.11 11.9 6 13 6C14.11 6 15 5.11 1


::cell::Cell;
use core::future::Future;
use core::ptr;
use core::task::{Context, Poll};
use embassy::util::Signal;

use crate::hal::gpio::{Input, Level, Output, Pin, Port};
use crate::interrupt;
use crate::interrupt::OwnedInterrupt;
use crate::pac::generic::Reg;
use crate::pac::gpiote::_TASKS_OUT;
#[cfg(any(feature = "52833", feature = "52840"))]
use crate::pac::P1;
use crate::pac::{p0 as gpio, GPIOTE, P0};

#[cfg(not(feature = "51"))]
use crate::pac::gpiote::{_TASKS_CLR, _TASKS_SET};

pub const CHANNEL_COUNT: usize = 8;

#[cfg(any(feature = "52833", feature = "52840"))]
pub const PIN_COUNT: usize = 48;
#[cfg(not(any(feature = "52833", feature = "52840")))]
pub const PIN_COUNT: usize = 32;

pub struct Gpiote {
    inner: GPIOTE,
    free_channels: Cell<u8>, // 0 = used, 1 = free. 8 bits for 8 channelself.
    channel_signals: [Signal<()>; CHANNEL_COUNT],
    port_signals: [Signal<()>; PIN_COUNT],
}

static mut INSTANCE: *const Gpiote = ptr::null_mut();

pub enum PortInputPolarity {
    High,
    Low,
}

pub enum InputChannelPolarity {
    None,
    HiToLo,
    LoToHi,
    Toggle,
}

/// Polarity of the `task out` operation.
pub enum OutputChannelPolarity {
    Set,
    Clear,
    Toggle,
}

#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum NewChannelError {
    NoFreeChannels,
}

impl Gpiote {
    pub fn new(gpiote: GPIOTE, irq: interrupt::GPIOTEInterrupt) -> Self {
        #[cfg(any(feature = "52833", feature = "52840"))]
        let ports = unsafe { &[&*P0::ptr(), &*P1::ptr()] };
        #[cfg(not(any(feature = "52833", feature = "52840")))]
        let ports = unsafe { &[&*P0::ptr()] };

        for &p in ports {
            // Enable latched detection
            p.detectmode.write(|w| w.detectmode().ldetect());
            // Clear latch
            p.latch.write(|w| unsafe { w.bits(0xFFFFFFFF) })
        }

        // Enable interrupts
        gpiote.events_port.write(|w| w);
        gpiote.intenset.write(|w| w.port().set());
        irq.set_handler(Self::on_irq, core::ptr::null_mut());
        irq.unpend();
        irq.enable();

        Self {
            inner: gpiote,
            free_channels: Cell::new(0xFF), // all 8 channels free
            channel_signals: [
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
            ],
            // This is just horrible
            #[cfg(any(feature = "52833", feature = "52840"))]
            port_signals: [
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Signal::new(),
                Sign


import streamlit as st
import numpy as np
import plotly.graph_objects as go
from scipy.stats import f

def generate_data(num_samples, homoscedastic=True):
    X = np.random.rand(num_samples)
    if homoscedastic:
        noise = np.random.normal(0, 0.1, num_samples)
    else:
        noise = np.random.normal(0, X, num_samples)
    y = 2 * X + 1 + noise
    return X, y

def goldfeld_quandt_test(X, y):
    n = len(X)
    k = int(n / 3)
    X_sorted = np.sort(X)
    X_low, X_high = X_sorted[:k], X_sorted[-k:]
    y_low = y[np.argsort(X)[:k]]
    y_high = y[np.argsort(X)[-k:]]

    ssr_low = np.sum((y_low - np.mean(y_low))**2)
    ssr_high = np.sum((y_high - np.mean(y_high))**2)

    f_value = ssr_high / ssr_low
    p_value = f.sf(f_value, k-1, k-1)

    return f_value, p_value

def plot_data(X, y, regression_line, title):
    fig = go.Figure()
    fig.add_trace(go.Scatter(x=X, y=y, mode='markers', name='Data'))
    fig.add_trace(go.Scatter(x=X, y=regression_line, mode='lines', name='Regression Line'))
    fig.update_layout(title=title, xaxis_title='X', yaxis_title='y')
    st.plotly_chart(fig)

def main():
    st.title("Homoscedasticity Demonstration")

    st.sidebar.header("Parameters")
    num_samples = st.sidebar.slider("Number of Samples", 50, 500, 100, 50)
    data_type = st.sidebar.radio("Data Type", ("Homoscedastic", "Heteroscedastic"))

    homoscedastic = data_type == "Homoscedastic"
    X, y = generate_data(num_samples, homoscedastic)

    regression_line = 2 * X + 1

    plot_data(X, y, regression_line, data_type + " Data")

    f_value, p_value = goldfeld_quandt_test(X, y)

    st.subheader("Goldfeld-Quandt Test Results")
    st.write(f"F-value: {f_value:.2f}")
    st.write(f"P-value: {p_value:.4f}")

    if p_value < 0.05:
        st.write("Reject the null hypothesis. The residuals are heteroscedastic.")
    else:
        st.write("Fail to reject the null hypothesis. The residuals are homoscedastic.")

if __name__ == "__main__":
    main()


0xef,0x01,0x00]

v_subrev_f16_e64 v5, -v1, v2
// GFX10: encoding: [0x05,0x00,0x34,0xd5,0x01,0x05,0x02,0x20]

v_subrev_f16_e64 v5, v1, -v2
// GFX10: encoding: [0x05,0x00,0x34,0xd5,0x01,0x05,0x02,0x40]

v_subrev_f16_e64 v5, -v1, -v2
// GFX10: encoding: [0x05,0x00,0x34,0xd5,0x01,0x05,0x02,0x60]

v_subrev_f16_e64 v5, |v1|, v2
// GFX10: encoding: [0x05,0x01,0x34,0xd5,0x01,0x05,0x02,0x00]

v_subrev_f16_e64 v5, v1, |v2|
// GFX10: encoding: [0x05,0x02,0x34,0xd5,0x01,0x05,0x02,0x00]

v_subrev_f16_e64 v5, |v1|, |v2|
// GFX10: encoding: [0x05,0x03,0x34,0xd5,0x01,0x05,0x02,0x00]

v_subrev_f16_e64 v5, v1, v2 clamp
// GFX10: encoding: [0x05,0x80,0x34,0xd5,0x01,0x05,0x02,0x00]

v_subrev_f16_sdwa v5, v1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0x0a,0x68,0x01,0x06,0x06,0x06]

v_subrev_f16_sdwa v255, v1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0xfe,0x69,0x01,0x06,0x06,0x06]

v_subrev_f16_sdwa v5, v255, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0x0a,0x68,0xff,0x06,0x06,0x06]

v_subrev_f16_sdwa v5, s1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0x0a,0x68,0x01,0x06,0x86,0x06]

v_subrev_f16_sdwa v5, s101, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0x0a,0x68,0x65,0x06,0x86,0x06]

v_subrev_f16_sdwa v5, vcc_lo, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
// GFX10: encoding: [0xf9,0x04,0x0a,0x68,0x6a,0x06,0x86,0x06]

v_subrev_f16_sdwa v5, vcc_hi, v2 dst_sel:DWORD dst_unu


gedIn = data.length > 0;
          if (!this.isLoggedIn) {
            localStorage.removeItem('token');
            localStorage.removeItem('user');
          }
        },
        () => {
          this.logout();
        }
      );
    } else {
      flag = false;
      this.isLoggedIn = false;
    }
    return flag;
  }

  login(loginObj: User): Observable<User> {
    return this.http.post<User>('/api/api-token-auth/', loginObj);
  }

  getUserInfo() {
    let user: User = new User();
    if (localStorage.getItem('user')) {
      user = JSON.parse(atob(localStorage.getItem('user')));
    }
    return user;
  }

  verifyToken(token): Observable<any> {
    return of(this.getToken());
  }

  logout(): void {
    localStorage.removeItem('token');
    localStorage.removeItem('user');
    this.isLoggedIn = false;
  }

  changeUserPassword(formData): Observable<any> {
    return this.http.post('/api/change_password/', formData);
  }
}
import { SimModule, Battle, CurStats, BaseStats } from "./sim.module";
import { log } from "util";

describe("SimModule", () => {
  let simModule: SimModule;

  beforeEach(() => {
    simModule = new SimModule();
  });

  it("should create an instance", () => {
    expect(simModule).toBeTruthy();
  });

  it("should start a battle", () => {
    battle = new Battle("Allosaurus", "Stegosaurus");
    expect(battle).toBeTruthy();
  });

  it("basic attack works", () => {
    battle = new Battle("Allosaurus", "Stegosaurus");
    setupBattle();
    battle.nextTurn(1, 1);
    updateStats();

    expect(getDmgTaken(1)).toEqual(d2dmg);
    expect(getDmgTaken(2)).toEqual(d1dmg);
  });

  it("armor works", () => {
    battle = new Battle("Einiasuchus", "Stegosaurus");
    setupBattle();
    battle.nextTurn(1, 1);
    updateStats();

    expect(getDmgTaken(1)).toEqual(d2dmg * (1 - d1armor / 100));
    expect(getDmgTaken(2)).toEqual(d1dmg * (1 - d2armor / 100));
  });

  it("pounce works", () => {
    battle = new Battle("Velociraptor", "Apatosaurus");
    setupBattle();
    battle.nextTurn(2, 1);
    updateStats();

    expect(getDmgTaken(1)).toEqual((d2dmg * (1 - d1armor / 100)) / 2);
    expect(getDmgTaken(2)).toEqual(d1dmg * (1 - d2armor / 100) * 2);
  });

  it("slow with pounce works", () => {
    battle = new Battle("Velociraptor", "Apatosaurus");
    setupBattle();
    // turn 1, velociraptor should do damage first
    battle.nextTurn(2, 2);
    updateStats();

    expect(getStep1DmgTaken(1)).toEqual(0);
    expect(getStep1DmgTaken(2)).toEqual(d1dmg * (1 - d2armor / 1


xecute,
    terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use tui::{
    backend::{Backend, CrosstermBackend},
    layout::{Constraint, Direction, Layout},
    style::{Modifier, Style},
    text::{Span, Spans},
    widgets::Wrap,
    widgets::{Block, Borders, List, ListItem, Paragraph},
    Terminal,
};

use std::{io::stdout, time::Duration};

/// control the maximum waiting time for event availability
/// in this case, the value should not really matter,
/// as the content does not update while waiting for events
///
/// see https://docs.rs/crossterm/0.14.0/crossterm/event/fn.poll.html
const POLL_RATE: u64 = 1000;

/// display an interactive prompt to ask the user to select an item
///
/// example:
/// ```
/// let prompt = "Choose your organization:";
/// let items = vec![String::from("Eka"), String::from("Toka"), String::from("Kolmas"),
/// String::from("Neljäs")];
///
/// let choice = interactive_list(prompt, items);
///
/// if let Some(choice) = choice {
///     println!("You chose: {}", choice);
/// }
/// ```
pub fn interactive_list(prompt: &str, items: Vec<String>) -> Option<String> {
    execute!(stdout(), EnterAlternateScreen).unwrap();
    let backend = CrosstermBackend::new(stdout());
    let mut terminal = Terminal::new(backend).unwrap();

    terminal.clear().unwrap();
    enable_raw_mode().unwrap();
    let app = AppState::new(items);
    let result = event_loop(&mut terminal, app, prompt);

    disable_raw_mode().unwrap();

    terminal.clear().unwrap();
    execute!(stdout(), LeaveAlternateScreen).unwrap();

    result
}

fn draw_terminal<B>(terminal: &mut Terminal<B>, app: &mut AppState, prompt: &str)
where
    B: Backend,
{
    terminal
        .draw(|f| {
            let chunks = Layout::default()
                .direction(Direction::Horizontal)
                .constraints([Constraint::Percentage(80), Constraint::Percentage(20)].as_ref())
                .split(f.size());
            let items: Vec<ListItem> = app
                .items
                .displayed
                .iter()
                .map(|i| {
                    let lines = vec![Spans::from(i.clone())];
                    ListItem::new(lines).style(Style::default())
                })
                .collect();
            let items = List::new(items)
                .block(Block::default().borders(Borders::NONE).title(prompt))
                .highlight_style(Style::default().add_modifier(Modifier::BOLD))
                .highlight_symbol(">> ");
            f.render_stateful_widget(items, chunks[0], &mut app.items.state);

            // if the user hasn't written anything yet, display the help message in its place
            let text = if app.filter.is_empty() {
                Paragraph::new(Span::styled(
                    "Press keys to filter",
                    Style::default().add_modifier(Modifier::ITALIC),
                ))
                .wrap(Wrap { trim: true })
            } else {
                Paragraph::new(Span::raw(app.filter.clone())).wrap(Wrap { trim: true })
            };
            f.render_widget(text, chunks[1]);
        })
        .unwrap();
}

/// tries reading input from user
/// if succeeds, handles the input and returns Option<


 name."]
    #[doc = ""]
    #[doc = " @param [in] context_name: The name of the created context."]
    #[doc = " @param [in] empty_context: No device is assigned with this context"]
    #[doc = "                            otherwise, all proved devices will be added into the context."]
    #[doc = ""]
    #[doc = " @return Execution context handle."]
    #[doc = "         If create Failed, return NULL."]
    pub fn create_context(
        context_name: *const ::std::os::raw::c_char,
        empty_context: ::std::os::raw::c_int,
    ) -> context_t;
}
extern "C" {
    #[doc = " @brief Destory and reclaim the resource related with the context."]
    #[doc = ""]
    #[doc = " @param [in] context: The context handle."]
    pub fn destroy_context(context: context_t);
}
extern "C" {
    #[doc = " @brief Get the device number assigned to a context."]
    #[doc = ""]
    #[doc = " @param [in] context: The context handle."]
    #[doc = ""]
    #[doc = " @return The number of devices inside the context."]
    pub fn get_context_device_number(context: context_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "  @brief Add a device into one context."]
    #[doc = ""]
    #[doc = "  @param [in] context: The context handle."]
    #[doc = "  @param [in] dev_name: The device name."]
    #[doc = ""]
    #[doc = "  @return 0: Success, -1: Fail."]
    pub fn add_context_device(
        context: context_t,
        dev_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "  @brief Remove a device from one context."]
    #[doc = ""]
    #[doc = "  @param [in] context: The context handle."]
    #[doc = "  @param [in] dev_name: The device name."]
    #[doc = ""]
    #[doc = "  @return 0: Success, -1: Fail."]
    pub fn remove_context_device(
        context: context_t,
        dev_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @brief Set attribute item of a context."]
    #[doc = ""]
    #[doc = " @param [in] context: The context handle."]
    #[doc = " @param [in] attr_name: The attribute item name."]
    #[doc = " @param [in] val: The buffer to hold the data to set."]
    #[doc = " @param [in] size: The buffer size."]
    #[doc = " @return 0: Success, -1: Fail."]
    pub fn set_context_attr(
        context: context_t,
        attr_name: *const ::std::os::raw::c_char,
        val: *const ::std::os::raw::c_void,
        val_size: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @brief Get the attribute item of a context."]
    #[doc = ""]
    #[doc = " @param [in] context: The context handle."]
    #[doc = " @param [in] attr_name: The attribute item name."]
    #[doc = " @param [out] val: The buffer to hold the


et; } = null!;

    public bool WtPonaglenie { get; set; }

    public virtual ICollection<NzFinanseHistoriaWindykacji> NzFinanseHistoriaWindykacjis { get; set; } = new List<NzFinanseHistoriaWindykacji>();
}


/android">
        <translate
            android:fromXDelta="0"
            android:toXDelta="0"
            android:fromYDelta="0"
            android:toYDelta="-100%"
            android:duration="2000" />
        <alpha
            android:fromAlpha="1"
            android:toAlpha="0"
            android:duration="2000" />
    </set>

activity_close_in:

    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate
            android:fromXDelta="0"
            android:toXDelta="0"
            android:fromYDelta="-100%"
            android:toYDelta="0"
            android:duration="2000" />
        <alpha
            android:fromAlpha="0"
            android:toAlpha="1"
            android:duration="2000" />
    </set>

activity_close_out:

    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate
            android:fromXDelta="0"
            android:toXDelta="0"
            android:fromYDelta="0"
            android:toYDelta="100%"
            android:duration="2000" />
        <alpha
            android:fromAlpha="1"
            android:toAlpha="0"
            android:duration="2000" />
    </set>

最终的效果是：

![activity 效果](../README_Res/activity_viewanimation2.gif)

实现 Activity 转场的动画有很多种方式，更多方式可以查看 [WiKi:实现 Activity 的切换动画](https://github.com/OCNYang/Android-Animation-Set/wiki/%E5%AE%9E%E7%8E%B0-Activity-%E7%9A%84%E5%88%87%E6%8D%A2%E5%8A%A8%E7%94%BB)

## 给 ViewGroup 的子控件加进场动画

LayoutAnimation 是作用于 ViewGroup 的，用来指定 ViewGroup 的子控件出现的动画

先做一个子控件出现的动画, 从之前随便选个 `activity_in.xml`：

    <set xmlns:android="http://schemas.android.com/apk/res/android">
        <translate
            android:fromXDelta="0"
            android:toXDelta="0"
            android:fromYDelta="100%"
            android:toYDelta="0"
            android:duration="2000" />
        <alpha
            android:fromAlpha="0"
            android:toAlpha="1"
            android:duration="2000" />
    </set>

准备好了动画，接下来有两种方法，也是 xml 和 java

### 通过 XML

然后新建一个动画文件, 这里叫anim_layout.xml, 这里有三个属性：

| 属性 | 作用 |
| ---- | ----- |
| android:delay | 可以取值为数值，百分数，或百分数 p。表示两个子控件执行出场动画的间隔时间，为 0 时，所有控件的动画没有延迟全部开始执行；为 1 时表示等上一个控件动画执行完毕才开始执行下一个；为 0.5 时表示等上一个控件动画执行一半开始执行下一个。可以大于 1。。。当这个值为百分数时，如 50%，表示这个延迟时间是当前动画执行时间的 50%。。。当这个值是百分数 p 的时候，如 50%p, 表示这个延迟时间是父 View 的


;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-botto


: TEEC_RegisteredMemoryReference,
    pub value: TEEC_Value,
}

#[repr(C)]
pub struct TEEC_Operation {
    pub started: u32,
    pub paramTypes: u32,
    pub params: [TEEC_Parameter; TEEC_CONFIG_PAYLOAD_REF_COUNT as usize],
    pub session: *mut TEEC_Session,
}

extern "C" {
    pub fn TEEC_InitializeContext(name: *const c_char, context: *mut TEEC_Context) -> TEEC_Result;
    pub fn TEEC_FinalizeContext(context: *mut TEEC_Context);
    pub fn TEEC_OpenSession(context: *mut TEEC_Context,
                            session: *mut TEEC_Session,
                            destination: *const TEEC_UUID,
                            connectionMethod: u32,
                            connectionData: *const c_void,
                            operation: *mut TEEC_Operation,
                            returnOrigin: *mut u32) -> TEEC_Result;
    pub fn TEEC_CloseSession(session: *mut TEEC_Session);
    pub fn TEEC_InvokeCommand(session: *mut TEEC_Session,
                              commandID: u32,
                              operation: *mut TEEC_Operation,
                              returnOrigin: *mut u32) -> TEEC_Result;
    pub fn TEEC_RegisterSharedMemory(context: *mut TEEC_Context,
                                     sharedMem: *mut TEEC_SharedMemory) -> TEEC_Result;
    pub fn TEEC_AllocateSharedMemory(context: *mut TEEC_Context,
                                     sharedMem: *mut TEEC_SharedMemory) -> TEEC_Result;
    pub fn TEEC_ReleaseSharedMemory(sharedMemory: *mut TEEC_SharedMemory);
    pub fn TEEC_RequestCancellation(operation: *mut TEEC_Operation);
}

#![warn(if_let_some_result)]

fn str_to_int(x: &str) -> i32 {
    if let Some(y) = x.parse().ok() {
        y
    } else {
        0
    }
}

fn str_to_int_ok(x: &str) -> i32 {
    if let Ok(y) = x.parse() {
        y
    } else {
        0
    }
}

fn main() {
    let y = str_to_int("1");
    let z = str_to_int_ok("2");
    println!("{}{}", y, z);
}
pub struct ChessPosition {
    x: i8,
    y: i8,
}

impl ChessPosition {
    pub fn new(x: i8, y: i8) -> Result<ChessPosition, ()> {
        if x < 0 || x > 7 || y < 0 || y > 7 {
            return Err(());
        }

        Ok(ChessPosition { x: x, y: y })
    }
}

pub struct Queen {
    pos: ChessPosition,
}

impl Queen {
    pub fn new(pos: ChessPosition) -> Queen {
        Queen { pos: pos }
    }

    pub fn can_attack(&self, other: &Queen) -> bool {
        if self.pos.x == other.pos.x || self.pos.y == other.pos.y {
            return true;
        }

        if (self.pos.x - other.pos.x).abs() == (self.pos.y - other.pos.y).abs() {
            return true;
        }

        false
    }
}
<filename>src/tachyon/channel.rs

use rustc_hash::{FxHashMap};

use super::{
    fragmentation::Fragmentation,
    header::{
        Header, MESSAGE_TYPE_FRAGMENT, MESSAGE_TYPE_NONE, MESSAGE_TYPE_NACK,
        TACHYON_FRAGMENTED_HEADER_SIZE, TACHYON_HEADER_SIZE, MESSAGE_TYPE_RELIABLE_WITH_NACK, MESSAGE_TYPE_RELIABLE, TACHYON_NACKED_HEADER_SIZE
    },
    int_buffer::IntBuffer,
    nack::Nack,


ash] ?: 1)
//      .also { if(Random.nextInt(10000) == 3) if (it == 1) println("$hash Miss"); else println("$hash Hit") }
      + 1 }
    val cdf = probs.runningReduce { acc, i -> acc + i }
    val rnd = Random.nextInt(cdf.last())
    val childIdx = cdf.binarySearch { it.compareTo(rnd) }.let { if (it < 0) -it - 1 else it }
    val (l, r) = branches[childIdx]
    val (lr, rr) = l.ntIdx to r.ntIdx
    val (a, b) = l.samplePCFG5(pcfgTable, ntIdx, 31 * lr, rr) to
                         r.samplePCFG5(pcfgTable, ntIdx, lr, 31 * rr)
    return if (a.isEmpty()) b else if (b.isEmpty()) a else "$a $b"
  }

  fun samplePCFG3(pcfgTable: Map<Int, Int>): Σᐩ {
    if (branches.isEmpty()) return epsStr

    val probs = triples.map { (pcfgTable[hash(ntIdx, it.first, it.second)] ?: 1) + 1 }
    val cdf = probs.runningReduce { acc, i -> acc + i }
    val rnd = Random.nextInt(probs.sum())
    val childIdx = cdf.binarySearch { it.compareTo(rnd) }.let { if (it < 0) -it - 1 else it }
    val (l, r) = branches[childIdx]
    val (a, b) = l.samplePCFG3(pcfgTable) to r.samplePCFG3(pcfgTable)
    return if (a.isEmpty()) b else if (b.isEmpty()) a else "$a $b"
  }

  fun sampleWRGD(): Sequence<String> = generateSequence { sampleStrWithGeomDecay() }

  // Prefers shorter strings, i.e., strings with more ε tokens
  fun sampleStrWithGeomDecay(): String =
    if (branches.isEmpty()) dotEpsStr
    else {
//      val p = 0.9 // Adjust this for different decay rates
//      val rnd = Random.nextDouble()
//      val index =(-(1.0 / ln(1 - p)) * ln(1 - rnd) * branches.size).toInt().coerceIn(branches.indices)
//      println(index)
      epsSortedBranches.sampleWithGeomDecay().let { (l, r) ->
        val (a, b) = l.sampleStrWithGeomDecay() to r.sampleStrWithGeomDecay()
        if (a.isEmpty()) b else if (b.isEmpty()) a else "$a $b"
      }
    }

//  fun List<Π2A<PTree>>.sampleWithGeomDecay(): Π2A<PTree> {
//    val p = 0.5 // Adjust this for different decay rates
//    val rnd = Random.nextDouble()
//    val index = -(1.0 / ln(1 - p)) * ln(1 - rnd)
//    return epsSortedBranches[index.toInt().coerceAtMost(branches.size - 1)]
//  }
}

fun CFG.startPTree(tokens: List<String>, nt: Σᐩ = START_SYMBOL) = //measureTimedValue {
//  initPForestMat(tokens).seekFixpoint().diagonals.last()[0][START_SYMBOL]
//}.also { println("Took ${it.duration} to compute parse forest") }.value
  initPTreeListMat(tokens).seekFixpoint()
//    .also { println(it.toFullMatrix().map { "" + it.count { it != null } }.toString()) }
    .diagonals.last()[0][bindex[nt]]

// Instead of defining a special case, we instead represent the unit production
// as a left child whose sibling is empty like so: Left child to Right child
fun PSingleton(v: String): List<Π2A<PTree>> = listOf(PTree(v) to PTree())

fun CFG.initPTreeListMat(tokens: List<String>): UTMatrix<List<PTree


= 4; // cutoff ?

//const int K = 10; // cutoff 7
//const int K = 4; // cutoff 8
//const int cutoff = 25;

void TestTSBiVRC(Heuristic<TopSpinState<N>> *f, Heuristic<TopSpinState<N>> *b, int first = 0, int last = 50);

int main(int argc, char* argv[])
{
	TeachingExample();
	// Turn off text buffering
	setvbuf(stdout, NULL, _IONBF, 0);
	InstallHandlers();
	RunHOGGUI(argc, argv, 640, 640);
	return 0;
}

/**
 * Allows you to install any keyboard handlers needed for program interaction.
 */
void InstallHandlers()
{
	InstallKeyboardHandler(MyDisplayHandler, "Record", "Record a movie", kAnyModifier, 'w');
	InstallKeyboardHandler(MyDisplayHandler, "Record", "Record a movie", kAnyModifier, 'a');
	InstallKeyboardHandler(MyDisplayHandler, "Record", "Record a movie", kAnyModifier, 's');
	InstallKeyboardHandler(MyDisplayHandler, "Record", "Record a movie", kAnyModifier, 'd');
	InstallKeyboardHandler(MyDisplayHandler, "TS VRC", "Top Spin VRC Experiments", kAnyModifier, 'v');
	InstallKeyboardHandler(MyDisplayHandler, "TS Bi VRC", "Top Spin Bidirectional VRC Experiments", kAnyModifier, 'b');

	InstallKeyboardHandler(MyDisplayHandler, "Record", "Record a movie", kAnyModifier, 'r');
	InstallKeyboardHandler(MyDisplayHandler, "Toggle Abstraction", "Toggle display of the ith level of the abstraction", kAnyModifier, '0', '9');
	InstallKeyboardHandler(MyDisplayHandler, "Cycle Abs. Display", "Cycle which group abstraction is drawn", kAnyModifier, '\t');
	InstallKeyboardHandler(MyDisplayHandler, "Delta + MD", "Test what happens when we add delta over MD with min compression.", kNoModifier, 'm');
	InstallKeyboardHandler(MyDisplayHandler, "Delta + Min", "Test what happens when we add delta over min with min compression.", kNoModifier, 'p');
	InstallKeyboardHandler(MyDisplayHandler, "Delta + Min", "Test what happens when we add delta over min with min compression on Top Spin", kAnyModifier, 't');
	InstallKeyboardHandler(MyDisplayHandler, "TOH", "TOH Test", kAnyModifier, 'h');
	//InstallKeyboardHandler(MyDisplayHandler, "Delta + Min", "Test what happens when we add delta over min with min compression on TOH", kAnyModifier, 'd');

	InstallKeyboardHandler(MyDisplayHandler, "Step Simulation", "If the simulation is paused, step forward .1 sec.", kAnyModifier, 'o');
	InstallKeyboardHandler(MyDisplayHandler, "Step History", "If the simulation is paused, step forward .1 sec in history", kAnyModifier, '}');
	InstallKeyboardHandler(MyDisplayHandler, "Step History", "If the simulation is paused, step back .1 sec in history", kAnyModifier, '{');
	InstallKeyboardHandler(MyDisplayHandler, "Step Abs Type", "Increase abstraction type", kAnyModifier, ']');
	InstallKeyboardHandler(MyDisplayHandler, "Step Abs Type", "Decrease abstraction type", kAnyModifier, '[');

	InstallCommandLineHandler(MyCLHandler, "-pdb", "-pdb <dir>", "Set the directory to use for PDBs");
	InstallCommandLineHandler(MyCLHandler, "-test", "-test <bits> <factor>", "Basic test comparing A*, IDA*, MM");
	InstallCommandLineHandler(MyCLHandler, "-rubik", "-rubik", "Duplicating Zahavi et al 2007.");
	InstallCommandLineHandler(MyCLHandler, "-toh", "-toh <delta>


// Copyright (c) 2018 Graphcore Ltd. All rights reserved.
#ifdef __IPU__

// Assembly implementation of popops::UnaryOp2D[InPlace] vertices for the three
// non linearities SIGMOID RELU, TANH.

// Restrictions
//
//  * Vertex state aligned to at least 4 bytes.
//
//  * The not-in-place variants require each vector (both input and output)
//    to be 8 byte aligned
//
//  * The in-place ones only require 'natural' alignment (2 bytes for half,
//    4 bytes for float)

#include "poplar/TileConstants.hpp"
#include "poplar/AvailableVTypes.h"
#include "poplar/StackSizeDefs.hpp"
#include "CommonPoplibsMacros.h.S"

// Symbols
#define HALF_SYMBOL(IN_PLACE) \
  __runCodelet_popops__UnaryOp2D ## IN_PLACE ## ___popops__expr__UnaryOpType__\NL_TYPE\()_half

#define FLOAT_SYMBOL(IN_PLACE) \
  __runCodelet_popops__UnaryOp2D ## IN_PLACE ## ___popops__expr__UnaryOpType__\NL_TYPE\()_float

// Offsets for the vertex state parameters (fields), for the InPlace variants
#define BASE_AND_N0_VOFFSET 0
#define DELTAN_PTR_VOFFSET 4

// Offsets for the vertex state parameters (fields), for the not-InPlace variants
#define IN_ITERATOR_OFFS   0
#define OUT_ITERATOR_OFFS  4
#define N_VECT_2D_OFFS    8

#if defined(VECTORLIST_AVAIL_DELTAN)
#define DELTAN_BASE_PTR_BITS 20
#define DELTAN_BASE_PTR_MASK ((1 << DELTAN_BASE_PTR_BITS) - 1)
#define DELTAN_HALF_OFFSET_BITS 18
#define DELTAN_HALF_OFFSET_MASK ((1 << DELTAN_HALF_OFFSET_BITS) - 1)
#define DELTAN_FLOAT_OFFSET_BITS 18
#define DELTAN_FLOAT_OFFSET_MASK ((1 << DELTAN_FLOAT_OFFSET_BITS) - 1)
#else
#define DELTAN_BASE_PTR_BITS 24
#define DELTAN_BASE_PTR_MASK ((1 << DELTAN_BASE_PTR_BITS) - 1)
#define DELTAN_HALF_OFFSET_BITS 20
#define DELTAN_HALF_OFFSET_MASK ((1 << DELTAN_HALF_OFFSET_BITS) - 1)
#define DELTAN_FLOAT_OFFSET_BITS 19
#define DELTAN_FLOAT_OFFSET_MASK ((1 << DELTAN_FLOAT_OFFSET_BITS) - 1)
#endif

// Worker register aliases
#define MASK m0
#if defined(VECTORLIST_AVAIL_DELTAN)
#define MEMORY_BASE m1
#else
#define MEMORY_BASE mzero
#endif
#define BASE_PTR m2
#define N0 m3
#define N0_B m6
#define DELTAN_PTR m4
#define DATA_PTR m5
#define N1 m6
#define N1_64BIT m7
#define OUT_PTR m8
#define MSCRATCH m10

#define IN_ITERATOR   m0
#define OUT_ITERATOR  m1
#define N_VECT_2D     m2

#define ACTS_0 a0
#define ACTS_1 a1
#define ACTS_PAIR a0:1
#define RESULTS_0 a4
#define RESULTS_1 a5
#define RESULTS_PAIR a4:5
#define ASCRATCH a6
#define ASCRATCH_PAIR a6:7

//------------------------------------------------------------------------------
//


predicates.sub.Damage
import kotlinx.serialization.Serializable

/**
 * Triggered when a player hurts an entity.
 *
 * Docs: https://kore.ayfri.com/docs/advancements/triggers#playerhurtentity
 * Minecraft Wiki: https://minecraft.wiki/w/Advancement/JSON_format
 */
@Serializable
data class PlayerHurtEntity(
	override var name: String,
	override var conditions: EntityOrPredicates? = null,
	var damage: Damage? = null,
	var entity: EntityOrPredicates? = null,
) : AdvancementTriggerCondition()

/** Add a `playerHurtEntity` criterion, triggered when a player hurts an entity. */
fun AdvancementCriteria.playerHurtEntity(name: String, block: PlayerHurtEntity.() -> Unit = {}) {
	criteria += PlayerHurtEntity(name).apply(block)
}

/** Set the damage constraints. */
fun PlayerHurtEntity.damage(block: Damage.() -> Unit) {
	damage = Damage().apply(block)
}

/** Set the entity constraints. */
fun PlayerHurtEntity.entity(block: EntityOrPredicates.() -> Unit) {
	entity = EntityOrPredicates().apply(block)
}
package io.github.ayfri.kore.features.enchantments.effects.entity

import io.github.ayfri.kore.features.enchantments.values.LevelBased
import io.github.ayfri.kore.features.enchantments.values.constantLevelBased
import io.github.ayfri.kore.generated.arguments.MobEffectOrTagArgument
import io.github.ayfri.kore.serializers.InlinableList
import kotlinx.serialization.Serializable

@Serializable
data class ApplyMobEffect(
	var toApply: InlinableList<MobEffectOrTagArgument> = emptyList(),
	var minDuration: LevelBased = constantLevelBased(0),
	var maxDuration: LevelBased = constantLevelBased(0),
	var minAmplifier: LevelBased = constantLevelBased(0),
	var maxAmplifier: LevelBased = constantLevelBased(0),
) : EntityEffect()

fun ApplyMobEffect.toApply(vararg effects: MobEffectOrTagArgument) {
	toApply = effects.toList()
}

fun ApplyMobEffect.toApply(block: MutableList<MobEffectOrTagArgument>.() -> Unit) {
	toApply = buildList(block)
}

fun ApplyMobEffect.minDuration(value: Int) {
	minDuration = constantLevelBased(value)
}

fun ApplyMobEffect.maxDuration(value: Int) {
	maxDuration = constantLevelBased(value)
}

fun ApplyMobEffect.minAmplifier(value: Int) {
	minAmplifier = constantLevelBased(value)
}

fun ApplyMobEffect.maxAmplifier(value: Int) {
	maxAmplifier = constantLevelBased(value)
}
package io.github.ayfri.kore.features.enchantments.effects.builders

import io.github.ayfri.kore.features.enchantments.effects.value.*
import io.github.ayfri.kore.features.enchantments.effects.value.Set
import io.github.ayfri.kore.features.enchantments.values.LevelBased
import io.github.ayfri.kore.features.enchantments.values.constantLevelBased
import io.github.ayfri.kore.features.predicates.Predicate
import io.github.ayfri.kore.features.predicates.conditions.PredicateCondition
import io.github.ayfri.kore.serializers.InlinableList
import kotlinx.serialization.Serializable

@Serializable
sealed class ValueEffectAllOfBuilder(var effects: AllOf = AllOf())

data class ValueEffectAllOfTopBuilder(var requirements: InlinableList<PredicateCondition>? = null) : Value


= assembly.GetType(fullyQualifiedTypeName);
                var candidates = new SortedSet<string>();

                if (type != null)
                {
                    foreach (var constructor in type.GetConstructors(BINDING_FLAGS))
                    {
                        if (constructor.Name == memberName)
                        {
                            AppendConstructorInfo(constructor, sb);
                            candidates.Add(sb.ToString());
                            sb.Clear();
                        }
                    }
                    foreach (var method in type.GetMethods(BINDING_FLAGS))
                    {
                        if (method.Name == memberName)
                        {
                            AppendMethodInfo(method, sb);
                            candidates.Add(sb.ToString());
                            sb.Clear();
                        }
                    }
                    foreach (var property in type.GetProperties(BINDING_FLAGS))
                    {
                        if (property.Name == memberName)
                        {
                            AppendPropertyInfo(property, sb);
                            candidates.Add(sb.ToString());
                            sb.Clear();
                        }
                    }
                    foreach (var @event in type.GetEvents(BINDING_FLAGS))
                    {
                        if (@event.Name == memberName)
                        {
                            AppendEventInfo(@event, sb);
                            candidates.Add(sb.ToString());
                            sb.Clear();
                        }
                    }
                    foreach (var field in type.GetFields(BINDING_FLAGS))
                    {
                        if (field.Name == memberName)
                        {
                            AppendFieldInfo(field, sb);
                            candidates.Add(sb.ToString());
                            sb.Clear();
                        }
                    }
                }

                retVal = candidates;
            }
            return retVal;
        }
    }
}


attice[1][1] * lattice[2][2] - lattice[1][2] * lattice[2][1];
    let minor01 = lattice[1][0] * lattice[2][2] - lattice[1][2] * lattice[2][0];
    let minor02 = lattice[1][0] * lattice[2][1] - lattice[1][1] * lattice[2][0];
    let determinant = lattice[0][0] * minor00 - lattice[0][1] * minor01
                      + lattice[0][2] * minor02;
    if determinant.abs() < 1e-16 {
        Err(String::from("Lattice doesn't span 3D space"))
    } else {
        Ok([[minor00 / determinant,
             (lattice[0][2] * lattice[2][1] - lattice[2][2] * lattice[0][1])
             / determinant,
             (lattice[0][1] * lattice[1][2] - lattice[1][1] * lattice[0][2])
             / determinant],
            [-minor01 / determinant,
             (lattice[0][0] * lattice[2][2] - lattice[2][0] * lattice[0][2])
             / determinant,
             (lattice[0][2] * lattice[1][0] - lattice[1][2] * lattice[0][0])
             / determinant],
            [minor02 / determinant,
             (lattice[0][1] * lattice[2][0] - lattice[2][1] * lattice[0][0])
             / determinant,
             (lattice[0][0] * lattice[1][1] - lattice[1][0] * lattice[0][1])
             / determinant]])
    }
}

/// returns the first index that is not vacuum from a sorted index list
pub fn vacuum_index(density: &[f64],
                    index: &[usize],
                    tolerance: Option<f64>)
                    -> usize {
    match tolerance {
        Some(tol) => {
            for (i, p) in index.iter().enumerate() {
                if density[*p] < tol {
                    return i.saturating_sub(1);
                }
            }
            index.len()
        }
        None => index.len(),
    }
}

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

    #[test]
    fn utils_dot() {
        assert_eq!(dot([1., 2., 3.],
                       [[1., 0., 0.], [0., 2., 0.], [0., 0., 3.]]),
                   [1., 4., 9.])
    }

    #[test]
    fn utils_vdot() {
        assert_eq!(vdot([1., 2., 3.], [1., 2., 3.]), 14.)
    }

    #[test]
    fn utils_norm() {
        assert_eq!(norm([3., 4., 12.]), 13.)
    }

    #[test]
    fn utils_transpose_square() {
        let matrix = [[3., 0., 0.], [2.5, 2., 0.], [0., 0., 5.]];
        let t_squared = [[15.25, 5., 0.], [5., 4., 0.], [0., 0., 25.]];
        assert_eq!(transpose_square(matrix), t_squared)
    }

    #[test]
    fn utils_vacuum_index_some_high() {
        let data = (0..60).map(|x| x as f64).collect::<Vec<f64>>();


tener('input', ['$event.target.value'])
  onInputChange(value: string) {
    const filteredValue: string = this.filterValue(value);
    this.updateTextInput(filteredValue, this.value !== filteredValue);
  }

  @HostListener('blur')
  onBlur() {
    this.onTouched();
  }

  private updateTextInput(value: string, propagateChange: boolean) {
    this._renderer.setProperty(this._elementRef.nativeElement, 'value', value);
    if (propagateChange) {
      this.onChange(value);
    }

    this.value = value;
  }

  registerOnChange(fn: any) : void {
    this.onChange = fn;
  }

  registerOnTouched(fn: any) {
    this.onTouched = fn;
  }

  setDisabledState(isDisabled: boolean) : void {
    this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  }

  writeValue(value: any): void {
    this.value = value ? String(value) : '';
    this.updateTextInput(value, false);
  }

  filterValue(value: string) : string {
    return value.replace(/[^0-9|^۱-۹]*/g, '');
  }
}
import { CollisionComponent } from "../components/CollisionComponent";

export class CollisionData {
  public a: CollisionComponent;
  public b: CollisionComponent;
  public time: number;

  public constructor(time: number, a: CollisionComponent, b: CollisionComponent) {
    this.time = time;
    this.a = a;
    this.b = b;
  }
}

export class CollisionManager {
  private static _totalTime = 0;
  private static _components: CollisionComponent[] = [];

  private static _collisionData: CollisionData[] = [];

  private constructor() { }

  public static registerCollisionComponent(component: CollisionComponent) {
    CollisionManager._components.push(component);
  }

  public static unRegisterCollisionComponent(component: CollisionComponent) {
    const index = CollisionManager._components.indexOf(component);
    if (index !== -1) {
      CollisionManager._components.splice(index, 1);
    }
  }

  public static clear() {
    CollisionManager._components.length = 0;
  }

  public static update(time: number) {
    CollisionManager._totalTime += time;

    const len = CollisionManager._components.length;
    for (let i = 0; i < len; i++) {
      const c = CollisionManager._components[i];
      for (let j = i + 1; j < len; j++) {
        const o = CollisionManager._components[j];
        if (c.shape.intersects(o.shape)) {
          let exists: boolean = false;
          for (const d of CollisionManager._collisionData) {
            if ((d.a === c && d.b === o) || (d.a === o && d.b === c)) {
              c.onCollisionUpdate(o);
              o.onCollisionUpdate(c);
              d.time = CollisionManager._totalTime;
              exists = true;
              break;
            }
          }

          if (!exists) {
            const col = new CollisionData(CollisionManager._totalTime, c, o);
            c.onCollisionEntry(o);
            o.onCollisionEntry(c);
            this._collisionData.push(col);
          }
        }
      }
    }

    const removeData: CollisionData[] = [];
    for(const d of CollisionManager._collisionData) {
      if (d.time !== CollisionManager._totalTime) {
        removeData.push(d);
      }
    }

    while (removeData.length !== 0) {
      const data = removeData.shift();
      if (data === undefined) continue;
      const index = CollisionManager._collisionData.indexOf(data);
      CollisionManager._collisionData.splice(index, 1);

      data.a.onCollisionExit(data.


 hard drop.
 */
export class KHInputAxisDeadZoneScaledAxial extends KHInputAxisDerived {
    private source: KHInputAxis;
    private deadZone: number;

    /**
     * Creates a new KHInputAxisDeadZoneAxialScaled instance.
     * @param inputSet Input set. Used to make sure it gets updated.
     * @param deadZone How far the stick has to be tilted before it registers input (0-1).
     * @param source The axis that is being measured by this input.
     */
    constructor(inputSet: KHInputSet, deadZone: number, source: KHInputAxis) {
        super(inputSet);
        this.source = source;
        this.deadZone = Math.min(deadZone, 0.999);
    }

    updateDerivedInput(now: number, delta: number) {
        let value = this.source.getValue();
        if (Math.abs(value) < this.deadZone) {
            this.update(0);
        }
        else {
            this.update(Math.sign(value) * (Math.abs(value) - this.deadZone) / (1 - this.deadZone));
        }
    }
}export * from './cookie';

export function resolution2Color(resolution: string) {
  const list = {
    '1080p': 'purple',
    '720p': 'geekblue',
    '480p': 'green',
    '360p': 'red',
  };

  return list[resolution];
}

export function second2String(second: number) {
  const sec = second % 60;
  const min = (Math.floor(second / 60)) % 60;
  const hour = (Math.floor(second / 3600)) % 60;

  const results: string[] = [];

  if (hour) {
    results.push(`${hour}시간`);
  }

  if (min) {
    results.push(`${min}분`);
  }

  if (!hour && sec) {
    results.push(`${sec}초`);
  }

  return results.join(' ');
}
import { Request, Response } from "express";
import path from "path";
import fs, { promises } from "fs-extra";

import Photo from "../models/photo";

export async function getPhotos(
   req: Request,
   res: Response
): Promise<Response> {
   const photos = await Photo.find();
   console.log(photos);

   return res.json({
      message: "geting Photo",
      photos,
   });
}

export async function getPhoto(req: Request, res: Response) {
   const photo = await Photo.findById(req.params.id);
   console.log(photo);

   return res.json({
      photo,
   });
}

export async function createPhoto(req: Request, res: Response) {
   console.log("Saving photo");
   const { title, description } = req.body;
   const newPhoto = {
      title: title,
      description: description,
      imagePath: req.file.path,
   };
   const photo = new Photo(newPhoto);
   await photo.save();

   return res.json({
      message: "Photo succesfully saved",
      photo,
   });
}

export async function deletePhoto(req: Request, res: Response) {
   const photo = await Photo.findByIdAndDelete(req.params.id);

   if (photo) {
      await fs.unlink(path.resolve(photo.imagePath));
   }

   return res.json({
      message: "Photo delete succesfull",
      photo,
   });
}

export async function updatePhoto(
   req: Request,
   res: Response
): Promise<Response> {
   const { title, description } = req.body;
   const photo = await Photo.findByIdAndUpdate(
      req.params.id,
      {
         title,
         description,
      },
      { new: true }
   );

   return res.json({


this.currentRecord == null) {
			throw new Neo4jException(withReason("Invalid cursor position"));
		}
	}

	private void assertIsOpen() throws SQLException {
		if (this.closed) {
			throw new Neo4jException(withReason("The result set is closed"));
		}
	}

	private void assertColumnIndexIsPresent(int columnIndex) throws SQLException {
		if (columnIndex < 1 || columnIndex > this.currentRecord.size()) {
			throw new Neo4jException(withReason("Invalid column index value"));
		}
	}

	private void assertColumnLabelIsPresent(String columnLabel) throws SQLException {
		if (!this.currentRecord.containsKey(columnLabel)) {
			throw new Neo4jException(withReason("Invalid column label value"));
		}
	}

	private <T> T getValueByColumnIndex(int columnIndex, ValueMapper<T> valueMapper) throws SQLException {
		assertIsOpen();
		assertCurrentRecordIsNotNull();
		assertColumnIndexIsPresent(columnIndex);
		columnIndex--;
		this.value = this.currentRecord.get(columnIndex);
		return valueMapper.map(this.value);
	}

	private <T> T getValueByColumnLabel(String columnLabel, ValueMapper<T> valueMapper) throws SQLException {
		assertIsOpen();
		assertCurrentRecordIsNotNull();
		assertColumnLabelIsPresent(columnLabel);
		this.value = this.currentRecord.get(columnLabel);
		return valueMapper.map(this.value);
	}

	private int calculateFetchSize() {
		return (this.remainingRowAllowance > 0) ? Math.min(this.remainingRowAllowance, this.fetchSize) : this.fetchSize;
	}

	private void decrementRemainingRowAllowance() {
		if (this.remainingRowAllowance > 0) {
			this.remainingRowAllowance--;
		}
	}

	private static String mapToString(Value value, int maxFieldSize) throws SQLException {
		if (Type.STRING.isTypeOf(value)) {
			return truncate(value.asString(), maxFieldSize);
		}
		if (Type.NULL.isTypeOf(value)) {
			return null;
		}

		try {
			if (NO_TO_STRING_SUPPORT.stream().anyMatch(t -> t.isTypeOf(value))) {
				throw new UncoercibleException(value.type().name(), "String");
			}
			return value.toString();
		}
		catch (UncoercibleException ex) {
			throw new Neo4jException(GQLError.$22N37.withTemplatedMessage(value.toDisplayString(), "String"));
		}
	}

	private static URL mapToUrl(Value value) throws SQLException {
		if (Type.STRING.isTypeOf(value)) {
			try {
				return new URL(value.asString());
			}
			catch (MalformedURLException ex) {
				throw new Neo4jException(
						GQLError.$22N37.causedBy(ex).withTemplatedMessage(value.toDisplayString(), "URL"));
			}
		}
		if (Type.NULL.isTypeOf(value)) {
			return null;
		}
		throw new Neo4jException(GQLError.$22N37.withTemplatedMessage(value.toDisplayString(), "URL"));
	}

	private static boolean mapToBoolean(Value value) throws SQLException {
		if (Type.BOOLEAN.isTypeOf(value)) {
			return value.asBoolean();
		}
		if (Type.NULL.isTypeOf(value)) {
			return false;
		}
		if (Type.INTEGER.isTypeOf(value)) {
			var number = value.asNumber().longValue();
			if (number == 0) {
				return false;
			}
			else if (number == 1) {
				return true;
			}
			else {
				throw new Neo4jException(GQLEr


nstance->object = rtcNewScene(g_device);
    createTriangulatedSphere(instance->object,instance->center,instance->radius);

    /* when no parallel commit mode at all is supported let only a single thread build */
    if (!join_commit_supported && !parallel_commit_supported)
      rtcCommitScene(instance->object);

    /* now switch to the LAZY_COMMIT state */
    __memory_barrier();
    instance->state = LAZY_COMMIT;
  }
  else
  {
    /* wait until the geometry got created */
    while (atomic_cmpxchg((int32_t*)&instance->state,10,11) < LAZY_COMMIT) {
      // instead of actively spinning here, best use a condition to let the thread sleep, or let it help in the creation stage
    }
  }

  /* if we support rtcCommit to get called from multiple threads, then this should be preferred for performance reasons */
  if (parallel_commit_supported)
    rtcCommitScene(instance->object);

  /* otherwise we could fallback to rtcJoinCommit scene, which has lower performance */
  else if (join_commit_supported)
    rtcJoinCommitScene(instance->object);

  /* switch to LAZY_VALID state */
  atomic_cmpxchg((int32_t*)&instance->state,LAZY_COMMIT,LAZY_VALID);
}

void eagerCreate(LazyGeometry* instance)
{
  //printf("creating sphere %i (eager)\n",instance->userID);
  instance->object = rtcNewScene(g_device);
  createTriangulatedSphere(instance->object,instance->center,instance->radius);
  rtcCommitScene(instance->object);
  instance->state = LAZY_VALID;
}

void instanceIntersectFuncN(const RTCIntersectFunctionNArguments* args)
{
  const int* valid = args->valid;
  void* ptr  = args->geometryUserPtr;
  RTCIntersectContext* context = args->context;
  RTCRayHitN* rays = (RTCRayHitN*)args->rayhit;
  assert(args->N == 1);
  LazyGeometry* instance = (LazyGeometry*)ptr;

  if (!valid[0])
    return;

  Ray *ray = (Ray *)rays;

  /* create the object if it is not yet created */
  if (instance->state != LAZY_VALID)
    lazyCreate(instance);

  /* trace ray inside object */
  const unsigned int geomID = ray->geomID;
  ray->geomID = RTC_INVALID_GEOMETRY_ID;
  rtcIntersect1(instance->object,context,RTCRayHit_(*ray));
  if (ray->geomID == RTC_INVALID_GEOMETRY_ID) ray->geomID = geomID;
  else ray->instID[0] = instance->userID;
}

void instanceOccludedFuncN(const RTCOccludedFunctionNArguments* args)
{
  const int* valid = args->valid;
  void* ptr  = args->geometryUserPtr;
   RTCIntersectContext* context = args->context;
   RTCRayHitN* rays = (RTCRayHitN*)args->ray;
  assert(args->N == 1);
  LazyGeometry* instance = (LazyGeometry*)ptr;

  if (!valid[0])
    return;

  Ray *ray = (Ray *)rays;
  /* create the object if it is not yet created */
  if (instance->state != LAZY_VALID)
    lazyCreate(instance);

  /* trace ray inside object */
  rtcOccluded1(instance->object,context,RTCRay_(*ray));
}

LazyGeometry* createLazyObject (RTCScene scene, int userID, const Vec3fa& center, const


.target_info = Some(BoundedListNode::new(
            self.inspect_node.create_child("target_info"),
            MAX_FEATURE_SETS,
        ));
        self.controller_info = Some(BoundedListNode::new(
            self.inspect_node.create_child("controller_info"),
            MAX_FEATURE_SETS,
        ));
        Ok(())
    }
}

impl RemotePeerInspect {
    pub fn new(peer_id: PeerId) -> Self {
        Self {
            peer_id,
            target_info: None,
            controller_info: None,
            last_connected: None,
            metrics_node: MetricsNode::default(),
            inspect_node: inspect::Node::default(),
        }
    }

    pub fn node(&self) -> &inspect::Node {
        &self.inspect_node
    }

    /// Sets this peer's node for metrics collection.
    pub fn set_metrics_node(&mut self, metrics_node: MetricsNode) {
        self.metrics_node = metrics_node;
    }

    pub fn record_target_features(&mut self, service: AvrcpService) {
        if let AvrcpService::Target { features, protocol_version, .. } = service {
            if let Some(desc) = self.target_info.as_mut() {
                inspect_log!(
                    desc,
                    features: format!("{:?}", features),
                    version: format!("{:?}", protocol_version)
                );
            }
            self.metrics_node.target_features(self.peer_id, features);
        }
    }

    pub fn record_controller_features(&mut self, service: AvrcpService) {
        if let AvrcpService::Controller { features, protocol_version, .. } = service {
            if let Some(desc) = self.controller_info.as_mut() {
                inspect_log!(
                    desc,
                    features: format!("{:?}", features),
                    version: format!("{:?}", protocol_version)
                );
            }
            self.metrics_node.controller_features(self.peer_id, features);
        }
    }

    pub fn record_connected(&mut self, at: fasync::Time) {
        if let Some(prop) = &self.last_connected {
            prop.set_at(at.into());
        } else {
            self.last_connected =
                Some(self.inspect_node.create_time_at("last_connected", at.into()));
        }
        self.metrics_node.control_connection();
    }

    pub fn metrics(&self) -> &MetricsNode {
        &self.metrics_node
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::profile::{AvrcpControllerFeatures, AvrcpProtocolVersion, AvrcpTargetFeatures};

    use {
        fuchsia_bluetooth::profile::Psm,
        fuchsia_inspect::{assert_data_tree, testing::AnyProperty},
        fuchsia_inspect_derive::WithInspect,
    };

    #[test]
    fn remote_peer_inspect_tree() {
        let _executor = fasync::TestExecutor::new();
        let inspect = inspect::Inspector::new();

        let mut peer_inspect =
            RemotePeerInspect::new(PeerId(1)).with_inspect(inspect.root(), "peer").unwrap();

        // Default inspect tree.
        assert_data_tree!(inspect, root: {
            peer: {
                peer_id: AnyProperty,
                controller_info: {},
                target_info: {},
            }
        });

        let target_info = AvrcpService::Target {
            features: AvrcpTargetFeatures::PLAYERSETTINGS,
            psm: Psm::new(20),


vmSynthetic
      @kotlin.PublishedApi
      internal fun _create(builder: qaul.sys.ble.BleOuterClass.BleDirectSend.Builder): Dsl = Dsl(builder)
    }

    @kotlin.jvm.JvmSynthetic
    @kotlin.PublishedApi
    internal fun _build(): qaul.sys.ble.BleOuterClass.BleDirectSend = _builder.build()

    /**
     * ```
     * message id (as a reference for the result message)
     * ```
     *
     * `bytes message_id = 1;`
     */
    public var messageId: com.google.protobuf.ByteString
      @JvmName("getMessageId")
      get() = _builder.getMessageId()
      @JvmName("setMessageId")
      set(value) {
        _builder.setMessageId(value)
      }
    /**
     * ```
     * message id (as a reference for the result message)
     * ```
     *
     * `bytes message_id = 1;`
     */
    public fun clearMessageId() {
      _builder.clearMessageId()
    }

    /**
     * ```
     * qaul id of the device to send it to
     * ```
     *
     * `bytes receiver_id = 2;`
     */
    public var receiverId: com.google.protobuf.ByteString
      @JvmName("getReceiverId")
      get() = _builder.getReceiverId()
      @JvmName("setReceiverId")
      set(value) {
        _builder.setReceiverId(value)
      }
    /**
     * ```
     * qaul id of the device to send it to
     * ```
     *
     * `bytes receiver_id = 2;`
     */
    public fun clearReceiverId() {
      _builder.clearReceiverId()
    }

    /**
     * ```
     * qaul id of the sending device
     * ```
     *
     * `bytes sender_id = 3;`
     */
    public var senderId: com.google.protobuf.ByteString
      @JvmName("getSenderId")
      get() = _builder.getSenderId()
      @JvmName("setSenderId")
      set(value) {
        _builder.setSenderId(value)
      }
    /**
     * ```
     * qaul id of the sending device
     * ```
     *
     * `bytes sender_id = 3;`
     */
    public fun clearSenderId() {
      _builder.clearSenderId()
    }

    /**
     * ```
     * data to be sent
     * ```
     *
     * `bytes data = 4;`
     */
    public var data: com.google.protobuf.ByteString
      @JvmName("getData")
      get() = _builder.getData()
      @JvmName("setData")
      set(value) {
        _builder.setData(value)
      }
    /**
     * ```
     * data to be sent
     * ```
     *
     * `bytes data = 4;`
     */
    public fun clearData() {
      _builder.clearData()
    }
  }
}
@kotlin.jvm.JvmSynthetic
public inline fun qaul.sys.ble.BleOuterClass.BleDirectSend.copy(block: qaul.sys.ble.BleDirectSendKt.Dsl.() -> kotlin.Unit): qaul.sys.ble.BleOuterClass.BleDirectSend =
  qaul.sys.ble.BleDirectSendKt.Dsl._create(this.toBuilder()).apply { block() }._build()

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: services/messaging/messaging.proto

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package qaul.net.messaging;

@kotlin.jvm.JvmName("-initializecontainer")
public inline fun container(block: qaul


//
// Dagor Engine 6.5 - Game Libraries
// Copyright (C) Gaijin Games KFT.  All rights reserved.
//
#pragma once

#include <util/dag_stdint.h>
#include <math/dag_Quat.h>
#include <math/dag_mathUtils.h>

namespace danet
{
class BitStream;
};

namespace gamephys
{
// Histories
bool readHistory32(const danet::BitStream &bs, uint32_t &data);
void writeHistory32(danet::BitStream &bs, uint32_t data);

// Time
double alignTime(double time, float fixed_dt);
inline int floorPhysicsTickNumber(float time, float fixed_dt)
{
  return int(time / fixed_dt); // conversion to int always truncates (round-to-zero)
}
inline int nearestPhysicsTickNumber(float time, float fixed_dt)
{
#if _TARGET_SIMD_SSE > 0
  return _mm_cvtss_si32(_mm_set_ss(time / fixed_dt));
#else
  return int(time / fixed_dt + 0.5f);
#endif
}
inline int ceilPhysicsTickNumber(float time, float fixed_dt)
{
  // Note: difference from std ceil() - for exactly divisible by fixed_dt time N this gives N+1 tick (i.e. 123.0 -> 124)
  // This is intentional, since this is how our controls/physics works
  return floorPhysicsTickNumber(time, fixed_dt) + 1;
}

// Interpolation / extrapolation
template <class T>
inline void calc_pos_vel_at_time(double at_time, const T &pos1, const T &vel1, double time1, const T &pos2, const T &vel2,
  double time2, T &out_pos, T &out_vel)
{
  const double step = time2 - time1;
  const double dt = at_time - time1;
  const double stepPart = dt / step;
  if (time1 <= at_time && at_time <= time2)
  {
    // interpolation by acceleration and its derrivative
    const T deltaPos = pos2 - pos1;
    const T deltaVel = vel2 - vel1;
    const T accelDeriv = (deltaVel - step * (deltaPos - vel1 * step) / (sqr(step) * 0.5f)) /
                         (sqr(step) * 0.5f - step * (sqr(step) * step * 0.333f) / (sqr(step) * 0.5f));
    const T accelPrev = (deltaVel - accelDeriv * sqr(step) * 0.5f) / step;

    out_pos = pos1 + vel1 * dt + accelPrev * sqr(dt) * 0.5f + accelDeriv * sqr(dt) * dt * 0.333f;
    out_vel = vel1 + accelPrev * dt + accelDeriv * sqr(dt) * 0.5f;
  }
  else
  {
    // current acceleration is not used in extrapolation as it may produce wrong estimations
    out_pos = pos1 * (1.0 - stepPart) + pos2 * stepPart;
    out_vel = vel1 * (1.0 - stepPart) + vel2 * stepPart;
  }
}

template <class T>
inline void calc_quat_omega_at_time(double at_time, const Quat &quat1, const T &omega1, double time1, const Quat &quat2,
  const T &omega2, double time2, Quat &out_quat, T &out_omega)
{
  const double step = time2 - time1;
  const double dt = at_time - time1;
  const double stepPart = dt / step;
  out_quat = normalize(qinterp(quat1, quat2, stepPart));
  out_omega = omega1 * (1.0 - stepPart) + omega2 * stepPart;
}
}; // namespace gamephys

// Moved from dng/phys/physUtils.h
// TODO: Move to gamephys namespace
template <typename Phys>
inline float get_phys_interp_time(const Phys &phys, float at_time)
{
  if (int tdelta = phys.currentState.atTick - phys.currentState.lastAppliedControlsForTick - 1) // correction for delayed controls mode
    return at_time + tdelta * phys.timeStep;
  else
    return at_time;
}

template <typename Phys>
inline float get_phys_interpk_clamped(const Phys &phys, float at_time)
{
  return cvt(get_phys_interp_time(phys, at_time), phys.previousState.atTick * phys.timeStep, phys.currentState.atTick * phys.timeStep,
    0.f, 1.f);
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.Graphics;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Runtime;
using Android.Support.V4.Graphics.Drawable;
using Android.Views;
using Android.Widget;
using Xamarin.Forms.Platform.Android;
using static Android.Graphics.Shader;

namespace Skor.Controls.Droid.Extensions
{
    public static class BackgroundExtension
    {
        public static LinearGradient CreateLinearGradient(Color startColor, Color endColor, Color centerColor, float width, float height)
        {
            return new LinearGradient(0, height/2, width, height/2,
                new int[] { startColor, centerColor, endColor },
                null,
                TileMode.Mirror
                );
        }
        public static Drawable CreateBackgroundColor(Color color, float cornerRadius)
        {
            GradientDrawable drawble = new GradientDrawable();
            drawble.SetShape(ShapeType.Rectangle);
            drawble.SetCornerRadius(cornerRadius);
            drawble.SetColors(new int[] { color, color });
            return drawble;
        }
        public static Drawable CreateBackgroundGradient(Color startColor, Color endColor, Color centerColor,
            float cornerRadius, GradientDrawable.Orientation orientation)


,
{'5483',	'蹕',	'蹕'},
{'5484',	'颮',	'颮'},
{'5485',	'婊子養的',	'婊子養的'},
{'5486',	'賓周',	'賓周'},
{'5487',	'冰後',	'冰後'},
{'5488',	'博訊',	'博訊'},
{'5489',	'不滅帝王',	'不滅帝王'},
{'5490',	'不爽不要錢',	'不爽不要錢'},
{'5491',	'蔡崇國',	'蔡崇國'},
{'5492',	'蔡啟芳',	'蔡啟芳'},
{'5493',	'操那嗎B',	'操那嗎B'},
{'5494',	'操那嗎逼',	'操那嗎逼'},
{'5495',	'操那嗎比',	'操那嗎比'},
{'5496',	'操你爺爺',	'操你爺爺'},
{'5497',	'曹長青',	'曹長青'},
{'5498',	'草你媽',	'草你媽'},
{'5499',	'草擬媽',	'草擬媽'},
{'5500',	'冊那娘餓比',	'冊那娘餓比'},
{'5501',	'插那嗎B',	'插那嗎B'},
{'5502',	'插那嗎逼',	'插那嗎逼'},
{'5503',	'插那嗎比',	'插那嗎比'},
{'5504',	'插你媽',	'插你媽'},
{'5505',	'插你爺爺',	'插你爺爺'},
{'5506',	'閶',	'閶'},
{'5507',	'長官沙塔特',	'長官沙塔特'},
{'5508',	'常勁',	'常勁'},
{'5509',	'朝鮮',	'朝鮮'},
{'5510',	'車侖',	'車侖'},
{'5511',	'車侖女幹',	'車侖女幹'},
{'5512',	'沉睡圖騰',	'沉睡圖騰'},
{'5513',	'陳炳基',	'陳炳基'},
{'5514',	'陳博志',	'陳博志'},
{'5515',	'陳定南',	'陳定南'},
{'5516',	'陳建銘',	'陳建銘'},
{'5517',	'陳景俊',	'陳景俊'},
{'5518',	'陳菊',	'陳菊'},
{'5519',	'陳軍',	'陳軍'},
{'5520',	'陳蒙',	'陳蒙'},
{'5521',	'陳破空',	'陳破空'},
{'5522',	'陳水扁',	'陳水扁'},
{'5523',	'陳唐山',	'陳唐山'},
{'5524',	'陳希同',	'陳希同'},
{'5525',	'陳小同',	'陳小同


n1 = int(input('digite um valor: '))
n2 = int(input('Digite outro valor: '))

s = n1 + n2

print('a {} e {} = {}'.format(n1, n2, s))

print(type(s))

#metodos python (is.numeric)


op {r3, r4, r5, r6, r7, pc}
_02220F1E:
	ldr r0, _022210C8 ; =ov13_0224CFB8
	mov r1, #1
	strb r1, [r0, #0x1c]
	bl ov13_02221428
	mov r0, #2
	add r1, r0, #0
	mov r2, #0
	bl ov13_02222A00
	ldr r1, _022210BC ; =ov13_022459B4
	cmp r0, #0
	str r0, [r1]
	bge _02220F4E
	ldr r1, _022210C0 ; =0x00000116
	ldr r0, [sp, #8]
	mov r2, #0xf
	strb r2, [r0, r1]
	bl ov13_02221428
	mov r0, #0
	add sp, #0xc8
	mvn r0, r0
	pop {r3, r4, r5, r6, r7, pc}
_02220F4E:
	mov r1, #4
	str r1, [sp]
	ldr r1, _022210CC ; =0x0000FFFF
	mov r2, #1
	add r3, sp, #0x54
	bl ov13_022229FC
	cmp r0, #0
	bge _02220F7A
	mov r0, #0xb
	bl ov13_022214AC
	ldr r1, _022210C0 ; =0x00000116
	ldr r0, [sp, #8]
	mov r2, #0xf
	strb r2, [r0, r1]
	bl ov13_02221428
	mov r0, #0
	add sp, #0xc8
	mvn r0, r0
	pop {r3, r4, r5, r6, r7, pc}
_02220F7A:
	add r0, sp, #0x2c
	mov r1, #0
	mov r2, #8
	bl ov13_02222978
	mov r1, #2
	add r0, sp, #0x2c
	strb r1, [r0, #1]
	ldr r0, [sp, #0x1c]
	bl ov13_02222A1C
	str r0, [sp, #0x30]
	ldr r0, _022210D0 ; =0x00005790
	bl ov13_02222A44
	add r1, sp, #0x2c
	strh r0, [r1, #2]
	ldr r0, _022210BC ; =ov13_022459B4
	add r1, sp, #0x2c
	ldr r0, [r0]
	mov r2, #8
	bl ov13_02222A08
	cmp r0, #0
	bge _02220FC0
	ldr r1, _022210C0 ; =0x00000116
	ldr r0, [sp, #8]
	mov r2, #0xf
	strb r2, [r0, r1]
	bl ov13_02221428
	mov r0, #0
	add sp, #0xc8
	mvn r0, r0
	pop {r3, r4, r5, r6, r7, pc}
_02220FC0:
	ldr r3, _022210BC ; =ov13_022459B4
	ldr r0, [sp, #0x24]
	ldr r3, [r3]
	add r1, sp, #0x60
	add r2, sp, #0xb0
	bl ov13_022220B4
	mov r1, #0
	mvn r1, r1
	cmp r0, r1
	bne _02220FF6
	mov r1, #1
	ld


text/javascript">
        var map,
            layerURL = "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer";

        function init() {
            var jsonp = new OpenLayers.Protocol.Script();
            jsonp.createRequest(layerURL, {
                f: 'json',
                pretty: 'true'
            }, initMap);
        }

        function initMap(layerInfo){
            /*
             * The initialize function in this layer has the ability to automatically configure
             * itself if given the JSON capabilities object from the ArcGIS map server.
             * This hugely simplifies setting up a new layer, and switching basemaps when using this technique.
             *
             * see the 'initialize' function in ArcGISCache.js, or
             * see the other two ArcGISCache.js examples for direct manual configuration options
             *
             */
            var baseLayer = new OpenLayers.Layer.ArcGISCache("AGSCache", layerURL, {
                layerInfo: layerInfo
            });

            /*
             * Make sure our baselayer and our map are synced up
             */
            map = new OpenLayers.Map('map', {
                maxExtent: baseLayer.maxExtent,
                units: baseLayer.units,
                resolutions: baseLayer.resolutions,
                numZoomLevels: baseLayer.numZoomLevels,
                tileSize: baseLayer.tileSize,
                displayProjection: baseLayer.displayProjection
            });
            map.addLayers([baseLayer]);

            //overlay test layer
            //http://dev.openlayers.org/examples/web-mercator.html
            var wms = new OpenLayers.Layer.WMS("Highways",
                "http://sampleserver1.arcgisonline.com/arcgis/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer",
                {layers: "2", format: "image/gif", transparent: "true"},
                { isBaseLayer: false, wrapDateLine: false }
            );
            map.addLayers([wms]);

            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.MousePosition() );
            //map.zoomToExtent(new OpenLayers.Bounds(-8341644, 4711236, -8339198, 4712459));
            map.zoomToExtent(new OpenLayers.Bounds(-8725663.6225564, 4683718.6735907, -8099491.4868444, 4996804.7414467));
        }
    </script>

OpenLayers 2 ArcGIS Cache Example (Autoconfigure with JSONP)

        arcgis, arcgiscache, cache, tms, jsonp

        Demonstrates the basic initialization of the ArcGIS Cache layer by using the server capabilities object.

This example demonstrates using the ArcGISCache layer for
        accessing ESRI's ArcGIS Server (AGS) Map Cache tiles normally through
        a live AGS MapServer.  Toggle the visibility of the overlay to
        demonstrate how the two layers are lined up correctly.

Notes on this Layer

        This method automatically configures the layer using the capabilities object
        generated by the server itself.  This page shows how to construct the url for the server capabilities object,
        retrieve it using JSONP, and pass it in during construction.  Note that in this case,
        the layer is constructed before the map.  This approach greatly simplifies the
        configuration of your map, and works best when all your tiles / overlays are similarly laid out.
        If you are using a live AGS map server for your layer, it can be helpful to check your
        server


size(0)>1:
                utils.save_image(clip_img(out_img[1:]), log_dir + prefix + 'epoch_' +str(n_epoch+1) + '_iter_' + str(n_iter+1) + '_1.jpg')

    def save_model(self, log_dir):
        torch.save(self.enc.state_dict(),'{:s}/enc.pth.tar'.format(log_dir))

    def save_checkpoint(self, n_epoch, log_dir):
        checkpoint_state = {
            'n_epoch': n_epoch,
            'enc_state_dict': self.enc.state_dict(),
            'enc_opt_state_dict': self.enc_opt.state_dict(),
            'enc_scheduler_state_dict': self.enc_scheduler.state_dict()
        }
        torch.save(checkpoint_state, '{:s}/checkpoint.pth'.format(log_dir))
        if (n_epoch+1)%10 == 0 :
            torch.save(checkpoint_state, '{:s}/checkpoint'.format(log_dir)+'_'+str(n_epoch+1)+'.pth')

    def load_model(self, log_dir):
        self.enc.load_state_dict(torch.load('{:s}/enc.pth.tar'.format(log_dir)))

    def load_checkpoint(self, checkpoint_path):
        state_dict = torch.load(checkpoint_path)
        self.enc.load_state_dict(state_dict['enc_state_dict'])
        self.enc_opt.load_state_dict(state_dict['enc_opt_state_dict'])
        self.enc_scheduler.load_state_dict(state_dict['enc_scheduler_state_dict'])
        return state_dict['n_epoch'] + 1

    def update(self, w=None, img=None, noise=None, real_img=None, n_iter=0):
        self.n_iter = n_iter
        self.enc_opt.zero_grad()
        self.compute_loss(w=w, img=img, noise=noise, real_img=real_img).backward()
        self.enc_opt.step()


nt(0deg,#f44336 2px,rgba(244,67,54,0) 0),linear-gradient(0deg,hsla(0,0%,71%,.1) 1px,hsla(0,0%,71%,0) 0)}.dark-edition .has-success .form-control:read-only{background-image:linear-gradient(0deg,#d2d2d2 1px,hsla(0,0%,82%,0) 0),linear-gradient(0deg,hsla(0,0%,71%,.1) 1px,hsla(0,0%,71%,0) 0)}.dark-edition .has-success .form-control.disabled,.dark-edition .has-success .form-control:disabled,.dark-edition .has-success .form-control[disabled],fieldset[disabled][disabled] .dark-edition .has-success .form-control{background-image:linear-gradient(90deg,hsla(0,0%,71%,.1) 0,hsla(0,0%,71%,.1) 30%,transparent 0,transparent);background-repeat:repeat-x;background-size:3px 1px}.dark-edition .has-success .form-control.form-control-success,.is-focused .dark-edition .has-success .form-control.form-control-success{background-image:linear-gradient(0deg,#4caf50 2px,rgba(76,175,80,0) 0),linear-gradient(0deg,hsla(0,0%,71%,.1) 1px,hsla(0,0%,71%,0) 0),"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MTIgNzkyIj48cGF0aCBmaWxsPSIjNWNiODVjIiBkPSJNMjMzLjggNjEwYy0xMy4zIDAtMjYtNi0zNC0xNi44TDkwLjUgNDQ4LjhDNzYuMyA0MzAgODAgNDAzLjMgOTguOCAzODljMTguOC0xNC4yIDQ1LjUtMTAuNCA1OS44IDguNGw3MiA5NUw0NTEuMyAyNDJjMTIuNS0yMCAzOC44LTI2LjIgNTguOC0xMy43IDIwIDEyLjQgMjYgMzguNyAxMy43IDU4LjhMMjcwIDU5MGMtNy40IDEyLTIwLjIgMTkuNC0zNC4zIDIwaC0yeiIvPjwvc3ZnPg=="}.dark-edition .has-success .form-control.form-control-warning,.is-focused .dark-edition .has-success .form-control.form-control-warning{background-image:linear-gradient(0deg,#4caf50 2px,rgba(76,175,80,0) 0),linear-gradient(0deg,hsla(0,0%,71%,.1) 1px,hsla(0,0%,71%,0) 0),"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MTIgNzkyIj48cGF0aCBmaWxsPSIjZjBhZDRlIiBkPSJNNjAzIDY0MC4ybC0yNzguNS01MDljLTMuOC02LjYtMTAuOC0xMC42LTE4LjUtMTAuNnMtMTQuNyA0LTE4LjUgMTAuNkw5IDY0MC4yYy0zLjcgNi41LTMuNiAxNC40LjIgMjAuOCAzLjggNi41IDEwLjggMTAuNCAxOC4zIDEwLjRoNTU3YzcuNiAwIDE0LjYtNCAxOC40LTEwLjQgMy41LTYuNCAzLjYtMTQuNCAwLTIwLjh6bS0yNjYuNC0zMGgtNjEuMlY1NDloNjEuMnY2MS4yem0wLTEwN2gtNjEuMlYzMDRoNjEuMnYxOTl6Ii8+PC9zdmc+"}.dark-edition .has-success .form-control.form-control-danger,.is-focused .dark-edition .has-success .form-control.form-control-danger{background-image:linear-gradient(0deg,#4caf50 2px,rgba(76,175,


 schemasv2.UpdateDeploymentSchema{
		DeploymentConfigSchema: DefaultDeploymentConfigSchema(),
		DynamoNim:              "nvidia:123456",
	}
}

// DefaultCreateDeploymentSchema generates a default CreateDeploymentSchema
func DefaultCreateDeploymentSchemaV2() schemasv2.CreateDeploymentSchema {
	return schemasv2.CreateDeploymentSchema{
		Name:                   "default-deployment",
		UpdateDeploymentSchema: DefaultUpdateDeploymentSchemaV2(),
	}
}
/*
 * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package converters

import (
	"context"
	"fmt"
	"strings"

	"github.com/ai-dynamo/dynamo/deploy/dynamo/api-server/api/mocks"
	"github.com/ai-dynamo/dynamo/deploy/dynamo/api-server/api/models"
	"github.com/ai-dynamo/dynamo/deploy/dynamo/api-server/api/schemas"
	"github.com/ai-dynamo/dynamo/deploy/dynamo/api-server/api/services"
	"github.com/pkg/errors"
)

func ToDeploymentTargetSchema(ctx context.Context, deploymentTarget *models.DeploymentTarget) (*schemas.DeploymentTargetSchema, error) {
	if deploymentTarget == nil {
		return nil, nil
	}
	ss, err := ToDeploymentTargetSchemas(ctx, []*models.DeploymentTarget{deploymentTarget})
	if err != nil {
		return nil, err
	}
	return ss[0], nil
}

func ToDeploymentTargetSchemas(ctx context.Context, deploymentTargets []*models.DeploymentTarget) ([]*schemas.DeploymentTargetSchema, error) {
	resourceSchemasMap := make(map[string]*schemas.ResourceSchema, len(deploymentTargets))
	for _, target := range deploymentTargets {
		resourceSchemasMap[target.GetUid()] = ToResourceSchema(targetToResource(target), target.GetResourceType())
	}

	res := make([]*schemas.DeploymentTargetSchema, 0, len(deploymentTargets))
	for _, deploymentTarget := range deploymentTargets {
		creatorSchema := mocks.DefaultUser()

		dynamoNimParts := strings.Split(deploymentTarget.DynamoNimVersionTag, ":")
		if len(dynamoNimParts) != 2 {
			return nil, errors.Errorf("Invalid format for DynamoNIM version tag %s. Expected 2 parts got %d", deploymentTarget.DynamoNimVersionTag, len(dynamoNimParts))
		}

		dynamoNimVersionFullSchema, err := services.BackendService.GetDynamoNimVersion(ctx, dynamoNimParts[0], dynamoNimParts[1])
		if err != nil {
			dynamoNimVersionFullSchema = nil // We shouldn't fail the request if this info is missing
		}

		resourceSchema, ok := resourceSchemasMap[deploymentTarget.GetUid()]
		if !ok {
			return nil, fmt.Errorf("resourceSchema not found for deploymentTarget %s", deploymentTarget.GetUid())
		}
		res = append(res, &schemas.DeploymentTargetSchema{
			ResourceSchema: *resourceSchema,
			DeploymentTarg


id="S6.F4.14.m2.1.1.cmml" xref="S6.F4.14.m2.1.1">𝑘</ci></apply></annotation-xml><annotation encoding="application/x-tex" id="S6.F4.14.m2.1d">R_{\rm mp}(k)</annotation><annotation encoding="application/x-llamapun" id="S6.F4.14.m2.1e">italic_R start_POSTSUBSCRIPT roman_mp end_POSTSUBSCRIPT ( italic_k )</annotation></semantics></math> from Magneticum (at <math alttext="z=0.25" class="ltx_Math" display="inline" id="S6.F4.15.m3.1"><semantics id="S6.F4.15.m3.1b"><mrow id="S6.F4.15.m3.1.1" xref="S6.F4.15.m3.1.1.cmml"><mi id="S6.F4.15.m3.1.1.2" xref="S6.F4.15.m3.1.1.2.cmml">z</mi><mo id="S6.F4.15.m3.1.1.1" xref="S6.F4.15.m3.1.1.1.cmml">=</mo><mn id="S6.F4.15.m3.1.1.3" xref="S6.F4.15.m3.1.1.3.cmml">0.25</mn></mrow><annotation-xml encoding="MathML-Content" id="S6.F4.15.m3.1c"><apply id="S6.F4.15.m3.1.1.cmml" xref="S6.F4.15.m3.1.1"><eq id="S6.F4.15.m3.1.1.1.cmml" xref="S6.F4.15.m3.1.1.1"></eq><ci id="S6.F4.15.m3.1.1.2.cmml" xref="S6.F4.15.m3.1.1.2">𝑧</ci><cn id="S6.F4.15.m3.1.1.3.cmml" type="float" xref="S6.F4.15.m3.1.1.3">0.25</cn></apply></annotation-xml><annotation encoding="application/x-tex" id="S6.F4.15.m3.1d">z=0.25</annotation><annotation encoding="application/x-llamapun" id="S6.F4.15.m3.1e">italic_z = 0.25</annotation></semantics></math>) using a six parameter model (parameters marked with <math alttext="\dagger" class="ltx_Math" display="inline" id="S6.F4.16.m4.1"><semantics id="S6.F4.16.m4.1b"><mo id="S6.F4.16.m4.1.1" mathcolor="#A60000" xref="S6.F4.16.m4.1.1.cmml">†</mo><annotation-xml encoding="MathML-Content" id="S6.F4.16.m4.1c"><ci id="S6.F4.16.m4.1.1.cmml" xref="S6.F4.16.m4.1.1">†</ci></annotation-xml><annotation encoding="application/x-tex"


 if there is no such element.
	 */
	fun elementWithQName(qName: String): ElementType? =
		elementsByQName[qName]

	/**
	 * Answer the root [element][XMLElement].
	 *
	 * @return
	 *   The root element.
	 */
	fun rootElement(): ElementType
	{
		return rootElement
	}

	/**
	 * Answer the allowed child [elements][XMLElement] of the specified element.
	 *
	 * @param element
	 *   An element.
	 * @return
	 *   The allowed child elements.
	 */
	fun allowedChildrenOf(element: ElementType): Set<ElementType>? =
		allowedChildren[element]

	/**
	 * Answer the allowed parent [elements][XMLElement] of the specified
	 * element.
	 *
	 * @param element
	 *   An element.
	 * @return
	 *   The allowed parent elements.
	 */
	@Suppress("MemberVisibilityCanBePrivate")
	fun allowedParentsOf( element: ElementType): Set<ElementType> =
		element.allowedParents

	init
	{
		assert(elementClass.isEnum)
		// Capture the elements of the enumeration.
		var elements: Array<ElementType>? = null
		try
		{
			val valuesMethod = elementClass.getMethod("values")
			assert(Modifier.isStatic(valuesMethod.modifiers))
			@Suppress("UNCHECKED_CAST")
			elements = valuesMethod(null) as Array<ElementType>
		}
		catch (e: SecurityException)
		{
			// This never happens.
			assert(false)
		}
		catch (e: NoSuchMethodException)
		{
			assert(false)
		}
		catch (e: IllegalArgumentException)
		{
			assert(false)
		}
		catch (e: IllegalAccessException)
		{
			assert(false)
		}
		catch (e: InvocationTargetException)
		{
			assert(false)
		}

		// Initialize other data structures.
		elementsByQName = mutableMapOf()
		allowedChildren = mutableMapOf()
		var root: ElementType? = null
		elements!!.forEach { element ->
			elementsByQName[element.qName] = element
			if (element.allowedParents.isEmpty())
			{
				assert(root === null)
				root = element
			}
			val children = elements
				.asSequence()
				.filter { it.allowedParents.contains(element) }
				.toSet()
			allowedChildren[element] = children
		}
		rootElement = root!!
	}
}
/*
 * PrimitiveNamesGenerator.kt
 * Copyright © 1993-2022, The Avail Foundation, LLC.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * * Neither the name of the copyright holder nor the names of the contributors
 *   may be used to endorse or promote products derived from this software
 *   without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package avail.tools.bootstrap

import avail.descriptor.types.A_Type.Companio


_status:"Mostra la vora intermitent quan s'activa",untrigger_seconds:"Segons després del canvi d'estat inactiu a desactivat"},views:{clip:"Clip més recent",clips:"Galeria de clips",current:"Vista actual",image:"Imatge estàtica",live:"Visualització en directe",recording:"Enregistrament més recent",recordings:"Galeria d'enregistraments",snapshot:"Instantània més recent",snapshots:"Galeria d'instantànies",timeline:"Vista cronològica"}}},i={grid:"Mostra el visualitzador multimèdia per a cada càmera d'una quadrícula",single:"Mostra un visualitzador multimèdia únic"},t={add_new_camera:"Afegeix una càmera nova",button:"Botó",camera:"Càmera",cameras:"Càmeres",cameras_secondary:"Quines càmeres renderitzar en aquesta targeta",delete:"Suprimeix",dimensions:"Dimensions",dimensions_secondary:"Opcions de dimensions i forma",image:"Imatge",image_secondary:"Opcions de visualització d'imatges estàtiques",live:"En directe",live_secondary:"Opcions de visualització de la càmera en directe",media_gallery:"Galeria multimèdia",media_gallery_secondary:"Opcions de la galeria multimèdia",media_viewer:"Visor multimèdia",media_viewer_secondary:"Visor de suports estàtics (clips, instantànies o enregistraments)",menu:"Menú",menu_secondary:"Opcions d'aspecte del menú",move_down:"Moure cap avall",move_up:"Moure cap amunt",overrides:"Les substitucions estan actives",overrides_secondary:"S'han detectat substitucions de configuració dinàmica",performance:"Rendiment",performance_secondary:"Opcions de rendiment de la targeta",profiles:"",profiles_secondary:"",remote_control:"",remote_control_secondary:"",status_bar:"",status_bar_secondary:"",timeline:"Cronologia",timeline_secondary:"Opcions de la cronologia d'esdeveniments",upgrade:"Upgrade",upgrade_available:"Hi ha disponible una actualització automàtica de la configuració de la targeta",view:"Vista",view_secondary:"Què ha de mostrar la targeta i com mostrar-la"},r={ptz:{down:"Avall",home:"Casa",left:"Esquerra",presets:"",right:"Dreta",up:"Amunt",zoom_in:"Ampliar",zoom_out:"Reduir"}},s={awaiting_live:"S'està esperant que es carregui la transmissió en directe ...",awaiting_media:"",camera_initialization:"",camera_initialization_reolink:"",could_not_render_elements:"No s'han pogut representar els elements de la imatge",could_not_resolve:"No s'ha pogut resoldre l'URL multimèdia",diagnostics:"Diagnòstic de targetes. Reviseu la informació confidencial abans de compartir-la",download_no_media:"No hi ha contingut multimèdia per descarregar",download_sign_failed:"No s'ha pogut signar l'URL multimèdia per baixar-la",duplicate_camera_id:"Duplica l'identificador de la càmera Frigate per a la següent càmera, utilitza el paràmetre 'id' per identificar les càmeres de manera única",empty_response:"S'ha rebut una resposta buida de Home Assistant per a la sol·licitud",failed_response:"No s'ha pogut rebre la resposta de Home Assistant per a la sol·licitud",failed_retain:"No s'ha pogut retenir l'esdeveniment",failed_sign:"No s'ha pogut signar l'URL de Home Assistant",fetching_diagnostics:"",image_load_error:"No s'ha pogut carregar la


/*
===========================================================================

Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.

This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").

Doom 3 BFG Edition Source Code 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.

Doom 3 BFG Edition Source Code 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 Doom 3 BFG Edition Source Code.  If not, see <http://www.gnu.org/licenses/>.

In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code.  If not, please request a copy in writing from id Software at the address below.

If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

===========================================================================
*/

#ifndef __D_MAIN__
#define __D_MAIN__

#include "d_event.h"

#ifdef __GNUG__
#pragma interface
#endif

extern const char*		extraWad;

#define MAXWADFILES             20
extern const char*		wadfiles[MAXWADFILES];

void D_AddExtraWadFile( const char *file );
void D_AddFile ( const char *file);

//
// D_DoomMain()
// Not a globally visible function, just included for source reference,
// calls all startup code, parses command line options.
// If not overrided by user input, calls N_AdvanceDemo.
//
void D_DoomMain (void);

// Called by IO functions when input is detected.
void D_PostEvent (event_t* ev);

//
// BASE LEVEL
//
void D_PageTicker (void);
void D_PageDrawer (void);
void D_AdvanceDemo (void);
void D_StartTitle (void);

#define R_OK	0x01
#define X_OK	0x02
#define W_OK	0x04
int access(char* name, int val);

#endif


c14, 1		@ clean & invalidate D line
#else
	mcr	p15, 0, r0, c7, c15, 1		@ clean & invalidate unified line
#endif
	add	r0, r0, #D_CACHE_LINE_SIZE
	cmp	r0, r1
	blo	1b
#ifdef HARVARD_CACHE
	mov	r0, #0
	mcr	p15, 0, r0, c7, c10, 4
#endif
	ret	lr
SYM_FUNC_END(v6_flush_kern_dcache_area)

/*
 *	v6_dma_inv_range(start,end)
 *
 *	Invalidate the data cache within the specified region; we will
 *	be performing a DMA operation in this region and we want to
 *	purge old data in the cache.
 *
 *	- start   - virtual start address of region
 *	- end     - virtual end address of region
 */
v6_dma_inv_range:
	tst	r0, #D_CACHE_LINE_SIZE - 1
	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
#ifdef HARVARD_CACHE
	mcrne	p15, 0, r0, c7, c10, 1		@ clean D line
#else
	mcrne	p15, 0, r0, c7, c11, 1		@ clean unified line
#endif
	tst	r1, #D_CACHE_LINE_SIZE - 1
	bic	r1, r1, #D_CACHE_LINE_SIZE - 1
#ifdef HARVARD_CACHE
	mcrne	p15, 0, r1, c7, c14, 1		@ clean & invalidate D line
#else
	mcrne	p15, 0, r1, c7, c15, 1		@ clean & invalidate unified line
#endif
1:
#ifdef HARVARD_CACHE
	mcr	p15, 0, r0, c7, c6, 1		@ invalidate D line
#else
	mcr	p15, 0, r0, c7, c7, 1		@ invalidate unified line
#endif
	add	r0, r0, #D_CACHE_LINE_SIZE
	cmp	r0, r1
	blo	1b
	mov	r0, #0
	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
	ret	lr

/*
 *	v6_dma_clean_range(start,end)
 *	- start   - virtual start address of region
 *	- end     - virtual end address o