 iter_mut(&mut self) -> Self::IterMut {
        IterMut {
            value: self.inner.as_mut().map(|v| (K::default(), v as *mut V)),
        }
    }
}
<reponame>Ka1wa/kube-rs
use serde::{Deserialize, Serialize};
use thiserror::Error;

/// Core error types.
#[derive(Error, Debug)]
pub enum Error {
    /// A request validation failed
    #[error("Request validation failed with {0}")]
    RequestValidation(String),

    /// Common error case when requesting parsing into own structs
    #[error("Error deserializing response")]
    SerdeError(#[from] serde_json::Error),

    /// Http based error
    #[error("HttpError: {0}")]
    HttpError(#[from] http::Error),

    /// Invalid GroupVersion
    #[error("Invalid GroupVersion: {0}")]
    InvalidGroupVersion(String),
}

/// An error response from the API.
#[derive(Error, Deserialize, Serialize, Debug, Clone, Eq, PartialEq)]
#[error("{message}: {reason}")]
pub struct ErrorResponse {
    /// The status
    pub status: String,
    /// A message about the error
    #[serde(default)]
    pub message: String,
    /// The reason for the error
    #[serde(default)]
    pub reason: String,
    /// The error code
    pub code: u16,
}
pub mod keyboard;
pub mod mouse;

mod button_state;

pub use button_state::ButtonState;<filename>plonky2/src/plonk/circuit_builder.rs
use std::cmp::max;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::time::Instant;

use log::{debug, info, Level};
use plonky2_field::cosets::get_unique_coset_shifts;
use plonky2_field::extension_field::{Extendable, FieldExtension};
use plonky2_field::fft::fft_root_table;
use plonky2_field::field_types::Field;
use plonky2_field::polynomial::PolynomialValues;
use plonky2_util::{log2_ceil, log2_strict};

use crate::fri::oracle::PolynomialBatch;
use crate::fri::{FriConfig, FriParams};
use crate::gadgets::arithmetic::BaseArithmeticOperation;
use crate::gadgets::arithmetic_extension::ExtensionArithmeticOperation;
use crate::gadgets::arithmetic_u32::U32Target;
use crate::gadgets::polynomial::PolynomialCoeffsExtTarget;
use crate::gates::arithmetic_base::ArithmeticGate;
use crate::gates::arithmetic_extension::ArithmeticExtensionGate;
use crate::gates::constant::ConstantGate;
use crate::gates::gate::{CurrentSlot, Gate, GateInstance, GateRef, PrefixedGate};
use crate::gates::gate_tree::Tree;
use crate::gates::noop::NoopGate;
use crate::gates::public_input::PublicInputGate;
use crate::hash::hash_types::{HashOutTarget, MerkleCapTarget, RichField};
use crate::hash::merkle_proofs::MerkleProofTarget;
use crate::iop::ext_target::ExtensionTarget;
use crate::iop::generator::{
    CopyGenerator, RandomValueGenerator, SimpleGenerator, WitnessGenerator,
};
use crate::iop::target::{BoolTarget, Target};
use crate::iop::wire::Wire;
use crate::plonk::circuit_data::{
    CircuitConfig, CircuitData, CommonCircuitData, ProverCircuitData, ProverOnlyCircuitData,
    VerifierCircuitData, VerifierOnlyCircuitData,
};
use crate::plonk::config::{GenericConfig, Hasher};
use crate::plonk::copy_constraint::CopyConstraint;
use crate::plonk::permutation_argument::Forest;
use crate::plonk::plonk_common::PlonkOracle;
use crate::timed;
use crate::util::context_tree::ContextTree;
use crate::util::marking::{Markable, MarkedTargets};
use crate::util::partial_products::num_part


/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Copyright (C) 2011-2018 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM 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.

    OpenFOAM 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 OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Class
    Foam::dragModels::Gibilaro

Description
    H, Enwald, E. Peirano, A-E Almstedt
    'Eulerian Two-Phase Flow Theory Applied to Fluidization'
    Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
    Eq. 106, p. 43

SourceFiles
    Gibilaro.C

\*---------------------------------------------------------------------------*/

#ifndef Gibilaro_H
#define Gibilaro_H

#include "dragModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace dragModels
{

/*---------------------------------------------------------------------------*\
                           Class Gibilaro Declaration
\*---------------------------------------------------------------------------*/

class Gibilaro
:
    public dragModel
{

public:

    //- Runtime type information
    TypeName("Gibilaro");

    // Constructors

        //- Construct from components
        Gibilaro
        (
            const dictionary& interfaceDict,
            const phaseModel& phase1,
            const phaseModel& phase2
        );

    //- Destructor
    virtual ~Gibilaro();

    // Member Functions

        tmp<volScalarField> K(const volScalarField& Ur) const;
};

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace dragModels
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //


mInitDone) Init(); }

	protected virtual void OnEnable () { if (mStarted && mHighlighted) OnHover(UICamera.IsHighlighted(gameObject)); }

	void OnDisable ()
	{
		if (tweenTarget != null)
		{
			TweenColor tc = tweenTarget.GetComponent<TweenColor>();

			if (tc != null)
			{
				tc.color = mColor;
				tc.enabled = false;
			}
		}
	}

	protected void Init ()
	{
		mInitDone = true;
		if (tweenTarget == null) tweenTarget = gameObject;
		UIWidget widget = tweenTarget.GetComponent<UIWidget>();

		if (widget != null)
		{
			mColor = widget.color;
		}
		else
		{
			Renderer ren = tweenTarget.renderer;

			if (ren != null)
			{
				mColor = ren.material.color;
			}
			else
			{
				Light lt = tweenTarget.light;

				if (lt != null)
				{
					mColor = lt.color;
				}
				else
				{
					Debug.LogWarning(NGUITools.GetHierarchy(gameObject) + " has nothing for UIButtonColor to color", this);
					enabled = false;
				}
			}
		}
	}

	void OnPress (bool isPressed)
	{
		if (!mInitDone) Init();
		if (enabled) TweenColor.Begin(tweenTarget, duration, isPressed ? pressed : (UICamera.IsHighlighted(gameObject) ? hover : mColor));
	}

	void OnHover (bool isOver)
	{
		if (enabled)
		{
			if (!mInitDone) Init();
			TweenColor.Begin(tweenTarget, duration, isOver ? hover : mColor);
			mHighlighted = isOver;
		}
	}
}


x01,0x73,0x0a,0x7e]

v_cvt_f16_u16 v255, v1
// CHECK: [0x01,0x73,0xfe,0x7f]

v_cvt_f16_u16 v5, v255
// CHECK: [0xff,0x73,0x0a,0x7e]

v_cvt_f16_u16 v5, s1
// CHECK: [0x01,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, s101
// CHECK: [0x65,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, flat_scratch_lo
// CHECK: [0x66,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, flat_scratch_hi
// CHECK: [0x67,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, vcc_lo
// CHECK: [0x6a,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, vcc_hi
// CHECK: [0x6b,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, m0
// CHECK: [0x7c,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, exec_lo
// CHECK: [0x7e,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, exec_hi
// CHECK: [0x7f,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, 0
// CHECK: [0x80,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, -1
// CHECK: [0xc1,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, 0.5
// CHECK: [0xf0,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, -4.0
// CHECK: [0xf7,0x72,0x0a,0x7e]

v_cvt_f16_u16 v5, 0xfe0b
// CHECK: [0xff,0x72,0x0a,0x7e,0x0b,0xfe,0x00,0x00]

v_cvt_f16_u16 v5, 0x3456
// CHECK: [0xff,0x72,0x0a,0x7e,0x56,0x34,0x00,0x00]

v_cvt_f16_u16_e64 v5, v1
// CHECK: [0x05,0x00,0x79,0xd1,0x01,0x01,0x00,0x00]

v_cvt_f16_u16_e64 v255, v1
// CHECK: [0xff,0x00,0x79,0xd1,0x01,0x01,0x00,0x00]

v_cvt_f16_u16_e64 v5, v255
// CHECK: [0x05,0x00,0x79,0xd1,0xff,0x01,0x00,0x00]

v_cvt_f16_u16_e64 v5, s1
// CHECK: [0x05,0x00,0x79,0xd1,0x01,0x00,0x00,0x00]

v_cvt_f16_u16_e64 v5, s101
// CHECK: [0


$/; or a RegExp.
 *
 * Using a RegExp allows to have more control on what you want to match, and also allows you to
 * use capturing parentheses to then use parts of the command in the responder.
 */
export function createCommand(command: string | RegExp, responder: Responder): Command {
  const regExpToString = (regExp: RegExp) => regExp.toString().replace(/^\/|\/$/g, '');
  const commandString = typeof command === 'string' ? `^${command}$` : regExpToString(command);
  const getCommandRegExp = (commandPrefix: string) => new RegExp(commandString.replace(/^(\^?)(.*)$/, `$1${commandPrefix}$2`));

  return data$ => data$
    .filter(({ message, commandPrefix }) => getCommandRegExp(commandPrefix).test(message.content))
    .mergeMap(({ message, commandPrefix }) => {
      const responderArgs = (message.content.match(getCommandRegExp(commandPrefix)) || []).slice(1);
      return Promise.resolve()
        .then(() => {
          const response = responder(message, ...responderArgs);
          if (response) return response;
          return { recipient: message.channel }; // this allows commands to just produce side-effects
        });
    });
}
/*--------------------------------------------------------------------------

MIT License

Copyright (c) smoke-run 2019 Haydn Paterson (sinclair) <haydn.developer@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---------------------------------------------------------------------------*/

import { FSWatcher, watch } from 'fs'
import { resolve }          from 'path'

// --------------------------------------------------------------------------
//
// ResetTimeout
//
// A specialized reset timeout. Used to debounce file system watch
// events. Provides a run method which accept a callback. Calling
// run in quick succession will result in reset. Only the 'last'
// callback will run.
//
// --------------------------------------------------------------------------

class ResetTimeout {
  private timer!: NodeJS.Timer
  constructor(private timeout: number) {}
  public run(func: () => void) {
    clearTimeout(this.timer)
    this.timer = setTimeout(() => func(), this.timeout)
  }
}

// --------------------------------------------------------------------------
//
// Watcher
//
// Specialized Watcher type. Watches an array of files and directories
// for changes and emits a watch event back to the caller.
//
// --------------------------------------------------------------------------

export class WatchHandle {
  constructor(private watchers: FSWatcher[]) {}
  public dispose() {
    while(this.watchers.length > 0) {
      const watcher = this.watchers.shift()!
      watcher.close()


// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "tracing_global.h"
#include <QObject>
#include <QtQml/qqml.h>

namespace Timeline {

class TimelineModel;
class TRACING_EXPORT TimelineNotesModel : public QObject
{
    Q_OBJECT
    Q_PROPERTY(int count READ count NOTIFY changed)
    QML_ANONYMOUS

public:
    TimelineNotesModel(QObject *parent = nullptr);
    ~TimelineNotesModel() override;

    int count() const;
    void addTimelineModel(const TimelineModel *timelineModel);
    void removeTimelineModel(const TimelineModel *timelineModel);
    QList<const TimelineModel *> timelineModels() const;

    Q_INVOKABLE int typeId(int index) const;
    Q_INVOKABLE QString text(int index) const;
    Q_INVOKABLE int timelineModel(int index) const;
    Q_INVOKABLE int timelineIndex(int index) const;

    Q_INVOKABLE QVariantList byTypeId(int typeId) const;
    Q_INVOKABLE QVariantList byTimelineModel(int modelId) const;

    Q_INVOKABLE int get(int modelId, int timelineIndex) const;
    Q_INVOKABLE int add(int modelId, int timelineIndex, const QString &text);
    Q_INVOKABLE void update(int index, const QString &text);
    Q_INVOKABLE void remove(int index);

    Q_INVOKABLE void setText(int noteId, const QString &text);
    Q_INVOKABLE void setText(int modelId, int index, const QString &text);

    bool isModified() const;
    void resetModified();

    virtual void stash();
    virtual void restore();
    virtual void clear();

protected:
    const TimelineModel *timelineModelByModelId(int modelId) const;

signals:
    void changed(int typeId, int modelId, int timelineIndex);

private:
    class TimelineNotesModelPrivate;
    TimelineNotesModelPrivate *d_ptr;

    Q_DECLARE_PRIVATE(TimelineNotesModel)
};

} // namespace Timeline


println("      no seek");
            }
          }
        }

        // Shorten prevTerm in place so that we don't redo
        // this loop if we come back here:
        if ((prevTerm.bytes[downTo] & 0xc0) == 0xc0 || (prevTerm.bytes[downTo] & 0x80) == 0) {
          prevTerm.length = downTo;
        }

        downTo--;
      }

      return didSeek;
    }

    // Look for seek type 3 ("pop"): if the delta from
    // prev -> current was replacing an S with an E,
    // we must now seek to beyond that E.  This seek
    // "finishes" the dance at this character
    // position.
    private boolean doPop() throws IOException {

      if (DEBUG_SURROGATES) {
        System.out.println("  try pop");
      }

      assert newSuffixStart <= prevTerm.length;
      assert newSuffixStart < scratchTerm.length || newSuffixStart == 0;

      if (prevTerm.length > newSuffixStart &&
          isNonBMPChar(prevTerm.bytes, newSuffixStart) &&
          isHighBMPChar(scratchTerm.bytes, newSuffixStart)) {

        // Seek type 2 -- put 0xFF at this position:
        scratchTerm.bytes[newSuffixStart] = (byte) 0xff;
        scratchTerm.length = newSuffixStart+1;

        if (DEBUG_SURROGATES) {
          System.out.println("    seek to term=" + UnicodeUtil.toHexString(scratchTerm.utf8ToString()) + " " + scratchTerm.toString());
        }

        // TODO: more efficient seek?  can we simply swap
        // the enums?
        getTermsDict().seekEnum(termEnum, new Term(fieldInfo.name, scratchTerm), true);

        final Term t2 = termEnum.term();

        // We could hit EOF or different field since this
        // was a seek "forward":
        if (t2 != null && t2.field() == internedFieldName) {

          if (DEBUG_SURROGATES) {
            System.out.println("      got term=" + UnicodeUtil.toHexString(t2.text()) + " " + t2.bytes());
          }

          final BytesRef b2 = t2.bytes();
          assert b2.offset == 0;

          // Set newSuffixStart -- we can't use
          // termEnum's since the above seek may have
          // done no scanning (eg, term was precisely
          // and index term, or, was in the term seek
          // cache):
          scratchTerm.copyBytes(b2);
          setNewSuffixStart(prevTerm, scratchTerm);

          return true;
        } else if (newSuffixStart != 0 || scratchTerm.length != 0) {
          if (DEBUG_SURROGATES) {
            System.out.println("      got term=null (or next field)");
          }
          newSuffixStart = 0;
          scratchTerm.length = 0;
          return true;
        }
      }

      return false;
    }

    // Pre-flex indices store terms in UTF16 sort order, but
    // certain queries require Unicode codepoint order; this
    // method carefully seeks around surrogates to handle
    // this impedance mismatch

    private void surrogateDance() throws IOException {

      if (!unicodeSortOrder) {
        return;
      }

      // We are invoked after TIS.next() (by UTF16 order) to
      // possibly seek to a different "next" (by unicode
      // order) term.

      // We scan only the "delta" from the last term to the
      // current term, in UTF8 bytes.  We look at 1) the bytes
      // stripped from the prior term, and then 2) the bytes
      // appended to that prior term's prefix.

      // We don't care about


is potentially a really sketchy thing to do, but it
        // was breaking attributes like   numberformat = "\$#,##0.00"
        // Q: Added back in but handle escaping differently now
        if ((flag == 1 || flag == 2) && c == '\\') {
          escape = true;
          continue;
        }
        else if (flag == 0 && c == '"') {
          flag = 1;
        }
        else if (flag == 1 && c == '"') {
          if (!escape) {
            flag = 0;
          } else {
            sb.append('\\');
          }
          escape = false;
        }
        else if (flag == 0 && c == '\'') {
          flag = 2;
        }
        else if (flag == 2 && c == '\'') {
          if (!escape) {
            flag = 0;
          } else {
            sb.append('\\');
          }
          escape = false;
        }
        else if ((flag == 1 || flag == 2)) {
          sb.append(' ');
          if (escape) {
            sb.append(' ');
            escape = false;
          }
          continue;
        }
        else if (flag == 0 && c == '>') {
          tag = false;
        }
      }
      else if (c == '<') {
        tag = true;
      }
      sb.append(c);
    }

    return sb.toString();
  }

  /**
   * HTML/JSP/XML

   *

   *
<!-- -->

   *

   *
   * @param source XML
   * @param contentsOnly true
   *                     false
   * @return
   */
  public static String comment2space(String source, boolean contentsOnly) {
    int index = 0;
    int last = 0;
    StringBuffer sb = new StringBuffer();
    while ((index = source.indexOf("", index);
      if (end != -1) {
        sb.append(source.substring(last, index));
        int length = end - index + 3;
        if (contentsOnly) {
          sb.append("");
        }
      }
      else {
        break;
      }
      last = end + 3;
    }
    if (last != source.length()) {
      sb.append(source.substring(last));
    }
    return sb.toString();
  }

  public static String cdata2space(String source, boolean contentsOnly) {
    int index = 0;
    int last = 0;
    StringBuffer sb = new StringBuffer();
    while ((index = source.indexOf("<![CDATA[", last)) != -1) {
      int end = source.indexOf("]]>", index);
      if (end != -1) {
        sb.append(source.substring(last, index));
        int length = end - index + 3;
        if (contentsOnly) {
          sb.append("<![CDATA[");
          length = length - 12;
        }
        for (int i = 0; i < length; i++) {
          sb.append(" ");
        }
        if (contentsOnly) {
          sb.append("]]>");
        }
      }
      else {
        break;
      }
      last = end + 3;
    }
    if (last != source.length()) {
      sb.append(sour


s, ContainerProps = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props.ContainerProps, _excluded), other = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(props, _excluded2);\n    const context = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_List_ListContext__WEBPACK_IMPORTED_MODULE_11__[\"default\"]);\n    const childContext = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(()=>({\n            dense: dense || context.dense || false,\n            alignItems,\n            disableGutters\n        }), [\n        alignItems,\n        context.dense,\n        dense,\n        disableGutters\n    ]);\n    const listItemRef = react__WEBPACK_IMPORTED_MODULE_2__.useRef(null);\n    (0,_utils_useEnhancedEffect__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(()=>{\n        if (autoFocus) {\n            if (listItemRef.current) {\n                listItemRef.current.focus();\n            } else if (true) {\n                console.error(\"MUI: Unable to set focus to a ListItem whose component has not been rendered.\");\n            }\n        }\n    }, [\n        autoFocus\n    ]);\n    const children = react__WEBPACK_IMPORTED_MODULE_2__.Children.toArray(childrenProp);\n    // v4 implementation, deprecated in v5, will be removed in v6\n    const hasSecondaryAction = children.length && (0,_utils_isMuiElement__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(children[children.length - 1], [\n        \"ListItemSecondaryAction\"\n    ]);\n    const ownerState = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, props, {\n        alignItems,\n        autoFocus,\n        button,\n        dense: childContext.dense,\n        disabled,\n        disableGutters,\n        disablePadding,\n        divider,\n        hasSecondaryAction,\n        selected\n    });\n    const classes = useUtilityClasses(ownerState);\n    const handleRef = (0,_utils_useForkRef__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(listItemRef, ref);\n    const Root = slots.root || components.Root || ListItemRoot;\n    const rootProps = slotProps.root || componentsProps.root || {};\n    const componentProps = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n        className: (0,clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(classes.root, rootProps.className, className),\n        disabled\n    }, other);\n    let Component = componentProp || \"li\";\n    if (button) {\n        componentProps.component = componentProp || \"div\";\n        componentProps.focusVisibleClassName = (0,clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_listItemClasses__WEBPACK_IMPORTED_MODULE_6__[\"default\"].focusVisible, focusVisibleClassName);\n        Component = _ButtonBase__WEBPACK_IMPORTED_MODULE_15__[\"default\"];\n    }\n    // v4 implementation, deprecated in v5, will be removed in v6\n    if (hasSecondaryAction) {\n        // Use div by default.\n        Component = !componentProps.component && !componentProp ? \"div\" : Component;\n        // Avoid nesting of li > li.\n        if (ContainerComponent === \"li\") {\n            if (Component === \"li\") {\n                Component = \"div\";\n            } else if (componentProps.component === \"li\") {\n                componentProps.component = \"div\";\n            }\n        }\n


аллов...$B$BПри одном взгляде на киражские артефакты мне хочется разбить их, чтобы переплавить обломки и испробовать на них свое собственное искусство. Докажи Кругу Кенариуса свою преданность, $N, и я создам для тебя могучее оружие из лучших киражских материалов.",
    ["O"] = "Принесите киражскую изысканную рукоять, 2 яшмовых идола, 5 хрустальных и 5 каменных скарабеев Надзирателю Харо в Силитус. Кроме того, вас должны превозносить в Круге Кенария.",
    ["T"] = "Палица бесконечной жизни",
  },
  [8711] = {
    ["D"] = "Киражи и их прислужники владеют вещами, которые созданы из редчайших и благороднейших материалов – костей гигантских древних созданий, драгоценностей из самых глубин земли, чистейших и прочных металлов...$B$BПри одном взгляде на киражские артефакты мне хочется разбить их, чтобы переплавить обломки и испробовать на них свое собственное искусство. Докажи Кругу Кенариуса свою преданность, $N, и я создам для тебя могучее оружие из лучших киражских материалов.",
    ["O"] = "Принесите киражскую шипастую рукоять, 2 янтарных идола, 5 бронзовых скарабеев и 5 скарабеев из слоновой кости Надзирателю Харо в Силитус. Кроме того, вас должны превозносить в Круге Кенария.",
    ["T"] = "Клинок Вечной Справедливости",
  },
  [8713] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Песнь Звезд",
  },
  [8714] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Лунная Заря",
  },
  [8715] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Остролист",
  },
  [8716] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Звездный Луг",
  },
  [8717] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Лунный Страж",
  },
  [8718] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Быстрый Клинок",
  },
  [8719] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Песнь Клинка",
  },
  [8720] = {
    ["D"] = "",
    ["O"] = "",
    ["T"] = "Предок Небесны


 self.added_files.append(str(path) + '/' + str(basename))

    def pull(self, file, path, device=None):
        """Pulls a file from the device (adb pull)"""
        device = self.__check_device(device)
        subprocess.run(['mkdir', '-p', path], capture_output=True, text=True).stdout.strip()
        print(f"[ INFO ] Pulling file from device path {file} to local path {path}")
        return subprocess.run(['adb', '-s', device, 'pull', file, path], capture_output=True, text=True).stdout.strip()

    def apps(self, all=False, device=None):
        """Returns a list of packages/apps"""
        packages = []
        device = self.__check_device(device)
        cmdlist = ['cmd', 'package', 'list', 'packages']
        if not all:
            cmdlist.append('-3')  # only thirdparty apps
        else:
            cmdlist.append('-e')  # only enabled apps
        out, _ = self.command(cmdlist)
        for d in out.split('\n'):
            m = re.match(r'package:(.+)', d)
            name = m.group(1)
            package = {}
            package['name'] = name
            info, _ = self.command(['dumpsys', 'package', name])
            for i in info.split('\n'):
                if 'primaryCpuAbi=' in i:
                    package['abi'] = i.split('=')[1]
                # elif 'versionCode=' in i: packages[name]['version'] = i.split('=')[1]
                elif 'versionName=' in i:
                    package['version'] = i.split('=')[1]
                elif 'resourcePath=' in i:
                    package['path'] = i.split('resourcePath=')[1]
            packages.append(package)
        return packages

    def install(self, package_apk, device=None):
        """Runs adb install"""
        device = self.__check_device(device)
        subprocess.run(['adb', '-s', device, 'install', '-g', '-t', '-r', '-d', package_apk])

    def uninstall(self, package_name, device=None):
        """Runs adb uninstall"""
        device = self.__check_device(device)
        subprocess.run(['adb', '-s', device, 'uninstall', package_name])

    def __check_device(self, device):
        """Checks that a device is connected"""
        if not device:
            device = self.device
        assert device, 'No device selected'
        assert device in self.devices, 'Device not found!'
        return device

    def cleanUpSDCard(self):
        stdout, _ = self.command(['ls', "/sdcard/devlib-target"], True, errors_handled_externally=True)
        if stdout:
            self.command(["rm", "-r" " /sdcard/devlib-target"], True)

if __name__ == '__main__':
    a = adb()
    a.init()
    if a.device is None:
        a.select_device(a.devices[0])
    for d in a.devices:
        print("%s : %s" % (d, a.configs[d]))
        for v in a.apps():
            print('\t' + str(v))


if (param_valuePointerData == NULL)
    {
        return CL_INVALID_HOST_PTR;
    }
    nativeParam_value = (void*)param_valuePointerData->pointer;

    int result = (clGetContextInfoFP)(nativeContext, nativeParam_name, nativeParam_value_size, nativeParam_value, &nativeParam_value_size_ret);

    // Write back native variable values and clean up
    if (!releasePointerData(env, param_valuePointerData)) return CL_INVALID_HOST_PTR;
    if (!set(env, param_value_size_ret, 0, (long)nativeParam_value_size_ret)) return CL_OUT_OF_HOST_MEMORY;

    return result;
}

/*
 * Class:     org_jocl_CL
 * Method:    clCreateCommandQueueNative
 * Signature: (Lorg/jocl/cl_context;Lorg/jocl/cl_device_id;J[I)Lorg/jocl/cl_command_queue;
 */
JNIEXPORT jobject JNICALL Java_org_jocl_CL_clCreateCommandQueueNative
  (JNIEnv *env, jclass UNUSED(cls), jobject context, jobject device, jlong properties, jintArray errcode_ret)
{
    Logger::log(LOG_TRACE, "Executing clCreateCommandQueue\n");
    if (clCreateCommandQueueFP == NULL)
    {
        ThrowByName(env, "java/lang/UnsupportedOperationException",
            "The function clCreateCommandQueue is not supported");
        return NULL;
    }

    // Native variables declaration
    cl_context nativeContext = NULL;
    cl_device_id nativeDevice = NULL;
    cl_command_queue_properties nativeProperties = 0;
    cl_int nativeErrcode_ret = 0;
    cl_command_queue nativeCommand_queue = NULL;

    // Obtain native variable values
    if (context != NULL)
    {
        nativeContext = (cl_context)env->GetLongField(context, NativePointerObject_nativePointer);
    }
    if (device != NULL)
    {
        nativeDevice = (cl_device_id)env->GetLongField(device, NativePointerObject_nativePointer);
    }
    nativeProperties = (cl_command_queue_properties)properties;

    nativeCommand_queue = (clCreateCommandQueueFP)(nativeContext, nativeDevice, nativeProperties, &nativeErrcode_ret);

    // Write back native variable values and clean up
    if (!set(env, errcode_ret, 0, nativeErrcode_ret)) return NULL;

    if (nativeCommand_queue == NULL)
    {
        return NULL;
    }

    // Create and return the Java cl_command_queue object
    jobject command_queue = env->NewObject(cl_command_queue_Class, cl_command_queue_Constructor);
    if (env->ExceptionCheck())
    {
        return NULL;
    }

    setNativePointer(env, command_queue, (jlong)nativeCommand_queue);
    return command_queue;
}

// #if defined(CL_VERSION_2_0)

/*
 * Class:     org_jocl_CL
 * Method:    clCreateCommandQueueWithPropertiesNative
 * Signature: (Lorg/jocl/cl_context;Lorg/jocl/cl_device_id;Lorg/jocl/cl_queue_properties;[I)Lorg/jocl/cl_command_queue;
 */
JNIEXPORT jobject JNICALL Java_org_jocl_CL_clCreateCommandQueueWithPropertiesNative
  (JNIEnv *env, jclass UNUSED(cls), jobject context, jobject device, jobject properties, jintArray errcode_ret)
{
    Logger::log(LOG_TRACE, "Executing clCreateCommandQueueWithProperties\n");
    if (clCreateCommandQueueWithPropertiesFP == NULL)
    {
        ThrowByName(env, "java/lang/UnsupportedOperationException",
            "The function clCreateCommandQueueWithProperties is not supported");
        return NULL;
    }

    // Native variables declaration
    cl_context nativeContext = NULL;
    cl_device_i


box-shadow);
  @include transition($form-select-transition);

  &:focus {
    border-color: $form-select-focus-border-color;
    outline: 0;
    @if $enable-shadows {
      @include box-shadow($form-select-box-shadow, $form-select-focus-box-shadow);
    } @else {
      // Avoid using mixin so we can pass custom focus shadow properly
      box-shadow: $form-select-focus-box-shadow;
    }
  }

  &[multiple],
  &[size]:not([size="1"]) {
    padding-right: $form-select-padding-x;
    background-image: none;
  }

  &:disabled {
    color: $form-select-disabled-color;
    background-color: $form-select-disabled-bg;
    border-color: $form-select-disabled-border-color;
  }

  // Remove outline from select box in FF
  &:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 $form-select-color;
  }
}

.form-select-sm {
  padding-top: $form-select-padding-y-sm;
  padding-bottom: $form-select-padding-y-sm;
  padding-left: $form-select-padding-x-sm;
  @include font-size($form-select-font-size-sm);
  @include border-radius($form-select-border-radius-sm);
}

.form-select-lg {
  padding-top: $form-select-padding-y-lg;
  padding-bottom: $form-select-padding-y-lg;
  padding-left: $form-select-padding-x-lg;
  @include font-size($form-select-font-size-lg);
  @include border-radius($form-select-border-radius-lg);
}

@if $enable-dark-mode {
  @include color-mode(dark) {
    .form-select {
      --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
    }
  }
}
.candidate-details-div {
    margin: auto;
    /* width: 100%; */
    min-width: 900px;
    transition: all 1s linear;
}

.candidate-details {
    margin: auto;
    display: flex;
    flex-direction: column;

    padding: 10px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    animation: slide-fade-in 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.candidate-photo {
    margin: auto;
    width: 150px;
    height: 150px;
    border-radius: 100%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.details {
    margin: auto;
    border-collapse: collapse;
    width: calc(100% - 20px);
}

.details-row {
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.1);
}

.details-row:last-child {
    border: none;
}

.details td {
    padding: 10px;
}

.des {
    color: rgb(100, 100, 100);
    font-variant: small-caps;
    font-size: 14px;
}

.candidate-details-div > div:last-child {
    width: 100%;
    margin-top: 20px;
    display: flex;
    opacity: 0;
    animation: slide-fade-in 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s forwards;
}

.vote-now {
    margin: auto;
    background: #047c00;


dth:24px;"> [Włącz / wyłącz wyświetlanie ramek](TechDraw_ToggleFrame/pl.md) służy on do wyświetlania widoku ramek, etykiet i wierzchołków widoku.

![](images/Exercise_drawing_02.jpg )

-   Powtórzmy operację dwa razy, żeby stworzyć jeszcze dwa widoki. Ustawimy dla nich wartości X i Y, które wskazują położenie widoku na stronie, w celu pokazania ich niezależnie od widoku z góry, oraz ich kierunku, aby utworzyć różne orientacje widoków. Nadaj każdemu z nowych widoków następujące właściwości:
    -   View001 *(widok z przodu)*: X: 70, Y: 220, Skala: 0.1, Obrót: 0, Kierunek: *(-1,0,0)*, XDirection: *(0,-1,0)*
    -   View002 *(widok z boku)*: X: 150, Y: 220, Skala: 0.1, Obrót: 0, Kierunek: *(0,-1,0)*, Kierunek: XDirection: *(1,0,0)*
-   Otrzymujemy następujący dokument:

![](images/Exercise_TechDraw_04.png )

-   Zwróć uwagę, że mogą być łatwiejsze sposoby na uzyskanie widoku, którego potrzebujesz. Możesz po prostu [obrócić](Manual_Navigating_in_the_3D_view.md) swój model w widoku 3D, a gdy już będziesz miał odpowiedni widok, wybierz model w widoku drzewa i naciśnij przycisk  Nowy widok. Spowoduje to automatyczne wstawienie widoku z żądanymi właściwościami obrotu i kierunku. Możesz również użyć narzędzia  [Grupa rzutów](TechDraw_ProjectionGroup/pl.md)

-   Możemy dopasować ustawienia naszych widoków jeśli chcemy, na przykład możemy zmienić ich właściwość **Szerokość linii** *(pod zakładką Widok w okienku widoku połączonego)* na 0.5.

Teraz umieścimy wymiary i oznaczenia na naszym rysunku. Istnieją dwa sposoby dodawania wymiarów do modelu:
pierwszy polega na umieszczeniu wymiarów w modelu 3D za pomocą narzędzia  [Dimension](Draft_Dimension/pl.md) z Środowiska pracy [Draft](Draft_Workbench/pl.md), a następnie umieszczenie widoku tych wymiarów na naszym arkuszu za pomocą narzędzia  [Nowy rysunek roboczy](TechDraw_DraftView/pl.md).
Drugi to wykonywanie czynności bezpośrednio na arkuszu Rysunku Technicznego. Użyjemy tej drugiej metody.

-   Wciśnij przycisk  Prze


NewRingBuffer(5)

	input := []Event{
		{"1": "a"},
		{"1": "b"},
	}
	for _, event := range input {
		rb.Push(event)
	}

	consumer := func(data []Event) bool {
		if !reflect.DeepEqual(input, data) {
			t.Errorf("Expected %v, Got %v", input, data)
		}
		return true
	}

	rb.Flush(consumer)
}

func TestRingBuffer_Flush_DeletesDataSnapshotIfConsumerFunctionSucceeds(t *testing.T) {
	rb := NewRingBuffer(5)

	rb.Push(Event{"1": "a"})
	rb.Push(Event{"1": "b"})

	rb.Flush(func(data []Event) bool { return true })
	result := rb.Flush()

	if !reflect.DeepEqual([]Event{}, result) {
		t.Errorf("Expected %v, Got %v", []Event{}, result)
	}
}

func TestRingBuffer_Flush_PreservesDataSnapshotIfConsumerFunctionDidNotSucceed(t *testing.T) {
	rb := NewRingBuffer(5)

	input := []Event{
		{"1": "a"},
		{"1": "b"},
	}
	for _, event := range input {
		rb.Push(event)
	}

	rb.Flush(func(data []Event) bool { return false })
	result := rb.Flush()

	if !reflect.DeepEqual(input, result) {
		t.Errorf("Expected %v, Got %v", input, result)
	}
}

func TestRingBuffer_Flush_PreservesStorageCapacityAfterDataDeletion(t *testing.T) {
	rb := NewRingBuffer(15)

	rb.Push(Event{"1": "a"})
	rb.Push(Event{"1": "b"})
	rb.Push(Event{"1": "c"})

	rb.Flush()

	if len(rb.buffer) != 15 {
		t.Errorf("Expected %v, Got %v", 15, len(rb.buffer))
	}

	rb.Flush()

	if len(rb.buffer) != 15 {
		t.Errorf("Expected %v, Got %v", 15, len(rb.buffer))
	}
}

func TestRingBuffer_Push_And_Flush_OnZeroCapacity(t *testing.T) {
	rb := NewRingBuffer(0)
	rb.Push(Event{"1": "a"})
	rb.Push(Event{"1": "b"})

	var result []Event
	expected := []Event{}

	result = rb.Flush()
	if !reflect.DeepEqual(expected, result) {
		t.Errorf("Final flush. Expected %v, Got %v", expected, result)
	}

	result = rb.Flush()
	if !reflect.DeepEqual(expected, result) {
		t.Errorf("Final flush. Expected %v, Got %v", expected, result)
	}

	result = rb.Flush()
	if !reflect.DeepEqual(expected, result) {
		t.Errorf("Final flush. Expected %v, Got %v", expected, result)
	}
}

// -====== Concurrent access check ======-

// - when flush consumer function returns FALSE after processing -

func TestRingBuffer_Flush_CA_False_OneElementWasPushedToFullBufferAfterFlush(t *testing.T) {
	var wg sync.WaitGroup
	rb := NewRingBuffer(4)
	rb.Push(Event{"1": "a"})
	rb.Push(Event{"1": "b"})


self == TFF_A::TFF_0
  }
  #[doc = "Checks if the value of the field is `TFF_1`"]
  #[inline(always)]
  pub fn is_tff_1(&self) -> bool {
    *self == TFF_A::TFF_1
  }
}
#[doc = "Write proxy for field `TFF`"]
pub struct TFF_W<'a> {
  w: &'a mut W,
}
impl<'a> TFF_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TFF_A) -> &'a mut W {
    {
      self.bit(variant.into())
    }
  }
  #[doc = "no description available"]
  #[inline(always)]
  pub fn tff_0(self) -> &'a mut W {
    self.variant(TFF_A::TFF_0)
  }
  #[doc = "A Transmit FIFO Full condition has occurred"]
  #[inline(always)]
  pub fn tff_1(self) -> &'a mut W {
    self.variant(TFF_A::TFF_1)
  }
  #[doc = r"Sets the field bit"]
  #[inline(always)]
  pub fn set_bit(self) -> &'a mut W {
    self.bit(true)
  }
  #[doc = r"Clears the field bit"]
  #[inline(always)]
  pub fn clear_bit(self) -> &'a mut W {
    self.bit(false)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bit(self, value: bool) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
    self.w
  }
}
#[doc = "Transmit Data Threshold Flag\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TDTF_A {
  #[doc = "0: Number of bytes in FIFO is greater than TDT\\[3:0\\], or bit has been cleared"]
  TDTF_0,
  #[doc = "1: Number of bytes in FIFO is less than or equal to TDT\\[3:0\\] (default)"]
  TDTF_1,
}
impl From<TDTF_A> for bool {
  #[inline(always)]
  fn from(variant: TDTF_A) -> Self {
    match variant {
      TDTF_A::TDTF_0 => false,
      TDTF_A::TDTF_1 => true,
    }
  }
}
#[doc = "Reader of field `TDTF`"]
pub type TDTF_R = crate::R<bool, TDTF_A>;
impl TDTF_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TDTF_A {
    match self.bits {
      false => TDTF_A::TDTF_0,
      true => TDTF_A::TDTF_1,
    }
  }
  #[doc = "Checks if the value of the field is `TDTF_0`"]
  #[inline(always)]
  pub fn is_tdtf_0(&self) -> bool {
    *self == TDTF_A::TDTF_0
  }
  #[doc = "Checks if the value of the field is `TDTF_1`"]
  #[inline(always)]
  pub fn is_tdtf_1(&self) -> bool {
    *self == TDTF_A::TDTF_1
  }
}
#[doc = "General Purpose Counter 0 Timeout Flag\


（parentNode）：直接的那个上级节点
- 子节点关系（childNodes）：直接的下级节点
- 同级节点关系（sibling）：拥有同一个父节点的节点

[slide] {:.flexbox.vleft}
## Node对象的属性
### 特征相关的属性
- nodeName 节点名称
- nodeType 节点类型
- nodeValue 节点文本值
	- 只有Text节点、Comment节点、XML文档的CDATA节点有文本值，其他类型的节点一律返回null。
- textContent 当前节点和它的所有后代节点的文本内容
- baseURI 当前网页的绝对路径

[slide] {:.flexbox.vleft}
## Node对象的属性
### nodeName和nodeType

      类型
      nodeName
      nodeType

      ELEMENT_NODE
      大写的HTML元素名
      1

      ATTRIBUTE_NODE
      等同于Attr.name
      2

      TEXT_NODE
      #text
      3

      COMMENT_NODE
      #comment
      8

      DOCUMENT_NODE
      #document
      9

      DOCUMENT_FRAGMENT_NODE
      #document-fragment
      11

      DOCUMENT_TYPE_NODE
      等同于DocumentType.name
      10

[slide] {:.flexbox.vleft}
## Node对象的属性
### 相关节点属性
- ownerDocument 当前节点所在的顶层文档对象，即document对象
- nextSibling 紧跟在当前节点后面的第一个同级节点
- previousSibling 当前节点前面的、距离最近的一个同级节点
- parentNode 当前节点的父节点
- childNodes 当前节点的所有子节点的 NodeList集合
- firstChild、lastChild 第一个最后一个子节点

[slide] {:.flexbox.vleft}
## 删除空白文本节点

```javascript
//删除空白文本节点
function cleanWhitespace(element)
{
	//遍历子节点
    for(var i=0; i<element.childNodes.length; i++)
    {
        var node = element.childNodes[i];
        //如果是文本节点，空节点
        if(node.nodeType == 3 && !/\S/.test(node.nodeValue))
        {
            node.parentNode.removeChild(node);
        }
    }
}
```

[slide] {:.flexbox.vleft}
## Node对象的方法
- appendChild 附加节点
- hasChildNodes 判断是否有子节点
- cloneNode 克隆节点
- insertBefore 在某节点前插入子节点
- removeChild 删除节点
- replaceChild 替换节点
- normalize 清理当前节点内部的所有Text节点

[slide] {:.flexbox.vleft}
## document节点
- 属性
	- 内部节点属性
	- 节点集合属性
	- 文档信息属性
- 方法
	- 读写相关方法
	- 查找节点方法
	- 生


_t[textLength];
  DWRITE_SHAPING_TEXT_PROPERTIES* textProperties;
  textProperties = new DWRITE_SHAPING_TEXT_PROPERTIES[textLength];
retry_getglyphs:
  uint16_t* glyphIndices = new uint16_t[maxGlyphCount];
  DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProperties;
  glyphProperties = new DWRITE_SHAPING_GLYPH_PROPERTIES[maxGlyphCount];

  hr = analyzer->GetGlyphs (textString, textLength, fontFace, false,
			    isRightToLeft, &runHead->mScript, localeName,
			    nullptr, &dwFeatures, featureRangeLengths, 1,
			    maxGlyphCount, clusterMap, textProperties,
			    glyphIndices, glyphProperties, &glyphCount);

  if (unlikely (hr == HRESULT_FROM_WIN32 (ERROR_INSUFFICIENT_BUFFER)))
  {
    delete [] glyphIndices;
    delete [] glyphProperties;

    maxGlyphCount *= 2;

    goto retry_getglyphs;
  }
  if (FAILED (hr))
    FAIL ("Analyzer failed to get glyphs.");

  float* glyphAdvances = new float[maxGlyphCount];
  DWRITE_GLYPH_OFFSET* glyphOffsets = new DWRITE_GLYPH_OFFSET[maxGlyphCount];

  /* The -2 in the following is to compensate for possible
   * alignment needed after the WORD array.  sizeof (WORD) == 2. */
  unsigned int glyphs_size = (scratch_size * sizeof (int) - 2)
			     / (sizeof (WORD) +
				sizeof (DWRITE_SHAPING_GLYPH_PROPERTIES) +
				sizeof (int) +
				sizeof (DWRITE_GLYPH_OFFSET) +
				sizeof (uint32_t));
  ALLOCATE_ARRAY (uint32_t, vis_clusters, glyphs_size);

#undef ALLOCATE_ARRAY

  int fontEmSize = font->face->get_upem ();
  if (fontEmSize < 0) fontEmSize = -fontEmSize;

  if (fontEmSize < 0) fontEmSize = -fontEmSize;
  double x_mult = (double) font->x_scale / fontEmSize;
  double y_mult = (double) font->y_scale / fontEmSize;

  hr = analyzer->GetGlyphPlacements (textString, clusterMap, textProperties,
				     textLength, glyphIndices, glyphProperties,
				     glyphCount, fontFace, fontEmSize,
				     false, isRightToLeft, &runHead->mScript, localeName,
				     &dwFeatures, featureRangeLengths, 1,
				     glyphAdvances, glyphOffsets);

  if (FAILED (hr))
    FAIL ("Analyzer failed to get glyph placements.");

  IDWriteTextAnalyzer1* analyzer1;
  analyzer->QueryInterface (&analyzer1);

  if (analyzer1 && lineWidth)
  {
    DWRITE_JUSTIFICATION_OPPORTUNITY* justificationOpportunities =
      new DWRITE_JUSTIFICATION_OPPORTUNITY[maxGlyphCount];
    hr = analyzer1->GetJustificationOpportunities (fontFace, fontEmSize, runHead->mScript,
						   textLength, glyphCount, textString,
						   clusterMap, glyphProperties,
						   justificationOpportunities);

    if (FAILED (hr))
      FAIL ("Analyzer failed to get justification opportunities.");

    float* justifiedGlyphAdvances = new float[maxGlyphCount];
    DWRITE_GLYPH_OFFSET* justifiedGlyphOffsets = new DWRITE_GLYPH_OFFSET[glyphCount];
    hr = analyzer1->JustifyGlyphAdvances (lineWidth, glyphCount, justificationOpportunities,
					  glyphAdvances, glyphOffsets, justifiedGlyphAdvances,
					  justifiedGlyphOffsets);

    if (FAILED (hr)) FAIL ("Analyzer failed to get justify glyph advances.");

    DWRITE_SCRIPT_PROPERTIES scriptProperties;
    hr = analyzer1->GetScriptProperties (runHead->mScript, &scriptProperties);
    if (FAILED (hr)) FAIL


.mec-event-social {
    text-align: center;
}

.mec-single-event .mec-frontbox-title,
.mec-single-event .mec-wrap-checkout h4,
.mec-single-event .mec-events-meta-group-booking form>h4 {
    text-transform: uppercase;
    font-size: 15px;
    font-weight: bold;
    color: #313131;
    border-bottom: 4px solid #ebebeb;
    width: 100%;
    display: block;
    padding-bottom: 10px;
    position: relative;
    text-align: center;
}

.mec-single-event .mec-frontbox-title:before,
.mec-single-event .mec-wrap-checkout h4:before,
.mec-single-event .mec-events-meta-group-booking form>h4:before {
    padding: 1px 35px;
    border-bottom: 4px solid #40d9f1;
    font-size: 6px;
    content: "";
    text-align: center;
    position: absolute;
    bottom: -4px;
    margin-left: -35px;
    left: 50%;
}

.mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-month"],
.mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-year"] {
    width: 47% !important;
    margin-right: 12px;
    margin-top: 5px;
    display: inline-block !important;
}

@media (max-width: 768px) {

    .mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-month"],
    .mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-year"] {
        width: 100% !important;
        margin-right: 0;
        display: block !important;
    }
}

/* Booking Checkboxes */
.mec-single-event .mec-booking .mec-booking-dates-checkboxes {
    margin-bottom: 22px;
}

.mec-single-event .mec-booking .mec-booking-dates-checkboxes label,
.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes label {
    margin-bottom: 3px;
    line-height: 1.1;
}

.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes label {
    display: flex;
}

.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox],
.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type="checkbox"],
.mec-booking input[type="checkbox"] {
    width: 17px;
    height: 17px;
    min-height: unset;
    border-radius: 3px;
    margin-top: -2px;
    margin-right: 7px !important;
    margin-bottom: 0 !important;
}

.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type="checkbox"] {
    margin-top: -1px;
}

.mec-events-meta-group-booking-shortcode .mec-booking-dates-checkboxes label {
    display: flex;
}

.mec-events-meta-group-booking-shortcode .mec-book


--------------------------------------------------------------------------------
-- Module Declaration
--

local mod, CL = BigWigs:NewBoss("So'leah", 2441, 2455)
if not mod then return end
mod:RegisterEnableMob(177269) -- So'leah
mod:SetEncounterID(2442)
mod:SetRespawnTime(30)
mod:SetStage(1)

--------------------------------------------------------------------------------
-- Locals
--

local powerOverwhelmingCount = 1
local energyFragmentationRemaining = 2
local hyperlightNovaRemaining = 2

--------------------------------------------------------------------------------
-- Localization
--

local L = mod:GetLocale()
if L then
	L.group = "GROUP"
end

--------------------------------------------------------------------------------
-- Initialization
--

function mod:GetOptions()
	return {
		"stages",
		-- Stage One: Final Preparations
		{350796, "HEALER"}, -- Hyperlight Spark
		353635, -- Collapsing Star
		350804, -- Collapsing Energy
		351124, -- Summon Assassins
		{351119, "NAMEPLATE"}, -- Shuriken Blitz
		-- Stage Two: Power Overwhelming
		351086, -- Power Overwhelming
		350875, -- Hyperlight Jolt
		351096, -- Energy Fragmentation
		351646, -- Hyperlight Nova
		-- Hard Mode
		{357190, "ME_ONLY"}, -- Star Vulnerability
	}, {
		[350796] = -23344, -- Stage One: Final Preparations
		[351086] = -23340, -- Stage Two: Power Overwhelming
		[357190] = CL.hard,
	}
end

function mod:OnBossEnable()
	-- Staging
	self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", nil, "boss1") -- Phase Transition

	-- Stage One: Final Preparations
	self:Log("SPELL_CAST_START", "HyperlightSpark", 350796)
	self:Log("SPELL_CAST_START", "CollapsingStar", 353635)
	self:Log("SPELL_AURA_APPLIED", "CollapsingEnergyApplied", 350804)
	self:Log("SPELL_AURA_APPLIED_DOSE", "CollapsingEnergyApplied", 350804)
	self:Log("SPELL_MISSED", "CollapsingEnergyApplied", 350804)
	self:Log("SPELL_AURA_REMOVED", "CollapsingEnergyRemoved", 350804)
	self:Log("SPELL_CAST_START", "SummonAssassins", 351124)
	self:RegisterEngageMob("SoCartelAssassinEngaged", 177716)
	self:Log("SPELL_CAST_START", "ShurikenBlitz", 351119)
	self:Death("SoCartelAssassinDeath", 177716)

	-- Stage Two: Power Overwhelming
	self:Log("SPELL_CAST_SUCCESS", "PowerOverwhelming", 351086)
	self:Log("SPELL_CAST_START", "HyperlightJolt", 350875)
	self:Log("SPELL_AURA_REMOVED", "PowerOverwhelmingRemoved", 351086)
	self:Log("SPELL_CAST_START", "EnergyFragmentation", 351096)
	self:Log("SPELL_CAST_START", "HyperlightNova", 351646)

	-- Hard Mode
	self:Log("SPELL_AURA_APPLIED", "StarVulnerabilityApplied", 357190)
	self:Log("SPELL_AURA_APPLIED_DOSE", "StarVulnerabilityApplied", 357190)
end

function mod:OnEngage()
	powerOverwhelmingCount = 1
	energyFragmentationRemaining = 2
	hyperlightNovaRemaining = 2
	self:SetStage(1)
	self:CDBar(351124, 5.9) -- Summon Assassins
	self:CDBar(350796, 12.0) -- Hyperlight Spark
	self:CDBar(353635, 20.5


startingGeohash;

  while (true) {
    const geohashPolygon = bboxPolygon(
      switchBbox(ngeohash.decode_bbox(currentGeohash))
    );

    let addGeohash = false;

    switch (hashMode) {
      case 'intersect':
        // Only add geohash if they intersect/overlap with the original polygon
        addGeohash = booleanOverlap(segmentPolygon, geohashPolygon);

        if (addGeohash && minIntersectArea > 0) {
          const intersected = intersect(turfShape, geohashPolygon)!;
          addGeohash = area(intersected) >= minIntersectArea;
        }
        break;
      case 'envelope':
        addGeohash = true; // add every geohash
        break;
      case 'insideOnly':
        // Only add geohash if it is completely within the original polygon
        addGeohash =
          booleanWithin(geohashPolygon, turfShape) &&
          allRectangleEdgesWithin(geohashPolygon, turfShape);
        // Extra check to avoid turf.js bug
        // REMOVE allRectangleEdgesWithin CHECK IF POSSIBLE -> NEGATIVE PERFORMANCE IMPACT
        break;
      case 'border':
        // Only add geohash if they overlap
        addGeohash =
          booleanOverlap(segmentPolygon, geohashPolygon) &&
          !booleanWithin(geohashPolygon, turfShape);
        break;
    }

    // Check if geohash polygon overlaps/intersects with original polygon
    // I need to check both because of some weird bug with turf

    // If yes -> add it to the list of geohashes
    if (addGeohash) {
      geohashList.push(currentGeohash);
    }

    // Save rowProgress
    // maxX plus some small amount to avoid overlapping edges due to lat/long inaccuracies
    rowProgress = bbox(geohashPolygon)[2] + 0.00001;

    // TODO: Risky change
    const maxX = geohashPolygon.bbox ? geohashPolygon.bbox[2] : Infinity;
    if (maxX >= envelopeBbox[2]) {
      // If right edge of current geohash is out of bounds we are done
      // TODO: Risky change
      // currentGeohash = null;
      break;
    }

    // Get eastern neighbor and set him as next geohash to be checked
    currentGeohash = ngeohash.neighbor(currentGeohash, [0, 1]);
  }

  return geohashList;
}

function allRectangleEdgesWithin(
  polygon1: Feature<Polygon>,
  polygon2: Feature<Polygon>
) {
  const box = bbox(polygon1);
  const edge = lineString([
    [box[0], box[3]], // Top edge
    [box[2], box[3]], // Top edge
    [box[2], box[3]], // Right edge
    [box[2], box[1]], // Right edge
    [box[2], box[1]], // Bottom edge
    [box[0], box[1]], // Bottom edge
    [box[0], box[1]], // Left edge
    [box[0], box[3]] // Left edge
  ]);
  // Make sure the polygon does not split the line into separate segments
  return lineSplit(edge, polygon2).features.length === 0;
}
// 取出这个数组的前n项返回

// 这个数组第一项可能是任意数组,那么不得不写成any[]的形式
function take(arr: any[], n: number): any[] {
    if(n >= arr.length) {
        return arr;
    }
    const newArr: any[] = [];
    for (let i = 0; i < n; i++){
        newArr.push(arr[i]);
    }
    return newArr;
}

// 泛型
// 有时,书写函数时,会丢失一些类型信息(多个位置的类型应该保持一致或有关联)
// 泛型是指: 附属于函数,类,接口,类型别名之上的类型
// 泛型相当于一个类型变


/*
 * TurnOrderProcessor.h, part of VCMI engine
 *
 * Authors: listed in file AUTHORS in main folder
 *
 * License: GNU General Public License v2.0 or later
 * Full text of license available in license.txt file, in main folder
 *
 */
#pragma once

#include "../../lib/GameConstants.h"

class CGameHandler;

class TurnOrderProcessor : boost::noncopyable
{
	CGameHandler * gameHandler;

	struct PlayerPair
	{
		PlayerColor a;
		PlayerColor b;

		bool operator == (const PlayerPair & other) const
		{
			return (a == other.a && b == other.b) || (a == other.b && b == other.a);
		}

		template<typename Handler>
		void serialize(Handler & h)
		{
			h & a;
			h & b;
		}
	};

	std::vector<PlayerPair> blockedContacts;

	std::set<PlayerColor> awaitingPlayers;
	std::set<PlayerColor> actingPlayers;
	std::set<PlayerColor> actedPlayers;

	std::optional<int> simturnsMinDurationDays;
	std::optional<int> simturnsMaxDurationDays;

	/// Returns date on which simturns must end unconditionally
	int simturnsTurnsMaxLimit() const;

	/// Returns date until which simturns must play unconditionally
	int simturnsTurnsMinLimit() const;

	/// Returns true if players are close enough to each other for their heroes to meet on this turn
	bool playersInContact(PlayerColor left, PlayerColor right) const;

	/// Returns true if waiting player can act alongside with currently acting player
	bool computeCanActSimultaneously(PlayerColor active, PlayerColor waiting) const;

	/// Returns true if left player must act before right player
	bool mustActBefore(PlayerColor left, PlayerColor right) const;

	/// Returns true if player is ready to start turn
	bool canStartTurn(PlayerColor which) const;

	/// Starts turn for all players that can start turn
	void tryStartTurnsForPlayers();

	void updateAndNotifyContactStatus();

	std::vector<PlayerPair> computeContactStatus() const;

	void doStartNewDay();
	void doStartPlayerTurn(PlayerColor which);
	void doEndPlayerTurn(PlayerColor which);

	bool isPlayerAwaitsTurn(PlayerColor which) const;
	bool isPlayerAwaitsNewDay(PlayerColor which) const;

public:
	TurnOrderProcessor(CGameHandler * owner);

	bool isContactAllowed(PlayerColor left, PlayerColor right) const;
	bool isPlayerMakingTurn(PlayerColor which) const;

	/// Add new player to handle (e.g. on game start)
	void addPlayer(PlayerColor which);

	/// NetPack call-in
	bool onPlayerEndsTurn(PlayerColor which);

	/// Ends player turn and removes this player from turn order
	void onPlayerEndsGame(PlayerColor which);

	/// Start game (or resume from save) and send PlayerStartsTurn pack to player(s)
	void onGameStarted();

	/// Permanently override duration of contactless simultaneous turns
	void setMinSimturnsDuration(int days);

	/// Permanently override duration of simultaneous turns with contact detection
	void setMaxSimturnsDuration(int days);

	template<typename Handler>
	void serialize(Handler & h)
	{
		h & blockedContacts;
		h & awaitingPlayers;
		h & actingPlayers;
		h & actedPlayers;
		h & simturnsMinDurationDays;
		h & simturnsMaxDurationDays;
	}
};


168.703 2.168h2.282l-1.846 1.341.706 2.168"/></svg>';
  static const String flag_for_flag_falkland_islands =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" preserveAspectRatio="xMidYMid meet" viewBox="0 0 64 64"><path fill="currentColor" d="M36.651 41.188c.173.039.342.047.504.006a.846.846 0 00.319-.176 10.063 10.063 0 01-.877-.619c.012.361.029.722.054.789m1.511-3.526c-.344.053-.671.367-.874.6.319.313.734.645 1.241.971.232-.604.373-1.115.376-1.135-.22-.25-.493-.473-.743-.436"/><path fill="currentColor" d="M32 2C15.432 2 2 15.432 2 32c0 16.568 13.432 30 30 30s30-13.432 30-30C62 15.432 48.568 2 32 2M5.45 32H4c0-3.102.515-6.083 1.45-8.875V32M32 14.299h-8.26L32 24.625v2.515L21.604 14.299h-5.9L30.033 32H26.1L14.3 17.25V32h-2.95V13.112a28.175 28.175 0 011.763-1.762H32v2.949m0-8.849h-8.876A27.858 27.858 0 0132 4v1.45m5.346 15.248h15.179v9.341s-2.847-1.967-3.795-1.967-2.701 1.967-3.794 1.967-2.847-1.967-3.794-1.967c-.949 0-3.796 1.967-3.796 1.967v-9.341m11.385 11.8c-.113 0-.238.031-.371.08.001-.037.002-.072.005-.104.037-.328.652-.898.652-.898l-1.5.348.016-1.348c.452-.303.873-.537 1.196-.537.948 0 3.795 1.967 3.795 1.967v1.475c0 .32-.026.633-.075.941-.585-.395-2.911-1.924-3.718-1.924m1.494 2.725c-.934.113-2.383.291-2.383.311 0-.029-.014.488-.017.658a7.71 7.71 0 01-.361.273l.017-1.43c.474-.32.913-.572 1.249-.572.322 0 .916.353 1.495.76m-4.181-2.239c.11.451.255.84.29.84.038 0 .437-.6.871-.629.014-.002.029.002.044.002l-.001.029c-.801.561-1.67 1.236-2.313 1.236-.167 0-.354-.057-.546-.133l.009-1.201c.463-.029 1.059.307 1.024.307s-.181-.451-.181-.779c0-.166.137-.504.273-.801.48-.203 1.018-.582 1.54-.953.092.021.166.035.219.041l-.012 1.039-.964.223c.002 0-.361.33-.253.779m1.183 2.225-.017 1.426c-.591.377-1.438.771-2.396.756a10.495 10.495 0 01-.459-.016c.006-.219.012-.605.017-1.088.199.082.392.143.564.143.636 0 1.495-


// https://html.spec.whatwg.org/multipage/images.html#when-to-obtain-images
  static Future<ImageLoadResponse> obtainImage(Element element, Uri url) async {
    var self = element as ImageElement;
    ImageRequest request = self._currentRequest = ImageRequest.fromUri(url);
    // Increment count when request.
    self.ownerDocument.incrementRequestCount();

    final data = await request.obtainImage(self.ownerDocument.controller);

    // Decrement count when response.
    self.ownerDocument.decrementRequestCount();

    return data;
  }

  /// Anti-shake and throttling
  final _debounce = Debounce(milliseconds: 5);

  void _startLoadNewImage() {
    if (_resolvedUri == null) {
      // TODO: should use empty image;
      return;
    }

    // Increment load event delay count before decode.
    ownerDocument.incrementLoadEventDelayCount();

    _debounce.run(() {
      _updateImageData();
    });
  }

  // Reload current image when width/height/boxFit changed.
  // If url is changed, please call [_startLoadNewImage] instead.
  void _reloadImage() {
    if (_isSVGMode) {
      // In svg mode, we don't need to reload
    } else {
      _debounce.run(() {
        _updateImageData();
      });
    }
  }

  Uri? _resolveResourceUri(String src) {
    String base = ownerDocument.controller.url;
    try {
      return ownerDocument.controller.uriParser!
          .resolve(Uri.parse(base), Uri.parse(src));
    } catch (_) {
      // Ignoring the failure of resolving, but to remove the resolved hyperlink.
      return null;
    }
  }

  void _stylePropertyChanged(String property, String? original, String present,
      {String? baseHref}) {
    if (property == WIDTH || property == HEIGHT) {
      // Resize image
      if (_shouldScaling && _resolvedUri != null) {
        _reloadImage();
      } else {
        _resizeImage();
      }
    } else if (property == OBJECT_FIT && _renderImage != null) {
      _renderImage!.fit = renderBoxModel!.renderStyle.objectFit;
    } else if (property == OBJECT_POSITION && _renderImage != null) {
      _renderImage!.alignment = renderBoxModel!.renderStyle.objectPosition;
    }
  }
}

// https://html.spec.whatwg.org/multipage/images.html#images-processing-model
enum _ImageRequestState {
  // The user agent hasn't obtained any image data, or has obtained some or
  // all of the image data but hasn't yet decoded enough of the image to get
  // the image dimensions.
  unavailable,

  // The user agent has obtained some of the image data and at least the
  // image dimensions are available.
  partiallyAvailable,

  // The user agent has obtained all of the image data and at least the image
  // dimensions are available.
  completelyAvailable,

  // The user agent has obtained all of the image data that it can, but it
  // cannot even decode the image enough to get the image dimensions (e.g.
  // the image is corrupted, or the format is not supported, or no data
  // could be obtained).
  broken,
}

// https://html.spec.whatwg.org/multipage/images.html#image-request
class ImageRequest {
  ImageRequest.fromUri(
    this.currentUri, {
    this.state = _ImageRequestState.unavailable,
  });

  /// The request uri.
  Uri currentUri;

  /// Current state of image request.
  _ImageRequestState state;

  /// When an image request's state is either partially available or completely available,
  /// the image request is said to be available.
  bool get available =>
      state == _ImageRequestState.completelyAvailable ||
      state == _ImageRequestState.partiallyAvaila


 "=", "A\u0316\u0300",      // Reordering --> equal
        };
        c.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
        compareArray(c, test2);
    }

    // Support for Swedish gone in 1.1.6 (Can't create Swedish collator)
    //
    public void Test4141640() {
        //
        // Rather than just creating a Swedish collator, we might as well
        // try to instantiate one for every locale available on the system
        // in order to prevent this sort of bug from cropping up in the future
        //
        Locale[] locales = Collator.getAvailableLocales();

        for (int i = 0; i < locales.length; i++) {
            try {
                Collator c = Collator.getInstance(locales[i]);
            } catch (Exception e) {
                errln("Caught " + e + " creating collator for " + locales[i]);
            }
        }
    }

    // getCollationKey throws exception for spanish text
    // Cannot reproduce this bug on 1.2, however it DOES fail on 1.1.6
    //
    public void Test4139572() {
        //
        // Code pasted straight from the bug report
        //
        // create spanish locale and collator
        Locale l = new Locale("es", "es");
        Collator col = Collator.getInstance(l);

        // this spanish phrase kills it!
        col.getCollationKey("Nombre De Objeto");
    }

    // RuleBasedCollator doesn't use getCollationElementIterator internally
    //
    public void Test4146160() throws ParseException {
        //
        // Use a custom collator class whose getCollationElementIterator
        // methods increment a count....
        //
        My4146160Collator.count = 0;
        new My4146160Collator().getCollationKey("1");
        if (My4146160Collator.count < 1) {
            errln("getCollationElementIterator not called");
        }

        My4146160Collator.count = 0;
        new My4146160Collator().compare("1", "2");
        if (My4146160Collator.count < 1) {
            errln("getCollationElementIterator not called");
        }
    }

    static class My4146160Collator extends RuleBasedCollator {
        public My4146160Collator() throws ParseException {
            super(Regression.en_us.getRules());
        }

        public CollationElementIterator getCollationElementIterator(
                                            String text) {
            count++;
            return super.getCollationElementIterator(text);
        }
        public CollationElementIterator getCollationElementIterator(
                                            CharacterIterator text) {
            count++;
            return super.getCollationElementIterator(text);
        }

        public static int count = 0;
    };

    // CollationElementIterator.previous broken for expanding char sequences
    //
    public void Test4179686() throws ParseException {

        // Create a collator with a few expanding character sequences in it....
        RuleBasedCollator coll = new RuleBasedCollator(en_us.getRules()
                                                    + " & ae ; \u00e4 & AE ; \u00c4"
                                                    + " & oe ; \u00f6 & OE ; \u00d6"
                                                    + " & ue ; \u00fc & UE ; \u00dc");

        String text = "T\u00f6ne"; // o-umlaut

        CollationElementIterator iter = coll.getCollationElementIterator(text);
        Vector elements = new Vector();
        int elem;

        // Iterate forward and collect all of the elements into a Vector
        while ((elem = iter.next()) != iter.NULLORDER) {
            elements.addElement(new Integer(elem));
        }

        // Now iterate backward and make sure they're the same
        int index = elements.size() - 1;
        while


"},
                        {field: 'preview', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},
                        {field: 'url', title: __('Url'), formatter: Controller.api.formatter.url, visible: false},
                        {field: 'filename', title: __('Filename'), sortable: true, formatter: Controller.api.formatter.filename, operate: 'like'},
                        {
                            field: 'filesize', title: __('Filesize'), operate: 'BETWEEN', sortable: true, formatter: function (value, row, index) {
                                var size = parseFloat(value);
                                var i = Math.floor(Math.log(size) / Math.log(1024));
                                return (size / Math.pow(1024, i)).toFixed(i < 2 ? 0 : 2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
                            }
                        },
                        {field: 'imagewidth', title: __('Imagewidth'), sortable: true},
                        {field: 'imageheight', title: __('Imageheight'), sortable: true},
                        {field: 'imagetype', title: __('Imagetype'), sortable: true, formatter: Table.api.formatter.search, operate: 'like'},
                        {field: 'storage', title: __('Storage'), formatter: Table.api.formatter.search, operate: 'like'},
                        {field: 'mimetype', title: __('Mimetype'), formatter: Controller.api.formatter.mimetype},
                        {
                            field: 'createtime',
                            title: __('Createtime'),
                            formatter: Table.api.formatter.datetime,
                            operate: 'RANGE',
                            addclass: 'datetimerange',
                            sortable: true,
                            width: 150
                        },
                        {
                            field: 'operate',
                            title: __('Operate'),
                            table: table,
                            events: Table.api.events.operate,
                            formatter: Table.api.formatter.operate
                        }
                    ]
                ],
            });

            // 绑定过滤事件
            $('.filter-type ul li a', table.closest(".panel-intro")).on('click', function (e) {
                $(this).closest("ul").find("li").removeClass("active");
                $(this).closest("li").addClass("active");
                var field = 'mimetype';
                var value = $(this).data("value") || '';
                var object = $("[name='" + field + "']", table.closest(".bootstrap-table").find(".commonsearch-table"));
                if (object.prop('tagName') == "SELECT") {
                    $("option[value='" + value + "']", object).prop("selected", true);
                } else {
                    object.val(value);
                }
                table.trigger("uncheckbox");
                table.bootstrapTable('refresh', {pageNumber: 1});
            });

            // 为表格绑定事件
            Table.api.bindevent(table);

            // 附件归类
            $(document).on('click', '.btn-classify', function () {
                var ids = Table.api.selectedids(table);
                Layer.open({
                    title: __('Classify'),
                    content: Template("typetpl", {}),
                    btn: [__('OK')],
                    yes: function (index, layero) {
                        var category = $("select[name='category']", layero).val();
                        Fast.api.ajax({
                            url: "general.attachment/classify",
                            type: "post",
                            data: {category: category, ids: ids.join(',')},
                        }, function () {
                            table.bootstrapTable('refresh', {});
                            Layer.close(index);
                        });
                    },
                    success: function (layero, index) {
                    }
                });
            });

        },
        select: function () {
            // 初始


er<'_>) -> fmt::Result {
        f.debug_list().entries(&*self.variants).finish()
    }
}

#[derive(Debug, Clone, Eq, PartialEq)]
pub struct ConditionalGroupContent {
    pub(crate) content: Content,

    /// In what mode the content should be printed.
    /// * Flat -> Omitted if the enclosing group is a multiline group, printed for groups fitting on a single line
    /// * Multiline -> Omitted if the enclosing group fits on a single line, printed if the group breaks over multiple lines.
    pub(crate) mode: PrintMode,

    /// The id of the group for which it should check if it breaks or not. The group must appear in the document
    /// before the conditional group (but doesn't have to be in the ancestor chain).
    pub(crate) group_id: Option<GroupId>,
}

impl ConditionalGroupContent {
    pub fn new(content: FormatElement, mode: PrintMode) -> Self {
        Self {
            content: Box::new(content),
            mode,
            group_id: None,
        }
    }

    pub fn with_group_id(mut self, id: Option<GroupId>) -> Self {
        self.group_id = id;
        self
    }
}

/// See [token] for documentation
#[derive(Eq, Clone)]
pub enum Token {
    /// Token constructed by the formatter from a static string
    Static { text: &'static str },
    /// Token constructed from the input source as a dynamics
    /// string and a range of the input source
    Dynamic {
        // There's no need for the text to be mutable, using `Box<str>` safes 8 bytes over `String`.
        text: Box<str>,
        // The position of the dynamic token in the unformatted source code
        source_position: TextSize,
    },
    /// A token for a text that is taken as is from the source code (input text and formatted representation are identical).
    /// Implementing by taking a slice from a `SyntaxToken` to avoid allocating a new string.
    SyntaxTokenSlice {
        /// The start position of the token in the unformatted source code
        source_position: TextSize,
        /// The token text
        slice: SyntaxTokenText,
    },
}

impl Debug for Token {
    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
        // This does not use debug_tuple so the tokens are
        // written on a single line even when pretty-printing
        match self {
            Token::Static { text } => write!(fmt, "StaticToken({:?})", text),
            Token::Dynamic { text, .. } => write!(fmt, "DynamicToken({:?})", text),
            Token::SyntaxTokenSlice {
                slice: token_text, ..
            } => {
                write!(fmt, "SyntaxTokenSlice({:?})", token_text)
            }
        }
    }
}

impl Token {
    /// Get the range of the input source covered by this token,
    /// or None if the token was synthesized by the formatter
    pub fn source_position(&self) -> Option<&TextSize> {
        match self {
            Token::Static { .. } => None,
            Token::Dynamic {
                source_position, ..
            } => Some(source_position),
            Token::SyntaxTokenSlice {
                source_position, ..
            } => Some(source_position),
        }
    }
}

// Token equality only compares the text content
impl PartialEq for Token {
    fn eq(&self, other: &Self) -> bool {
        **self == **other
    }
}

const LINE_SEPARATOR: char = '\u{2028}';
const PARAGRAPH_SEPARATOR: char = '\u{2029}';
pub const LINE_TERMINATORS: [char; 3] = ['\r', LINE_SEPARATOR, PARAGRAPH_SEPARATOR];

/// Replace the line terminators matching the provided list with "\n"
/// since its the only line break type supported by the printer
pub fn normalize_newlines<const N: usize>(text: &str,


 with the user identified by `u`. `u` is expected to be the username of
// the user in question (not the current, requesting user).
//
// This returns, in order, a boolean that indicates whether or not the current user
// has the required tenancy to modify the indicated Delivery Service, and an error
// indicating what, if anything, went wrong during the check.
// returned errors is not nil, otherwise its value is undefined.
//
// Note: If no such delivery service exists, the return values shall indicate that the
// user isn't authorized.
func IsUserAuthorizedToModifyJobsMadeByUsername(inf *api.Info, u string) (bool, error) {
	var t uint
	row := inf.Tx.Tx.QueryRow(`SELECT tenant_id FROM tm_user WHERE username=$1`, u)
	if err := row.Scan(&t); err != nil {
		if err == sql.ErrNoRows {
			return false, nil //I do this to conceal the existence of DSes for which the user has no permission to see
		}
		return false, err
	}

	return tenant.IsResourceAuthorizedToUserTx(int(t), inf.User, inf.Tx.Tx)
}
package v13

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

import "github.com/apache/trafficcontrol/v8/lib/go-tc"

// PhysLocations -  PhysLocationsResponse to get the "response" top level key
// swagger:response PhysLocations
// in: body
type PhysLocations struct {
	// PhysLocation Response Body
	// in: body
	PhysLocationsResponse tc.PhysLocationsResponse `json:"response"`
}

// PhysLocation -  PhysLocationResponse to get the "response" top level key
// swagger:response PhysLocation
// in: body
type PhysLocation struct {
	// PhysLocation Response Body
	// in: body
	PhysLocationResponse tc.PhysLocationResponse
}

// PhysLocationQueryParams
//
// swagger:parameters GetPhysLocations
type PhysLocationQueryParams struct {

	// PhysLocationsQueryParams

	// The ID of the region associated with this Physical Location
	//
	RegionID int `json:"regionId"`

	//
	//
	Orderby string `json:"orderby"`
}

// swagger:parameters PostPhysLocation
type PhysLocationPostParam struct {
	// PhysLocation Request Body
	//
	// in: body
	// required: true
	PhysLocation tc.PhysLocationNullable
}

// swagger:parameters GetPhysLocationById DeletePhysLocation
type PhysLocationPathParams struct {

	// Id associated to the PhysLocation
	// in: path
	ID int `json:"id"`
}

// PostPhysLocation swagger:route POST /phys_locations PhysLocation PostPhysLocation
//
// # Create a PhysLocation
//
// # A PhysLocation is a collection of Delivery Services
//
// Responses:
//
//	200: Alerts
func PostPhysLocation(entity PhysLocationPostParam) (PhysLocation, Alerts) {
	return PhysLocation{}, Alerts{}
}

// GetPhysLocations swagger:route GET /phys_locations PhysLocation GetPhysLocations
//
// # Retrieve a list of Phys


		RenderTexture.Destroy(t);
			}
			skyboxTextures = null;
		}

		resolution = GetIdealResolution();
		skyboxTextures = new RenderTexture[6];
		for (int i = 0; i < 6; i++)
		{
			var t = new RenderTexture(resolution, resolution, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
			t.wrapMode = TextureWrapMode.Mirror;
			t.filterMode = FilterMode.Trilinear;
			t.enableRandomWrite = true;
			t.autoGenerateMips = false;
			t.useMipMap = true;
			t.Create();
			t.name = textureNames[i];
			skyboxTextures[i] = t;
		}

		if (targetComponents == null || targetComponents.Length == 0)
			targetComponents = GetComponentsInChildren<Skybox>();

		foreach (var target in targetComponents)
		{
			var material = target.material;
			for (int i = 0; i < 6; i++)
				material.SetTexture(textureNames[i], skyboxTextures[i]);
		}

	}

	void Generate()
	{
		if (closestSun != null)
			closestSunDirection = -closestSun.forward;

		shader.SetFloat("_time", Time.realtimeSinceStartup);
		shader.SetVector("_sunDir", closestSunDirection);

		for (int i = 0; i < 6; i++)
			shader.SetTexture(0, textureNames[i], skyboxTextures[i]);
		shader.Dispatch(0, resolution / 16, resolution / 16, 6);
		for (int i = 0; i < 6; i++)
			if (skyboxTextures[i].useMipMap && !skyboxTextures[i].autoGenerateMips)
				skyboxTextures[i].GenerateMips();
	}

}


(r1)
/* 802A4514 002A0174  83 A1 00 14 */	lwz r29, 0x14(r1)
/* 802A4518 002A0178  80 01 00 24 */	lwz r0, 0x24(r1)
/* 802A451C 0


id="u_0_0">Keep me signed in

<input type="hidden" autocomplete="off" id="default_persistent" name="default_persistent" value="0">
</form>

Get the app on  iOS ,  Windows Phone ,  Android


------------------------------------------
-- Effortless wmii-style dynamic tagging.
------------------------------------------
-- Lucas de Vries <lucas@glacicle.org>
-- Licensed under the WTFPL version 2
--   * http://sam.zoy.org/wtfpl/COPYING
-----------------------------------------
-- Cut version
-----------------------------------------

-- Grab environment
local ipairs = ipairs
local awful  = require("awful")
local table  = table
local capi   = { screen = screen }

-- Eminent: Effortless wmii-style dynamic tagging
module("eminent")

-- Grab the original functions we're replacing
local deflayout = nil
local orig = {
    new     = awful.tag.new,
    taglist = awful.widget.taglist.new,
    filter  = awful.widget.taglist.fil


llection-literals
    var points = <Point>[];
    var addresses = <String, Address>{};
    var counts = <int>{};
    // #enddocregion collection-literals
  }

  {
    var command = 'c';
    var options = ['a'];
    var modeFlags = ['b'] as List<String>?;
    var filePaths = ['p'];
    String removeExtension(String path) => path;

    // #docregion spread-etc
    var arguments = [
      ...options,
      command,
      ...?modeFlags,
      for (var path in filePaths)
        if (path.endsWith('.dart')) path.replaceAll('.dart', '.js'),
    ];
    // #enddocregion spread-etc
  }

  (Iterable lunchBox, Iterable words) {
    // #docregion dont-use-length
    if (lunchBox.isEmpty) return 'so hungry...';
    if (words.isNotEmpty) return words.join(' ');
    // #enddocregion dont-use-length
    return 'foo';
  };

  {
    // #docregion cast-list
    var stuff = <dynamic>[1, 2];
    var ints = List<int>.from(stuff);
    // #enddocregion cast-list
  }

  {
    // #docregion cast-map
    var stuff = <dynamic>[1, 2];
    var reciprocals = stuff.map<double>((n) => (n as int) * 2);
    // #enddocregion cast-map
  }

  // #docregion cast-at-create
  List<int> singletonList(int value) {
    var list = <int>[];
    list.add(value);
    return list;
  }
  // #enddocregion cast-at-create

  // #docregion cast-iterate
  void printEvens(List<Object> objects) {
    // We happen to know the list only contains ints.
    for (final n in objects) {
      if ((n as int).isEven) print(n);
    }
  }
  // #enddocregion cast-iterate

  // #docregion cast-from
  int median(List<Object> objects) {
    // We happen to know the list only contains ints.
    var ints = List<int>.from(objects);
    ints.sort();
    return ints[ints.length ~/ 2];
  }
  // #enddocregion cast-from

  (Iterable people) {
    // #docregion avoid-for-each
    for (final person in people) {
      /*...*/
    }
    // #enddocregion avoid-for-each
    // #docregion forEach-over-func
    people.forEach(print);
    // #enddocregion forEach-over-func
  };

  {
    // #docregion func-decl
    void main() {
      void localFunction() {
        /*...*/
      }
    }

    // #enddocregion func-decl
  }

  (Iterable names) {
    // #docregion use-tear-off
    var charCodes = [68, 97, 114, 116];
    var buffer = StringBuffer();

    // Function:
    charCodes.forEach(print);

    // Method:
    charCodes.forEach(buffer.write);

    // Named constructor:
    var strings = charCodes.map(String.fromCharCode);

    // Unnamed constructor:
    var buffers = charCodes.map(StringBuffer.new);
    // #enddocregion use-tear-off
  };

  {
    // #docregion default-separator
    void insert(Object item, {int at = 0}) {
      /* ... */
    }
    // #enddocregion default-separator
  }

  {
    // #docregion default-value-null
    void error([String? message]) {
      stderr.write(message ?? '\n');
    }

    // #enddocregion default-value-null
  }

  {
    // #docregion null-aware-promote
    int measureMessage(String? message) {
      if (message != null && message.isNot


[class*="tablet stackable"].table tr.marked.red.left {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #DB2828 inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #DB2828 inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].table tr.marked.red.right {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #DB2828 inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #DB2828 inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].inverted.table tr.marked.red.left {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #FF695E inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #FF695E inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].inverted.table tr.marked.red.right {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #FF695E inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #FF695E inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].table tr.marked.orange.left {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #F2711C inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #F2711C inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].table tr.marked.orange.right {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #F2711C inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #F2711C inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].inverted.table tr.marked.orange.left {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #FF851B inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #FF851B inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].inverted.table tr.marked.orange.right {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #FF851B inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, -0.2em 0 0 0 #FF851B inset;
}

.ui.ui.ui.ui[class*="tablet stackable"].table tr.marked.yellow.left {
  -webkit-box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.1) inset, 0.2em 0 0 0 #FBBD08 inset;
  box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0


inerTapGestureRecognizer(), (instance) {
          instance.onDoubleFinerTap = onDoubleFinerTap;
        }),
        CustomTouchGestureRecognizer:
            GestureRecognizerFactoryWithHandlers<CustomTouchGestureRecognizer>(
                () => CustomTouchGestureRecognizer(), (instance) {
          instance
            ..onOneFingerPanStart = onOneFingerPanStart
            ..onOneFingerPanUpdate = onOneFingerPanUpdate
            ..onOneFingerPanEnd = onOneFingerPanEnd
            ..onTwoFingerScaleUpdate = onTwoFingerScaleUpdate
            ..onTwoFingerScaleEnd = onTwoFingerScaleEnd
            ..onThreeFingerVerticalDragUpdate = onThreeFingerVerticalDragUpdate;
        }),
      });
}
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui;

import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_custom_cursor/cursor_manager.dart'
    as custom_cursor_manager;
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:wakelock/wakelock.dart';
import 'package:flutter_custom_cursor/flutter_custom_cursor.dart';
import 'package:flutter_improved_scrolling/flutter_improved_scrolling.dart';

import '../../consts.dart';
import '../../common/widgets/overlay.dart';
import '../../common/widgets/remote_input.dart';
import '../../common.dart';
import '../../mobile/widgets/dialog.dart';
import '../../models/model.dart';
import '../../models/platform_model.dart';
import '../../common/shared_state.dart';
import '../widgets/remote_menubar.dart';
import '../widgets/kb_layout_type_chooser.dart';

bool _isCustomCursorInited = false;
final SimpleWrapper<bool> _firstEnterImage = SimpleWrapper(false);

class RemotePage extends StatefulWidget {
  RemotePage({
    Key? key,
    required this.id,
    required this.menubarState,
    this.switchUuid,
  }) : super(key: key);

  final String id;
  final MenubarState menubarState;
  final String? switchUuid;
  final SimpleWrapper<State<RemotePage>?> _lastState = SimpleWrapper(null);

  FFI get ffi => (_lastState.value! as _RemotePageState)._ffi;

  @override
  State<RemotePage> createState() {
    final state = _RemotePageState();
    _lastState.value = state;
    return state;
  }
}

class _RemotePageState extends State<RemotePage>
    with AutomaticKeepAliveClientMixin, MultiWindowListener {
  Timer? _timer;
  String keyboardMode = "legacy";
  bool _isWindowBlur = false;
  final _cursorOverImage = false.obs;
  late RxBool _showRemoteCursor;
  late RxBool _zoomCursor;
  late RxBool _remoteCursorMoved;
  late RxBool _keyboardEnabled;

  final FocusNode _rawKeyFocusNode = FocusNode(debugLabel: "rawkeyFocusNode");

  Function(bool)? _onEnterOrLeaveImage4Menubar;

  late FFI _ffi;

  void _initStates(String id) {
    PrivacyModeState.init(id);
    BlockInputState.init(id);
    CurrentDisplayState.init(id);
    KeyboardEnabledState.init(id);
    ShowRemoteCursorState.init(id);
    RemoteCursorMovedState.init(id);
    final optZoomCursor = 'zoom-cursor';
    PeerBoolOption.init(id, optZoomCursor, () => false);
    _zoomCursor = PeerBoolOption.find(id, optZoomCurs


 {
        val funList = ArrayList<FunSpec>()
        var funSpecBuilder: FunSpec.Builder
        ksClassMap.forEach { (key, ksClass) ->
            val rxHttpTypeNames = ksClass.typeParameters.map { it.toTypeVariableName() }
            val param = ksClass.toClassName()
            val rxHttpName = "RxHttp${ksClass.simpleName.asString()}"
            val rxHttpParamName = rxhttpKClass.peerClass(rxHttpName)
            val methodReturnType = if (rxHttpTypeNames.isNotEmpty()) {
                rxHttpParamName.parameterizedBy(*rxHttpTypeNames.toTypedArray())
            } else {
                rxHttpParamName
            }

            val classTypeParams = ksClass.typeParameters.toTypeParameterResolver()
            //遍历public构造方法
            ksClass.getPublicConstructors().forEach { function ->
                val functionTypeParams = function.typeParameters
                    .toTypeParameterResolver(classTypeParams)
                //构造方法参数
                val parameterSpecs = function.parameters
                    .mapTo(ArrayList()) { it.toKParameterSpec(functionTypeParams) }
                val prefix = "return %T(%T("
                val postfix = "))"
                val methodBody = parameterSpecs
                    .joinToStringIndexed(", ", prefix, postfix) { index, it ->
                        if (index == 0 && it.type == STRING) {
                            "format(${it.name}, *formatArgs)"
                        } else if (it.isVararg()) "*${it.name}" else it.name
                    }
                if (parameterSpecs.firstOrNull()?.type == STRING) {
                    parameterSpecs.add(newParameterSpec("formatArgs", ANY, true, KModifier.VARARG))
                }
                FunSpec.builder(key)
                    .jvmStatic()
                    .addParameters(parameterSpecs)
                    .addTypeVariables(rxHttpTypeNames)
                    .addStatement(methodBody, rxHttpParamName, param)
                    .returns(methodReturnType)
                    .build()
                    .apply { funList.add(this) }
            }
            val superclass = ksClass.superclass()
            var prefix = "(param as ${ksClass.simpleName.asString()})."
            val rxHttpParam = when (superclass?.getQualifiedName()) {
                "rxhttp.wrapper.param.BodyParam" -> rxhttpKClass.peerClass("RxHttpBodyParam")
                "rxhttp.wrapper.param.FormParam" -> rxhttpKClass.peerClass("RxHttpFormParam")
                "rxhttp.wrapper.param.JsonParam" -> rxhttpKClass.peerClass("RxHttpJsonParam")
                "rxhttp.wrapper.param.JsonArrayParam" -> rxhttpKClass.peerClass("RxHttpJsonArrayParam")
                "rxhttp.wrapper.param.NoBodyParam" -> rxhttpKClass.peerClass("RxHttpNoBodyParam")
                else -> {
                    val typeName = superclass?.toTypeName()
                    if ((typeName as? ParameterizedTypeName)?.rawType?.toString() == "rxhttp.wrapper.param.AbstractBodyParam") {
                        prefix = "param."
                        rxhttpKClass.peerClass("RxHttpAbstractBodyParam")
                            .parameterizedBy(param, rxHttpParamName)
                    } else {
                        prefix = "param."
                        rxhttpKClass.parameterizedBy(param, rxHttpParamName)
                    }
                }
            }
            val rxHttpPostCustomFun = ArrayList<FunSpec>()
            FunSpec.constructorBuilder()
                .addParameter("param", param)
                .callSuperConstructor("param")
                .build()
                .apply {


l.

If you still want to try using the latest stable releases, you can set
`config.defaults.version = "*"`

Some plugins that are known to break with their outdated release will still
be forced to install the latest development version. To override that, specify
`version="*"` for those plugins. (see the **LazyVim** code)
:::

<!-- lazy:start -->

```lua title="lua/config/lazy.lua"
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  if vim.v.shell_error ~= 0 then
    vim.api.nvim_echo({
      { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
      { out, "WarningMsg" },
      { "\nPress any key to exit..." },
    }, true, {})
    vim.fn.getchar()
    os.exit(1)
  end
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  spec = {
    -- add LazyVim and import its plugins
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- import/override with your plugins
    { import = "plugins" },
  },
  defaults = {
    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
    lazy = false,
    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
    -- have outdated releases, which may break your Neovim install.
    version = false, -- always use the latest git commit
    -- version = "*", -- try installing the latest stable version for plugins that support semver
  },
  install = { colorscheme = { "tokyonight", "habamax" } },
  checker = {
    enabled = true, -- check for plugin updates periodically
    notify = false, -- notify on update
  }, -- automatically check for plugin updates
  performance = {
    rtp = {
      -- disable some rtp plugins
      disabled_plugins = {
        "gzip",
        -- "matchit",
        -- "matchparen",
        -- "netrwPlugin",
        "tarPlugin",
        "tohtml",
        "tutor",
        "zipPlugin",
      },
    },
  },
})

```

<!-- lazy:end -->
---
sidebar_position: 5
---

# Examples

<!-- examples:start -->

```lua
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
  -- add gruvbox
  { "ellisonleao/gruvbox.nvim" },

  -- Configure LazyVim to load gruvbox
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "gruvbox",
    },
  },

  -- change trouble config
  {
    "folke/trouble.nvim",
    -- opts will be merged with the parent spec
    opts = { use_diagnostic_signs = true },
  },

  -- disable trouble
  { "folke/trouble.nvim", enabled = false },

  -- override nvim-cmp and add cmp-emoji
  {
    "hrsh7th/nvim-


enarioWindow:updateScenarioProperties()
				end

				if name=="Acts" and r2.Scenario:getCurrentAct()==r2.Scenario:getBaseAct() and r2.Scenario.Acts.Size>1 then
					r2.ScenarioWindow:setAct( r2.Scenario.Acts[1] )
				end
			end
		end,

		-----------------------------------------------------------------------------
		onErase = function(this)
			r2.acts.deleteOldScenario = false
		end,
		getName = function(this)
			if this.Ghost_Name then return this.Ghost_Name end
			return this.Name
		end,
	}

	----------------------------------------------------------------------------
	-- add a line to the event menu
	function classScenario.initLogicEntitiesMenu(this, logicEntityMenu)
		local name = i18n.get("uiR2EDScenario")
		logicEntityMenu:addLine(name, "lua", "", "Scenario")
	end

	----------------------------------------------------------------------------
	-- add a line to the event sub menu
	function classScenario.initLogicEntitiesInstancesMenu(this, subMenu, calledFunction)
		local name = r2.Scenario:getName()
		subMenu:addLine(name, "lua", calledFunction.."('".. r2.Scenario.InstanceId .."')", r2.Scenario.InstanceId)
	end

	----------------------------------------------------------------------------
	-- add a line to the event menu
	function classScenario:getLogicTranslations()
		local logicTranslations = {
			["ApplicableActions"] = {
					--["Start Scenario Timing"]	= { menu=i18n.get( "uiR2AA0ScenarioStartTiming" ),
					--						text=i18n.get( "uiR2AA1ScenarioStartTiming" )},
					--["Stop Scenario Timing"]	= { menu=i18n.get( "uiR2AA0ScenarioStopTiming" ),
					--						text=i18n.get( "uiR2AA1ScenarioStopTiming" )},
					--["add scenario points"]	= { menu=i18n.get( "uiR2AA0ScenarioAddPoints" ),
					--						text=i18n.get( "uiR2AA1ScenarioAddPoints" )},
					--["succeed scenario"]	= { menu=i18n.get( "uiR2AA0ScenarioSucceed" ),
					--						text=i18n.get( "uiR2AA1ScenarioSucceed" )},
					--["fail scenario"]	= { menu=i18n.get( "uiR2AA0ScenarioFail" ),
					--						text=i18n.get( "uiR2AA1ScenarioFail" )},
			},
			["Events"] = {
				--["On Scenario Started"]	= { menu=i18n.get( "uiR2Event0ScenarioStart" ),
				--							text=i18n.get( "uiR2Event1ScenarioStart" )},
				--["on scenario succeeded"]	= { menu=i18n.get( "uiR2Event0ScenarioSucceed" ),
				--							text=i18n.get( "uiR2Event1ScenarioSucceed" )},
				--["on scenario failed"]	= { menu=i18n.get( "uiR2Event0ScenarioFailed" ),
				--							text=i18n.get( "uiR2Event1ScenarioFailed" )},
			},
			["Conditions"] = {
			}
		}
		return logicTranslations
	end

	function classScenario.initEventValuesMenu(this, menu, categoryEvent)
		for ev=0,menu:getNumLine()-1 do

			local eventType = tostring(menu:getLineId(ev))

			if r2.events.eventTypeWithValue[eventType] == "Number" then
				menu:addSubMenu(ev)
				local subMenu = menu:getSubMenu(ev)
				local func = ""

				local lineNb = 0
				for i=1, 100, 20 do
					local lineStr = tostring(i).."/"..tostring(i+19)
					subMenu:addLine(lineStr, "", "", tostring(i))

					subMenu:addSubMenu(lineNb)
					local subMenu2= subMenu:getSubMenu(lineNb)
					for s=0, 19 do
						lineStr = tostring(i+s)
						local func = "r2