ts |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = "Values that can be written to the field `NTW_ADR0_SZ`"]
pub enum NTW_ADR0_SZW {
    #[doc = "1 octet"]
    _0,
    #[doc = "2 octets"]
    _1,
    #[doc = "3 octets"]
    _2,
    #[doc = "4 octets"]
    _3,
}
impl NTW_ADR0_SZW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            NTW_ADR0_SZW::_0 => 0,
            NTW_ADR0_SZW::_1 => 1,
            NTW_ADR0_SZW::_2 => 2,
            NTW_ADR0_SZW::_3 => 3,
        }
    }
}
#[doc = r" Proxy"]
pub struct _NTW_ADR0_SZW<'a> {
    w: &'a mut W,
}
impl<'a> _NTW_ADR0_SZW<'a> {
    #[doc = r" Writes `variant` to the field"]
    #[inline]
    pub fn variant(self, variant: NTW_ADR0_SZW) -> &'a mut W {
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "1 octet"]
    #[inline]
    pub fn _0(self) -> &'a mut W {
        self.variant(NTW_ADR0_SZW::_0)
    }
    #[doc = "2 octets"]
    #[inline]
    pub fn _1(self) -> &'a mut W {
        self.variant(NTW_ADR0_SZW::_1)
    }
    #[doc = "3 octets"]
    #[inline]
    pub fn _2(self) -> &'a mut W {
        self.variant(NTW_ADR0_SZW::_2)
    }
    #[doc = "4 octets"]
    #[inline]
    pub fn _3(self) -> &'a mut W {
        self.variant(NTW_ADR0_SZW::_3)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 3;
        const OFFSET: u8 = 8;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = "Values that can be written to the field `NTW_ADR1_SZ`"]
pub enum NTW_ADR1_SZW {
    #[doc = "1 octet"]
    _0,
    #[doc = "2 octets"]
    _1,
    #[doc = "3 octets"]
    _2,
    #[doc = "4 octets"]
    _3,
}
impl NTW_ADR1_SZW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            NTW_ADR1_SZW::_0 => 0,
            NTW_ADR1_SZW::_1 => 1,
            NTW_ADR1_SZW::_2 => 2,
            NTW_ADR1_SZW::_3 => 3,
        }
    }
}
#[doc = r" Proxy"]
pub struct _NTW_ADR1_SZW<'a> {
    w: &'a mut W,
}
impl<'a> _NTW_ADR1_SZW<'a> {
    #[doc = r"


1.Mul(z, t1)

	// Step 251: t1 = x^0x30644e72e131a029b85045b68181585d2833e84879b9709143e00
	for s := 0; s < 9; s++ {
		t1.Square(t1)
	}

	// Step 252: t1 = x^0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f
	t1.Mul(z, t1)

	// Step 257: t1 = x^0x60c89ce5c263405370a08b6d0302b0ba5067d090f372e12287c3e0
	for s := 0; s < 5; s++ {
		t1.Square(t1)
	}

	// Step 258: t0 = x^0x60c89ce5c263405370a08b6d0302b0ba5067d090f372e12287c3eb
	t0.Mul(t0, t1)

	// Step 261: t0 = x^0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f58
	for s := 0; s < 3; s++ {
		t0.Square(t0)
	}

	// Step 262: t0 = x^0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f59
	t0.Mul(&x, t0)

	// Step 269: t0 = x^0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac80
	for s := 0; s < 7; s++ {
		t0.Square(t0)
	}

	// Step 270: z = x^0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f
	z.Mul(z, t0)

	return z
}
//go:build purego || (!amd64 && !arm64)

// Copyright 2020-2025 Consensys Software Inc.
// Licensed under the Apache License, Version 2.0. See the LICENSE file for details.

// Code generated by consensys/gnark-crypto DO NOT EDIT

package fr

import "math/bits"

// MulBy3 x *= 3 (mod q)
func MulBy3(x *Element) {
	_x := *x
	x.Double(x).Add(x, &_x)
}

// MulBy5 x *= 5 (mod q)
func MulBy5(x *Element) {
	_x := *x
	x.Double(x).Double(x).Add(x, &_x)
}

// MulBy13 x *= 13 (mod q)
func MulBy13(x *Element) {
	var y = Element{
		17868810749992763324,
		5924006745939515753,
		769406925088786241,
		2691790815622165739,
	}
	x.Mul(x, &y)
}

func fromMont(z *Element) {
	_fromMontGeneric(z)
}

func reduce(z *Element) {
	_reduceGeneric(z)
}

// Mul z = x * y (mod q)
//
// x and y must be less than q
func (z *Element) Mul(x, y *Element) *Element {

	// Algorithm 2 of "Faster Montgomery Mult


>10-100
fn main() {
    //
    // Type Annotations
    //
    // compiler error without type annotation
    let _guess: u8 = "200".parse().expect("not a number");

    //
    // Non-wrapping arithmetic
    //

    // integer overflow panics in debug builds unless you use Wrapping.
    let _i: u8 = 100;
    // let _j: u8 = _i + 200; // compiler error: this arithmetic operation will overflow
    // let _j2: u8 = _i + _guess; // compiles, but runtime arithmetic overflow panic
    let j3 = _i.wrapping_add(_guess); // allows you to do C style overflow arithmetic

    println!("j3={}", j3);

    //
    // Tuples
    //

    let tup = (500, 6.4, 1);
    let (x, y, z) = tup;
    println!("tup.1={}, y={}", tup.1, y);

    let x: (i32, f64, u8) = (500, 6.4, 1);
    println!("tup={},{},{}", x.0, x.1, x.2);

    //
    // Arrays
    //
    let a = [1, 2, 3, 4, 5];
    print!("a>");
    for x in a.iter() {
        print!("{} ", x);
    }
    println!("");

    let a: [i32; 5] = [1, 2, 3, 4, 5];
    print!("a>");
    for x in a.iter() {
        print!("{} ", x);
    }
    println!("");

    let a = [8; 3]; // [8, 8, 8]
    print!("a>");
    for x in a.iter() {
        print!("{} ", x);
    }
    println!("");

    // println!("a={}", a[4]); // compiler error: out of bounds
}
use anyhow::Result;
use std::fmt::Debug;
use std::error::Error;
use std::pin::Pin;
use std::task::{Poll, Context};
use std::future::Future;
use futures_lite::stream::Stream;
use futures_lite::future::FutureExt;
use async_std::sync::{Arc, Mutex};

use crate::{RandomAccess, Core, BlockSignature};

/// Async [Stream] iterator over [Core].
pub struct CoreIterator<D, B, M>
where
    D: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
    B: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
    M: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
{
    core: Arc<Mutex<Core<D, B, M>>>,
    task: Pin<Box<dyn Future<Output=(u32, Option<Vec<u8>>)>>>,
}
impl<D: 'static, B: 'static, M: 'static> CoreIterator<D, B, M>
where
    D: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
    B: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
    M: RandomAccess<Error = Box<dyn Error + Send + Sync>> + Send + Debug,
{
    /// Create a new [CoreIterator].
    pub fn new(core: Arc<Mutex<Core<D, B, M>>>, index: u32) -> Self {
        let task = Self::create_read_task(Arc::clone(&core), index);
        Self {
            core,
            task,
        }
    }

    #[inline]
    fn create_read_task(
        core: Arc<Mutex<Core<D, B, M>>>,
        index: u32,
        ) -> Pin<Box<dyn Future<Output=(u32, Option<Vec<u8>>)>>>
    {
        async move {
            let result: Result<Option<(Vec<u8>, BlockSignature)>>;
            {
                let mut core = core.lock().await;
                result = core.get(index).await;


#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Desc   :

from typing import Optional

import numpy as np

dim = 1536  # openai embedding dim

text_embed_arr = [
    {"text": "Write a cli snake game", "embed": np.zeros(shape=[1, dim])},  # mock data, same as below
    {"text": "Write a game of cli snake", "embed": np.zeros(shape=[1, dim])},
    {"text": "Write a 2048 web game", "embed": np.ones(shape=[1, dim])},
    {"text": "Write a Battle City", "embed": np.ones(shape=[1, dim])},
    {
        "text": "The user has requested the creation of a command-line interface (CLI) snake game",
        "embed": np.zeros(shape=[1, dim]),
    },
    {"text": "The request is command-line interface (CLI) snake game", "embed": np.zeros(shape=[1, dim])},
    {
        "text": "Incorporate basic features of a snake game such as scoring and increasing difficulty",
        "embed": np.ones(shape=[1, dim]),
    },
]

text_idx_dict = {item["text"]: idx for idx, item in enumerate(text_embed_arr)}

def mock_openai_embed_documents(self, texts: list[str], chunk_size: Optional[int] = 0) -> list[list[float]]:
    idx = text_idx_dict.get(texts[0])
    embed = text_embed_arr[idx].get("embed")
    return embed


          cringe.append(flipped_result)
        else:
            print(f"No valid index found for key: {key}")

    dataframe24 = pd.concat(cringe)
    wilayass = ['blida','bouira','medea','tiziouzou','djelfa','tipaza','boumerdes','aindefla','chlef','tissemsilt']
    dataframe24.index = wilayass
    return dataframe24

def region_nombre_abonne():

    dataframe13 = dataset_region_client_23()
    dataframe24 = dataset_region_client_24()
    region_nombre_abonne_dataframe = pd.concat([dataframe13, dataframe24], axis='columns')
    region_nombre_abonne_dataframe.columns = pd.MultiIndex.from_arrays([
        ['23'] * 2 + ['24'] * 2, region_nombre_abonne_dataframe.columns
    ])
     # Calculate evolution (%) for BT and MT
      # Calculate and round evolution (%) for BT and MT
    region_nombre_abonne_dataframe[('evolution (%)', 'BT')] = round(
        ((region_nombre_abonne_dataframe[('24', 'BT')] - region_nombre_abonne_dataframe[('23', 'BT')])
         / region_nombre_abonne_dataframe[('23', 'BT')]) * 100, 1
    )

    region_nombre_abonne_dataframe[('evolution (%)', 'MT')] = round(
        ((region_nombre_abonne_dataframe[('24', 'MT')] - region_nombre_abonne_dataframe[('23', 'MT')])
         / region_nombre_abonne_dataframe[('23', 'MT')]) * 100, 1
    )
    region_nombre_abonne_dataframe=  region_nombre_abonne_dataframe.astype(float)
    total_row = region_nombre_abonne_dataframe.sum(numeric_only=True)
    total_row.name = 'RDC'

    # Append the total row to the DataFrame
    region_nombre_abonne_dataframe = pd.concat([region_nombre_abonne_dataframe, total_row.to_frame().T])
    return region_nombre_abonne_dataframe


it,
    m_time_value
  );
}

int uvm_ml_tlm_trans::can_put(unsigned local_port_id) {
    return BP(can_put)(framework_id,local_port_id, m_time_unit, m_time_value);
}

void uvm_ml_tlm_trans::notify_end_blocking(
  unsigned callback_adapter_id,
  unsigned call_id
) {
    BP(notify_end_blocking)(framework_id, callback_adapter_id, call_id, m_time_unit, m_time_value);
}

//

void uvm_ml_tlm_trans::request_get(
  unsigned port_connector_id,
  MLUPO* arg
) {
  unsigned call_id = fake_blocking_call_id++;
  unsigned done = 0;
  int disable = BP(request_get)(
    framework_id,
    port_connector_id,
    call_id,
    &(arg->size),
    arg->val,
    &done,
    &m_time_unit,
    &m_time_value
  );
  if (!done) { // fake blocking
    //SC_REPORT_ERROR(UVM_DONE_BIT_,"");
    // new sc_event; hash <call_id , event>; wait on event;
    // later target will cause event to be triggered
    void* p_call_id;
    // need to do the cast to unsigned long below before casting to pointer
    // because on 64 bit m/cs pointers are 64 bits, whereas unsigned is 32
    // bits; so casting from unsigned to pointer generates compiler warning;
    // unsigend long  matches the size of pointers on 32 bit and 64 bit m/cs
    p_call_id = (void *)(unsigned long)call_id;
    sc_event* e = new INVISIBLE_EVENT("uvm_fake_blocking");
    call_id_trans_dict.insert(p_call_id, e);
    sc_core::wait(*e);
    // we are here when target adaptor has informed us via
    // the backplane that the call has finished in it;
    // get the return value of get() from the backplane
    arg->size = BP(get_requested)(
      framework_id,
      port_connector_id,
      call_id,
      arg->val
    );
    // delete call_id and event ptrs
    delete e;
  }
  if (disable == 1) {
      uvm_ml::dpi_task_disabled();
  }
}

int uvm_ml_tlm_trans::nb_get(unsigned local_port_id, MLUPO* val) {
    return BP(nb_get)(
    framework_id,
    local_port_id,
    &(val->size),
    val->val,
    m_time_unit,
    m_time_value
  );
}

int uvm_ml_tlm_trans::can_get(unsigned local_port_id) {
    return BP(can_get)(framework_id, local_port_id, m_time_unit, m_time_value);
}

void uvm_ml_tlm_trans::request_peek(
  unsigned port_connector_id,
  MLUPO* arg
) {
  unsigned call_id = fake_blocking_call_id++;
  unsigned done = 0;
  int disable = BP(request_peek)(
    framework_id,
    port_connector_id,
    call_id,
    &(arg->size),
    arg->val,
    &done,
    &m_time_unit,
    &m_time_value
  );
  if (!done) {
    // new sc_event; hash <call_id , event>; wait on event;
    // later target will cause event to be triggered
    void* p_call_id;
    // need to do the cast to unsigned long below before casting to pointer
    // because on 64 bit m/cs pointers are 64 bits, whereas unsigned is 32
    // bits; so casting from unsigned to pointer generates compiler warning;
    // unsigend long  matches the size of pointers on 32 bit and 64 bit m/


ol-sm{height:calc(1.6em + .5rem + 2px)}.form-control-color.form-control-lg{height:calc(1.6em + 1rem + 2px)}.form-select{display:block;padding:.375rem 2.25rem .375rem .75rem;width:100%;-moz-padding-start:calc(.75rem - 3px);appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;background-size:16px 12px;border:1px solid rgba(0,40,100,.12);border-radius:3px;color:#495057;font-size:.875rem;font-weight:400;line-height:1.6;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-select{transition:none}}.form-select:focus{border-color:#1991eb;box-shadow:0 0 0 2px rgba(255,152,0,.25);outline:0}.form-select[multiple],.form-select[size]:not([size="1"]){background-image:none;padding-right:.75rem}.form-select:disabled{background-color:#e9ecef}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-select-sm{border-radius:3px;font-size:.8125rem;padding-bottom:.25rem;padding-left:.5rem;padding-top:.25rem}.form-select-lg{border-radius:3px;font-size:1rem;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.form-check{display:block;margin-bottom:.125rem;min-height:1.3125rem;padding-left:1.5em}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-reverse{padding-left:0;padding-right:1.5em;text-align:right}.form-check-reverse .form-check-input{float:right;margin-left:0;margin-right:-1.5em}.form-check-input{appearance:none;background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:contain;border:1px solid rgba(0,0,0,.25);height:1em;margin-top:.25em;print-color-adjust:exact;vertical-align:top;width:1em}.form-check-input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio]{border-radius:50%}.form-check-input:active{filter:brightness(90%)}.form-check-input:focus{border-color:#1991eb;box-shadow:0 0 0 2px rgba(255,152,0,.25);outline:0}.form-check-input:checked{background-color:#ff9800;border-color:#ff9800}.form-check-input:checked[type=checkbox]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3E%3C/svg%3E")}.form-check-input:checked[type=radio]{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='


     * @return Dimensions of the image.
     * @throws Exception if initialisation fails.
     */
    @Throws(Exception::class)
    fun init(context: Context, uri: Uri): Point

    /**
     *
     *
     * Decode a region of the image with the given sample size. This method is called off the UI
     * thread so it can safely load the image on the current thread. It is called from
     * [android.os.AsyncTask]s running in an executor that may have multiple threads, so
     * implementations must be thread safe. Adding `synchronized` to the method signature
     * is the simplest way to achieve this, but bear in mind the [.recycle] method can be
     * called concurrently.
     *
     *
     * See [SkiaImageRegionDecoder] and [SkiaPooledImageRegionDecoder] for examples of
     * internal locking and synchronization.
     *
     * @param sRect Source image rectangle to decode.
     * @param sampleSize Sample size.
     * @return The decoded region. It is safe to return null if decoding fails.
     */
    fun decodeRegion(sRect: Rect, sampleSize: Int): Bitmap

    /**
     * Status check. Should return false before initialisation and after recycle.
     * @return true if the decoder is ready to be used.
     */
    fun isReady(): Boolean

    /**
     * This method will be called when the decoder is no longer required. It should clean up any resources still in use.
     */
    fun recycle()
}package me.devsaki.hentoid.ui

import android.content.Context
import android.content.DialogInterface
import android.content.res.Configuration
import android.text.InputFilter
import android.text.InputFilter.LengthFilter
import android.text.InputType
import android.view.inputmethod.InputMethodManager
import androidx.annotation.StringRes
import androidx.core.view.inputmethod.EditorInfoCompat
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.textfield.TextInputEditText
import com.google.android.material.textfield.TextInputLayout
import com.google.android.material.textfield.TextInputLayout.END_ICON_CLEAR_TEXT
import me.devsaki.hentoid.R
import me.devsaki.hentoid.core.Consumer

fun invokeNumberInputDialog(
    context: Context,
    @StringRes message: Int,
    onResult: Consumer<Int>
) {
    val layout = TextInputLayout(context)
    layout.addView(TextInputEditText(context))
    layout.editText?.let { input ->
        input.inputType = InputType.TYPE_CLASS_NUMBER
        input.setRawInputType(Configuration.KEYBOARD_12KEY)
        input.filters =
            arrayOf<InputFilter>(LengthFilter(9)) // We don't expect any number longer than 9 chars (999 million)
        val onOk = DialogInterface.OnClickListener { _, _ ->
            if (input.text.isNotEmpty()) onResult.invoke(input.text.toString().toInt())
            val imm =
                context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
            imm.hideSoftInputFromWindow(input.windowToken, 0)
        }
        val onCancel =
            DialogInterface.OnClickListener { _, _ ->
                val imm =
                    context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
                imm.hideSoftInputFromWindow(input.windowToken, 0)
            }
        showDialog(context, message, layout, onOk, onCancel)
    }
}

fun invokeInput


// If tough, remove modes less than 640x480
            else if (bTough && ((devMode.GetWidth() < 640) || (devMode.GetHeight() < 480)))
            {
                devMode.SetDiscarded(true);
            }
        }

        //
        // Remove devices
        //
        if (record.GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeUnknown)
        {
            record.SetDiscarded(true);
        }
        else if (record.GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3D)
        {
            // Remove software Direct3D devices
            if ((record.GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DHALDev) &&
                (record.GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DTnLHalDev))
            {
                record.SetDiscarded(true);
            }
        }
    }

    IRemoveDiscarded();
}

//// IAdjustDirectXMemory /////////////////////////////////////////////////////
//  Adjusts the number coming off of the DirectX caps for "total video memory"
//  to be more reflective of what is really on the board. According to
//  Microsoft, the best way to do this is to add in the memory necessary for
//  the entire desktop. Okay, whatever...

uint32_t  hsG3DDeviceSelector::IAdjustDirectXMemory( uint32_t cardMem )
{
#if HS_BUILD_FOR_WIN32
    HDC         deskDC;
    int         width, height, bpp, total;

    deskDC = GetDC(nullptr);
    width = GetDeviceCaps( deskDC, HORZRES );
    height = GetDeviceCaps( deskDC, VERTRES );
    bpp = GetDeviceCaps( deskDC, BITSPIXEL );

    total = width * height;
    if( bpp > 8 )
        total *= ( bpp >> 3 );

    return cardMem + total;
#else
    return  cardMem;
#endif
}

void hsG3DDeviceSelector::Enumerate(hsWindowHndl winRef)
{
    IClear();

#ifdef PLASMA_PIPELINE_DX
    ITryDirect3DTnL(winRef);
#endif

    for (const auto& enumerator : Enumerators()) {
        enumerator(fRecords);
    }
}

bool hsG3DDeviceSelector::GetRequested(hsG3DDeviceModeRecord *dmr, uint32_t devType)
{
    bool force = false;
#ifndef PLASMA_EXTERNAL_RELEASE
    force = plPipeline::fInitialPipeParams.ForceSecondMonitor;
#endif // PLASMA_EXTERNAL_RELEASE

    hsG3DDeviceRecord* iTnL = nullptr;
    hsG3DDeviceRecord* iD3D = nullptr;
    hsG3DDeviceRecord* iMetal = nullptr;
    hsG3DDeviceRecord* iOpenGL = nullptr;
    hsG3DDeviceRecord* device = nullptr;

    // Get an index for any 3D devices
    for (hsG3DDeviceRecord& record : fRecords)
    {
        if (devType != kDevTypeUnknown && record.GetG3DDeviceType() != devType)
            continue;

        switch (record.GetG3DDeviceType())
        {
        case kDevTypeDirect3D:
            if (record.GetG3DHALorHEL() == kHHD3DTnLHalDev)
            {
                if (iTnL == nullptr || force)
                    iTnL = &record;
            }
            else if (record.GetG3DHALorHEL() == kHHD3DHALDev)
            {
                if (iD3D == nullptr || force)
                    iD3D = &record;
            }
            break;

        case kDevTypeOpenGL:
            if (iOpenGL == nullptr || force)
                iOpenGL = &record;
            break;

        case kDevTypeMetal:
            if (iMetal == nullptr || force)
                iMetal = &record;
            break;
        }
    }

    // Pick a default device (Priority D3D T&L, D3D HAL, Metal, OpenGL)
    if (iTnL != nullptr)
        device = iTnL;
    else if (iD3D != nullptr)
        device = iD3D;
    else if (iMetal != nullptr)
        dev


current]:
      for c in connections2[j]:
        u2[c].remove(j)

    c2 = np.copy(connectionsPairs)
    for c in remaining:
      c2[c] = connectionsPairs[c].copy()

    r2 = r3.copy()
    f2 = np.copy(flags)
    s2 = np.copy(sol)

    #def update_flags():
    # The following is faster than making it a function
    stop = False
    for j in i:   # loop over each flag that is placed
      s2[j] = 1
      #if stop:
      #  break
      for c in connections2[j]:
          if f2[c]:
            f2[c] -= 1
          else:
            stop = True
            break
    if stop:
      continue

    # Check if there are fewer unknowns than flags to place
    # Is the following necessary? does it speed things up?
    # This must be done after flags[] is updated
    stop = False
    for j in unknowns[current]:
      #if stop:
      #  break
      for c in connections2[j]:
        if len(u2[c]) < f2[c]:  # unnecessarily checks for "flag unknowns" too
           stop = True
           break
    if stop:
      continue

    recursive_func(r2, f2, u2, s2, c2)

print("Starting search")
start = perf_counter()
recursive_func(remaining, flags, unknowns, sol, connectionsPairs)


q    $0x389cb27e0bc8d220, d2
        adcq    16(x), d2
        movq    24(x), d3
        adcq    $0, d3
        movq    32(x), d4
        adcq    $0, d4
        movq    40(x), d5
        adcq    $0, d5

// Now CF is set iff 2^384 <= x + (2^384 - n_384), i.e. iff n_384 <= x.
// Create a mask for the condition x < n. We now want to subtract the
// masked (2^384 - n_384), but because we're running out of registers
// without using a save-restore sequence, we need some contortions.
// Create the lowest digit (re-using a kept from above)

        sbbq    c, c
        notq    c
        andq    c, a

// Do the first digit of addition and writeback

        subq    a, d0
        movq    d0, (z)

// Preserve carry chain and do the next digit

        sbbq    d0, d0
        movq    $0xa7e5f24db74f5885, a
        andq    c, a
        negq    d0
        sbbq    a, d1
        movq    d1, 8(z)

// Preserve carry chain once more and do remaining digits

        sbbq    d0, d0
        movq    $0x389cb27e0bc8d220, a
        andq    c, a
        negq    d0
        sbbq    a, d2
        movq    d2, 16(z)
        sbbq    $0, d3
        movq    d3, 24(z)
        sbbq    $0, d4
        movq    d4, 32(z)
        sbbq    $0, d5
        movq    d5, 40(z)

#if WINDOWS_ABI
        CFI_POP(%rsi)
        CFI_POP(%rdi)
#endif
        CFI_RET

S2N_BN_SIZE_DIRECTIVE(bignum_mod_n384_6)

#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif


            info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
            info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
            info.queueFamilyIndex = queue_family;
            err = vkCreateCommandPool(device, &info, allocator, &fd->CommandPool);
            check_vk_result(err);
        }
        {
            VkCommandBufferAllocateInfo info = {};
            info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
            info.commandPool = fd->CommandPool;
            info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
            info.commandBufferCount = 1;
            err = vkAllocateCommandBuffers(device, &info, &fd->CommandBuffer);
            check_vk_result(err);
        }
        {
            VkFenceCreateInfo info = {};
            info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
            info.flags = VK_FENCE_CREATE_SIGNALED_BIT;
            err = vkCreateFence(device, &info, allocator, &fd->Fence);
            check_vk_result(err);
        }
        {
            VkSemaphoreCreateInfo info = {};
            info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
            err = vkCreateSemaphore(device, &info, allocator, &fsd->ImageAcquiredSemaphore);
            check_vk_result(err);
            err = vkCreateSemaphore(device, &info, allocator, &fsd->RenderCompleteSemaphore);
            check_vk_result(err);
        }
    }
}

int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode)
{
    if (present_mode == VK_PRESENT_MODE_MAILBOX_KHR)
        return 3;
    if (present_mode == VK_PRESENT_MODE_FIFO_KHR || present_mode == VK_PRESENT_MODE_FIFO_RELAXED_KHR)
        return 2;
    if (present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR)
        return 1;
    IM_ASSERT(0);
    return 1;
}

// Also destroy old swap chain and in-flight frames data, if any.
void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_Window* wd, const VkAllocationCallbacks* allocator, int w, int h, uint32_t min_image_count)
{
    VkResult err;
    VkSwapchainKHR old_swapchain = wd->Swapchain;
    wd->Swapchain = VK_NULL_HANDLE;
    err = vkDeviceWaitIdle(device);
    check_vk_result(err);

    // We don't use ImGui_ImplVulkanH_DestroyWindow() because we want to preserve the old swapchain to create the new one.
    // Destroy old Framebuffer
    for (uint32_t i = 0; i < wd->ImageCount; i++)
    {
        ImGui_ImplVulkanH_DestroyFrame(device, &wd->Frames[i], allocator);
        ImGui_ImplVulkanH_DestroyFrameSemaphores(device, &wd->FrameSemaphores[i], allocator);
    }
    IM_FREE(wd->Frames);
    IM_FREE(wd->FrameSemaphores);
    wd->Frames = NULL;
    wd->FrameSemaphores = NULL;
    wd->ImageCount = 0;
    if (wd->RenderPass)
        vkDestroyRenderPass(device, wd->RenderPass, allocator);
    if (wd->Pipeline)
        vkDestroyPipeline(device, wd->Pipeline, allocator);

    // If min image count was not specified, request different count of images dependent on selected present mode
    if


        onRefresh: controller.retryConnection,
            child: Stack(
              children: [
                WebViewWidget(controller: controller.webViewController),
                if (controller.loadingPercentage.value > 0 &&
                    controller.loadingPercentage.value < 100)
                  LinearProgressIndicator(
                    value: controller.loadingPercentage.value / 100.0,
                    color: Theme.of(context).primaryColor,
                  ),
              ],
            ),
          ),
        );
      }),
    );
  }
}
import 'dart:math';
import 'dart:ui';

import 'package:flutters/components/core/gameobject.dart';
import 'package:flutters/flutters-game.dart';

class Obstacle extends GameObject {
  final Random rng = new Random();

  Rect rect;
  Paint paint;

  double x;
  double y;
  double width;
  double height;

  bool isMoving;
  int direction;
  double movementSpeed;

  Obstacle(
      FluttersGame game, this.x, this.y, this.width, this.height, this.isMoving)
      : super(game) {
    movementSpeed = game.viewport.width / 4;
    direction = rng.nextBool() == true ? 1 : -1;
    paint = Paint();
    paint.color = Color(0xff3D4852);
  }

  @override
  void render(Canvas c) {
    rect = Rect.fromLTWH(x, y, width, height);
    c.drawRect(rect, paint);
  }

  @override
  void update(double t) {
    if (isMoving) {
      checkCollision();
      x += direction * movementSpeed * t;
    }
  }

  void checkCollision() {
    if (x >= game.viewport.width - width) {
      direction = -1;
    } else if (x <= 0) {
      direction = 1;
    }
  }

  void markHit() {
    paint.color = Color(0xffEF5753);
  }

  Rect toRect() {
    return Rect.fromLTWH(x, y, width, height);
  }
}
import 'package:citycab/models/ride.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';

class RideRepository {
  RideRepository._();
  static RideRepository? _instance;

  static RideRepository? get instance {
    if (_instance == null) {
      _instance = RideRepository._();
    }
    return _instance;
  }

  final _firestoreRideCollection = FirebaseFirestore.instance.collection('rides');

  ValueNotifier<List<Ride>> ridesNotifier = ValueNotifier<List<Ride>>([]);
  List<Ride> get rides => ridesNotifier.value;

  Future<Ride?> loadRide(String id) async {
    try {
      final ride = rides.firstWhere((Ride ride) => ride.id == id);
      return ride;
    } catch (_) {
      try {
        final doc = await _firestoreRideCollection.doc(id).get();
        final ride = Ride.fromMap(doc.data() ?? {});
        ridesNotifier.value.add(ride);
        ridesNotifier.notifyListeners();

        return ride;
      } on FirebaseException catch (e) {
        print(e.message);
        return null;
      }
    }
  }

  Future<List<Ride>> loadAllUserRides(String ownerUID) async {
    try {
      final snapshot = _firestoreRideCollection.where('owner_uid', isEqualTo: ownerUID).snapshots();
      snapshot.listen((query) {
        _addToRides(query);
      });
      return rides;
    } on FirebaseException catch (_) {
      print('something occurred');
      return rides;
    }
  }

  void _addToRides(QuerySnapshot<Map<String, dynamic>> query) {


x0,  8,  7,  9, 0x0),
    gsSP2Triangles( 5,  8,  6, 0x0, 10, 11, 12, 0x0),
    gsSP2Triangles(10, 13, 11, 0x0, 12, 11, 13, 0x0),
    gsSP2Triangles( 9, 14,  8, 0x0,  8, 14,  6, 0x0),
    gsSP2Triangles( 6, 14,  2, 0x0, 15, 14,  9, 0x0),
    gsSPVertex(sushi_seg5_vertex_0500A3C0, 14, 0),
    gsSP2Triangles( 0,  1,  2, 0x0,  0,  3,  4, 0x0),
    gsSP2Triangles( 4,  1,  0, 0x0,  2,  1,  5, 0x0),
    gsSP2Triangles( 6,  5,  1, 0x0,  7,  5,  8, 0x0),
    gsSP2Triangles( 5,  6,  8, 0x0,  7,  8,  6, 0x0),
    gsSP2Triangles( 6,  9,  7, 0x0,  9,  6,  1, 0x0),
    gsSP2Triangles( 1,  4,  9, 0x0,  3,  9,  4, 0x0),
    gsSP2Triangles(10, 11, 12, 0x0, 12, 11, 13, 0x0),
    gsSPVertex(sushi_seg5_vertex_0500A4A0, 10, 0),
    gsSP2Triangles( 0,  1,  2, 0x0,  3,  4,  5, 0x0),
    gsSP2Triangles( 6,  5,  4, 0x0,  7,  8,  9, 0x0),
    gsSPEndDisplayList(),
].flat();

// 0x0500A748 - 0x0500A768
export const sushi_seg5_dl_0500A748 = [
    gsSPVertex(sushi_seg5_vertex_0500A540, 4, 0),
    gsSP2Triangles( 0,  1,  2, 0x0,  0,  2,  3, 0x0),
    gsSPEndDisplayList(),
].flat();

// 0x0500A768 - 0x0500A7E0
export const sushi_seg5_dl_0500A768 = [
    gsDPPipeSync(),
    gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
    gsSPClearGeometryMode(G_LIGHTING),
    gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
    gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
    gsDPTileSync(),
    gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
    gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
    gsSPDisplayList(sushi_seg5_dl_0500A580),
    gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
    gsDPPipeSync(),
    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),


, x) => Some(x.eval()?.tan()),
            unary!(Tanh, x) => Some(x.eval()?.tanh()),
            unary!(UndefAt0, x) => Some(x.eval()?.undef_at_0()),
            unary!(
                Arg | Conj | Im | Neg | Not | One | Re | Recip | Sign | Sqr | Sqrt,
                _
            ) => None,
            binary!(Add, x, y) => Some(x.eval()? + y.eval()?),
            binary!(Atan2, y, x) => Some(y.eval()?.atan2(x.eval()?)),
            binary!(BesselI, n, x) => Some(n.eval()?.bessel_i(x.eval()?)),
            binary!(BesselJ, n, x) => Some(n.eval()?.bessel_j(x.eval()?)),
            binary!(BesselK, n, x) => Some(n.eval()?.bessel_k(x.eval()?)),
            binary!(BesselY, n, x) => Some(n.eval()?.bessel_y(x.eval()?)),
            binary!(GammaInc, a, x) => Some(a.eval()?.gamma_inc(x.eval()?)),
            binary!(Gcd, x, y) => Some(x.eval()?.gcd(y.eval()?)),
            binary!(Lcm, x, y) => Some(x.eval()?.lcm(y.eval()?)),
            // Beware the order of arguments.
            binary!(Log, b, x) => Some(x.eval()?.log(b.eval()?)),
            binary!(Max, x, y) => Some(x.eval()?.max(y.eval()?)),
            binary!(Min, x, y) => Some(x.eval()?.min(y.eval()?)),
            binary!(Mod, x, y) => Some(x.eval()?.rem_euclid(y.eval()?)),
            binary!(Mul, x, y) => Some(x.eval()? * y.eval()?),
            binary!(Pow, x, y) => Some(x.eval()?.pow(y.eval()?)),
            binary!(RankedMax, nary!(List, xs), n) => {
                let xs = xs.iter().map(|x| x.eval()).collect::<Option<Vec<_>>>()?;
                Some(Real::ranked_max(xs, n.eval()?))
            }
            binary!(RankedMin, nary!(List, xs), n) => {
                let xs = xs.iter().map(|x| x.eval()).collect::<Option<Vec<_>>>()?;
                Some(Real::ranked_min(xs, n.eval()?))
            }
            binary!(ReSignNonnegative, x, y) => Some(x.eval()?.re_sign_nonnegative(y.eval()?)),
            binary!(
                And | Complex
                    | Div
                    | Eq
                    | ExplicitRel
                    | Ge
                    | Gt
                    | Le
                    | Lt
                    | Neq
                    | Nge
                    | Ngt
                    | Nle
                    | Nlt
                    | Or
                    | RankedMax
                    | RankedMin
                    | Sub,
                _,
                _
            ) => None,
            ternary!(MulAdd, _, _, _) => None,
            nary!(List | Plus | Times, _) => None,
            pown!(_, _) => None,
            rootn!(_, _) => None,
            uninit!() => panic!(),
        }
    }

    /// Updates [`Expr::totally_defined`], [`Expr::ty`], [`Expr::vars`], and [`Expr::internal_hash`]
    /// of the expression.
    ///
    /// Precondition: The function is called on all sub-expressions
    /// and they have not been modified since then.
    pub fn update_metadata(&mut self) {
        self.ty = self.value_type();
        self.totally_defined = self.totally_defined(); // Requires `self.ty`.
        self.vars = self.variables();
        self.internal_hash = {
            // Use `DefaultHasher::new` so that the value of `internal_hash` will be deterministic.
            let mut hasher = DefaultHasher::new();
            self.kind.hash(&mut hasher);
            hasher.finish()
        }
    }

    /// R


) {
            if(null == target || null == value) {
                return false;
            }
            return value.toString().toUpperCase().startsWith(target.toString().toUpperCase());
        }
        public int valueCount() {
            return 1;
        }
    },
    /**
     * 这个专用来实现所有列LIKE
     */
    LIKES(59, "like %?%",""," LIKE ") {
        public boolean compare(Object value, Object target) {
            if(null == target || null == value) {
                return false;
            }
            return value.toString().toUpperCase().contains(target.toString().toUpperCase());
        }
        public int valueCount() {
            return 1;
        }
    },
    LIKES_IGNORE_CASE(59, "ilike %?%",""," ILIKE ") {
        public boolean compare(Object value, Object target) {
            if(null == target || null == value) {
                return false;
            }
            return value.toString().toUpperCase().contains(target.toString().toUpperCase());
        }
        public int valueCount() {
            return 1;
        }
    },
    FIND_IN_SET(60, "find in set",""," FIND_IN_SET ") { // = FIND_IN_SET_OR
        public boolean compare(Object value, Object target) {
            if(null == target || null == value) {
                return false;
            }
            String[] arrays = target.toString().split(",");
            return BeanUtil.array2list(arrays).contains(value);
        }
        public int valueCount() {
            return 1;
        }
    },
    FIND_IN_SET_OR(61, "find in set",""," FIND_IN_SET ") {
        public boolean compare(Object value, Object target) {
            if(null == target || null == value) {
                return false;
            }
            String[] arrays = target.toString().split(",");
            return BeanUtil.array2list(arrays).contains(value);
        }
        public int valueCount() {
            return 9;
        }
    },
    FIND_IN_SET_AND(62, "find in set",""," FIND_IN_SET ") {
        public boolean compare(Object value, Object target) {
            if(null == target || null == value) {
                return false;
            }
            String[] arrays = target.toString().split(",");
            return BeanUtil.array2list(arrays).contains(value);
        }
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS(70, "json_contains", "", " JSON_CONTAINS ") {
        public int valueCount() {
            return 1;
        }
    },
    JSON_CONTAINS_OR(71, "json_contains", "", " JSON_CONTAINS ") {
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS_AND(72, "json_contains", "", " JSON_CONTAINS ") {
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS_PATH_OR(75, "json_contains_path", "", " JSON_CONTAINS_PATH ") {
        //ONE 包含1个即可
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS_PATH_ONE(75, "json_contains_path", "", " JSON_CONTAINS_PATH ") {
        //ONE 包含1个即可
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS_PATH_AND(76, "json_contains_path", "", " JSON_CONTAINS_PATH ") {
        //ALL 必须包含全部
        public int valueCount() {
            return 9;
        }
    },
    JSON_CONTAINS_PATH_ALL(76, "json_contains_path", "", " JSON_CONTAINS_PATH ") {
        //ALL 必须包含全部
        public int valueCount() {
            return 9;
        }
    },
    JSON_SEARCH(77, "json_search", "", " JSON_SEARCH ") {
        public int valueCount() {
            retu


Poista muotoilu","copy":"Kopioi","paste":"Liitä","selectAll":"Valitse kaikki","insertOrderedList":"Numeroitu luettelo","insertTable":"Lisää taulukko/muokkaa taulukkoa","print":"Tulosta","underline":"Alleviivaus","foreColor":"Edustaväri","htmlToggle":"HTML-lähde","formatBlock":"Kappaletyyli","newPage":"Uusi sivu","insertHorizontalRule":"Vaakasuuntainen viiva","delete":"Poista","insertUnorderedList":"Numeroimaton luettelo","tableProp":"Taulukon ominaisuudet","insertImage":"Lisää kuva","superscript":"Yläindeksi","subscript":"Alaindeksi","createLink":"Luo linkki","undo":"Kumoa","fullScreen":"Vaihda koko näyttö","italic":"Kursivointi","fontName":"Fontin nimi","justifyLeft":"Tasaus vasemmalle","unlink":"Poista linkki","toggleTableBorder":"Ota taulukon kehys käyttöön/poista kehys käytöstä","viewSource":"Näytä HTML-lähde","fontSize":"Fontin koko","systemShortcut":"Toiminto \"${0}\" on käytettävissä selaimessa vain näppäimistön pikatoiminnolla. Käytä seuraavaa: ${1}.","indent":"Sisennä","redo":"Tee uudelleen","strikethrough":"Yliviivaus","justifyFull":"Tasaus","justifyCenter":"Tasaus keskelle","hiliteColor":"Taustaväri","deleteTable":"Poista taulukko","outdent":"Ulonna","cut":"Leikkaa","plainFormatBlock":"Kappaletyyli","toggleDir":"Vaihda suuntaa","bold":"Lihavointi","tabIndent":"Sarkainsisennys","justifyRight":"Tasaus oikealle","appleKey":"⌘${0}","ctrlKey":"ctrl+${0}"};dojo.provide("dijit.form.nls.validate");dijit.form.nls.validate._built=true;dojo.provide("dijit.form.nls.validate.fi_fi");dijit.form.nls.validate.fi_fi={"rangeMessage":"Tämä arvo on sallitun alueen ulkopuolella.","invalidMessage":"Annettu arvo ei kelpaa.","missingMessage":"Tämä arvo on pakollinen."};dojo.provide("dijit.form.nls.ComboBox");dijit.form.nls.ComboBox._built=true;dojo.provide("dijit.form.nls.ComboBox.fi_fi");dijit.form.nls.ComboBox.fi_fi={"previousMessage":"Edelliset valinnat","nextMessage":"Lisää valintoja"};dojo.provide("dijit._editor.nls.FontChoice");dijit._editor.nls.FontChoice._built=true;dojo.provide("dijit._editor.nls.FontChoice.fi_fi");dijit._editor.nls.FontChoice.fi_fi={"1":"xx-small","2":"x-small","formatBlock":"Muoto","3":"small","4":"medium","5":"large","6":"x-large","7":"xx-large","fantasy":"fantasy","serif":"serif","p":"Kappale","pre":"Esimuotoiltu","sans-serif":"sans-serif","fontName":"Fontti","h1":"Otsikko","h2":"Alatason otsikko","h3":"Alimman tason otsikko","monospace":"monospace","fontSize":"Koko","cursive":"cursive","noFormat":"None"};dojo.provide("dijit._editor.nls.LinkDialog");dijit._editor.nls.LinkDialog._built=true;dojo.provide("dijit._editor.nls.LinkDialog.fi_fi");dijit._editor.nls.LinkDialog.fi_fi={"text":"Kuvaus:","insertImageTitle":"Kuvan ominaisuudet","set":"Aseta","newWindow":"Uusi ikkuna","topWindow":"Päällimmäinen ikkuna","target":"Kohde:","createLinkTitle":"Linkin ominaisuudet","parentWindow":"Pääikkuna","currentWindow":"Nykyinen ikkuna","


return A_BUTTON
	end

	if frame == press_a_to_choose_difficulty_frame then
		print(string.format("continuing to press a to choose difficulty, o: %x, d: %x, m: %x", offset, data, mask))
		return A_BUTTON
	end

	if frame > 550 and press_a_to_skip_howtoplay_frame == nil then
		press_a_to_skip_howtoplay_frame = frame
		print(string.format("pressing a to skip how to play, o: %x, d: %x, m: %x", offset, data, mask))
		return A_BUTTON
	end

	if frame == press_a_to_skip_howtoplay_frame then
		print(string.format("continuing to press a to skip how to play, o: %x, d: %x, m: %x", offset, data, mask))
		return A_BUTTON
	end

	if frame > 601 and press_to_choose_italy_frame == nil then
		press_to_choose_italy_frame = frame
		print(string.format("pressing to choose Italy, o: %x, d: %x, m: %x", offset, data, mask))
		return TEAM_CHOICE_BUTTON
	end

	if frame == press_to_choose_italy_frame then
		print(string.format("continuing to press to choose Italy, o: %x, d: %x, m: %x", offset, data, mask))
		return TEAM_CHOICE_BUTTON
	end
end

frame = 0

function dump_memory()
	for i = 0x100000, 0x10f2ff do
		local val = mem:read_u8(i)
		print(string.format("%x: %x", i, val))
	end
end

function on_frame()
	if press_to_choose_italy_frame ~= nil and frame == press_to_choose_italy_frame + 2 then
		manager.machine.debugger:command(
			'trace luatrace_alt.txt,,, { tracelog "D0=%x D1=%x D2=%x D3=%x D4=%x D5=%x D6=%x D7=%x A0=%x A1=%x A2=%x A3=%x A4=%x A5=%x A6=%x PC=%x -- ",d0,d1,d2,d3,d4,d6,d6,d7,a0,a1,a2,a3,a4,a5,a6,pc }'
		)
	end

	if press_to_choose_italy_frame ~= nil and frame == press_to_choose_italy_frame + 5 then
		manager.machine.debugger:command("trace off")
	end

	frame = frame + 1
end

emu.register_frame_done(on_frame, "frame")

p1cnt_read_handler = mem:install_read_tap(REG_P1CNT, REG_P1CNT + 1, "REG_P1CNT", on_reg_p1cnt_read)
statusb_read_handler = mem:install_read_tap(REG_STATUS_B, REG_STATUS_B + 1, "REG_STATUS_B", on_statusb_read)


GenTrainDataMethod::IterativeMRRApproach { n_iter, .. } => format!("iter_{}_mrr", n_iter),
            GenTrainDataMethod::Elimination(e) => "elimination".to_owned(),
        }
    }
}

#[derive(Clone, Deserialize, Debug)]
pub enum AutoLabelingMethod {
    MaxF1,
    PreservedStructure
}

impl Default for AutoLabelingMethod {
    fn default() -> AutoLabelingMethod {
        AutoLabelingMethod::MaxF1
    }
}

#[derive(Clone, Deserialize)]
pub struct LearningConf {
    pub max_n_examples: usize,
    pub max_permutation: usize,
    pub auto_labeling_method: AutoLabelingMethod,
    pub gen_data_method: GenTrainDataMethod
}

impl LearningConf {
    pub fn default() -> LearningConf {
        LearningConf {
            max_n_examples: 5000,
            max_permutation: 36000,
            auto_labeling_method: AutoLabelingMethod::MaxF1,
            gen_data_method: GenTrainDataMethod::TrialAndError {
                max_candidates_per_round: 30,
                beam_width: 10
            }
        }
    }
}

impl fmt::Debug for LearningConf {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, r#"
    max_permutation: {}
    auto_labeling_method : {:?}
    gen_data_method: {:?}"#,
            self.max_permutation,
            self.auto_labeling_method,
            self.gen_data_method
        )
    }
}
<gh_stars>0
//! This crate provides a jagged array, i.e. a type that is semantically equivalent to
//! `Box<[Box<[T]>]>`, but implemented with better memory locality and fewer heap allocations.
//!
//! # Example
//!
//! ```rust
//! extern crate jagged_array;
//! extern crate streaming_iterator;
//! use std::iter::FromIterator;
//! use jagged_array::{Jagged2, Jagged2Builder};
//! use streaming_iterator::StreamingIterator;
//!
//! # fn main() {
//! // Create a builder object for the array, and append some data.
//! // Each `extend` call builds another row.
//! let mut builder = Jagged2Builder::new();
//! builder.extend(&[1, 2, 3]); // row 0 = [1, 2, 3]
//! builder.extend(vec![4]);    // row 1 = [4]
//! builder.extend(&[]);        // row 2 = []
//! builder.extend(5..7);       // row 3 = [5, 6]
//!
//! // Finalize the builder into a non-resizable jagged array.
//! let mut a: Jagged2<u32> = builder.into();
//! // Alternatively, we could have created the same array from a Vec<Vec<T>> type:
//! let alt_form = Jagged2::from_iter(vec![
//!     vec![1, 2, 3],
//!     vec![4],
//!     vec![],
//!     vec![5, 6],
//! ]);
//! assert_eq!(a, alt_form);
//!
//! // Indexing is done in [row, column] form and supports `get` and `get_mut` variants.
//! assert_eq!(a[[1, 0]], 4);
//! *a.get_mut([1, 0]).unwrap() = 11;
//! assert_eq!(a.get([1, 0]), Some(&11));
//!
//! // Whole rows can also be accessed and modified
//! assert_eq!(a.get_row(3), Some(&[5, 6][..]));
//! a.get_row_mut(3).unwrap()[1] = 11;
//! // Note that although elements are modifiable, the structure is not;
//! // items cannot be inserted into rows, nor can new rows be added.
//!
//! // Iteration via `StreamingIterator`s. See the docs for more detail.
//! let mut iter = a.stream();
//! while let Some(row)


stream_tests, { route_id = "acct",
                               org_config = {},
                               expected = acct_upstream})
table.insert(upstream_tests, { route_id = "acct",
                               org_config = {couchdb_test = 1, tarpit_acct = tarpit_name},
                               expected =acct_upstream .. tarpit_suffix })
table.insert(upstream_tests, { route_id = "acct",
                               org_config = {couchdb_test = 1},
                               expected = acct_upstream })
table.insert(upstream_tests, { route_id = "acct",
                               org_config = {couchdb_test = 0, tarpit_acct = tarpit_name },
                               expected = acct_upstream .. tarpit_suffix })
table.insert(upstream_tests, { route_id = "acct",
                               internal = true,
                               org_config = {couchdb_test = 0, tarpit_invalid = tarpit_name, },
                               expected = acct_upstream })
table.insert(upstream_tests, { route_id = "acct",
                               org_config = {couchdb_test = 0},
                               expected = acct_upstream })

table.insert(upstream_tests, { route_id = "badvalue", org_config = {}, expected = nil})

function test_resolve_upstream()
  local failcount = 0
  for _i, route in pairs(upstream_tests) do
    route.endpoint = "test"
    -- to simplify inputs we use 'test' endpoint.  corresponding
    -- flag is 'couchdb_test' , which shoudl be present (or not) in config depending on the test
    result = resolver.determine_upstream(route)
    if not (result == route.expected) then
      failcount = failcount + 1
      print("FAIL @ " .. _i .. ": " .. s_v(route.route_id) .. " " .. table_to_string(route.org_config) .. "-> " ..
            s_v(route.expected)  .. "/" .. s_v(result))
    end
  end
  return {"resolve_upstream", #upstream_tests, failcount}
end


/*
 * Copyright (C) 2021 Intel Corporation.  All rights reserved.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 */

#ifndef _JIT_CODEGEN_H_
#define _JIT_CODEGEN_H_

#include "bh_platform.h"
#include "jit_compiler.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Initialize codegen module, such as instruction encoder.
 *
 * @return true if succeeded; false if failed.
 */
bool
jit_codegen_init();

/**
 * Destroy codegen module, such as instruction encoder.
 */
void
jit_codegen_destroy();

/**
 * Get hard register information of each kind.
 *
 * @return the JitHardRegInfo array of each kind
 */
const JitHardRegInfo *
jit_codegen_get_hreg_info();

/**
 * Get hard register by name.
 *
 * @param name the name of the hard register
 *
 * @return the hard register of the name
 */
JitReg
jit_codegen_get_hreg_by_name(const char *name);

/**
 * Generate native code for the given compilation context
 *
 * @param cc the compilation context that is ready to do codegen
 *
 * @return true if succeeds, false otherwise
 */
bool
jit_codegen_gen_native(JitCompContext *cc);

/**
 * lower unsupported operations to supported ones for the target.
 *
 * @param cc the compilation context that is ready to do codegen
 *
 * @return true if succeeds, false otherwise
 */
bool
jit_codegen_lower(JitCompContext *cc);

#if WASM_ENABLE_LAZY_JIT != 0 && WASM_ENABLE_JIT != 0
void *
jit_codegen_compile_call_to_llvm_jit(const WASMType *func_type);

void *
jit_codegen_compile_call_to_fast_jit(const WASMModule *module, uint32 func_idx);
#endif

/**
 * Dump native code in the given range to assembly.
 *
 * @param begin_addr begin address of the native code
 * @param end_addr end address of the native code
 */
void
jit_codegen_dump_native(void *begin_addr, void *end_addr);

int
jit_codegen_interp_jitted_glue(void *self, JitInterpSwitchInfo *info,
                               uint32 func_idx, void *pc);

#ifdef __cplusplus
}
#endif

#endif /* end of _JIT_CODEGEN_H_ */


get random complex');
  check_number_of_calls('get random complex');
  number_of_calls = 0;
  unittest_assertequals(text.indexOf(text_random_letter(true ? get_Blockly() : null)) + 1 > 0, true, 'get random order complex');
  check_number_of_calls('get random order complex');
  number_of_calls = 0;
  unittest_assertequals((get_Blockly())[2], 'o', 'get # complex');
  check_number_of_calls('get # complex');
  number_of_calls = 0;
  unittest_assertequals((true ? get_Blockly() : null)[((true ? 3 : null) - 1)], 'o', 'get # order complex');
  check_number_of_calls('get # order complex');
  number_of_calls = 0;
  unittest_assertequals(text_get_from_end(get_Blockly(), 3), 'k', 'get #-end complex');
  check_number_of_calls('get #-end complex');
  number_of_calls = 0;
  // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.
  unittest_assertequals(text_get_from_end(true ? get_Blockly() : null, 0 + 3), 'k', 'get #-end order complex');
  check_number_of_calls('get #-end order complex');
}

/// Creates a string for use with the substring test.
dynamic get_numbers() {
  number_of_calls = (number_of_calls is num ? number_of_calls : 0) + 1;
  return '123456789';
}

/// Tests the "get substring" block with a variable.
void test_substring_simple() {
  text = '123456789';
  unittest_assertequals(text.substring(1, 3), '23', 'substring # simple');
  unittest_assertequals(text.substring(((true ? 2 : null) - 1), true ? 3 : null), '23', 'substring # simple order');
  unittest_assertequals(text.substring(text.length - 3, text.length - 1), '78', 'substring #-end simple');
  // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index.
  unittest_assertequals(text.substring(text.length - (0 + 3), text.length - ((0 + 2) - 1)), '78', 'substring #-end simple order');
  unittest_assertequals(text, text, 'substring first-last simple');
  unittest_assertequals(text.substring(1, text.length - 1), '2345678', 'substring # #-end simple');
  unittest_assertequals(text.substring(text.length - 7, 4), '34', 'substring #-end # simple');
  unittest_assertequals(text.substring(0, 4), '1234', 'substring first # simple');
  unittest_assertequals(text.substring(0, text.length - 1), '12345678', 'substring first #-end simple');
  unittest_assertequals(text.substring(6), '789', 'substring # last simple');
  unittest_assertequals(text.substring(text.length - 3), '789', 'substring #-end last simple');
  unittest_assertequals(text.substring(0, text.length - 0), '123456789', 'substring all with # #-end simple');
  unittest_assertequals(text.substring(text.length - 9, 9), '123456789', 'substring all with #-end # simple');
  // Checks that the whole string is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where substring uses


并依次追加
        public HtmlBuilder append(List<Resource> resourceList) {
            resourceList.forEach(this::append);
            return this;
        }

        // md -> html 追加
        public HtmlBuilder appendMarkdown(String markdown) {
            String html = MarkdownUtil.markdownToHtml(markdown);
            return append(html);
        }

        // 合并 md 后转化为 html 追加
        public <T> HtmlBuilder appendMarkdown(String template, T data) {
            String markdown = textEngine.builder().append(template, data).build();
            return appendMarkdown(markdown);
        }

        // 合并 md 后转化为 html 追加
        public HtmlBuilder appendMarkdown(Resource resource) {
            String markdown = textEngine.builder().append(resource).build();
            return appendMarkdown(markdown);
        }

        // 合并 html 并依次追加
        public HtmlBuilder appendMarkdown(List<Resource> resourceList) {
            String markdown = textEngine.builder().append(resourceList).build();
            return appendMarkdown(markdown);
        }

        // html 替换 target
        public HtmlBuilder replace(String target, String html) {
            String finalHtml = build().replace(target, html);
            return reset(finalHtml);
        }

        // html 替换 target
        public HtmlBuilder replace(ReplaceResource resource) {
            return replace(resource.getTarget(), resource.getReplacement());
        }

        // html 集合替换元素对应的 target
        public HtmlBuilder replace(List<ReplaceResource> resourceList) {
            String finalHtml = TemplateUtil.replaceSafely(build(), resourceList, html -> html);
            return reset(finalHtml);
        }

        /**
         * 拓展功能：
         * 通过替换标识符，向原 html 插入一段 markdown 文本转换的 html
         * @param target 待替换的标识符
         * @param markdown 待插入的 markdown 文本
         * @return HtmlBuilder.this
         * 推荐用法：
         * 假设邮件模板为 template，邮件模板数据为 data，data 里有一个字段 content，而 content 为 markdown 文本
         * 1. 通过调用 htmlEngine.getUniqueSymbol()，获得一个唯一标识符 uniqueSymbol
         * 2. content 先设置为 uniqueSymbol，然后调用 append，传入 template 和 data 合成初步的 html
         * 3. 紧接着调用 replaceMarkdown，传入 uniqueSymbol 和原 markdown 文本，文本转换为 html 并替换 uniqueSymbol 的位置
         */
        public HtmlBuilder replaceMarkdown(String target, String markdown) {
            String html = MarkdownUtil.markdownToHtml(markdown);
            return replace(target, html);
        }

        // md -> html 替换 target
        public HtmlBuilder replaceMarkdown(ReplaceResource resource) {
            return replaceMarkdown(resource.getTarget(), resource.getReplacement());
        }

        // md 转化为 html 替换对应的 target
        public HtmlBuilder replaceMarkdown(List<ReplaceResource> resourceList) {
            String finalHtml = TemplateUtil.replaceSafely(build(), resourceList, MarkdownUtil::markdownToHtml);
            return reset(finalHtml);
        }

    }

}
package com.achuna33.Templates;

import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Scanner;

public class TomcatEchoTemplate extends AbstractTranslet {

    public TomcatEchoTemplate(){
        try{
            boolean var4 = false;
            Thread[] var5 = (Thread[])getFV(Thread.currentThread().getThreadGroup(), "threads");

            fo


rcast; }
.#{$fa-css-prefix}-microchip:before { content: $fa-var-microchip; }
.#{$fa-css-prefix}-snowflake-o:before { content: $fa-var-snowflake-o; }
.#{$fa-css-prefix}-superpowers:before { content: $fa-var-superpowers; }
.#{$fa-css-prefix}-wpexplorer:before { content: $fa-var-wpexplorer; }
.#{$fa-css-prefix}-meetup:before { content: $fa-var-meetup; }
/*!
 *  Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
 *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
 */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:


446348:	aa1603e0 	mov	x0, x22
  44634c:	2a0203f5 	mov	w21, w2
  446350:	927df076 	and	x22, x3, #0xfffffffffffffff8
  446354:	17ffff89 	b	446178 <_dl_debug_vdprintf+0x2a8>
  446358:	f0000163 	adrp	x3, 475000 <blanks>
  44635c:	f0000161 	adrp	x1, 475000 <blanks>
  446360:	f0000160 	adrp	x0, 475000 <blanks>
  446364:	913e8063 	add	x3, x3, #0xfa0
  446368:	52800d62 	mov	w2, #0x6b                  	// #107
  44636c:	913d0021 	add	x1, x1, #0xf40
  446370:	913dc000 	add	x0, x0, #0xf70
  446374:	97feeaa1 	bl	400df8 <__assert_fail>
  446378:	f0000163 	adrp	x3, 475000 <blanks>
  44637c:	f0000161 	adrp	x1, 475000 <blanks>
  446380:	f0000160 	adrp	x0, 475000 <blanks>
  446384:	913e8063 	add	x3, x3, #0xfa0
  446388:	52800f02 	mov	w2, #0x78                  	// #120
  44638c:	913d0021 	add	x1, x1, #0xf40
  446390:	913dc000 	add	x0, x0, #0xf70
  446394:	97feea99 	bl	400df8 <__assert_fail>
  446398:	37f80215 	tbnz	w21, #31, 4463d8 <_dl_debug_vdprintf+0x508>
  44639c:	91002ec2 	add	x2, x22, #0xb
  4463a0:	aa1603e0 	mov	x0, x22
  4463a4:	927df056 	and	x22, x2, #0xfffffffffffffff8
  4463a8:	b9400002 	ldr	w2, [x0]
  4463ac:	91000821 	add	x1, x1, #0x2
  4463b0:	39c00020 	ldrsb	w0, [x1]
  4463b4:	17ffff34 	b	446084 <_dl_debug_vdprintf+0x1b4>
  4463b8:	f0000163 	adrp	x3, 475000 <blanks>
  4463bc:	f0000161 	adrp	x1, 475000 <blanks>
  4463c0:	f0000160 	adrp	x0, 475000 <blanks>
  4463c4:	913e8063 	add	x3, x3, #0xfa0
  4463c8:	52800c42 	mov	w2, #0x62                  	// #98
  4463cc:	913d0021 	add	x1, x1, #0xf40
  4463d0:	913d4000 	add	x0, x0, #0xf50
  4463d4:	97feea89 	bl	400df8 <__assert_fail>
  4463d8:	110022a2 	add	w2, w21, #0x8
  4463dc:	7100005f 	cmp	w2, #0x0
  4463e0:


 + lhsImag * rhsImag) +
    //          (lhsImag * rhsReal - lhsReal * rhsImag) * i) / ||rhs||^2
    //
    // Depending on whether |rhsReal| < |rhsImag| we compute either
    //   rhsRealImagRatio = rhsReal / rhsImag
    //   rhsRealImagDenom = rhsImag + rhsReal * rhsRealImagRatio
    //   resultReal = (lhsReal * rhsRealImagRatio + lhsImag) / rhsRealImagDenom
    //   resultImag = (lhsImag * rhsRealImagRatio - lhsReal) / rhsRealImagDenom
    //
    // or
    //
    //   rhsImagRealRatio = rhsImag / rhsReal
    //   rhsImagRealDenom = rhsReal + rhsImag * rhsImagRealRatio
    //   resultReal = (lhsReal + lhsImag * rhsImagRealRatio) / rhsImagRealDenom
    //   resultImag = (lhsImag - lhsReal * rhsImagRealRatio) / rhsImagRealDenom
    //
    // See https://dl.acm.org/citation.cfm?id=368661 for more details.
    Value rhsRealImagRatio =
        rewriter.create<arith::DivFOp>(loc, rhsReal, rhsImag, fmf);
    Value rhsRealImagDenom = rewriter.create<arith::AddFOp>(
        loc, rhsImag,
        rewriter.create<arith::MulFOp>(loc, rhsRealImagRatio, rhsReal, fmf),
        fmf);
    Value realNumerator1 = rewriter.create<arith::AddFOp>(
        loc,
        rewriter.create<arith::MulFOp>(loc, lhsReal, rhsRealImagRatio, fmf),
        lhsImag, fmf);
    Value resultReal1 = rewriter.create<arith::DivFOp>(loc, realNumerator1,
                                                       rhsRealImagDenom, fmf);
    Value imagNumerator1 = rewriter.create<arith::SubFOp>(
        loc,
        rewriter.create<arith::MulFOp>(loc, lhsImag, rhsRealImagRatio, fmf),
        lhsReal, fmf);
    Value resultImag1 = rewriter.create<arith::DivFOp>(loc, imagNumerator1,
                                                       rhsRealImagDenom, fmf);

    Value rhsImagRealRatio =
        rewriter.create<arith::DivFOp>(loc, rhsImag, rhsReal, fmf);
    Value rhsImagRealDenom = rewriter.create<arith::AddFOp>(
        loc, rhsReal,
        rewriter.create<arith::MulFOp>(loc, rhsImagRealRatio, rhsImag, fmf),
        fmf);
    Value realNumerator2 = rewriter.create<arith::AddFOp>(
        loc, lhsReal,
        rewriter.create<arith::MulFOp>(loc, lhsImag, rhsImagRealRatio, fmf),
        fmf);
    Value resultReal2 = rewriter.create<arith::DivFOp>(loc, realNumerator2,
                                                       rhsImagRealDenom, fmf);
    Value imagNumerator2 = rewriter.create<arith::SubFOp>(
        loc, lhsImag,
        rewriter.create<arith::MulFOp>(loc, lhsReal, rhsImagRealRatio, fmf),
        fmf);
    Value resultImag2 = rewriter.create<arith::DivFOp>(loc, imagNumerator2,
                                                       rhsImagRealDenom, fmf);

    // Consider corner cases.
    // Case 1. Zero denominator, numerator contains at most one NaN value.
    Value zero = rewriter.create<arith::ConstantOp>(
        loc, elementType, rewriter.getZeroAttr(elem


本必须存放在 /etc/ini.d/ 目录下
cp xxx /etc/ini.d/
# 2. 增加/删除所指定的系统服务，让 chkconfig 指令得以管理它
chkconfig --add/--del service_name
# 3. 开启/关闭服务，不指定任何运行级别的 chkconfig on 将启用运行级别 2、3、4 和 5上 的服务。
chkconfig  service_name  on/off

# CentOS 7
systemctl enable  service_name		# 开机启动
systemctl disable  service_name		# 开机关闭
```

---

以下内容节选自《[systemd 时代的开机自启动任务 | 骏马金龙](https://www.junmajinlong.com/linux/systemd/auto_tasks_on_boot/)》，供参考。

## systemd 中自定义开机自启动命令/脚本

- 在 SysV 系统中，要让某个命令或者某个脚本开机自启动，可以将命令或者脚本的命令行写入 /etc/rc.d/rc.local 文件中。

- 在 systemd 中，要让命令或者某个脚本开机自启动，要么将其编写成一个开机自启动服务，要么通过兼容的 /etc/rc.d/rc.local。

但更建议的方案是编写开机自启动服务，后面会专门介绍服务管理配置文件如何编写。

下面是一个简单的让命令(脚本)开机自启动的配置文件：

```bash
$ cat /usr/lib/systemd/system/mycmd.service
[Unit]
Description = some shell script
# 要求脚本具有可执行权限
ConditionFileIsExecutable=/usr/bin/some.sh

# 指定要运行的命令、脚本
[Service]
ExecStart = /usr/bin/some.sh

# 下面这段不能少
[Install]
WantedBy = multi-user.target

$ systemctl daemon-reload
$ systemctl enable mycmd.service
```

如果要使用 /etc/rc.local 的方式呢？systemd 提供了 rc-local.service 服务来加载 /etc/rc.d/rc.local 文件中的命令。

```bash
$ cat /usr/lib/systemd/system/rc-local.service
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
```

这个文件缺少了 \[Install] 段且没有 WantedBy，后面将会解释 Install 中的 WantedBy 表示设置该服务开机自启动时，该服务加入到哪个『运行级别』中启动。

但这个文件的注释中说明了，如果 /etc/rc.d/rc.local


.png"] = -457,
  [520022002] = -458,
  ["520022002_2_0"] = -459,
  ["520022002_3_0"] = -460,
  [520022003] = -461,
  ["520022003_2_0"] = -462,
  ["520022003_3_0"] = -463,
  ["UI/Atlas/BuffS/tex_icon_buff_invincible.png"] = -464,
  [520022004] = -465,
  ["520022004_2_0"] = -466,
  ["520022004_3_0"] = -467,
  [520024002] = -468,
  ["520024002_2_0"] = -469,
  ["520024002_3_0"] = -470,
  [520024003] = -471,
  ["520024003_2_0"] = -472,
  ["520024003_3_0"] = -473,
  [520025001] = -474,
  ["520025001_2_0"] = -475,
  ["520025001_3_0"] = -476,
  [520025003] = -477,
  ["520025003_2_0"] = -478,
  ["520025003_3_0"] = -479,
  [520026001] = -480,
  ["520026001_2_0"] = -481,
  ["520026001_3_0"] = -482,
  [520028002] = -483,
  ["520028002_2_0"] = -484,
  ["520028002_3_0"] = -485,
  ["UI/Atlas/BuffS/tex_icon_buff_icedefup.png"] = -486,
  [520028003] = -487,
  ["520028003_2_0"] = -488,
  ["520028003_3_0"] = -489,
  ["UI/Atlas/BuffS/tex_icon_buff_wooddefup.png"] = -490,
  [520028004] = -491,
  ["520028004_2_0"] = -492,
  ["520028004_3_0"] = -493,
  ["UI/Atlas/BuffS/tex_icon_buff_waterdefdown.png"] = -494,
  [520028005] = -495,
  ["520028005_2_0"] = -496,
  ["520028005_3_0"] = -497,
  ["UI/Atlas/BuffS/tex_icon_buff_earthdefdown.png"] = -498,
  [520029002] = -499,
  ["520029002_2_0"] = -500,
  ["520029002_3_0"] = -501,
  ["UI/Atlas/BuffS/tex_icon_buff_firedefup.png"] = -502,
  [520029003] = -503,
  ["520029003_2_0"] = -504,
  ["520029003_3_0"] = -505,
  ["UI/Atlas/BuffS/tex_icon_buff_earthdefup.png"] = -506,
  [520029004] = -507,
  ["520029004_2_0"] = -508,
  ["520029004_3_0"] = -509,
  [520029005] = -510,
  ["520029005_2_0"] = -511,
  ["520029005_3_0"] = -512,
  ["UI/Atlas/BuffS/tex_icon_buff_thunderdefdown.png"] = -513,
  [520030002] = -514,
  ["520030002_2_0"] = -515,
  ["520030002_3_0"] = -516,
  [520030003] = -517,
  ["520030003_2_0"] = -518,
  ["52003


16 v22, v40, v30, v22 op_sel_hi:[1,0,1]
	v_pk_fma_f16 v24, v39, v30, v24 op_sel:[0,1,0]
	v_and_b32_sdwa v47, v21, v47 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
	v_and_b32_sdwa v63, v21, v63 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
	v_and_b32_sdwa v55, v21, v55 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
	v_lshrrev_b32_e32 v77, 16, v51
	v_pk_fma_f16 v23, v28, v30, v23 op_sel:[0,1,0]
	v_lshl_or_b32 v29, v71, 16, v90
	v_lshrrev_b32_e32 v74, 16, v71
	v_pk_fma_f16 v22, v25, v30, v22 op_sel:[0,1,0]
	v_lshl_or_b32 v35, v51, 16, v95
	v_and_b32_e32 v91, v21, v64
	v_and_b32_e32 v96, v21, v56
	v_pk_fma_f16 v24, v26, v31, v24 op_sel_hi:[1,0,1]
	v_lshl_or_b32 v27, v65, 16, v47
	v_pk_fma_f16 v23, v29, v31, v23 op_sel_hi:[1,0,1]
	v_lshl_or_b32 v25, v74, 16, v63
	v_lshl_or_b32 v28, v77, 16, v55
	v_pk_fma_f16 v22, v35, v31, v22 op_sel_hi:[1,0,1]
	v_pk_fma_f16 v24, v27, v31, v24 op_sel:[0,1,0]
	v_and_b32_sdwa v64, v21, v64 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
	v_and_b32_sdwa v56, v21, v56 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
	v_lshrrev_b32_e32 v66, 16, v52
	v_lshrrev_b32_e32 v85, 16, v72
	v_pk_fma_f16 v23, v25, v31, v23 op_sel:[0,1,0]
	v_lshl_or_b32 v26, v72, 16, v91
	v_lshl_or_b32 v29, v52, 16, v96
	v_pk_fma_f16 v22, v28, v31, v22 op_sel:[0,1,0]
	v_pk_fma_f16 v24, v33, v32, v24 op_sel_hi:[1,0,1]
	v_lshl_or_b32 v25, v85, 16, v64
	v_pk_fma_f16 v23, v26, v32, v23 op_sel_hi:[1,0,1]
	v_lshl_or_b32 v27, v66, 16, v56
	v_pk_fma_f16 v22, v29, v32, v22 op_sel_hi:[1,0,1]
	v_pk


 [
					type.typeName,
					type.migrations.subTypeKey && type.migrations.subTypeMigrations
						? {
								version: type.migrations.currentVersion,
								subTypeKey: type.migrations.subTypeKey,
								subTypeVersions: type.migrations.subTypeMigrations
									? Object.fromEntries(
											Object.entries(type.migrations.subTypeMigrations).map(([k, v]) => [
												k,
												v.currentVersion,
											])
									  )
									: undefined,
						  }
						: {
								version: type.migrations.currentVersion,
						  },
				])
			),
		}
	}

	serializeEarliestVersion(): SerializedSchema {
		return {
			schemaVersion: 1,
			storeVersion: this.options.snapshotMigrations?.firstVersion ?? 0,
			recordVersions: Object.fromEntries(
				objectMapValues(this.types).map((type) => [
					type.typeName,
					type.migrations.subTypeKey && type.migrations.subTypeMigrations
						? {
								version: type.migrations.firstVersion,
								subTypeKey: type.migrations.subTypeKey,
								subTypeVersions: type.migrations.subTypeMigrations
									? Object.fromEntries(
											Object.entries(type.migrations.subTypeMigrations).map(([k, v]) => [
												k,
												v.firstVersion,
											])
									  )
									: undefined,
						  }
						: {
								version: type.migrations.firstVersion,
						  },
				])
			),
		}
	}
}
import { MomentTimeSpan } from './moment-timespan';

describe('Moment timespan', () => {

  it('should initialize', () => {
    const item = new MomentTimeSpan('8.00', '11.00');

    expect(item).toBeTruthy();
    expect(item.durationAsString()).toBe('PT3H');
  });

  it('should be comparable', () => {
    const first = new MomentTimeSpan('8.00', '11.00');
    const second = new MomentTimeSpan('11.15', '12.00');

    expect(first.isBefore(second)).toBeTruthy();
    expect(second.isAfter(first)).toBeTruthy();
    expect(second.isBefore(first)).toBeFalsy();
  });

  it ('should conflict with timespans', () => {
    const dep = new MomentTimeSpan('07.30', '08.00');
    const first = new MomentTimeSpan('08.00', '11.00');
    const second = new MomentTimeSpan('7.30', '9.00');
    const third = new MomentTimeSpan('11.15', '12.00');

    const fourth = new MomentTimeSpan('8.30', '9.00');
    const fifth = new MomentTimeSpan('11.00', '12.00');

    expect(first.conflicts(dep)).toBeFalsy();
    expect(first.conflicts(fifth)).toBeFalsy();
    expect(first.conflicts(second)).toBeTruthy();
    expect(first.conflicts(third)).toBeFalsy();

    expect(fifth.conflicts(fourth)).toBeFalsy();
  });

  it ('should handle equality', () => {
    const first = new MomentTimeSpan('8.00', '11.00');
    const second = new MomentTimeSpan('8.00', '11.00');
    const third = new MomentTimeSpan('8.00', '12.00');

    expect(first.isSame(second)).toBeTruthy();
    expect(first.isSame(third)).toBeFalsy();
  });

  it('should handle connections', () => {
    const first = new MomentTimeSpan('8.00', '11.00');
    const second = new MomentTimeSpan('11.00', '12.00');
    const third = new MomentTimeSpan('7.00', '8.00');
    const fourth = new MomentTimeSpan('11.15', '12.00');

    expect(first.isConnectedTo


istogram> {
    fn fmt(&self, formatter: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        write!(formatter, "Static:\n")?;
        macro_rules! with_field { ($(($ident: ident, $name: expr, $user_readable: expr, $bname: expr )),*) => {
                $(
                    write!(formatter, "    {name}:\n", name = $user_readable)?;
                    write!(formatter, "{content}", content = self.$ident)?;
                )*
        } };
        for_field_in_per_static!(with_field);
        Ok(())
    }
}

pub trait DisplayWith<T> {
    fn fmt(&self, formatter: &mut std::fmt::Formatter, data: &T) -> Result<(), std::fmt::Error>;
}

impl DisplayWith</* Total */ BytesAndInstances> for BytesAndInstances {
    fn fmt(
        &self,
        formatter: &mut std::fmt::Formatter,
        total: &BytesAndInstances,
    ) -> Result<(), std::fmt::Error> {
        let bytes = Into::<usize>::into(self.bytes);
        let symbols = Into::<usize>::into(self.instances);
        let total_bytes = Into::<usize>::into(total.bytes);
        let total_symbols = Into::<usize>::into(total.instances);
        write!(formatter, "symbols {symbols} = {symbols_percent:.2}, bytes {bytes} = {bytes_percent:.2} ({bits_per_symbol:.2} bits/symbol)",
            symbols = symbols,
            bytes = bytes,
            symbols_percent = 100.* symbols as f64 / total_symbols as f64,
            bytes_percent = 100.* bytes as f64 / total_bytes as f64,
            bits_per_symbol = 8. * bytes as f64 / symbols as f64,
        )
    }
}

impl std::fmt::Display for PerUserExtensibleKind<BytesAndInstances> {
    fn fmt(&self, formatter: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        let total = BytesAndInstances {
            bytes: self.iter().map(|(_, data)| data.bytes.clone()).sum(),
            instances: self.iter().map(|(_, data)| data.instances.clone()).sum(),
        };

        write!(formatter, "  User-extensible:\n")?;
        for (field, name) in &[
            (&self.identifier_names, "identifier names"),
            (&self.string_literals, "string literals"),
            (&self.floats, "floats"),
            (&self.unsigned_longs, "unsigned longs"),
            (&self.list_lengths, "list lengths"),
        ] {
            write!(formatter, "    {name}: ", name = name)?;
            field.fmt(formatter, &total)?;
            write!(formatter, "\n")?;
        }
        write!(
            formatter,
            "Total: {} bytes, {} symbols",
            total.bytes, total.instances
        )?;
        Ok(())
    }
}
<reponame>jatindhankhar/vita
use crate::error::{Result, VitaError};
use crate::{DataSource, IntoSubdomain};
use async_trait::async_trait;
use dotenv::dotenv;
use reqwest::header::ACCEPT;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use std::env;
use std::sync::Arc;
use tokio::sync::mpsc::Sender;
use tracing::{info, trace, warn};

struct Creds {
    key: String,
    secret: String,
}

impl Creds {
    fn from_env() -> Result<Self> {
        dotenv().ok();
        let key = env::var("PASSIVETOTAL_KEY");
        let secret = env::var("PASSIVETOTAL_SECRET");
        match (key, secret) {
            (Ok(k), Ok(s)) => Ok(Self { key: k, secret: s }),
            _ => Err(VitaError::UnsetKeys(vec![


shadow:0 0 1px rgba(21,104,94,.3),0 0 2px rgba(21,104,94,.3),0 0 5px rgba(21,104,94,.2)}a{text-shadow:0 0 1px rgba(50,251,226,.3),0 0 2px rgba(50,251,226,.3),0 0 5px rgba(50,251,226,.2)}.blockquote-footer{text-shadow:0 0 1px rgba(21,104,94,.3),0 0 2px rgba(21,104,94,.3),0 0 5px rgba(21,104,94,.2)}hr{border-top:1px solid #6f42c1;box-shadow:0 0 2px rgba(111,66,193,.9),0 0 4px rgba(111,66,193,.4),0 0 1rem rgba(111,66,193,.3),0 0 4rem rgba(111,66,193,.1);opacity:1}.table,table{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-primary,.btn-primary{box-shadow:0 0 2px rgba(111,66,193,.9),0 0 4px rgba(111,66,193,.4),0 0 1rem rgba(111,66,193,.3),0 0 4rem rgba(111,66,193,.1)}.btn-primary{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-primary{color:#fff;border-width:2px}.btn-outline-secondary,.btn-secondary{box-shadow:0 0 2px rgba(234,57,184,.9),0 0 4px rgba(234,57,184,.4),0 0 1rem rgba(234,57,184,.3),0 0 4rem rgba(234,57,184,.1)}.btn-secondary{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-secondary{color:#fff;border-width:2px}.btn-outline-success,.btn-success{box-shadow:0 0 2px rgba(60,242,129,.9),0 0 4px rgba(60,242,129,.4),0 0 1rem rgba(60,242,129,.3),0 0 4rem rgba(60,242,129,.1)}.btn-success{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-success{color:#fff;border-width:2px}.btn-info,.btn-outline-info{box-shadow:0 0 2px rgba(27,162,246,.9),0 0 4px rgba(27,162,246,.4),0 0 1rem rgba(27,162,246,.3),0 0 4rem rgba(27,162,246,.1)}.btn-info{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-info{color:#fff;border-width:2px}.btn-outline-warning,.btn-warning{box-shadow:0 0 2px rgba(255,193,7,.9),0 0 4px rgba(255,193,7,.4),0 0 1rem rgba(255,193,7,.3),0 0 4rem rgba(255,193,7,.1)}.btn-warning{text-shadow:0 0 1px rgba(255,255,255,.3),0 0 2px rgba(255,255,255,.3),0 0 5px rgba(255,255,255,.2)}.btn-outline-warning{color:#fff;border-width:2px}.btn-danger,.


}

            if (GUILayout.Button(EnableHotkeys ? "Start Host (H)" : "Start Host", GUILayout.Height(height))) {
              if (_isMultiplePeerMode) {
                StartHostWithClients(nds);
              } else {
                nds.StartHost();
              }
            }

            if (GUILayout.Button(EnableHotkeys ? "Start Client (C)" : "Start Client", GUILayout.Height(height))) {
              if (_isMultiplePeerMode) {
                StartMultipleClients(nds);
              } else {
                nds.StartClient();
              }
            }

            if (GUILayout.Button(EnableHotkeys ? "Start Auto Host Or Client (A)" : "Start Auto Host Or Client", GUILayout.Height(height))) {
              if (_isMultiplePeerMode) {
                StartMultipleAutoClients(nds);
              } else {
                nds.StartAutoClient();
              }
            }

            if (_isMultiplePeerMode) {

              GUILayout.BeginHorizontal(/*GUI.skin.button*/);
              {
                GUILayout.Label("Client Count:", GUILayout.Height(height));
                GUILayout.Label("", GUILayout.Width(4));
                string newcount = GUILayout.TextField(_clientCount, 10, GUILayout.Width(width * .25f), GUILayout.Height(height));
                if (_clientCount != newcount) {
                  // Remove everything but numbers from our client count string.
                  _clientCount = newcount;
                  ValidateClientCount();
                }
              }
              GUILayout.EndHorizontal();
            }
          } else {

            if (GUILayout.Button("Shutdown", GUILayout.Height(height))) {
              _networkDebugStart.ShutdownAll();
            }
          }

          GUILayout.EndVertical();
        }
      }
      GUILayout.EndArea();

      GUI.skin = holdskin;
    }

    private void StartHostWithClients(FusionBootstrap nds) {
      int count;
      try {
        count = Convert.ToInt32(_clientCount);
      } catch {
        count = 0;
      }
      nds.StartHostPlusClients(count);
    }

    private void StartServerWithClients(FusionBootstrap nds) {
      int count;
      try {
        count = Convert.ToInt32(_clien


.println(JsonUtils.toJson(output.shape()));
                    // System.out.println(JsonUtils.toJson(label.shape()));
                    int time = output.number / batchSize;
                    float error = this.accuracyBatchFisrt(input, output, label, time, batchSize, trainingData.vocab, trainingData.dictionary.get("<pad>"));
                    // if(error > 99) {
                    // break;
                    // }
                    String msg = "training[" + this.trainIndex + "]{" + it + "} (lr:" + this.network.learnRate + ") accuracy:{" + error + "%} train_loss:" + this.currentError + " [costTime:" + (System.nanoTime() - start) / 1e6 + "ms.]";
                    System.out.println(msg);
                    this.batchIndex++;
                }
                // output.showDMByNumber(0);
                // showOutputAndLabel(trainingData, inputEncoder, output, label,
                // this.batchSize);
                /**
                 * update learning rate
                 *
                 */
                this.updateLR(this.lr_step);
            }
            /**
             * 停止训练
             *
             */
            System.out.println("training finish. [" + this.trainIndex + "] finalError:" + this.currentError);
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }

    public void trainGPT2(ENTokenizer trainingData) {
        // TODO Auto-generated method stub
        try {
            // CUDAModules.initCUDAFunctions();
            this.dataSize = trainingData.number;
            if (isWarmUp()) {
                this.network.learnRate = (float) (this.lr * Math.pow(batchIndex * 1.0f / burnIn * 1.0f, power));
            }
            GPT2 network = (GPT2) this.network;
            Tensor input = new Tensor(batchSize * network.time, 1, 1, network.vocabSize, true);
            Tensor label = new Tensor(batchSize * network.time, 1, 1, network.vocabSize, true);
            Tensor mask = ENTokenizer.triu(batchSize, network.headNum, network.time, network.time, 1);
            Tensor positions = ENTokenizer.getPositions(batchSize, network.time);
            for (int i = 0; i < this.trainTime; i++) {
                if (this.trainIndex >= this.minTrainTime) {
                    break;
                }
                this.trainIndex = i + 1;
                int[][] indexs = MathUtils.randomInts(trainingData.number, this.batchSize);
                Tensor output = null;
                /**
                 * 遍历整个训练集
                 *
                 */
                for (int it = 0; it < indexs.length; it++) {
                    if (Math.abs(this.currentError) <= this.error) {
                        break;
                    }
                    long start = System.nanoTime();
                    this.loss.clear();
                    this.lossDiff.clear();
                    /**
                     * 读取训练数据
                     *
                     */
                    trainingData.loadData(indexs[it], input, label);
                    /**
                     * forward
                     *
                     */
                    output = network.forward(input, positions, mask);
                    // output.showDMByNumber(0);
                    // label.showDMByNumber(0);
                    /**
                     * loss
                     *
                     */
                    this.loss = network.loss(output, label, trainingData.dictionary.get("<pad>"));
                    // this.loss = network.loss(output, label);
                    /**
                     * loss diff
                     *
                     */
                    this.lossDiff = network.lossDiff(output, label, trainingData.dictionary.get("<pad>"));
                    // this.lossDiff = network.lossDiff(output, label);
                    // System.out.println(JsonUtils.toJson(output.syncHost()));
                    // GradClipping.gradClipping(this.lossDiff, 1e-7f);


"Content-Style" content="text/css">
<title>TIFFWarning</title>

TIFFWarning

NAME

SYNOPSIS

DESCRIPTION

RETURN VALUES

SEE ALSO

NAME

TIFFWarning, TIFFSetWarningHandler − library
warning interface

SYNOPSIS

#include <tiffio.h>

void TIFFWarning(const char *module,
const char *fmt, ...)

#include <stdarg.h>

typedef void (*TIFFWarningHandler)(const char
*module, const char *fmt,
va_list ap);

TIFFWarningHandler
TIFFSetWarningHandler(TIFFWarningHandler
handler);

DESCRIPTION

TIFFWarning invokes the library-wide warning
handler function to (normally) write a warning message to
the stderr. The fmt parameter is a
printf(3S) format string, and any number arguments
can be supplied. The module parameter is interpreted
as a string that, if non-zero, should be printed before the
message; it typically is used to identify the software
module in which a warning is detected.

Applications that desire to capture control in the event
of a warning should use TIFFSetWarningHandler to
override the default warning handler. A NULL
(0) warning handler function may be installed to suppress
error messages.

RETURN VALUES

<td width="91


S 0
    free_stack    SIZEOF_FP_REGS

    pop_register    r10
    POP_ARGUMENT_REGISTERS

    mov    r11, [r10]
    mov    qword ptr [rax], r11

    mov    rax, [r10 + POINTER_SIZE]
    jmp    rax
LEAF_END RhCommonStub, _TEXT

LEAF_ENTRY RhGetCommonStubAddress, _TEXT
    lea rax, [rip + C_FUNC(RhCommonStub)]
    ret
LEAF_END RhGetCommonStubAddress, _TEXT

LEAF_ENTRY RhGetCurrentThunkContext, _TEXT

    INLINE_GET_TLS_VAR  tls_thunkData

    mov    rax, qword ptr [rax]
    ret
LEAF_END RhGetCurrentThunkContext, _TEXT


** follow the directive ordering conventions in\n[Effective Dart](https://dart.dev/effective-dart/style#ordering):\n\n**DO** place `dart:` imports before other imports.\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n\nimport 'dart:async';  // LINT\nimport 'dart:html';  // LINT\n```\n\n**BAD:**\n```dart\nimport 'dart:html';  // OK\nimport 'package:bar/bar.dart';\n\nimport 'dart:async';  // LINT\nimport 'package:foo/foo.dart';\n```\n\n**GOOD:**\n```dart\nimport 'dart:async';  // OK\nimport 'dart:html';  // OK\n\nimport 'package:bar/bar.dart';\nimport 'package:foo/foo.dart';\n```\n\n**DO** place `package:` imports before relative imports.\n\n**BAD:**\n```dart\nimport 'a.dart';\nimport 'b.dart';\n\nimport 'package:bar/bar.dart';  // LINT\nimport 'package:foo/foo.dart';  // LINT\n```\n\n**BAD:**\n```dart\nimport 'package:bar/bar.dart';  // OK\nimport 'a.dart';\n\nimport 'package:foo/foo.dart';  // LINT\nimport 'b.dart';\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart';  // OK\nimport 'package:foo/foo.dart';  // OK\n\nimport 'a.dart';\nimport 'b.dart';\n```\n\n**DO** specify exports in a separate section after all imports.\n\n**BAD:**\n```dart\nimport 'src/error.dart';\nexport 'src/error.dart'; // LINT\nimport 'src/string_source.dart';\n```\n\n**GOOD:**\n```dart\nimport 'src/error.dart';\nimport 'src/string_source.dart';\n\nexport 'src/error.dart'; // OK\n```\n\n**DO** sort sections alphabetically.\n\n**BAD:**\n```dart\nimport 'package:foo/bar.dart'; // OK\nimport 'package:bar/bar.dart'; // LINT\n\nimport 'a/b.dart'; // OK\nimport 'a.dart'; // LINT\n```\n\n**GOOD:**\n```dart\nimport 'package:bar/bar.dart'; // OK\nimport 'package:foo/bar.dart'; // OK\n\nimport 'a.dart'; // OK\nimport 'a/b.dart'; // OK\n```",
    "sinceDartSdk": "2.0"
  },
  {
    "name": "discarded_futures",
    "description": "Don't invoke asynchronous functions in non-`async` blocks.",
    "categories": [
      "errorProne"
    ],
    "state": "stable",
    "incompatible": [],
    "sets": [],
    "fixStatus": "hasFix",
    "details": "Making asynchronous calls in non-`async` functions is usually the sign of a\nprogramming error.  In general these functions should be marked `async` and such\nfutures should likely be awaited (as enforced by `unawaited_futures`).\n\n**DON'T** invoke asynchronous functions in non-`async` blocks.\n\n**BAD:**\n```dart\nvoid recreateDir(String path) {\n  deleteDir(path);\n  createDir(path);\n}\n\nFuture<void> deleteDir(String path) async {}\n\nFuture<void> createDir(String path) async {}\n```\n\n**GOOD:**\n```dart\nFuture<void> recreateDir(String path) async {\n  await deleteDir(path);\n  await createDir(path);\n}\n\nFuture<void> deleteDir(String path) async {}\n\nFuture<void> createDir(String path) async {}\n```",


   math_sin},
  {"sqrt",  math_sqrt},
  {"tan",   math_tan},
  {"type", math_type},
#if defined(LUA_COMPAT_MATHLIB)
  {"atan2", math_atan},
  {"cosh",   math_cosh},
  {"sinh",   math_sinh},
  {"tanh",   math_tanh},
  {"pow",   math_pow},
  {"frexp", math_frexp},
  {"ldexp", math_ldexp},
  {"log10", math_log10},
#endif
  /* placeholders */
  {"pi", NULL},
  {"huge", NULL},
  {"maxinteger", NULL},
  {"mininteger", NULL},
  {NULL, NULL}
};

/*
** Open math library
*/
LUAMOD_API int luaopen_math (lua_State *L) {
  luaL_newlib(L, mathlib);
  lua_pushnumber(L, PI);
  lua_setfield(L, -2, "pi");
  lua_pushnumber(L, (lua_Number)HUGE_VAL);
  lua_setfield(L, -2, "huge");
  lua_pushinteger(L, LUA_MAXINTEGER);
  lua_setfield(L, -2, "maxinteger");
  lua_pushinteger(L, LUA_MININTEGER);
  lua_setfield(L, -2, "mininteger");
  return 1;
}

} // end NS_SLUA/*
** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/

#define liolib_c
#define LUA_LIB

#include "lprefix.h"

#include <ctype.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"

/*
** {======================================================
** l_fseek: configuration for longer offsets
** =======================================================
*/

#if !defined(l_fseek)		/* { */

#if defined(LUA_USE_POSIX)	/* { */

#include <sys/types.h>

#define l_fseek(f,o,w)		fseeko(f,o,w)
#define l_ftell(f)		ftello(f)
#define l_seeknum		off_t

#elif defined(LUA_USE_WINDOWS) && !defined(_CRTIMP_TYPEINFO) \
   && defined(_MSC_VER) && (_MSC_VER >= 1400)	/* }{ */

/* Windows (but not DDK) and Visual C++ 2005 or higher */
#define l_fseek(f,o,w)		_fseeki64(f,o,w)
#define l_ftell(f)		_ftelli64(f)
#define l_seeknum		__int64

#else				/* }{ */

/* ISO C definitions */
#define l_fseek(f,o,w)		fseek(f,o,w)
#define l_ftell(f)		ftell(f)
#define l_seeknum		long

#endif				/* } */

#endif				/* } */

/* }====================================================== */

namespace NS_SLUA {
/*
** Change this macro to accept other modes for 'fopen' besides
** the standard ones.
*/
#if !defined(l_checkmode)

/* accepted extensions to 'mode' in 'fopen' */
#if !defined(L_MODEEXT)
#define L_MODEEXT	"b"
#endif

/* Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */
static int l_checkmode (const char *mode) {
  return (*mode != '\0' && strchr("rwa", *(mode++)) != NULL &&
         (*mode != '+' || (++mode, 1)) &&  /* skip if char is '+' */


a\x12=\n" +
	"\rmember_alarms\x18\x02 \x03(\v2\x18.machine.EtcdMemberAlarmR\fmemberAlarms\"M\n" +
	"\x16EtcdDefragmentResponse\x123\n" +
	"\bmessages\x18\x01 \x03(\v2\x17.machine.EtcdDefragmentR\bmessages\">\n" +
	"\x0eEtcdDefragment\x12,\n" +
	"\bmetadata\x18\x01 \x01(\v2\x10.common.MetadataR\bmetadata\"E\n" +
	"\x12EtcdStatusResponse\x12/\n" +
	"\bmessages\x18\x01 \x03(\v2\x13.machine.EtcdStatusR\bmessages\"z\n" +
	"\n" +
	"EtcdStatus\x12,\n" +
	"\bmetadata\x18\x01 \x01(\v2\x10.common.MetadataR\bmetadata\x12>\n" +
	"\rmember_status\x18\x02 \x01(\v2\x19.machine.EtcdMemberStatusR\fmemberStatus\"\xfa\x02\n" +
	"\x10EtcdMemberStatus\x12'\n" +
	"\x0fstorage_version\x18\v \x01(\tR\x0estorageVersion\x12\x1b\n" +
	"\tmember_id\x18\n" +
	" \x01(\x04R\bmemberId\x12)\n" +
	"\x10protocol_version\x18\x01 \x01(\tR\x0fprotocolVersion\x12\x17\n" +
	"\adb_size\x18\x02 \x01(\x03R\x06dbSize\x12#\n" +
	"\x0edb_size_in_use\x18\x03 \x01(\x03R\vdbSizeInUse\x12\x16\n" +
	"\x06leader\x18\x04 \x01(\x04R\x06leader\x12\x1d\n" +
	"\n" +
	"raft_index\x18\x05 \x01(\x04R\traftIndex\x12\x1b\n" +
	"\traft_term\x18\x06 \x01(\x04R\braftTerm\x12,\n" +
	"\x12raft_applied_index\x18\a \x01(\x04R\x10raftAppliedIndex\x12\x16\n" +
	"\x06errors\x18\b \x03(\tR\x06errors\x12\x1d\n" +
	"\n" +
	"is_learner\x18\t \x01(\bR\tisLearner\"8\n" +
	"\x1cEtcdDowngradeValidateRequest\x12\x18\n" +
	"\aversion\x18\x01 \x01(\tR\aversion\"[\n" +
	"\x1dEtcdDowngradeValidateResponse\x12:\n" +
	"\bmessages\x18\x01 \x03(\v2\x1e.machine.EtcdDowngradeValidateR\bmessages\"\x91\x01\n" +
	"\x15EtcdDowngradeValidate\x12,\n" +
	"\bmetadata\x18\x01 \x01(\v2\x10.common.MetadataR\bmetadata\x12J\n" +
	"\x11cluster_downgrade\x18\x02 \x01(\v2\x1d.machine.EtcdClusterDowngradeR\x10clusterDowngrade\"6\n" +
	"\x1aEtcdDowngradeEnableRequest\x12\x18\n" +
	"\aversion\x18\x01 \x01(\tR\aversion\"W\n" +
	"\x


//  OCHamcrest by Jon Reid, http://qualitycoding.org/about/
//  Copyright 2014 hamcrest.org. See LICENSE.txt

#import <OCHamcrestIOS/HCDiagnosingMatcher.h>

@interface HCIsCollectionContaining : HCDiagnosingMatcher

+ (instancetype)isCollectionContaining:(id <HCMatcher>)elementMatcher;
- (instancetype)initWithMatcher:(id <HCMatcher>)elementMatcher;

@end

FOUNDATION_EXPORT id HC_hasItem(id itemMatch);

/**
 hasItem(aMatcher) -
 Matches if any element of collection satisfies a given matcher.

 @param aMatcher  The matcher to satisfy, or an expected value for @ref equalTo matching.

 This matcher iterates the evaluated collection, searching for any element that satisfies a
 given matcher. If a matching element is found, @c hasItem is satisfied.

 If the @a aMatcher argument is not a matcher, it is implicitly wrapped in an @ref equalTo
 matcher to check for equality.

 (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
 @c HC_hasItem instead.)

 @ingroup collection_matchers
 */
#ifdef HC_SHORTHAND
    #define hasItem HC_hasItem
#endif

FOUNDATION_EXPORT id HC_hasItems(id itemMatch, ...) NS_REQUIRES_NIL_TERMINATION;

/**
 hasItems(firstMatcher, ...) -
 Matches if all of the given matchers are satisfied by any elements of the collection.

 @param firstMatcher,...  A comma-separated list of matchers ending with @c nil.

 This matcher iterates the given matchers, searching for any elements in the evaluated collection
 that satisfy them. If each matcher is satisfied, then @c hasItems is satisfied.

 Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for
 equality.

 (In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
 @c hasItems instead.)

 @ingroup collection_matchers
 */
#ifdef HC_SHORTHAND
    #define hasItems HC_hasItems
#endif


d test_유저_삭제_성공() {
    // given
    Long userId = 1L;
    User user = new User();
    when(userRepository.findById(userId)).thenReturn(Optional.of(user));

    // when & then
    userService.deleteUser(userId);

    // verify
    verify(userRepository).findById(userId);
  }

  @Test
  void test_유저_삭제_실패_유저없음() {
    // given
    Long userId = 1L;
    when(userRepository.findById(userId)).thenReturn(Optional.empty());

    // when & then
    UserException exception = assertThrows(UserException.class,
        () -> userService.deleteUser(userId));

    assertEquals(UserErrorCode.USER_NOT_FOUND, exception.getErrorCode());

    // verify
    verify(userRepository).findById(userId);
  }

  @Test
  void test_유저_티어_단일_조회_성공() {
    // given
    Long userId = 1L;
    Long tierId = 1L;

    UserRequest.Create requestUser = new UserRequest.Create(
        "testUser", "password", "test@test.com", "nickname1", UserRole.ROLE_USER
    );
    User user = User.create(requestUser, "password123");
    Tier tier = new Tier(tierId, "실버핑", 100000L);
    UserTier userTier = UserTier.create(user, tier);

    // when
    when(userTierRepository.findByUserId(userId)).thenReturn(Optional.of(userTier));
    when(userRepository.findById(userTier.getUser().getId())).thenReturn(Optional.of(user));
    when(tierRepository.findById(userTier.getTier().getId())).thenReturn(Optional.of(tier));

    // then
    UserTierResponse.Get response = userService.getUserTierByUserId(userId);

    // assert
    assertEquals("testUser", response.getUsername());
    assertEquals("실버핑", response.getTier());

    verify(userTierRepository, times(1)).findByUserId(userId);
    verify(userRepository, times(1)).findById(userTier.getUser().getId());
    verify(tierRepository, times(1)).findById(userTier.getTier().getId());
  }

  @Test
  void test_유저_티어_단일_조회_실패_유저티어_없음() {
    // given
    Long userId = 1L;

    // when
    when(userTierRepository.findByUserId(userId)).thenReturn(Optional.empty());

    // then
    UserException exception = assertThrows(UserException.class,
        () -> userService.getUserTierByUserId(userId));

    // assert
    assertEquals(UserErrorCode.USER_TIER_NOT_FOUND, exception.getErrorCode());

    verify(userTierRepository, times(1)).findByUserId(userId);
    verify(userRepository, never()).findById(anyLong());
    verify(tierRepository, never()).findById(anyLong());
  }

  @Test
  void test_유저_티어_단일_조회_실패_유저_없음() {
    // given
    Long userId = 1L;

    User user = mock(User.class);
    Tier tier = mock(Tier.class);
    UserTier userTier = UserTier.create(user, tier);

    // when
    when(userTierRepository.findByUserId(userId)).thenReturn(Optional.of(userTier));
    when(userRepository.findById(userTier.getUser().getId())).thenReturn(Optional.empty());

    // then
    UserException exception = assertThrows(UserException.class,
        () -> userService.


mented
    public
#else
    internal
#endif
    abstract partial class CosmosFloat64 : CosmosNumber, IEquatable<CosmosFloat64>, IComparable<CosmosFloat64>
    {
        private sealed class EagerCosmosFloat64 : CosmosFloat64
        {
            private readonly double number;

            public EagerCosmosFloat64(double number)
            {
                this.number = number;
            }

            public override double GetValue()
            {
                return this.number;
            }
        }
    }
}