30
	tst r2, #8
	bne _02340F30
	tst r2, #0x100
	streqb r4, [fp, r6, lsl #1]
	addeq r0, fp, r6, lsl #1
	streqb r8, [r0, #1]
	addeq r6, r6, #1
_02340F30:
	add r8, r8, #1
	cmp r8, #0x20
	blt _02340EDC
	add r7, r7, #1
	cmp r7, #0x38
	blt _02340ED4
	cmp r6, #0
	beq _02340FFC
	ldrb r4, [sl, #0xf]
	cmp r4, #0
	beq _02340F74
	sub r0, r4, #2
	add r1, r4, #2
	bl DungeonRandRange
	mov r4, r0
	cmp r4, #1
	movlt r4, #1
_02340F74:
	ldr r1, _02341458 ; =DUNGEON_PTR
	ldr r0, _02341460 ; =0x0002C9E8
	ldr r2, [r1]
	ldrsh r0, [r2, r0]
	cmp r0, #0
	addne r4, r4, #1
	add r1, r4, #1
	ldr r0, _02341464 ; =0x00012AFA
	cmp r1, #0
	strh r1, [r2, r0]
	ble _02340FFC
	add r0, sp, #0
	mov r1, r6
	bl ShuffleSpawnPositions
	mov r0, r6
	bl DungeonRandInt
	mov r8, r0
	mov r7, #0
	add r4, r4, #1
	add fp, sp, #0
	b _02340FF4
_02340FC8:
	add r1, fp, r8, lsl #1
	ldrb r0, [fp, r8, lsl #1]
	ldrb r1, [r1, #1]
	bl GetTileSafe
	ldrh r1, [r0, #2]
	add r8, r8, #1
	cmp r8, r6
	orr r1, r1, #2
	strh r1, [r0, #2]
	moveq r8, #0
	add r7, r7, #1
_02340FF4:
	cmp r7, r4
	blt _02340FC8
_02340FFC:
	mov r6, #0
	mov r7, r6
	add fp, sp, #0
_02341008:
	mov r8, #0
	and r4, r7, #0xff
_02341010:
	mov r0, r7
	mov r1, r8
	bl GetTile
	ldrh r0, [r0]
	tst r0, #3
	streqb r4, [fp, r6, lsl #1]
	addeq r0, fp, r6, lsl #1
	streqb r8, [r0, #1]
	add r8, r8, #1
	addeq r6, r6, #1
	cmp r8, #0x20
	blt _02341010
	add r7, r7, #1
	cmp r7, #0x38
	blt _02341008
	cmp r6, #0
	beq _023410D0
	ldrb r7, [sl, #0x14]
	cmp r7, #0
	beq _02341070
	sub r0, r7, #2
	add r1, r7, #2
	bl DungeonRandRange
	mov r7, r0
_02341070:
	cmp r7, #0
	ble _023410D0
	add r0, sp, #0
	mov r1, r6


   raise TypeError(
                "'exclude_classes' must be of type str, list of str or None. "
                f"Given type: {type(exclude_classes)}."
            )
    else:
        exclude_classes = []

    if include_classes and exclude_classes:
        raise TypeError("Either 'include_classes' OR 'exclude_classes' can be set, not both.")

    include_classes = [_capitalize_first_letter(cls) for cls in include_classes]
    exclude_classes = [_capitalize_first_letter(cls) for cls in exclude_classes]

    return (backup_id.lower(), backend, include_classes, exclude_classes)

def _get_and_validate_get_status(
    backup_id: str, backend: Union[str, BackupStorage]
) -> Tuple[str, BackupStorage]:
    """Checks if a started classification job has completed.

    Args:
        backup_id: The identifier name of the backup. NOTE: Case insensitive.
        backend: The backend storage where to create the backup. Currently available options are:
                "filesystem", "s3", "gcs" and "azure".

    Returns:
        Validated and processed (backup_id, backend, include_classes, exclude_classes).

    Raises:
        TypeError: One of the arguments is of a wrong type.
    """
    if not isinstance(backup_id, str):
        raise TypeError(f"'backup_id' must be of type str. Given type: {type(backup_id)}.")
    if isinstance(backend, str):
        try:
            backend = BackupStorage(backend.lower())
        except KeyError:
            raise ValueError(
                f"'backend' must have one of these values: {STORAGE_NAMES}. Given value: {backend}."
            )

    return (backup_id.lower(), backend)


    else:
          h = modules[m_idx](h, temb)
          m_idx += 1

    assert not hs

    if self.progressive == 'output_skip':
      h = pyramid
    else:
      h = self.act(modules[m_idx](h))
      m_idx += 1
      h = modules[m_idx](h)
      m_idx += 1

    assert m_idx == len(modules)
    # if self.config.scale_by_sigma:
    #   used_sigmas = used_sigmas.reshape((x.shape[0], *([1] * len(x.shape[1:]))))
    if self.config.scale_by_sigma:
      used_sigmas = used_sigmas.reshape((x.shape[0], *([1] * len(x.shape[1:]))))
      used_sigmas = used_sigmas.repeat(1, 3, 1, 1)
      used_sigmas_ = 1.001 - used_sigmas
      if self.out_mul > 2:
        used_sigmas = used_sigmas.repeat(1, self.out_mul-1, 1, 1)
      used_sigmas = torch.cat([torch.exp(-used_sigmas), torch.exp(-used_sigmas_)], dim=1)

      # used_sigmas = self.sigma_layer(temb)
      # used_sigmas = used_sigmas.reshape((used_sigmas.shape[0], used_sigmas.shape[1], *([1] * len(x.shape[2:]))))
      # h = h/(1+used_sigmas)
      # used_sigmas1 = used_sigmas[:, 0].reshape((x.shape[0], *([1] * len(x.shape[1:]))))
      # h[:, :3] = h[:, :3] / used_sigmas1
      # used_sigmas2 = used_sigmas[:, 1].reshape((x.shape[0], *([1] * len(x.shape[1:]))))
      # h[:, 3:] = h[:, 3:] / used_sigmas2
      h = h / used_sigmas

    return h

if __name__ == '__main__':
  import yaml
  from fvcore.common.config import CfgNode
  with open('../configs/cifar10/uncond_etp_const_dpm_sde.yaml') as f:
    exp_conf = yaml.load(f, Loader=yaml.FullLoader)
  config = CfgNode(exp_conf)
  config = config.model.ncsnpp
  model = NCSNpp(config)
  x = torch.rand(2, 3, 32, 32)
  eps = 1e-4
  t = torch.rand(x.shape[0], device=x.device) * (1 - eps) + eps
  y = model(x, t)
  pass


BLED
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_6 && t6 , T_7 && t7 , T_8 && t8 , T_9 && t9)
    : base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::
      forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5) , std::forward<T_6>( t6) , std::forward<T_7>( t7) , std::forward<T_8>( t8) , std::forward<T_9>( t9)))
{}
# endif
        BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        deque()
            {}
        BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        explicit deque(typename detail::call_param<T0>::type t0)
            : base(t0, detail::nil_keyed_element())
            {}
        BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        explicit deque(deque const& rhs)
            : base(rhs)
            {}
        template<typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
        BOOST_FUSION_GPU_ENABLED
        deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& seq)
            : base(seq)
            {}
        template<typename Sequence>
        BOOST_FUSION_GPU_ENABLED
        deque(Sequence const& seq
            , typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
            , typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
            : base(base::from_iterator(fusion::begin(seq)))
            {}
        template <typename T>
        BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        deque&
        operator=(T const& rhs)
        {
            base::operator=(rhs);
            return *this;
        }
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
        template <typename T0_>
        BOOST_FUSION_GPU_ENABLED
        explicit deque(T0_&& t0
          , typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
          , typename disable_if_c<
                boost::is_same<deque const, typename boost::remove_reference<T0_>::type const>::value
              , detail::enabler_
            >::type = detail::enabler
         )
            : base(std::forward<T0_>( t0), detail::nil_keyed_element())
            {}
        BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
        explicit deque(deque&& rhs)
            : base(std::forward<deque>(rhs))
            {}
        template<typename U0 , typename U1


-right: 24px; }
.mdl-badge:not([data-badge]) {
    margin-right: auto; }
.mdl-badge[data-badge]:after {
    content: attr(data-badge);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    position: absolute;
    top: -11px;
    right: -24px;
    font-family: "Open Sans", "Helvetica", "Arial", sans-serif;
    font-weight: 600;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgb(116,79,198);
    color: rgb(255,255,255); }
.mdl-button .mdl-badge[data-badge]:after {
    top: -10px;
    right: -5px; }
.mdl-badge.mdl-badge--no-background[data-badge]:after {
    color: rgb(116,79,198);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 1px gray; }
.mdl-badge.mdl-badge--overlap {
    margin-right: 10px; }
.mdl-badge.mdl-badge--overlap:after {
    right: -10px; }

/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*------------------------------------*    $CONTENTS
\*------------------------------------*/
/**
 * STYLE GUIDE VARIABLES------------------Declarations of Sass variables
 * -----Typography
 * -----Colors
 * -----Textfield
 * -----Switch
 * -----Spinner
 * -----Radio
 * -----Menu
 * -----List
 * -----Layout
 * -----Icon toggles
 * -----Footer
 * -----Column
 * -----Checkbox
 * -----Card
 * -----Button
 * -----Animation
 * -----Progress
 * -----Badge
 * -----Shadows
 * -----Grid
 * -----Data table
 * -----Dialog
 * -----Snackbar
 *
 * Even though all variables have the `!default` directive, most of them
 * should not be changed as they are dependent one another. This can cause
 * visual distortions (like alignment issues) that are hard to track down
 * and fix.
 */
/* ==========  TYPOGRAPHY  ========== */
/* We're splitting fonts into "preferred" and "performance" in order to optimize
   page loading. For important text, such as the body, we want it to load
   immediately and not wait for the web font load, whereas for other sections,
   such as headers and titles, we're OK with things taking a bit longer to load.
   We do have some optional classes and parameters in the mixins, in case you
   definitely want to make sure you're using the preferred font and don't mind
   the performance hit.
   We should be able to improve on this once CSS Font Loading L3 becomes more
   widely available.
*/
/* ==========  COLORS  ======


            if var == "--" {
                options_ok = false;
                continue;
            } else if var == "-nocomplain" {
                continue;
            }
        }

        interp.unset_var(var);
    }

    molt_ok!()
}

/// # while *test* *command*
///
/// A standard "while" loop.  *test* is a boolean expression; *command* is a script to
/// execute so long as the expression is true.
pub fn cmd_while(interp: &mut Interp, argv: &[Value]) -> MoltResult {
    check_args(1, argv, 3, 3, "test command")?;

    while interp.expr_bool(&argv[1])? {
        let result = interp.eval_body(&argv[2]);

        match result {
            Ok(_) => (),
            Err(ResultCode::Break) => break,
            Err(ResultCode::Continue) => (),
            _ => return result,
        }
    }

    molt_ok!()
}
<filename>src/config.rs<gh_stars>1-10
use std::ffi::OsStr;
use winreg::enums::*;
use winreg::types::FromRegValue;
use winreg::RegKey;

pub struct RegConfig {
    hive: Option<RegKey>,
}

impl RegConfig {
    pub fn new() -> Self {
        let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
        match hklm.create_subkey_with_flags(
            "SYSTEM\\CurrentControlSet\\Control\\Lsa\\HIBPPwdFlt",
            KEY_READ,
        ) {
            Ok((h, _)) => Self { hive: Some(h) },
            _ => Self { hive: None },
        }
    }

    pub fn get_or<T: FromRegValue, N: AsRef<OsStr>>(&self, name: N, fallback: T) -> T {
        match self.hive {
            Some(ref h) => match h.get_value(name) {
                Ok(value) => value,
                Err(_) => fallback,
            },
            None => fallback,
        }
    }
}
use quibitous_automation::quibitous::ConfigurationBuilder;
use quibitous_automation::{qcli::JCli, quibitous::Starter};
use quibitous_lib::crypto::hash::Hash;
use quibitous_lib::interfaces::{BlockDate, InitialUTxO};

use assert_fs::TempDir;
use chain_impl_mockchain::fee::LinearFee;
use std::io::Write;

#[test]
pub fn test_make_test_transaction() {
    let temp_dir = TempDir::new().unwrap();

    let qcli: JCli = Default::default();
    let sender = silica::Wallet::default();

    let sk_file_path = temp_dir.join("sender.sk");

    {
        let mut sk_file = std::fs::File::create(&sk_file_path).unwrap();
        sk_file
            .write_all(sender.signing_key_to_string().as_bytes())
            .unwrap();
    }

    let staging_file = temp_dir.join("staging.txt");

    let config = ConfigurationBuilder::new()
        .with_funds(vec![InitialUTxO {
            address: sender.address(),
            value: 100.into(),
        }])
        .build(&temp_dir);

    let quibitous = Starter::new()
        .temp_dir(temp_dir)
        .config(config.clone())
        .start()
        .unwrap();

    let block0_hash = Hash::from_hex(config.genesis_block_hash()).unwrap();

    qcli.transaction().make_transaction(
        quibitous.rest_uri(),
        sender.address(),
        None,
        100.into(),
        block0_hash.to_string(),
        BlockDate::new(1, 0),
        sk_file_path,


	ldr	w2, [x0, #:lo12:.LANCHOR42]
	adrp	x0, .LANCHOR76+6
	ldrh	w0, [x0, #:lo12:.LANCHOR76+6]
	cmp	w1, w2
	sub	w0, w2, w0
	sub	w0, w0, w1
	udiv	w0, w0, w3
	adrp	x3, .LANCHOR232
	strh	w0, [x3, #:lo12:.LANCHOR232]
	bls	.L2162
	mov	w2, 1739
	adrp	x1, .LANCHOR230
	adrp	x0, .LC5
	add	x1, x1, :lo12:.LANCHOR230
	add	x0, x0, :lo12:.LC5
	bl	printf
	adrp	x1, .LC6
	adrp	x0, .LC7
	add	x1, x1, :lo12:.LC6
	add	x0, x0, :lo12:.LC7
	bl	printf
.L2162:
	add	x4, x20, :lo12:.LANCHOR82
	adrp	x0, .LANCHOR93
	add	x2, x0, :lo12:.LANCHOR93
	adrp	x5, .LANCHOR213
	adrp	x19, .LANCHOR94
	mov	x22, x5
	ldrh	w1, [x4, 16]
	ldrh	w6, [x4, 14]
	strh	w6, [x0, #:lo12:.LANCHOR93]
	lsr	w3, w1, 6
	and	w1, w1, 63
	strb	w1, [x2, 6]
	ldrb	w1, [x4, 11]
	strb	w1, [x2, 8]
	add	x1, x5, :lo12:.LANCHOR213
	strh	w3, [x2, 2]
	mov	w2, -1
	strh	w2, [x5, #:lo12:.LANCHOR213]
	add	x2, x19, :lo12:.LANCHOR94
	strh	wzr, [x1, 2]
	strb	wzr, [x1, 6]
	strb	wzr, [x1, 8]
	ldrh	w1, [x4, 18]
	strh	w1, [x19, #:lo12:.LANCHOR94]
	ldrh	w1, [x4, 20]
	lsr	w3, w1, 6
	and	w1, w1, 63
	strb	w1, [x2, 6]
	ldrb	w1, [x4, 12]
	strh	w3, [x2, 2]
	strb	w1, [x2, 8]
	adrp	x2, .LANCHOR95
	ldrh	w1, [x4, 22]
	add	x3, x2, :lo12:.LANCHOR95
	strh	w1, [x2, #:lo12:.LANCHOR95]
	mov	x21, x2
	ldrh	w1, [x4, 24]
	lsr	w7, w1, 6
	and	w1, w1, 63
	strb	w1, [x3, 6]
	ldrb	w1, [x4, 13]
	strb	w1, [x3, 8]
	adrp	x1, .LANCHOR166
	strh	w7, [x3, 2]
	ldr	w3, [x4, 32]
	str	wzr, [x1, #:lo12:.LANCHOR166]
	adrp	x1, .LANCHOR167
	str	wzr, [x1, #:lo12:.


 reduction: We assume that these conditions are met:
 * Given x =(x_2k-1 ...x_0)_b
 *	 m =(m_k-1 ....m_0)_b	  with m_k-1 != 0
 * Output r = x mod m
 * Before using this function init_barret must be used to calucalte y and k.
 * Returns: false = no error
 *	    true = can't perform barret reduction
 */
static int
calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 )
{
    int xx = k > 3 ? k-3:0;

    mpi_normalize( x );
    if( mpi_get_nlimbs(x) > 2*k )
	return 1; /* can't do it */

    /* 1. q1 = floor( x / b^k-1)
     *	  q2 = q1 * y
     *	  q3 = floor( q2 / b^k+1 )
     * Actually, we don't need qx, we can work direct on r2
     */
    mpi_set( r2, x );
    mpi_rshift_limbs( r2, k-1 );
    mpi_mul( r2, r2, y );
    mpi_rshift_limbs( r2, k+1 );

    /* 2. r1 = x mod b^k+1
     *	  r2 = q3 * m mod b^k+1
     *	  r  = r1 - r2
     * 3. if r < 0 then  r = r + b^k+1
     */
    mpi_set( r1, x );
    if( r1->nlimbs > k+1 ) /* quick modulo operation */
	r1->nlimbs = k+1;
    mpi_mul( r2, r2, m );
    if( r2->nlimbs > k+1 ) /* quick modulo operation */
	r2->nlimbs = k+1;
    mpi_sub( r, r1, r2 );

    if( mpi_has_sign (r) ) {
	gcry_mpi_t tmp;

	tmp = mpi_alloc( k + 2 );
	mpi_set_ui( tmp, 1 );
	mpi_lshift_limbs( tmp, k+1 );
	mpi_add( r, r, tmp );
	mpi_free(tmp);
    }

    /* 4. while r >= m do r = r - m */
    while( mpi_cmp( r, m ) >= 0 )
	mpi_sub( r, r, m );

    return 0;
}
#endif /* USE_BARRETT */


nth[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
   char buf[128];
   time_t t = ts;
   struct tm *tm;
#ifdef HAVE_GMTIME_R
   struct tm storage;
   tm = gmtime_r(&t, &storage);
#else
   tm = gmtime(&t);
#endif

   EINA_SAFETY_ON_NULL_RETURN_VAL(tm, NULL);

   snprintf(buf, sizeof(buf),
            "%s, %02d %s %4d %02d:%02d:%02d GMT",
            wkday[tm->tm_wday],
            tm->tm_mday,
            month[tm->tm_mon],
            tm->tm_year + 1900,
            tm->tm_hour,
            tm->tm_min,
            tm->tm_sec);
   return strdup(buf);
}

CURL *
efl_net_dialer_http_curl_get(const Eo *o)
{
   Efl_Net_Dialer_Http_Data *pd = efl_data_scope_get(o, MY_CLASS);
   EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
   return pd->easy;
}

#include "efl_net_dialer_http.eo.c"


 }

    // Getters e Setters
    public Integer getIdModalidade() {
        return idModalidade;
    }

    public void setIdModalidade(Integer idModalidade) {
        this.idModalidade = idModalidade;
    }

    public String getDescricaoModalidade() {
        return descricaoModalidade;
    }

    public void setDescricaoModalidade(String descricaoModalidade) {
        this.descricaoModalidade = descricaoModalidade;
    }
}
package com.analisedecredito.aplicacao_analise_credito.model;

import com.analisedecredito.aplicacao_analise_credito.dto.PatrimonioTipoDto;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

@Entity
@Table(name = "patrimonio_tipo")
public class PatrimonioTipo {

    // Propriedades
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id_patrimonio_tipo")
    private Integer idPatrimonioTipo;

    @Column(name = "descricao_patrimonio_tipo", nullable = false)
    private String descricaoPatrimonioTipo;

    // Construtor
    public PatrimonioTipo() {

    }

    public PatrimonioTipo(PatrimonioTipoDto patrimonioTipoDto) {
        this.idPatrimonioTipo = patrimonioTipoDto.getIdPatrimonioTipo();
        this.descricaoPatrimonioTipo = patrimonioTipoDto.getDescricaoPatrimonioTipo();
    }

    // Getters e Setters
    public Integer getIdPatrimonioTipo() {
        return idPatrimonioTipo;
    }

    public void setIdPatrimonioTipo(Integer idPatrimonioTipo) {
        this.idPatrimonioTipo = idPatrimonioTipo;
    }

    public String getDescricaoPatrimonioTipo() {
        return descricaoPatrimonioTipo;
    }

    public void setDescricaoPatrimonioTipo(String descricaoPatrimonioTipo) {
        this.descricaoPatrimonioTipo = descricaoPatrimonioTipo;
    }

}
package com.athaydes.automaton.samples;

import com.athaydes.automaton.FXApp;
import com.athaydes.automaton.FXer;
import com.athaydes.automaton.samples.apps.JavaFxLoginPage;
import com.athaydes.automaton.selector.AutomatonSelector;
import com.athaydes.automaton.selector.SimpleFxSelector;
import javafx.scene.Node;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.junit.Before;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static com.athaydes.automaton.assertion.AutomatonMatcher.hasText;
import static com.athaydes.automaton.samples.apps.LoginResult.LOGIN_OK;
import static com.athaydes.automaton.samples.apps.LoginResult.NO_PASSWORD;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
 * @author Renato
 */
public class JavaFxSample {

    FXer fxer;

    @Before
    public void setup() throws Exception {
        FXApp.startApp( new JavaFxLoginPage() );
        Thread.sleep( 500 );
        fxer = FXer.getUserWith( FXApp.getScene().getRoot() );
    }

    @Test
    public void cannotLoginWithoutEnteringPassword() {
        fxer.clickOn( fxer.getAt( TextField.class ) )
                .type( "Automaton


rpolate(
            rel_pos.reshape(1, rel_pos.shape[0], -1).permute(0, 2, 1),
            size=max_rel_dist,
            mode="linear",
        )
        rel_pos_resized = rel_pos_resized.reshape(-1, max_rel_dist).permute(1, 0)
    else:
        rel_pos_resized = rel_pos

    # Scale the coords with short length if shapes for q and k are different.
    q_coords = torch.arange(q_size)[:, None] * max(k_size / q_size, 1.0)
    k_coords = torch.arange(k_size)[None, :] * max(q_size / k_size, 1.0)
    relative_coords = (q_coords - k_coords) + (k_size - 1) * max(q_size / k_size, 1.0)

    return rel_pos_resized[relative_coords.long()]

def add_decomposed_rel_pos(attn, q, rel_pos_h, rel_pos_w, q_size, k_size):
    """
    Calculate decomposed Relative Positional Embeddings from :paper:`mvitv2`.
    https://github.com/facebookresearch/mvit/blob/19786631e330df9f3622e5402b4a419a263a2c80/mvit/models/attention.py   # noqa B950
    Args:
        attn (Tensor): attention map.
        q (Tensor): query q in the attention layer with shape (B, q_h * q_w, C).
        rel_pos_h (Tensor): relative position embeddings (Lh, C) for height axis.
        rel_pos_w (Tensor): relative position embeddings (Lw, C) for width axis.
        q_size (Tuple): spatial sequence size of query q with (q_h, q_w).
        k_size (Tuple): spatial sequence size of key k with (k_h, k_w).

    Returns:
        attn (Tensor): attention map with added relative positional embeddings.
    """
    q_h, q_w = q_size
    k_h, k_w = k_size
    Rh = get_rel_pos(q_h, k_h, rel_pos_h)
    Rw = get_rel_pos(q_w, k_w, rel_pos_w)

    B, _, dim = q.shape
    r_q = q.reshape(B, q_h, q_w, dim)
    rel_h = torch.einsum("bhwc,hkc->bhwk", r_q, Rh)
    rel_w = torch.einsum("bhwc,wkc->bhwk", r_q, Rw)

    attn = (
        attn.view(B, q_h, q_w, k_h, k_w) + rel_h[:, :, :, :, None] + rel_w[:, :, :, None, :]
    ).view(B, q_h * q_w, k_h * k_w)

    return attn

def mean_flat(tensor):
    return tensor.mean(dim=list(range(1, tensor.ndim)))

#################################################################################
#                          Token Masking and Unmasking                          #
#################################################################################
def get_mask(batch, length, mask_ratio, device, mask_type=None, data_info=None, extra_len=0):
    """
    Get the binary mask for the input sequence.
    Args:
        - batch: batch size
        - length: sequence length
        - mask_ratio: ratio of tokens to mask
        - data_info: dictionary with info for reconstruction
    return:
        mask_dict with following keys:
        - mask: binary mask, 0 is keep, 1 is remove
        - ids_keep: indices of tokens to keep
        - ids_restore: indices to restore the original order
    """
    assert mask_type in ['random', 'fft', 'laplacian', 'group']
    mask = torch.ones([batch, length], device=device)
    len_keep = int(length * (1 - mask_ratio)) - extra_len

    if mask_type == 'random' or mask_type == 'group':
        noise = torch.rand(batch, length, device=device)  # noise in [0, 1]
        ids_shuffle = torch.argsort(noise, dim=1)  # ascend: small is keep, large is remove
        ids_restore = torch.argsort(ids_shuffle, dim=1)
        # keep the first subset
        ids_keep = ids_shuffle[:, :len_keep]
        ids_removed = ids_shuffle[:, len_keep:]

    elif mask_type in ['fft', 'laplacian']:
        if 'strength' in data_info:
            strength = data_info['strength']

        else:
            N = data_info['N'][0]
            img = data_info['ori_img']
            # 获取原图的尺寸信息
            _, C, H, W = img.shape
            if mask_type == 'fft':
                # 对图片进行reshape，将其变为patch (3, H/N, N, W/N, N)
                reshaped_image = img.reshape((batch, -1, H // N, N, W // N, N))
                fft_image = torch.fft.fftn(reshaped_image, dim=(3, 5))
                # 取绝对值并求和获取频率强度
                strength = torch.sum(torch.abs(fft_image), dim=(1, 3, 5)).reshape((batch, -1,))
            elif type == 'laplacian':
                laplacian_kernel = torch.tensor([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]], dtype=torch.float32).reshape(1, 1, 3, 3)
                laplacian_kernel = laplacian_kernel.repeat(C, 1, 1, 1)
                # 对图片进行reshape，将其变为patch (3, H/N, N, W/N, N)
                reshaped_image = img.reshape(-1, C, H // N, N, W // N, N).permute(0, 2, 4, 1, 3, 5).reshape(-1, C, N, N)
                laplacian_response = F.conv2d(re


a(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);color:#333}.mod-workflow-request .dropdown-container,.search-ui-form .dropdown-container{display:none;position:absolute;z-index:101;width:70%;max-height:70%;margin-top:2px;overflow:auto;-moz-box-shadow:1px 2px 4px #888;-webkit-box-shadow:1px 2px 4px #888;box-shadow:1px 2px 4px #888;font-weight:normal}.search-ui-select .btn{display:inline-block;padding:6px 12px;border:1px solid #bbb;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#fff;background:-owg-linear-gradient(top, #fff, #ebecec);background:-webkit-linear-gradient(top, #fff, #ebecec);background:-moz-linear-gradient(top, #fff, #ebecec);background:-o-linear-gradient(top, #fff, #ebecec);background:linear-gradient(top, #fff, #ebecec);*zoom:1;filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr="#FFFFFFFF", endColorstr="#FFEBECEC");filter:none \9 ;color:#000;font-size:86%;line-height:1.4;word-break:keep-all;vertical-align:middle;cursor:pointer}.search-ui-select .btn:hover{opacity:.9;text-decoration:none}.search-ui-select .btn:disabled,.search-ui-select .btn.btn-disabled{border:1px solid rgba(0,0,0,0);background:#d8d8d8;color:#888;cursor:default}.search-ui-select .btn[aria-pressed=true],.search-ui-select .btn.btn-pressed{background-color:#ccc;background-image:none;box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);color:#333}.mod-workflow-request dt .tooltip{display:inline-block;position:relative;width:16px;height:16px;margin-left:5px;-webkit-border-radius:8px;-moz-border-radius:8px;-ms-border-radius:8px;-o-border-radius:8px;border-radius:8px;background:#f25a38;color:#fff;line-height:1.1;text-align:center;cursor:pointer}.mod-workflow-request dt .tooltip ul{display:none;position:absolute;z-index:100;top:30px;left:-25px;width:30em;padding:15px;border:1px solid #d0d0d0;background:#fff;-moz-box-shadow:0 1px 6px #d0d0d0;-webkit-box-shadow:0 1px 6px #d0d0d0;box-shadow:0 1px 6px #d0d0d0;color:#000;font-size:90%;font-weight:normal;line-height:1.6;list-style:none;text-align:left;cursor:auto}@media only screen and (max-width: 768px){.mod-workflow-request dt .tooltip ul{width:15em}}.mod-workflow-request dt .tooltip ul:before{content:"";position:absolute;top:-13px;left:20px;width:0;height:0;border-right:12px solid rgba(0,0,0,0);border-bottom:12px solid #d0d0d0;border-left:12px solid rgba(0,0,0,0);background-color:#fff}.mod-workflow-request dt .tooltip ul:after{content:"";position:absolute;top:-12px;left:215px;width:0;height:0;border-right:12px solid rgba(0,0,0,0);border-bottom:12px


(); dpy++)
        {
            sp<const DisplayDevice> displayDevice(mDisplays[dpy]);
            const auto hwcId = displayDevice->getHwcDisplayId();
            if (hwcId >= 0)
            {
                const Vector<sp<Layer>> &currentLayers(
                    displayDevice->getVisibleLayersSortedByZ());
                for (size_t i = 0; i < currentLayers.size(); i++)
                {
                    const auto &layer = currentLayers[i];
                    if (!layer->hasHwcLayer(hwcId))
                    {
                        if (!layer->createHwcLayer(getBE().mHwc.get(), hwcId))
                        {
                            layer->forceClientComposition(hwcId);
                            continue;
                        }
                    }

                    layer->setGeometry(displayDevice, i);
                    if (mDebugDisableHWC || mDebugRegion)
                    {
                        layer->forceClientComposition(hwcId);
                    }
                }
            }
        }
    }

    // Set the per-frame data
    for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId)
    {
        auto &displayDevice = mDisplays[displayId];
        const auto hwcId = displayDevice->getHwcDisplayId();

        if (hwcId < 0)
        {
            continue;
        }
        if (mDrawingState.colorMatrixChanged)
        {
            displayDevice->setColorTransform(mDrawingState.colorMatrix);
            status_t result = getBE().mHwc->setColorTransform(hwcId, mDrawingState.colorMatrix);
            ALOGE_IF(result != NO_ERROR, "Failed to set color transform on "
                                         "display %zd: %d",
                     displayId, result);
        }
        for (auto &layer : displayDevice->getVisibleLayersSortedByZ())
        {
            if (layer->isHdrY410())
            {
                layer->forceClientComposition(hwcId);
            }
            else if ((layer->getDataSpace() == Dataspace::BT2020_PQ ||
                      layer->getDataSpace() == Dataspace::BT2020_ITU_PQ) &&
                     !displayDevice->hasHDR10Support())
            {
                layer->forceClientComposition(hwcId);
            }
            else if ((layer->getDataSpace() == Dataspace::BT2020_HLG ||
                      layer->getDataSpace() == Dataspace::BT2020_ITU_HLG) &&
                     !displayDevice->hasHLGSupport())
            {
                layer->forceClientComposition(hwcId);
            }

            if (layer->getForceClientComposition(hwcId))
            {
                ALOGV("[%s] Requesting Client composition", layer->getName().string());
                layer->setCompositionType(hwcId, HWC2::Composition::Client);
                continue;
            }

            layer->setPerFrameData(displayDevice);
        }

        if (hasWideColorDisplay)
        {
            ColorMode colorMode;
            Dataspace dataSpace;
            RenderIntent renderIntent;
            pickColorMode(displayDevice, &colorMode, &dataSpace, &renderIntent);
            setActiveColorModeInternal(displayDevice, colorMode, dataSpace, renderIntent);
        }
    }

    mDrawingState.colorMatrixChanged = false;

    for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId)
    {
        auto &displayDevice = mDisplays[displayId];
        if (!displayDevice->isDisplayOn())
        {
            continue;
        }

        status_t result = displayDevice->prepareFrame(*getBE().mHwc);
        ALOGE_IF(result != NO_ERROR, "prepareFrame for display %zd failed:"
                                     " %d (%


# Python3 code to remove after substring in string using index() + len() + slicing
str1 = 'geeksforgeeks is best for geeks'
sub_str = 'best'

res = str1[:str1.index(sub_str) + len(sub_str)]

print('The string after removal:', res)


					FileUtils.copyFileUsingChannel(source, dstConfig);
				else {
					ProfileModel params = loadConfig(from.getDir());
					if (params != null) {
						params.dir = dstConfig.getParentFile();
						saveConfig(params);
					}
				}
			}
			if (keyboard) FileUtils.copyFileUsingChannel(from.getKeyLayout(), dstKeyLayout);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	static void save(Profile profile, String fromPath, boolean config, boolean keyboard)
			throws IOException {
		if (!config && !keyboard) {
			return;
		}
		profile.create();
		File srcConfig = new File(fromPath, Config.MIDLET_CONFIG_FILE);
		File srcKeyLayout = new File(fromPath, Config.MIDLET_KEY_LAYOUT_FILE);
		try {
			if (config) FileUtils.copyFileUsingChannel(srcConfig, profile.getConfig());
			if (keyboard) FileUtils.copyFileUsingChannel(srcKeyLayout, profile.getKeyLayout());
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	@Nullable
	public static ProfileModel loadConfig(File dir) {
		File file = new File(dir, Config.MIDLET_CONFIG_FILE);
		ProfileModel params = null;
		if (file.exists()) {
			try (FileReader reader = new FileReader(file)) {
				params = gson.fromJson(reader, ProfileModel.class);
				params.dir = dir;
			} catch (Exception e) {
				Log.e(TAG, "loadConfig: ", e);
			}
		}
		if (params == null) {
			File oldFile = new File(dir, "config.xml");
			if (oldFile.exists()) {
				try (FileInputStream in = new FileInputStream(oldFile)) {
					HashMap<String, Object> map = XmlUtils.readMapXml(in);
					JsonElement json = gson.toJsonTree(map);
					params = gson.fromJson(json, ProfileModel.class);
					params.dir = dir;
					if (saveConfig(params) && oldFile.delete()) {
						Log.d(TAG, "loadConfig: old config file deleted");
					}
				} catch (Exception e) {
					Log.e(TAG, "loadConfig: ", e);
				}
			}
		}
		if (params == null) {
			return null;
		}
		switch (params.version) {
			case 0:
				if (params.hwAcceleration) {
					params.graphicsMode = Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? 2 : 3;
				}
				updateSystemProperties(params);
			case 1:
				int w = params.screenWidth;
				int h = params.screenHeight;
				if (w > 0) {
					if (h > 0) {
						params.fontAA = Math.min(w, h) >= 240;
					} else {
						params.fontAA = w >= 240;
					}
				} else {
					params.fontAA = (h <= 0) || (h >= 240);
				}
			case 2:
				if (params.screenScaleToFit) {
					if (params.screenKeepAspectRatio) {
						params.screenScaleType = 1;
					} else {
						params.screenScaleType = 2;
					}
				} else {
					params.screenScaleType = 0;
				}
				params.screenGravity = 1;

				params.version = ProfileModel.VERSION;
				ProfilesManager.saveConfig(params);
				break;
		}
		return params;
	}

	public static boolean saveConfig(ProfileModel p) {
		try (FileWriter writer = new FileWriter(new File(p.dir, Config.MIDLET_CONFIG_FILE))) {
			gson.toJson(p, writer);
			writer.close();
			return true;
		} catch (Exception e) {
			Log.e(TAG, "saveConfig: ", e);
		}
		return false;
	}

	public static void updateSystemProperties(ProfileModel params) {
		String defaultProperties = ContextHolder.getAssetAsString("defaults/system.props");


  if (userName == aName) {
        cout << "Greetings, George\n";
    } else if (userName < aName) {
        cout << "You come before George\n";
    } else {
        cout << "You come after George\n";
    }

    int n = userName.compare(0, 2, aName, 0, 2);
    cout << "The first two letters of your name ";
    if (n == 0) {
        cout << "match";
    } else if (n < 0) {
        cout << "come before";
    } else {
        cout << "come after";
    }
    cout << aName.substr(0, 2) << endl;

    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s1("Quick! Send for Count Graystone.");
    string s2("Lord");
    string s3("Don't");

    s1.erase(0, 7); // Erase "Quick! "
    s1.replace(9, 5, s2); // Replace "Count" with "Lord"
    s1.replace(0, 1, "s"); // Replace "S" with "s"
    s1.insert(0, s3 + " "); // Insert "Don't " at the beginning
    s1.erase(s1.size() - 1, 1); // Erase the period
    s1.append(3, '!'); // Append "!!!" to the end

    int x = s1.find(' '); // Find the first space
    while (x < s1.size()) {
        s1.replace(x, 1, "/"); // Replace spaces with slashes
        x = s1.find(' '); // Find the next space
    }

    cout << "s1:" << s1 << endl;

    return 0;
}

#include <iostream>

using namespace std;

class Part {
    private:
        int modelnumber;
        int partnumber;
        float cost;
    public:
        void setpart(int mn, int pn, float c) {
            modelnumber = mn;
            partnumber = pn;
            cost = c;
        }
        void showpart() {
            cout << "Model " << modelnumber;
            cout << ", part " << partnumber;
            cout << ", cost $" << cost << endl;
        }
};

int main() {
    Part part1;
    part1.setpart(6244, 373, 217.55F);
    part1.showpart();
    return 0;
}#include <iostream>

using namespace std;

class Distance {
    private:
        int feet;
        float inches;
    public:
        Distance() : feet(0), inches(0.0) {
            // empty constructor
        }

        Distance(int ft, float in) : feet(ft), inches(in) {
            // empty constructor
        }

        void getdist() {
            cout << "\nEnter feet: "; cin >> feet;
            cout << "Enter inches: "; cin >> inches;
        }

        void showdist() {
            cout << feet << "\'-" << inches << '\"';
        }
};

int main() {
    Distance dist1(11, 6.25);
    Distance dist2(dist1);
    Distance dist3 = dist1;

    cout << "\ndist1 = "; dist1.showdist();
    cout << "\ndist2 = "; dist2.showdist();
    cout << "\ndist3 = "; dist3.showdist();
    cout << endl;
    return 0;
}#include <iostream>
using namespace std;

class AClass {
    public:
        class AnError {};
        void Func() {
            if (1) throw AnError();
        }
};

int main() {
    AClass a;
    try {
        a.Func();
    }


if (lc >= 265 && lc < 285) {
				extra_bits += (lc - 261) / 4;
			}

			int dc = Dcode(distance - 1);
			distTree.freqs[dc]++;
			if (dc >= 4) {
				extra_bits += dc / 2 - 1;
			}
			return IsFull();
		}

		/// <summary>
		/// Reverse the bits of a 16 bit value.
		/// </summary>
		/// <param name="toReverse">Value to reverse bits</param>
		/// <returns>Value with bits reversed</returns>
		public static short BitReverse(int toReverse)
		{
			return (short)(bit4Reverse[toReverse & 0xF] << 12


e.Am);Yl(b);}Gd(34962,B4e.Am);AJM(34962,d,35044);B4C=B4C+e|0;}}}
function IN(b,c,d){Ck();B4i=b;B4j=c;B4k=d;B4l=1.0;}
function YW(b,c){Ck();Bd();B3d.polygonOffset(b,c);}
function Tx(b){Ck();a:{switch(b){case 32885:break;case 32886:B4f=1;break a;case 32887:break a;case 32888:B4h=1;break a;default:break a;}B4g=1;}}
function T0(b){Ck();a:{switch(b){case 32885:break;case 32886:B4f=0;break a;case 32887:break a;case 32888:B4h=0;break a;default:break a;}B4g=0;}}
function AE9(){Ck();return 0|(!B4f?0:1)|(!B4g?0:2)|(!B4h?0:4);}
function AJb(b){var c;Ck();c=ACx(b);B4W=c;AUA(c);if(B4b)AYy(c,B4c);A6e(c,B4i,B4j,B4k,B4l);if(B4x){BaV(c,(!B4y?0:2)+B4w|0);BcM(c,B4s,B4t,B4u,B4v);APq(c,B4B);A_w(c,B4z,B4A);}AOD(c,B4G.data[B4H]);APD(c,B4I.data[B4J]);Bc9(c,B4K.data[B4L]);if(B4r&&B4a){A_L(c,B4m,B4n,B4o);A_l(c,B4T,B4U);}A1R(c,B4p,B4q);}
function AVy(b,c,d,e){var f;Ck();if(B4d){if(b!=7)BJ(Cv(),B(215));else{if(B4e.ui==(-1))B4e.ui=AE9();else if(B4e.ui!=AE9())BJ(Cv(),B(216));f=B4e;f.r$=f.r$+d|0;Bd();e=e;if((B3Z+e.length|0)<B30.length){f=B30;b=B3Z;f.set(e,b);B3Z=B3Z+e.length|0;}}}else{B4C=B4C+ZQ(e)|0;B4D=B4D+d|0;AJb(0|(!B4f?0:1)|(!B4g?0:2)|(!B4h?0:4)|(B4r&&B4a?8:0)|(!B4x?0:16)|(!B4b?0:32)|(!B3_?0:64));SO(B4W.KF);Gd(34962,B4W.Si);if(!B4W.Li){B4W.Li=1;AJM(34962,B4X,35048);}f=B3d;e=e;f.bufferSubData(34962,0,e);if(b==7){ACI(c,d);B4E=B4E+(d/2|0)|0;}
else{a:{b:{switch(b){case 1:break;case 2:case 4:break b;case 3:b=3;B4E=B4E+(d-1|0)|0;break a;case 5:b=5;B4E=B4E+(d-2|0)|0;break a;case 6:b=6;B4E=B4E+(d-2|0)|0;break a;default:break b;}b=1;B4E=


], stripChars);
        }
        return newArr;
    }

    /**
     *
Removes the accents from a string.

     *
NOTE: This is a JDK 1.6 method, it will fail on JDK 1.5.

     *
     *

     * StringUtils.stripAccents(null)                = null
     * StringUtils.stripAccents("")                  = ""
     * StringUtils.stripAccents("control")           = "control"
     * StringUtils.stripAccents("&ecute;clair")      = "eclair"
     *

     *
     * @param input String to be stripped
     * @return String without accents on the text
     *
     * @since 3.0
     */
    public static String stripAccents(String input) {
        if(input == null) {
            return null;
        }
        if(SystemUtils.isJavaVersionAtLeast(1.6f)) {

            // String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD);

            // START of 1.5 reflection - in 1.6 use the line commented out above
            try {
                // get java.text.Normalizer.Form class
                Class normalizerFormClass = ClassUtils.getClass("java.text.Normalizer$Form", false);

                // get Normlizer class
                Class normalizerClass = ClassUtils.getClass("java.text.Normalizer", false);

                // get static method on Normalizer
                java.lang.reflect.Method method = normalizerClass.getMethod("normalize", CharSequence.class, normalizerFormClass );

                // get Normalizer.NFD field
                java.lang.reflect.Field nfd = normalizerFormClass.getField("NFD");

                // invoke method
                String decomposed = (String) method.invoke( null, input, nfd.get(null) );
                // END of 1.5 reflection

                java.util.regex.Pattern accentPattern = java.util.regex.Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
                return accentPattern.matcher(decomposed).replaceAll("");
            } catch(ClassNotFoundException cnfe) {
                throw new RuntimeException("ClassNotFoundException occurred during 1.6 backcompat code", cnfe);
            } catch(NoSuchMethodException nsme) {
                throw new RuntimeException("NoSuchMethodException occurred during 1.6 backcompat code", nsme);
            } catch(NoSuchFieldException nsfe) {
                throw new RuntimeException("NoSuchFieldException occurred during 1.6 backcompat code", nsfe);
            } catch(IllegalAccessException iae) {
                throw new RuntimeException("IllegalAccessException occurred during 1.6 backcompat code", iae);
            } catch(IllegalArgumentException iae) {
                throw new RuntimeException("IllegalArgumentException occurred during 1.6 backcompat code", iae);
            } catch(java.lang.reflect.InvocationTargetException ite) {
                throw new RuntimeException("InvocationTargetException occurred during 1.6 backcompat code", ite);
            } catch(SecurityException se) {
                throw new RuntimeException("SecurityException occurred during 1.6 backcompat code", se);
            }
        } else {
            throw new UnsupportedOperationException("The stripAccents(String) method is not supported until Java 1.6");
        }
    }

    // Equals
    //-----------------------------------------------------------------------
    /**
     *
Compares two Strings, returning true if they are equal.

     *
     *
nulls are handled without exceptions. Two null
     * references are considered to be equal. The comparison is case sensitive.</p


= 2;
        //
        // rbNearestXY
        //
        rbNearestXY.AutoSize = true;
        rbNearestXY.Checked = true;
        rbNearestXY.Location = new Point(12, 12);
        rbNearestXY.Name = "rbNearestXY";
        rbNearestXY.Size = new Size(87, 19);
        rbNearestXY.TabIndex = 3;
        rbNearestXY.TabStop = true;
        rbNearestXY.Text = "Nearest X/Y";
        rbNearestXY.UseVisualStyleBackColor = true;
        //
        // rbNearestX
        //
        rbNearestX.AutoSize = true;
        rbNearestX.Location = new Point(105, 12);
        rbNearestX.Name = "rbNearestX";
        rbNearestX.Size = new Size(103, 19);
        rbNearestX.TabIndex = 4;
        rbNearestX.Text = "Nearest X Only";
        rbNearestX.UseVisualStyleBackColor = true;
        //
        // ShowValueUnderMouseSignalXY
        //
        AutoScaleDimensions = new SizeF(7F, 15F);
        AutoScaleMode = AutoScaleMode.Font;
        ClientSize = new Size(800, 450);
        Controls.Add(rbNearestX);
        Controls.Add(rbNearestXY);
        Controls.Add(formsPlot1);
        Name = "ShowValueUnderMouseSignalXY";
        Text = "ShowValueUnderMouseSignalXY";
        ResumeLayout(false);
        PerformLayout();
    }

    #endregion

    private ScottPlot.WinForms.FormsPlot formsPlot1;
    private RadioButton rbNearestXY;
    private RadioButton rbNearestX;
}


> RemoveFilterTypes(List<Order> orders)
        {
            if(FilterTypes.NotNullOrEmpty() && orders.NotNullOrEmpty())
            {
                List<Order> newOrders = new List<Order>();
                var ids = FilterTypes.Select(p => p.TypeID).ToHashSet2();
                foreach(var o in orders)
                {
                    if(!ids.Contains(o.TypeId))
                    {
                        newOrders.Add(o);
                    }
                }
                return newOrders;
            }
            else
            {
                return orders;
            }
        }
        /// <summary>
        /// 由源市场目的市场订单和指定物品分组类型生成表示一个物品的实例
        /// 卖单卖单按最低价最高价顺序排序完毕
        /// </summary>
        /// <param name="sourceOrders"></param>
        /// <param name="destinationOrders"></param>
        /// <param name="marketGroupIDs"></param>
        /// <returns></returns>
        private List<ScalperItem> GetScalperItems(List<Order> sourceOrders, List<Order> destinationOrders, HashSet<int> marketGroupIDs)
        {
            try
            {
                List<ScalperItem> scalperItems = new List<ScalperItem>();
                var sourceGroups = sourceOrders.GroupBy(p => p.TypeId);
                foreach (var group in sourceGroups)
                {
                    var list = group.ToList();
                    var invType = list.First().InvType;
                    if (invType?.MarketGroupID != null)
                    {
                        if (marketGroupIDs.Contains((int)invType.MarketGroupID))
                        {
                            var item = new ScalperItem()
                            {
                                InvType = list.First().InvType,
                                SourceSellOrders = list.Where(p => !p.IsBuyOrder).OrderBy(p => p.Price).ToList(),
                                SourceBuyOrders = list.Where(p => p.IsBuyOrder).OrderByDescending(p => p.Price).ToList(),
                            };
                            scalperItems.Add(item);
                            if(item.SourceSellOrders == null || item.SourceBuyOrders == null)
                            {

                            }
                        }
                    }
                }
                var dic = destinationOrders.GroupBy(p => p.TypeId).ToDictionary(p => p.Key);
                foreach (var item in scalperItems)
                {
                    if(dic.TryGetValue(item.InvType.TypeID, out var group))
                    {
                        var list = group.ToList();
                        item.DestinationSellOrders = list.Where(p => !p.IsBuyOrder).OrderBy(p => p.Price).ToList();
                        item.DestinationBuyOrders = list.Where(p => p.IsBuyOrder).OrderBy(p => p.Price).ToList();
                    }
                }
                return scalperItems;
            }
            catch(Exception ex)
            {
                Core.Log.Error(ex);
                return null;
            }
        }
        private void SetHistory(List<ScalperItem> scalperItems, Dictionary<int, List<Core.Models.Market.Statistic>> sourceStatisticDic, Dictionary<int, List<Core.Models.Market.Statistic>> destinationStatisticDic)
        {
            foreach(var item in scalperItems)
            {
                if(sourceStatisticDic.TryGetValue(item.InvType.TypeID, out var value1))
                {
                    item.SourceStatistics = value1;
                }
                if (destinationStatisticDic.TryGetValue(item.InvType.TypeID, out var value2))
                {
                    item.DestinationStatistics = value2;
                }
            }
        }
        private async Task<List<Core.DBModels.InvMarketGroup>> GetSubGroupOfTargetGroup()
        {
            var subGroups = await Core.Services.DB.InvMarketGroupService.QuerySubGroupAsync();
            return await Task.Run(() =>
            {
                List<Core.DBModels.InvMarketGroup> targetroups = new List<Core.DBModels.InvMarketGroup>();
                var ids = SelectedInvMarketGroups.Select(p => p.MarketGroupID).ToHashSet2();


0 = HEAP32[$29>>2]|0;
 HEAP32[7056>>2] = ((8832 + 12|0));
 HEAP32[((7056 + 4|0))>>2] = ((8832 + 32|0));
 $31 = (7056 + ($10)|0);
 __THREW__ = 0;
 invoke_vii(392,($31|0),($30|0));
 $32 = __THREW__; __THREW__ = 0;
 $33 = $32&1;
 if ($33) {
  $34 = ___cxa_find_matching_catch()|0;
  $35 = tempRet0;
  __ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev(((7056 + 4|0)));
  ___resumeException($34|0);
  // unreachable;
 }
 $36 = (7056 + ($$sum$i1)|0);
 HEAP32[$36>>2] = 0;
 $37 = (7056 + ($$sum1$i2)|0);
 HEAP32[$37>>2] = -1;
 $38 = HEAP32[6792>>2]|0;
 $39 = (($38) + -12|0);
 $40 = HEAP32[$39>>2]|0;
 $$sum19 = (($40) + 72)|0;
 $41 = (6792 + ($$sum19)|0);
 HEAP32[$41>>2] = 6880;
 $42 = HEAP32[6968>>2]|0;
 $43 = (($42) + -12|0);
 $44 = HEAP32[$43>>2]|0;
 $$sum20 = (($44) + 4)|0;
 $45 = (6968 + ($$sum20)|0);
 $46 = HEAP32[$45>>2]|0;
 $47 = $46 | 8192;
 HEAP32[$45>>2] = $47;
 $48 = HEAP32[6968>>2]|0;
 $49 = (($48) + -12|0);
 $50 = HEAP32[$49>>2]|0;
 $$sum21 = (($50) + 72)|0;
 $51 = (6968 + ($$sum21)|0);
 HEAP32[$51>>2] = 6880;
 __ZNSt3__110__stdinbufIwEC2EP8_IO_FILEP11__mbstate_t(7704,$0,((7560 + 24|0)));
 HEAP32[7144>>2] = ((8792 + 12|0));
 HEAP32[((7144 + 8|0))>>2] = ((8792 + 32|0));
 HEAP32[((7144 + 4|0))>>2] = 0;
 $52 = HEAP32[8792>>2]|0;
 $53 = (7144 + ($52)|0);
 __THREW__ = 0;
 invoke_vii(392,($53|0),(7704|0));
 $54 = __THREW__; __THREW__ = 0;
 $55 = $54&1;
 if ($55) {
  $56 = ___cxa_find_matching_catch()|0;
  $57 = tempRet0;
  __ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev(((7144 + 8|0)));
  ___resumeException($56|0);
  // unreachable;
 }
 $$sum$i9 = (($52) + 72)|0;
 $58 = (7144 + ($$sum$i9)|0);
 HEAP32[$58>>2] = 0;
 $$sum1$i10 = (($52) + 76)|0;
 $59 = (7144 + ($$sum1$i10)|0);
 HEAP32[$59>>2] = -1;
 __ZNSt3__111__stdoutbufIwEC2EP8_IO_FILEP11__mbstate_t(7760,$9,((7560 + 32|0)));
 HEAP32[7232>>2] = ((8872 + 12|0));
 HEAP32[((7232 + 4|0))>>2] = ((8872 + 32|


tBufRef(&[])
    }

    pub fn end(&self) -> *const T {
        unsafe { self.as_ptr().offset(self.len().try_into().unwrap()) }
    }

    pub fn with_start(&self, new_start: *const T) -> ExpatBufRef<'a, T> {
        if new_start < self.as_ptr() || new_start > self.end() {
            panic!("Attempted to move the start of an ExpatBufRef to an invalid pointer: {:?}", new_start);
        }
        ExpatBufRef::new(new_start, self.end())
    }

    pub fn with_end(&self, new_end: *const T) -> ExpatBufRef<'a, T> {
        if new_end < self.as_ptr() || new_end > self.end() {
            panic!("Attempted to move the end of an ExpatBufRef to an invalid pointer: {:?}", new_end);
        }
        ExpatBufRef::new(self.0.as_ptr(), new_end)
    }

    pub fn with_len(&self, len: usize) -> ExpatBufRef<'a, T> {
        if len > self.len() {
            panic!("Attempted to expand an ExpatBufRef to lenth: {:?}", len);
        }
        ExpatBufRef(&self.0[..len])
    }

    pub fn inc_start(&self, offset: isize) -> ExpatBufRef<'a, T> {
        if offset < 0 {
            panic!("Attempted to decrement the start of an ExpatBufRef");
        }
        if offset as usize > self.len() {
            panic!("Attempted to increment the start of an ExpatBufRef by too much: {:?}", offset);
        }
        ExpatBufRef(&self.0[(offset as usize)..])
    }

    pub fn dec_end(&self, offset: usize) -> ExpatBufRef<'a, T> {
        if offset > self.len() {
            panic!("Attempted to decrement the end of an ExpatBufRef by too much: {:?}", offset);
        }
        ExpatBufRef(&self.0[..(self.len() - offset)])
    }
}

impl<'a, T> ops::Deref for ExpatBufRef<'a, T> {
    type Target = &'a [T];

    fn deref(&self) -> &&'a [T] {
        &self.0
    }
}

impl<'a, T> From<&'a [T]> for ExpatBufRef<'a, T> {
    fn from(s: &'a [T]) -> ExpatBufRef<'a, T> {
        ExpatBufRef(s)
    }
}

impl<'a> From<ExpatBufRef<'a, c_char>> for ExpatBufRef<'a, c_ushort> {
    fn from(s: ExpatBufRef<'a, c_char>) -> ExpatBufRef<'a, c_ushort> {
        ExpatBufRef::new(s.as_ptr() as *const c_ushort, s.end() as *const c_ushort)
    }
}

#[derive(Debug)]
pub struct ExpatBufRefMut<'a, T = c_char>(&'a mut [T]);
impl<'a, T> ExpatBufRefMut<'a, T> {
    pub fn new<'new>(start: *mut T, end: *mut T) -> ExpatBufRefMut<'new, T> {
        unsafe { ExpatBufRefMut(std::slice::from_raw_parts_mut(start, end.wrapping_offset_from(start) as usize)) }
    }
    pub fn new_len<'new>(start: *mut T, len: usize) -> ExpatBufRefMut<'new, T> {
        unsafe { ExpatBufRefMut(std::slice::from_raw_parts_mut(start, len)) }
    }
    pub fn empty<'new>() -> ExpatBufRefMut<'new, T> {
        ExpatBufRefMut(&mut [


w;
        }
    }

    /** Lisab sappa lüli koopia
     *
     * @param lyli Selles koopia sappa
     */
    void LisaSappaKoopia(const LYLI_TMPL<S_TYYP, C_TYYP> &lyli)
    {
        LYLI_TMPL<S_TYYP, C_TYYP> *pLyli = TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::AddPlaceHolder(); // lisame sappa
        try
        {
            pLyli->Start(lyli); // initsialiseerime
        }
        catch (...)
        {
            TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::Del(); // nässus, kustutame
            throw;
        }
    }

    /** Sõna ahelas sappa
     *
     * @param pStr
     * @param _lipp_
     * @param id
     */
    void LisaSonaSappa(const C_TYYP *pStr,
                       const LYLI_FLAGS_BASE_TYPE _lipp_ = PRMS_SONA,
                       const int id = -1)
    {
        LYLI_TMPL<S_TYYP, C_TYYP> *pLyli = TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::AddPlaceHolder(); // lisame sappa
        try
        {
            pLyli->Start(pStr, _lipp_, id); // initsialiseerime
        }
        catch (...)
        {
            TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::Del(); // nässus, kustutame
            throw;
        }
    }

    bool EmptyClassInvariant(void) const
    {
        return
            ahelaLipp == 0;
    }

    bool ClassInvariant(void) const
    {
        return
            TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::ClassInvariant();
    }

private:

    void InitClassVariables(void)
    {
        ahelaLipp = 0;
        TMPLPTRARRAY<LYLI_TMPL<S_TYYP, C_TYYP> >::Start(0, 10);
    }

    // Need kuulutame illegaalseteks-{{

    /// Illegaalne

    AHEL2_TMPL(const AHEL2_TMPL&)
    {
        assert(false);
    }

    /// illegaalne

    AHEL2_TMPL & operator=(const AHEL2_TMPL&)
    {
        assert(false);
        return *this;
    }
    // }}-Need kuulutame illegaalseteks
};

typedef AHEL2_TMPL<FSXSTRING, FSWCHAR> AHEL2;
typedef AHEL2_TMPL<PCFSAString, char > AHEL2_UTF8;

#endif


  </dependency>

  <!-- SpringBoot Web -->
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
  </dependency>

  <!-- Spring Security -->
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
  </dependency>

</dependencies>
```
## 添加配置
配置有独立服务配置和 Nacos 共享配置以及微服务 Nacos 配置，三份配置共同作用于微服务系统，其中优先级顺序是Nacos 共享配置>微服务 Nacos 配置>独立服务配置

对于每个微服务都需要的配置放在共享配置中，本次这部分不做改动，另外是微服务的 Nacos 配置和本地配置如下：

本地配置：bootstrap.yml
```yaml
# Tomcat
server:
  port: 端口

# Spring
spring:
  application:
    # 应用名称
    name: monitor
  profiles:
    # 环境配置
    active: dev
  cloud:
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 127.0.0.1:端口
      config:
        # 配置中心地址
        server-addr: 127.0.0.1:端口
        # 配置文件格式
        file-extension: yml
        # 共享配置
        shared-configs:
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
```

Nacos 配置：monitor-dev.yml
```yaml
# spring
spring:
  security:
    user:
      name: web页面中的用户名
      password: 密码
  boot:
    admin:
      ui:
        title: 服务状态监控
```

通过以上步骤直接访问微服务地址即可直接访问，这里监控中心的微服务没有直接走网关，而是直接暴露出来，因为其内部自己做了鉴权处理，就不走网关通用鉴权了。
# 监控有用功能
## web ui 页面
在 UI 页面上可以清晰的看出服务系统的情况，方便直观，而且耦合性比较低。以下是我项目的监控情况：

![服务监控应用墙](https://cdn.nlark.com/yuque/0/2024/png/29495295/1715910693827-106b9d6f-9876-4ee2-b98d-ee7ac874808f.png#averageHue=%233a4f46&clientId=ud7e406f0-a820-4&from=paste&height=454&id=uce6657fd&originHeight=908&originWidth=1907&originalType=binary&ratio=2&rotation=0&showTitle=true&size=187467&status=done&style=none&taskId=ua151b768-a780-496c-80cf-73fac06498f&title=%E6%9C%8D%E5%8A%A1%E7%9B%91%E6%8E%A7%E5%BA%94%E7%94%A8%E5%A2%99&width=953.5 "服务监控应用墙")

点进去每一个微服务可看到具体监控信息：

![单个微服务监控详情](https://cdn.nlark.com/yuque/0/2024/png/29495295/1715910746564


itietthongbaoModel, chitietthongbaoAttributes> {}

 type ChitietthongbaoStatic = typeof Model & {
    new (values?: object, options?: BuildOptions): chitietthongbaoModel;
};

export function chitietthongbao (sequelize: Sequelize): ChitietthongbaoStatic {
    return <ChitietthongbaoStatic>sequelize.define("chitietthongbao", {
        id: {
            type: DataType.INTEGER,
            primaryKey: true,
            allowNull: false,
            unique: true,
            autoIncrement: true
          },
          idUser:{
            type:DataType.NUMBER,
            allowNull:false
          },
          idThongBao:{

           type: DataType.NUMBER,
           allowNull:false
        },
          status:{
              type:DataType.BOOLEAN
          }
    },{
        timestamps:false,
        tableName:"chitietthongbao"
    }
    );
}export interface SearchOption {
    id: SearchOptionEnum;
    name: string;
}

export enum SearchOptionEnum {
    Default = 1,
    FromCache = 2,
    Greedy = 3
}import * as path from 'path'
import { trace } from './logger'
import { Options } from './arkit'
import { ComponentSchema, ConfigSchema, OutputSchema } from './schema'

const DEFAULT_COMPONENTS: ComponentSchema = {
  type: 'Component',
  patterns: ['**/*.ts', '**/*.js', '**/*.jsx', '**/*.tsx']
}

export const DEFAULT_CONFIG: ConfigSchema = {
  components: DEFAULT_COMPONENTS,
  excludePatterns: ['node_modules/**', 'test/**', 'tests/**', '**/*.test.*', '**/*.spec.*'],
  output: {}
}

export class Config {
  directory: string
  components: ComponentSchema[]
  outputs: OutputSchema[]
  patterns: string[] = []
  excludePatterns: string[] = []
  extensions = ['.js', '.ts', '.jsx', '.tsx']

  constructor (options: Options) {
    this.directory = options.directory
    const userConfigPath = path.join(this.directory, 'arkit')
    const userConfig = this.safeRequire<ConfigSchema>(userConfigPath)

    this.components = this.array(userConfig && userConfig.components) || []

    if (!this.components.length) {
      this.components.push(DEFAULT_COMPONENTS)
    }

    this.outputs = this.getOutputs(options, userConfig)

    if (userConfig && userConfig.excludePatterns) {
      this.excludePatterns.push(...userConfig.excludePatterns)
    } else if (!userConfig && DEFAULT_CONFIG.excludePatterns) {
      this.excludePatterns.push(...DEFAULT_CONFIG.excludePatterns)
    }

    for (const component of this.components) {
      if (component.patterns) {
        this.patterns.push(...component.patterns)
      }
      if (component.excludePatterns) {
        this.excludePatterns.push(...component.excludePatterns)
      }
    }
  }

  getOutputs (options: Options, userConfig?: ConfigSchema): OutputSchema[] {
    const generatedSchema:


i.Client)
		}
	}

	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// NewClientCreator creates a new instance of ClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewClientCreator(t interface {
	mock.TestingT
	Cleanup(func())
}) *ClientCreator {
	mock := &ClientCreator{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
// Code generated by mockery. DO NOT EDIT.

package mocks

import (
	context "context"

	abcicli "github.com/cometbft/cometbft/abci/client"

	mock "github.com/stretchr/testify/mock"

	types "github.com/cometbft/cometbft/abci/types"
)

// AppConnMempool is an autogenerated mock type for the AppConnMempool type
type AppConnMempool struct {
	mock.Mock
}

// CheckTx provides a mock function with given fields: _a0, _a1
func (_m *AppConnMempool) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
	ret := _m.Called(_a0, _a1)

	if len(ret) == 0 {
		panic("no return value specified for CheckTx")
	}

	var r0 *types.ResponseCheckTx
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok {
		return rf(_a0, _a1)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.ResponseCheckTx)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// CheckTxAsync provides a mock function with given fields: _a0, _a1
func (_m *AppConnMempool) CheckTxAsync(_a0 context.Context, _a1 *types.RequestCheckTx) (*abcicli.ReqRes, error) {
	ret := _m.Called(_a0, _a1)

	if len(ret) == 0 {
		panic("no return value specified for CheckTxAsync")
	}

	var r0 *abcicli.ReqRes
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*abcicli.ReqRes, error)); ok {
		return rf(_a0, _a1)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *abcicli.ReqRes); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*abcicli.ReqRes)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Error


ds(s)
	if len(parts) > 3 || len(parts) == 0 {
		return d, newInvalidSQLDurationError(s)
	}
	// Index of which part(s) have been parsed for detecting bad order such as `HH:MM:SS Year-Month`.
	parsedIdx := nothingParsed
	// Both 'Day' and 'Second' can be float, but 'Day Second'::interval is invalid.
	floatParsed := false
	// Parsing backward makes it easy to distinguish 'Day' and 'Second' when encountering a single value.
	//   `1-2 5 9:` and `1-2 5`
	//        |              |
	// day ---+              |
	// second ---------------+
	for i := len(parts) - 1; i >= 0; i-- {
		// Parses leading sign
		part := parts[i]

		consumeNeg := func(str string) (newStr string, mult int64, ok bool) {
			neg := false
			// Consumes [-+]
			if str != "" {
				c := str[0]
				if c == '-' || c == '+' {
					neg = c == '-'
					str = str[1:]
				}
			}
			if len(str) == 0 {
				return str, 0, false
			}
			if str[0] == '-' || str[0] == '+' {
				return str, 0, false
			}

			mult = 1
			if neg {
				mult = -1
			}
			return str, mult, true
		}

		var mult int64
		var ok bool
		if part, mult, ok = consumeNeg(part); !ok {
			return d, newInvalidSQLDurationError(s)
		}

		if strings.ContainsRune(part, ':') {
			// Try to parse as HH:MM:SS
			if parsedIdx != nothingParsed {
				return d, newInvalidSQLDurationError(s)
			}
			parsedIdx = hmsParsed
			// Colon-separated intervals in Postgres are odd. They have day, hour,
			// minute, or second parts depending on number of fields and if the field
			// is an int or float.
			//
			// Instead of supporting unit changing based on int or float, use the
			// following rules:
			// - If there is a float at the front, it represents D:(<apply below rules).
			// - Two fields is H:M or M:S.fff (unless using MINUTE TO SECOND, then M:S).
			// - Three fields is H:M:S(.fff)?.
			hms := strings.Split(part, ":")

			// If the first element is blank or is a float, it represents a day.
			// Take it to days, and simplify logic below to a H:M:S scenario.
			firstComponentIsFloat := strings.Contains(hms[0], ".")
			if firstComponentIsFloat || hms[0] == "" {
				// Negatives are not permitted in this format.
				// Also, there must be more units in front.
				if mult != 1 || len(hms) == 1 {
					return d, newInvalidSQLDurationError(s)
				}
				if firstComponentIsFloat {
					days, err := strconv.ParseFloat(hms[0], 64)
					if err != nil {
						return d, newInvalidSQLDurationError(s)
					}
					d = d.Add(duration.MakeDuration(0, 1, 0).MulFloat(days))
				}

				hms = hms[1:]
				if hms[0], mult, ok = consumeNeg(hms[0]); !ok {
					return d, newInvalidSQLDurationError(s)
				}
			}

			// Postgres fills in the blanks of all H:M:S as if they were zero.
			for i := 0; i < len(hms); i++ {
				if hms[i]


118.351014, 33.887908],
    'pop': 29576,
    'state': 'CA'
  },
  {
    '_id': '90262',
    'city': 'LYNWOOD',
    'loc': [-118.201289, 33.924076],
    'pop': 61606,
    'state': 'CA'
  },
  {
    '_id': '90265',
    'city': 'MALIBU',
    'loc': [-118.735149, 34.040184],
    'pop': 17850,
    'state': 'CA'
  },
  {
    '_id': '90266',
    'city': 'MANHATTAN BEACH',
    'loc': [-118.399562, 33.889594],
    'pop': 31984,
    'state': 'CA'
  },
  {
    '_id': '90270',
    'city': 'MAYWOOD',
    'loc': [-118.187685, 33.988992],
    'pop': 27801,
    'state': 'CA'
  },
  {
    '_id': '90272',
    'city': 'PACIFIC PALISADE',
    'loc': [-118.536874, 34.054097],
    'pop': 20984,
    'state': 'CA'
  },
  {
    '_id': '90274',
    'city': 'PALOS VERDES EST',
    'loc': [-118.374763, 33.770094],
    'pop': 60381,
    'state': 'CA'
  },
  {
    '_id': '90277',
    'city': 'REDONDO BEACH',
    'loc': [-118.383221, 33.830656],
    'pop': 33102,
    'state': 'CA'
  },
  {
    '_id': '90278',
    'city': 'REDONDO BEACH',
    'loc': [-118.371459, 33.870654],
    'pop': 34873,
    'state': 'CA'
  },
  {
    '_id': '90280',
    'city': 'SOUTH GATE',
    'loc': [-118.201349, 33.94617],
    'pop': 87026,
    'state': 'CA'
  },
  {
    '_id': '90290',
    'city': 'TOPANGA',
    'loc': [-118.602268, 34.10759],
    'pop': 5430,
    'state': 'CA'
  },
  {
    '_id': '90291',
    'city': 'VENICE',
    'loc': [-118.463463, 33.993772],
    'pop': 32987,
    'state': 'CA'
  },
  {
    '_id': '90292',
    'city': 'MARINA DEL REY',
    'loc': [-118.452475, 33.977876],
    'pop': 16572,
    'state': 'CA'
  },
  {
    '_id': '90293',
    'city': 'PLAYA DEL REY',
    'loc': [-118.437314, 33.957745],
    'pop': 11477,
    'state': 'CA'
  },
  {
    '_id': '90301',
    'city': 'INGLEWOOD',
    'loc': [-118.355575, 33.955048],
    'pop': 36481,
    'state': 'CA'
  },
  {
    '_id': '90302',
    'city': 'INGLEWOOD',
    'loc': [-118.354805, 33.974496],
    'pop': 28681,
    'state': 'CA'
  },
  {
    '_id': '90303',
    'city': 'INGLEWOOD',
    'loc': [-118.332058, 33.937691],
    'pop': 26418,
    'state


	ID:     p.ID,
						Hash:   p.Hash,
						Status: DownloadedResourcePackResponseStatus,
					})
					if err != nil {
						return fmt.Errorf("error sending downloaded resource pack response: %w", err)
					}
				}
				err = mcConn.WritePacket(&packet.ResourcePackResponse{
					ID:     p.ID,
					Hash:   p.Hash,
					Status: SuccessfulResourcePackResponseStatus,
				})
				if err != nil {
					return fmt.Errorf("error sending successful resource pack response: %w", err)
				}
			}
			if modifiedPack {
				log.Info("A plugin has tried to modify a ResourcePack provided by the backend server " +
					"with a ResourcePack already applied, the applying of the resource pack will be skipped.")
			}
		} else {
			err = serverConn.player.resourcePackHandler.QueueResourcePack(&toSend)
			if err != nil {
				return fmt.Errorf("error queuing resource pack: %w", err)
			}
		}
	} else if smc, ok := serverConn.ensureConnected(); ok {
		err = smc.WritePacket(&packet.ResourcePackResponse{
			ID:     p.ID,
			Hash:   p.Hash,
			Status: DeclinedResourcePackResponseStatus,
		})
		if err != nil {
			return err
		}
	}
	return nil
}

func (b *backendPlaySessionHandler) handleRemoveResourcePack(p *packet.RemoveResourcePack) {
	handler := b.serverConn.player.resourcePackHandler
	if p.ID != uuid.Nil {
		handler.Remove(p.ID)
	} else {
		handler.ClearAppliedResourcePacks()
	}
	b.forwardToPlayer(nil, p)
}

func (b *backendPlaySessionHandler) handleTransfer(p *packet.Transfer) {
	handleTransfer(p, b.serverConn.player, b.log, b.proxy().Event())
}
func handleTransfer(p *packet.Transfer, player Player, log logr.Logger, mgr event.Manager) {
	originalAddr, err := p.Addr()
	if err != nil {
		log.Error(err, "error getting address from Transfer packet received from Backend Server in Play State")
		return
	}
	event.FireParallel(mgr, newPreTransferEvent(player, originalAddr), func(e *PreTransferEvent) {
		if e.Allowed() {
			resultedAddr := e.Addr()
			if resultedAddr == nil {
				resultedAddr = originalAddr
			}
			host, port := netutil.HostPort(resultedAddr)
			err = player.WritePacket(&packet.Transfer{
				Host: host,
				Port: int(port),
			})
			if err != nil {
				log.V(1).Error(err, "error sending Transfer packet to player")
			}
		}
	})
}

func (b *backendPlaySessionHandler) handleLegacyPlayerListItem(p *legacytablist.PlayerListItem, pc *proto.PacketContext) {
	if err := b.serverConn.player.tabList.ProcessLegacy(p); err != nil {
		b.log.Error(err, "error processing backend LegacyPlayerListItem packet, ignored")
	}
	b.forwardToPlayer(pc, nil)
}

func (b *backendPlaySessionHandler) handleUpsertPlayerInfo(p *playerinfo.Upsert, pc *proto.PacketContext) {
	if err := b.serverConn.player.tabList.ProcessUpdate(p); err != nil {
		b.log.Error(err, "error processing backend UpsertPlayerInfo packet, ignored")
	}
	b.forwardToPlayer(pc, nil)
}

func (b *backendPlaySessionHandler) handleRemovePlayerInfo(p *playerinfo.Remove, pc *proto.PacketContext) {
	b.serverConn.player.tabList.ProcessRemove(p)
	b.forwardToPlayer(pc, nil)
}

func (b *backendPlaySessionHandler) handleAva


on of this software is strictly
// prohibited and may be subject to legal action.
//
// For full licensing terms, please visit:
//
// https://oidc.abblix.com/license
//
// CONTACT: For license inquiries or permissions, contact Abblix LLP at
// info@abblix.com

using System.Security.Claims;
using Abblix.Oidc.Server.Model;

namespace Abblix.Oidc.Server.Endpoints.Authorization.Interfaces;

/// <summary>
/// Means that a current user is logged in, but some additional interaction with him is to continue
/// </summary>
public record InteractionRequired(AuthorizationRequest Model, ClaimsPrincipal User)
    : AuthorizationResponse(Model);


private messageService: MessageService) { }

  ngOnInit(): void {
    this.doctor = new Doctor();
  }

/**
   * Store a Doctor to backend server
   */
 save() {
  this.doctorService.createDoctor(this.doctor)
        .subscribe((message: Message) => {
          console.log(message);
          let doctor = message.doctors[0];
          let msg = "Success -> Post a Doctor: "
              + "
"
                  + "
id: " + doctor.id + "
"
                  + "
firstname: " + doctor.firstname + "
"
                  + "
lastname: " + doctor.lastname + "
"
                  + "
age: " + doctor.age + "
"
                  + "
address: " + doctor.email + "
"
              + "
";

          this.messageService.add(msg);
        }, error => {
          console.log(error);
          let msg = "Error! -> Action Posting a Doctor:"
                    + "
"
                      + "
id = " + this.doctor.id + "
"
                      + "
firstname = " + this.doctor.firstname + "
"
                      + "
lastname = " + this.doctor.lastname + "
"
                      + "
age = " + this.doctor.age + "
"
                      + "
address = " + this.doctor.email + "
"
                    + "
";

          this.messageService.add(msg);
        });
}

reset(){
  this.doctor = new Doctor();
}

/**
   * Function handles form submitting
   */
 onSubmit() {
  this.save();
  this.reset();
}

}
import { Model } from './Model';

/**
 * Scope Options for Model.scope
 */
export interface ScopeOptions<ScopeNames> {
  /**
   * The scope(s) to apply. Scopes can either be passed as consecutive arguments, or as an array of arguments.
   * To apply simple scopes and scope functions with no arguments, pass them as strings. For scope function,
   * pass an object, with a `method` property. The value can either be a string, if the method does not take
   * any arguments, or an array, where the first element is the name of the method, and consecutive elements
   * are arguments to that method. Pass null to remove all scopes, including the default.
   */
  method: ScopeNames | readonly [ScopeNames, ...unknown[]];
}
class StringHelpers {
    trimStart(character: string, string: string) : string {
        var startIndex = 0;

        while (string[startIndex] === character) {
            startIndex++;
        }

        return string.substr(startIndex);
    }

    parseMySqlDate(date: string) : Date {
        let split = date.split(/[- :]/);
        return new Date(Date.UTC(+split[0], +split[1] - 1, +split[2], +split[3] || 0, +split[4] || 0, +split[5] || 0));
    }

    getTimeDiff(from: Date, to: Date) : string {
        let elapsed = (to.getTime() - from.getTime()) / 1000;
        let years = elapsed / 31557600;
        if (years >= 1) {
            return Math.trunc(years) + ' year' + (years >= 2 ? 's' : '');
        }
        let months = elapsed / 2629800;
        if (months >= 1) {
            return Math.trunc(months) + ' month' + (months >= 2 ? 's' : '');
        }
        let days = elapsed / 86400;
        if (days >= 1) {
            return Math.trunc(days) + ' day' + (days >= 2 ? 's' : '');
        }
        let hours = elapsed / 3600;
        if (hours >= 1) {
            return Math.trunc(hours) + ' hour' + (hours >= 2 ? 's' : '');
        }
        let minutes = elapsed / 60;


el D_80A11934
    .asciz "../z_en_fhg_fire.c"
    .balign 4

glabel D_80A11948
    .asciz "yari hikari draw 1\n"
    .balign 4

glabel D_80A1195C
    .asciz "../z_en_fhg_fire.c"
    .balign 4

glabel D_80A11970
    .asciz "../z_en_fhg_fire.c"
    .balign 4

glabel D_80A11984
    .asciz "FF DRAW 1\n"
    .balign 4

glabel D_80A11990
    .asciz "../z_en_fhg_fire.c"
    .balign 4

glabel D_80A119A4
    .asciz "FF DRAW 2\n"
    .balign 4

glabel D_80A119B0
    .asciz "../z_en_fhg_fire.c"
    .balign 4

glabel D_80A119C4
 .word 0x3E051EB8
glabel D_80A119C8
 .word 0x4622F983
glabel D_80A119CC
 .word 0x4622F983
glabel D_80A119D0
 .word 0xBE4CCCCD
glabel D_80A119D4
 .word 0x469C4000
glabel D_80A119D8
 .word 0xBDA3D70A
glabel D_80A119DC
 .word 0x469C4000
glabel D_80A119E0
 .word 0xBDA3D70A
glabel D_80A119E4
 .word 0x4622F983
glabel D_80A119E8
 .word 0x4622F983
glabel D_80A119EC
 .word 0x4622F983
glabel D_80A119F0
 .word 0x4622F983
glabel D_80A119F4
 .word 0x4622F983
glabel D_80A119F8
 .word 0x4622F983
glabel D_80A119FC
 .word 0x4622F983
glabel D_80A11A00
 .word 0xBDCCCCCD
glabel D_80A11A04
 .word 0x40490FF9, 0x00000000, 0x00000000


evel prefetch APIs.)
 */
#ifdef USE_POSIX_FADVISE
#define USE_PREFETCH
#endif

/*
 * This is the default directory in which AF_UNIX socket files are
 * placed.	Caution: changing this risks breaking your existing client
 * applications, which are likely to continue to look in the old
 * directory.  But if you just hate the idea of sockets in /tmp,
 * here's where to twiddle it.  You can also override this at runtime
 * with the postmaster's -k switch.
 */
#define DEFAULT_PGSOCKET_DIR  "/tmp"

/*
 * The random() function is expected to yield values between 0 and
 * MAX_RANDOM_VALUE.  Currently, all known implementations yield
 * 0..2^31-1, so we just hardwire this constant.  We could do a
 * configure test if it proves to be necessary.  CAUTION: Think not to
 * replace this with RAND_MAX.	RAND_MAX defines the maximum value of
 * the older rand() function, which is often different from --- and
 * considerably inferior to --- random().
 */
#define MAX_RANDOM_VALUE  (0x7FFFFFFF)

/*
 * Set the format style used by gcc to check printf type functions. We really
 * want the "gnu_printf" style set, which includes what glibc uses, such
 * as %m for error strings and %lld for 64 bit long longs. But not all gcc
 * compilers are known to support it, so we just use "printf" which all
 * gcc versions alive are known to support, except on Windows where
 * using "gnu_printf" style makes a dramatic difference. Maybe someday
 * we'll have a configure test for this, if we ever discover use of more
 * variants to be necessary.
 */
#ifdef WIN32
#define PG_PRINTF_ATTRIBUTE gnu_printf
#else
#define PG_PRINTF_ATTRIBUTE printf
#endif

/*
 *------------------------------------------------------------------------
 * The following symbols are for enabling debugging code, not for
 * controlling user-visible features or resource limits.
 *------------------------------------------------------------------------
 */

/*
 * Define this to cause pfree()'d memory to be cleared immediately, to
 * facilitate catching bugs that refer to already-freed values.
 * Right now, this gets defined automatically if --enable-cassert.
 */
#ifdef USE_ASSERT_CHECKING
#define CLOBBER_FREED_MEMORY
#endif

/*
 * Define this to check memory allocation errors (scribbling on more
 * bytes than were allocated).	Right now, this gets defined
 * automatically if --enable-cassert.
 */
#ifdef USE_ASSERT_CHECKING
#define MEMORY_CONTEXT_CHECKING
#endif

/*
 * Define this to cause palloc()'d memory to be filled with random data, to
 * facilitate catching code that depends on the contents of uninitialized
 * memory.	Caution: this is horrendously expensive.
 */
/* #define RANDOMIZE_ALLOCATED_MEMORY */

/*
 * Define this to force all parse and plan trees to be passed through
 * copyObject(), to facilitate catching errors and omissions in
 * copyObject().
 */
/* #define COPY_PARSE_PLAN_TREES */

/*
 * Enable debugging print statements for lock-related operations.
 */
/* #define LOCK_DEBUG */

/*
 * Enable debugging print statements for WAL-related operations; see
 * also the wal_debug GUC var.
 */
/* #define WAL_DEBUG */

/*
 * Enable tracing of resource consumption during sort operations;
 * see also the trace_sort GUC var.  For 8.1 this is enabled by default.
 */
#define TRACE_SORT 1

/*
 * Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
 */
/* #define TRACE_SYNCSCAN */

/*
 * Other debug #defines (documentation, anyone?)
 */
/* #define HEAPDEBUGALL */
/* #define ACLDEBUG */
/* #define RTDEBUG */


n(scope))
		// 不易混淆字符模式：重新生成字符
		if kind == 4 {
			result[i] = letters[rand.Intn(len(letters))]
		}
	}
	return result
}
package cmd

import (
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"path/filepath"
	"syscall"

	"github.com/afomera/spin/internal/config"
	"github.com/afomera/spin/internal/process"
	"github.com/spf13/cobra"
)

// logsCmd represents the logs command
var logsCmd = &cobra.Command{
	Use:   "logs [process-name]",
	Short: "View process logs",
	Long: `View the logs for a running process.
Shows the process output in real-time.

Example:
  spin logs web     # View web process logs
  spin logs worker  # View worker process logs`,
	Args: cobra.ExactArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		processName := args[0]

		// Load configuration
		cfg, err := config.LoadConfig("spin.config.json")
		if err != nil {
			fmt.Printf("Error loading configuration: %v\n", err)
			os.Exit(1)
		}

		// Get the process manager instance
		manager := process.GetManager(cfg)

		// Check if process exists
		if _, err := manager.GetProcessStatus(cfg.Name, processName); err != nil {
			fmt.Printf("Error: %v\n", err)
			os.Exit(1)
		}

		// Find the process to get its log file path
		proc, err := manager.FindProcess(processName)
		if err != nil {
			fmt.Printf("Error finding process: %v\n", err)
			os.Exit(1)
		}

		// Get spin directory
		home, err := os.UserHomeDir()
		if err != nil {
			fmt.Printf("Error getting home directory: %v\n", err)
			os.Exit(1)
		}

		// Use app-specific log directory
		logFile := filepath.Join(home, ".spin", "output", process.SanitizeAppName(proc.AppName), fmt.Sprintf("%s.log", proc.Name))

		// First show recent output
		tail := exec.Command("tail", "-n", "50", logFile)
		tail.Stdout = os.Stdout
		tail.Stderr = os.Stderr
		if err := tail.Run(); err != nil {
			fmt.Printf("Error showing recent logs: %v\n", err)
			os.Exit(1)
		}

		fmt.Println("\nShowing live logs (Ctrl+C to exit)...")

		// Set up signal handling
		sigChan := make(chan os.Signal, 1)
		signal.Notify(sigChan, syscall.SIGINT)
		defer signal.Stop(sigChan)

		// Start following output
		follow := exec.Command("tail", "-f", logFile)
		follow.Stdout = os.Stdout
		follow.Stderr = os.Stderr

		// Start the command
		if err := follow.Start(); err != nil {
			fmt.Printf("


lhs, rhs) => format!(
            "({} {})",
            print_expr(lhs.as_ref().clone(), layer),
            print_expr(rhs.as_ref().clone(), layer)
        ),
        Expr::Lambda(patterns) => format!(
            "(λ {{\n{}\n{}}})",
            patterns
                .into_iter()
                .map(|n| print_pattern(n, layer + 1))
                .collect::<Vec<_>>()
                .join("\n"),
            "\t".repeat(layer)
        ),
        Expr::Typed(expr, type_) => format!(
            "({} : {})",
            print_expr(expr.as_ref().clone(), layer),
            print_type(type_.as_ref().clone(), layer)
        ),
        Expr::Var(id) => print_ident(id),
    }
}

fn print_type(node: Type, layer: usize) -> String {
    match node {
        Type::Map(lhs, rhs) => format!(
            "({} → {})",
            print_type(lhs.as_ref().clone(), layer),
            print_type(rhs.as_ref().clone(), layer)
        ),
        Type::Sum(instances) => format!(
            "σ {{\n{}\n{}}}",
            instances
                .into_iter()
                .map(|n| print_instance(n, layer + 1))
                .collect::<Vec<_>>()
                .join("\n"),
            "\t".repeat(layer)
        ),
        Type::Var(id) => print_ident(id),
    }
}

fn print_instance(node: Instance, layer: usize) -> String {
    format!(
        "{}{} : {}",
        "\t".repeat(layer),
        print_ident(node.id),
        print_type(node.type_.as_ref().clone(), layer)
    )
}

fn print_pattern(node: Pattern, layer: usize) -> String {
    format!(
        "{}{} . {}",
        "\t".repeat(layer),
        print_expr(node.param.as_ref().clone(), layer),
        print_expr(node.expr.as_ref().clone(), layer)
    )
}

fn print_ident(ident: Ident) -> String {
    let Ident(string) = ident;

    return string;
}
use crate::Ray;
use cgmath::Point3;

/// Can be implemented by any 3d shape to allow ray-casting onto the shape
pub trait RayIntersect {
    /// Calculate the distance from the ray origin to the intersection point.
    ///
    /// Returns `None`, when the ray does not intersect the shape.
    /// Returns `Some(f)` when the ray intersects self.
    ///
    /// See [Self::cast_ray()] to get the intersection point by using [Ray::cast_distance]
    /// on the result
    fn ray_intersect(&self, ray: &Ray) -> Option<f32>;

    /// Returns `true` when `ray` intersects self.
    ///
    /// When the actual distance is not needed then this function should be used
    fn does_intersect(&self, ray: &Ray) -> bool {
        self.ray_intersect(ray).is_some()
    }

    /// Calculate the intersection point of self with `ray`
    ///
    /// Returns None when the ray does not intersect `self`
    #[inline]
    fn ray_intersection_point(&self, ray: &Ray) -> Option<Point3<f32>> {
        self.ray_intersect(ray).map(|d| ray.cast_distance(d))
    }
}
<gh_stars>10-100
//! # xrust::qname
//!
//! Support for Qualified Names.

use core::hash::{Hash, Hasher};


.wrapper.annotation.DefaultDomain
import rxhttp.wrapper.annotation.Domain
import rxhttp.wrapper.annotation.OkClient
import rxhttp.wrapper.annotation.Param
import rxhttp.wrapper.annotation.Parser

/**
 * User: ljx
 * Date: 2021/10/8
 * Time: 16:31
 */
class KspProcessor(private val env: SymbolProcessorEnvironment) : SymbolProcessor {

    private var processed: Boolean = false
    private var androidPlatform = true

    @KspExperimental
    override fun process(resolver: Resolver): List<KSAnnotated> {
        val logger = env.logger
        val options = env.options
        val codeGenerator = env.codeGenerator
        isKps2 = env.kspVersion.toString().versionCompare("2.0.0") >= 0

        val debug = options[rxhttp_debug].toBoolean()
        if (debug) {
            logger.warn(
                "LJX process getAllFiles.size=${resolver.getAllFiles().toList().size} " +
                        "newFiles.size=${resolver.getNewFiles().toList().size}"
            )
        }
        androidPlatform = (options[rxhttp_android_platform] ?: "true").toBoolean()
        if (processed) return emptyList()
        processed = true

        rxHttpPackage = options[rxhttp_package] ?: defaultPackageName
        initRxJavaVersion(options[rxhttp_rxjava])

        ClassHelper().generatorStaticClass(codeGenerator)
        KClassHelper(androidPlatform).generatorStaticClass(codeGenerator)

        if (resolver.getAllFiles().toList().isEmpty()) {
            return emptyList()
        }

        val rxHttpWrapper = RxHttpWrapper(logger)

        val domainVisitor = DomainVisitor(resolver, logger)
        resolver.getSymbolsWithAnnotation(Domain::class.java.name).forEach {
            if (it is KSPropertyDeclaration) {
                it.accept(domainVisitor, Unit)
                rxHttpWrapper.addDomain(it)
            }
        }

        val defaultDomainVisitor = DefaultDomainVisitor(resolver, logger)
        resolver.getSymbolsWithAnnotation(DefaultDomain::class.java.name).forEach {
            if (it is KSPropertyDeclaration) {
                it.accept(defaultDomainVisitor, Unit)
            }
        }

        val okClientVisitor = OkClientVisitor(resolver, logger)
        resolver.getSymbolsWithAnnotation(OkClient::class.java.name).forEach {
            if (it is KSPropertyDeclaration) {
                it.accept(okClientVisitor, Unit)
                rxHttpWrapper.addOkClient(it)
            }
        }

        val converterVisitor = ConverterVisitor(resolver, logger)
        resolver.getSymbolsWithAnnotation(Converter::class.java.name).forEach {
            if (it is KSPropertyDeclaration) {
                it.accept(converterVisitor, Unit)
                rxHttpWrapper.addConverter(it)
            }
        }

        val parserVisitor = ParserVisitor(resolver, logger)
        resolver.getSymbolsWithAnnotation(Parser::class.java.name).forEach {
            if (it is KSClassDeclaration) {
                it.accept(parserVisitor, Unit)
            }
        }

        val paramsVisitor = ParamsVisitor(logger, resolver)
        resolver.getSymbolsWithAnnotation(Param::class.java.name).forEach {
            if (it is KSClassDeclaration) {
                it.accept(paramsVisitor, Unit)
                rxHttpWrapper.add(it)
            }
        }
        rxHttpWrapper.generateRxWrapper(codeGenerator)

        //取第一个源文件做为输出文件的关联文件(如果有使用注解，则忽略该变量)
        //以修复https://github.com/liujingxing/rxhttp/issues/489提到的bug
        va


ent('C2');
    ClassElement D1 = env.getElement('D1');
    ClassElement D2 = env.getElement('D2');
    ClassElement E1 = env.getElement('E1');
    ClassElement E2 = env.getElement('E2');
    ClassElement F1 = env.getElement('F1');
    ClassElement F2 = env.getElement('F2');

    ClassElement C1_A_B = C1.superclass;
    ClassElement D1_A_B = D1.superclass;
    ClassElement E1_A_B = E1.superclass;
    ClassElement F1_A_B = F1.superclass;

    void testSupertypes(ClassElement element,
                        Map<ClassElement, List<DartType>> typeArguments) {
      if (element != Object) {
        Expect.isTrue(element.typeVariables.length == 1);
        Expect.equals(element,
                      element.typeVariables.first.element.enclosingElement);
      }
      for (InterfaceType supertype in element.allSupertypesAndSelf.types) {
        if (typeArguments.containsKey(supertype.element)) {
          Expect.listEquals(typeArguments[supertype.element],
                            supertype.typeArguments,
              "Type argument mismatch on supertype $supertype of $element.");
        } else if (!supertype.typeArguments.isEmpty) {
          Expect.listEquals(element.typeVariables, supertype.typeArguments,
              "Type argument mismatch on supertype $supertype of $element.");
        } else {
          Expect.equals(Object, supertype.element);
        }
      }
    }

    testSupertypes(C1, {A: [_dynamic], B: [_dynamic, _dynamic]});
    testSupertypes(C1.superclass, {A: [_dynamic], B: [_dynamic, _dynamic]});
    testSupertypes(C2, {A: [_dynamic], B: [_dynamic, _dynamic]});

    DartType D1_T = D1.typeVariables.first;
    testSupertypes(D1, {A: [D1_T], B: [D1_T, instantiate(A, [D1_T])]});
    DartType D1_superclass_T = D1.superclass.typeVariables.first;
    testSupertypes(D1.superclass,
        {A: [D1_superclass_T],
         B: [D1_superclass_T, instantiate(A, [D1_superclass_T])]});
    DartType D2_T = D2.typeVariables.first;
    testSupertypes(D2, {A: [D2_T], B: [D2_T, instantiate(A, [D2_T])]});

    testSupertypes(E1, {A: [_], B: [_, instantiate(A, [_])]});
    testSupertypes(E1.superclass, {A: [_], B: [_, instantiate(A, [_])]});
    testSupertypes(E2, {A: [_], B: [_, instantiate(A, [_])]});

    DartType F1_T = F1.typeVariables.first;
    testSupertypes(F1, {A: [_], B: [_, instantiate(B, [F1_T, _])]});
    DartType F1_superclass_T = F1.superclass.typeVariables.first;
    testSupertypes(F1.superclass, {A: [_], B: [_, instantiate(B, [F1_superclass_T, _])]});
    DartType F2_T = F2.typeVariables.first;
    testSupertypes(F2, {A: [_], B: [_, instantiate(B, [F2_T, _])]});
  }));
}
// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
//


; ACSI2STM Atari hard drive emulator
; Copyright (C) 2019-2024 by Jean-Matthieu Coulon

; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.

; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.

; You should have received a copy of the GNU General Public License
; along with this program.  If not, see <https://www.gnu.org/licenses/>.

; Hooks TOS system calls into the STM32

savereg	macro
	; Save registers on stack
	; ... because some poorly written apps rely on scratch register being
	; preserved !
	movem.l	d1-d2/a0-a2,-(sp)
	endm

resreg	macro
	; Restore registers from stack
	movem.l	(sp)+,d1-d2/a0-a2
	endm

	; Stack offset introduced by savereg
spoff	equ	5*4

syshook:
	; Initialize registers for hook subroutines
	; Input:
	;  d0.b: Command byte
	;  syshook.prmoff: Offset to a7 to find params (platform dependent)

	tst.b	flock.w                 ; Prevent reentrant calls
	bne.b	syshook.rts             ;

	savereg	                        ; Save registers

	bsr.b	syshook.setprm          ; Set a2 (DMA address) at the parameters

	cmp.w	#$0020,(a2)             ; Don't hook Super because it breaks
	beq.b	syshook.forward         ; some programs such as ICDFMT.PRG

syshook.sendcmd:
	st	flock.w                 ; Lock floppy controller
	bsr.w	syshook.setdmaaddr      ; Set DMA address on chip

	move.w	#$00ff,(a0)             ; Send 255 blocks.
	move.w	#$0188,(a1)             ; Switch to command.
	and.w	#$00ff,d0               ; Filter command byte
	move.w	d0,(a0)                 ; Send command byte to the STM32
	move.w	#$0100,(a1)             ; Start DMA

syshook.reply:
	; Handle single byte reply

.await	btst.b	#5,gpip.w               ; Wait for acknowledge on IRQ
	bne.b	.await                  ;

	move.w	#$008a,(a1)             ; Prepare to read command/status
	move.w	(a0),d0                 ; Read command/status byte

	cmp.b	#$9a,d0                 ; Check if command byte
	beq.b	syshook.forward         ; Check command $9a (forward to TOS)
	blt.b	syshook.execcmd         ; Other commands with parameter

.qret	ext.w	d0                      ; Quick return sign-extended d0
	ext.l	d0                      ;

	; Fall through syshook.return
syshook.return:
	; Return from interrupt
	sf	flock.w                 ; Unlock floppy controller
	resreg	                        ; Restore registers
	addq	#4,sp                   ; Pop forward address
	rte	                        ; Return

syshook.forward:
	; Command $9a: forward the call to the next handler
	sf


 and (max-width: 360px) {

			#wrapper section {
				margin: 2.25rem 0 0 0;
			}

			#wrapper > section {
				margin: 0;
			}

				#wrapper > section > header {
					padding: 2.25rem 1.5rem;
				}

				#wrapper > section > .content {
					padding: 2.25rem 1.5rem;
				}

					#wrapper > section > .content > section {
						margin: 2.25rem 0;
					}

				#wrapper > section > footer {
					padding: 0 1.5rem 2.25rem 1.5rem;
				}

				#wrapper > section.intro > header {
					padding: 4.875rem 1.5rem 1.875rem 1.5rem;
				}

			#wrapper .copyright {
				padding: 0 1.5rem 1.5rem 1.5rem;
			}

		}

	body.is-mobile #wrapper:before {
		background-attachment: scroll;
		background-position: 50% -3%;
		background-repeat: repeat-y;
		background-size: 150% auto;
	}

	body.is-mobile #wrapper > section > header {
		background-attachment: scroll;
		background-position: 25% 50%;
	}

	body.is-mobile #wrapper > section.intro > header {
		background-position: 25% 23%;
	}

	#wrapper:before {
		transition: opacity 1s ease;
	}

		body.is-preload #wrapper:before {
			opacity: 0;
		}

	#wrapper > section.intro {
		transition: opacity 1s ease;
		opacity: 1;
	}

		#wrapper > section.intro > header {
			transition: transform 1s ease;
		}

		#wrapper > section.intro > .content {
			transition: transform 1s ease;
		}

		body.is-preload #wrapper > section.intro {
			opacity: 0;
		}

			body.is-preload #wrapper > section.intro > header {
				transform: translateY(1rem);
			}

			body.is-preload #wrapper > section.intro > .content {
				transform: translateY(-1rem);
			}

		@media screen and (max-width: 1280px) {

			#wrapper > section.intro > header > * {
				transition: transform 1s ease, opacity 1s ease;
			}

			body.is-preload #wrapper > section.intro > header {
				transform: none;
			}

				body.is-preload #wrapper > section.intro > header > * {
					transform: translate(-0.5rem);
					opacity: 0;
				}

			body.is-preload #wrapper > section.intro > .content {
				transform: none;
			}

		}

	body.is-ie #wrapper section {
		display: flex;
		flex-wrap: wrap;
	}

		body.is-ie #wrapper section > header {
			width: 50%;
		}

		body.is-ie #wrapper section > .content {
			width: 50%;
		}

		body.is-ie #wrapper section > footer {
			width: 50%;
			text-align: left;
			margin-left: 50%;
			padding: 5rem;
		}

	body.is-ie #wrapper > section > .content > section {
		width: 100vw;
	}

	@media screen and (max-width: 1280px) {

		body.is-ie #wrapper section > footer {
			padding: 4rem;
		}

	}

/*!
 *  Font Awesome 4.1.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.1.0');src:url('../fonts/fo


			Files: files,
			// Setting a high refresh interval to make sure that the tests only
			// rely on file watches.
			RefreshInterval: model.Duration(1 * time.Hour),
		}

		reg := prometheus.NewRegistry()
		refreshMetrics := discovery.NewRefreshMetrics(reg)
		metrics := conf.NewDiscovererMetrics(reg, refreshMetrics)
		require.NoError(t, metrics.Register())

		d, err := NewDiscovery(
			conf,
			nil,
			metrics,
		)
		require.NoError(t, err)

		d.Run(ctx, t.ch)

		metrics.Unregister()
	}()
}

func (t *testRunner) stop() {
	t.cancelSD()
	close(t.done)
	<-t.stopped
}

func (t *testRunner) lastReceive() time.Time {
	t.mtx.Lock()
	defer t.mtx.Unlock()
	return t.receivedAt
}

func (t *testRunner) targets() []*targetgroup.Group {
	t.mtx.Lock()
	defer t.mtx.Unlock()
	var (
		keys []string
		tgs  []*targetgroup.Group
	)

	for k := range t.tgs {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	for _, k := range keys {
		tgs = append(tgs, t.tgs[k])
	}
	return tgs
}

func (t *testRunner) requireUpdate(ref time.Time, expected []*targetgroup.Group) {
	t.Helper()

	timeout := time.After(defaultWait)
	for {
		select {
		case <-timeout:
			t.Fatalf("Expected update but got none")
		case <-time.After(defaultWait / 10):
			if ref.Equal(t.lastReceive()) {
				// No update received.
				break
			}

			// We can receive partial updates so only check the result when the
			// expected number of groups is reached.
			tgs := t.targets()
			if len(tgs) != len(expected) {
				t.Logf("skipping update: expected %d targets, got %d", len(expected), len(tgs))
				break
			}
			t.requireTargetGroups(expected, tgs)
			if ref.After(time.Time{}) {
				t.Logf("update received after %v", t.lastReceive().Sub(ref))
			}
			return
		}
	}
}

func (t *testRunner) requireTargetGroups(expected, got []*targetgroup.Group) {
	t.Helper()
	b1, err := json.Marshal(expected)
	if err != nil {
		panic(err)
	}
	b2, err := json.Marshal(got)
	if err != nil {
		panic(err)
	}

	require.Equal(t, string(b1), string(b2))
}

// validTg() maps to fixtures/valid.{json,yml}.
func validTg(file string) []*targetgroup.Group {
	return []*targetgroup.Group{
		{
			Targets: []model.LabelSet{
				{
					model.AddressLabel: model.LabelValue("localhost:9090"),
				},
				{
					model.AddressLabel: model.LabelValue("example.org:443"),
				},
			},
			Labels: model.LabelSet{
				model.LabelName("foo"): model.LabelValue("bar"),
				fileSDFilepathLabel:    model.LabelValue(file),
			},
			Source: fileSource(file, 0),
		},
		{
			Targets: []model.LabelSet{
				{
					model.AddressLabel: model.LabelValue("my.domain"),
				},
			},
			Labels: model.LabelSet{
				fileSDFilepathLabel: model.LabelValue(file),
			},
			Source: fileSource(file, 1),
		},
	}