make MorphoDiTa interface as effective as possible. Because the
  input strings may be substrings of larger text or come from different than
  C++ memory regions, we want to avoid the cost of \\0 padding or
  string conversion. Nevertheless, both const char* and
  std::string can be used instead of a string_piece because of existing
  implicit conversion rules.

7. MorphoDiTa API Reference

The MorphoDiTa API is defined in header morphodita.h and resides in
ufal::morphodita namespace.

The strings used in the MorphoDiTa API are always UTF-8 encoded (except from
file paths, whose encoding is system dependent).

7.1. MorphoDiTa Versioning

MorphoDiTa is versioned using Semantic Versioning.
Therefore, a version consists of three numbers major.minor.patch, optionally
followed by a hyphen and pre-release version info, with the following semantics:

Stable versions have no pre-release version info, development have non-empty
  pre-release version info.

Two versions with the same major.minor have the same API with the same
  behaviour, apart from bugs. Therefore, if only patch is increased, the
  new version is only a bug-fix release.

If two versions v and u have the same major, but minor(v) is
  greater than minor(u), version v contains only additions to the API.
  In other words, the API of u is all present in v with the same
  behaviour (once again apart from bugs). It is therefore safe to upgrade to
  a newer MorphoDiTa version with the same major.

If two versions differ in major, their API may differ in any way.

Models created by MorphoDiTa have the same behaviour in all MorphoDiTa
versions with same major, apart from obvious bugfixes. On the other hand,
models created from the same data by different major.minor MorphoDiTa
versions may have different behaviour.

7.2. Lemma Structure

The lemmas used by MorphoDiTa consist of three parts:

raw lemma: text form of the lemma. May not uniquely distinguish
  lemma meanings, lemma use cases etc.

lemma id: together with raw lemma provide a unique identifier of the lemma,
  possibly including lemma meanings or use cases.

lemma comments: additional comments for the given lemma.

These parts are stored in one string and the boundaries between them can be
determined by
morpho::raw_lemma_len and
morpho::lemma_id_len methods


 snippets from dir `~/.config/helix/snippets` or specify snippets path via `SNIPPETS_PATH` env.

Default lookup directory can be overriden via `SCLS_CONFIG_SUBDIRECTORY` as well (e.g. when SCLS_CONFIG_SUBDIRECTORY = `vim`, SCLS will perform it's lookups in `~/.config/vim` instead)

Currently, it supports our own `toml` format and vscode `json` (a basic effort).

Filename used as snippet scope ([language id][1]), filename `snippets.(toml|json)` will not attach scope to snippets.

For example, snippets with the filename `python.toml` or `python.json` would have a `python` scope.

Snippets format

```toml
[[snippets]]
prefix = "ld"
scope = [ "python" ]  # language id https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers
body = 'log.debug("$1")'
description = "log at debug level"
```

### Use external snippets collections from git repos

Configure sources in `~/.config/helix/external-snippets.toml` (or via env `EXTERNAL_SNIPPETS_CONFIG`)

1. Declare list of sources by key `[[sources]]`

2. Optionally, declare paths to load snippets on current source by `[[source.paths]]`.

Highly recommended to declare concrete paths with scopes. To explicit configure required snippets and its scopes.

Snippets suggestion filtered out by document scope.

Scope it's [language id](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) and **not file extension** by language server protocol.

If `[[source.paths]]` isn't specified for source then all files with extensions `.json` and `.toml` would be tried to load. Scope at that case would be equal filename.
To apply snippets the filename must be one of known language id.

3. Run commands to fetch and validate snippets

```console

# Clone or update snippets source repos to `~/.config/helix/external-snippets/<repo path>`
simple-completion-language-server fetch-external-snippets

# Try to find and parse snippets
simple-completion-language-server validate-snippets

```

#### Config format for external snippets

```toml
# first external source to load snippets
[[sources]] # list of sources to load
name = "source1" # optional name shown on snippet description
git = "https://example.com/source1.git" # git repo with snippets collections

[[sources.paths]] # explicit list of paths to load on current source
scope = ["scope1", "scope2"] # optional scopes (language id) for current snippets
path = "path-in-repo/snippets1.json" # where snippet file or dir located in repo

[[sources.paths]]
scope = ["scope3"]
path = "path-in-repo/snippets2.json"

# next external source to load snippets
[[sources]]
name = "source2"
git = "https://example.com/source2.git"

[[sources.paths]]
scope = ["scope1"]
path = "path-in-repo-of-source2/snippets1.json"
```

#### Example

Load python snippets from file https://github.com/rafamadriz/friendly-snippets/blob/main/snippets/python/python.json

File `~/.config/helix/external-snippets.toml`

```toml
[[sources]]
name = "friendly-snippets"
git = "https://github.com/rafamadriz/friendly-snippets.git"

[[sources.paths]]
scope = ["python"]
path = "snippets/python/python.json"
```

Clone or update snippets source repos to `~/.config/helix/external-snippets/<repo path>`

```console
$ simple-completion-language-server fetch-external-snippets
```

Validate snippets

```c


        'ポ' to 'ホ',
    )

    private val reverseSmall = mapOf(
        'ぁ' to 'あ',
        'ぃ' to 'い',
        'ぅ' to 'う',
        'ぇ' to 'え',
        'ぉ' to 'お',

        'ゕ' to 'か',
        'ゖ' to 'け',

        'っ' to 'つ',

        'ゃ' to 'や',
        'ゅ' to 'ゆ',
        'ょ' to 'よ',

        'ゎ' to 'わ',

        'ァ' to 'ア',
        'ィ' to 'イ',
        'ゥ' to 'ウ',
        'ェ' to 'エ',
        'ォ' to 'オ',

        'ヵ' to 'カ',
        'ㇰ' to 'ク',
        'ヶ' to 'ケ',

        'ㇱ' to 'シ',
        'ㇲ' to 'ス',

        'ッ' to 'ツ',
        'ㇳ' to 'ト',

        'ㇴ' to 'ヌ',

        'ㇵ' to 'ハ',
        'ㇶ' to 'ヒ',
        'ㇷ' to 'フ',
        'ㇸ' to 'ヘ',
        'ㇹ' to 'ホ',

        'ㇺ' to 'ム',

        'ャ' to 'ヤ',
        'ュ' to 'ユ',
        'ョ' to 'ヨ',

        'ㇻ' to 'ラ',
        'ㇼ' to 'リ',
        'ㇽ' to 'ル',
        'ㇾ' to 'レ',
        'ㇿ' to 'ロ',

        'ヮ' to 'ワ',
    )

    private val smallSentinel: Char = '〓'

    private fun isDakuten(char: Char): Boolean {
        return char == '゙' || char == '゛' || char == 'ﾞ'
    }

    private fun isHandakuten(char: Char): Boolean {
        return char == '゚' || char == '゜' || char == 'ﾟ'
    }

    private fun isComposingCharacter(char: Char): Boolean {
        return char == '゙' || char == '゚'
    }

    private fun getBaseCharacter(c: Char): Char {
        return reverseDaku.getOrElse(c) {
            reverseHandaku.getOrElse(c) {
                reverseSmall.getOrElse(c) { c }
            }
        }
    }

    private fun <K>handleTransform(l: Char, c: Char, base: Map<Char, K>, rev: Map<Char, Char>, addOnFalse: Boolean): Pair<Int, String> {
        val char = getBaseCharacter(l)
        val trans = if (sticky) {
            base[char]
        } else {
            rev.getOrElse(l) { base[char] }
        }
        return if (trans != null) {
            1 to trans.toString()
        } else if (isComposingCharacter(l) && isComposingCharacter(c)) {
            1 to if (l == c && !sticky) { "" } else { ""+c  }
        } else {
            0 to if (addOnFalse) { ""+c } else { "" }
        }
    }

    override fun getActions(precedingText: String, toInsert: String): Pair<Int, String> {
        val c = toInsert.firstOrNull() ?: return 0 to toInsert
        // precedingText is "at least the last 1 character of what's currently here"
        if (precedingText.isEmpty()) {
            return if (c == smallSentinel || isComposingCharacter(c)) {
                0 to ""
            } else {
                0 to toInsert
            }
        }
        val lastChar = precedingText.last()

        return when {
            isDakuten(c) -> handleTransform(lastChar, c, daku, reverseDaku, true)
            isHandakuten(c) -> handleTransform(lastChar, c, handaku, reverseHandaku, true)
            c == smallSentinel -> handleTransform(lastChar, c, small, reverseSmall, false)
            else


toByteArray())
                    Base64.encodeToString(encrypted, Base64.DEFAULT)
                } catch (e: Exception) {
                    Timber.e(e, "Error encrypting DB field")
                    e.printStackTrace()
                    null
                }
            }

        private val aesKey: ByteArray
            get() {
                val key = Settings.Secure.ANDROID_ID + "fkvn8 w4y*(NC\$G*(G($*GR*(#)*huio4h389\$G"
                return key.toByteArray().copyOfRange(0, 32)
            }

        fun decrypt(encodedString: String?): String? =
            encodedString?.let {
                try {
                    val encoded = Base64.decode(encodedString, Base64.DEFAULT)
                    val original = Util.aes_decrypt(aesKey, encoded)
                    String(original)
                } catch (e: Exception) {
                    Timber.e(e, "Error decrypting DB field")
                    e.printStackTrace()
                    null
                }
            }

    }
}
@file:Suppress("unused")

package mega.privacy.android.app.utils

import android.content.Context
import android.graphics.Bitmap
import android.graphics.Paint
import android.renderscript.Allocation
import android.renderscript.Element
import android.renderscript.RenderScript
import android.renderscript.ScriptIntrinsicBlur
import androidx.core.graphics.applyCanvas
import androidx.core.graphics.createBitmap
import coil3.size.Size
import coil3.transform.Transformation

/**
 * A [Transformation] that applies a Gaussian blur to an image.
 *
 * @param context The [Context] used to create a [RenderScript] instance.
 * @param radius The radius of the blur.
 * @param sampling The sampling multiplier used to scale the image. Values > 1
 *  will downscale the image. Values between 0 and 1 will upscale the image.
 */
class BlurTransformation @JvmOverloads constructor(
    private val context: Context,
    private val radius: Float = DEFAULT_RADIUS,
    private val sampling: Float = DEFAULT_SAMPLING,
) : Transformation() {

    init {
        require(radius in 0.0..25.0) { "radius must be in [0, 25]." }
        require(sampling > 0) { "sampling must be > 0." }
    }

    @Suppress("NullableToStringCall")
    override val cacheKey = "${BlurTransformation::class.java.name}-$radius-$sampling"

    override suspend fun transform(input: Bitmap, size: Size): Bitmap {
        val paint = Paint(Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG)

        val scaledWidth = (input.width / sampling).toInt()
        val scaledHeight = (input.height / sampling).toInt()
        val output =
            createBitmap(scaledWidth, scaledHeight, input.config ?: Bitmap.Config.ARGB_8888)
        output.applyCanvas {
            scale(1 / sampling, 1 / sampling)
            drawBitmap(input, 0f, 0f, paint)
        }

        var script: RenderScript? = null
        var tmpInt: Allocation? = null
        var tmpOut: Allocation? = null
        var blur: ScriptIntrinsicBlur? = null
        try {
            script = RenderScript.create(context)
            tmpInt = Allocation.createFromBitmap(
                script,
                output,
                Allocation.MipmapControl.MIPMAP_NONE,
                Allocation.USAGE_SCRIPT
            )
            tmpOut = Allocation.createTyped(script, tmpInt.type)
            blur = ScriptIntrinsicBlur.create(script, Element.U8_4(script))
            blur.setRadius


tr [rdx + 2032]

// CHECK: vpmovzxbd zmm18, xmmword ptr [rdx + 2048]
// CHECK:  encoding: [0x62,0xe2,0x7d,0x48,0x31,0x92,0x00,0x08,0x00,0x00]
          vpmovzxbd zmm18, xmmword ptr [rdx + 2048]

// CHECK: vpmovzxbd zmm18, xmmword ptr [rdx - 2048]
// CHECK:  encoding: [0x62,0xe2,0x7d,0x48,0x31,0x52,0x80]
          vpmovzxbd zmm18, xmmword ptr [rdx - 2048]

// CHECK: vpmovzxbd zmm18, xmmword ptr [rdx - 2064]
// CHECK:  encoding: [0x62,0xe2,0x7d,0x48,0x31,0x92,0xf0,0xf7,0xff,0xff]
          vpmovzxbd zmm18, xmmword ptr [rdx - 2064]

// CHECK: vpmovzxbq zmm5, xmm15
// CHECK:  encoding: [0x62,0xd2,0x7d,0x48,0x32,0xef]
          vpmovzxbq zmm5, xmm15

// CHECK: vpmovzxbq zmm5 {k1}, xmm15
// CHECK:  encoding: [0x62,0xd2,0x7d,0x49,0x32,0xef]
          vpmovzxbq zmm5 {k1}, xmm15

// CHECK: vpmovzxbq zmm5 {k1} {z}, xmm15
// CHECK:  encoding: [0x62,0xd2,0x7d,0xc9,0x32,0xef]
          vpmovzxbq zmm5 {k1} {z}, xmm15

// CHECK: vpmovzxbq zmm5, qword ptr [rcx]
// CHECK:  encoding: [0x62,0xf2,0x7d,0x48,0x32,0x29]
          vpmovzxbq zmm5, qword ptr [rcx]

// CHECK: vpmovzxbq zmm5, qword ptr [rax + 8*r14 + 291]
// CHECK:  encoding: [0x62,0xb2,0x7d,0x48,0x32,0xac,0xf0,0x23,0x01,0x00,0x00]
          vpmovzxbq zmm5, qword ptr [rax + 8*r14 + 291]

// CHECK: vpmovzxbq zmm5, qword ptr [rdx + 1016]
// CHECK:  encoding: [0x62,0xf2,0x7d,0x48,0x32,0x6a,0x7f]
          vpmovzxbq zmm5, qword ptr [rdx + 1016]

// CHECK: vpmovzxbq zmm5, qword ptr [rdx + 1024]
// CHECK:  encoding: [0x62,0xf2,0x7d,0x48,0x32,0xaa,0x00,0x04,0x00,0x00]
          vpmovzxbq zmm5, qword ptr [rdx + 1024]

// CHECK: vpmovzxbq zmm5, qword ptr [rdx - 1024]
// CHECK:  encoding: [0x62,0xf2,0x7d,0x48,0x32,0x6a,0x80]
          vpmovzxbq zmm5, qword ptr [rdx - 1024]

// CHECK: vpmovzxbq zmm5, qword ptr [rdx - 1032]
// CHECK:  encoding: [0x62,0xf2,0x7d,0x48,0x


  'm' => Some(Mnemonic::Miscellaneous),
            'o' => Some(Mnemonic::ProgramNumber),
            't' => Some(Mnemonic::ToolChange),
            _ => None,
        }
    }
}

impl Display for Mnemonic {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        match self {
            Mnemonic::General => write!(f, "G"),
            Mnemonic::Miscellaneous => write!(f, "M"),
            Mnemonic::ProgramNumber => write!(f, "O"),
            Mnemonic::ToolChange => write!(f, "T"),
        }
    }
}

/// The in-memory representation of a single command in the G-code language
/// (e.g. `"G01 X50.0 Y-20.0"`).
#[derive(Clone)]
#[cfg_attr(
    feature = "serde-1",
    derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
pub struct GCode<A = DefaultArguments> {
    mnemonic: Mnemonic,
    number: f32,
    arguments: A,
    span: Span,
}

impl GCode {
    /// Create a new [`GCode`] which uses the [`DefaultArguments`] buffer.
    pub fn new(mnemonic: Mnemonic, number: f32, span: Span) -> Self {
        GCode {
            mnemonic,
            number,
            span,
            arguments: DefaultArguments::default(),
        }
    }
}

impl<A: Buffer<Word>> GCode<A> {
    /// Create a new [`GCode`] which uses a custom [`Buffer`].
    pub fn new_with_argument_buffer(
        mnemonic: Mnemonic,
        number: f32,
        span: Span,
        arguments: A,
    ) -> Self {
        GCode {
            mnemonic,
            number,
            span,
            arguments,
        }
    }

    /// The overall category this [`GCode`] belongs to.
    pub fn mnemonic(&self) -> Mnemonic { self.mnemonic }

    /// The integral part of a command number (i.e. the `12` in `G12.3`).
    pub fn major_number(&self) -> u32 {
        debug_assert!(self.number >= 0.0);

        libm::floorf(self.number) as u32
    }

    /// The fractional part of a command number (i.e. the `3` in `G12.3`).
    pub fn minor_number(&self) -> u32 {
        let fract = self.number - libm::floorf(self.number);
        let digit = libm::roundf(fract * 10.0);
        digit as u32
    }

    /// The arguments attached to this [`GCode`].
    pub fn arguments(&self) -> &[Word] { self.arguments.as_slice() }

    /// Where the [`GCode`] was found in its source text.
    pub fn span(&self) -> Span { self.span }

    /// Add an argument to the list of arguments attached to this [`GCode`].
    pub fn push_argument(
        &mut self,
        arg: Word,
    ) -> Result<(), CapacityError<Word>> {
        self.span = self.span.merge(arg.span);
        self.arguments.try_push(arg)
    }

    /// The builder equivalent of [`GCode::push_argument()`].
    ///
    /// # Panics
    ///
    /// This will panic if the underlying [`Buffer`] returns a
    /// [`CapacityError`].
    pub fn with_argument(mut self, arg: Word) -> Self {
        if let Err(e) = self.push_argument(arg) {
            panic!("Unable to add the argument {:?}: {}", arg, e);
        }
        self
    }

    /// Get the value for a particular argument.
    ///
    /// # Examples
    ///
    /// ```rust
    /// # use gcode::{G


JSON(data?: any) {
    data = typeof data === 'object' ? data : {};
    data['id'] = this.id !== undefined ? this.id : <any>null;
    data['locationId'] = this.locationId !== undefined ? this.locationId : <any>null;
    data['name'] = this.name !== undefined ? this.name : <any>null;
    if (this.sections && this.sections.constructor === Array) {
      data['sections'] = [];
      for (const item of this.sections)
        data['sections'].push(item.toJSON());
    }
    data['notes'] = this.notes !== undefined ? this.notes : <any>null;
    data['program'] = this.program !== undefined ? this.program : <any>null;
    data['programId'] = this.programId !== undefined ? this.programId : <any>null;
    data['publishOnDateTime'] = this.publishOnDateTime ? this.publishOnDateTime.toISOString() : <any>null;
    data['wodDate'] =  this.wodDate ? this.wodDate.toISOString() : <any>null;
    return data;
  }
}
// ------------------------------------------------------------------------
// Year 2019 Day 02
//
// Part 1: The return of the "build an opcode processor" puzzle, so soon!
// This is a pretty simple switch statement, plus some furious checking
// to make sure you are grabbing the referenced parameters and not the
// parameters themselves.
//
// Part 2: Wrap the processor in a loop and run it until you get the
// desired output.
//
// As usual, this puzzle is setup for future puzzles in which the inputs,
// outputs, and opcodes themselves will get increasingly convoluted. After
// spamming the submit button, I've cleaned up my answer to make it easier
// to extend in the future.
// ------------------------------------------------------------------------
import { p, part1, part2 } from '../../util';

function runUntilHalted(program: number[]): void {
  let ip = 0;

  for (;;) {
    switch (program[ip]) {
      case 1:
        program[program[ip + 3]] = program[program[ip + 1]] + program[program[ip + 2]];
        ip += 4;
        break;
      case 2:
        program[program[ip + 3]] = program[program[ip + 1]] * program[program[ip + 2]];
        ip += 4;
        break;
      case 99:
        return;
    }
  }
}

function execute(program: number[], inputs: number[]): number {
  program = program.slice();
  program[1] = inputs[0];
  program[2] = inputs[1];
  runUntilHalted(program);
  return program[0];
}

function solveFor(program: number[], desiredOutput: number): { noun: number, verb: number } {
  for (let noun = 0; noun < 99; noun++) {
    for (let verb = 0; verb < 99; verb++) {
      if (execute(program, [noun, verb]) === desiredOutput) return { noun, verb };
    }
  }
}

export function solve(input: string[]): void {
  //// Part 1 ////
  let program = input[0].split(',').map(s => parseInt(s, 10));
  let result1 = execute(program, [12, 2]);
  part1(result1);

  //// Part 2 ////
  let { noun, verb } = solveFor(program, 19690720);
  let result2 = 100 * noun + verb;
  part2(result2);
};
import * as crypto from "crypto";
import * as admin from "firebase-admin";
import * as functions from "firebase-functions";
import { request as httpsRequest } from "https";
import NestedError from "nested-error-stacks";

admin.initializeApp({
  cr


!(Some("little"), iter.next());
    /// assert_eq!(Some("lamb"), iter.next());
    ///
    /// assert_eq!(None, iter.next());
    /// ```
    #[unstable(feature = "split_ascii_whitespace", issue = "48656")]
    #[inline]
    pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace {
        let inner = self
            .as_bytes()
            .split(IsAsciiWhitespace)
            .filter(IsNotEmpty)
            .map(UnsafeBytesToStr);
        SplitAsciiWhitespace { inner }
    }

    /// An iterator over the lines of a string, as string slices.
    ///
    /// Lines are ended with either a newline (`\n`) or a carriage return with
    /// a line feed (`\r\n`).
    ///
    /// The final line ending is optional.
    ///
    /// # Examples
    ///
    /// Basic usage:
    ///
    /// ```
    /// let text = "foo\r\nbar\n\nbaz\n";
    /// let mut lines = text.lines();
    ///
    /// assert_eq!(Some("foo"), lines.next());
    /// assert_eq!(Some("bar"), lines.next());
    /// assert_eq!(Some(""), lines.next());
    /// assert_eq!(Some("baz"), lines.next());
    ///
    /// assert_eq!(None, lines.next());
    /// ```
    ///
    /// The final line ending isn't required:
    ///
    /// ```
    /// let text = "foo\nbar\n\r\nbaz";
    /// let mut lines = text.lines();
    ///
    /// assert_eq!(Some("foo"), lines.next());
    /// assert_eq!(Some("bar"), lines.next());
    /// assert_eq!(Some(""), lines.next());
    /// assert_eq!(Some("baz"), lines.next());
    ///
    /// assert_eq!(None, lines.next());
    /// ```
    #[stable(feature = "rust1", since = "1.0.0")]
    #[inline]
    pub fn lines(&self) -> Lines {
        Lines(self.split_terminator('\n').map(LinesAnyMap))
    }

    /// An iterator over the lines of a string.
    #[stable(feature = "rust1", since = "1.0.0")]
    #[rustc_deprecated(since = "1.4.0", reason = "use lines() instead now")]
    #[inline]
    #[allow(deprecated)]
    pub fn lines_any(&self) -> LinesAny {
        LinesAny(self.lines())
    }

    /// Returns an iterator of `u16` over the string encoded as UTF-16.
    ///
    /// # Examples
    ///
    /// Basic usage:
    ///
    /// ```
    /// let text = "Zażółć gęślą jaźń";
    ///
    /// let utf8_len = text.len();
    /// let utf16_len = text.encode_utf16().count();
    ///
    /// assert!(utf16_len <= utf8_len);
    /// ```
    #[stable(feature = "encode_utf16", since = "1.8.0")]
    pub fn encode_utf16(&self) -> EncodeUtf16 {
        EncodeUtf16 { chars: self.chars(), extra: 0 }
    }

    /// Returns `true` if the given pattern matches a sub-slice of
    /// this string slice.
    ///
    /// Returns `false` if it does not.
    ///
    /// # Examples
    ///
    /// Basic usage:
    ///
    /// ```
    /// let bananas = "bananas";
    ///
    /// assert!(bananas.contains("nana"));
    /// assert!(!bananas.contains("apples"));
    /// ```
    #[stable(feature = "rust1", since = "1.0.0"


READY    : i32 = -11;
pub const SYS_ENOTSUP     : i32 = -12;
pub const SYS_EUNKNOWN    : i32 = -13;
pub const SYS_EREMOTEIO   : i32 = -14;
pub const SYS_EDONE       : i32 = -15;
pub const SYS_EPERUSER : i32 = -65535;
use rusqlite::params;
use zeronet_protocol::PeerAddr;

use crate::{
    controllers::sites::SitesController,
    core::{peer::Peer, site::Site},
};

impl SitesController {
    pub fn load_peers(&mut self, site: &Site) {
        let addr = site.address();
        let conn = self.db_manager.get_db("content_db").unwrap();
        let site_id = conn
            .query_row("SELECT * FROM site WHERE address = ?", params![addr], |a| {
                a.get::<_, i32>(0)
            })
            .unwrap();
        let mut stmt = conn
            .prepare(
                "SELECT address, port FROM peer WHERE site_id = ? AND address NOT LIKE '%.onion' AND reputation > 0", //TODO! Don't filter out onion peers
            )
            .unwrap();
        let peers = stmt
            .query_map(params![site_id], |row| {
                Ok((row.get::<_, String>(0)?, row.get::<_, i32>(1)?))
            })
            .unwrap();
        for peer in peers {
            let (ip, port) = peer.unwrap();
            let peer = format!("{}:{}", ip, port);
            let peer = Peer::new(PeerAddr::parse(&peer).unwrap());
            self.sites.get_mut(&addr).unwrap().add_peer(peer)
        }
    }
}
#![allow(clippy::large_enum_variant)]
pub mod client;
pub mod google_rpc;
pub mod gossip;
pub mod persistent;
pub mod projections;
pub mod streams;

pub use client::*;
<gh_stars>10-100
use crate::web::CaseConversions;
use anyhow::Context as _;
use maplit::btreeset;
use serde::Serialize;
use snowchains_core::{
    color_spec,
    testsuite::{Additional, BatchTestSuite, TestSuite},
    web::{
        Atcoder, AtcoderRetrieveFullTestCasesCredentials,
        AtcoderRetrieveSampleTestCasesCredentials, Codeforces,
        CodeforcesRetrieveSampleTestCasesCredentials, CookieStorage, PlatformKind,
        ProblemsInContest, RetrieveFullTestCases, RetrieveTestCases, Yukicoder,
        YukicoderRetrieveFullTestCasesCredentials, YukicoderRetrieveTestCasesTargets,
    },
};
use std::{
    cell::RefCell,
    io::{BufRead, Write},
    path::PathBuf,
};
use structopt::StructOpt;
use strum::VariantNames as _;
use termcolor::{Color, WriteColor};
use url::Url;

#[derive(StructOpt, Debug)]
pub struct OptRetrieveTestcases {
    /// Downloads full test cases
    #[structopt(long)]
    pub full: bool,

    /// Prints JSON data
    #[structopt(long)]
    pub json: bool,

    /// Path to `snowchains.dhall`
    #[structopt(long)]
    pub config: Option<PathBuf>,

    /// Coloring
    #[structopt(
        long,
        possible_values(crate::ColorChoice::VARIANTS),
        default_value("auto")
    )]
    pub color: crate::ColorChoice,

    /// Platform
    #[structopt(
        short,
        long,
        value_name("SERVICE"),
        possible_values(PlatformKind::KEBAB_CASE_VARI


},
                data: Vec::new(),
                permissions: Vec::new(),
                owners: Vec::new(),
            },
        }
    }
}

impl Debug for UnseqAppendOnlyData<PubPermissions> {
    fn fmt(&self, formatter: &mut Formatter) -> fmt::Result {
        write!(formatter, "PubUnseqAppendOnlyData {:?}", self.name())
    }
}

impl SeqAppendOnlyData<UnpubPermissions> {
    pub fn new(name: XorName, tag: u64) -> Self {
        Self {
            inner: AppendOnly {
                address: Address::UnpubSeq { name, tag },
                data: Vec::new(),
                permissions: Vec::new(),
                owners: Vec::new(),
            },
        }
    }
}

impl Debug for SeqAppendOnlyData<UnpubPermissions> {
    fn fmt(&self, formatter: &mut Formatter) -> fmt::Result {
        write!(formatter, "PubSeqAppendOnlyData {:?}", self.name())
    }
}

impl UnseqAppendOnlyData<UnpubPermissions> {
    pub fn new(name: XorName, tag: u64) -> Self {
        Self {
            inner: AppendOnly {
                address: Address::UnpubUnseq { name, tag },
                data: Vec::new(),
                permissions: Vec::new(),
                owners: Vec::new(),
            },
        }
    }
}

impl Debug for UnseqAppendOnlyData<UnpubPermissions> {
    fn fmt(&self, formatter: &mut Formatter) -> fmt::Result {
        write!(formatter, "UnpubUnseqAppendOnlyData {:?}", self.name())
    }
}

impl
 SeqAppendOnly for SeqAppendOnlyData

where
    P: Permissions + Hash + Clone,
{
    fn append(&mut self, entries: &[(Vec<u8>, Vec<u8>)], last_entries_index: u64) -> Result<()> {
        if last_entries_index != self.inner.data.len() as u64 {
            return Err(Error::InvalidSuccessor(self.inner.data.len() as u64));
        }
        self.inner.data.extend(entries.iter().cloned());
        Ok(())
    }
}

impl
 UnseqAppendOnly for UnseqAppendOnlyData

where
    P: Permissions + Hash + Clone,
{
    fn append(&mut self, entries: &[(Vec<u8>, Vec<u8>)]) -> Result<()> {
        self.inner.data.extend(entries.iter().cloned());
        Ok(())
    }
}

macro_rules! check_perm {
    ($data: ident, $requester: ident, $request: ident) => {
        if $data
            .fetch_owner_at_index($data.owners_index() - 1)
            .ok_or_else(|| Error::NoSuchData)?
            .public_key
            == $requester
        {
            Ok(())
        } else {
            $data
                .fetch_permissions_at_index($data.permissions_index() - 1)
                .ok_or_else(|| Error::NoSuchData)?
                .check_permissions_for_key($requester, $request)
        }
    };
}

macro_rules! indices {
    ($data: ident) => {
        Ok(Indices::new(
            $data.entry_index(),
            $data.owners_index(),
            $data.permissions_index(),
        ))
    };
}

#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Debug)]
pub enum Kind {
    PubSeq,
    PubUnseq,
    UnpubSeq,
    UnpubUnseq,
}

#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Debug)]
pub enum Address {
    PubSeq { name: XorName, tag: u64 },
    PubUnseq { name: XorName, tag: u64


08EC:
	step 15, 2
	step_end

	.balign 4, 0
_08F4:
	step 12, 1
	step 15, 1
	step_end

	.balign 4, 0
_0900:
	step 0, 1
	step 71, 1
	step 13, 1
	step 72, 1
	step_end

	.balign 4, 0
_0914:
	step 3, 1
	step 71, 1
	step 14, 1
	step 72, 1
	step_end

	.balign 4, 0
_0928:
	step 35, 1
	step_end

	.balign 4, 0
_0930:
	step 32, 1
	step_end

	.balign 4, 0
_0938:
	step 14, 9
	step_end

scr_seq_D23R0101_006:
	simple_npc_msg msg_0065_D23R0101_00026
	end

scr_seq_D23R0101_007:
	simple_npc_msg msg_0065_D23R0101_00027
	end

scr_seq_D23R0101_001:
	play_se SEQ_SE_DP_SELECT
	lockall
	faceplayer
	compare VAR_UNK_4136, 0
	goto_if_ne _0B86
	goto_if_set FLAG_UNK_AA6, _09CF
	goto_if_set FLAG_UNK_AA5, _09AF
	npc_msg msg_0065_D23R0101_00028
	touchscreen_menu_hide
	getmenuchoice VAR_SPECIAL_RESULT
	touchscreen_menu_show
	compare VAR_SPECIAL_RESULT, 0
	goto_if_eq _09E5
	goto _09DA

_09AF:
	npc_msg msg_0065_D23R0101_00045
	touchscreen_menu_hide
	getmenuchoice VAR_SPECIAL_RESULT
	touchscreen_menu_show
	compare VAR_SPECIAL_RESULT, 0
	goto_if_eq _09E5
	goto _09DA
	end

_09CF:
	npc_msg msg_0065_D23R0101_00029
	wait_button_or_walk_away
	closemsg
	releaseall
	end

_09DA:
	npc_msg msg_0065_D23R0101_00030
	wait_button_or_walk_away
	closemsg
	releaseall
	end

_09E5:
	setflag FLAG_UNK_AA5
	npc_msg msg_0065_D23R0101_00031
	loto_id_get VAR_SPECIAL_x8000
	buffer_int_ex 0, VAR_SPECIAL_x8000, 2, 5
	npc_msg msg_0065_D23R0101_00032
	loto_id_search VAR_SPECIAL_x8001, VAR_SPECIAL_x8002, VAR_SPECIAL_x8003, VAR_SPECIAL_x8000
	compare VAR_SPECIAL_x8002, 0
	goto_if_eq _0A24
	compare VAR_SPECIAL_x8003


    a.emit(emission(42, {purpose: 'All work and no play makes jack a dull boy.'}));
  });

  it('should be shared to avoid multiple invocations of run().', () => {
    let r = 0;
    class _N extends Node {
      constructor(){super({outputs: ['o']})}
      run(_: NodeInputs, __: NodeOutput) {
        r++;
        __('o');
      }
    }

    let n = new _N();
    let a = new Source(); a.to(n.control);
    let [p1, p2] = (n.out('o').to(pin(), pin()) as Group).pins;
    p1.subscribe();
    p2.subscribe();
    a.send();
    r.should.equal(1);
  });

  it('should be serially connectible.', () => {
    class N extends Node {
      constructor(){super({inputs:['a', 'b'], outputs:['zero', 'one', 'two']})}
      run(_: NodeInputs, __: NodeOutput) {
        let k = (_.a + _.b) % 3;
        if (k == 0) __('zero');
        if (k == 1) __('one');
        if (k == 2) __('two');
      }
    }

    let z = false, o = false, t = false;
    let a = source(); let b = source();
    group(a, b).serialTo(new N()).serialTo(
      sink(() => z = true), sink(() => o = true), sink(() => t = true))
      .subscribe();

    a.send(1); b.send(1);
    a.send(4); b.send(3);

    z.should.be.false;
    o.should.be.true;
    t.should.be.true;
  });

  describe('.control', () => {
    it('should be instance of `Control`.', () => {
      class _N extends Node { constructor(){super({outputs:[]})} run() {}}
      new _N().control.should.be.instanceOf(Control);
    });
  });
});

describe('node()', () => {
  it('should return a `Node` factory.', () => {
    node({outputs: []}, () => {})().should.be.instanceof(Node);
  });

  it('should return a factory that creates `Nodes` with given signature.', () => {
    let sig = { inputs: ['a', 'b'], outputs: ['c', 'd'] };
    node(sig, () => {})().signature.should.eql(sig);
  });

  it('should return a factory that creates `Nodes` running given run function.', () => {
    let n = node({
      inputs: ['a'],
      outputs: ['odd', 'even']},
    (inputs, output) => {
      if (inputs.a % 2 == 0) output('even');
      else output('odd');
    })();

    let res = <string[]>[];
    let a = new Source();

    a.to(n.in('a'));
    group(
      n.out('odd').to(map(() => 'X')),
      n.out('even').to(map(() => 'Y'))
    ).subscribe(v => res.push(v));

    a.send(2);
    a.send(3);
    a.send(4);
    a.send(5);
    a.send(6);

    res.should.eql(['Y', 'X', 'Y', 'X', 'Y']);
  });
});
/// <reference path="phosphorus.ts" />

// IO helpers and hooks

namespace P.io {
  /**
   * Configuration of IO behavior
   */
  export var config = {
    /**
     * A relative or absolute path to a full installation of forkphorus, from which "local" files can be fetched.
     * Do not including a trailing slash.
     */
    localPath: '',
  };

  // non-http/https protocols cannot xhr request local files, so utilize forkphorus.github.io instead
  if (['http:', 'https:'].indexOf(location.protocol) === -1) {
    config.localPath = 'https://


Value.OFF to SwitchableValue.ON, f)

fun RGBLight.onTurnedOff(f: RGBLight.(Switchable) -> Unit) =
    onStateValueChangedFrom(SwitchableValue.ON to SwitchableValue.OFF, f)
package easy.orderOfSuccession

import java.util.*

// https://www.codingame.com/ide/puzzle/order-of-succession

enum class Gender(val gender: String) {
    M("M"), F("F")
}

data class Person(
    val name: String,
    val parent: String,
    val birth: Long,
    val death: Long,
    val isAnglican: Boolean,
    val gender: Gender
)

fun main(args: Array<String>) {
    val input = Scanner(System.`in`)
    val n = input.nextInt()
    val persons = LinkedList<Person>()

    // Each person insert to List
    for (i in 0 until n) {
        val person = Person(
            input.next(),
            input.next(),
            input.nextLong(),
            run {
                val temp = input.next()
                if (temp == "-") 0 else temp.toLong()
            },
            run { input.next() == "Anglican" },
            Gender.valueOf(input.next())
        )
        persons.addLast(person)
    }

    // Ordering rules (a) in order of generation (b) in order of gender (c) in order of age (year of birth)
    // First sort - persons sorted by parents
    val succession = persons.sortedWith(compareBy({ it.parent }, { it.gender }, { it.birth })).toMutableList()

    // Sub sort - persons sorted by successors
    for (i in succession.indices) {
        val parent = succession[i].name
        for (k in i + 1..succession.size) {
            val targetIndex = succession.indexOfFirst {
                it.parent == parent && k <= succession.indexOf(it)
            }
            succession.pushBefore(k, targetIndex)
        }
    }
    // (a) exclude dead people (b) exclude people who are catholic (but include siblings of catholic people)
    succession.filter { it.death == 0.toLong() && it.isAnglican }.forEach { println(it.name) }
}

private fun <E> MutableList<E>.pushBefore(pushBefore: Int, targetIndex: Int) {
    for (i in pushBefore..targetIndex) {
        this.swap(i, targetIndex)
    }
}

fun <T> MutableList<T>.swap(index1: Int, index2: Int) {
    if (index1 == -1 || index2 == -1) return
    val tmp = this[index1] // 'this' corresponds to the list
    this[index1] = this[index2]
    this[index2] = tmp
}
package club.anifox.android.ui

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.navigation.NavDestination
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navOptions
import androidx.tracing.trace
import club.anifox.android.core.common.util.network.NetworkMonitor
import club.anifox.android.feature.favourite.navigation.navigateToFavourite
import club.anifox.android.feature.home.navigation.navigateToHome
import club.anifox.android.feature.schedule.navigation.navigateToSchedule
import club.anifox.android.navigation.TopLevelDestination
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn

@Composable
fun rememberAnifoxAppState(
    networkMonitor: NetworkMonitor,
    coroutineScope: CoroutineScope = rememberCoroutineScope(),
    navController: NavHostController = rememberNavContro


ue},
{'supercategory': 'human_accessories', 'id': 314, 'name': 'gloves', 'c_name': '手套', 'isthing': True},
{'supercategory': 'repair_tool', 'id': 315, 'name': 'screwdriver', 'c_name': '螺丝刀', 'isthing': True},
{'supercategory': 'kitchen_tool', 'id': 316, 'name': 'drinking_straw', 'c_name': '吸管', 'isthing': True},
{'supercategory': 'mammal', 'id': 317, 'name': 'pig', 'c_name': '猪', 'isthing': True},
{'supercategory': 'plant', 'id': 318, 'name': 'plant_ot', 'c_name': '其他植物', 'isthing': True},
{'supercategory': 'cabinets', 'id': 319, 'name': 'bathroom cabinets', 'c_name': '浴室柜', 'isthing': True},
{'supercategory': 'ventilation_appliances', 'id': 320, 'name': 'vent', 'c_name': '通风孔', 'isthing': True},
{'supercategory': 'clean_appliances', 'id': 321, 'name': 'washing_machine', 'c_name': '洗衣机', 'isthing': True},
{'supercategory': 'racket', 'id': 322, 'name': 'tennis_racket', 'c_name': '网球拍', 'isthing': True},
{'supercategory': 'kitchen_tool', 'id': 323, 'name': 'chopsticks', 'c_name': '筷子', 'isthing': True},
{'supercategory': 'mammal', 'id': 324, 'name': 'seal', 'c_name': '海豹', 'isthing': True},
{'supercategory': 'building_houses', 'id': 325, 'name': 'lighthouse', 'c_name': '灯塔', 'isthing': False},
{'supercategory': 'kitchen_appliances', 'id': 326, 'name': 'kettle', 'c_name': '水壶', 'isthing': True},
{'supercategory': 'fitness_equipment', 'id': 327, 'name': 'parachute', 'c_name': '降落伞', 'isthing': True},
{'supercategory': 'beddings', 'id': 328, 'name': 'blanket', 'c_name': '被子', 'isthing': True},
{'supercategory': 'drink', 'id': 329, 'name': 'juice', 'c_name': '果汁', 'isthing': True},
{'supercategory': 'kitchen_tool', 'id': 330, 'name': 'food_processor', 'c_name': '食品加工机', 'isthing': True},
{'supercategory': 'truck', 'id': 331, 'name': 'pickup_truck', 'c_name': '皮卡车', 'isthing': True},
{'supercategory': 'doll', 'id': 332, 'name': 'teddy_bear', 'c_name': '泰迪熊', 'isthing': True},
{'supercategory': 'deer', 'id': 333, 'name': 'deer_ot', 'c_name': '其他鹿', 'isthing': True},
{'supercategory': 'clock_furniture', 'id': 335, 'name': 'clock', 'c_name': '时钟', 'isthing': True},
{'supercategory': 'beddings', 'id': 336, 'name': 'beddings_ot', 'c_name': '其他床上用品', 'isthing': True},
{'supercategory': 'lab_tool', 'id': 337, 'name': 'tube', 'c_name': '试管', 'isthing': True},
{'supercategory': 'fluid', 'id': 338, 'name': 'fountain', 'c_name': '喷泉', 'isthing': False},
{'supercategory': 'non-building_houses', 'id': 339, 'name': 'parterre', 'c_name': '花坛', 'isthing': False},
{'supercategory': 'human_accessories', 'id': 340, 'name': 'human_accessories_ot', 'c_name': '其他人物服饰类', 'isthing': True},
{'supercategory': 'birds', 'id': 341, 'name': 'parrot', 'c_name': '鹦鹉', 'isthing': True},
{'supercategory': 'common_furniture', 'id': 342, 'name': 'toilet', 'c_name': '马桶', 'isthing': True},
{'supercategory': 'fitness_equipment', 'id': 343, 'name': 'dumbbell', 'c_name': '哑铃', 'isthing': True},
{'supercategory': 'fruit', 'id': 344, 'name': 'pear', 'c_name': '梨', 'isthing': True},
{'supercategory': 'fruit', 'id': 345, 'name': 'pineapple', 'c_name': '菠萝', 'isthing': True},
{'supercategory': 'building_houses', 'id': 346, 'name': 'temple', 'c_name': '寺庙', 'isthing': False},
{'supercategory': 'camel', 'id': 350, 'name': 'camel_ot', 'c_name': '其他骆驼', 'isthing': True},
{'supercategory': 'person', 'id': 640, 'name': 'person_ot', 'c_name': '无法分辨年龄性别的人', 'isthing': True},
{'supercategory': 'person', 'id': 641, 'name': 'woman', 'c_name': '女人', 'isthing': True},
{'supercategory': 'person', 'id': 642, 'name': 'boy', 'c_name': '男孩', 'isthing': True},
{'supercategory': 'person', 'id': 643, 'name': 'girl', 'c_name': '女孩', 'isthing': True},
]

def _get_entityv2_panoptic_meta():
    meta = {}

    ## thing_dataset_id and stuff_dataset_id share the same contiguous id
    thing_dataset_id_to_contiguous_id = {}
    stuff_dataset_id_to_contiguous_id = {}
    for i, cat in enumerate(EntityV2_panoptic_CATEGORIES):
        if cat["isthing"]:
            thing_dataset_id_to_contiguous_id[cat["id"]] = i
        else:
            stuff_dataset_id_to_contiguous_id[cat["id"]] = i

    ## add new map for PanopticFPN Dataloader
    thing_contiguous_id_to_new_contiguous =  {}
    stuff_contiguous_id_to_new_contiguous =  {}
    for id_, (thing_id, contiguous_id) in enumerate(thing_dataset_id_to_contiguous_id.items()):
        thing_contiguous_id_to_new_contiguous[contiguous_id] = id_

    for id_, (stuff_id, contiguous_id) in enumerate(stuff_dataset_id_to_contiguous_id.items()):
        s


 {
      expect(result['file1.jsx']).toMatchInlineSnapshot(`
              "import { styled } from '@glitz/react';
              const MyComponent = /*#__PURE__*/ styled((props) => {
                  return <styled.Div css={{ backgroundColor: 'green' }}/>;
              }, { color: 'red' });
              "
          `);
      expect(result['style.css']).toMatchInlineSnapshot(`".a{background-color:green}"`);
    },
    diagnostics =>
      expect(diagnostics).toMatchInlineSnapshot(`
        Array [
          Object {
            "file": "file1.tsx",
            "line": 2,
            "message": "Functions in style objects requires runtime or statically declared themes",
            "severity": "info",
            "source": "(props: {}) => {
            return <styled.Div css={{ backgroundColor: 'green' }}/>;
        }",
          },
        ]
      `),
  );
});

test('bails on spread after css prop', () => {
  const code = {
    'file1.tsx': `
import { styled } from '@glitz/react';
const obj: any = {};
const Styled = styled.div({
  color: 'red',
})
const node1 = <styled.Div css={{ backgroundColor: 'green' }} {...obj} />;
const node2 = <styled.Div {...obj} />;
const node3 = <styled.Div {...obj} css={{ backgroundColor: 'green' }} />;
const node4 = <Styled {...obj} />;
const node5 = <Styled css={{ backgroundColor: 'green' }} {...obj} />;
const node6 = <Styled {...obj} css={{ backgroundColor: 'green' }} />;
`,
  };

  expectEqual(compile(code), result => {
    expect(result['file1.jsx']).toMatchInlineSnapshot(`
      "import { styled } from '@glitz/react';
      const obj = {};
      const Styled = /*#__PURE__*/ styled.div({
          color: 'red',
      });
      const node1 = <styled.Div css={{ backgroundColor: 'green' }} {...obj}/>;
      const node2 = <styled.Div {...obj}/>;
      const node3 = <div {...obj} className={\\"b\\"} data-glitzname=\\"styled.Div\\"/>;
      const node4 = <Styled {...obj}/>;
      const node5 = <Styled css={{ backgroundColor: 'green' }} {...obj}/>;
      const node6 = <div {...obj} className={\\"b a\\"} data-glitzname=\\"Styled\\"/>;
      "
    `);
    expect(result['style.css']).toMatchInlineSnapshot(`".a{color:red}.b{background-color:green}"`);
  });
});

test('can compile prop funcs for static themes', () => {
  const code = {
    'themes.ts': `
export const staticThemes = [{
  id: 'red',
  isDark: false,
  color: 'red',
  backgroundColor: 'pink',
  spacing: { small: '10px', large: '20px' },
}, {
  id: 'blue',
  isDark: false,
  color: 'blue',
  backgroundColor: 'lightblue',
  spacing: { small: '10px', large: '20px' },
}, {
  id: 'black',
  isDark: true,
  color: 'black',
  backgroundColor: 'black',
  spacing: { small: '10px', large: '20px' },
}];
`,
    'file1.tsx': `
import { styled } from '@glitz/react';

const Styled1 = styled.div({
  color: theme => theme.color,
});
const Styled2 = styled.div({
  color: theme => theme.color,
  fontWeight: 'bold',
});
const Styled3 = styled.div({
  color: theme => theme.isDark ? 'black' : 'white',
});
const Styled4 = styled.div({
  paddingLeft: theme => theme.spa


ensity');

      await ProjectFileUtils.createDirectoryIfNotExists(iconDir);

      final iconPath = path.join(iconDir, 'ic_launcher.png');
      await _generateIcon(iconPath, size, appName);
    }
  }

  static Future<void> _generateIOSIcons(
      String projectDir, String appName) async {
    final iosDir = path.join(
        projectDir, 'ios', 'Runner', 'Assets.xcassets', 'AppIcon.appiconset');

    await ProjectFileUtils.createDirectoryIfNotExists(iosDir);

    for (final size in iosSizes) {
      final iconPath = path.join(iosDir, 'Icon-App-${size}x${size}@1x.png');
      await _generateIcon(iconPath, size, appName);
    }

    await _generateIOSContentsJson(iosDir);
  }

  static String _getAndroidDensity(int size) {
    switch (size) {
      case 48:
        return 'mdpi';
      case 72:
        return 'hdpi';
      case 96:
        return 'xhdpi';
      case 144:
        return 'xxhdpi';
      case 192:
        return 'xxxhdpi';
      default:
        return 'hdpi';
    }
  }

  static Future<void> _generateIcon(
      String iconPath, int size, String appName) async {
    final recorder = ui.PictureRecorder();
    final canvas = Canvas(recorder);

    final paint = Paint()
      ..color = _getColorFromString(appName)
      ..style = PaintingStyle.fill;

    canvas.drawRect(
        Rect.fromLTWH(0, 0, size.toDouble(), size.toDouble()), paint);

    final initials = _getAppInitials(appName);
    final textPainter = TextPainter(
      text: TextSpan(
        text: initials,
        style: TextStyle(
          color: Colors.white,
          fontSize: size * 0.4,
          fontWeight: FontWeight.bold,
        ),
      ),
      textDirection: TextDirection.ltr,
    );

    textPainter.layout();
    textPainter.paint(
      canvas,
      Offset(
        (size - textPainter.width) / 2,
        (size - textPainter.height) / 2,
      ),
    );

    final picture = recorder.endRecording();
    final image = await picture.toImage(size, size);
    final byteData = await image.toByteData(format: ui.ImageByteFormat.png);
    final bytes = byteData!.buffer.asUint8List();

    await ProjectFileUtils.writeFileBytes(iconPath, bytes);
  }

  static String _getAppInitials(String appName) {
    if (appName.isEmpty) return 'A';

    final words = appName.trim().split(' ');
    if (words.length == 1) {
      return appName.substring(0, 1).toUpperCase();
    }

    final firstWord = words[0];
    final lastWord = words.last;

    if (firstWord == lastWord) {
      return firstWord.substring(0, 1).toUpperCase();
    }

    return '${firstWord.substring(0, 1)}${lastWord.substring(0, 1)}'
        .toUpperCase();
  }

  static Color _getColorFromString(String text) {
    final colors = [
      Colors.blue,
      Colors.green,
      Colors.orange,
      Colors.purple,
      Colors.teal,
      Colors.indigo,
      Colors.pink,
      Colors.cyan,
      Colors.amber,
      Colors.deepPurple,
    ];


org/2000/svg","aria-labelledby":t,...n},e?c.createElement("title",{id:t},e):null,c.createElement("rect",{width:16,height:16,rx:2,fill:"currentColor"})),"SvgStop"),ul=sI(({title:e,titleId:t,...n})=>c.createElement("svg",{width:"1em",height:"5em",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd","aria-hidden":"true",viewBox:"0 0 23 23",style:{height:"1.5em"},clipRule:"evenodd","aria-labelledby":t,...n},void 0===e?c.createElement("title",{id:t},"trash icon"):e?c.createElement("title",{id:t},e):null,c.createElement("path",{d:"M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-7 7.586l3.293-3.293 1.414 1.414-3.293 3.293 3.293 3.293-1.414 1.414-3.293-3.293-3.293 3.293-1.414-1.414 3.293-3.293-3.293-3.293 1.414-1.414 3.293 3.293zm2-10.586h-4v1h4v-1z",fill:"currentColor",strokeWidth:.25,stroke:"currentColor"})),"SvgTrash"),us=sI(({title:e,titleId:t,...n})=>c.createElement("svg",{height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...n},e?c.createElement("title",{id:t},e):null,c.createElement("rect",{x:.6,y:.6,width:11.8,height:11.8,rx:5.9,stroke:"currentColor",strokeWidth:1.2}),c.createElement("rect",{x:5.5,y:5.5,width:2,height:2,rx:1,fill:"currentColor"})),"SvgType"),uu=uH(sW),uc=uH(sq),ud=uH(sz),uf=uH(sU),up=uH(sK),uh=uH(sG),um=uH(s$),ug=uH(sY),uv=uH(sX),uy=uH(sQ),ub=uH(sZ,"filled docs icon"),uC=uH(sJ),uk=uH(s0),ux=uH(s1),uw=uH(s2),uE=uH(s5),uS=uH(s3),uT=uH(s6),uL=uH(s4),uA=uH(s9),uM=uH(s7),uN=uH(s8),uO=uH(ue),uD=uH(ut),uP=uH(un),u_=uH(ur),uF=uH(ui,"filled star icon"),uI=uH(uo),uR=uH(ua),uj=uH(ul,"trash icon"),uV=uH(us);function uH(e,t=e.name.replace("Svg","").replaceAll(/([A-Z])/g," $1").trimStart().toLowerCase()+" icon"){return e.defaultProps={title:t},e}sI(uH,"generateIcon");let uB=(0,c.forwardRef)((e,t)=>(0,u.jsx)("button",{...e,ref:t,className:(0,f.$)("graphiql-un-styled",e.className)}));uB.displayName="UnStyledButton";let uW=(0,c.forwardRef)((e,t)=>(0,u.jsx)("button"


:char;
use std::fs::{File, OpenOptions};
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
use std::path::Path;

static NAME: &str = "split";
static VERSION: &str = env!("CARGO_PKG_VERSION");

pub fn uumain(args: Vec<String>) -> i32 {
    let mut opts = getopts::Options::new();

    opts.optopt(
        "a",
        "suffix-length",
        "use suffixes of length N (default 2)",
        "N",
    );
    opts.optopt("b", "bytes", "put SIZE bytes per output file", "SIZE");
    opts.optopt(
        "C",
        "line-bytes",
        "put at most SIZE bytes of lines per output file",
        "SIZE",
    );
    opts.optflag(
        "d",
        "numeric-suffixes",
        "use numeric suffixes instead of alphabetic",
    );
    opts.optopt("l", "lines", "put NUMBER lines per output file", "NUMBER");
    opts.optflag(
        "",
        "verbose",
        "print a diagnostic just before each output file is opened",
    );
    opts.optflag("h", "help", "display help and exit");
    opts.optflag("V", "version", "output version information and exit");

    let matches = match opts.parse(&args[1..]) {
        Ok(m) => m,
        Err(f) => crash!(1, "{}", f),
    };

    if matches.opt_present("h") {
        let msg = format!(
            "{0} {1}

Usage:
  {0} [OPTION]... [INPUT [PREFIX]]

Output fixed-size pieces of INPUT to PREFIXaa, PREFIX ab, ...; default
size is 1000, and default PREFIX is 'x'. With no INPUT, or when INPUT is
-, read standard input.",
            NAME, VERSION
        );

        println!(
            "{}\nSIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.",
            opts.usage(&msg)
        );
        return 0;
    }

    if matches.opt_present("V") {
        println!("{} {}", NAME, VERSION);
        return 0;
    }

    let mut settings = Settings {
        prefix: "".to_owned(),
        numeric_suffix: false,
        suffix_length: 0,
        input: "".to_owned(),
        strategy: "".to_owned(),
        strategy_param: "".to_owned(),
        verbose: false,
    };

    settings.numeric_suffix = matches.opt_present("d");

    settings.suffix_length = match matches.opt_str("a") {
        Some(n) => match n.parse() {
            Ok(m) => m,
            Err(e) => crash!(1, "cannot parse num: {}", e),
        },
        None => 2,
    };

    settings.verbose = matches.opt_present("verbose");

    settings.strategy = "l".to_owned();
    settings.strategy_param = "1000".to_owned();
    let strategies = vec!["b", "C", "l"];
    for e in &strategies {
        match matches.opt_str(*e) {
            Some(a) => {
                if settings.strategy == "l" {
                    settings.strategy = (*e).to_owned();
                    settings.strategy_param = a;
                } else {
                    crash!(1, "{}: cannot split in more than one way", NAME)
                }
            }
            None => {}
        }
    }

    let mut v = matches.free.iter();
    let (input, prefix) = match (v.next(), v.next()) {
        (Some(a), None) => (a.to_owned(), "x".to_owned()),


   ticker.high = it.getDouble("high24h")
                ticker.low = it.getDouble("low24h")

                ticker.vol = it.getDouble("baseVol")
                ticker.volQuote = it.getDouble("quoteVol")

                ticker.bid = it.getDouble("buyOne")
                ticker.ask = it.getDouble("sellOne")

//                ticker.timestamp = it.getLong("ts")
            }
    }
}package com.aneonex.bitcoinchecker.datamodule.model.market

import com.aneonex.bitcoinchecker.datamodule.model.CheckerInfo
import com.aneonex.bitcoinchecker.datamodule.model.CurrencyPairInfo
import com.aneonex.bitcoinchecker.datamodule.model.Market
import com.aneonex.bitcoinchecker.datamodule.model.Ticker
import com.aneonex.bitcoinchecker.datamodule.util.forEachName
import com.aneonex.bitcoinchecker.datamodule.util.optDoubleNoData
import org.json.JSONObject

class CoinJar : Market(NAME, TTS_NAME, null) {
    override fun getUrl(requestId: Int, checkerInfo: CheckerInfo): String {
        return URL
    }

    @Throws(Exception::class)
    override fun parseTickerFromJsonObject(requestId: Int, jsonObject: JSONObject, ticker: Ticker, checkerInfo: CheckerInfo) {
        jsonObject
            .getJSONObject("exchange_rates")
            .getJSONObject(checkerInfo.currencyPairId!!).also {
                ticker.bid = it.optDoubleNoData("bid")
                ticker.ask = it.optDoubleNoData("ask")
                ticker.last = it.getDouble("midpoint")
            }
    }

    // ====================
    // Get currency pairs
    // ====================
    override fun getCurrencyPairsUrl(requestId: Int): String {
        return URL_CURRENCY_PAIRS
    }

    @Throws(Exception::class)
    override fun parseCurrencyPairsFromJsonObject(requestId: Int, jsonObject: JSONObject, pairs: MutableList<CurrencyPairInfo>) {
        jsonObject
            .getJSONObject("exchange_rates")
            .forEachName{ symbol, item ->
                pairs.add(CurrencyPairInfo(
                    item.getString("base_currency"),
                    item.getString("counter_currency"),
                    symbol
                ))
            }
    }

    companion object {
        private const val NAME = "CoinJar Prices"
        private const val TTS_NAME = "Coin Jar prices"
        private const val URL = "https://api.coinjar.com/v3/exchange_rates"
        private const val URL_CURRENCY_PAIRS = URL
    }
}package com.aneonex.bitcoinchecker.datamodule.model.market

import com.aneonex.bitcoinchecker.datamodule.model.CheckerInfo
import com.aneonex.bitcoinchecker.datamodule.model.CurrencyPairInfo
import com.aneonex.bitcoinchecker.datamodule.model.Ticker
import com.aneonex.bitcoinchecker.datamodule.model.currency.Currency
import com.aneonex.bitcoinchecker.datamodule.model.market.generic.SimpleMarket
import org.json.JSONObject
import java.util.*

class LiteBit : SimpleMarket(
        "LiteBit.eu",
        "https://api.litebit.eu/markets",
        "https://api.litebit.eu/market/%1\$s",
        "Lite Bit"
        ) {

    override fun parseCurrencyPairsFromJsonObject(requestId: Int, jsonObject: JSONObject, pairs: MutableList<CurrencyPairInfo>) {
        val data = jsonObject.getJSONObject("result")
        for (key in data.keys()) {
            val market = data.getJSONObject(key)

            pairs.add(
                CurrencyPairInfo(
                    market.getString("abbr").uppercase(Locale.ROOT),
                    Currency.EUR,
                    key
                ))
        }
    }


+ dir, c: prevMove.dst.c });
      }
    }
    return movesMatrix;
  }
  return [];
};
PieceGameLogic.isPossibleToMoveTo = (gameState: GameState,  src: Box): { (box: Box): boolean } => {
  const s = gameState.getEncoding(src);
  const numMoves = PieceGameLogic.getNumMoves(s);
  const PieceType = PieceGameLogic.getType(s);
  const isPossibleToMoveTo = PieceType.getPossibleMoves(gameState, src);
  return isPossibleToMoveTo;
};
PieceGameLogic.isInCheck = (gameState: GameState, src: Box): boolean => {
  for (let i = 0; i < gameState.rankCount; i++)
    for (let j = 0; j < gameState.fileCount; j++)
      if (src.r != i && src.c != j) {
        const possibleAttacks = PieceGameLogic.getPossibleMoves(gameState, {r:i,c:j});
        // console.log(`PieceGameLogic.isInCheck possibleAttacks piece at (${i},${j})`, possibleAttacks);
        for (let k = 0; k < possibleAttacks.length; k++) {
          if (possibleAttacks[k].r==src.r && possibleAttacks[k].c==src.c) return true;
        }
      }
  return false;
};
PieceGameLogic.isInCheckmate = (gameState: GameState, src: Box): boolean => {
  const possibleMoves = PieceGameLogic.getPossibleMoves(gameState, src);
  let pieceIsInCheck = PieceGameLogic.isInCheck(gameState, src);
  if (pieceIsInCheck) {
    let isInCheckmate = true; // use reduce
    for (let i = 0; i < possibleMoves.length; i++)
      isInCheckmate = isInCheckmate && PieceGameLogic.isInCheck(gameState, possibleMoves[i]);
    if (isInCheckmate) return true;
  }
  return false;
};
PieceGameLogic.kingCanCastleWithGivenRook = (gameState: GameState, src: Box, dst: Box): boolean => {
  const s = gameState.getEncoding(src);
  const t = gameState.getEncoding(dst);
  if (PieceGameLogic.getType(s).name != (new King('')).name || PieceGameLogic.getType(t).name != (new Rook('')).name || PieceGameLogic.getNumMoves(s) != 0 || PieceGameLogic.getNumMoves(t) != 0) return false;
  if (PieceHelper.isPieceOfCurrentPlayer(gameState, src) && PieceHelper.isPieceOfCurrentPlayer(gameState, dst) && PieceHelper.isBoxOnBoard(gameState, dst) && src != dst) {
    let dir = dst.c - src.c > 0 ? 1 : -1;
    let len = Math.abs(dst.c-src.c);
    for (let i = src.c+dir; len-- > 1; i += dir) if (!PieceHelper.isEmpty(gameState, {r:src.r,c:i})) return false;
    return true;
  }
};
/**
 * @returns {GameState} Updated GameState with King's castle.
 */
PieceGameLogic.castleKingWithGivenRook = (gameState: GameState, src: Box, dst: Box): GameState => {
  if (!PieceGameLogic.kingCanCastleWithGivenRook(gameState, src, dst)) return gameState;
  const newBoard = new Board(gameState.board);
  newBoard.setEncoding(src, PieceGameLogic.incrementMoveCount(gameState.getEncoding(src)));
  let outDir = dst.c - src.c > 0 ? 1 : -1;
  let shift = 0;
  if (Math.abs(dst.c - src.c) == 3) shift = 2;
  else if (Math.abs(dst.c - src.c) == 4) shift =


      val = math.floor((exponent * ((opt == 'd') and 16 or 128) + val) / (2 ^ 8))
      bytes[#bytes + 1] = math.floor(sign * 128 + val) % (2 ^ 8)
      val = math.floor((sign * 128 + val) / (2 ^ 8))

      return bytes
end

local function bytesToFloatOrDouble(bytes, opt)
      local n = (opt == 'd') and 8 or 4

      local sign = 1
      local mantissa = bytes[n - 1] % ((opt == 'd') and 16 or 128)
      for i = n - 2, 1, -1 do
        mantissa = mantissa * (2 ^ 8) + bytes[i]
      end

      if bytes[n] > 127 then
        sign = -1
      end

      local exponent = (bytes[n] % 128) * ((opt == 'd') and 16 or 2) + math.floor(bytes[n - 1] / ((opt == 'd') and 16 or 128))
      if exponent == 0 then
        return 0.0
      else
        mantissa = (math.ldexp(mantissa, (opt == 'd') and -52 or -23) + 1) * sign
        return math.ldexp(mantissa, exponent - ((opt == 'd') and 1023 or 127))
      end
end

--

function bit_converter.float32_to_bytes(float, order)
    return fromLE(floatOrDoubleToBytes(float, 'f'), order)
end

function bit_converter.float64_to_bytes(float, order)
    return fromLE(floatOrDoubleToBytes(float, 'd'), order)
end

function bit_converter.single_to_bytes(float, order)
    on_deprecated_call("bit_converter.float_to_bytes", "bit_converter.float32_to_bytes")
    return bit_converter.float32_to_bytes(bytes, order)
end

function bit_converter.double_to_bytes(double, order)
    on_deprecated_call("bit_converter.double_to_bytes", "bit_converter.float64_to_bytes")
    return bit_converter.float64_to_bytes(bytes, order)
end

local function uint32ToBytes(int, order)
    return fromLE({
        maskHighBytes(int),
        maskHighBytes(bit.rshift(int, 8)),
        maskHighBytes(bit.rshift(int, 16)),
        maskHighBytes(bit.rshift(int, 24))
    }, order)
end

local function uint16ToBytes(int, order)
    return fromLE({
        maskHighBytes(int),
        maskHighBytes(bit.rshift(int, 8))
    }, order)
end

function bit_converter.uint32_to_bytes(int, order)
    if int > MAX_UINT32 or int < MIN_UINT32 then
        error("invalid uint32")
    end

    return uint32ToBytes(int, order)
end

function bit_converter.uint16_to_bytes(int, order)
    if int > MAX_UINT16 or int < MIN_UINT16 then
        error("invalid uint16")
    end

    return uint16ToBytes(int, order)
end

function bit_converter.int64_to_bytes(int, order)
    if int > MAX_INT64 or int < MIN_INT64 then
        error("invalid int64")
    end

    return fromLE({
        maskHighBytes(int),
        maskHighBytes(bit.rshift(int, 8)),
        maskHighBytes(bit.rshift(int, 16)),
        maskHighBytes(bit.rshift(int, 24)),
        maskHighBytes(bit.rshift(int, 32)),
        maskHighBytes(bit.rshift(int, 40)),
        maskHighBytes(bit.rshift(int, 48)),
        maskHighBytes(bit.rshift(int, 56))
    }, order)
end

function bit_converter.int32_to_bytes(int, order)
    on_deprecated_call("bit_converter.int


 v3dt changes */
caption { font: 90% sans-serif; }

ul.schema {
	list-style: disc;		/* Mac NS has problem with 'none' */
	list-style: none;
	margin: 1em 1em 1em 1em;
}

ul.schema ul.schema {
	list-style: disc;		/* Mac NS has problem with 'none' */
	list-style: none;
	margin: 0 0 0 1em;
}
.vis-background,.vis-labelset,.vis-timeline{overflow:hidden}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}.vis-panel,.vis-timeline{padding:0;box-sizing:border-box}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%)


:= logrusRecorder{Level: logrus.InfoLevel}
	warnRecorder := logrusRecorder{Level: logrus.WarnLevel}
	log.AddHook(&infoRecorder)
	log.AddHook(&warnRecorder)

	logStdout := getLogfForLevel(log, logrus.InfoLevel)
	logStderr := getLogfForLevel(log, logrus.WarnLevel)
	err := runAndLogCommand(nil, cmd, logStdout, logStderr)
	assert.Nil(t, err)
	assert.Equal(t, []string{"stderr> FOO\n"}, warnRecorder.Messages)
	assert.Equal(t, []string{"stdout> LALA\n"}, infoRecorder.Messages)
}

func TestLogcmdFail(t *testing.T) {
	cmd := exec.Command("/bin/sh", "-c", "exit 1")
	log := logrus.New()
	log.SetOutput(ioutil.Discard)

	infoRecorder := logrusRecorder{Level: logrus.InfoLevel}
	warnRecorder := logrusRecorder{Level: logrus.WarnLevel}
	log.AddHook(&infoRecorder)
	log.AddHook(&warnRecorder)

	logStdout := getLogfForLevel(log, logrus.InfoLevel)
	logStderr := getLogfForLevel(log, logrus.WarnLevel)
	err := runAndLogCommand(nil, cmd, logStdout, logStderr)
	assert.Error(t, err)
	assert.Nil(t, warnRecorder.Messages)
	assert.Equal(t, []string(nil), infoRecorder.Messages)
}

func TestLogcmdTimeout(t *testing.T) {
	log := logrus.New()
	log.SetOutput(ioutil.Discard)

	infoRecorder := logrusRecorder{Level: logrus.InfoLevel}
	warnRecorder := logrusRecorder{Level: logrus.WarnLevel}
	log.AddHook(&infoRecorder)
	log.AddHook(&warnRecorder)

	ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond)
	defer cancel()
	err := RunAndLogCommandContext(ctx, log, "/bin/sh", "-c", "sleep inf")
	assert.ErrorIs(t, err, context.DeadlineExceeded)
}

func TestLogcmdNoTimeout(t *testing.T) {
	log := logrus.New()
	log.SetOutput(ioutil.Discard)
	infoRecorder := logrusRecorder{Level: logrus.InfoLevel}
	warnRecorder := logrusRecorder{Level: logrus.WarnLevel}
	log.AddHook(&infoRecorder)
	log.AddHook(&warnRecorder)

	ctx, cancel := context.WithTimeout(context.Background(), time.Second)
	defer cancel()
	err := RunAndLogCommandContext(ctx, log, "/bin/sh", "-c", "sleep .1s")
	assert.Nil(t, err)
}

func TestRunAndLogCommandsContext(t *testing.T) {
	log := logrus.New()
	log.SetOutput(ioutil.Discard)
	infoRecorder := logrusRecorder{Level: logrus.InfoLevel}
	warnRecorder := logrusRecorder{Level: logrus.WarnLevel}
	log.AddHook(&infoRecorder)
	log.AddHook(&warnRecorder)

	err := RunAndLogCommandsContext(context.Background(), log,
		[]string{"/bin/sh", "-c", "echo FOO"},
		[]string{"/bin/sh", "-c", "echo LALA>&2"},
	)
	assert.Nil(t, err)
	assert.Equal(t, []string{"starting command", "stdout> FOO\n", "starting command"}, infoRecorder.Messages)
	assert.Equal(t, []string{"stderr> LALA\n"}, warnRecorder.Messages)
}
// SPDX-License-Identifier: Apache-2.0
/* Copyright Mart


l
{
    /// <summary>
    ///
    /// </summary>
    public partial class AssetStorageProviderService
    {
        /// <summary>
        /// Gets the active no tracking.
        /// </summary>
        /// <returns></returns>
        public IQueryable<AssetStorageProvider> GetActiveNoTracking()
        {
            return Queryable()
                .AsNoTracking()
                .Where( a => a.IsActive == true );
        }

        /// <summary>
        /// Gets all no tracking.
        /// </summary>
        /// <returns></returns>
        public IQueryable<AssetStorageProvider> GetAllNoTracking()
        {
            return Queryable().AsNoTracking();
        }
    }
}


rence = source.ValueReference,
                            ValueInteger = source.ValueInteger,
                            ValueDateTime = source.ValueDateTime,
                            ComputedValueIndex = source.ComputedValueIndex
                        });
        await LinqToDB.LinqExtensions.MergeAsync(merged);
    }

    public async Task<ITransaction> StartTransaction(CancellationToken token)
    {
        var inMemory = _scimDbContext.Database.IsInMemory();
        IDbContextTransaction transaction = null;
        if(!inMemory) transaction = await _scimDbContext.Database.BeginTransactionAsync(token);
        return new EFTransaction(_scimDbContext, transaction);
    }

    private void ResolveChildren(IQueryable<SCIMRepresentationAttribute> representationAttributes, string parentId, List<SCIMRepresentationAttribute> children)
    {
        var filteredAttributes = representationAttributes.Where(a => a.ParentAttributeId == parentId);
        children.AddRange(filteredAttributes);
        foreach (var fAttr in filteredAttributes) ResolveChildren(representationAttributes, fAttr.Id, children);
    }
}


kt-login.kt-login--v6.kt-login--signup .kt-login__account {
  display: none; }

.kt-login.kt-login--v6.kt-login--forgot .kt-login__signup {
  display: none; }

.kt-login.kt-login--v6.kt-login--forgot .kt-login__signin {
  display: none; }

.kt-login.kt-login--v6.kt-login--forgot .kt-login__forgot {
  display: block; }

@media (max-width: 1024px) {
  .kt-login.kt-login--v6 {
    height: 100%; }
    .kt-login.kt-login--v6 .kt-login__aside {
      padding: 3rem 1.5rem;
      width: 100%; }
      .kt-login.kt-login--v6 .kt-login__aside .kt-login__wrapper {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        padding-top: 1.5rem; }
        .kt-login.kt-login--v6 .kt-login__aside .kt-login__wrapper .kt-login__container {
          padding-bottom: 2rem; }
        .kt-login.kt-login--v6 .kt-login__aside .kt-login__wrapper .kt-login__logo {
          margin: 1.5rem auto 2rem auto; }
      .kt-login.kt-login--v6 .kt-login__aside .kt-login__account {
        margin-top: 1.5rem; }
    .kt-login.kt-login--v6 .kt-login__content {
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center;
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center;
      padding: 4rem 1.5rem; }
      .kt-login.kt-login--v6 .kt-login__content .kt-login__section .kt-login__title {
        font-size: 1.3rem;
        margin-bottom: 1rem; }
      .kt-login.kt-login--v6 .kt-login__content .kt-login__section .kt-login__desc {
        font-size: 1rem;
        margin: 0; } }
/*
$kt-media-breakpoints: (
    // Small screen / phone
    sm: 576px,

    // Medium screen / tablet
    md: 768px,

    // Large screen / desktop
    lg: 1024px,

    // Extra large screen / wide desktop
    xl: 1200px,

    // Extra large screen / wide desktop
    xxl: 1600px
)!default;
*/
.kt-pricing-4 {
  padding-bottom: 4rem; }
  .kt-pricing-4 .kt-pricing-4__top {
    background-color: #E0306E; }
    .kt-pricing-4 .kt-pricing-4__top .kt-pricing-4__top-container.kt-pricing-4__top-container--fixed {
      width: 80%;
      margin: 0 auto; }
      .kt-pricing-4 .kt-pricing-4__top .kt-pricing-4__top-container.kt-pricing-4__top-container--fixed .kt-pricing-4__top-header .kt-pricing-4__top-title {
        padding-top: 5rem;
        margin-bottom: 5rem;
        text-align: center; }
        .kt-pricing-4 .kt-pricing-4__top .kt-pricing-4__top-container.kt-pricing-4__top-container--fixed .kt-pricing-4__top-header .kt-pricing-4__top-title > h1 {
          font-size: 2.3rem; }
      .kt-pricing


local M = {}
local dUtils = dofile('../utils/depthUtils.lua')
local matio = require 'matio'
local rpsem = require 'rpsem'
-------------------------------
-------------------------------
local maxSavedDepth = 10
local function BuildArray(...)
  local arr = {}
  for v in ... do
    arr[#arr + 1] = v
  end
  return arr
end
-------------------------------
-------------------------------
local fusion = {}
fusion.__index = fusion

setmetatable(fusion, {
    __call = function (cls, ...)
        return cls.new(...)
    end,
})

function fusion.new(synsetDir, nImgs, maskOnly, geometry, useNoise)
    local self = setmetatable({}, fusion)
    self.nImgs = nImgs
    self.depthPrefix = useNoise and 'noise0pt2_depth' or 'depth'
    self.synsetDir = synsetDir
    self.modelNames = BuildArray(paths.files(self.synsetDir,'...'))

    self.geometry = geometry
    self.sz, self.nCells = unpack(geometry:size())
    self.gridSize = {}
    for d=1,self.sz:size(1) do
        self.gridSize[d] = self.sz[d]
    end
    self.maxBounds = self.geometry.maxBounds:clone():contiguous()
    self.minBounds = self.geometry.minBounds:clone():contiguous()
    local useProj = (self.geometry.focal ~= nil)
    self.focal = (useProj and self.geometry.focal or self.geometry.step):clone():contiguous()
    self.useProj = torch.Tensor({useProj and 1 or 0}):int()
    self.maskOnly = torch.Tensor({maskOnly and 1 or 0}):int()
    self.nRaysPerCam = 224*224
    self.emptyCount = torch.Tensor(torch.LongStorage(self.gridSize))
    self.occCount = torch.Tensor(torch.LongStorage(self.gridSize))

    return self
end

function fusion:fuseModel(imgsDir)
    local nRays = self.nRaysPerCam*self.nImgs
    local bs = 1
    local depths = torch.Tensor(bs, nRays):float()
    local origins = torch.Tensor(bs, nRays, 3):float()
    local directions = torch.Tensor(bs, nRays, 3):float()

    local nImgs = self.nImgs
    for nc = 1,self.nImgs do
        local numSamples =  self.nRaysPerCam


180,209084,294511,341883,950245,682522,928567,11164,521521,517406,656091,745508,110186,385822,214496,185987,528480,779521,113896,382726,753691,94187,135083,244744,326718,948968,745036,920985,941055,61746,686652,381469,49872,396535,559373,456580,827707,549876,311840,877859,142887,11962,592204,890322,183714,102470,377534,741303,449791,498875,254557,252759,631929,223879,313019,977602,396522,981557,192823,213065,201563,137499,468268,428579,578766,850577,680291,913663,878458,836303,645333,775669,952560,696792,2125,462873,244844,230436,308437,680823,312206,187930,454287,388493,453155,602372,779737,410682,187030,543206,635695,522905,506872,128604,441425,393189,560552,785663,582671,841129,462032,352536,616029,577813,824889,140682,800970,335044,132787,930637,614397,904883,466653,644831,307910,689008,831341,905015,245670,967883,418419,230490,541833,459906,676144,34298,775461,460419,569832,50486,601995,742433,354477,686576,69000,57021,705167,523801,325395,838828,845566,740921,27921,105732,490331,296060];
import CopyableText from "@/components/shared/CopyableText";
import { TextButton } from "@/components/table/styles";
import { usePlayerSidebar } from "@/hooks/usePlayerSidebar";
import dayjs from "dayjs";

export const auditLogsColumns = [
  {
    header: "Time",
    accessorKey: "creation_time",
    cell: ({ row }) => {
      return dayjs(row.original.creation_time).format("lll");
    },
    meta: {
      variant: "action",
    },
  },
  {
    header: "User",
    accessorKey: "username",
  },
  {
    header: "Action",
    accessorKey: "command",
  },
  {
    header: "Player",
    cell: ({ row }) => {
      const { openWithId } = usePlayerSidebar();
      let args, player, playerId;
      try {
        args = JSON.parse(row.original.command_arguments);
        player = args.player_name ?? args.description;
        playerId = args.player_id;
      } catch (e) {
        return "";
      }

      if (playerId) {
        return (
          <TextButton
            onClick={(e) => {
              e.stopPropagation();
              openWithId(playerId);
            }}
          >
            {player}
          </TextButton>
        );


nt-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;-webkit-text-decoration:var(--mdc-typography-button-text-decoration, none);text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-typography--overline{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-overline-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-overline-font-size, 0.75rem);line-height:2rem;line-height:var(--mdc-typography-overline-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-overline-font-weight, 500);letter-spacing:0.1666666667em;letter-spacing:var(--mdc-typography-overline-letter-spacing, 0.1666666667em);text-decoration:none;-webkit-text-decoration:var(--mdc-typography-overline-text-decoration, none);text-decoration:var(--mdc-typography-overline-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-overline-text-transform, uppercase)}

 /*# sourceMappingURL=material-components-web.min.css.map*/
@use "sass:math";

.rc-tabs {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.rc-tabs-bar,
.rc-tabs-nav-container {
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  outline: none;
  zoom: 1;
  transition: padding .45s;
}

.rc-tabs-ink-bar {
  margin-top: 0;
  @include border-radius($border-radius);
  box-shadow:
          0 16px 26px -10px rgba($primary, 0.56),
          0 4px 25px 0px rgba(0, 0, 0, 0.12),
          0 8px 10px -5px rgba($primary, 0.2);
}

.rc-tabs-ink-bar-animated {
  transition: all 0.5s cubic-bezier(0.29, 1.42, 0.79, 1) 0s;
}

.rc-tabs-tab-prev,
.rc-tabs-tab-next {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  z-index: 1;
  line-height: 36px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  position: absolute;
}

.rc-tabs-tab-prev-icon,
.rc-tabs-tab-next-icon {
  position: relative;
  display: inline-block;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  line-height: inherit;
  vertical-align: baseline;
  text-align: center;
  text-transform: none


=1;j<=m;j++)//ͳ˵滰
    if(lie[j]==1)
     lieNum++;
  if(lieNum>m-n)//˵滰޶ìܣ˳
    return 0;

  return 1;//ˣ˵һȷ⣬1
}

int main()
{
  freopen("LOGIC.in","r",stdin);
  freopen("LOGIC.out","w",stdout);
  int i,j,index,BadManNum=0;
  string temp,BadMan;
  char word[250];
  cin>>m>>n>>p;
  for(i=1;i<=m;i++)//ȡ
    cin>>student[i].name;
  gets(word);//ֻмһ䣬ȷ֤
  for(i=1;i<=p;i++)//벢֤
  {
    string temp=gets(word);
    int pos=temp.find(":",0);
    string t1(temp,0,pos);

    for(j=1;j<=m;j++)//ȷĸ˵Ļ
      if(student[j].name==t1)
        index=j;
    temp.erase(0,pos+2);//ɾ":"ǰ
    if(temp=="I am guilty.")
      student[index].Me=1;
    else if(temp=="I am not guilty.")
      student[index].NotMe=1;
    else if(temp=="Today is Monday.")
      student[index].day[1]=1;
    else if(temp=="Today is Tuesday.")
      student[index].day[2]=1;
    else if(temp=="Today is Wednesday.")
      student[index].day[3]=1;
    else if(temp=="Today is Thursday.")
      student[index].day[4]=1;
    else if(temp=="Today is Friday.")
      student[index].day[5]=1;
    else if(temp=="Today is Saturday.")
      student[index].day[6]=1;
    else if(temp=="Today is Sunday.")
      student[index].day[7]=1;
    else
    {
      for(j=1;j<=m;j++)
      {
        t1=student[j].name+" is guilty.";
        if(temp==t1)
          student[index].P[j]=1;
      }
      for(j=1;j<=m;j++)
      {
        t1=student[j].name+" is not guilty.";
        if(temp==t1)
          student[index].NotP[j]=1;
      }
    }
  }//Ԥ,˴Ӧ֤ǷȷԱһ

  for(i=1;i<=m;i++)//ٿܵﷸ
    for(j=1;j<=7;j++)//ٿܵ
    {
      if(judge(i,j)==0)//֤ì
        continue;
      else if(judge(i,j)==1)//֤ʶ
      {
        if(BadMan!=student[i].name)//壡Ϊظ֤ĳﷸ
          BadManNum++;//ﷸ1
        BadMan=student[i].name;
      }
    }
  if(BadManNum==1)
    cout<<BadMan<<endl;
  else if(BadManNum>1)
    cout<<"Cannot Determine"<<endl;
  else
    cout<<"Impossible"<<endl;
  return 0;
}
//޾1
#include <


700000){M=600; R=0;}
    	else if(freq>=  330000){M=1280; R=0;}
    	else if(freq>=  150000){M=1300; R=1;}
    	else if(freq>=   67000){M=1500; R=2;}
    	else if(freq>=   30300){M=1600; R=3;}
    	else if(freq>=   14000){M=1800; R=4;}
    	else if(freq>=    7000){M=1800; R=5;}
    	else if(freq>=    3500){M=1800; R=6;}
    	else{M=1800; R=7;}

    	freq*=M;
    	freq<<=R;

    	unsigned long c=0xFFFFF;
    	unsigned long a=freq/fxtal;
    	unsigned long b=(long)((float)(freq-a*fxtal)*(float)c/(float)fxtal);
    	unsigned long dd=(128*b)/c;
    	unsigned long P1=128*a+dd-512;
    	unsigned long P2=128*b-c*dd;
    	unsigned long P3=c;

    	//Set fvco of PLL_A
        cmd_si5351(26,(P3>>8)&0xFF);        //MSNA_P3[15:8]
        cmd_si5351(27,P3&0xFF);             //MSNA_P3[7:0]
        cmd_si5351(28,(P1>>16)&0x03);       //MSNA_P1[17:16]
        cmd_si5351(29,(P1>>8)&0xFF);        //MSNA_P1[15:8]
        cmd_si5351(30,P1&0xFF);              //MSNA_P1[7:0]
        cmd_si5351(31,(P3>>12)&0xF0|(P2>>16)&0x0F);//MSNA_P3[19:16], MSNA_P2[19:16]
        cmd_si5351(32,(P2>>8)&0xFF);        //MSNA_P2[15:8]
        cmd_si5351(33,P2&0xFF);             //MSNA_P2[7:0]

    	// Set MS0, MS1
    	// a=M, b=0, c=1 ---> P1=128*M-512, P2=0, P3=1
    	if(M==4){
    		P1=0;
    		cmd_si5351(42,0);                   //MS0_P3[15:8]
    		cmd_si5351(43,1);                   //MS0_P3[7:0]
    		cmd_si5351(44,0b00001100);  		//0,R0_DIV[2:0],MS0_DIVBY4[1:0],MS0_P1[17:16]
    		cmd_si5351(45,0);        			//MS0_P1[15:8]
    		cmd_si5351(46,0);              		//MS0_P1[7:0]
    		cmd_si5351(47,0);                   //MS0_P3[19:16], MS0_P2[19:16]
    		cmd_si5351(48,0);                   //MS0_P2[15:8]
    		cmd_si5351(49,0);                   //MS0_P2[7:0]

    		cmd_si5351(50,0);                   //MS1_P3[15:8]
    		cmd_si5351(51,1);                   //MS1_P3[7:0]
    		cmd_si5351(52,0b00001100);  		//0,R1_DIV[2:0],MS1_DIVBY4[1:0],MS1_P1[17:16]
    		cmd_si5351(53,0);        			//MS1_P1[15:8]
    		cmd_si5351(54,0);              		//MS1_P1[7:0]
    		cmd_si5351(55,0);                   //MS1_P3[19:16


       "Unable to get sabre payload for create namespace registry permission: {}",
                err
            ))
        })?
        .into_transaction_builder()
        .map_err(|err| {
            SabreCommandExecutorError::Internal(format!(
                "Unable to get transaction builder for create namespace registry permission: {}",
                err
            ))
        })?
        .build(signer)
        .map_err(|err| {
            SabreCommandExecutorError::Internal(format!(
                "Unable to build create namespace registry transaction: {}",
                err
            ))
        })
}
extern crate proc_macro;

mod args;
mod throws;

use proc_macro::*;

use args::Args;
use throws::Throws;

#[proc_macro_attribute]
pub fn throws(args: TokenStream, input: TokenStream) -> TokenStream {
    let args = syn::parse_macro_input!(args as Args);
    Throws::new(args).fold(input)
}
<reponame>aslilac/doin<gh_stars>1-10
mod completions;

use std::{env, io, process::Command};

fn main() -> io::Result<()> {
    let mut args = env::args().skip(1);
    let dir_or_flag = args.next().expect("Must provide a directory to run in!");

    if dir_or_flag == "--fish-completions" {
        println!("{}", completions::FISH);
        return Ok(());
    }

    let dir = dir_or_flag;
    let command = args.next().expect("Must provide a command to run!");
    Command::new(command).current_dir(dir).args(args).status()?;
    Ok(())
}
<reponame>Wassasin/nrfxlib-sys
#![no_std]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]

pub mod ctypes {
	pub type c_char = u8;
	pub type c_schar = i8;
	pub type c_uchar = u8;
	pub type c_int = i32;
	pub type c_uint = u32;
	pub type c_long = i32;
	pub type c_ulong = u32;
	pub type c_longlong = i64;
	pub type c_ulonglong = u64;
	pub type c_ushort = u16;
	pub type c_short = i16;

	#[repr(u8)]
	pub enum c_void {
		// Two dummy variants so the #[repr] attribute can be used.
		#[doc(hidden)]
		__variant1,
		#[doc(hidden)]
		__variant2,
	}
}

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
<filename>src/interpolate.rs
/*!
    Interpolation methods for spectral distributions.

    These type of interpolation methods work well with relatively smooth spectral distributions, such as typical surface
    reflections spectra, and color matching functions.  For peaky spectral distributions, which can occur with emissive
    sources such as hid and fluorescent lamps, these methods should not be used. It is best to interpoate smooth spetral
    distributions to peaky distributions: in this library, when calculating tristimulus values, color matching
    functions, which are smooth, are interpolated to illuminant spectra. In rare cases, having a peaky source spectrum,
    and peaky reflection or transmission spectrum, care has to be taken to make sure the color calculations are
    performed correctly.
*/

use std::ops::Index;

use nalgebra::{storage::Storage, DMatrix, Dim, Matrix};
use nalgebra::{Const, Dynamic, Matrix3xX, MatrixSlice3xX, OMatrix, VecStorage};

use crate::Domain;
use crate::{Step, Unit};

use super::IterInterpolateType;

pub fn matrix_from_data_by_lin_row_int<S1, S2, const R: usize, const C: usize>(
    from_domain: &Domain<S1>,
    to_domain: &Domain<S2>,
    data: &[[f64; R]; C], //
) -> Matrix<f64, Const<R>, Dynamic, VecStorage<f64, Const<R>, Dynamic>>
// MatrixNxX
where
    S1


ide] {:.flexbox.vleft}
## 其他标签
### select option
```html
<!--下拉选择列表-->
<select name="cars">
	<option value="volvo">Volvo</option>
	<option value="saab">Saab</option>
	<option value="fiat">Fiat</option>
	<option value="audi">Audi</option>
</select>
```

[slide] {:.flexbox.vleft}
## [案例与练习](/demos/editor.html?file=form6)

[slide]
# 前端开发
## 旨为前端开发工程师的前端开发基础课程
title: Date对象
speaker: 交互开发课题组
url: https://zptcsoft.github.io/ppt/38.htm
transition: rollIn
files: /js/demo.js,/style/01.css,/js/zoom.js
theme: colors

[slide]
# Date对象
## 演讲者：交互开发课题组

[slide]
## 内容提纲
1. Date对象概述
2. Date对象方法
3. 时间操作
4. 案例练习

[slide] {:.flexbox.vleft}
## Date对象概述
- 日期对象用于处理日期和时间。
- 时间范围是1970年1月1日00:00:00前后的各1亿天（单位为毫秒）。
- 参考资料
	- [参考1](http://javascript.ruanyifeng.com/stdlib/date.html)
	- [参考2](http://w3school.com.cn/js/js_obj_date.asp)

[slide] {:.flexbox.vleft}
## Date对象方法
- 构造方法
- 静态方法
- 实例方法
	- get方法
	- set方法
	- to方法

[slide] {:.flexbox.vleft}
## Date对象构造方法
- 不带参数，返回当前时间
- 数字做参数，返回自1970年1月1日00:00:00开始计算的毫秒数的时间
- 日期字符串作为参数，返回所对应的时间
- 多个整数作为参数，依次表示年、月、日、小时、分钟、秒和�


ggles
 * -----Footer
 * -----Column
 * -----Checkbox
 * -----Card
 * -----Button
 * -----Animation
 * -----Progress
 * -----Badge
 * -----Shadows
 * -----Grid
 * -----Data table
 * -----Dialog
 * -----Snackbar
 * -----Tooltip
 * -----Chip
 *
 * Even though all variables have the `!default` directive, most of them
 * should not be changed as they are dependent one another. This can cause
 * visual distortions (like alignment issues) that are hard to track down
 * and fix.
 */
/* ==========  TYPOGRAPHY  ========== */
/* We're splitting fonts into "preferred" and "performance" in order to optimize
   page loading. For important text, such as the body, we want it to load
   immediately and not wait for the web font load, whereas for other sections,
   such as headers and titles, we're OK with things taking a bit longer to load.
   We do have some optional classes and parameters in the mixins, in case you
   definitely want to make sure you're using the preferred font and don't mind
   the performance hit.
   We should be able to improve on this once CSS Font Loading L3 becomes more
   widely available.
*/
/* ==========  COLORS  ========== */
/**
*
* Material design color palettes.
* @see http://www.google.com/design/spec/style/color.html
*
**/
/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* ==========  Color Palettes  ========== */
/* colors.scss */
/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* ==========  IMAGES  ========== */
/* ==========  Color & Themes  ========== */
/* ==========  Typography  ========== */
/* ==========  Components  ========== */
/* ==========  Standard Buttons  ========== */
/* ==========  Icon Toggles  ========== */
/* ==========  Radio Buttons  ========== */
/* ==========  Ripple effect  ========== */
/* ==========  Layout  ========== */
/* ==========  Content Tabs  ========== */
/* ==========  Checkboxes  ========== */
/* ==========  Switches  ========== */
/* ==========  Spinner  ========== */
/* ==========  Text fields  ========== */
/* ==========  Card  ========== */
/* ==========  Sliders ========== */
/* ========== Progress ========== */
/* ==========  List ========== */
/* ==========  Item ========== */
/* ==========  Dropdown menu ========== */
/* ==========  Tooltips  ========== */
/* ==========  Footer  ========== */
/* TEXTFIELD */
/* SWITCH */
/* SPINNER */
/* RADIO */
/* MENU */
/* LIST */


0980] = "Kurzbogen der Wacht",
[20981] = "Neophytenstreitkolben",
[20982] = "Geschärfter Dolch",
[20983] = "Akolythendolch",
[20984] = "Rekrutenschild",
[20985] = "Lichtstoffschuhe",
[20986] = "Lichtstoffhose",
[20987] = "Lichtstoffhandschuhe",
[20988] = "Lichtstoffarmschienen",
[20989] = "Lichtstoffgürtel",
[20990] = "Lichtstoffrüstung",
[20991] = "Umhang des Tageslichts",
[20992] = "Armschienen der Morgensonne",
[20993] = "Luchshauthandschuhe",
[20994] = "Grüne Kettenweste",
[20995] = "Handschuhe des Brunnenbehüters",
[20996] = "Kordel des Sonnenturms",
[20997] = "Grüne Kettenstiefel",
[20998] = "Wyrmschärpe",
[20999] = "Grüne Kettenstulpen",
[21000] = "Armschienen der Lebhaftigkeit",
[21001] = "Hosen des Wanderers",
[21002] = "Abgetragener Gürtel",
[21003] = "Abgetragene Armschienen",
[21004] = "Abgetragener Umhang",
[21005] = "Abgetragene Handschuhe",
[21006] = "Abgetragene Hose",
[21007] = "Abgetragene Robe",
[21008] = "Abgetragene Schuhe",
[21009] = "Abgewetzter Ledergürtel",
[21010] = "Abgewetzte Lederstiefel",
[21011] = "Abgewetzte Lederarmschienen",
[21012] = "Abgewetzte Lederhandschuhe",
[21013] = "Abgewetzte Lederhose",
[21014] = "Abgewetzte Lederweste",
[21015] = "Schäbiger Kettengürtel",
[21016] = "Schäbige Kettenweste",
[21017] = "Schäbige Kettenhose",
[21018] = "Schäbige Kettenhandschuhe",
[21019] = "Schäbige Kettenarmschienen",
[21020] = "Schäbige Kettenstiefel",
[21021] = "Ramponierter Schild",
[21022] = "Verwitterter Rundschild",
[21023] = "Dirges abgefahrene Chimaerokkoteletts",
[21024] = "Chimaeroklenden",
[21025] = "Rezept: Dirges abgefahrene Chimaerokkoteletts",
[21026] = "Orakelsphäre",
[21027] = "Lakmaerans Kadaver",
[21028] = "500 Pfund-Hühnchen",
[21029] = "Lösegeldforderung",
[21030] = "Darnassischer Kimchikuchen",
[21031] = "Weißkohlkimchi",
[21032] = "Meridiths Liebesbrief",
[21033] = "Rettichkimchi",
[21034] = "Weiße Testzweihandaxt",
[21035] = "Weißer Testdolch",
[21036] = "Testbogen",
[21037] = "Primitive Karte",
[21038] = "Festgeformter Schneeball",
[21039] = "Narains Turban",
[21040] = "Narains Robe",
[21041] = "Tasche voller Gold",
[21042] = "Narains Spezialset",
[21043] = "Geheimnisvoller Umschlag",
[21044] = "Rentierzügel",
[210


r
// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.
//
// ? To change the layout colors you just need to change the $black and $body-bg colors and rest (border, card, font colors and etc...) will be adjust automatically.
// ? Use https://noeldelgado.github.io/shadowlord/ to select proper 💄 Color tints and shade for $black and $body-bg color.
// ? color-variables and theme-color-variables (branding colors) can be choose as per your preferences. We suggest you to use https://colors.eva.design/
// ! Light style use $black to generate the $gray shades.
// (C) Custom variables for extended components of bootstrap only

// * Color system
// *******************************************************************************

// scss-docs-start gray-color-variables
$white: #fff !default;
$black: #2e263d !default;
$gray-25: rgba($black, 0.025) !default; // (C)
$gray-50: rgba($black, 0.06) !default; // (C)
$gray-75: rgba($black, 0.08) !default; // (C)
$gray-100: rgba($black, 0.1) !default;
$gray-200: rgba($black, 0.2) !default;
$gray-300: rgba($black, 0.3) !default;
$gray-400: rgba($black, 0.4) !default;
$gray-500: rgba($black, 0.5) !default;
$gray-600: rgba($black, 0.6) !default;
$gray-700: rgba($black, 0.7) !default;
$gray-800: rgba($black, 0.8) !default;
$gray-900: rgba($black, 0.9) !default;
// scss-docs-end gray-color-variables

// scss-docs-start gray-colors-map
$grays: (
  '25': $gray-25,
  '50': $gray-50
) !default;
// scss-docs-end gray-colors-map

// scss-docs-start color-variables
$blue: #16b1ff !default;
$indigo: #666cff !default;
$purple: #8c57ff !default;
$pink: #e83e8c !default;
$red: #ff4c51 !default;
$orange: #ffb400 !default;
$yellow: #ffb400 !default;
$green: #56ca00 !default;
$teal: #20c997 !default;
$cyan: #28c3d7 !default;
// scss-docs-end color-variables

// scss-docs-start theme-color-variables
$primary: $purple !default;
$secondary: #8a8d93 !default;
$success: $green !default;
$info: $blue !default;
$warning: $orange !default;
$danger: $red !default;
$light: #dfdfe3 !default;
$dark: #4b4b4b !default;
$gray: $gray-500 !default; // (C)
// scss-docs-end theme-color-variables

// scss-docs-start theme-colors-map
$theme-colors: (
  'primary': $primary,
  'secondary': $secondary,
  'success': $success,
  'info': $info,
  'warning': $warning,
  'danger': $danger,
  'light': $light,
  'dark': $dark,
  'gray': $gray
) !default;
// scss-docs-end theme-colors-map

$color-scheme: 'light' !default; // (C)
// The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
// See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
$min-contrast-ratio: 1.6 !default;

// Characters which are escaped by the escape-svg function
$escaped-characters: (('<', '%3c'), ('>', '%3e'), ('#', '%23'), ('(', '%28'), (')', '%29')) !default;

// * Options
// *******************************************************************************

$enable-negative-margins: true !default;
$enable-validation-icons: false


import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

import plotly.express as px
import pandas as pd

import dash_draggable

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv')

app.layout = html.Div([
    html.H1("Dash Draggable"),
    html.B("Description:"),
    html.Ul([
        html.Li("The chart is not draggable nor resizeable (with the value 'static' set to True in 'layout')."),
        html.Li("The slider is draggable and resizeable.")
    ]),
    dash_draggable.GridLayout(
        id='draggable',
        clearSavedLayout=True,
        layout=[
            {
                "i": "graph-with-slider",
                "x":0, "w":8, "y":0, "h":12, "static": True
            },
            {
                "i": "year-slider",
                "x": 0, "w":8, "y":13, "h":2
            },
        ],
        children=[
            dcc.Graph(
                id='graph-with-slider',
                responsive=True,
                style={
                    "width":"100%",
                    "height":"100%",

                }),
            dcc.Slider(
                id='year-slider',
                min=df['year'].min(),
                max=df['year'].max(),
                value=df['year'].min(),
                marks={str(year): str(year) for year in df['year'].unique()},
                step=None)
        ]
    ),
])

@app.callback(
    Output('graph-with-slider', 'figure'),
    Input('year-slider', 'value'))
def update_figure(selected_year):
    filtered_df = df[df.year == selected_year]

    fig = px.scatter(filtered_df, x="gdpPercap", y="lifeExp",
                     size="pop", color="continent", hover_name="country",
                     log_x=True, size_max=55)

    fig.update_layout(transition_duration=500)

    return fig

if __name__ == '__main__':
    app.run_server(debug=True, port='5080')