fn init() {
        Ok(())
    }

    #[validate_agent]
    pub fn validate_agent(validation_data: EntryValidationData::<AgentId>) {
        Ok(())
    }

    #[entry_def]
    fn fulfillment_entry_def() -> ValidatingEntryType {
        entry_def()
    }

    #[entry_def]
    fn fulfillment_base_entry_def() -> ValidatingEntryType {
        remote_entry_def()
    }

    #[zome_fn("hc_public")]
    fn fulfillment_created(fulfillment: CreateRequest) -> ZomeApiResult<ResponseData> {
        receive_create_fulfillment(fulfillment)
    }

    #[zome_fn("hc_public")]
    fn fulfillment_updated(fulfillment: UpdateRequest) -> ZomeApiResult<ResponseData> {
        receive_update_fulfillment(fulfillment)
    }

    #[zome_fn("hc_public")]
    fn fulfillment_deleted(address: FulfillmentAddress) -> ZomeApiResult<bool> {
        receive_delete_fulfillment(address)
    }

    #[zome_fn("hc_public")]
    fn get_fulfillment(address: FulfillmentAddress) -> ZomeApiResult<ResponseData> {
        receive_get_fulfillment(address)
    }

    #[zome_fn("hc_public")]
    fn query_fulfillments(params: QueryParams) -> ZomeApiResult<Vec<ResponseData>> {
        receive_query_fulfillments(params)
    }

    // :TODO:
    // receive: |from, payload| {
    //     format!("Received: {} from {}", payload, from)
    //   }

}
use crate::contracts::Erc20Contract;
use client::state::Treasury;
use std::collections::BTreeMap;
use web3::types::H160;

pub async fn get_treasury<T>(
    web3: &web3::Web3<T>,
    name: String,
    wallet: H160,
    contracts: &BTreeMap<String, H160>,
) -> Treasury
where
    T: web3::Transport,
{
    let mut treasury = Treasury::new(name.clone(), wallet.clone());
    for (token, addr) in contracts {
        let contract = Erc20Contract::new(&web3, *addr);
        let val = contract.get_balance(wallet).await;
        if let Some(v) = &val {
            treasury.balances.insert(token.clone(), v.clone());
        }
    }
    let dt = chrono::Utc::now().naive_utc();
    treasury.updated_at = dt.timestamp();
    treasury
}

pub async fn read_treasuries<T>(
    web3: &web3::Web3<T>,
    tokens: &BTreeMap<String, H160>,
    wallets: &BTreeMap<String, H160>,
) -> BTreeMap<String, Treasury>
where
    T: web3::Transport,
{
    let mut res = BTreeMap::new();
    for (name, wallet) in wallets {
        res.insert(
            name.to_owned(),
            get_treasury(web3, name.clone(), wallet.clone(), tokens).await,
        );
    }
    res
}
use cosmwasm_std::Env;
use core::mem;

use crate::state::PrivateKeyRecord;
use crate::crypto::{HASH_SIZE, prng, hash};

pub fn generate_api_key(seed: &[u8], env: &Env) -> String {
    let height_slice = unsafe { mem::transmute::<u64, [u8; 8]>(env.block.height) };

    let mut entropy: Vec<u8> =   env.message.sender.0.as_bytes().to_vec();
    entropy.extend_from_


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Materia.Nodes.Helpers;
using System.Drawing;
using System.Runtime.InteropServices;

namespace Materia.Imaging
{
    public struct ByteColor
    {
        public byte r;
        public byte g;
        public byte b;
        public byte a;

        public ByteColor(byte red, byte green, byte blue, byte alpha)
        {
            r = red;
            g = green;
            b = blue;
            a = alpha;
        }
    }

    public class RawBitmap
    {
        public int Width { get; protected set; }
        public int Height { get; protected set; }

        public byte[] Image { get; set; }

        public int BPP { get; protected set; }

        public RawBitmap(int w, int h, byte[] data, int bpp = 32)
        {
            Width = w;
            Height = h;
            Image = data;
            BPP = bpp;
        }

        public RawBitmap(int w, int h, int bpp = 32)
        {
            Width = w;
            Height = h;
            BPP = bpp;
            Image = new byte[w * h * (BPP / 8)];
        }

        public static RawBitmap FromBitmap(Bitmap bmp)
        {
            int bpp = System.Drawing.Bitmap.GetPixelFormatSize(bmp.PixelFormat);
            var data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat);
            byte[] raw = new byte[data.Height * data.Stride];
            Marshal.Copy(data.Scan0, raw, 0, raw.Length);
            bmp.UnlockBits(data);
            return new RawBitmap(bmp.Width, bmp.Height, raw, bpp);
        }

        public void GetPixel(int x, int y, out byte r, out byte g, out byte b, out byte a)
        {
            r = g = b = 0;
            a = 0;
            int idx = (x + y * Width) * (BPP / 8);

            if (x >= 0 && x < Width && y >= 0 && y < Height)
            {
                if (BPP == 8)
                {
                    r = g = b = Image[idx];
                }
                else if (BPP >= 16)
                {
                    r = Image[idx];
                    g = Image[idx + 1];
                }
                else if (BPP >= 24)
                {
                    r = Image[idx + 2];
                    g = Image[idx + 1];
                    b = Image[idx];
                }

                if (BPP == 32)
                    a = Image[idx + 3];
                else
                    a = 1;
            }
        }

        public void CopyRedToGreen(RawBitmap src)
        {
            Parallel.For(0, Height, y =>
            {
                for (int x = 0; x < Width; ++x)
                {
                    int idxsrc = ((x % src.Width) + (y % src.Height) * src.Width) * 4;
                    int idx = (x + y * Width) * 4;

                    if (BPP >= 16 && src.BPP >= 24)
                    {
                        Image[idx + 1] = src.Image[idxsrc + 2];
                    }
                    else if(BPP >= 16 && src.BPP >= 8)
                    {
                        Image[idx + 1] = src.Image[idxsrc];
                    }
                    else if(BPP >= 8 && src.BPP >= 24)
                    {
                        Image[idx] = src.Image[idxsrc + 2];
                    }
                    else if(BPP >= 8 && src.BPP >= 8)
                    {
                        Image[idx] = src.Image[idxsrc];
                    }
                }
            });
        }

        publ


int('FontAtlasManager: 预构建字体图集完成 - 字体大小: $fontSize, 文本数量: ${texts.length}');
  }

  /// 清理所有实例
  static void disposeAll() {
    for (final atlas in _instances.values) {
      atlas.dispose();
    }
    _instances.clear();
    _initialized.clear();
    debugPrint('FontAtlasManager: 清理所有字体图集实例');
  }

  /// 清理特定配置的实例
  static void disposeInstance({
    required double fontSize,
    Color color = Colors.white,
  }) {
    final key = '${fontSize}_${color.value}';
    final atlas = _instances.remove(key);
    _initialized.remove(key);
    atlas?.dispose();
    debugPrint('FontAtlasManager: 清理字体图集实例 - 字体大小: $fontSize, 颜色: $color');
  }
}

// 动态字体图集
// 能够从传入的文本中提取新字符，并增量更新图集
class DynamicFontAtlas {
  ui.Image? atlasTexture;
  Map<String, Rect> characterRectMap = {}; // 只存储像素Rect

  final double fontSize;
  final Color color;
  final VoidCallback? onAtlasUpdated; // 添加回调

  final Set<String> _allChars = {};
  final Set<String> _pendingChars = {};
  bool _isUpdating = false;

  DynamicFontAtlas({
    required this.fontSize,
    this.color = Colors.white,
    this.onAtlasUpdated,
  });

  // 初始化，生成一个包含基本字符的初始图集
  Future<void> generate() async {
    // 如果已经生成过，直接返回
    if (atlasTexture != null) {
      debugPrint('DynamicFontAtlas: 字体图集已存在，跳过重新生成');
      return;
    }

    const initialChars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .!?';
    _allChars.addAll(initialChars.split(''));
    await _regenerateAtlas();
    debugPrint('DynamicFontAtlas: 初始图集生成完毕');
  }

  // 预扫描大量文本并批量生成字符集（用于视频初始化时预处理）
  Future<void> prebuildFromTexts(List<String> texts) async {
    if (_isUpdating) return;
    _isUpdating = true;

    debugPrint('DynamicFontAtlas: 开始预扫描 ${texts.length} 条弹幕文本');

    final Set<String> newChars = {};
    int totalChars = 0;

    // 批量提取所有唯一字符
    for (final text in texts) {
      for (final char in text.runes) {
        final charStr = String.fromCharCode(char);
        totalChars++;
        if (!_allChars.contains(charStr)) {
          newChars.add(charStr);
        }
      }
    }

    if (newChars.isNotEmpty) {
      debugPrint('DynamicFontAtlas: 发现 ${newChars.length} 个新字符（总计 $totalChars 个字符）');

      _allChars.addAll(newChars);
      await _regenerateAtlas();

      debugPrint('DynamicFontAtlas: 预构建完成，图集包含 ${_allChars.length} 个字符');
      onAtlasUpdated?.call();
    } else {
      debugPrint('DynamicFontAtlas: 所有字符已在图集中，无需重建');
    }

    _isUpdating = false;
  }

  // 从文本中提取新字符，并触发更新
  void addText(String text) {
    bool hasNewChars = false;
    for (final char in text.runes) {
      final charStr = String.fromCharCode(char);
      if (!_


_reflection.GeneratedProtocolMessageType('SheetData', (_message.Message,), {
  'DESCRIPTOR' : _SHEETDATA,
  '__module__' : 'u4ms._impl.config_pb2'
  # @@protoc_insertion_point(class_scope:lq.config.SheetData)
  })
_sym_db.RegisterMessage(SheetData)

ConfigTables = _reflection.GeneratedProtocolMessageType('ConfigTables', (_message.Message,), {
  'DESCRIPTOR' : _CONFIGTABLES,
  '__module__' : 'u4ms._impl.config_pb2'
  # @@protoc_insertion_point(class_scope:lq.config.ConfigTables)
  })
_sym_db.RegisterMessage(ConfigTables)

# @@protoc_insertion_point(module_scope)


     <template #embeddedContainer></template>
    </ng-container>
    <nested-on-push></nested-on-push>
    <nested-on-push-link></nested-on-push-link>
    <nested-on-push-link *ngIf="isVisible"></nested-on-push-link>
  ''',
  directives: [
    NestedOnPush,
    NestedOnPushLink,
    NgIf,
  ],
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class OnPushLink {
  @ViewChild('container', read: ViewContainerRef)
  set container(ViewContainerRef? _) => deopt(_);

  @ViewChild('embeddedContainer', read: ViewContainerRef)
  set embeddedContainer(ViewContainerRef? _) => deopt(_);

  bool isVisible = deopt();
}

// Should not be linked.
@Component(
  selector: 'nested-on-push',
  template: '',
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class NestedOnPush {}

@changeDetectionLink
@Component(
  selector: 'nested-on-push-link',
  template: '''
    <template #container></template>
  ''',
  changeDetection: ChangeDetectionStrategy.OnPush,
)
class NestedOnPushLink {
  @ViewChild('container', read: ViewContainerRef)
  set container(ViewContainerRef? _) => deopt(_);
}
// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:angular_components/model/selection/select.dart';
import 'package:angular_components/model/selection/selection_container.dart';
import 'package:angular_components/model/ui/has_factory.dart';

/// An limited interface for child groups to use to access the tree.
abstract class MaterialTreeRoot<T>
    implements
        SelectionContainer<T>,
        HasComponentRenderer<RendersValue, Object>,
        HasFactoryRenderer<RendersValue, T> {
  /// Whether a filter is currently applied.
  bool isFiltered = false;

  /// Whether to hide check-marks in a single select dropdown
  bool get optimizeForDropdown => false;

  /// Whether the widget supports searching the data set.
  ///
  /// When `false`, no search box is shown.
  bool get supportsFiltering => options is Filterable;

  /// Whether the widgets supports expansion and child data sets.
  ///
  /// When `false`, the widget falls back to a simple flat list. This is not a
  /// recommended use case and is provided for graceful failure. If you intend
  /// to use a flat data set consider [MaterialSelect].
  bool get supportsHierarchy => options is Parent;

  /// Whether the widgets supports the selection of non-leaf nodes
  ///
  /// When `false`, and the widget is using a single selection model clicking
  /// the widget should toggle expansion when a non-leaf node is clicked. When
  /// `true` the widget should select non-leaf nodes when clicked and only
  /// toggle expansion when the expansion icon is clicked.
  bool get allowParentSingleSelection => false;

  /// Whether the widgets supports the selection of non-leaf nodes.
  ///
  /// When `false`, and the widget should toggle expansion when a non-leaf
  /// node is clicked. When `true` the widget should select non-leaf nodes
  /// when clicked and only toggle expansion when the expansion icon is clicked.
  bool get allowParentMultiSelection => true;

  /// The previously toggled node.
  T previouslyToggledNode;
}
// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular_components/laminate/enums


search">
          Show / Hide Table of Contents

Delegate ContextFactory.Method

A delegate that describes the possible inputs for a context.

Namespace: SpiceSharp.Entities.DependencyInjection

Assembly: SpiceSharp.dll

Syntax

public delegate IBindingContext Method(ISimulation simulation, IEntity entity, IBehaviorContainer container);

Parameters

        Type
        Name
        Description

        ISimulation
        simulation

The simulation.

        IEntity
        entity

The entity.

        IBehaviorContainer
        container

The container with the behaviors.

Returns

        Type
        Description

        IBindingContext

The context.

Constructors

  <h4 id="SpiceSharp_Entities_DependencyInjection_ContextFactory_Method__ctor_System_Object_System_IntPtr_" data-uid="SpiceSharp.Entities.DependencyIn


::rotate(model, glm::radians(-90.0f), vec3(1.0f,0.0f,0.0f));
    setMatrices();
    teapot.render();

    prog.setUniform("Kd", 0.9f, 0.5f, 0.3f);
    prog.setUniform("Ks", 0.95f, 0.95f, 0.95f);
    prog.setUniform("Ka", 0.9f * 0.3f, 0.5f * 0.3f, 0.3f * 0.3f);
    prog.setUniform("Shininess", 100.0f);

    model = mat4(1.0f);
    model = glm::translate(model, vec3(-1.0f,0.75f,3.0f));
    model = glm::rotate(model, glm::radians(-90.0f), vec3(1.0f,0.0f,0.0f));
    setMatrices();
    torus.render();

    prog.setUniform("Kd", 0.7f, 0.7f, 0.7f);
    prog.setUniform("Ks", 0.9f, 0.9f, 0.9f);
    prog.setUniform("Ka", 0.2f, 0.2f, 0.2f);
    prog.setUniform("Shininess", 180.0f);

    model = mat4(1.0f);
    setMatrices();
    plane.render();
}

void SceneSpot::setMatrices()
{
    mat4 mv = view * model;
    prog.setUniform("ModelViewMatrix", mv);
    prog.setUniform("NormalMatrix",
                    mat3( vec3(mv[0]), vec3(mv[1]), vec3(mv[2]) ));
    prog.setUniform("MVP", projection * mv);
}

void SceneSpot::resize(int w, int h)
{
    glViewport(0,0,w,h);
    width = w;
    height = h;
    projection = glm::perspective(glm::radians(60.0f), (float)w/h, 0.3f, 100.0f);
}

void SceneSpot::compileAndLinkShader()
{
	try {
		prog.compileShader("shader/spot.vs");
		prog.compileShader("shader/spot.fs");
    	prog.link();
    	prog.use();
    } catch(GLSLProgramException & e) {
 		cerr << e.what() << endl;
 		exit( EXIT_FAILURE );
    }
}
#include "plane.h"
#include "glutils.h"
#include "cookbookogl.h"
#include "glutils.h"

#include <cstdio>
#include <cmath>

Plane::Plane(float xsize, float zsize, int xdivs, int zdivs, float smax, float tmax)
{
    std::vector<GLfloat> p(3 * (xdivs + 1) * (zdivs + 1));
	std::vector<GLfloat> n(3 * (xdivs + 1) * (zdivs + 1));
    std::vector<GLfloat> tex(2 * (xdivs + 1) * (zdivs + 1));
    std::vector<GLuint> el(6 * xdivs * zdivs);

    float x2 = xsize / 2.0f;
    float z2 = zsize / 2.0f;
    float iFactor = (float)zsize / zdivs;
    float jFactor = (float)xsize / xdivs;
    float texi = smax / zdivs;
    float texj = tmax / xdivs;
    float x, z;
    int vidx = 0, tidx = 0;
    for( int i = 0; i <= zdivs; i++ ) {
        z = iFactor * i - z2;
        for( int j = 0; j <= xdivs; j++ ) {
            x = jFactor * j - x2;
            p[vidx] = x;
            p[vidx+1] = 0.0f;
            p[vidx+2] = z;
			n[vidx] = 0


-   Replace `${SHARED_KEY}` by the fluentd shared key configured for the `forward` protocol`

{{site.data.alerts.end}}

`/etc/fluent-bit/custom_parsers.conf`
```
[PARSER]
    Name syslog-rfc3164-nopri
    Format regex
    Regex /^(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$/
    Time_Key time
    Time_Format %b %d %H:%M:%S
    Time_Keep False
```

With this configuration, Fluentbit will monitoring log entries in `/var/log/auth.log` and `/var/log/syslog` files, parsing them using a custom parser `syslog-rfc3165-nopri` (syslog default parser removing priority field), and forward them to fluentd aggregator service running in K3S cluster. Fluentd destination is configured using DNS name associated to fluentd aggregator service external IP.

---
title: Kafka
permalink: /docs/kafka/
description: How to deploy Kafka in a Kubernetes cluster. Using Strimzi Kafka Operator to streamline the deployment. How to configure external access and secure it using SASL/SCRAM authentication and ACL authorization. How to integrate Schema Registry and Kafka UI (Kafdrop)
last_modified_at: "15-09-2025"

---

## Kafka Cluster installation

For the installation [Strimzi](https://strimzi.io/) kafka operator will be used to deploy a Kafka cluster.

### Strimzi Operator installation procedure using Helm

Installation using `Helm` (Release 3):

- Step 1: Add the Strimzi Helm repository:

  ```shell
  helm repo add strimzi https://strimzi.io/charts/
  ```
- Step2: Fetch the latest charts from the repository:

  ```shell
  helm repo update
  ```
- Step 3: Create namespace

  ```shell
  kubectl create namespace kafka
  ```
- Step 3: Install Strimzi kafka operator

  ```shell
  helm install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace kafka
  ```
- Step 4: Confirm that the deployment succeeded, run:

  ```shell
  kubectl -n kafka get pod
  ```

### Usage

#### Deploy Kafka cluster

Using Strimzi operator, Kafka cluster in KRaft mode can be deployed.

-   Step 1: Create a Kafka cluster of 3 nodes with dual roles (Kraft controller/ Kafka broker),configure its storage (5gb) and create a Kafka cluster from that pool broker using a specific Kafka release.

    ```yaml
    ---
    apiVersion: kafka.strimzi.io/v1beta2
    kind: KafkaNodePool
    metadata:
      name: dual-role
      labels:
        strimzi.io/cluster: cluster
    spec:
      replicas: 3
      roles:
        - controller
        - broker
      storage:
        type: jbod
        volumes:
          - id: 0
            type: persistent-claim
            size: 5Gi
            class: longhorn
            deleteClaim: false
            kraftMetadata: shared
    ---
    apiVersion: kafka.strimzi.io/v1beta2
    kind: Kafka
    metadata:
      name: cluster
      annotations:
        strimzi.io/node-pools: enabled
        strimzi.io/kraft: enabled
    spec:
      kafka:
        version: 4.0.0
        metadataVersion: 4.0-IV3
        listeners:
          - name: plain
            port: 9092
            type: internal
            tls: false
          - name: tls
            port: 9093
            type: internal
            tls: true
        config:
          offsets.topic.replication.factor: 3
          transaction.state.log.replication.factor: 3
          transaction.state.log.min.isr: 2
          default.replication.factor: 3
          min.insync.replicas: 2
      entityOperator:
        top


q).
//!
//! Currently, we only support one scheme (FV) and one set of parameters, corresponding to a polynomial degree of 2048 and a 54-bit prime modulus.
//! ```
//! let scheme = cupcake::default();
//! ```
//! # Setup
//! In order to encrypt and decrypt data, we needs to generate a keypair, i.e. a secret key and a public key.
//! ```
//! let scheme = cupcake::default();
//! use cupcake::traits::{KeyGeneration};
//! let (pk, sk) = scheme.generate_keypair();
//! ```
//! The public key can be used for encryption and the secret key can be used for encryption or decryption.
//!
//! # Encryption and Decryption
//!
//! The default plaintext space of Cupcake is `Vec<u8>` of fixed size n. We can encrypt a vector under a public key like so
//! ```
//! # let scheme = cupcake::default();
//! # use cupcake::traits::KeyGeneration;
//! # let (pk, sk) = scheme.generate_keypair();
//! use cupcake::traits::{SKEncryption, PKEncryption};
//! let v = vec![1; scheme.n];
//! let ct = scheme.encrypt(&v, &pk);
//! ```
//! Then, the ciphertext `ct` can be decrypted using the secret key:
//! ```
//! # let scheme = cupcake::default();
//! # use cupcake::traits::{KeyGeneration, SKEncryption, PKEncryption};
//! # let (pk, sk) = scheme.generate_keypair();
//! # let v = vec![1; scheme.n];
//! # let ct = scheme.encrypt(&v, &pk);
//! let w: Vec<u8>= scheme.decrypt(&ct, &sk);
//! assert_eq!(v, w);
//! ```
//! You may also use other plaintext types, which are vectors of `Scalar` of size n. Here `Scalar`  represents an integer modulo a fixed modulus t.
//! See the following example:
//! ```
//! # use cupcake::traits::{KeyGeneration, PKEncryption, SKEncryption};
//! use cupcake::integer_arith::scalar::Scalar;
//! let t = 199;
//! let scheme = cupcake::default_with_plaintext_mod(t);
//! let (pk, sk) = scheme.generate_keypair();
//! let plain_modulus = scheme.t.clone();
//! let pt = vec![Scalar::from(t-1 as u32); scheme.n];
//! let ct = scheme.encrypt(&pt, &pk);
//! let pt_actual: Vec<Scalar> = scheme.decrypt(&ct, &sk);
//! assert_eq!(pt_actual, pt);
//! ```
//! # Homomorphic Operations
//!
//! We can encrypt two vectors and add up the resulting ciphertexts.
//! ```
//! # let scheme = cupcake::default();
//! # use cupcake::traits::{KeyGeneration, SKEncryption, PKEncryption};
//! # let (pk, sk) = scheme.generate_keypair();
//! use cupcake::traits::{AdditiveHomomorphicScheme};
//! let z1 = vec![1; scheme.n];
//! let mut ctz1 = scheme.encrypt(&z1, &pk);
//! let z2 = vec![2; scheme.n];
//! let ctz2 = scheme.encrypt(&z2, &pk);
//! scheme.add_inplace(&mut ctz1, &ctz2);
//! // Now ctz1 should decrypt to vec![3; scheme.n];
//! let expected = vec![3; scheme.n];
//! let actual: Vec<u8> = scheme.decrypt(&ctz1, &sk);
//! assert_eq!(actual, expected);
//! ```
//! Alternatively, we can add a plaintext vector into a ciphertext
//! ```
//! # let scheme = cupcake::default();
//! # use cup


// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN:        | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN

ldff1d  { z31.d }, p7/z, [sp]
// CHECK-INST: ldff1d  { z31.d }, p7/z, [sp]
// CHECK-ENCODING: [0xff,0x7f,0xff,0xa5]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: ff 7f ff a5 <unknown>

ldff1d  { z31.d }, p7/z, [sp, xzr, lsl #3]
// CHECK-INST: ldff1d  { z31.d }, p7/z, [sp]
// CHECK-ENCODING: [0xff,0x7f,0xff,0xa5]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: ff 7f ff a5 <unknown>

ldff1d  { z0.d }, p0/z, [x0, x0, lsl #3]
// CHECK-INST: ldff1d  { z0.d }, p0/z, [x0, x0, lsl #3]
// CHECK-ENCODING: [0x00,0x60,0xe0,0xa5]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 60 e0 a5 <unknown>

ldff1d  { z31.d }, p7/z, [sp, z31.d]
// CHECK-INST: ldff1d  { z31.d }, p7/z, [sp, z31.d]
// CHECK-ENCODING: [0xff,0xff,0xdf,0xc5]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: ff ff df c5 <unknown>

ldff1d  { z23.d }, p3/z, [x13, z8.d, lsl #3]
// CHECK-INST: ldff1d  { z23.d


  ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
```javascript
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
  .then( myFunc, myFailure );
```
     */
    when<TR1, UR1,
        TJ1 = any, UJ1 = any>(
            deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
            deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
    ): JQuery.Promise2<
        TR1, TJ1, never,
        UR1, UJ1, never>;
    /**
     * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
     * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
     * @since 1.5
     * @example  ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
```javascript
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
  // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
  var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
  if ( /Whip It/.test( data ) ) {
    alert( "We got what we came for!" );
  }
});
```
     * @example  ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
```javascript
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
  .then( myFunc, myFailure );
```
     */
    when<TR1, TJ1,
        TR2, TJ2,
        TR3 = never, TJ3 = never>(
            deferredT: JQuery.Promise3<TR1, TJ1, any, TR2, TJ2, any, TR3, TJ3, any> |
                       JQuery.Promise2<TR1, TJ1, any, TR2, TJ2, any>
    ): JQuery.Promise3<
        TR1, TJ1, never,
        TR2, TJ2, never,
        TR3, TJ3, never>;
    /**
     * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
     * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
     * @since 1.5
     * @example  ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
```javascript
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
  // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
  var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
  if ( /Whip It/.test( data ) ) {
    alert( "We got what we came for!" );
  }
});
```
     * @example  ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
```javascript
$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
  .then( myFunc, myFailure );
```
     */
    when<TR1, TJ1 = any>(deferred: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1>


_sscratch()
                .as_ref()
                .expect("Not running on a process!")
                .pid
        }
    }

    pub fn this() -> Arc<RwLock<Process>> {
        try_get_process(&Self::this_pid())
    }
}
pub fn init() {}

// All functions after this are only safe when init() has been called
// (but init doesn't do anything yet, so nothing bad happens)

// Marks the process executed as the current hart as pending
pub fn finish_executing_process(pid: usize) {
    if pid == 0 || pid == 1 {
        // Boot process can't be stopped
        return;
    }
    try_get_process(&pid).write().state = ProcessState::Pending;
    debug!("Made process pending");
}

/// Finds an unused PID
pub fn allocate_pid() -> usize {
    allocate_pid_lockfree(&mut PROCESSES.write())
}

pub fn allocate_pid_lockfree(processes: &mut BTreeMap<usize, PidSlot>) -> usize {
    let mut pid = 2;
    for this_pid in pid.. {
        if !processes.contains_key(&this_pid) {
            processes.insert(this_pid, PidSlot::Allocated);
            pid = this_pid;
            break;
        }
    }
    pid
}

/// Creates a supervisor process and returns PID
/// SAFETY: Only when function is a valid function pointer
pub fn new_process(constructor: impl FnOnce(&mut Process)) -> usize {
    // Hold this guard for as much time as possible
    // to prevent a race condition on allocate_pid
    let mut guard = PROCESSES.write();
    let pid = allocate_pid_lockfree(&mut *guard);

    let trapframe_box = Box::new(TrapFrame::zeroed());
    let trapframe_box = Pin::new(trapframe_box);

    let mut process = Process {
        is_supervisor: false,
        handles: BTreeMap::new(),
        trap_frame: trapframe_box,
        state: ProcessState::Pending,
        kernel_allocated_stack: None,
        name: None,
        no_op_yield_count: AtomicUsize::new(0),
        user_id: 0,
    };

    constructor(&mut process);

    process.trap_frame.pid = pid;
    process.trap_frame.use_current_satp_as_kernel_satp();
    if process.is_supervisor {
        process.trap_frame.satp = process.trap_frame.kernel_satp;
    }
    process.trap_frame.hartid = 0xBADC0DE;

    // Wrap the process in a lock
    let process = RwLock::new(process);
    // Move the process into an Arc
    let process = Arc::new(process);

    // Schedule the process
    PROCESS_SCHED_QUEUE.write().push(Arc::downgrade(&process));

    guard.insert(pid, PidSlot::Used(process));

    pid
}

pub fn new_supervisor_process_int(function: usize, a0: usize) -> usize {
    new_process(|process| {
        process.is_supervisor = true;
        process.trap_frame.general_registers[Registers::Ra.idx()] =
            process_return_address_supervisor as usize;

        let process_stack = kernel_util::boxed_slice_with_alignment(4096, 4096, &0u8);
        process.trap_frame.interrupt_stack =
            process_stack.as_ptr() as usize + TASK_STACK_SIZE - 0x10;

        Box::leak(process_stack);

        let process_stack = kernel_util::boxed_slice_with_alignment(TASK_STACK_SIZE, 4096, &0u8);
        process.trap_frame.general_registers[Registers::Sp.idx()] =
            process_stack.as_ptr() as usize + TASK_STACK_SIZE - 0x10;

        process.trap_frame.general_registers[Registers::A0.idx()] = a0;


/*
 * Copyright 2019 GridGain Systems, Inc. and Contributors.
 *
 * Licensed under the GridGain Community Edition License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
 *
 * 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.
 */

namespace Apache.Ignite.Linq.Impl.Dml
{
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;
    using System.Linq.Expressions;
    using System.Reflection;
    using Apache.Ignite.Core.Cache;
    using Remotion.Linq.Clauses;
    using Remotion.Linq.Parsing.Structure.IntermediateModel;

    /// <summary>
    /// Represents a <see cref="MethodCallExpression"/> for
    /// <see cref="CacheLinqExtensions.RemoveAll{TKey,TValue}(IQueryable{ICacheEntry{TKey,TValue}})"/>.
    /// When user calls RemoveAll, this node is generated.
    /// </summary>
    [SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes",
        Justification = "Instantiated by framework")]
    internal sealed class RemoveAllExpressionNode : ResultOperatorExpressionNodeBase
    {
        /** */
        private static readonly MethodInfo[] RemoveAllMethodInfos = typeof(CacheLinqExtensions)
            .GetMethods().Where(x => x.Name == "RemoveAll").ToArray();

        /// <summary>
        /// The RemoveAll() method.
        /// </summary>
        public stati


c(var(--bld-us) + 4px);line-height:calc(var(--bld-us) + 4px);overflow:hidden;padding-left:calc(var(--cnt-h-p) + 8px);padding-right:calc(2px * 2 + var(--bld-us) + var(--cnt-h-p));position:relative;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:border-radius .2s ease-in-out .2s}.tp-fldv_b:hover,.tp-rotv_b:hover{background-color:var(--cnt-bg-h)}.tp-fldv_b:focus,.tp-rotv_b:focus{background-color:var(--cnt-bg-f)}.tp-fldv_b:active,.tp-rotv_b:active{background-color:var(--cnt-bg-a)}.tp-fldv_b:disabled,.tp-rotv_b:disabled{opacity:0.5}.tp-fldv_m,.tp-rotv_m{background:linear-gradient(to left, var(--cnt-fg), var(--cnt-fg) 2px, transparent 2px, transparent 4px, var(--cnt-fg) 4px);border-radius:2px;bottom:0;content:'';display:block;height:6px;right:calc(var(--cnt-h-p) + (var(--bld-us) + 4px - 6px) / 2 - 2px);margin:auto;opacity:0.5;position:absolute;top:0;transform:rotate(90deg);transition:transform .2s ease-in-out;width:6px}.tp-fldv.tp-fldv-expanded>.tp-fldv_b>.tp-fldv_m,.tp-rotv.tp-rotv-expanded .tp-rotv_m{transform:none}.tp-fldv_c,.tp-rotv_c{box-sizing:border-box;height:0;opacity:0;overflow:hidden;padding-bottom:0;padding-top:0;position:relative;transition:height .2s ease-in-out,opacity .2s linear,padding .2s ease-in-out}.tp-fldv.tp-fldv-cpl:not(.tp-fldv-expanded)>.tp-fldv_c,.tp-rotv.tp-rotv-cpl:not(.tp-rotv-expanded) .tp-rotv_c{display:none}.tp-fldv.tp-fldv-expanded>.tp-fldv_c,.tp-rotv.tp-rotv-expanded .tp-rotv_c{opacity:1;padding-bottom:var(--cnt-v-p);padding-top:var(--cnt-v-p);transform:none;overflow:visible;transition:height .2s ease-in-out,opacity .2s linear .2s,padding .2s ease-in-out}.tp-coltxtv_m,.tp-lstv{position:relative}.tp-lstv_s{padding:0 20px 0 4px;width:100%}.tp-coltxtv_mm,.tp-lstv_m{bottom:0;margin:auto;pointer-events:none;position:absolute;right:2px;top:0}.tp-coltxtv_mm svg,.tp-lstv_m svg{bottom:0;height:16px;margin:auto;position:absolute;right:0;top:0;width:16px}.tp-coltxtv_mm svg path,.tp-lstv_m svg path{fill


 };

  Node.prototype.getText = function getText(allLevels, separator) {
    return allLevels ? this.pathLabels.join(separator) : this.label;
  };

  Node.prototype.isSameNode = function isSameNode(checkedValue) {
    var value = this.getValueByOption();
    return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
      return Object(util_["isEqual"])(val, value);
    }) : Object(util_["isEqual"])(checkedValue, value);
  };

  Node.prototype.broadcast = function broadcast(event) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var handlerName = 'onParent' + Object(util_["capitalize"])(event);

    this.children.forEach(function (child) {
      if (child) {
        // bottom up
        child.broadcast.apply(child, [event].concat(args));
        child[handlerName] && child[handlerName].apply(child, args);
      }
    });
  };

  Node.prototype.emit = function emit(event) {
    var parent = this.parent;

    var handlerName = 'onChild' + Object(util_["capitalize"])(event);
    if (parent) {
      for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }

      parent[handlerName] && parent[handlerName].apply(parent, args);
      parent.emit.apply(parent, [event].concat(args));
    }
  };

  Node.prototype.onParentCheck = function onParentCheck(checked) {
    if (!this.isDisabled) {
      this.setCheckState(checked);
    }
  };

  Node.prototype.onChildCheck = function onChildCheck() {
    var children = this.children;

    var validChildren = children.filter(function (child) {
      return !child.isDisabled;
    });
    var checked = validChildren.length ? validChildren.every(function (child) {
      return child.checked;
    }) : false;

    this.setCheckState(checked);
  };

  Node.prototype.setCheckState = function setCheckState(checked) {
    var totalNum = this.children.length;
    var checkedNum = this.children.reduce(function (c, p) {
      var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
      return c + num;
    }, 0);

    this.checked = checked;
    this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
  };

  Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
    var value = this.getValueByOption();
    var checked = this.isSameNode(checkedValue, value);

    this.doCheck(checked);
  };

  Node.prototype.doCheck = function doCheck(checked) {
    if (this.checked !== checked) {
      if (this.config.checkStrictly) {
        this.checked = checked;
      } else {
        // bottom up to unify the calculation of the indeterminate state
        this.broadcast('check', checked);
        this.setCheckState(checked);
        this.emit('check');
      }
    }
  };

  node_createClass(Node, [{
    key: 'isDisabled',
    get: function get() {
      var data = this.data,
          parent = this.parent,
          config = this.config;

      var disabledKey = config.disabled;
      var checkStrictly = config.checkStrictly;

      return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
    }
  }, {
    key: 'isLeaf',
    get


// 可能返回的错误码:
//  FAILEDOPERATION = "FailedOperation"
//  FAILEDOPERATION_DEBUGMODESTATUS = "FailedOperation.DebugModeStatus"
//  FAILEDOPERATION_FUNCTIONVERSIONSTATUSNOTACTIVE = "FailedOperation.FunctionVersionStatusNotActive"
//  FAILEDOPERATION_INSUFFICIENTBALANCE = "FailedOperation.InsufficientBalance"
//  FAILEDOPERATION_PROVISIONEDEXCEEDRESERVED = "FailedOperation.ProvisionedExceedReserved"
//  FAILEDOPERATION_RESERVEDINPROGRESS = "FailedOperation.ReservedInProgress"
//  FAILEDOPERATION_SERVICECLOSED = "FailedOperation.ServiceClosed"
//  INTERNALERROR = "InternalError"
//  INVALIDPARAMETERVALUE = "InvalidParameterValue"
//  INVALIDPARAMETERVALUE_FUNCTIONNAME = "InvalidParameterValue.FunctionName"
//  INVALIDPARAMETERVALUE_NAMESPACE = "InvalidParameterValue.Namespace"
//  LIMITEXCEEDED_FUNCTIONRESERVEDCONCURRENCYMEMORY = "LimitExceeded.FunctionReservedConcurrencyMemory"
//  MISSINGPARAMETER = "MissingParameter"
//  RESOURCENOTFOUND_FUNCTION = "ResourceNotFound.Function"
//  RESOURCENOTFOUND_FUNCTIONNAME = "ResourceNotFound.FunctionName"
//  RESOURCENOTFOUND_NAMESPACE = "ResourceNotFound.Namespace"
//  UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
func (c *Client) PutReservedConcurrencyConfigWithContext(ctx context.Context, request *PutReservedConcurrencyConfigRequest) (response *PutReservedConcurrencyConfigResponse, err error) {
    if request == nil {
        request = NewPutReservedConcurrencyConfigRequest()
    }
    c.InitBaseRequest(&request.BaseRequest, "scf", APIVersion, "PutReservedConcurrencyConfig")

    if c.GetCredential() == nil {
        return nil, errors.New("PutReservedConcurrencyConfig require credential")
    }

    request.SetContext(ctx)

    response = NewPutReservedConcurrencyConfigResponse()
    err = c.Send(request, response)
    return
}

func NewPutTotalConcurrencyConfigRequest() (request *PutTotalConcurrencyConfigRequest) {
    request = &PutTotalConcurrencyConfigRequest{
        BaseRequest: &tchttp.BaseRequest{},
    }

    request.Init().WithApiInfo("scf", APIVersion, "PutTotalConcurrencyConfig")

    return
}

func NewPutTotalConcurrencyConfigResponse() (response *PutTotalConcurrencyConfigResponse) {
    response = &PutTotalConcurrencyConfigResponse{
        BaseResponse: &tchttp.BaseResponse{},
    }
    return

}

// PutTotalConcurrencyConfig
// 修改账号并发限制配额
//
// 可能返回的错误码:
//  FAILEDOPERATION_INSUFFICIENTBALANCE = "FailedOperation.InsufficientBalance"
//  FAILEDOPERATION_RESERVEDEXCEEDTOTAL = "FailedOperation.ReservedExceedTotal"
//  FAILEDOPERATION_TOTALCONCURRENCYMEMORYINPROGRESS = "FailedOperation.TotalConcurrencyMemoryInProgress"
//  INTERNALERROR = "InternalError"
//  INVALIDPARAMETERVALUE = "InvalidParameterValue"
//  LIMITEXCEEDED_TOTALCONCURRENCYMEMORY = "LimitExceeded.TotalConcurrencyMemory"
//  LIMITEXCEEDED_USERTOTALCONCURRENCYMEMORY = "LimitExceeded.UserTotalConcurrencyMemory"
//  MISSINGPARAMETER = "MissingParameter"
//  RESOURCENOTFOUND_NAMESPACE = "ResourceNotFound.Namespace"
//  RESOURCENOTFOUND_TOTALCONCURRENCYMEMORY = "ResourceNotFound.TotalConcurrencyMemory"
//  UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
//  UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) PutTotalConcurrencyConfig(request *PutTotalConcurrencyConfig


tienda.png',
        ),
      ),
      Marker(
        markerId: MarkerId('tiendaRopa2'),
        position: LatLng(-8.1185, -79.0229), // Coordenas de la Tienda 2
        infoWindow: InfoWindow(title: 'Tiendas Él'),
        icon: await BitmapDescriptor.fromAssetImage(
          ImageConfiguration(size: Size(48, 48)),
          'iconos/tienda.png',
        ),
      ),
      // Puedes añadir más tiendas según sea necesario
    ];

    return tiendasMarkers;
  }

  Future<List<Marker>> _getHotelesMarkers() async {
    List<Marker> hotelesMarkers = [
      Marker(
        markerId: MarkerId('hotel1'),
        position: LatLng(-8.1027, -79.0293), // Coordenas del Hotel 1
        infoWindow: InfoWindow(title: 'Hotel San Isidro'),
        icon: await BitmapDescriptor.fromAssetImage(
          ImageConfiguration(size: Size(48, 48)),
          'iconos/hotel.png',
        ),
      ),
      Marker(
        markerId: MarkerId('hotel2'),
        position: LatLng(-8.1187, -79.0427), // Coordenas del Hotel 2
        infoWindow: InfoWindow(title: 'Hostal Olimpo'),
        icon: await BitmapDescriptor.fromAssetImage(
          ImageConfiguration(size: Size(48, 48)),
          'iconos/hotel.png',
        ),
      ),
      // Puedes añadir más hoteles según sea necesario
    ];

    return hotelesMarkers;
  }

  Future<List<Marker>> _getHospitalesMarkers() async {
    List<Marker> hospitalesMarkers = [
      Marker(
        markerId: MarkerId('hospital1'),
        position: LatLng(-8.1159, -79.0308), // Coordenas del Hospital 1
        infoWindow: InfoWindow(title: 'Hospital Belén de Trujillo'),
        icon: await BitmapDescriptor.fromAssetImage(
          ImageConfiguration(size: Size(48, 48)),
          'iconos/hospital.png',
        ),
      ),
      Marker(
        markerId: MarkerId('hospital2'),
        position: LatLng(-8.0996, -79.0121), // Coordenas del Hospital 3
        infoWindow: InfoWindow(title: 'Hospital Victor Lazarte Echegaray'),
        icon: await BitmapDescriptor.fromAssetImage(
          ImageConfiguration(size: Size(48, 48)),
          'iconos/hospital.png',
        ),
      ),
      // Puedes añadir más hospitales según sea necesario
    ];

    return hospitalesMarkers;
  }

  void _toggleTiendasVisibility() {
    setState(() {
      _showTiendas = !_showTiendas;
    });
  }

  void _toggleHotelesVisibility() {
    setState(() {
      _showHoteles = !_showHoteles;
    });
  }

  void _toggleHospitalesVisibility() {
    setState(() {
      _showHospitales = !_showHospitales;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Mi Ubicación'),
      ),
      body: Stack(
        children: [
          GoogleMap(
            onMapCreated: (controller) {
              setState(() {
                _controller = controller;
              });
            },
            initialCameraPosition: CameraPosition(
              target: _currentLocation,
              zoom: 15,
            ),
            markers: {
              Marker(
                markerId: MarkerId('MiUbicacion'),
                position: _currentLocation,
                infoWindow: InfoWindow(title: 'Mi Ubicación'),
              ),
              if (_showTiendas) ..._tiendasMarkers,
              if (_showHoteles) ..._hotelesMarkers,
              if (_showHospitales) ..._hospitalesMarkers,


911

  913   using UnderlyingIterator = RegularTileIterator<

  914     layout::PitchLinearShape<Shape::kColumn, Shape::kRow>,

  915     Element,

  916     layout::VoltaTensorOpMultiplicandBCongruous<sizeof_bits<Element_>::value>,

  917     (kAdvanceRank == 0 ? 1 : 0),

  918     ThreadMap_>;

  919

  920 public:

  921

  923   using Fragment = Array<Element, UnderlyingIterator::Fragment::kElements>;

  924

  925 <sp


TIVE: &str = "ACTIVE";

/// Creates a Kinesis stream with the given name and shard count.
/// Will fail if the stream is not created and in ACTIVE mode after
/// some amount of retrying.
pub async fn create_stream(
    kinesis_client: &KinesisClient,
    stream_name: &str,
    shard_count: i64,
) -> Result<String, anyhow::Error> {
    kinesis_client
        .create_stream(CreateStreamInput {
            shard_count,
            stream_name: stream_name.to_string(),
        })
        .await
        .context("creating Kinesis stream")?;

    let stream_arn = retry::retry_for(Duration::from_secs(120), |_| async {
        let description = &kinesis_client
            .describe_stream(DescribeStreamInput {
                exclusive_start_shard_id: None,
                limit: None,
                stream_name: stream_name.to_string(),
            })
            .await
            .context("describing Kinesis stream")?
            .stream_description;
        match description.stream_status.as_ref() {
            ACTIVE => Ok(description.stream_arn.clone()),
            other_status => Err(anyhow::Error::msg(format!(
                "Stream {} is not yet ACTIVE, is {}",
                stream_name.to_string(),
                other_status
            ))),
        }
    })
    .await
    .context("Kinesis stream never became ACTIVE")?;

    Ok(stream_arn)
}

/// Generate total_records number of records (random strings converted to bytes).
/// Then, put records_per_second records to Kinesis in batches of 500 (the PutRecords API limit).
///
/// This function will log if it's falling behind the expected put rate and once
/// at the end to indicate total amount of time spent generating and putting records.
pub async fn generate_and_put_records(
    kinesis_client: &KinesisClient,
    stream_name: &str,
    total_records: u64,
    records_per_second: u64,
) -> Result<(), anyhow::Error> {
    let timer = std::time::Instant::now();
    // For each string, round robin puts across all of the shards.
    let mut shard_starting_hash_keys: VecDeque<String> =
        aws_util::kinesis::list_shards(&kinesis_client, &stream_name)
            .await?
            .iter()
            .map(|shard| shard.hash_key_range.starting_hash_key.clone())
            .collect();

    let mut put_record_count = 0;
    while put_record_count < total_records {
        // Use a basic timer to put records_per_second records/second to Kinesis.
        let put_timer = std::time::Instant::now();

        let target_shard = shard_starting_hash_keys.pop_front().unwrap();
        put_record_count += put_records_one_second(
            kinesis_client,
            stream_name,
            &target_shard,
            records_per_second,
        )
        .await
        .context("putting records to Kinesis")?;
        shard_starting_hash_keys.push_back(target_shard);

        let elapsed = put_timer.elapsed();
        if elapsed < Duration::from_secs(1) {
            thread::sleep(Duration::from_secs(1) - elapsed);
        } else {
            log::info!(
                "Expected to put {} records in 1s, took {:#?}",
                records_per_second,
                elapsed
            );
        }
    }
    log::info!(
        "Generated and put {} records in {} milliseconds.",
        put_record_


up(t *testing.T) {
	tempDir := t.TempDir()
	fm := NewFileManager(tempDir)

	// Create several files
	fileNames := []string{"file1.txt", "file2.txt", "file3.txt"}
	for _, fileName := range fileNames {
		err := fm.CreateFile(fileName, []byte("test"))
		require.NoError(t, err)
	}

	// Verify files exist
	for _, fileName := range fileNames {
		assert.True(t, fm.FileExists(fileName))
	}

	// Cleanup specific files
	err := fm.CleanupFiles(fileNames[:2])
	require.NoError(t, err)

	// First two files should be gone
	assert.False(t, fm.FileExists(fileNames[0]))
	assert.False(t, fm.FileExists(fileNames[1]))
	assert.True(t, fm.FileExists(fileNames[2]))
}

func TestFileManagerAtomicWrite(t *testing.T) {
	tempDir := t.TempDir()
	fm := NewFileManager(tempDir)

	fileName := "atomic_test.txt"
	data := []byte("Atomic write test data")

	// Atomic write should create the file
	err := fm.AtomicWrite(fileName, data)
	require.NoError(t, err)

	// Verify content
	content, err := fm.ReadFile(fileName)
	require.NoError(t, err)
	assert.Equal(t, data, content)

	// Atomic write should replace existing content
	newData := []byte("New atomic data")
	err = fm.AtomicWrite(fileName, newData)
	require.NoError(t, err)

	content, err = fm.ReadFile(fileName)
	require.NoError(t, err)
	assert.Equal(t, newData, content)
}

func BenchmarkFileManagerCreateFile(b *testing.B) {
	tempDir := b.TempDir()
	fm := NewFileManager(tempDir)

	data := make([]byte, 1024) // 1KB files
	rand.Read(data)

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		fileName := fmt.Sprintf("bench_file_%d.dat", i)
		err := fm.CreateFile(fileName, data)
		if err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkFileManagerReadFile(b *testing.B) {
	tempDir := b.TempDir()
	fm := NewFileManager(tempDir)

	// Create test files
	data := make([]byte, 1024)
	rand.Read(data)

	fileNames := make([]string, b.N)
	for i := 0; i < b.N; i++ {
		fileName := fmt.Sprintf("read_bench_%d.dat", i)
		fileNames[i] = fileName
		err := fm.CreateFile(fileName, data)
		if err != nil {
			b.Fatal(err)
		}
	}

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		_, err := fm.ReadFile(fileNames[i])
		if err != nil {
			b.Fatal(err)
		}
	}
}

func BenchmarkFileManagerLargeFileOperations(b *testing.B) {
	tempDir := b.TempDir()
	fm := NewFileManager(tempDir)

	// 1MB file
	largeData := make([]byte, 1024*1024)
	rand.Read(largeData)

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		fileName := fmt.Sprintf("large_bench_%d.dat", i)

		// Create large file
		err := fm.CreateFile(fileName, largeData)
		if err != nil {
			b.Fatal(err)
		}

		// Read it back
		_, err = fm.ReadFile(fileName)
		if err != nil {
			b.Fatal(err)
		}
	}
}
package wal

import (
	"os"
	"testing"
	"time"
)

func TestW


 this(
        bottomText: json_['bottomText'] as core.String?,
        selected: json_['selected'] as core.bool?,
        startIconUri: json_['startIconUri'] as core.String?,
        text: json_['text'] as core.String?,
        value: json_['value'] as core.String?,
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (bottomText != null) 'bottomText': bottomText!,
    if (selected != null) 'selected': selected!,
    if (startIconUri != null) 'startIconUri': startIconUri!,
    if (text != null) 'text': text!,
    if (value != null) 'value': value!,
  };
}

/// One suggested value that users can enter in a text input field.
///
/// \[Google Workspace add-ons and Chat
/// apps\](https://developers.google.com/workspace/extend):
class GoogleAppsCardV1SuggestionItem {
  /// The value of a suggested input to a text input field.
  ///
  /// This is equivalent to what users enter themselves.
  core.String? text;

  GoogleAppsCardV1SuggestionItem({this.text});

  GoogleAppsCardV1SuggestionItem.fromJson(core.Map json_)
    : this(text: json_['text'] as core.String?);

  core.Map<core.String, core.dynamic> toJson() => {
    if (text != null) 'text': text!,
  };
}

/// Suggested values that users can enter.
///
/// These values appear when users click inside the text input field. As users
/// type, the suggested values dynamically filter to match what the users have
/// typed. For example, a text input field for programming language might
/// suggest Java, JavaScript, Python, and C++. When users start typing `Jav`,
/// the list of suggestions filters to show `Java` and `JavaScript`. Suggested
/// values help guide users to enter values that your app can make sense of.
/// When referring to JavaScript, some users might enter `javascript` and others
/// `java script`. Suggesting `JavaScript` can standardize how users interact
/// with your app. When specified, `TextInput.type` is always `SINGLE_LINE`,
/// even if it's set to `MULTIPLE_LINE`. \[Google Workspace add-ons and Chat
/// apps\](https://developers.google.com/workspace/extend):
class GoogleAppsCardV1Suggestions {
  /// A list of suggestions used for autocomplete recommendations in text input
  /// fields.
  core.List<GoogleAppsCardV1SuggestionItem>? items;

  GoogleAppsCardV1Suggestions({this.items});

  GoogleAppsCardV1Suggestions.fromJson(core.Map json_)
    : this(
        items:
            (json_['items'] as core.List?)
                ?.map(
                  (value) => GoogleAppsCardV1SuggestionItem.fromJson(
                    value as core.Map<core.String, core.dynamic>,
                  ),
                )
                .toList(),
      );

  core.Map<core.String, core.dynamic> toJson() => {
    if (items != null) 'items': items!,
  };
}

/// Either a toggle-style switch or a checkbox inside a `decoratedText` widget.
///
/// \[Google Workspace add-ons and Chat
/// apps\](https://developers.google.com/workspace/extend): Only supported in
/// the `decoratedText` widget.
class GoogleAppsCardV1SwitchControl {
  /// How the switch appears in the user interface.
  ///
  /// \[Google Workspace add-ons and Chat
  /// apps\](https://developers.google.com/workspace/extend):
  /// Possible string values are:
  /// - "SWITCH" : A toggle-style switch.
  /// - "CHECKBOX" : Deprecated in favor of `CHECK_BOX`.
  /// - "CHECK_BOX" : A checkbox.
  core.String? controlType;

  /// The name by which the switch widget is identified in a form input event.
  ///
  /// For details about working with form inputs, see
  /// [Receive form data](https://developers.google.com/workspace/chat


,
}
#[test]
fn bindgen_test_layout_ImportForeignSchemaStmt() {
    assert_eq!(
        ::std::mem::size_of::<ImportForeignSchemaStmt>(),
        56usize,
        concat!("Size of: ", stringify!(ImportForeignSchemaStmt))
    );
    assert_eq!(
        ::std::mem::align_of::<ImportForeignSchemaStmt>(),
        8usize,
        concat!("Alignment of ", stringify!(ImportForeignSchemaStmt))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).type_ as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).server_name as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(server_name)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).remote_schema as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(remote_schema)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).local_schema as *const _ as usize
        },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(local_schema)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).list_type as *const _ as usize
        },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(list_type)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).table_list as *const _ as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(table_list)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<ImportForeignSchemaStmt>())).options as *const _ as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(ImportForeignSchemaStmt),
            "::",
            stringify!(options)
        )
    );
}
impl Default for ImportForeignSchemaStmt {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[doc = "    Create POLICY Statement"]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct CreatePolicyStmt {
    pub type_: NodeTag,
    pub policy_name: *mut ::std::os::raw::c_char,
    #[doc = " Policy's name"]
    pub table: *mut RangeVar,
    #[doc = " the table name the policy applies to"]
    pub cmd_name: *mut ::std::os::raw::c_char,
    #[doc = " the command name the policy applies to"]
    pub permissive: bool,
    #[doc = " restrictive or permissive policy"]
    pub roles: *mut List,
    #[doc = " the roles associated with the policy"]
    pub qual: *mut Node,
    #[doc =


1 { }; // CHECK1: rename [[@LINE]]:8 -> [[@LINE]]:10

typedef struct S2 { } S3; // CHECK2: rename [[@LINE]]:16 -> [[@LINE]]:18
// CHECK3: rename [[@LINE-1]]:23 -> [[@LINE-1]]:25

void func(struct S1, // CHECK1-NEXT: rename [[@LINE]]:18 -> [[@LINE]]:20
          struct S2, // CHECK2-NEXT: rename [[@LINE]]:18 -> [[@LINE]]:20
          S3) { // CHECK3-NEXT: rename [[@LINE]]:11 -> [[@LINE]]:13
}

// RUN: clang-refactor-test rename-initiate -at=%s:1:8 -at=%s:6:18 -new-name=Bar %s | FileCheck --check-prefix=CHECK1 %s
// RUN: clang-refactor-test rename-initiate -at=%s:3:16 -at=%s:7:18 -new-name=Bar %s | FileCheck --check-prefix=CHECK2 %s
// RUN: clang-refactor-test rename-initiate -at=%s:3:23 -at=%s:8:11 -new-name=Bar %s | FileCheck --check-prefix=CHECK3 %s

// RUN: clang-refactor-test rename-initiate -at=%s:1:8 -at=%s:6:18 -new-name=Bar %s -x c | FileCheck --check-prefix=CHECK1 %s
// RUN: clang-refactor-test rename-initiate -at=%s:3:16 -at=%s:7:18 -new-name=Bar %s -x c | FileCheck --check-prefix=CHECK2 %s
// RUN: clang-refactor-test rename-initiate -at=%s:3:23 -at=%s:8:11 -new-name=Bar %s -x c | FileCheck --check-prefix=CHECK3 %s

// RUN: not clang-refactor-test rename-initiate -at=%s:3:9 -at=%s:6:11 -at=%s:7:11 -new-name=Bar %s 2>&1 | FileCheck --check-prefix=ERROR %s
// RUN: not clang-refactor-test rename-initiate -at=%s:3:9 -at=%s:6:11 -at=%s:7:11 -new-name=Bar %s -x c 2>&1 | FileCheck --check-prefix=ERROR %s
// ERROR: could not rename symbol at the given location
// Note: the run lines follow their respective tests, since line/column
// matter in this test

class Test {  // CHECK: rename [[@LINE]]:7 -> [[@LINE]]:11
public:
  Test() { }  // CHECK: rename [[@LINE]]:3 -> [[@LINE]]:7
  ~Test() { } // CHECK: rename [[@LINE]]:4 -> [[@LINE]]:8
  void doSomething() {
    return;
  }
};

void foo() {
  Test test;  // CHECK: rename [[@LINE]]:3 -> [[@LINE]]:7
  test.doSomething();
}

// RUN: clang-refactor-test rename-initiate -at=%s:4:7 -new-name=Foo %s | FileCheck %s
// RUN: clang-refactor-test rename-initiate -at=%s:4:8 -new-name=Foo %s | FileCheck %s
// RUN: clang-refactor-test rename-initiate -at=%s:4:9 -new-name=Foo %s | FileCheck %s
// RUN: clang-refactor-test rename-initiate -at=%s:4:10 -new-name=Foo %s | FileCheck %s

// RUN: not clang-refactor-test rename-initiate -at=%s:1:10 -new-name=Foo %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR1 %s
// CHECK-ERROR1: error: could not rename symbol at the given location

// RUN: not clang-refactor-test rename-initiate -at=%s -new-name=Foo %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR2 %s
// CHECK-ERROR2: error: The -at option must use the


rc=images/PartDesign_Revolution.svg  style="width:32px;"> [Revolução](PartDesign_Revolution/pt-br.md): cria uma peça sólida ao girar um esboço em torno de um eixo. O esboço deve formar um perfil fechado.

-    [Loft aditivo](PartDesign_AdditiveLoft/pt-br.md): cria um sólido, fazendo uma transição entre dois ou mais esboços.

-    [Aditivo de varredura](PartDesign_AdditivePipe/pt-br.md): cria um sólido ao varrer um ou mais esboços ao longo de um caminho aberto ou fechado.

-    [Hélice aditiva](PartDesign_AdditiveHelix/pt-br.md): cria um sólido ao varrer um esboço ao longo de uma hélice.

-    Create an additive primitive:

  - [Cubo aditivo](PartDesign_AdditiveBox/pt-br.md): cria um cubo aditivo.

  - [Cilindro aditivo](PartDesign_AdditiveCylinder/pt-br.md): cria um cilindro aditivo.

  - [Esfera aditiva](PartDesign_AdditiveSphere/pt-br.md): cria uma esfera aditiva.

  - [Cone aditivo](PartDesign_AdditiveCone/pt-br.md): cria um cone aditivo.

  - [Elipsóide aditiva](PartDesign_AdditiveEllipsoid/pt-br.md): cria uma elipsóide aditiva.

  - [Toro aditivo](PartDesign_AdditiveTorus/pt-br.md): cria um toro aditivo.

  - [Prisma aditivo](PartDesign_AdditivePrism/pt-br.md): cria um prisma aditivo.

  - [Cunha aditiva](PartDesign_AdditiveWedge/pt-br.md): cria uma cunha aditiva.

#### Ferramentas subtrativas

Estas são ferramentas para subtrair material de um corpo existente.

-    [Cavidade](PartDesign_Pocket/pt-br.md): cria uma cavidade a partir do esboço selecionado.

-    [Perfuração](PartDesign_Hole/pt-br.md): cria uma função de perfuração a partir do esboço selecionado. O esboço deve conter um ou mais círculos.

-   <img alt="" src=


 != verse.book) {
            cmds.add(PreBookChangeCommand())
            cmds.add(TextCommand("${res.getString(R.string.speak_book_changed)} $bookName ${res.getString(R.string.speak_chapter_changed)} ${verse.chapter}. "))
            cmds.add(SilenceCommand())
        }
        else if(prevVerse.chapter != verse.chapter) {
            if(settings.playbackSettings.speakChapterChanges) {
                cmds.add(PreChapterChangeCommand(settings))
                cmds.add(TextCommand("${res.getString(R.string.speak_chapter_changed)} ${verse.chapter}. "))
                cmds.add(SilenceCommand())
            }
        }
        else if(verse.ordinal < prevVerse.ordinal) {
            // TODO: we could say something special related to repeating
            cmds.add(TextCommand("$bookName ${res.getString(R.string.speak_chapter_changed)} ${verse.chapter}. "))
            cmds.add(SilenceCommand())
        }
        cmds.addAll(getSpeakCommandsForVerse(verse))
        return cmds
    }

    override fun getNextSpeakCommand(utteranceId: String, isCurrent: Boolean): SpeakCommand {
        while(currentCommands.isEmpty()) {
            currentCommands.addAll(getMoreSpeakCommands())
        }
        val cmd = currentCommands.removeAt(0)
        if(isCurrent) {
            currentUtteranceId = utteranceId
            utteranceState.clear()
            Log.i(TAG, "Marked current utteranceID $utteranceId")
        }
        utteranceState[utteranceId] = State(book, startVerse, endVerse, currentVerse, cmd)
        return cmd
    }

    private fun getMoreSpeakCommands(): SpeakCommandArray {
        val cmds = SpeakCommandArray()

        var verse = limitToRange(currentVerse)
        startVerse = verse

        // If there's something left from splitted verse, then we'll speak that first.
        if(readList.isNotEmpty()) {
            cmds.addAll(readList)
            readList.clear()
            verse = getNextVerse(verse)
        }

        verse = skipEmptyVerses(verse)

        cmds.addAll(getCommandsForVerse(endVerse, verse))

        // If verse does not end in period, add the part before period to the current reading
        val rest = SpeakCommandArray()

        while (!cmds.endsSentence) {
            val nextVerse = getNextVerse(verse)
            // We can have infinite loop if we are in repeat passage mode
            if(nextVerse.ordinal < verse.ordinal) {
                break
            }
            val nextCommands = getCommandsForVerse(verse, nextVerse)

            cmds.addUntilSentenceBreak(nextCommands, rest)
            verse = nextVerse
        }

        currentVerse = if (rest.isNotEmpty()) {
            readList.addAll(rest)
            verse
        } else {
            getNextVerse(verse)
        }

        endVerse = verse

        return cmds
    }

    override fun getStatusText(showFlag: Int): String {
        val verseRange = settings.playbackSettings.verseRange
        val percent = if(verseRange == null) {
            bibleTraverser.getPercentOfBook(currentState.startVerse)
        } else  {
            ((currentState.startVerse.ordinal - verseRange.start.ordinal).toFloat()
                    / (verseRange.end.ordinal-verseRange.start.ordinal) * 100).toInt()
        }
        var result = this.verseRange.name

        if(showFlag and FLAG_SHOW_STATUSITEMS != 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if(verseRange != null) {
                result += " \t\uD83D\uDD01"
            }
            if(settings.sleepTimer > 0) {
                result += " ⌛"
            }
        }

        if(showFlag and FLAG_SHOW_PERCENT != 0) {


,31.06}}},1537},
[171770] = {"Longberry's Reagents",nil,nil,{[1537]={{28.85,26.86}}},1537},
[171938] = {"Cactus Apple",nil,nil,{[14]={{39.93,68.09},{52.61,69.63},{46.93,60.26},{46.63,69.77},{53.25,43.49},{56.35,59.22},{44.85,61.65},{41.84,63.33},{47.4,65.2},{40.86,63.95},{42.01,56.46},{43.41,63.04},{45.93,67.44},{47.25,62.82},{52.59,69.34},{40.54,60.29},{46.16,63.07},{42.49,73.17},{39.97,68.38},{43.53,62.76},{41.77,63.3},{43.81,62.7},{39.8,63.02},{44.81,59.75},{45.65,16.83},{41.94,63.24},{42.07,66},{46,60.55},{40.24,65.2},{44,66.9},{39.61,63.04},{43.77,72.46},{45.32,71.02},{46.02,62.79},{43.96,65.2},{44.62,64.92},{44.17,65.14},{42.52,58.7},{41.57,58.55},{42.07,65.96},{41.54,58.71},{46.93,60.26},{42.81,56.25},{40.52,60.31},{41.97,56.51},{45.42,58.49},{42.62,58.73},{42,56.48},{45.5,58.52},{41.98,66.14},{42.53,58.69},{44.57,58.25},{44.64,58.28},{44.82,59.77},{44.91,59.69},{39.94,68.1},{39.96,68.37},{40.12,64.99},{40.23,65.19},{46.01,60.55},{47.31,65.2},{39.63,63.03},{39.7,62.87},{47.25,62.83},{45.97,60.69},{41.15,72.45},{41.04,72.09},{42.47,73.13},{44.93,61.53},{45.75,64.49},{44.85,61.65},{45.69,64.62},{46.07,63.02},{46.83,60.31},{46.83,60.44},{46.01,62.88},{45.68,63.29},{44.21,70.43},{43.81,62.83},{44.65,64.77},{44.6,64.88},{44.06,66.95},{43.99,67.09},{43.77,72.48}}},14},
[171939] = {"Corrupted Songflower",nil,{4401},{[361]={{45.94,85.22}}},361},
[171940] = {"Cleansed Songflower",nil,nil,{[361]={{46.4,83.65}}},361},
[171942] = {"Corrupted Songflower",nil,{2523},{[361]={{48.26,75.65}}},361},
[171943] = {"Cleansed Songflower",nil,nil,{[361]={{48.59,75.36}}},361},
[172619] = {"Un'Goro Flat Rock",nil,nil,{[490]={{79.92,49.9}}},490},
[172911] = {"The Black Anvil",nil,nil,{[1584]={{-1,-1}}},1584},
[172941] = {"Mighty Blaze",nil,nil,{[1637]={{58.21,54.26}}},1637},
[172942] = {"Mighty Blaze",nil,nil,{[1637]={{58.18,50.81}}},1637},
[172943] = {"Mighty Blaze",nil,nil,nil,0},
[172944] = {"Mighty Blaze",nil,nil,{[1637]={{53.37,34.


nt8_t result;
        __asm__ ("elpm %0,Z\n":"=r"(result):"z"(address));
        putch(result);
        address++;
      }
      while (--length);
#else
      do putch(pgm_read_byte_near(address++));
      while (--length);
#endif
#endif
    }

    /* Get device signature bytes  */
    else if(ch == STK_READ_SIGN) {
      // READ SIGN - return what Avrdude wants to hear
      verifySpace();
      putch(SIGNATURE_0);
      putch(SIGNATURE_1);
      putch(SIGNATURE_2);
    }
    else if (ch == 'Q') {
      // Adaboot no-wait mod
      watchdogConfig(WATCHDOG_16MS);
      verifySpace();
    }
    else {
      // This covers the response to commands like STK_ENTER_PROGMODE
      verifySpace();
    }
    putch(STK_OK);
  }
}

void putch(char ch) {
#ifndef SOFT_UART
  while (!(UCSR0A & _BV(UDRE0)));
  UDR0 = ch;
#else
  __asm__ __volatile__ (
    "   com %[ch]\n" // ones complement, carry set
    "   sec\n"
    "1: brcc 2f\n"
    "   cbi %[uartPort],%[uartBit]\n"
    "   rjmp 3f\n"
    "2: sbi %[uartPort],%[uartBit]\n"
    "   nop\n"
    "3: rcall uartDelay\n"
    "   rcall uartDelay\n"
    "   lsr %[ch]\n"
    "   dec %[bitcnt]\n"
    "   brne 1b\n"
    :
    :
      [bitcnt] "d" (10),
      [ch] "r" (ch),
      [uartPort] "I" (_SFR_IO_ADDR(UART_PORT)),
      [uartBit] "I" (UART_TX_BIT)
    :
      "r25"
  );
#endif
}

uint8_t getch(void) {
  uint8_t ch;

#ifdef LED_DATA_FLASH
#ifdef __AVR_ATmega8__
  LED_PORT ^= _BV(LED);
#else
  LED_PIN |= _BV(LED);
#endif
#endif

#ifdef SOFT_UART
  __asm__ __volatile__ (
    "1: sbic  %[uartPin],%[uartBit]\n"  // Wait for start edge
    "   rjmp  1b\n"
    "   rcall uartDelay\n"          // Get to middle of start bit
    "2: rcall uartDelay\n"              // Wait 1 bit period
    "   rcall uartDelay\n"              // Wait 1 bit period
    "   clc\n"
    "   sbic  %[uartPin],%[uartBit]\n"
    "   sec\n"
    "   dec   %[bitCnt]\n"
    "   breq  3f\n"
    "   ror   %[ch]\n"
    "   rjmp  2b\n"
    "3:\n"
    :
      [ch] "=r" (ch)
    :
      [bitCnt] "d" (9),
      [uartPin] "I" (_SFR_IO_ADDR(UART_PIN)),
      [uartBit] "I" (UART_RX_BIT)
    :
      "r25"
);
#else
  while(!(UCSR0A & _BV(RXC0)))
    ;
  if (!(UCSR0A & _BV(FE0))) {
      /*
       * A Framing Error indicates (probably) that something is talking
       * to us at the wrong bit rate.  Assume that this is because it
       * expects to be talking to the application, and DON'T reset the
       * watchdog.  This should cause the bootloader to abort and run
       * the application "soon", if it keeps happening.  (Note that we
       * don't care that an invalid char is returned...)
       */
    watchdogReset();
  }

  ch = UDR0;
#endif

#ifdef LED_DATA_FLASH
#ifdef __AVR_ATmega8__
  LED_PORT ^= _BV(LED);
#else
  LED_PIN |= _BV(LED);
#endif
#endif

  return ch;
}

#ifdef SOFT_UART
// AVR350 equation: #define UART_B_VALUE (((F_CPU/BAUD_RATE)-23)/6)
// Adding 3 to numerator simulates nearest rounding for more accurate baud rates
#define UART_B_VALUE (((F_CPU/BAUD_RATE)-20)/6)
#if UART_B_VALUE > 255
#error Baud rate too slow for soft UART
#endif

void uartDelay() {
  __asm__ __volatile__ (
    "ldi r25,%[count]\n"
    "1:dec r25\n"
    "brne 1b\n"
    "ret\n"
    ::[count] "M" (UART_B_VALUE)
  );
}
#endif

void getNch(uint8_t count) {
  do getch(); while (--count);
  verifySpace();
}

void verifySpace() {
  if (getch() != CRC_EOP) {
    watchdogConfig(WATCHDOG_16MS);    // shorten WD timeout
    while (1)			      // and busy-loop so that WD causes
      ;				      //  a reset and app start.
  }
  putch(STK_INSYNC);
}

#if LED_START_FLASHES > 0
void flash_led(uint8_t count) {
  do {
    TCNT1 = -(F_CPU/(1024*16));
    TIFR1 = _BV(TOV1);
    while(!(TIFR1 & _BV(TOV1)));
#ifdef __AVR_ATmega8__
    LED_PORT ^= _BV(LED);
#else
    LED_PIN |= _BV(LED);
#endif
    watchdogReset();
  } while (--count);
}
#endif

// Watchdog functions. These are only safe with interrupts turned off.
void watchdogReset() {
  __asm__ __volatile__ (
    "wdr\n"
  );
}

void watchdogConfig(uint8_t x) {
  WDTCSR = _BV(WDCE) | _BV(WDE);
  WDTCSR = x;
}

void appStart() {
  watchdogConfig(WATCHDOG_OFF);
  __asm__ __volatile__ (
#ifdef VIRTUAL_BOOT_PARTITION
    // Jump to WDT vector
    "ldi r30,4\n"
    "clr r31\n"
#else
    // Jump to RST vector
    "clr r30\n"
    "clr r31\n"
#endif
    "ijmp\n"
  );
}


# double precision floating point stuff for Atari-gcc using the SFP004
# developed with gas
#
# double precision complex exponential function
#
# M. Ritzert (mjr at dmzrzu71)
#
# 12.10.1990
#
# addresses of the 68881 data port. This choice is fastest when much data is
# transferred between the two processors.

comm =	 -6
resp =	-16
zahl =	  0

# waiting loop ...
#
# wait:
# ww:	cmpiw	#0x8900,a1@(resp)
# 	beq	ww
# is coded directly by
#	.long	0x0c688900, 0xfff067f8
# and
# www:	tst.b	a1@(resp)
#	bmi.b	www
# is coded by
#	.word	0x4a68,0xfff0,0x6bfa		| test

	.text; .even
	.globl _cexp
_cexp:
	movel	a1,d0				| save a1 as return value
	lea	0xfffa50,a0			| fpu address
	movew	#0x5410,a0@(comm)		| exp()
	cmpiw	#0x8900,a0@(resp)		| check
	movel	a7@(4),a0@			| load arg_hi
	movel	a7@(8),a0@			| load ar


hen to insert a new keyframe, create some new MapPoints and
    // performs relocalization if tracking fails.
    Tracking* mpTracker;

    // Local Mapper. It manages the local map and performs local bundle adjustment.
    LocalMapping* mpLocalMapper;  // 管理局部地图

    // Loop Closer. It searches loops with every new keyframe. If there is a loop it performs
    // a pose graph optimization and full bundle adjustment (in a new thread) afterwards.
    LoopClosing* mpLoopCloser;

    // The viewer draws the map and the current camera pose. It uses Pangolin.
    Viewer* mpViewer;

    FrameDrawer* mpFrameDrawer;
    MapDrawer* mpMapDrawer;

    // System threads: Local Mapping, Loop Closing, Viewer.
    // The Tracking thread "lives" in the main execution thread that creates the System object.
    // 这里可以看到 tracking线程存在于主线程中 外加其他三个线程一共四个线程
    std::thread* mptLocalMapping;   //定义线程指针在类的实现文件中，动态申请线程
    std::thread* mptLoopClosing;    //这三个线程指针用法类似
    std::thread* mptViewer;

    // Reset flag
    std::mutex mMutexReset;
    bool mbReset;

    // Change mode flags
    std::mutex mMutexMode;
    bool mbActivateLocalizationMode;
    bool mbDeactivateLocalizationMode;

 /*   ///以下wubo版本中没有，但是ORBSLAM中有，这里我加上。
    //　以下这一部分应该是没有啥用处，调试的时候可用

    // Tracking state 这是ORB中原有的
    int mTrackingState;
    std::vector<MapPoint*> mTrackedMapPoints;
    std::vector<cv::KeyPoint> mTrackedKeyPointsUn;

    // --line--
    std::vector<MapLine*> mTrackedMapLines;
    std::vector<KeyLine> mTrackedKeyLines;

    std::mutex mMutexState; */
};

}// namespace ORB_SLAM

#endif  // SYSTEM_H


scope(InputScope {
            // FIXME: ???
            parent: self.id,
            child: id,
        });

        Scope {
            datalog: self.datalog.clone(),
            id,
            __lifetime: PhantomData,
        }
    }

    pub fn id(&self) -> u32 {
        self.id
    }

    pub fn next_func_id(&self) -> u32 {
        self.datalog.borrow_mut().inc_function()
    }

    pub fn next_expr_id(&self) -> u32 {
        self.datalog.borrow_mut().inc_expression()
    }

    pub fn push_function(&self, func: Function) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::Function as RelId,
            v: Value::Function(func).into_ddvalue(),
        });
    }

    pub fn push_func_arg(&self, arg: FuncArg) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::FuncArg as RelId,
            v: Value::FuncArg(arg).into_ddvalue(),
        });
    }

    pub fn push_expression(&self, expr: Expression) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::Expression as RelId,
            v: Value::Expression(expr).into_ddvalue(),
        });
    }

    pub fn push_var_decl(&self, var_decl: VarDecl) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::VarDecl as RelId,
            v: Value::VarDecl(var_decl).into_ddvalue(),
        });
    }

    pub fn push_literal(&self, literal: Literal) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::Literal as RelId,
            v: Value::Literal(literal).into_ddvalue(),
        });
    }

    pub fn push_app(&self, app: Application) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::Application as RelId,
            v: Value::Application(app).into_ddvalue(),
        });
    }

    pub fn push_app_arg(&self, arg: ApplicationArg) {
        self.datalog.borrow_mut().updates.push(Update::Insert {
            relid: Relations::ApplicationArg as RelId,
            v: Value::ApplicationArg(arg).into_ddvalue(),
        });
    }
}

fn ddlog_literal(lit: ast::Literal) -> Lit {
    match lit {
        ast::Literal::String(s) => Lit::LitStr {
            s: internment::intern(&s.0),
        },
        ast::Literal::Int(i) => Lit::LitInt { i },
        ast::Literal::Bool(b) => Lit::LitBool { b },
    }
}

fn ddlog_type(ty: ast::Type) -> Type {
    match ty {
        ast::Type::Path(_) => Type::Unknown,
        ast::Type::Bool => Type::Bool,
        ast::Type::Int => Type::Int,
        ast::Type::String => Type::String,
    }
}

fn expr_kind(expr: &ast::Expr) -> ExprKind {
    match expr {
        ast::Expr::Let(_) => ExprKind::Decl,
        ast::Expr::Literal(_) => ExprKind::Lit,
        ast::Expr::V


import unittest
import lib as merge
from collections import OrderedDict

fixtures = [
[{
    "title": "Goodbye!",
    "author" : {
        "givenName" : "John",
        "familyName" : "Doe"
    },
    "tags":[ "example", "sample" ],
    "content": "This will be unchanged"
},
{
    "title": "Hello!",
    "phoneNumber": "+01-123-456-7890",
    "author": {
        "familyName": None
     },
     "tags": [ "example" ]
},
{
     "title": "Hello!",
     "author" : {
         "givenName" : "John"
     },
     "tags": [ "example" ],
     "content": "This will be unchanged",
     "phoneNumber": "+01-123-456-7890"
}],
[{"a":"b"},{"a":"c"},{"a":"c"}],
[{"a":"b"},{"b":"c"},{"a":"b", "b":"c"}],
[{"a":"b"},{"a":None},{}],
[{"a":"b","b":"c"},{"a":None},{"b":"c"}],
[{"a":["b"]},{"a":"c"},{"a":"c"}],
[{"a":"c"},{"a":["b"]},{"a":["b"]}],
[{"a": {"b": "c"}},{"a":{"b": "d", "c": None}}, {"a": {"b": "d"}}],
[{"a": [{"b":"c"}]},{"a": [1]},{"a": [1]}],
[["a","b"],["c","d"],["c","d"]],
[{"a":"foo"},None,None],
[{"a":"foo"},"bar","bar"],
[{"e":None},{"a":1},{"e":None, "a":1}],
[[1,2], {"a":"b","c":None},{"a":"b"}],
[{},{"a":{"bb":{"ccc": None}}},{"a":{"bb":{}}}]
]

class TestAll(unittest.TestCase):

    def test_merge(self):
        for fixture in fixtures:
            self.assertEqual(merge.merge(fixture[0], fixture[1]), fixture[2])

    def test_create_patch(self):
        for num, fixture in enumerate(fixtures):
            # ignore some tests as these do not show mimimum patch needed
            if num not in [7, 13, 14]:
                self.assertEqual(merge.create_patch(fixture[0], fixture[2]), fixture[1])

ordered_fixtures = [[
    OrderedDict([
        ("title", "Goodbye!"),
        ("content", "This will be unchanged")
    ]),
    OrderedDict([
        ("title", "Goodbye!"),
        ("new", "Where will this go?"),
        ("content", "content")
    ]),
    OrderedDict([
        ("title", "Goodbye!"),
        ("content", "content"),
        ("new", "Where will this go?")
    ]),
    OrderedDict([
        ("new", "Where will this go?"),
        ("title", "Goodbye!"),
        ("content", "content")
    ])
],[
    OrderedDict([
        ("title", "Goodbye!"),
        ("content", "This will be unchanged")
    ]),
    OrderedDict([
        ("title", "Goodbye!"),
        ("new", OrderedDict([("where", "will I go")])),
        ("content", "content"),
    ]),
    OrderedDict([
        ("title", "Goodbye!"),
        ("content", "content"),
        ("new", OrderedDict([("where", "will I go")])),
    ]),
    OrderedDict([
        ("new", OrderedDict([("where", "will I go")])),
        ("title", "Goodbye!"),
        ("content", "content"),
    ])
]]

class TestOrdered(unittest.TestCase):

    def test_merge(self):
        for fixture in ordered_fixtures:
            self.assertEqual(merge.merge(fixture[0].copy(), fixture[1], position='last'), fixture[2])
            self.assertEqual(merge.merge(fixture[0].copy(), fixture[1], position='first'), fixture[3])

if __name__ == '__main__':
    unittest.main()


null,"C":null,"D":null,"E":null})";
            string translated = R"({"A":null,"B":null,"C":null,"D":null,"E":null})";

            ::Thunder::Core::JSON::Tester<1, SmallTest> parser;
            ::Thunder::Core::ProxyType<SmallTest> output = ::Thunder::Core::ProxyType<SmallTest>::Create();
            string received;

            parser.FromString(input, output);
            parser.ToString(output, received);
            EXPECT_STREQ(translated.c_str(), received.c_str());
        }
        {
            // SmallTest
            string input = R"({"A":"1","B":"3.2","C":"Text"})";
            string translated = R"({"A":1,"B":3.2,"C":"Text"})";

            ::Thunder::Core::JSON::Tester<1, SmallTest> parser;
            ::Thunder::Core::ProxyType<SmallTest> output = ::Thunder::Core::ProxyType<SmallTest>::Create();
            string received;

            parser.FromString(input, output);
            parser.ToString(output, received);
            EXPECT_STREQ(translated.c_str(), received.c_str());
        }
        {
            // SmallTest
            string input = R"({"A":["test"],"B":"3.2","C":"-65.22"})";
            string translated = R"({"A":["test"],"B":3.2,"C":-65.22})";

            ::Thunder::Core::JSON::Tester<1, SmallTest2> parser;
            ::Thunder::Core::ProxyType<SmallTest2> output = ::Thunder::Core::ProxyType<SmallTest2>::Create();
            string received;

            parser.FromString(input, output);
            parser.ToString(output, received);
            EXPECT_STREQ(translated.c_str(), received.c_str());
        }
        {
            string input = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":"-44","i":"enum_4","j":["6","14","22"],"k":"1.1","l":"2.11"},"m":["Test"],"n":"3.2","o":"-65.22"})";
            string translated = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":-44,"i":"enum_4","j":[6,14,22],"k":1.1,"l":2.11},"m":["Test"],"n":3.2,"o":-65.22})";

            ::Thunder::Core::JSON::Tester<1, CommandRequest> parser;
            ::Thunder::Core::ProxyType<CommandRequest> output = ::Thunder::Core::ProxyType<CommandRequest>::Create();
            string received;

            parser.FromString(input, output);
            parser.ToString(output, received);
            EXPECT_STREQ(translated.c_str(), received.c_str());
        }
        {
            //Tester
            string input = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":"-44","i":"enum_4","j":["6","14","22"],"k":"1.1","l":"2.11"},"m":["Test"],"n":"3.2","o":"-65.22"})";
            string inputRequired = R"({"a":"-0x5A","b":"TestIdentifier","c":"0x5A","d":true,"e":"014","f":{"g":"-014","h":-44,"i":"enum_4","j":[6,14,22],"k":1.1,"l":2.11},"m":["Test"],"n":3.2,"o":-65.22})";
            string output;
            ::Thunder::Core::ProxyType<CommandRequest> command = ::Thunder::Core::ProxyType<CommandRequest>::Create();
            command->A = -90;
            command->B = _T("TestIdentifier");
            command->C = 90;
            command->D = true;
            command->E = 12;
            command->F.


2",
					DomainSuffix:      "edgekey.net",
					IPVersionBehavior: "IPV4",
				},
				{
					ID:                "ehn_2",
					Domain:            "test3.edgesuite.net",
					ProductID:         "prd_2",
					DomainPrefix:      "test3",
					DomainSuffix:      "edgesuite.net",
					IPVersionBehavior: "IPV4",
				},
			}},
		}, nil)
	}
	expectGetEdgeHostnameAkamaized := func(m *papi.Mock, edgehostID, contractID, groupID string) *mock.Call {
		return m.On("GetEdgeHostname", testutils.MockContext, papi.GetEdgeHostnameRequest{
			EdgeHostnameID: edgehostID,
			ContractID:     contractID,
			GroupID:        groupID,
		}).Return(&papi.GetEdgeHostnamesResponse{
			ContractID: "ctr_1",
			GroupID:    "grp_2",
			EdgeHostname: papi.EdgeHostnameGetItem{
				ID:                "ehn_1",
				Domain:            "test.akamaized.net",
				ProductID:         "prd_2",
				DomainPrefix:      "test",
				DomainSuffix:      "akamaized.net",
				IPVersionBehavior: "IPV4",
				Secure:            true,
			},
			EdgeHostnames: papi.EdgeHostnameItems{Items: []papi.EdgeHostnameGetItem{
				{
					ID:                "ehn_1",
					Domain:            "test2.edgekey.net",
					ProductID:         "prd_2",
					DomainPrefix:      "test2",
					DomainSuffix:      "edgekey.net",
					IPVersionBehavior: "IPV4",
				},
				{
					ID:                "ehn_2",
					Domain:            "test3.edgesuite.net",
					ProductID:         "prd_2",
					DomainPrefix:      "test3",
					DomainSuffix:      "edgesuite.net",
					IPVersionBehavior: "IPV4",
				},
			}},
		}, nil)
	}
	expectGetEdgeHostnameAkamaizedNoProductID := func(m *papi.Mock, edgehostID, contractID, groupID string) *mock.Call {
		return m.On("GetEdgeHostname", testutils.MockContext, papi.GetEdgeHostnameRequest{
			EdgeHostnameID: edgehostID,
			ContractID:     contractID,
			GroupID:        groupID,
		}).Return(&papi.GetEdgeHostnamesResponse{
			ContractID: "ctr_1",
			GroupID:    "grp_2",
			EdgeHostname: papi.EdgeHostnameGetItem{
				ID:                "ehn_1",
				Domain:            "test.akamaized.net",
				DomainPrefix:      "test",
				DomainSuffix:      "akamaized.net",
				IPVersionBehavior: "IPV4",
				Secure:            true,
			},
			EdgeHostnames: papi.EdgeHostnameItems{Items: []papi.EdgeHostnameGetItem{
				{
					ID:                "ehn_1",
					Domain:            "test2.edgekey.net",
					DomainPrefix:      "test2",
					DomainSuffix:      "edgekey.net",
					IPVersionBehavior: "IPV4",
				},
				{
					ID:                "ehn_2",
					Domain:            "test3.edgesuite.net",
					DomainPrefix:      "test3",
					DomainSuffix:      "edgesuite.net",
					IPVersionBehavior: "IPV4",
				},
			}},
		}, nil)
	}
	expectGetEdgeHostnames := func(m *papi.Mock, contractID, groupID string) *mock.Call {
		return m.On("GetEdgeHostnames", testutils.MockContext, papi.GetEdgeHostnamesRequest{
			ContractID: contractID,
			GroupID:


String merriWeatherFontFamily = 'MerriWeather';

  //Mulish Font Family
  static const String mulishFontFamily = 'Mulish';

  //Headings
  static TextStyle titleLarge = TextStyle(
      fontSize: 20.sp,
      fontWeight: FontWeight.w700,
      fontFamily: mulishFontFamily,
      letterSpacing: 0.4);

  static TextStyle titleMedium = TextStyle(
      fontSize: 16.sp,
      fontWeight: FontWeight.w900,
      fontFamily: merriWeatherFontFamily,
      letterSpacing: 0.32);
  static  TextStyle titleSmall = TextStyle(
      fontSize: 16.sp,
      fontWeight: FontWeight.w700,
      fontFamily: mulishFontFamily,
      letterSpacing: 0.28);

  //Body
  static const TextStyle bodyLarge = TextStyle(
      fontSize: 16,
      fontWeight: FontWeight.w900,
      fontFamily: merriWeatherFontFamily,
      letterSpacing: 0.02);
  static  TextStyle bodyMedium = TextStyle(
      fontSize: 14.sp,
      fontWeight: FontWeight.w400,
      fontFamily: mulishFontFamily,
      letterSpacing: 0.24);

  static TextStyle bodySmall = TextStyle(
      fontSize: 14.sp,
      fontWeight: FontWeight.w400,
      fontFamily: mulishFontFamily,
      letterSpacing: 0.24);
}
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'cast.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');

Cast _$CastFromJson(Map<String, dynamic> json) {
  return _Cast.fromJson(json);
}

/// @nodoc
mixin _$Cast {
  @JsonKey(name: 'id')
  int get id => throw _privateConstructorUsedError;
  @JsonKey(name: 'name')
  String get name => throw _privateConstructorUsedError;
  @JsonKey(name: 'original_name')
  String get originalName => throw _privateConstructorUsedError;
  @JsonKey(name: 'profile_path')
  String get profilePath => throw _privateConstructorUsedError;

  Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
  @JsonKey(ignore: true)
  $CastCopyWith<Cast> get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $CastCopyWith<$Res> {
  factory $CastCopyWith(Cast value, $Res Function(Cast) then) =
      _$CastCopyWithImpl<$Res, Cast>;
  @useResult
  $Res call(
      {@JsonKey(name: 'id') int id,
      @JsonKey(name: 'name') String name,
      @JsonKey(name: 'original_name') String originalName,
      @JsonKey(name: 'profile_path') String profilePath});
}

/// @nodoc
class _$CastCopyWithImpl<$Res, $Val extends Cast>
    implements $CastCopyWith<$Res> {
  _$CastCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? id = null,
    Object? name = null,
    Object? originalName = null,
    Object?


c
	137: 26,
	// langDzongkha → smTibetan
	138: 0,
	// langJavaneseRom → smRoman
	139: 0,
	// langSundaneseRom → smRoman
	140: 0,
	// langGalician → smRoman
	141: 0,
	// langAfrikaans → smRoman
	142: 0,
	// langBreton → smRoman (modified)
	143: 28,
	// langInuktitut → smEthiopic (modified)
	144: 0,
	// langScottishGaelic → smRoman (modified)
	145: 0,
	// langManxGaelic → smRoman (modified)
	146: 0,
	// langIrishGaelicScript → smRoman (modified)
	147: 0,
	// langTongan → smRoman
	148: 6,
	// langGreekAncient → smRoman
	149: 0,
	// langGreenlandic → smRoman
	150: 0,
	// langAzerbaijanRoman → smRoman
	151: 0,
	// langNynorsk → smRoman
};
var windowsLanguages = {
	1078: 'af',
	1052: 'sq',
	1156: 'gsw',
	1118: 'am',
	5121: 'ar-DZ',
	15361: 'ar-BH',
	3073: 'ar',
	2049: 'ar-IQ',
	11265: 'ar-JO',
	13313: 'ar-KW',
	12289: 'ar-LB',
	4097: 'ar-LY',
	6145: 'ary',
	8193: 'ar-OM',
	16385: 'ar-QA',
	1025: 'ar-SA',
	10241: 'ar-SY',
	7169: 'aeb',
	14337: 'ar-AE',
	9217: 'ar-YE',
	1067: 'hy',
	1101: 'as',
	2092: 'az-Cyrl',
	1068: 'az',
	1133: 'ba',
	1069: 'eu',
	1059: 'be',
	2117: 'bn',
	1093: 'bn-IN',
	8218: 'bs-Cyrl',
	5146: 'bs',
	1150: 'br',
	1026: 'bg',
	1027: 'ca',
	3076: 'zh-HK',
	5124: 'zh-MO',
	2052: 'zh',
	4100: 'zh-SG',
	1028: 'zh-TW',
	1155: 'co',
	1050: 'hr',
	4122: 'hr-BA',
	1029: 'cs',
	1030: 'da',
	1164: 'prs',
	1125: 'dv',
	2067: 'nl-BE',
	1043: 'nl',
	3081: 'en-AU',
	10249: 'en-BZ',
	4105: 'en-CA',
	9225: 'en-029',
	16393: 'en-IN',
	6153: 'en-IE',
	8201: 'en-JM',
	17417: 'en-MY',
	5129: 'en-NZ',
	13321: 'en-PH',
	18441: 'en-SG',
	7177: 'en-ZA',
	11273: 'en-TT',
	2057: 'en-GB',
	1033: 'en',
	12297: 'en-ZW',
	1061: 'et',
	1080: 'fo',
	1124: 'fil',
	1035: 'fi',
	2060: 'fr-BE',
	3084: 'fr-CA',
	1036: 'fr',
	5132: 'fr-LU',
	6156: 'fr-MC',
	4108: 'fr-CH',
	1122: 'fy',
	1110: 'gl',
	1079: 'ka',
	3079: 'de-AT',
	1031: 'de',
	5127: 'de-LI',
	4103: 'de-LU',
	2055: 'de-CH',
	1032: 'el',
	1135: 'kl',
	1095: 'gu',
	1128: 'ha',


IU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
`

const ambiguousPathsGo = `package ambiguouspaths

import (
	_ "golang.org/x/mobile/app"
)

func Dummy() {}
`

func TestBindWithGoModules(t *testing.T) {
	if runtime.GOOS == "android" || runtime.GOOS == "ios" {
		t.Skipf("gomobile and gobind are not available on %s", runtime.GOOS)
	}

	dir := t.TempDir()

	if out, err := exec.Command("go", "build", "-o="+dir, "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil {
		t.Fatalf("%v: %s", err, string(out))
	}
	if out, err := exec.Command("go", "build", "-o="+dir, "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
		t.Fatalf("%v: %s", err, string(out))
	}
	path := dir
	if p := os.Getenv("PATH"); p != "" {
		path += string(filepath.ListSeparator) + p
	}

	// Create a source package dynamically to avoid go.mod files in this repository. See golang/go#34352 for more details.
	if err := os.Mkdir(filepath.Join(dir, "ambiguouspaths"), 0755); err != nil {
		t.Fatal(err)
	}
	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.mod"), []byte(ambiguousPathsGoMod), 0644); err != nil {
		t.Fatal(err)
	}
	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.sum"), []byte(ambiguousPathsGoSum), 0644); err != nil {
		t.Fatal(err)
	}
	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "ambiguouspaths.go"), []byte(ambiguousPathsGo), 0644); err != nil {
		t.Fatal(err)
	}

	for _, target := range []string{"android", "ios"} {
		target := target
		t.Run(target, func(t *testing.T) {
			switch target {
			case "android":
				if _, err := sdkpath.AndroidAPIPath(minAndroidAPI); err != nil {
					t.Skip("No compatible Android API platform found, skipping bind")
				}
			case "ios":
				if !xcodeAvailable() {
					t.Skip("Xcode is missing")
				}
			}

			var out string
			switch target {
			case "android":
				out = filepath.Join(dir, "cgopkg.aar")
			case "ios":
				out = filepath.Join(dir, "Cgopkg.xcframework")
			}

			tests := []struct {
				Name string
				Path string
				Dir  string
			}{
				{
					Name: "Absolute Path",
					Path: "golang.org/x/mobile/bind/testdata/cgopkg",
				},
				{
					Name: "Relative Path",
					Path: "./bind/testdata/cgopkg",
					Dir:  filepath.Join("..", ".."),
				},
				{
					Name: "Ambiguous Paths",
					Path: ".",
					Dir:  filepath.Join(dir, "ambiguouspaths"),
				},
			}

			for _, tc := range tests {
				tc := tc
				t.Run(tc.Name, func(t *testing.T) {
					cmd := exec.Command(filepath.Join(dir, "gomobile"), "bind", "-target="+target, "-o="+out, tc.Path)
					cmd.Env = append(os.Environ(), "PATH="+path, "GO111MODULE=on")
					cmd.Dir = tc.Dir
					if out, err := cmd.CombinedOutput(); err != nil {
						t.Errorf("gomobile bind


erver_fd, epoll_fd, rc, i, reuseaddr, status;
  struct sockaddr_in server_addr;
  unsigned long nb;
  pid_t pid;

  server_fd = socket(AF_INET, SOCK_STREAM, 0);
  // printf("server_fd=%d\n", server_fd);
  if (server_fd == -1) {
    perror("socket failed");
    exit(EXIT_FAILURE);
  }

  memset(&server_addr, 0, sizeof(server_addr));
  server_addr.sin_family = AF_INET;
  server_addr.sin_addr.s_addr = INADDR_ANY;
  server_addr.sin_port = htons(PORT);

  reuseaddr = 1;
  if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&reuseaddr,
                 sizeof(int)) == -1) {
    perror("setsockopt reuse addr failed");
    close(server_fd);
    exit(EXIT_FAILURE);
  }

  nb = 1;
  if (ioctl(server_fd, FIONBIO, &nb) == -1) {
    perror("ioctl FIONBIO failed");
    close(server_fd);
    exit(EXIT_FAILURE);
  }

  if (bind(server_fd, (struct sockaddr *)&server_addr, sizeof(server_addr)) <
      0) {
    perror("bind failed");
    close(server_fd);
    exit(EXIT_FAILURE);
  }

  if (listen(server_fd, 511) < 0) {
    perror("listen failed");
    close(server_fd);
    exit(EXIT_FAILURE);
  }

  int child_count = get_logical_cpu_cores();
  pid_t *child_pids = malloc(sizeof(pid_t) * child_count);
  if (child_pids == NULL) {
    perror("cannot alloc child_pids");
    close(server_fd);
    exit(EXIT_FAILURE);
  }

  for (int i = 0; i < child_count; i++) {
    pid = fork();
    switch (pid) {
    case 0:
      handle_client(&server_fd);
      break;
    case -1:
      break;
    default:
      child_pids[i] = pid;
      break;
    }
  }

  for (int i = 0; i < child_count; i++) {
    pid = wait(&status);
    if (pid == -1) {
      perror("wait worker process failed");
      close(server_fd);
      exit(EXIT_FAILURE);
    }
  }

  close(server_fd);
  return 0;
}


sPolicy &&
          other.topologyKey == topologyKey &&
          other.whenUnsatisfiable == whenUnsatisfiable;

  @override
  int get hashCode =>
      // ignore: unnecessary_parenthesis
      (labelSelector == null ? 0 : labelSelector!.hashCode) +
      (matchLabelKeys.hashCode) +
      (maxSkew.hashCode) +
      (minDomains == null ? 0 : minDomains!.hashCode) +
      (nodeAffinityPolicy == null ? 0 : nodeAffinityPolicy!.hashCode) +
      (nodeTaintsPolicy == null ? 0 : nodeTaintsPolicy!.hashCode) +
      (topologyKey.hashCode) +
      (whenUnsatisfiable.hashCode);

  @override
  String toString() =>
      'IoK8sApiCoreV1TopologySpreadConstraint[labelSelector=$labelSelector, matchLabelKeys=$matchLabelKeys, maxSkew=$maxSkew, minDomains=$minDomains, nodeAffinityPolicy=$nodeAffinityPolicy, nodeTaintsPolicy=$nodeTaintsPolicy, topologyKey=$topologyKey, whenUnsatisfiable=$whenUnsatisfiable]';

  Map<String, dynamic> toJson() {
    final json = <String, dynamic>{};
    if (this.labelSelector != null) {
      json[r'labelSelector'] = this.labelSelector;
    } else {
      json[r'labelSelector'] = null;
    }
    json[r'matchLabelKeys'] = this.matchLabelKeys;
    json[r'maxSkew'] = this.maxSkew;
    if (this.minDomains != null) {
      json[r'minDomains'] = this.minDomains;
    } else {
      json[r'minDomains'] = null;
    }
    if (this.nodeAffinityPolicy != null) {
      json[r'nodeAffinityPolicy'] = this.nodeAffinityPolicy;
    } else {
      json[r'nodeAffinityPolicy'] = null;
    }
    if (this.nodeTaintsPolicy != null) {
      json[r'nodeTaintsPolicy'] = this.nodeTaintsPolicy;
    } else {
      json[r'nodeTaintsPolicy'] = null;
    }
    json[r'topologyKey'] = this.topologyKey;
    json[r'whenUnsatisfiable'] = this.whenUnsatisfiable;
    return json;
  }

  /// Returns a new [IoK8sApiCoreV1TopologySpreadConstraint] instance and imports its values from
  /// [value] if it's a [Map], null otherwise.
  // ignore: prefer_constructors_over_static_methods
  static IoK8sApiCoreV1TopologySpreadConstraint? fromJson(dynamic value) {
    if (value is Map) {
      final json = value.cast<String, dynamic>();

      // Ensure that the map contains the required keys.
      // Note 1: the values aren't checked for validity beyond being non-null.
      // Note 2: this code is stripped in release mode!
      assert(() {
        requiredKeys.forEach((key) {
          assert(json.containsKey(key),
              'Required key "IoK8sApiCoreV1TopologySpreadConstraint[$key]" is missing from JSON.');
          assert(json[key] != null,
              'Required key "IoK8sApiCoreV1TopologySpreadConstraint[$key]" has a null value in JSON.');
        });
        return true;
      }());

      return IoK8sApiCoreV1TopologySpreadConstraint(
        labelSelector: IoK8sApimachineryPkgApisMetaV1LabelSelector.fromJson(
            json[r'labelSelector']),
        matchLabelKeys: json[r'matchLabelKeys'] is List
            ? (json[r'matchLabelKeys'] as List).cast<String>()
            : const [],
        maxSkew: mapValueOfType<int>(json, r'maxSkew')!,
        minDomains: mapValueOfType<int>(json, r'm