1, "rgb(0, 95, 107)");

  canvasContext.fillStyle = gradient;
  canvasContext.fillRect(0, 0, width, height);

  canvasContext.lineWidth = 3;
  canvasContext.strokeStyle = "rgb(181, 82, 92)";
}

export function drawOscilloscope(analyser: AnalyserNode) {
  const canvas = document.querySelector(".oscilloscope") as HTMLCanvasElement;
  const canvasContext = canvas.getContext("2d") as CanvasRenderingContext2D;
  const bufferLength = analyser.fftSize;
  const dataArray = new Uint8Array(bufferLength);

  const { width, height } = canvas;
  canvasContext.clearRect(0, 0, width, height);

  const draw = () => {
    requestAnimationFrame(draw);
    analyser.getByteTimeDomainData(dataArray);

    stylizeCanvas(canvasContext, width, height);
    canvasContext.beginPath();

    const sliceWidth = width / bufferLength;
    let x = 0;
    for (let i = 0; i < bufferLength; i++) {
      const value = dataArray[i] / 32.0;
      const y = (value * height) / 2;
      const yVal = y - 195;
      canvasContext.lineTo(x, yVal);
      x += sliceWidth;
    }

    canvasContext.stroke();
  };

  draw();
}
/**
 * Model for Focus
 */

import { Skill } from './Skill';

export class Focus {
  id: number;
  name: string;
  isActive: boolean;
  isCore: boolean;
  skills: Skill[];

  /**
   * Creates an instance of Focus.
   * @param {number} id
   * @param {string} name
   * @param {boolean} active
   * @param {boolean} core
   * @param {Skill[]} skills
   * @memberof Focus
   */
  constructor(id: number, name: string, active: boolean, core: boolean, skills: Skill[]) {
    this.id = id;
    this.name = name;
    this.isActive = active;
    this.isCore = core;
    this.skills = skills;
  }
}
import { Component, OnInit } from '@angular/core';
import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";

@Component({
  selector: 'app-fileupload',
  templateUrl: './fileupload.component.html',
  styleUrls: ['./fileupload.component.css']
})
export class FileuploadComponent implements OnInit {
  file: any;
  imgURL: any;
  storageRef: any;
  progressRange: any = 0;
  fileUploadOperationState: boolean = false;

  constructor() {
    this.storageRef = firebase.storage().ref();
  }

  ngOnInit(): void {
  }

  uploadFile(files: any) {
    this.file = files[0];

    var reader = new FileReader();
    reader.readAsDataURL(this.file);
    reader.onload = (event) => {
      this.imgURL = reader.result;
    }
    console.log(this.file);
  }

  upload() {
    // Create file metadata including the content type
    var metadata = {
      contentType: 'image/jpeg',
    };

    // Upload the file and metadata
    var uploadTask = this.storageRef.child('images/'+this.file.name).put(this.file, metadata);

    // Register three observers:
    // 1. 'state_changed' observer, called any time the state changes
    // 2. Error observer, called on failure
    // 3. Completion observer, called on successful completion
    uploadTask.on('state_changed', (snapshot:any) => {
      // Observe state change events such as progress, pause, and resume
      // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded
      var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;


   -webkit-user-select  :none;
}
.viewlistdialog_ul  li .nococotile
{
	background : #eee;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}
.viewlistdialog_ul li.nodata {
	padding: 8px;
	font-size:95%;
	border-bottom: 0px solid #999;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li a.item.view {
	background-color: #eff6f2;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li.outside a.item .pankuzu
{

	color:#ff4500;
}

.viewlistdialog_ul li a.item .viewmark {

	position:absolute;
	display:inline-block;
	*display: inline;
	*zoom: 1;
	padding:1px 3px 1px 3px;
	-moz-border-radius: 3px;/*for Firefox*/
	-webkit-border-radius: 3px;/*for Safari and chrome*/
	border-radius: 3px;
	behavior: url(border-radius.htc);/*for IE*/

	background: #2B7396;
	color:#fff;
	left : 2px;
	top : 1px;
	font-size: 7pt;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li .grayscale
{
	color:#000;
	position: absolute;
	right:109px;
	top:18px;
	font-size:10px;
	display:inline-block;
	*display: inline;
	*zoom: 1;

	padding:0px;

    white-space:nowrap;

	z-index:10;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li .grayscale_label
{
	color:#000;
	position: absolute;
	right: 98px;
	top:3px;
	font-size:10px;
	display:inline-block;
	*display: inline;
	*zoom: 1;

	padding:0px;

    white-space:nowrap;

	z-index:10;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li .opacity
{
	color:#000;
	position: absolute;
	right:48px;
	top:3px;
	font-size:10px;
	display:inline-block;
	*display: inline;
	*zoom: 1;

	padding:0px;

    white-space:nowrap;

	z-index:10;

    -webkit-touch-callout:none;
    -webkit-user-select  :none;
}

.viewlistdialog_ul li .btn
{
    -webkit-touch-callout:none;
    -webkit-user-select  :none;

    cursor:pointer;
}

.viewlistdialog_ul li .opacity_up_btn
{
	color:#333;
	position: absolute;
	right:70px;
	top:18px;
	font-size:10px;
	line-height:20px;
	height:18px;
	width: 18px;
	display:inline-block;
	*display: inline;
	*zoom: 1;
	text-align: center;
	vertical-align: middle;
	padding:0px;

    border: 1px solid #666;
    background-color:#eee;

	-moz-border-radius: 5px;/*for Firefox*/
	-webkit-border-radius: 5px;/*for Safari and chrome*/
	border-radius: 5px;
	behavior: url(border-radius.htc);/*for IE*/

    -moz-transition: all 0.3s ease


55, .3) !important;
}
.mdui-theme-layout-dark .mdui-radio:active input[type="radio"] + .mdui-radio-icon {
  box-shadow: 0 0 0 15px rgba(255, 255, 255, .1);
}
/**
 * =============================================================================
 * ************   Switch 单选框   ************
 * =============================================================================
 */
.mdui-switch {
  display: inline-block;
  height: 36px;
  line-height: 36px;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.mdui-switch input {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
/* 图标轨道 */
.mdui-switch-icon {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 14px;
  vertical-align: middle;
  background-color: rgba(0, 0, 0, .38);
  border-radius: 14px;
  transition: background-color .3s cubic-bezier(.4, 0, .2, 1);
}
.mdui-switch-icon:before {
  position: absolute;
  top: -3px;
  left: -3px;
  display: inline-block;
  width: 20px;
  height: 20px;
  content: ' ';
  background-color: #fafafa;
  border-radius: 20px;
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);
  transition: box-shadow .14s cubic-bezier(.4, 0, .2, 1), background-color .3s cubic-bezier(.4, 0, .2, 1), left .3s cubic-bezier(.4, 0, .2, 1);
}
/* 选中状态的图标 */
.mdui-switch input[type="checkbox"]:checked + .mdui-switch-icon {
  background-color: rgba(255, 64, 129, .5);
}
.mdui-switch input[type="checkbox"]:checked + .mdui-switch-icon:before {
  left: 20px;
  background-color: #ff4081;
}
/* 未选中时或禁用时 按下的阴影 */
.mdui-switch:active input[type="checkbox"] + .mdui-switch-icon:before {
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 0 15px rgba(0, 0, 0, .1);
}
/* 已选中时按下的阴影 */
.mdui-switch:active input[type="checkbox"]:checked:not(:disabled) + .mdui-switch-icon:before {
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 0 15px rgba(255, 64, 129, .16);
}
/* 禁用状态 */
.mdui-switch input[type="checkbox"]:disabled + .mdui-switch-icon {
  background-color: rgba(0, 0, 0, .12) !important;
}
.mdui-switch input[type="checkbox"]:disabled + .mdui-switch-icon:before {
  background-color: #bdbdbd !important;
}
/**
 * =============================================================================
 * ************   Switch 强调色


/*
 * coreMQTT v1.1.1
 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

/**
 * @file event_callback_stub.h
 * @brief Stub definition for the application defined MQTT library incoming
 * event callback.
 */
#ifndef EVENT_CALLBACK_STUB_H_
#define EVENT_CALLBACK_STUB_H_

/* mqtt.h must precede including this header. */

/**
 * @brief User defined callback for receiving incoming publishes and incoming
 * acks.
 *
 * @param[in] pContext Initialized MQTT context.
 * @param[in] pPacketInfo Information on the type of incoming MQTT packet.
 * @param[in] pDeserializedInfo Deserialized information from incoming packet.
 */
void EventCallbackStub( MQTTContext_t * pContext,
                        MQTTPacketInfo_t * pPacketInfo,
                        MQTTDeserializedInfo_t * pDeserializedInfo );

#endif /* ifndef EVENT_CALLBACK_STUB_H_ */


in os.Args and go from there.  All the usual contents of
	// main() are put into this package for ease of testing.
	mainReturn := entrypoint.Main()

	//  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Timing
	//
	// The system 'time' command is built-in, of course but it's nice to have
	// simply wall-time without the real/user/sys distinction. Also, making
	// this a Miller built-in is nice for Windows.
	if mainReturn.PrintElapsedTime {
		endTime := time.Now()
		startNanos := startTime.UnixNano()
		endNanos := endTime.UnixNano()
		seconds := float64(endNanos-startNanos) / 1e9
		fmt.Fprintf(os.Stderr, "%.6f", seconds)
		for _, arg := range os.Args {
			if strings.Contains(arg, " ") || strings.Contains(arg, "\t") {
				fmt.Fprintf(os.Stderr, " '%s'", arg)
			} else {
				fmt.Fprintf(os.Stderr, " %s", arg)
			}
		}
		fmt.Fprintf(os.Stderr, "\n")
	}
}
package main

import (
	"bufio"
	"container/list"
	"errors"
	"fmt"
	"os"

	"github.com/johnkerl/miller/v6/pkg/cli"
	"github.com/johnkerl/miller/v6/pkg/input"
	"github.com/johnkerl/miller/v6/pkg/output"
	"github.com/johnkerl/miller/v6/pkg/transformers"
	"github.com/johnkerl/miller/v6/pkg/types"
)

func convert_csv_to_json(fileNames []string) error {
	options := &cli.TOptions{
		ReaderOptions: cli.TReaderOptions{
			InputFileFormat: "csv",
			IFS:             ",",
			IRS:             "\n",
			RecordsPerBatch: 1,
		},
		WriterOptions: cli.TWriterOptions{
			OutputFileFormat: "json",
		},
	}
	outputStream := os.Stdout
	outputIsStdout := true

	// Since Go is concurrent, the context struct needs to be duplicated and
	// passed through the channels along with each record.
	initialContext := types.NewContext()

	// Instantiate the record-reader.
	// RecordsPerBatch is tracked separately from ReaderOptions since join/repl
	// may use batch size of 1.
	recordReader, err := input.Create(&options.ReaderOptions, options.ReaderOptions.RecordsPerBatch)
	if err != nil {
		return err
	}

	// Instantiate the record-writer
	recordWriter, err := output.Create(&options.WriterOptions)
	if err != nil {
		return err
	}

	cat, err := transformers.NewTransformerCat(
		false, // doCounters bool,
		"",    // counterFieldName string,
		nil,   // groupByFieldNames []string,
		false, // doFileName bool,
		false, // doFileNum bool,
	)
	if err != nil {
		return err
	}
	recordTransformers := []transformers.IRecordTransformer{cat}

	// Set up the reader-to-transformer and transformer-to-writer channels.
	readerChannel := make(chan *list.List, 2) // list of *types.RecordAndContext
	writerChannel := make(chan *list.List, 1) // list of *types.RecordAndContext

	// We're done when a fatal error is registered on input (file not found,
	// etc) or when the record-writer has written all its output. We use


age);

  /// Named constructor for creating a user with default values
  User.withDefaults(this.id, this.name)
    : email = '$name@example.com',
      _age = 0;

  /// Getter for user's age
  int get age => _age;

  /// Setter for user's age with validation
  set age(int value) {
    if (value < 0 || value > 150) {
      throw ArgumentError('Age must be between 0 and 150');
    }
    _age = value;
  }

  /// Checks if the user is an adult
  bool get isAdult => _age >= 18;

  /// Returns a string representation of the user
  @override
  String toString() {
    return 'User(id: $id, name: $name, email: $email, age: $_age)';
  }

  /// Checks equality based on user ID
  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is User && other.id == id;
  }

  @override
  int get hashCode => id.hashCode;
}

/// Represents a product in an e-commerce system
class Product {
  final String id;
  final String name;
  final double price;
  final String category;
  int _stock;

  Product(this.id, this.name, this.price, this.category, this._stock);

  /// Getter for current stock
  int get stock => _stock;

  /// Reduces stock by the specified amount
  bool reduceStock(int amount) {
    if (amount <= 0) {
      throw ArgumentError('Amount must be positive');
    }
    if (_stock >= amount) {
      _stock -= amount;
      return true;
    }
    return false;
  }

  /// Increases stock by the specified amount
  void increaseStock(int amount) {
    if (amount <= 0) {
      throw ArgumentError('Amount must be positive');
    }
    _stock += amount;
  }

  /// Checks if the product is in stock
  bool get isInStock => _stock > 0;

  /// Calculates the total value of stock
  double get totalStockValue => _stock * price;
}

/// An abstract base class for different types of accounts
abstract class Account {
  final String accountNumber;
  double _balance;

  Account(this.accountNumber, this._balance);

  double get balance => _balance;

  /// Abstract method that must be implemented by subclasses
  bool withdraw(double amount);

  /// Deposits money into the account
  void deposit(double amount) {
    if (amount <= 0) {
      throw ArgumentError('Deposit amount must be positive');
    }
    _balance += amount;
  }
}

/// A savings account implementation
class SavingsAccount extends Account {
  final double interestRate;

  SavingsAccount(super.accountNumber, super.balance, this.interestRate);

  @override
  bool withdraw(double amount) {
    if (amount <= 0) {
      throw ArgumentError('Withdrawal amount must be positive');
    }
    if (_balance >= amount) {
      _balance -= amount;
      return true;
    }
    return false;
  }

  /// Applies interest to the account balance
  void applyInterest() {
    _balance += _balance * interestRate / 100;
  }
}

/// Generic container class demonstrating type parameters
class Container<T> {
  final List<T> _items = [];

  /// Adds an item to the container
  void add(T item) {
    _items.add(item);
  }

  /// Removes an item from the container
  bool remove(T item) {
    return _items.remove(item);
  }

  /// Gets all items in the container
  List<T> get items => List.unmodifiable(_items);

  /// Gets the number of items
  int get length => _items.length;

  /// Checks if the container is empty
  bool get isEmpty => _items.isEmpty;

  /// Finds the first item matching the predicate
  T? find(bool Function(T) predicate) {
    for (fin


Stem export…

MIDI/panic	Panic

MouseMode/set-mouse-mode-audition	Audition Tool

MouseMode/set-mouse-mode-draw	Note Drawing Tool

MouseMode/set-mouse-mode-gain	Gain Tool

MouseMode/set-mouse-mode-object	Object Tool

MouseMode/set-mouse-mode-object-range	Smart Object Mode

MouseMode/set-mouse-mode-range	Range Tool

MouseMode/set-mouse-mode-timefx	Time FX Tool

MouseMode/set-mouse-mode-zoom	Zoom Tool

MouseMode/toggle-internal-edit	Edit MIDI

options/SendMidiClock	Send MIDI Clock

options/SendMIDIfeedback	Send MIDI Feedback

options/SendMMC	Send MMC

options/SendMTC	Send MTC

options/UseMMC	Use MMC

ProcessorMenu/ab_plugins	A/B Plugins

ProcessorMenu/activate_all	Activate All

ProcessorMenu/clear	Clear (all)

ProcessorMenu/clear_post	Clear (post-fader)

ProcessorMenu/clear_pre	Clear (pre-fader)

ProcessorMenu/controls	Controls

ProcessorMenu/copy	Copy

ProcessorMenu/cut	Cut

ProcessorMenu/deactivate_all	Deactivate All

ProcessorMenu/delete	Delete

ProcessorMenu/deselectall	Deselect All

ProcessorMenu/edit-generic	Edit with generic controls…

ProcessorMenu/edit	Edit…


td>マモルベキモノ
東方回転木馬

	原曲
明治十七年の上海アリス

东方红魔乡　～ the Embodiment of Scarlet Devil.

02	哀れな身無し子	03:59

	编曲	コンプ，パプリカ

	演唱	ランコ

	作词	ランコの姉<a rel="


align-arrow-inner,.tips-notice[class*=" x-align-top"] .x-align-arrow-inner{border-top-color:#fcf8e3;}.tips-notice.x-align-right .x-align-arrow{border-right-color:#fbeed5;}.tips-notice.x-align-right .x-align-arrow-inner{border-right-color:#fcf8e3;}.tips-notice.x-align-left .x-align-arrow{border-left-color:#fbeed5;}.tips-notice.x-align-left .x-align-arrow-inner{border-left-color:#fcf8e3;}.tips-notice[class^="x-align-bottom"] .x-align-arrow,.tips-notice[class*=" x-align-bottom"] .x-align-arrow{border-bottom-color:#fbeed5;}.tips-notice[class^="x-align-bottom"] .x-align-arrow-inner,.tips-notice[class*=" x-align-bottom"] .x-align-arrow-inner{border-bottom-color:#fcf8e3;}.bui-uploader .bui-uploader-button-wrap{display:inline-block;padding:0 5px;height:24px;overflow:hidden;line-height:24px;position:relative;z-index:500;margin-right:10px;text-decoration:none;font-size:12px;text-align:center;cursor:pointer;}.bui-uploader .bui-uploader-button-wrap .file-input-wrapper{display:block;width:200px;height:26px;position:absolute;left:0;top:0;overflow:hidden;z-index:300;}.bui-uploader .bui-uploader-button-wrap .file-input-wrapper .file-input{background:none repeat scroll 0 0 transparent;border:medium none;cursor:pointer;height:200px;width:200px;top:-50px;opacity:0;filter:alpha(opacity=0);position:absolute;font-size:100px;left:0;}.bui-uploader .bui-uploader-button-wrap .uploader-button-swf{display:block;width:200px;height:26px;position:absolute;left:0;top:0;overflow:hidden;z-index:300;}.bui-uploader .bui-uploader-button-wrap .uploader-button-swf .file-input{background:none repeat scroll 0 0 transparent;border:medium none;cursor:pointer;height:200px;width:200px;top:-50px;opacity:0;filter:alpha(opacity=0);position:absolute;font-size:100px;left:0;}.defaultTheme .bui-uploader-button-wrap{display:inline-block;padding:0 5px;height:24px;overflow:hidden;line-height:24px;position:relative;z-index:500;margin-right:10px;text-decoration:none;font-size:12px;text-align:center;border:1px solid #C4DAED;background:-webkit-gradient(linear,left top,left bottom,from(#fdfefe),to(#dfe7ef));background:-moz-linear-gradient(top,#fdfefe,#dfe7ef);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FDFEFE',endColorstr='#DFE7EF');}.defaultTheme .bui-uploader-button-wrap:link,.defaultTheme .bui-uploader-button-wrap:visited{color:#404040;}.defaultTheme .bui-uploader-button-wrap:hover{text-decoration:none;color:black;background:-webkit-gradient(linear,left top,left bottom,from(#dfe7ef),to(#fdfefe));background:-moz-linear-gradient(top,#dfe7ef,#fdfefe);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#DFE7EF',endColorstr='#FDFEFE');}.defaultTheme .bui-uploader-button-wrap:active{background:#DFE7EF;filter:none;}.defaultTheme .bui-uploader-htmlButton-disabled .bui-uploader-button-wrap{border:1px


_FSDSP)
  .value("C_FSW", LIEF::assembly::riscv::OPCODE::C_FSW)
  .value("C_FSWSP", LIEF::assembly::riscv::OPCODE::C_FSWSP)
  .value("C_J", LIEF::assembly::riscv::OPCODE::C_J)
  .value("C_JAL", LIEF::assembly::riscv::OPCODE::C_JAL)
  .value("C_JALR", LIEF::assembly::riscv::OPCODE::C_JALR)
  .value("C_JR", LIEF::assembly::riscv::OPCODE::C_JR)
  .value("C_LBU", LIEF::assembly::riscv::OPCODE::C_LBU)
  .value("C_LD", LIEF::assembly::riscv::OPCODE::C_LD)
  .value("C_LDSP", LIEF::assembly::riscv::OPCODE::C_LDSP)
  .value("C_LDSP_RV32", LIEF::assembly::riscv::OPCODE::C_LDSP_RV32)
  .value("C_LD_RV32", LIEF::assembly::riscv::OPCODE::C_LD_RV32)
  .value("C_LH", LIEF::assembly::riscv::OPCODE::C_LH)
  .value("C_LHU", LIEF::assembly::riscv::OPCODE::C_LHU)
  .value("C_LH_INX", LIEF::assembly::riscv::OPCODE::C_LH_INX)
  .value("C_LI", LIEF::assembly::riscv::OPCODE::C_LI)
  .value("C_LI_HINT", LIEF::assembly::riscv::OPCODE::C_LI_HINT)
  .value("C_LUI", LIEF::assembly::riscv::OPCODE::C_LUI)
  .value("C_LUI_HINT", LIEF::assembly::riscv::OPCODE::C_LUI_HINT)
  .value("C_LW", LIEF::assembly::riscv::OPCODE::C_LW)
  .value("C_LWSP", LIEF::assembly::riscv::OPCODE::C_LWSP)
  .value("C_LWSP_INX", LIEF::assembly::riscv::OPCODE::C_LWSP_INX)
  .value("C_LW_INX", LIEF::assembly::riscv::OPCODE::C_LW_INX)
  .value("C_MOP1", LIEF::assembly::riscv::OPCODE::C_MOP1)
  .value("C_MOP11", LIEF::assembly::riscv::OPCODE::C_MOP11)
  .value("C_MOP13", LIEF::assembly::riscv::OPCODE::C_MOP13)
  .value("C_MOP15", LIEF::assembly::riscv::OPCODE::C_MOP15)
  .value("C_MOP3", LIEF::assembly::riscv::OPCODE::C_MOP3)
  .value("C_MOP5", LIEF::assembly::riscv::OPCODE::C_MOP5)
  .value("C_MOP7", LIEF::assembly::riscv::OPCODE::C_MOP7)
  .value("C_MOP9", LIEF::assembly::riscv::OPCODE::C_MOP9)
  .value("C_MUL", LIEF::assembly::riscv::OPCODE::C_MUL)
  .value("C_MV", LIEF::assembly::riscv::OPCODE::C_MV)
  .value("C_MV_HINT", LIEF::assembly::riscv::OPCODE::C_MV_HINT)
  .value("C_NOP", LIEF::assembly::riscv::OPCODE::C_NOP


1 = default delay)
	 * @return           AutoChatInstance chatInst
	 */
	public AutoChatInstance registerGlobalChat(final int npcId, final String[] chatTexts, final long chatDelay)
	{
		return registerChat(npcId, null, chatTexts, chatDelay);
	}

	/**
	 * Registers a NON globally-active auto chat for the given NPC instance, and adds to the currently assigned chat instance for this NPC ID, otherwise creates a new instance if a previous one is not found.

	 * Returns the associated auto chat instance.
	 * @param  npcInst
	 * @param  chatTexts
	 * @param  chatDelay (-1 = default delay)
	 * @return           AutoChatInstance chatInst
	 */
	public AutoChatInstance registerChat(final L2NpcInstance npcInst, final String[] chatTexts, final long chatDelay)
	{
		return registerChat(npcInst.getNpcId(), npcInst, chatTexts, chatDelay);
	}

	private final AutoChatInstance registerChat(final int npcId, final L2NpcInstance npcInst, final String[] chatTexts, long chatDelay)
	{
		AutoChatInstance chatInst = null;

		if (chatDelay < 0)
		{
			chatDelay = DEFAULT_CHAT_DELAY;
		}

		if (registeredChats.containsKey(npcId))
		{
			chatInst = registeredChats.get(npcId);
		}
		else
		{
			chatInst = new AutoChatInstance(npcId, chatTexts, chatDelay, (npcInst == null));
		}

		if (npcInst != null)
		{
			chatInst.addChatDefinition(npcInst);
		}

		registeredChats.put(npcId, chatInst);

		return chatInst;
	}

	/**
	 * Removes and cancels ALL auto chat definition for the given NPC ID, and removes its chat instance if it exists.
	 * @param  npcId
	 * @return       boolean removedSuccessfully
	 */
	public boolean removeChat(final int npcId)
	{
		final AutoChatInstance chatInst = registeredChats.get(npcId);

		return removeChat(chatInst);
	}

	/**
	 * Removes and cancels ALL auto chats for the given chat instance.
	 * @param  chatInst
	 * @return          removedSuccessfully
	 */
	public boolean removeChat(final AutoChatInstance chatInst)
	{
		if (chatInst == null)
		{
			return false;
		}

		registeredChats.remove(chatInst.getNPCId());
		chatInst.setActive(false);

		if (Config.DEBUG)
		{
			LOGGER.debug("AutoChatHandler: Removed auto chat for NPC ID " + chatInst.getNPCId());
		}

		return true;
	}

	/**
	 * Returns the associated auto chat instance either by the given NPC ID or object ID.
	 * @param  id
	 * @param  byObjectId
	 * @return            chatInst
	 */
	public AutoChatInstance getAutoChatInstance(final int id, final boolean byObjectId)
	{
		if (!byObjectId)
		{
			return registeredChats.get(id);
		}

		for (final AutoChatInstance chatInst : registeredChats.values())
		{
			if (chatInst.getChatDefinition(id) != null)
			{
				return chatInst;
			}
		}

		return null;
	}

	/**
	 * Sets the active state of all auto chat instances to that specified, and cancels the scheduled chat task if necessary.
	 * @param isActive
	 */
	public void setAutoChatActive(final boolean isActive)
	{
		for (final AutoChatInstance chatInst : registeredChats.values())
		{
			chatInst.setActive(isActive);
		}
	}

	/**
	 * Used in conjunction with a SpawnListener, this method is called every time an NPC is spawned in the world.

	 *

	 * If an auto chat instance is set to be "global", all instances matching the registered NPC ID will be added to that chat instance.
	 */
	@Override
	public void npcSpawned(final L2NpcInstance npc)
	{
		synchronized (registe


91c.png",
    pokemon_type_id: "electric,flying",
    pokemon_type_name: "電,飛行",
  },
  {
    zukan_id: "145",
    zukan_sub_id: 1,
    pokemon_name: "閃電鳥",
    pokemon_sub_name: "伽勒爾的樣子",
    weight: 58.2,
    height: 1.6,
    file_name: "/img/pm/c8ca1d916272be90a24dd4da66a27e3ae70d8fd5.png",
    pokemon_type_id: "fighting,flying",
    pokemon_type_name: "格鬥,飛行",
  },
  {
    zukan_id: "146",
    zukan_sub_id: 0,
    pokemon_name: "火焰鳥",
    pokemon_sub_name: "",
    weight: 60,
    height: 2,
    file_name: "/img/pm/9d83c451429ae1858ff1588ba5724ffbad4b55c1.png",
    pokemon_type_id: "fire,flying",
    pokemon_type_name: "火,飛行",
  },
  {
    zukan_id: "146",
    zukan_sub_id: 1,
    pokemon_name: "火焰鳥",
    pokemon_sub_name: "伽勒爾的樣子",
    weight: 66,
    height: 2,
    file_name: "/img/pm/9b19c3a602a800d162bc3f7549804b721186f1b6.png",
    pokemon_type_id: "dark,flying",
    pokemon_type_name: "惡,飛行",
  },
  {
    zukan_id: "147",
    zukan_sub_id: 0,
    pokemon_name: "迷你龍",
    pokemon_sub_name: "",
    weight: 3.3,
    height: 1.8,
    file_name: "/img/pm/27a6cc8fdc7abc93def1b061b582dac7a93430c1.png",
    pokemon_type_id: "dragon",
    pokemon_type_name: "龍",
  },
  {
    zukan_id: "148",
    zukan_sub_id: 0,
    pokemon_name: "哈克龍",
    pokemon_sub_name: "",
    weight: 16.5,
    height: 4,
    file_name: "/img/pm/f6ae3010972469372d493e3cc4a516c574df3974.png",
    pokemon_type_id: "dragon",
    pokemon_type_name: "龍",
  },
  {
    zukan_id: "149",
    zukan_sub_id: 0,
    pokemon_name: "快龍",
    pokemon_sub_name: "",
    weight: 210,
    height: 2.2,
    file_name: "/img/pm/ecdc5527d67488c92c242e34458844fe2afac525.png",
    pokemon_type_id: "dragon,flying",
    pokemon_type_name: "龍,飛行",
  },
  {
    zukan_id: "150",
    zukan_sub_id: 0,
    pokemon_name: "超夢",
    pokemon_sub_name: "",
    weight: 122,
    height: 2,
    file_name: "/img/pm/ad7ffb53f984a6623c53f01cfbc


from typing import Callable, List, Any

#https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#section-5.4.1
def expandMessageXMD(
  #pylint: disable=invalid-name
  H: Callable[[bytes], Any],
  dst: str,
  msg: bytes,
  outLen: int
) -> bytes:
  h: Any = H("".encode("utf-8"))
  bInBytes: int = h.digest_size
  rInBytes: int = h.block_size

  #Steps 1-2.
  ell: int = ((outLen + bInBytes) - 1) // bInBytes
  if ell > 255:
    raise Exception("Invalid XMD output length set given the hash function.")

  #Steps 3-4.
  if len(dst) > 255:
    raise Exception("Invalid DST.")
  dstPrime: bytes = dst.encode("utf-8") + len(dst).to_bytes(1, "big")
  zPad: bytes = bytes([0] * rInBytes)
  if outLen > 65535:
    raise Exception("Invalid XMD output length.")

  #Steps 5-6.
  msgPrime: bytes = zPad + msg + outLen.to_bytes(2, "big") + bytes([0]) + dstPrime

  #Steps 7-8.
  #b0
  b: List[bytes] = [H(msgPrime).digest()]
  #b1
  b.append(H(b[0] + bytes([1]) + dstPrime).digest())

  #Steps 9-10.
  for i in range(2, ell + 1):
    b.append(
      H(
        bytes([b[0][i] ^ b[-1][i] for i in range(len(b[0]))]) +
        i.to_bytes(1, "big") +
        dstPrime
      ).digest()
    )

  #Steps 11-12.
  return (b"".join(b[1:]))[0 : outLen]


) * Snm_i(n,m) * sigma2snm(n,m) * Snm_k(n,m) * coeff_k(n);
      }
    }
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

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

Double GravityfieldFilter::variance(const Time &time, const Vector3d &point, const Kernel &kernel) const
{
  try
  {
    SphericalHarmonics harmonics = sphericalHarmonics(time);
    if(!harmonics.sigma2cnm().size())
      return 0.0;

    UInt   maxDegree = harmonics.maxDegree();
    Double GM = harmonics.GM();
    Double R  = harmonics.R();
    Vector coeff = GM/R * kernel.inverseCoefficients(point, maxDegree, harmonics.isInterior());
    Matrix Cnm, Snm;
    SphericalHarmonics::CnmSnm(1/R * point, maxDegree, Cnm, Snm, harmonics.isInterior());

    Double sigma2 = 0;
    const Matrix sigma2cnm = harmonics.sigma2cnm();
    const Matrix sigma2snm = harmonics.sigma2snm();
    for(UInt n=0; n<=maxDegree; n++)
      for(UInt m=0; m<=n; m++)
        sigma2  += std::pow(coeff(n)*Cnm(n,m),2) * sigma2cnm(n,m)
                +  std::pow(coeff(n)*Snm(n,m),2) * sigma2snm(n,m);
    return sigma2;
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/
/***********************************************/
/**
* @file observationSstVariational.cpp
*
* @brief Satellite to satellite tracking (Variational equations).
*
* @author Torsten Mayer-Guerr
* @date 2012-06-10
*
*/
/***********************************************/

#include "base/import.h"
#include "misc/observation/observationMiscSstVariational.h"
#include "misc/observation/covarianceSst.h"
#include "misc/observation/covariancePod.h"
#include "classes/observation/observation.h"
#include "observationSstVariational.h"

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

ObservationSstVariational::ObservationSstVariational(Config &config)
{
  try
  {
    observationMisc = ObservationMiscSstVariationalPtr(new ObservationMiscSstVariational(config));
    readConfig(config, "covarianceSst",  covSst,  Config::MUSTSET, "", "covariance matrix of satellite to satellite tracking observations");
    readConfig(config, "covariancePod1", covPod1, Config::MUSTSET, "", "covariance matrix of kinematic orbits (satellite 1)");
    readConfig(config, "covariancePod2", covPod2, Config::MUSTSET, "", "covariance matrix of kinematic orbits (satellite 2)");
    if(isCreateSchema(config)) return;
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

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

void ObservationSstVariational::observation(UInt arcNo, Matrix &l, Matrix &A, Matrix &B)
{
  try
  {
    ObservationMiscSstVariational::Arc arc = observationMisc->computeArc(arcNo, covSst, covPod1, covPod2);
    l = arc.l;
    A = arc.A;
    B = arc.B;
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/
/***********************************************/
/**
* @file observationTerrestrial.cpp
*
* @brief Terrestrial observations (point measurements).
* Observed function values of Gravityfield.
*
* @author Torsten Mayer-Guerr
* @date 2005-03-22
*
*/
/********************************


MUTABLE) {
            advance()
        } else {
            error("`const`, `immutable`, `inout`, or `shared` expected")
            return false
        }
        exit_section_modified(builder, marker, DlangTypes.CAST_QUALIFIER, true)
        return true
    }

    /**
     * Parses a Catch
     *
     *
     * $(GRAMMAR $(RULEDEF catch):
     * $(LITERAL 'catch') $(LITERAL '$(LPAREN)') $(RULE type) $(LITERAL Identifier)? $(LITERAL '$(RPAREN)') $(RULE declarationOrStatement)
     * ;)
     */
    fun parseCatch(): Boolean {
        val m = builder.mark()
        expect(DlangTypes.KW_CATCH)
        if (!tokenCheck(DlangTypes.OP_PAR_LEFT)) {
            cleanup(m, DlangTypes.CATCH)
            return false
        }
        if (!parseType()) {
            cleanup(m, DlangTypes.CATCH)
            return false
        }
        if (currentIs(DlangTypes.ID)) {
            advance()
        }
        if (!tokenCheck(DlangTypes.OP_PAR_RIGHT)) {
            cleanup(m, DlangTypes.CATCH)
            return false
        }
        if (!parseNoScopeNonEmptyStatement()) {
            cleanup(m, DlangTypes.CATCH)
            return false
        }
        exit_section_modified(builder, m, DlangTypes.CATCH, true)
        return true
    }

    /**
     * Parses a Catches
     *
     *
     * $(GRAMMAR $(RULEDEF catches):
     * $(RULE catch)+
     * | $(RULE catch)* $(RULE lastCatch)
     * ;)
     */
    fun parseCatches(): Boolean {
        val m = builder.mark()
        while (moreTokens()) {
            if (!currentIs(DlangTypes.KW_CATCH)) break
            if (peekIs(DlangTypes.OP_PAR_LEFT)) {
                if (!parseCatch()) {
                    cleanup(m, DlangTypes.CATCHES)
                    return false
                }
            } else {
                if (!parseLastCatch()) {
                    cleanup(m, DlangTypes.CATCHES)
                    return false
                }
                break
            }
        }
        exit_section_modified(builder, m, DlangTypes.CATCHES, true)
        return true
    }

    /**
     * Parses a ClassDeclaration
     *
     *
     * $(GRAMMAR $(RULEDEF classDeclaration):
     * $(LITERAL 'class') $(LITERAL Identifier) $(LITERAL ';')
     * | $(LITERAL 'class') $(LITERAL Identifier) ($(LITERAL ':') $(RULE baseClassList))? $(RULE structBody)
     * | $(LITERAL 'class') $(LITERAL Identifier) $(RULE templateParameters) $(RULE consraint)? ($(RULE structBody) | $(LITERAL ';'))
     * | $(LITERAL 'class') $(LITERAL Identifier) $(RULE templateParameters) $(RULE consraint)? ($(LITERAL ':') $(RULE baseClassList))? $(RULE structBody)
     * | $(LITERAL 'class') $(LITERAL Identifier) $(RULE templateParameters) ($(LITERAL ':') $(RULE baseClassList))? $(RULE raint)? $(RULE structBody)
     * ;)
     */
    fun parseClassDeclaration(m: PsiBuilder.Marker): Boolean {
        if (builder.tokenType !== DlangTypes.KW_CLASS) return false
        builder.advanceLexer()
        parseInterfaceOrClass()
        m.done(DlangTypes.CLASS_DECLARATION)
        return true
    }

    /**
     * Parses a CmpExpression
     *
     *
     * $(GRAMMAR $(RULEDEF cmpExpression):
     * $(RULE shiftExpression)
     * | $(RULE equalExpression)
     * | $(RULE identityExpression)
     * | $(RULE relExpression)
     * | $(RULE inExpression)
     * ;)
     */
    fun parseCmpExpre


jU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGltdWxoOiBmdW5jdGlvbiBpbXVsaCh1LCB2KSB7XG4gICAgdmFyIFVJTlQxNiA9IDB4ZmZmZjtcbiAgICB2YXIgJHUgPSArdTtcbiAgICB2YXIgJHYgPSArdjtcbiAgICB2YXIgdTAgPSAkdSAmIFVJTlQxNjtcbiAgICB2YXIgdjAgPSAkdiAmIFVJTlQxNjtcbiAgICB2YXIgdTEgPSAkdSA+PiAxNjtcbiAgICB2YXIgdjEgPSAkdiA+PiAxNjtcbiAgICB2YXIgdCA9ICh1MSAqIHYwID4+PiAwKSArICh1MCAqIHYwID4+PiAxNik7XG4gICAgcmV0dXJuIHUxICogdjEgKyAodCA+PiAxNikgKyAoKHUwICogdjEgPj4+IDApICsgKHQgJiBVSU5UMTYpID4+IDE2KTtcbiAgfVxufSk7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/core-js/modules/es7.math.imulh.js\n");

/***/ }),

/***/ "./node_modules/core-js/modules/es7.math.isubh.js":
/*!********************************************************!*\
  !*** ./node_modules/core-js/modules/es7.math.isubh.js ***!
  \********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(/*! ./_export */ \"./node_modules/core-js/modules/_export.js\");\n\n$export($export.S, 'Math', {\n  isubh: function isubh(x0, x1, y0, y1) {\n    var $x0 = x0 >>> 0;\n    var $x1 = x1 >>> 0;\n    var $y0 = y0 >>> 0;\n    return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n  }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLmlzdWJoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pc3ViaC5qcz8yZjc4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBz


a.603.603 0 0 0-.435.736l.842 3.11 2.432-1.379a.625.625 0 0 0 .308-.53l-.008-2.77zm8.61 0l-.007 2.768c0 .215.116.415.303.52l2.438 1.381.84-3.099a.603.603 0 0 0-.435-.737l-3.138-.832zM11.562 3.28L9.274 5.54l2.417 1.391a.605.605 0 0 0 .618 0l2.417-1.39-2.287-2.261a.626.626 0 0 0-.878 0z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E  %3Cpath fill='%23576B95' fill-rule='evenodd' d='M13.283 2.427l2.733 2.702 3.734.99a1.803 1.803 0 0 1 1.288 2.21l-1.001 3.691 1.001 3.691a1.802 1.802 0 0 1-1.286 2.208l-3.71.984-2.759 2.72a1.826 1.826 0 0 1-2.566 0L7.985 18.92l-3.735-.99a1.803 1.803 0 0 1-1.288-2.21l1-3.69-1-3.702A1.802 1.802 0 0 1 4.248 6.12l3.736-.992 2.733-2.701a1.826 1.826 0 0 1 2.566 0zm-1.592 14.691l-2.417 1.39 2.287 2.262c.242.24.636.24.879-.001l2.295-2.261-2.416-1.39a.621.621 0 0 0-.628 0zm-6.73-4.185l-.84 3.1c-.086.32.107.65.435.736l3.138.833.008-2.768a.598.598 0 0 0-.303-.52l-2.439-1.38zm14.078-.01l-2.433 1.38a.621.621 0 0 0-.308.52l.008 2.769 3.14-.833a.603.603 0 0 0 .434-.735l-.841-3.101zm-3.934-6.216l-2.193 1.262a1.8 1.8 0 0 1-1.821.001L8.895 6.707l.007 2.508c0 .643-.345 1.24-.903 1.569L5.8 12.029l2.187 1.24c.564.317.914.918.914 1.566l-.007 2.507 2.193-1.261a1.819 1.819 0 0 1 1.828-.004l2.188 1.259-.006-2.511c0-.636.347-1.232.903-1.56l2.2-1.245-2.187-1.24a1.797 1.797 0 0 1-.914-1.564l.007-2.508zm-7.41-.26l-3.14.833a.603.603 0 0 0-.435.736l.842 3.11 2.432-1.379a.625.625 0 0 0 .308-.53l-.008-2.77zm8.61 0l-.007 2.768c0 .215.116.415.303.52l2.438 1.381.84-3.099a.603.603 0 0 0-.435-.737l-3.138-.832zM11.562 3.28L9.274 5.54l2.417 1.391a.605.605 0 0 0 .618 0l2.417-1.39-2.287-2.261a.626.626 0 0 0-.878 0z'/%3E%3C/svg%3E"


 azprof::Servlet *servlet);
  static bool add(const char *path, int flags, azprof::Privilege, azprof::StatelessServlet::Function);
  static bool add0(
    const char *path, const char *category, const char *subcategory, int flags, azprof::Privilege,
    azprof::StatelessServlet::Function
  );
  static bool add(
    const char *path, const char *category, const char *subcategory, int flags, azprof::Privilege,
    azprof::StatelessServlet::Function
  );
  static bool add(const char *path, int flags, azprof::Privilege, XmlServletFunction);
  static bool add(
    const char *path, const char *category, const char *subcategory, int flags, azprof::Privilege, XmlServletFunction
  );

  HotSpotServlet(azprof::Servlet*);
  virtual void pre_service(azprof::Request*, azprof::Response*);
  virtual void service(azprof::Request*, azprof::Response*);
  virtual void post_service(azprof::Request*, azprof::Response*);

private:
  static void detach_callback(void*);

  static ArtaObjectPool* _object_pool;
  azprof::Servlet *_servlet;
};

class XmlServlet:public CHeapObj{
public:
  virtual void service(azprof::Request*, xmlBuffer*) = 0;
};

class StatelessXmlServlet : public XmlServlet {
public:
  StatelessXmlServlet(XmlServletFunction);

  virtual void service(azprof::Request*, xmlBuffer*);

private:
  XmlServletFunction _function;
};

class XmlServletAdapter : public azprof::Servlet {
public:
  XmlServletAdapter(int flags, azprof::Privilege required_privilege, XmlServlet *servlet);
  XmlServlet* servlet() {return _servlet;}
  virtual void service(azprof::Request*, azprof::Response*);
private:
  XmlServlet *_servlet;
};

#endif // AZ_PROFILER

#endif // ARTAQUERY_HPP
// Copyright 2010 Azul Systems, Inc.  All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 2 only, as published by
// the Free Software Foundation.
//
// This code is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.  See the GNU General Public License version 2 for  more
// details (a copy is included in the LICENSE file that accompanied this code).
//
// You should have received a copy of the GNU General Public License version 2
// along with this work; if not, write to the Free Software Foundation,Inc.,
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
//
// Please contact Azul Systems, Inc., 1600 Plymouth Street, Mountain View,
// CA 94043 USA, or visit www.azulsystems.com if you need additional information
// or have any questions.

#include "javaClasses.hpp"
#include "mutex.hpp"
#include "mutexLocker.hpp"
#include "os_os.hpp"
#include "oop.hpp"
#include "artaThreadState.hpp"
#include "systemDictionary.hpp"
#include "tickProfiler.hpp"
#include "thread.hpp"

#include "atomic_os_pd.inline.hpp"
#include "os_os.inline.hpp"
#include "oop.inline.hpp"
#include "mutex.inline.hpp"
#include "thread_os.inline.hpp"

////////////////////////////////////////////////////////////////////////////////
// ArtaThreadState
////////////////////////////////////////////////////////////////////////////////

const ArtaThreadState* const ArtaThreadState::NIL = (ArtaThreadState*) (uintptr_t) -1;

ArtaThreadState* ArtaThreadState::get(JavaThread *thread) {
ArtaThreadState*state=thread->arta_thread_state();
if(state==NIL){
    //


    --print(success, ast)
            if not success then
                print("ERROR MINIFYING LINE:")
                print("Message: " .. ast)
                print("Line: " .. w)
            end
            success, ast = loadstring(success)
            if not success then
                print("ERROR PARSING MINIFIED LINE:")
                print("Message: " .. ast)
                print("Line nr: " .. line_nr)
                print("Line: " .. w)
            end
            --print("Suceeded!")
        end
    end
end
print"Done!"
os.remove("tmp")

--[[
function readAll(file)
    local f = io.open(file, "rb")
    local content = f:read("*all")
    f:close()
    return content
end

local text = readAll('../ParseLua.lua')
local success, ast = Parser.ParseLua(text)
local nice
nice = Format_Mini(ast)
print(nice)
--]]


import pytest

from pipelex import log
from pipelex.core.concepts.concept_blueprint import ConceptBlueprint
from pipelex.libraries.pipelines.builder.concept.concept_spec import ConceptSpec
from tests.unit.pipelex.libraries.pipelines.builder.concept.test_data import ConceptBlueprintTestCases, ConceptCodeValidationTestCases

class TestConceptBlueprintConversion:
    @pytest.mark.parametrize(
        ("topic", "concept_spec", "expected_core"),
        ConceptBlueprintTestCases.TEST_CASES,
    )
    def test_concept_to_core_blueprint(self, topic: str, concept_spec: ConceptSpec, expected_core: ConceptBlueprint):
        log.verbose(f"Testing {topic}")
        result = concept_spec.to_blueprint()
        assert result == expected_core

class TestConceptCodeValidation:
    """Tests for concept code validation and snake_case to PascalCase conversion."""

    @pytest.mark.parametrize(
        ("topic", "input_code", "expected_code"),
        ConceptCodeValidationTestCases.TEST_CASES,
    )
    def test_concept_code_conversion(self, topic: str, input_code: str, expected_code: str):
        log.verbose(f"Testing {topic}: '{input_code}' -> '{expected_code}'")

        # Create a ConceptSpec with the input code
        concept_spec = ConceptSpec(
            the_concept_code=input_code,
            description="Test concept for code validation",
            refines=None,
            structure=None,
        )

        # Verify the concept code was converted correctly
        assert concept_spec.the_concept_code == expected_code, (
            f"Expected concept code to be '{expected_code}', but got '{concept_spec.the_concept_code}'"
        )


("\t[-kill <job-id>]\n");
      System.err.printf("\t[-set-priority <job-id> <priority>]. " +
                                      "Valid values for priorities are: " +
                                      jobPriorityValues + "\n");
      System.err.printf("\t[-events <job-id> <from-event-#> <#-of-events>]\n");
      System.err.printf("\t[-history <jobOutputDir>]\n");
      System.err.printf("\t[-list [all]]\n");
      System.err.printf("\t[-list-active-trackers]\n");
      System.err.printf("\t[-list-blacklisted-trackers]\n");
      System.err.printf("\t[-list-trackers]\n");
      System.err.println("\t[-list-attempt-ids <job-id> <task-type> " +
      		"<task-state>]\n");
      System.err.printf("\t[-kill-task <task-id>]\n");
      System.err.printf("\t[-fail-task <task-id>]\n\n");
      ToolRunner.printGenericCommandUsage(System.out);
    }
  }

  public int run(String[] argv) throws Exception {
    int exitCode = -1;
    if (argv.length < 1) {
      displayUsage("");
      return exitCode;
    }
    // process arguments
    String cmd = argv[0];
    String submitJobFile = null;
    String jobid = null;
    String taskid = null;
    String outputDir = null;
    String counterGroupName = null;
    String counterName = null;
    String newPriority = null;
    String taskType = null;
    String taskState = null;
    int fromEvent = 0;
    int nEvents = 0;
    boolean getStatus = false;
    boolean getCounter = false;
    boolean killJob = false;
    boolean listEvents = false;
    boolean viewHistory = false;
    boolean viewAllHistory = false;
    boolean listJobs = false;
    boolean listAllJobs = false;
    boolean listActiveTrackers = false;
    boolean listBlacklistedTrackers = false;
    boolean listTrackers = false;
    boolean displayTasks = false;
    boolean killTask = false;
    boolean failTask = false;
    boolean setJobPriority = false;

    if ("-submit".equals(cmd)) {
      if (argv.length != 2) {
        displayUsage(cmd);
        return exitCode;
      }
      submitJobFile = argv[1];
    } else if ("-status".equals(cmd)) {
      if (argv.length != 2) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = argv[1];
      getStatus = true;
    } else if("-counter".equals(cmd)) {
      if (argv.length != 4) {
        displayUsage(cmd);
        return exitCode;
      }
      getCounter = true;
      jobid = argv[1];
      counterGroupName = argv[2];
      counterName = argv[3];
    } else if ("-kill".equals(cmd)) {
      if (argv.length != 2) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = argv[1];
      killJob = true;
    } else if ("-set-priority".equals(cmd)) {
      if (argv.length != 3) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = argv[1];
      newPriority = argv[2];
      try {
        JobPriority jp = JobPriority.valueOf(newPriority);
      } catch (IllegalArgumentException iae) {
        displayUsage(cmd);
        return exitCode;
      }
      setJobPriority = true;
    } else if ("-events".equals(cmd)) {
      if (argv.length != 4) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = argv[1];
      fromEvent = Integer.parseInt(argv[2


tus(1)
        logging.info(__name__ + ' : Setting Helium Probe in SLOW rate')
        self._execute('S1')
        self.set_remote_status(3)

    def set_to_fast(self):
        """
        Set helium meter channel 1 to fast mode.
        """
        self.set_remote_status(1)
        logging.info(__name__ + ' : Setting Helium Probe in FAST rate')
        self._execute('T1')
        self.set_remote_status(3)

    def _do_set_rate(self, rate):
        """
        Set helium meter channel 1 probe rate

        Args:
            rate(int) :
            0 : "SLOW"
            1 : "FAST"
        """
        self.set_remote_status(1)
        if rate == 0:
            self.set_to_slow()
        elif rate == 1:
            self.set_to_fast()
        self.set_remote_status(3)
        logging.info(self._do_get_rate())


 -s {:?} {:?}", &source, &target)).working_dir(&working_dir))
    }
}

pub fn in_temp_dir(work: &mut dyn FnMut(&Path) -> FailableUnit) -> FailableUnit {
    let temp = tempfile::Builder::new().prefix("crust").tempdir()?;
    work(&temp.path())
}

pub fn write_bytes(content: &[u8], path: &PathBuf) -> FailableUnit {
    let parent = path.parent().ok_or("Parent directory not found")?;
    std::fs::create_dir_all(parent)?;

    let mut file = File::create(path)?;
    file.write_all(content)?;

    Ok(())
}

pub fn write_string(content: &str, path: &PathBuf) -> FailableUnit {
    write_bytes(content.as_bytes(), path)?;
    Ok(())
}

#[cfg(target_os = "windows")]
pub fn apply_permissions(_: &PathBuf, _: u32) -> FailableUnit {
    // On Windows this is a no-op but we will leave it stubbed so we can cross compile easily.
    Ok(())
}

#[cfg(not(target_os = "windows"))]
pub fn apply_permissions(path: &PathBuf, permissions: u32) -> FailableUnit {
    use std::os::unix::fs::PermissionsExt;
    Ok(std::fs::set_permissions(&path, std::fs::Permissions::from_mode(permissions))?)
}

pub fn copy(source: &PathBuf, destination: &PathBuf) -> FailableUnit {
    if source.is_dir() {
        if cfg!(target_os = "windows") {
            scripts::run(&Script::new(&format!(
                "xcopy /E /H /I {:?} {:?}",
                &source,
                &destination.join(source.file_name().ok_or("Missing file name")?)
            )))?;
        } else {
            scripts::run(&Script::new(&format!("cp -R {:?} {:?}", &source, &destination)))?;
        }
    } else {
        std::fs::copy(source, destination)?;
    }

    Ok(())
}

pub fn create_dir(path: &PathBuf) -> FailableUnit {
    std::fs::create_dir_all(path)?;

    Ok(())
}

pub fn delete(victim: &PathBuf) -> FailableUnit {
    logs::out(log_tag!(), &format!("Deleting {:?}", victim));

    // We need to also check if we are trying to delete a symlink by querying for link meta data.
    // The regular `.exists` method will return false even if the victim is a broken symlink.
    let is_symlink = std::fs::read_link(&victim).is_ok();

    if !is_symlink && !victim.exists() {
        return Ok(());
    }

    if victim.is_dir() || is_symlink {
        std::fs::remove_dir_all(victim)?;
    } else {
        std::fs::remove_file(victim)?;
    }

    Ok(())
}

pub fn rename(source: &PathBuf, destination: &PathBuf) -> FailableUnit {
    logs::out(log_tag!(), &format!("Renaming: {:?} => {:?}", source, destination));

    std::fs::rename(source, destination)?;
    Ok(())
}

pub fn unzip(source: &PathBuf, destination: &PathBuf) -> FailableUnit {
    logs::out(log_tag!(), &format!("Unzipping: {:?} => {:?}", source, destination));

    create_dir(destination)?;

    let zip_file = File::open(&source)?;
    let mut archive = zip::ZipArchive::new(zip_file)?;

    for i in 0..archive.len() {
        let mut file = archive.by_index(i)?;
        let outpath = match file.enclosed_name() {
            Some(path) => destination.join(path.to_owned()),
            None => continue,
        };

        if (&*file.na


/*
 * Wslay - The WebSocket Library
 *
 * Copyright (c) 2011, 2012 Tatsuhiro Tsujikawa
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#ifndef WSLAY_EVENT_TEST_H
#define WSLAY_EVENT_TEST_H

void test_wslay_event_send_fragmented_msg(void);
void test_wslay_event_send_fragmented_msg_empty_data(void);
void test_wslay_event_send_fragmented_msg_with_ctrl(void);
void test_wslay_event_send_fragmented_msg_with_rsv1(void);
void test_wslay_event_send_msg_with_rsv1(void);
void test_wslay_event_send_ctrl_msg_first(void);
void test_wslay_event_send_ctrl_msg_with_rsv1(void);
void test_wslay_event_queue_close(void);
void test_wslay_event_queue_close_without_code(void);
void test_wslay_event_recv_close_without_code(void);
void test_wslay_event_reply_close(void);
void test_wslay_event_no_more_msg(void);
void test_wslay_event_callback_failure(void);
void test_wslay_event_no_buffering(void);
void test_wslay_event_recv_text_frame_with_rsv1(void);
void test_wslay_event_frame_too_big(void);
void test_wslay_event_message_too_big(void);
void test_wslay_event_config_set_allowed_rsv_bits(void);
void test_wslay_event_write_fragmented_msg(void);
void test_wslay_event_write_fragmented_msg_empty_data(void);
void test_wslay_event_write_fragmented_msg_with_ctrl(void);
void test_wslay_event_write_fragmented_msg_with_rsv1(void);
void test_wslay_event_write_msg_with_rsv1(void);
void test_wslay_event_write_ctrl_msg_first(void);

#endif /* WSLAY_EVENT_TEST_H */


_index) = indices.binary_search_by(|&x| x.cmp(&self.minor_index)) {
                let entry = &data[local_index];
                result = Some((self.current_major_index, entry));

                self.current_major_index += 1;
                break;
            } else {
                self.current_major_index += 1;
            }
        }

        result
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::{error::*, proptest::*};
    use nalgebra::{DMatrix, SMatrix};
    use proptest::prelude::*;

    #[test]
    fn matrix_has_valid_data() {
        const NROWS: usize = 6;
        const NCOLS: usize = 3;
        const NNZ: usize = 5;

        const OFFSETS: [usize; NCOLS] = [0, 2, 2];
        const INDICES: [usize; NNZ] = [0, 5, 1, 2, 3];
        const DATA: [usize; NNZ] = [0, 1, 2, 3, 4];

        let mat = CscMatrix::try_from_parts(
            NROWS,
            NCOLS,
            OFFSETS.to_vec(),
            INDICES.to_vec(),
            DATA.to_vec(),
        )
        .unwrap();

        assert_eq!(NROWS, mat.nrows());
        assert_eq!(NCOLS, mat.ncols());
        assert_eq!(5, mat.nnz());

        let (mo, mi, d) = mat.cs_data();

        assert_eq!(mo, &OFFSETS);
        assert_eq!(mi, &INDICES);
        assert_eq!(d, &DATA);

        assert_eq!(mi.len(), mat.nnz());
        assert_eq!(d.len(), mat.nnz());

        const EXPECTED_TRIPLETS: [(usize, usize, usize); NNZ] =
            [(0, 0, 0), (0, 5, 1), (2, 1, 2), (2, 2, 3), (2, 3, 4)];

        assert!(mat.triplet_iter().zip(EXPECTED_TRIPLETS).all(
            |((major, minor, &val), (expected_major, expected_minor, expected_value))| {
                major == expected_major && minor == expected_minor && val == expected_value
            }
        ));

        let mat_iter = mat.iter();

        assert_eq!(NCOLS, mat_iter.len());

        for lane in mat_iter {
            assert!(lane.len() <= NROWS);
        }

        assert_eq!(NROWS, mat.minor_lane_iter().len());

        let (mo, mi, d) = mat.disassemble();

        assert_eq!(&mo, &OFFSETS);
        assert_eq!(&mi, &INDICES);
        assert_eq!(&d, &DATA);
    }

    #[test]
    fn empty_matrix_does_not_panic() {
        // An empty 0x0 matrix doesn't make a lot of sense in practical usage but there's no reason
        // it can't exist.
        let mat =
            CscMatrix::try_from_parts(0, 0, Vec::new(), Vec::new(), Vec::<u32>::new()).unwrap();

        assert_eq!(0, mat.nrows());
        assert_eq!(0, mat.ncols());
        assert_eq!(0, mat.nmajor());
        assert_eq!(0, mat.nminor());
        assert_eq!(0, mat.nnz());

        assert_eq!((0, 0), mat.shape());

        assert_eq!(0, mat.all_entries().len());
        assert!(mat.triplet_iter().next().is_none());
        assert_eq!(0, mat.iter().len());
        assert_eq!(0, mat.minor_lane_iter().len());
    }

    #[test]
    fn invalid_first_offset_fails_with_invalid_structure() {
        // Invalid first entry in offsets array; should be zero
        let offsets = vec![1, 2, 2];
        let indices = vec![0, 5, 1,


 float target_d = 45 - (msg->data.data[3] * (180/pi)); // Modified calculation for servo D

    // Apply smooth motion to each servo if change is significant
    if (fabs(target_a - current_pos.current_a) > 0.5) {
        smooth_servo_motion(&servo_a, current_pos.current_a, target_a);
        current_pos.current_a = target_a;
    }

    if (fabs(target_b - current_pos.current_b) > 0.5) {
        smooth_servo_motion(&servo_b, current_pos.current_b, target_b);
        current_pos.current_b = target_b;
    }

    if (fabs(target_c - current_pos.current_c) > 0.5) {
        smooth_servo_motion(&servo_c, current_pos.current_c, target_c);
        current_pos.current_c = target_c;
    }

    if (fabs(target_d - current_pos.current_d) > 0.5) {
        smooth_servo_motion(&servo_d, current_pos.current_d, target_d);
        current_pos.current_d = target_d;
    }
}

void micro_ros_task(void * arg)
{
    printf("Starting micro-ROS task\n");
    memset(test_array, 'z', ARRAY_LEN);
    rcl_allocator_t allocator = rcl_get_default_allocator();
    rclc_support_t support;

    // Enable servo and initialize current positions
    enable_servo();
    current_pos.current_a = read_servo(&servo_a);
    current_pos.current_b = read_servo(&servo_b);
    current_pos.current_c = read_servo(&servo_c);
    current_pos.current_d = read_servo(&servo_d);

    // Create init_options
    rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
    RCCHECK(rcl_init_options_init(&init_options, allocator));

    #ifdef CONFIG_MICRO_ROS_ESP_XRCE_DDS_MIDDLEWARE
    rmw_init_options_t* rmw_options = rcl_init_options_get_rmw_init_options(&init_options);
    RCCHECK(rmw_uros_options_set_udp_address(CONFIG_MICRO_ROS_AGENT_IP, CONFIG_MICRO_ROS_AGENT_PORT, rmw_options));
    #endif

    // Setup support structure
    RCCHECK(rclc_support_init_with_options(&support, 0, NULL, &init_options, &allocator));

    // Create node
    rcl_node_t node = rcl_get_zero_initialized_node();
    RCCHECK(rclc_node_init_default(&node, "Set_servo_angles", "", &support));

    // Create subscriber
    RCCHECK(rclc_subscription_init_default(
        &subscriber,
        &node,
        ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Float64MultiArray),
        "/forward_position_controller/commands"));

    // Create executor
    rclc_executor_t executor = rclc_executor_get_zero_initialized_executor();
    RCCHECK(rclc_executor_init(&executor, &support.context, 2, &allocator));

    unsigned int rcl_wait_timeout = 1000;   // in ms
    RCCHECK(rclc_executor_set_timeout(&executor, RCL_MS_TO_NS(rcl_wait_timeout)));

    RCCHECK(rclc_executor_add_subscription(&executor, &subscriber, &recv_msg, &subscription_callback, ON_NEW_DATA));

    // Allocate memory for received message
    recv_msg.data.data = (double*) malloc(ARRAY_LEN);
    recv_msg.data.size = 0;
    recv_msg.data.capacity = ARRAY_LEN;

    // Spin forever
    rclc_executor_spin(&executor);

    // Cleanup
    RCCHECK(rcl_subscription_fini(&subscriber, &node));
    RCCHECK(rcl_node_fini(&node));

    vTaskDelete(NULL);
}

void app_main(void)
{
    #if defined(CONFIG_MICRO_ROS_ESP_NETIF_WLAN) || defined(CONFIG_MICRO_ROS_ESP_NETIF_ENET)
    ESP_ERROR_CHECK(uros_network_interface_initialize());
    #endif

    xTaskCreate(micro_ros_task,
            "uros_task",
            CONFIG_MICRO_ROS_APP_STACK,
            NULL,
            CONFIG_MICRO_ROS_APP_TASK_PRIO,
            NULL);
}


# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import test_program_without_code_operations
from . import test_program_with_code_operations
from . import test_program_rules
from . import test_program_numbers
from . import test_program_multi_company
from . import test_sale_invoicing


("027ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid3 = UUID.fromString("037ba5ca-aa12-4afa-9219-e20cc3018599")

        realm.executeTransaction { realm ->
            realm.createObject<UUIDAndString>().id = uuid2
            realm.createObject<UUIDAndString>().id = null
            realm.createObject<UUIDAndString>().id = uuid3
            realm.createObject<UUIDAndString>().id = uuid1
        }

        val all = realm.where<UUIDAndString>()
                .greaterThanOrEqualTo("id", uuid2)
                .sort("id", Sort.ASCENDING)
                .findAll()

        assertEquals(2, all.size)
        assertEquals(uuid2, all[0]!!.id)
        assertEquals(uuid3, all[1]!!.id)
    }

    @Test
    fun queriesGreaterThan() {
        val uuid1 = UUID.fromString("017ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid2 = UUID.fromString("027ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid3 = UUID.fromString("037ba5ca-aa12-4afa-9219-e20cc3018599")

        realm.executeTransaction { realm ->
            realm.createObject<UUIDAndString>().id = uuid2
            realm.createObject<UUIDAndString>().id = null
            realm.createObject<UUIDAndString>().id = uuid3
            realm.createObject<UUIDAndString>().id = uuid1
        }

        val all = realm.where<UUIDAndString>()
                .greaterThan("id", uuid2)
                .sort("id", Sort.ASCENDING)
                .findAll()

        assertEquals(1, all.size)
        assertEquals(uuid3, all[0]!!.id)
    }

    @Test
    fun queriesLessThanOrEqualTo() {
        val uuid1 = UUID.fromString("017ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid2 = UUID.fromString("027ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid3 = UUID.fromString("037ba5ca-aa12-4afa-9219-e20cc3018599")

        realm.executeTransaction { realm ->
            realm.createObject<UUIDAndString>().id = uuid2
            realm.createObject<UUIDAndString>().id = null
            realm.createObject<UUIDAndString>().id = uuid3
            realm.createObject<UUIDAndString>().id = uuid1
        }

        val all = realm.where<UUIDAndString>()
                .lessThanOrEqualTo("id", uuid2)
                .sort("id", Sort.ASCENDING)
                .findAll()

        assertEquals(2, all.size)
        assertEquals(uuid1, all[0]!!.id)
        assertEquals(uuid2, all[1]!!.id)
    }

    @Test
    fun queriesLessThan() {
        val uuid1 = UUID.fromString("017ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid2 = UUID.fromString("027ba5ca-aa12-4afa-9219-e20cc3018599")
        val uuid3 = UUID.fromString("037ba5ca-aa12-4afa-9219-e20cc3018599")

        realm.executeTransaction { realm ->
            realm.createObject<UUIDAndString>().id = uuid2
            realm.createObject<UUIDAndString>().id = null
            realm.createObject<UUIDAndString>().id = uuid3
            realm.createObject<UUIDAndString>().id = uuid1
        }

        val all = realm.where<UUIDAndString>()
                .lessThan("id", uuid2)
                .sor


         "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Gateways",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 3,
        "w": 6,
        "x": 18,
        "y": 6
      },
      "id": 116,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(galley_istio_authentication_meshpolicies) / count(up{job=\"galley\"})",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "Authentication Mesh Policies",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "columns": [],
      "datasource": "Prometheus",
      "fontSize": "100%",
      "gridPos": {
        "h": 21,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "hideTimeOverride": false,
      "id": 73,
      "links": [],
      "pageSize": null,
      "repeat": null,
      "repeatDirection": "v",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 4,
        "desc": true
      },
      "styles": [
        {
          "alias": "Workload",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",


(tp, 0x06, 0xa725);
        rtl8168_mdio_write(tp, 0x06, 0xe50a);
        rtl8168_mdio_write(tp, 0x06, 0x1de5);
        rtl8168_mdio_write(tp, 0x06, 0x0a2c);
        rtl8168_mdio_write(tp, 0x06, 0xe50a);
        rtl8168_mdio_write(tp, 0x06, 0x6de5);
        rtl8168_mdio_write(tp, 0x06, 0x0a1d);
        rtl8168_mdio_write(tp, 0x06, 0xe50a);
        rtl8168_mdio_write(tp, 0x06, 0x1ce5);
        rtl8168_mdio_write(tp, 0x06, 0x0a2d);
        rtl8168_mdio_write(tp, 0x06, 0xa755);
        rtl8168_mdio_write(tp, 0x05, 0x8b64);
        rtl8168_mdio_write(tp, 0x06, 0x0000);
        rtl8168_mdio_write(tp, 0x05, 0x8b94);
        rtl8168_mdio_write(tp, 0x06, 0x82cd);
        rtl8168_mdio_write(tp, 0x05, 0x8b85);
        rtl8168_mdio_write(tp, 0x06, 0x2000);
        rtl8168_mdio_write(tp, 0x05, 0x8aee);
        rtl8168_mdio_write(tp, 0x06, 0x03b8);
        rtl8168_mdio_write(tp, 0x05, 0x8ae8);
        rtl8168_mdio_write(tp, 0x06, 0x0002);
        gphy_val = rtl8168_mdio_read(tp, 0x01);
        gphy_val |= BIT_0;
        rtl8168_mdio_write(tp, 0x01, gphy_val);
        gphy_val = rtl8168_mdio_read(tp, 0x00);
        gphy_val |= BIT_0;
        rtl8168_mdio_write(tp, 0x00, gphy_val);
        rtl8168_mdio_write(tp, 0x1f, 0x0000);
        rtl8168_mdio_write(tp, 0x1f, 0x0005);
        for (i = 0; i < 200; i++) {
                udelay(100);
                gphy_val = rtl8168_mdio_read(tp, 0x00);
                if (gphy_val & BIT_7)
                        break;
        }
        rtl8168_mdio_write(tp, 0x1f, 0x0007);
        rtl8168_mdio_write(tp, 0x1e, 0x0023);
        gphy_val = rtl8168_mdio_read(tp, 0x17);
        gphy_val &= ~(BIT_0);
        if (tp->RequiredSecLanDonglePatch)
                gphy_val &= ~(BIT_2);
        rtl8168_mdio_write(tp, 0x17, gphy_val);
        rtl8168_mdio_write(tp, 0x1f, 0x0007);
        rtl8168_mdio_write(tp, 0x1e, 0x0028);
        rtl8168_mdio_write(tp, 0x15, 0x0010);
        rtl8168_mdio_write(tp, 0x1f, 0x0007);
        rtl8168_mdio_write(tp, 0x1e, 0x0041);
        rtl8168_mdio_write(tp, 0x15, 0x0802);
        rtl8168_mdio_write(tp, 0x16, 0x2185);
        rtl8168_mdio_write(tp, 0x1f, 0x0000);
}

static void
rtl8168_set_phy_mcu_8168e_2(struct net_device *dev)
{
        struct rtl8168_private *tp = netdev_priv(dev);
        unsigned int gphy_val,i;

        if (rtl8168_efuse_read(tp, 0x22) == 0x0c) {
                rtl8168_mdio_write(tp, 0x1f, 0x0000);
                rtl8168_mdio_write(tp, 0x00,


      --input_path="/path/to/ch4_training_localization_transcription_gt" \
                    --output_label="/path/to/train_icdar2015_label.txt"
```

解压数据集和下载标注文件后，PaddleOCR/train_data/ 有两个文件夹和两个文件，按照如下方式组织icdar2015数据集：

```text linenums="1"
/PaddleOCR/train_data/icdar2015/text_localization/
  └─ icdar_c4_train_imgs/         icdar 2015 数据集的训练数据
  └─ ch4_test_images/             icdar 2015 数据集的测试数据
  └─ train_icdar2015_label.txt    icdar 2015 数据集的训练标注
  └─ test_icdar2015_label.txt     icdar 2015 数据集的测试标注
```

## 2. 文本识别

### 2.1 PaddleOCR 文字识别数据格式

PaddleOCR 中的文字识别算法支持两种数据格式:

- `lmdb` 用于训练以lmdb格式存储的数据集，使用 [lmdb_dataset.py](../../../ppocr/data/lmdb_dataset.py) 进行读取;
- `通用数据` 用于训练以文本文件存储的数据集，使用 [simple_dataset.py](../../../ppocr/data/simple_dataset.py)进行读取。

下面以通用数据集为例， 介绍如何准备数据集：

#### 训练集

建议将训练图片放入同一个文件夹，并用一个txt文件（rec_gt_train.txt）记录图片路径和标签，txt文件里的内容如下:

**注意：** txt文件中默认请将图片路径和图片标签用 \t 分割，如用其他方式分割将造成训练报错。

```text linenums="1"
" 图像文件名                 图像标注信息 "

train_data/rec/train/word_001.jpg   简单可依赖
train_data/rec/train/word_002.jpg   用科技让复杂的世界更简单
...
```

最终训练集应有如下文件结构：

```text linenums="1"
|-train_data
  |-rec
    |- rec_gt_train.txt
    |- train
        |- word_001.png
        |- word_002.jpg
        |- word_003.jpg
        | ...
```

除上述单张图像为一行格式之外，PaddleOCR也支持对离线增广后的数据进行训练，为了防止相同样本在同一个batch中被多次采样，我们可以将相同标签对应的图片路径写在一行中，以列表的形式给出，在训练中，PaddleOCR会随机选择列表中的一张图片进行训练。对应地，标注文件的格式如下：

```text linenums="1"
["11.jpg", "12.jpg"]   简单可依赖
["21.jpg", "22.jpg", "23.jpg"]   用科技让复杂的世界更简单
3.jpg   ocr
```

上述示例标注文件中，"11.jpg"和"12.jpg"的标签相同，都是`简单可依赖`，在训练的时候，对于该行


idsperiode.fom !== undefined &&
        tidsperiode.tom !== undefined &&
        dayjs(tidsperiode.fom).isSameOrBefore(tidsperiode.tom, 'day')
    );
};

const getUkedag = (dato: Date): number => {
    return dayjs(dato).isoWeekday();
};

const erUttaksdag = (dato: Date): boolean => {
    return getUkedag(dato) !== 6 && getUkedag(dato) !== 7;
};

export const getAntallUttaksdagerITidsperiode = (tidsperiode: TidsperiodeDate): number => {
    if (!isValidTidsperiode(tidsperiode)) {
        return 0;
    }

    let fom = dayjs(tidsperiode.fom);
    const tom = dayjs(tidsperiode.tom);
    let antall = 0;

    while (fom.isSameOrBefore(tom, 'day')) {
        if (erUttaksdag(fom.toDate())) {
            antall++;
        }
        fom = fom.add(24, 'hours');
    }

    return antall;
};

export const ISOStringToDate = (dateString: string | undefined): Date | undefined => {
    if (dateString === undefined) {
        return undefined;
    }
    if (isISODateString(dateString) && dayjs(dateString, 'YYYY-MM-DD', true).isValid()) {
        return dayjs.utc(dateString).toDate();
    }
    return undefined;
};

export const getErDatoInnenEnDagFraAnnenDato = (dato1: Date | undefined, dato2: Date | undefined): boolean => {
    if (dato1 === undefined || dato2 === undefined) {
        return false;
    }
    return (
        dayjs(dato1).isSameOrAfter(dayjs(dato2).subtract(1, 'day'), 'day') &&
        dayjs(dato1).isSameOrBefore(dayjs(dato2).add(1, 'day'), 'day')
    );
};
/**
 * Last In First out (LIFO) with O(1) key operations
 */

export class Stack<T> {
  private data: T[] = [];

  /** Adds item in O(1) */
  push(item: T): void {
    this.data.push(item);
  }

  /**
   * Pops the last inserted item in O(1)
   * If there are no more items returns undefined
   */

  pop(): T | undefined {
    return this.data.pop();
  }

  /**
   * Returns the number of elements in the stack in O(1)
   */
  size(): number {
    return this.data.length;
  }
}
/**
 * It is the top-level interface for storing data.
 */
export interface Store {
  /**
   * add the store item
   *
   * @param key
   * @param value
   */
  set(key: any, value: any): void;

  /**
   * reading the store item
   *
   * @param key
   */
  get(key: any): any;

  /**
   * removing the store item
   *
   * @param key
   */
  remove(key: any): void;

  /**
   * clear all items
   */
  clear(): void;
}
import { Mutation } from "vuex";

import { Note } from "../../services/notes/model";
import { RootStore } from "../model/rootstore";

export const SAVE_NOTE_MUTATION = "save-note";

export interface SaveNotePayload {
  type: "save-note";
  note: Note;
}

export const saveNoteMutation: Mutation<RootStore> = (
  state,
  payload: SaveNotePayload
) => {
  if (state.selectedIndex == null) {
    state.notes.push({ ...payload.note });
  } else {
    Object.assign(state.notes[state.selectedIndex], payload


#pragma once
#include "UI\UIButtonImage.h"
#include "UI\UIText.h"
#include <math.h>

namespace Kigs
{

	namespace Gps
	{
		// ****************************************
		// * UIPointInteret class
		// * --------------------------------------
		/**
		* \file	UIPointInteret.h
		* \class	UIPointInteret
		* \ingroup Geoloc
		* \brief	 An UIPointInteret is placed on the map to mark an point of interest
		* \author	Knig Jolan
		* \version ukn
		* \date	14/02/16
		*
		* The point is placed with GPS coordonates, it is represented by an image. You can choose the condition of activation (distance with user or click on the point),
		* and the actions (stack the sequence, show pop up, or show vignette).
		*
		*/
		// ****************************************

		class PointInteretVignette;

		class UIPointInteret :
			public UIButtonImage
		{
		public:
			DECLARE_CLASS_INFO(UIPointInteret, UIButtonImage, 2DLayers);

			UIPointInteret(const std::string& name, DECLARE_CLASS_NAME_TREE_ARG);
			void ActivePoint(bool);
			void ActivePoint(double, double);
			bool Get_VignetteIsHidden();
			double DistanceToUser(double _lat, double _long);
			void Get_TitleAndDescription(std::string& title, std::string& Desc) { title = mNameOfInterestPoint; Desc = mDescriptionOfInterestPoint; }

			bool ClickAction(CoreModifiable* sender, usString param);
			WRAP_METHODS(ClickAction);

		protected:

			void NotifyUpdate(const unsigned int /* labelid */)override;
			void InitModifiable()override;
			//bool TriggerMouseClick(int buttonState, int buttonEvent, int X, int Y, bool & catchClick)override;
			DECLARE_VIRTUAL_METHOD(HideVignette);
			COREMODIFIABLE_METHODS(HideVignette);
			virtual  void SetParent(CoreModifiable* value);

			SP<UIText> mNameText;

			SP<PointInteretVignette> mVignette;
			maString mVignetteParameters;

			void RecalculatePosition();

			maDouble mCoordGPS_Lat;
			maDouble mCoordGPS_Long;

			maString mNameOfInterestPoint;
			maString mDescriptionOfInterestPoint;

			maString mConditionOfActivation;
			maInt mDistanceOfActivation;

			maString mActionOfActivation;
			maString mActionOfDeactivation;
			maUSString mParameterOfActivation;
			maUSString mParameterOfDesactivation;

			maBool mShowTitle;
			maVect4DF mTitleColor;
			maString mTitleFontName;
			maInt mTitleFontSize;

			maBool mFeedbackOnActivation;

			bool mCanBeActivatedByClick;
			bool mIsTitleShown;
			bool mInactivate;
		};
	}
}


Schedulers.mainThread())
                .mapOrThrowApiException()
                .safeSubscribeBy {
                    (news as MutableLiveData).value = it
                }
    }

    // TODO NewsDownloadListener 接口会造成内存泄漏
    fun download(rxPermissions: RxPermissions, list: List<NewsAttachment>, listener: NewsDownloadListener) {
        checkPermission(rxPermissions) { isGranted ->
            if (isGranted) {
                listener.onDownloadStart()
                list.forEachIndexed { pos, it ->
                    DownloadManager.download(object : RedDownloadListener {
                        override fun onDownloadStart() {}
                        override fun onProgress(currentBytes: Long, contentLength: Long) {
                            listener.onProgress(pos, currentBytes, contentLength)
                        }

                        override fun onSuccess(uri: Uri?) {
                            listener.onDownloadEnd(pos, uri)
                        }

                        override fun onFail(e: Throwable) {
                            listener.onDownloadEnd(pos, e = e)
                        }
                    }, it.id, it.name)
                }
            } else {
                listener.onDownloadEnd(-1, e = Exception("permission deny"))
            }
        }
    }

    private fun checkPermission(rxPermissions: RxPermissions, result: (Boolean) -> Unit) {
        rxPermissions.request(WRITE_EXTERNAL_STORAGE).safeSubscribeBy(onNext = result)
    }

    interface NewsDownloadListener {
        fun onDownloadStart()
        fun onProgress(id: Int, currentBytes: Long, contentLength: Long)
        fun onDownloadEnd(id: Int, uri: Uri? = null, e: Throwable? = null)
    }
}package com.cyxbs.pages.noclass.bean

import com.cyxbs.pages.course.api.ICourseService
import com.cyxbs.pages.course.api.ILessonService
import java.io.Serializable

/**
 *
 * @ProjectName:    CyxbsMobile_Android
 * @Package:        com.cyxbs.pages.noclass.bean
 * @ClassName:      NoClassSpareTime
 * @Author:         Yan
 * @CreateDate:     2022年09月06日 23:43:00
 * @UpdateRemark:   更新说明：
 * @Version:        1.0
 * @Description:    用于记录所有人的没课情况
 */

data class NoClassSpareTime (   //todo 一周的空闲时间
    //记录一天的空闲时间
    val spareDayTime : HashMap<Int,SpareLineTime>
) : Serializable {

  companion object{
    val EMPTY_PAGE = HashMap<Int, NoClassSpareTime>().apply {
      (0 .. ICourseService.maxWeek).forEach{
        this[it] = getNewEmptySpareTime()
      }
    }
  }

  //一个学生的map 用于学号与姓名之间的转换
  var mIdToNameMap : HashMap<String,String> = hashMapOf()

  //记录从上当下一行的空闲时间
  data class SpareLineTime(  //todo 一天的空闲时间
    //此时有空闲时间的学号
    val SpareItem: ArrayList<SpareIds>,   //todo 对应一天格子的集合
  ): Serializable {
    //每格格子上空闲的人数
    data class SpareIds(
      val spareId : ArrayList<String>  //todo 每个格子的空闲的人数
    ) : Serializable
  }
}

  /**
   * 将返回出来的数据变为SpareTime格式
   *
   * @receiver key: 学号; value: 所有课程
   * @return key: 周数; value: 当前周的空闲时间
   */
fun Map<String, List<ILessonService.Lesson>>.toSpareTime() : HashMap<Int, NoClassSpareTime>{
  val studentSpareTimes: HashMap<Int, NoClassSpareTime> = HashMap()
  //所有学


:["Fib kanaal"]}},82330:e=>{e.exports={en:["Fib Circles"],nl_NL:["Fib cirkels"]}},55986:e=>{e.exports={en:["Fib Retracement"],nl_NL:["Fib teruggang"]}},33880:e=>{e.exports={en:["Fib Speed Resistance Arcs"],nl_NL:["Fib snelheid weerstandsbogen"]}},2395:e=>{e.exports={en:["Fib Speed Resistance Fan"],nl_NL:["Fib snelheid weerstandswaaier"]}},39014:e=>{e.exports={en:["Fib Spiral"],nl_NL:["Fib spiraal"]}},30622:e=>{e.exports={en:["Fib Time Zone"],nl_NL:["Fib tijdszone"]}},85042:e=>{e.exports={en:["Fib Wedge"],nl_NL:["Fib wig"]}},33885:e=>{e.exports={en:["Flag"],nl_NL:["Flag"]}},14600:e=>{e.exports={en:["Flag Mark"],nl_NL:["Vlag markering"]}},45051:e=>{e.exports={en:["Flat Top/Bottom"],nl_NL:["Vlakke top/bodem"]}},63271:e=>{e.exports={en:["Flipped"],nl_NL:["Omgedraaid"]}},39643:e=>{e.exports={en:["Fraction part is invalid."],nl_NL:["Fraction part is invalid."]}},24077:e=>{e.exports={en:["Fundamental studies are no longer available on charts"],
nl_NL:["Fundamental studies are no longer available on charts"]}},31561:e=>{e.exports={en:["Kolkata"],nl_NL:["Kolkata"]}},54533:e=>{e.exports={en:["Kathmandu"],nl_NL:["Kathmandu"]}},83490:e=>{e.exports={en:["Kagi"],nl_NL:["Kagi"]}},70913:e=>{e.exports={en:["Karachi"],nl_NL:["Karachi"]}},76614:e=>{e.exports={en:["Kuwait"],nl_NL:["Kuwait"]}},38561:e=>{e.exports={en:["Kuala Lumpur"],nl_NL:["Kuala Lumpur"]}},99906:e=>{e.exports={en:["HLC area"],nl_NL:["HLC area"]}},34491:e=>{e.exports={en:["Ho Chi Minh"],nl_NL:["Ho Chi Minh"]}},13459:e=>{e.exports={en:["Hollow candles"],nl_NL:["Lege candles"]}},48861:e=>{e.exports={en:["Hong Kong"],nl_NL:["Hong Kong"]}},79668:e=>{e.exports={en:["Honolulu"],nl_NL:["Honolulu"]}},21795:e=>{e.exports={en:["Horizontal Line"],nl_NL:["Horizontale lijn"]}},25487:e=>{e.exports={en:["Horizontal Ray"],nl_NL:["Horizontale straal"]}},21928:e=>{e.exports={en:["Head and Shoulders"],nl_NL:["Head and Shoulders"]}},63876:e=>{e.exports={en:["Heikin Ashi"],nl_NL:["Heikin Ashi"]}},48203:e=>{e.exports={en:["Helsinki"],nl_NL:["Helsinki"]}},27298:e=>{e.exports={en:["Hide"],nl_NL:["Verbergen"]}},47074:e=>{e.exports={en:["Hide all"],nl_NL:["Hide all"]}},52563:e=>{e.exports={en:["Hide all drawings"],nl_NL:["Hide all drawings"]}},90763:e=>{e.exports={en:["Hide all drawings and indicators"],nl_NL:["Hide all drawings and indicators"]}},18216:e=>{e.exports={en:["Hide all drawings, indicators, positions & orders"],nl_NL:["Hide all drawings, indicators, positions & orders"]}},78525:e=>{e.exports={en:["Hide all indicators"],nl_NL:["Hide all indicators"]}},42164:e=>{e.exports={en:["Hide all positions & orders"],nl_NL:["Hide all positions & orders"]}},3217:e=>{e.exports={en:["Hid


ClientProviderMockBuilder.builder()
            .url("$VALID_YAPI_SERVER${AbstractYapiApiHelper.GET_PROJECT_URL}?token=$VALID_TOKEN_1")
            .method("GET")
            .response(
                content = PROJECT_INFO,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${AbstractYapiApiHelper.GET_PROJECT_URL}?token=$VALID_TOKEN_2")
            .method("GET")
            .response(
                content = PROJECT_INFO_2,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${AbstractYapiApiHelper.GET_PROJECT_URL}?token=$INVALID_TOKEN")
            .method("GET")
            .response(
                content = CALL_FAILED,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${DefaultYapiApiHelper.GET_CAT_MENU}?project_id=$PROJECT_1&token=$VALID_TOKEN_1")
            .method("GET")
            .response(
                content = CART_MENU,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${DefaultYapiApiHelper.GET_CAT}?token=$VALID_TOKEN_1&catid=$CART_1&limit=1000")
            .method("GET")
            .response(
                content = LIST_CART_1,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${DefaultYapiApiHelper.SAVE_API}")
            .method("POST")
            .response(
                content = SAVE_OR_UPDATE_SUCCESS,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .url("$VALID_YAPI_SERVER${DefaultYapiApiHelper.ADD_CART}")
            .method("POST")
            .response(
                content = ADD_CART_SUCCESS,
                contentType = org.apache.http.entity.ContentType.APPLICATION_JSON
            )
            .build()
        httpClientProviderSpy = Mockito.spy<HttpClientProvider>(mockHttpClientProvider)
        builder.bind(HttpClientProvider::class) {
            it.toInstance(httpClientProviderSpy)
        }
    }

    @Test
    fun testGetProjectIdByToken() {
        // First call should make a real API call
        assertEquals(PROJECT_1, yapiApiHelper.getProjectIdByToken(VALID_TOKEN_1))

        verify(httpClientProviderSpy, times(1)).getHttpClient()

        // Second call should use the cached value
        assertEquals(PROJECT_1, yapiApiHelper.getProjectIdByToken(VALID_TOKEN_1))
        verify(httpClientProviderSpy, times(1)).getHttpClient() // Still only one call

        // Invalid token should return null consistently
        assertNull(yapiApiHelper.getProjectIdByToken(INVALID_TOKEN))
        assertNull(yapiApiHelper.getProjectIdByToken(INVALID_TOKEN))
    }

    @Test
    fun testFindCarts() {
        // First call should make a real API call
        val carts = yapiApiHelper.findCarts(PROJECT_1, VALID_TOKEN_1)
        assertNotNull(carts)
        assertEquals(4, carts.size)
        verify(httpClientProviderSpy, times(1)).getHttpClient()

        // Second call should use cached value
        val cachedCarts = yapiApiH


amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-entityresolution-matchingworkflow-inputsource.html#cfn-entityresolution-matchingworkflow-inputsource-schemaarn
	//
	SchemaArn *string `field:"required" json:"schemaArn" yaml:"schemaArn"`
	// Normalizes the attributes defined in the schema in the input data.
	//
	// For example, if an attribute has an `AttributeType` of `PHONE_NUMBER` , and the data in the input table is in a format of 1234567890, AWS Entity Resolution will normalize this field in the output to (123)-456-7890.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-entityresolution-matchingworkflow-inputsource.html#cfn-entityresolution-matchingworkflow-inputsource-applynormalization
	//
	ApplyNormalization interface{} `field:"optional" json:"applyNormalization" yaml:"applyNormalization"`
}

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package ctl

import (
	"bufio"
	"fmt"
	"image"
	"image/color"
	"image/png"
	"math"
	"os"
	"strings"

	"github.com/awslabs/diagram-as-code/internal/cache"
	"github.com/awslabs/diagram-as-code/internal/definition"
	"github.com/awslabs/diagram-as-code/internal/types"
	log "github.com/sirupsen/logrus"
	"golang.org/x/exp/maps"
	"golang.org/x/image/draw"
)

func stringToColor(c string) (color.RGBA, error) {
	var r, g, b, a uint8
	_, err := fmt.Sscanf(c, "rgba(%d,%d,%d,%d)", &r, &g, &b, &a)
	if err != nil {
		return color.RGBA{}, fmt.Errorf("failed to parse color string '%s': %w", c, err)
	}
	return color.RGBA{r, g, b, a}, nil
}

// OverwriteMode defines how to handle existing output files
type OverwriteMode int

const (
	// Ask shows confirmation prompt when output file exists (CLI default)
	Ask OverwriteMode = iota
	// Force overwrites without confirmation (CLI with --force)
	Force
	// NoOverwrite refuses to overwrite and returns error (MCP server default)
	NoOverwrite
)

// CheckOutputFileOverwrite checks if output file exists and handles according to mode
func CheckOutputFileOverwrite(outputFile string, mode OverwriteMode) error {
	// Check if file exists
	if _, err := os.Stat(outputFile); os.IsNotExist(err) {
		// File doesn't exist, proceed
		return nil
	} else if err != nil {
		// Some other error occurred
		return fmt.Errorf("failed to check output file: %w", err)
	}

	// File exists, handle according to mode
	switch mode {
	case Force:
		// Force mode: proceed without confirmation
		return nil
	case NoOverwrite:
		// NoOverwrite mode: return error
		return fmt.Errorf("output file '%s' already exists", outputFile)
	case Ask:
		// Ask mode: show confirmation prompt
		return askOverwriteConfirmation(outputFile)
	default:
		return fmt.Errorf("unknown overwrite mode: %d", mode)
	}
}

// askOverwriteConfirmation shows interactive confirmation prompt
func askOverwriteConfirmation(outputFile string) error {
	fmt.Printf("File '%s' already exists. Overwrite? [y/N]: ", outputFile)

	reader := bufio.NewReader(os.Stdin)
	response, err := reader.ReadString('\n')
	if err != nil {
		return fmt.Errorf("failed to read user input: %w", err)
	}

	response = strings.TrimSpace(strings.ToLower(response))
	if response == "y" || response == "yes" {
		return nil
	}

	return fmt.Errorf("operation cancelled by user")
}

type TemplateStruct struct {
	Diagram `yaml:"Diagram"`
}

type Diagram struct {
	DefinitionFiles []D


        "REGNAMESPACE",
	OracleOid.T__regnamespace:                  "_REGNAMESPACE",
	OracleOid.T_regrole:                        "REGROLE",
	OracleOid.T__regrole:                       "_REGROLE",
	OracleOid.T_datetime:                       "DATETIME",
	OracleOid.T__datetime:                      "_DATETIME",
	OracleOid.T_byteawithoutorderwithequalcol:  "BYTEAWITHOUTORDERWITHEQUALCOL",
	OracleOid.T_byteawithoutordercol:           "BYTEAWITHOUTORDERCOL",
	OracleOid.T__byteawithoutorderwithequalcol: "_BYTEAWITHOUTORDERWITHEQUALCOL",
	OracleOid.T__byteawithoutordercol:          "_BYTEAWITHOUTORDERCOL",
	OracleOid.T_anyset:                         "ANYSET",
	OracleOid.T_pg_mcv_list:                    "KB_MCV_LIST",
	OracleOid.T_nchar:                          "NCHAR",
	OracleOid.T__nchar:                         "_NCHAR",
	OracleOid.T_nvarchar:                       "NVARCHAR",
	OracleOid.T__nvarchar:                      "_NVARCHAR",
	OracleOid.T_pg_subscription:                "KB_SUBSCRIPTION",
	//OracleOid.T_pg_sharedobject:                "KB_SHAREDOBJECT",
	OracleOid.T_hash16:  "HASH16",
	OracleOid.T__hash16: "_HASH16",
	OracleOid.T_hash32:  "HASH32",
	OracleOid.T__hash32: "_HASH32",
	OracleOid.T_rowid:   "ROWID",
	OracleOid.T__rowid:  "_ROWID",
	OracleOid.T_urowid:  "UROWID",
	OracleOid.T__urowid: "_UROWID",
	OracleOid.T__nclob:  "_NCLOB",
	OracleOid.T__clob:   "_CLOB",
	OracleOid.T__blob:   "_BLOB",
	// OracleOid.T_mysql_time:                     "MYSQL_TIME",
	// OracleOid.T__mysql_date:                    "_MYSQL_DATE",
	// OracleOid.T_mysql_date:                     "MYSQL_DATE",
	// OracleOid.T__mysql_time:                    "_MYSQL_TIME",
	OracleOid.T_dsinterval:   "DSINTERVAL",
	OracleOid.T__dsinterval:  "_DSINTERVAL",
	OracleOid.T_yminterval:   "YMINTERVAL",
	OracleOid.T__yminterval:  "_YMINTERVAL",
	OracleOid.T_uint4:        "UINT4",
	OracleOid.T__uint4:       "_UINT4",
	OracleOid.T_uint8:        "UINT8",
	OracleOid.T__uint8:       "_UINT8",
	OracleOid.T_blob:         "BLOB",
	OracleOid.T_clob:         "CLOB",
	OracleOid.T_nclob:        "NCLOB",
	OracleOid.T_bpcharbyte:   "BPCHARBYTE",
	OracleOid.T__bpcharbyte:  "_BPCHARBYTE",
	OracleOid.T_varcharbyte:  "VARCHARBYTE",
	OracleOid.T__varcharbyte: "_VARCHARBYTE",
	OracleOid.T_date:         "DATE",
	OracleOid.T__date:        "_DATE",
	// OracleOid.T_nestedtable:                    "NESTEDTABLE",
	// OracleOid.T_associative_array:              "ASSOCIATIVE_ARRAY",
	// OracleOid.T_varray:                         "VARRAY",
	// OracleOid.T_pg_privilege:                   "KB_PRIVILEGE",
	// OracleOid.T_pg_audit_userlog:               "KB_AUDIT_USERLOG",
	// OracleOid.T_pg_audit_blocklog:              "KB_


    expect(config).toMatchInlineSnapshot(`
        Object {
          "daysToDecay": Object {
            "error": 10,
            "warn": 5,
          },
          "daysToDecayByRule": Object {
            "no-bare-strings": Object {
              "error": 20,
              "warn": 10,
            },
          },
        }
      `);
  });

  it('errors if both package.json and .lint-todorc.js contain todo configurations', () => {
    project.writeLegacyPackageJsonTodoConfig({
      warn: 5,
      error: 10,
    });
    project.writeLintTodorc('foo', { warn: 20, error: 40 });

    expect(() => {
      getTodoConfig(project.baseDir, 'foo');
    }).toThrow(
      'You cannot have todo configurations in both package.json and .lint-todorc.js. Please move the configuration from the package.json to the .lint-todorc.js'
    );
  });

  it('can get lint todo config from env vars', () => {
    setupEnvVar('TODO_DAYS_TO_WARN', '5');
    setupEnvVar('TODO_DAYS_TO_ERROR', '10');

    const config = getTodoConfig(project.baseDir, 'foo');

    expect(config.daysToDecay).toEqual({
      warn: 5,
      error: 10,
    });
  });

  it('can get lint todo config from options', () => {
    const config = getTodoConfig(project.baseDir, 'foo', { warn: 3, error: 5 });

    expect(config.daysToDecay).toEqual({
      warn: 3,
      error: 5,
    });
  });

  it('can override lint todo config from package.json with env vars', () => {
    project.writeLegacyPackageJsonTodoConfig({
      warn: 1,
      error: 2,
    });

    setupEnvVar('TODO_DAYS_TO_WARN', '5');
    setupEnvVar('TODO_DAYS_TO_ERROR', '10');

    const config = getTodoConfig(project.baseDir, 'foo');

    expect(config.daysToDecay).toEqual({
      warn: 5,
      error: 10,
    });
  });

  it('can override lint todo config from package.json with options', () => {
    project.writeLegacyPackageJsonTodoConfig({
      warn: 1,
      error: 2,
    });

    const config = getTodoConfig(project.baseDir, 'foo', {
      warn: 5,
      error: 10,
    });

    expect(config.daysToDecay).toEqual({
      warn: 5,
      error: 10,
    });
  });

  it('can override lint todo config from env vars with options', () => {
    setupEnvVar('TODO_DAYS_TO_WARN', '1');
    setupEnvVar('TODO_DAYS_TO_ERROR', '2');

    const config = getTodoConfig(project.baseDir, 'foo', {
      warn: 5,
      error: 10,
    });

    expect(config.daysToDecay).toEqual({
      warn: 5,
      error: 10,
    });
  });

  it('can override defaults with null values', () => {
    project.writeLegacyPackageJsonTodoConfig({
      warn: 1,
      error: 2,
    });

    const config = getTodoConfig(project.baseDir, 'foo', {
      warn: undefined,
      error: undefined,
    });

    expect(config.daysToDecay).toEqual({
      warn: undefined,
      error: undefined,
    });
  });

  it('can override defaults with single null value', () => {
    project.writeLegacyPackageJsonTodoConfig({
      warn: 1,
      error: 2,
    });

    const config = getTodoConfig(project.baseDir, 'foo', {
      error: undefined,
    });

    expect(config.daysToDecay).toEqual({
      warn: 1,
      error: undefined,
    });
  });

  it('throws if warn is equal to error', () => {
    expect(() => getTodoConfig(project.baseDir, 'foo', {


('one@example.com')), findsOneWidget);

  // go back
  await tester.tapAndSettle(find.byKey(const Key('bottom_bar_primary')));
  await shareAndFinishDisclosureSession(tester);
}

Future<void> testClaimValueOnePresentOneNot(WidgetTester tester, IntegrationTestIrmaBinding irmaBinding) async {
  await pumpAndUnlockApp(tester, irmaBinding.repository);
  await issueEmailAddress(tester, irmaBinding, sdJwtBatchSize: 10, email: 'one@example.com');
  await issueEmailAddress(tester, irmaBinding, sdJwtBatchSize: 10, email: 'two@example.com');

  await tester.tapAndSettle(find.text('OK'));
  await tester.tapAndSettle(find.byKey(const Key('nav_button_data')));

  final dcql = {
    'credentials': [
      {
        'id': 'mail',
        'format': 'dc+sd-jwt',
        'meta': {
          'vct_values': ['irma-demo.sidn-pbdf.email']
        },
        'claims': [
          {
            'id': 'em',
            'path': ['email'],
            'values': ['two@example.com']
          },
          {
            'id': 'do',
            'path': ['domain']
          },
        ]
      },
    ],
  };

  final sessionUrl = await startOpenID4VPSession(dcql);
  irmaBinding.repository.startTestSessionFromUrl(sessionUrl);
  await evaluateIntroduction(tester);

  await tester.pumpAndSettle();

  expect(find.byType(DisclosurePermissionChoicesScreen), findsOneWidget);
  final cardsFinder = find.byType(YiviCredentialCard, skipOffstage: false);
  expect(cardsFinder, findsOneWidget);

  await evaluateCredentialCard(
    tester,
    cardsFinder,
    issuerName: 'Demo Privacy by Design Foundation via SIDN',
    credentialName: 'Demo Email address',
    attributes: {
      'Email address': 'two@example.com',
      'Email domain name': 'example.com',
    },
  );

  await tapChangeChoicesButton(tester);
  expect(cardsFinder, findsNWidgets(2));

  expect(find.text('Obtain new data'), findsOneWidget);

  // confirm choice/go back
  await tester.tapAndSettle(find.byKey(const Key('bottom_bar_primary')));

  await shareAndFinishDisclosureSession(tester);
}

Future<void> testOptionallyDiscloseExtraCredential(WidgetTester tester, IntegrationTestIrmaBinding irmaBinding) async {
  await pumpAndUnlockApp(tester, irmaBinding.repository);
  await issueEmailAddress(tester, irmaBinding, sdJwtBatchSize: 10, email: 'one@example.com');
  await issueEmailAddress(tester, irmaBinding, sdJwtBatchSize: 10, email: 'two@example.com');
  await issueMobileNumber(tester, irmaBinding, sdJwtBatchSize: 10, phone: '0612345678');

  await tester.tapAndSettle(find.text('OK'));
  await tester.tapAndSettle(find.byKey(const Key('nav_button_data')));

  final dcql = {
    'credentials': [
      {
        'id': 'phone',
        'format': 'dc+sd-jwt',
        'meta': {
          'vct_values': ['irma-demo.sidn-pbdf.mobilenumber']
        },
        'claims': [
          {
            'id': 'mn',
            'path': ['mobilenumber']
          },
        ]
      },
      {
        'id': 'mail',
        'format': 'dc+sd-jwt',
        'meta': {
          'vct_values': ['irma-demo.sidn-pbdf.email']
        },
        'claims': [
          {
            'id': 'em',
            'path': ['email']
          },
          {