 = s
	i.Put(2)
	check(i.Get() == 1, "f1 i")
	check(s.i == 1, "f1 s")
}

func f2() {
	s := S1{1}
	var i I1 = &s
	i.Put(2)
	check(i.Get() == 1, "f2 i")
	check(s.i == 1, "f2 s")
}

func f3() {
	s := &S1{1}
	var i I1 = s
	i.Put(2)
	check(i.Get() == 1, "f3 i")
	check(s.i == 1, "f3 s")
}

type S2 struct { i int }
func (p *S2) Get() int { return p.i }
func (p *S2) Put(i int) { p.i = i }

// Disallowed by restriction of values going to pointer receivers
// func f4() {
//	 s := S2{1}
//	 var i I1 = s
//	 i.Put(2)
//	 check(i.Get() == 2, "f4 i")
//	 check(s.i == 1, "f4 s")
// }

func f5() {
	s := S2{1}
	var i I1 = &s
	i.Put(2)
	check(i.Get() == 2, "f5 i")
	check(s.i == 2, "f5 s")
}

func f6() {
	s := &S2{1}
	var i I1 = s
	i.Put(2)
	check(i.Get() == 2, "f6 i")
	check(s.i == 2, "f6 s")
}

type I2 interface { Get() int64; Put(int64) }

type S3 struct { i, j, k, l int64 }
func (p S3) Get() int64 { return p.l }
func (p S3) Put(i int64) { p.l = i }

func f7() {
	s := S3{1, 2, 3, 4}
	var i I2 = s
	i.Put(5)
	check(i.Get() == 4, "f7 i")
	check(s.l == 4, "f7 s")
}

func f8() {
	s := S3{1, 2, 3, 4}
	var i I2 = &s
	i.Put(5)
	check(i.Get() == 4, "f8 i")
	check(s.l == 4, "f8 s")
}

func f9() {
	s := &S3{1, 2, 3, 4}
	var i I2 = s
	i.Put(5)
	check(i.Get() == 4, "f9 i")
	check(s.l == 4, "f9 s")
}

type S4 struct { i, j, k, l int64 }
func (p *S4) Get() int64 { return p.l }
func (p *S4) Put(i int64) { p.l = i }

// Disallowed by restriction of values going to pointer receivers
// func f10() {
//	 s := S4{1, 2, 3, 4}
//	 var i I2 = s
//	 i.Put(5)
//	 check(i.Get() == 5, "f10 i")
//	 check(s.l == 4, "f10 s")
// }

func f11() {
	s := S4{1, 2, 3, 4}
	var i I2 = &s
	i.Put(5)
	check(i.Get() == 5, "f11 i")
	check(s.l == 5, "f11 s")
}

func f12() {
	s := &S4{1, 2, 3, 4}
	var i I2 = s
	i.Put(5)
	check(i.Get() == 5, "f12 i")
	check(s.l == 5, "f12 s")
}

func main() {
	f1()
	f2()
	f3()
//	f4()
	f5()
	f6()
	f7()
	f8()
	f9()
//	f10()
	f11()
	f12()
	if fail > 0 {
		os.Exit(1)
	}
}
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that c


ewly-generated ED25519 private and public key pair.
 */
fun generateEd25519KeyPair(): Pair<PrivKey, PubKey> = with(Ed25519KeyPairGenerator()) {
    init(Ed25519KeyGenerationParameters(SecureRandom()))
    val keypair = generateKeyPair()
    val privateKey = keypair.private as Ed25519PrivateKeyParameters
    Pair(Ed25519PrivateKey(privateKey), Ed25519PublicKey(keypair.public as Ed25519PublicKeyParameters))
}

/**
 * Unmarshals the given key bytes into an ED25519 private key instance.
 * @param keyBytes the key bytes.
 * @return a private key.
 */
fun unmarshalEd25519PrivateKey(keyBytes: ByteArray): PrivKey =
    Ed25519PrivateKey(Ed25519PrivateKeyParameters(keyBytes, 0))

/**
 * Unmarshals the given key bytes into an ED25519 public key instance.
 * @param keyBytes the key bytes.
 * @return a public key.
 */
fun unmarshalEd25519PublicKey(keyBytes: ByteArray): PubKey = Ed25519PublicKey(Ed25519PublicKeyParameters(keyBytes, 0))
/*
 * Copyright 2019 BLK Technologies Limited (web3labs.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package io.web3j.libp2p.shared.conversion

import io.web3j.libp2p.shared.env.Libp2pException
import java.io.ByteArrayInputStream
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
import java.nio.ByteBuffer
import kotlin.experimental.and

/**
 * Common methods to encode and decode varints and varlongs into ByteBuffers and
 * arrays. <br />
 * This is a direct port (mostly auto-ported thanks to IntelliJ) of:
 * [https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/VarInt.java]
 */
object Varint {

    /**
     * Maximum encoded size of 32-bit positive integers (in bytes)
     */
    val MAX_VARINT_SIZE = 5

    /**
     * maximum encoded size of 64-bit longs, and negative 32-bit ints (in bytes)
     */
    val MAX_VARLONG_SIZE = 10

    /**
     * The 0 UInt value.
     */
    private val UINT_0 = 0.toULong()

    /**
     * Used to obtain the last 7 bits.
     */
    private val _0x7F = 0x7f.toULong()

    /**
     * Used to set the 7th bit.
     */
    private val _0x80 = 0x80.toULong()

    /**
     * Reads an long  varint from the given byte array.
     * @param inputStream the byte array.
     * @return the equivalent long value.
     */
    fun readVarLong(inputStream: InputStream): Long {
        return getVarLong(inputStream)
    }

    /**
     * Reads an integer varint from the given byte array.
     * @param inputStream the byte array.
     * @return the equivalent int value.
     */
    fun readVarInt(inputStream: InputStream): Int {
        return getVarInt(inputStream)
    }

    /**
     * Returns the number of bytes required to store the given Long as a varint.
     * @param value the value.
     * @return the number of bytes.
     */
    fun sizeOf(value: Long): Int {
        return varLongSize(value)
    }

    /**
     * Returns the number of bytes required to store the given Int as a varint.


local api = vim.api

local M = {}

--- Table with default priorities used for highlighting:
--- - `syntax`: `50`, used for standard syntax highlighting
--- - `treesitter`: `100`, used for treesitter-based highlighting
--- - `semantic_tokens`: `125`, used for LSP semantic token highlighting
--- - `diagnostics`: `150`, used for code analysis such as diagnostics
--- - `user`: `200`, used for user-triggered highlights such as LSP document
---   symbols or `on_yank` autocommands
M.priorities = {
  syntax = 50,
  treesitter = 100,
  semantic_tokens = 125,
  diagnostics = 150,
  user = 200,
}

--- @class vim.hl.range.Opts
--- @inlinedoc
---
--- Type of range. See [getregtype()]
--- (default: `'v'` i.e. charwise)
--- @field regtype? string
---
--- Indicates whether the range is end-inclusive
--- (default: `false`)
--- @field inclusive? boolean
---
--- Highlight priority
--- (default: `vim.hl.priorities.user`)
--- @field priority? integer
---
--- Time in ms before highlight is cleared
--- (default: -1 no timeout)
--- @field timeout? integer

--- Apply highlight group to range of text.
---
---@param bufnr integer Buffer number to apply highlighting to
---@param ns integer Namespace to add highlight to
---@param higroup string Highlight group to use for highlighting
---@param start [integer,integer]|string Start of region as a (line, column) tuple or string accepted by |getpos()|
---@param finish [integer,integer]|string End of region as a (line, column) tuple or string accepted by |getpos()|
---@param opts? vim.hl.range.Opts
--- @return uv.uv_timer_t? range_timer A timer which manages how much time the
--- highlight has left
--- @return fun()? range_clear A function which allows clearing the highlight manually.
--- nil is returned if timeout is not specified
function M.range(bufnr, ns, higroup, start, finish, opts)
  opts = opts or {}
  local regtype = opts.regtype or 'v'
  local inclusive = opts.inclusive or false
  local priority = opts.priority or M.priorities.user
  local timeout = opts.timeout or -1

  local v_maxcol = vim.v.maxcol

  local pos1 = type(start) == 'string' and vim.fn.getpos(start)
    or {
      bufnr,
      start[1] + 1,
      start[2] ~= -1 and start[2] ~= v_maxcol and start[2] + 1 or v_maxcol,
      0,
    }
  local pos2 = type(finish) == 'string' and vim.fn.getpos(finish)
    or {
      bufnr,
      finish[1] + 1,
      finish[2] ~= -1 and start[2] ~= v_maxcol and finish[2] + 1 or v_maxcol,
      0,
    }

  local buf_line_count = api.nvim_buf_line_count(bufnr)
  pos1[2] = math.min(pos1[2], buf_line_count)
  pos2[2] = math.min(pos2[2], buf_line_count)

  if pos1[2] <= 0 or pos1[3] <= 0 or pos2[2] <= 0 or pos2[3] <= 0 then
    return
  end

  vim._with({ buf = bufnr }, function()
    if pos1[3] ~= v_maxcol then
      local max_col1 = vim.fn.col({ pos1[2], '$' })
      pos1[3] = math.min(pos1[3], max_col1)
    end
    if pos2[3] ~= v_maxcol then
      local max_col2 = vim.fn.col({


test/UserGuide/aws-properties-greengrass-coredefinition-coredefinitionversion.html
//
type CfnCoreDefinition_CoreDefinitionVersionProperty struct {
	// The Greengrass core in this version.
	//
	// Currently, the `Cores` property for a core definition version can contain only one core.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-coredefinition-coredefinitionversion.html#cfn-greengrass-coredefinition-coredefinitionversion-cores
	//
	Cores interface{} `field:"required" json:"cores" yaml:"cores"`
}

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

package main

import (
	"errors"
	"testing"
	"time"

	"github.com/aws/aws-sdk-go/service/codebuild"
	"github.com/aws/aws-sdk-go/service/codebuild/codebuildiface"
)

// Define a mock struct to use in unit tests
type mockCodeBuildClient struct {
	codebuildiface.CodeBuildAPI
}

func (m *mockCodeBuildClient) StartBuild(input *codebuild.StartBuildInput) (*codebuild.StartBuildOutput, error) {
	// Check that required inputs exist
	if input.ProjectName == nil || *input.ProjectName == "" {
		return nil, errors.New("StartBuildInput.ProjectName is nil or an empty string")
	}

	resp := codebuild.StartBuildOutput{}
	return &resp, nil
}

func TestBuildProject(t *testing.T) {
	thisTime := time.Now()
	nowString := thisTime.Format("2006-01-02 15:04:05 Monday")
	t.Log("Starting unit test at " + nowString)

	// mock resource
	project := "test-project"

	mockSvc := &mockCodeBuildClient{}

	err := BldProject(mockSvc, &project)
	if err != nil {
		t.Fatal(err)
	}

	t.Log("Built project " + project)
}
package awsgreengrass

// A function is a Lambda function that's referenced from an AWS IoT Greengrass group.
//
// The function is deployed to a Greengrass core where it runs locally. For more information, see [Run Lambda Functions on the AWS IoT Greengrass Core](https://docs.aws.amazon.com/greengrass/v1/developerguide/lambda-functions.html) in the *Developer Guide* .
//
// In an AWS CloudFormation template, the `Functions` property of the [`FunctionDefinitionVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functiondefinitionversion.html) property type contains a list of `Function` property types.
//
// Example:
//   // The code below shows an example of how to instantiate this type.
//   // The values are placeholders you should change.
//   import "github.com/aws/aws-cdk-go/awscdk"
//
//   var variables interface{}
//
//   functionProperty := &FunctionProperty{
//   	FunctionArn: jsii.String("functionArn"),
//   	FunctionConfiguration: &FunctionConfigurationProperty{
//   		EncodingType: jsii.String("encodingType"),
//   		Environment: &EnvironmentProperty{
//   			AccessSysfs: jsii.Boolean(false),
//   			Execution: &ExecutionProperty{
//   				IsolationMode: jsii.String("isolationMode"),
//   				RunAs: &RunAsProperty{
//   					Gid: jsii.Number(123),
//   					Uid: jsii.Number(123),
//   				},
//   			},
//   			ResourceAccessPolicies: []interface{}{
//   				&ResourceAccessPolicyProperty{
//   					ResourceId: jsii.String("resourceId"),
//
//   					// the properties below are optional
//   					Permission: jsii.String("permission"),
//   				},


// Copyright (c) 2014  GeometryFactory (France).  All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL: https://github.com/CGAL/cgal/blob/releases/CGAL-5.1-beta1/STL_Extension/include/CGAL/Container_helper.h $
// $Id: Container_helper.h 8bb22d5 2020-03-26T14:23:37+01:00 Sébastien Loriot
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s)     : Andreas Fabri

#ifndef CGAL_CONTAINER_HELPER_H
#define CGAL_CONTAINER_HELPER_H

#include <CGAL/array.h>
#include <CGAL/Has_member.h>

#include <CGAL/assertions.h>
#include <boost/mpl/logical.hpp>
#include <boost/utility/enable_if.hpp>

#include <cstddef>

namespace CGAL {
namespace internal {

CGAL_GENERATE_MEMBER_DETECTOR(size);
CGAL_GENERATE_MEMBER_DETECTOR(resize);

// Typical container
template <class Container>
void resize(Container& c, std::size_t size,
            typename boost::enable_if_c<has_resize<Container>::value>::type* = nullptr)
{
  c.resize(size);
}

// Container without a resize() function, but with a size() function (e.g. an array)
template <class Container>
void resize(Container& CGAL_assertion_code(array), std::size_t CGAL_assertion_code(size),
            typename boost::enable_if<
              boost::mpl::and_<
                boost::mpl::not_<has_resize<Container> >,
                                 has_size<Container> > >::type* = nullptr)
{
  CGAL_assertion(array.size() == size);
}

// A class with neither resize() nor size(), can't enforce size (it better be correct!)
template <class Container>
void resize(Container&, std::size_t,
            typename boost::disable_if<
              boost::mpl::or_<has_resize<Container>,
                              has_size<Container> > >::type* = nullptr)
{
}

// Plenty of times we ask for a model of RandomAccessContainer and use reserve, but some models
// of the concept do not have a reserve (e.g. deque)
CGAL_GENERATE_MEMBER_DETECTOR(reserve);

// Container with 'reserve'
template <class Container>
void reserve(Container& c, std::size_t size,
             typename boost::enable_if_c<has_reserve<Container>::value>::type* = nullptr)
{
  c.reserve(size);
}

// Container with no 'reserve'
template <class Container>
void reserve(Container&, std::size_t,
             typename boost::disable_if_c<has_reserve<Container>::value>::type* = nullptr)
{
}

} // namespace internal
} // namespace CGAL

#endif // CGAL_CONTAINER_HELPER_H


                                           if (fab.params->rowtot[Gc]) denom -= fab.matrix[Gc][c][c];

                                            WAbc[Gab][ab][c] /= denom;

                                        } /* c */
                                    }     /* ab */
                                }         /* Gab */

                                /* 1/2 Dot product of final V and W is the energy for this ijk triple */
                                for (Gab = 0; Gab < nirreps; Gab++) {
                                    Gc = Gab ^ Gijk;
                                    ET_ABB +=
                                        dot_block(WAbc[Gab], VAbc[Gab], FABints.params->coltot[Gab], bvirtpi[Gc], 0.5);
                                    global_dpd_->free_dpd_block(WAbc[Gab], FABints.params->coltot[Gab], bvirtpi[Gc]);
                                    global_dpd_->free_dpd_block(VAbc[Gab], FABints.params->coltot[Gab], bvirtpi[Gc]);
                                }

                            } /* J >= K */

                        } /* k */
                    }     /* j */
                }         /* i */

            } /* Gk */
        }     /* Gj */
    }         /* Gi */

    free(WAbc);
    free(VAbc);
    free(WAcb);
    free(WbcA);
    free(WcAb);
    free(WbAc);

    for (h = 0; h < nirreps; h++) {
        global_dpd_->buf4_mat_irrep_close(&T2BB, h);
        global_dpd_->buf4_mat_irrep_close(&T2AB, h);
        global_dpd_->buf4_mat_irrep_close(&T2BA, h);
        global_dpd_->buf4_mat_irrep_close(&EBBints, h);
        global_dpd_->buf4_mat_irrep_close(&EABints, h);
        global_dpd_->buf4_mat_irrep_close(&EBAints, h);
        global_dpd_->buf4_mat_irrep_close(&DBBints, h);
        global_dpd_->buf4_mat_irrep_close(&DABints, h);
    }

    global_dpd_->buf4_close(&T2BB);
    global_dpd_->buf4_close(&T2AB);
    global_dpd_->buf4_close(&T2BA);
    global_dpd_->buf4_close(&FBBints);
    global_dpd_->buf4_close(&FABints);
    global_dpd_->buf4_close(&FBAints);
    global_dpd_->buf4_close(&EBBints);
    global_dpd_->buf4_close(&EABints);
    global_dpd_->buf4_close(&EBAints);
    global_dpd_->buf4_close(&DBBints);
    global_dpd_->buf4_close(&DABints);

    global_dpd_->file2_mat_close(&T1A);
    global_dpd_->file2_close(&T1A);
    global_dpd_->file2_mat_close(&T1B);
    global_dpd_->file2_close(&T1B);

    global_dpd_->file2_mat_close(&fIJ);
    global_dpd_->file2_mat_close(&fij);
    global_dpd_->file2_mat_close(&fAB);
    global_dpd_->file2_mat_close(&fab);
    global_dpd_->file2_mat_close(&fIA);
    global_dpd_->file2_mat_close(&fia);
    global_dpd_->file2_close(&fIJ);
    global_dpd_->file2_close(&fij);
    global_dpd_->file2_close(&fAB);
    global_dpd_->file2_close(&fab);
    global_dpd_->file2_close(&fIA);
    global_dpd_->file2_close(&fia);

    return ET_ABB;
}

}  // namespace cctriples
}  // namespace psi
/*
 * @BEGIN LICENSE
 *
 * Psi4: an open-source quantum chemistry software package
 *
 * Copyright (c) 2007-2025 The Psi4 Developers.
 *
 * The copyrights for code used from other parties are included in
 * the corresponding files.
 *
 * This file is part of Psi4.
 *
 * Psi4 is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * Psi4 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY;


.

Benchmarking dan profiling dapat menunjuk pada optimasi berikut.

##### Perketat skema

* MySQL menulis ke disk dalam blok yang berdekatan untuk akses cepat.
* Gunakan `CHAR` daripada `VARCHAR` untuk field berdimensi tetap.
    * `CHAR` memungkinkan akses acak cepat, sedangkan dengan `VARCHAR`, Anda harus menemukan akhir string sebelum pindah ke berikutnya.
* Gunakan `TEXT` untuk blok teks besar seperti posting blog.  `TEXT` juga memungkinkan pencarian boolean.  Penggunaan field `TEXT` mengakibatkan penyimpanan pointer di disk yang digunakan untuk menemukan blok teks.
* Gunakan `INT` untuk angka besar hingga 2^32 atau 4 miliar.
* Gunakan `DECIMAL` untuk mata uang agar terhindar dari kesalahan representasi floating point.
* Hindari menyimpan `BLOB` besar, simpan lokasi objek untuk mengambilnya.
* `VARCHAR(255)` adalah jumlah karakter terbesar yang dapat dihitung dalam angka 8 bit, sering memaksimalkan penggunaan byte pada beberapa RDBMS.
* Atur batasan `NOT NULL` jika memungkinkan untuk [meningkatkan performa pencarian](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search).

##### Gunakan indeks yang baik

* Kolom yang Anda query (`SELECT`, `GROUP BY`, `ORDER BY`, `JOIN`) bisa lebih cepat dengan indeks.
* Indeks biasanya diwakili sebagai [B-tree](https://id.wikipedia.org/wiki/B-tree) self-balancing yang menjaga data tetap terurut dan memungkinkan pencarian, akses berurutan, penyisipan, dan penghapusan dalam waktu logaritmik.
* Penempatan indeks bisa menjaga data tetap di memori, sehingga membutuhkan lebih banyak ruang.
* Penulisan juga bisa lebih lambat karena indeks perlu diperbarui.
* Saat memuat data dalam jumlah besar, mungkin lebih cepat untuk menonaktifkan indeks, memuat data, lalu membangun ulang indeks.

##### Hindari join yang mahal

* [Denormalisasi](#denormalisasi) jika tuntutan kinerja membutuhkannya.

##### Partisi tabel

* Pisahkan sebuah tabel dengan menempatkan titik-titik panas (hot spots) dalam tabel terpisah untuk membantu agar tetap berada di memori.

##### Sesuaikan cache query

* Dalam beberapa kasus, [cache query](https://dev.mysql.com/doc/refman/5.7/en/query-cache.html) bisa menyebabkan [masalah kinerja](https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/).

##### Sumber dan bacaan lanjutan: Penyempurnaan SQL

* [Tips untuk mengoptimalkan query MySQL](http://aiddroid.com/10-tips-optimizing-mysql-queries-dont-suck/)
* [Apakah ada alasan bagus VARCHAR(255) sering digunakan?](http://stackoverflow.com/questions/1217466/is-there-a-good-reason-i-see-varchar255-used-so-often-as-opposed-to-another-l)
* [Bagaimana nilai null mempengaruhi kinerja?](http://stackoverflow.com/questions/1017239/how-do-null


, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]

pub use self::boardroom::Boardroom;
use ink_lang as ink;

#[ink::contract]
mod boardroom {
    use ink_prelude::vec::Vec;

    use ink_storage::{
        collections::{
            HashMap,
            Vec as StorageVec,
        },
        lazy::Lazy,
        traits::{PackedLayout, SpreadLayout},
    };

    use ink_env::call::FromAccountId;
    use core::convert::TryInto;

    use util::Util;
    use asset::Asset;

    /// Event emitted when a stake occurs that user Stake the ALS.
    #[ink(event)]
    pub struct Staked {
        #[ink(topic)]
        user: Option<AccountId>,
        #[ink(topic)]
        amount: u128,
    }

    /// Event emitted when an withdraw occurs that user withdraw the ALS which is staked before.
    #[ink(event)]
    pub struct Withdrawn {
        #[ink(topic)]
        user: Option<AccountId>,
        #[ink(topic)]
        amount: u128,
    }

    /// Event emitted when an claim_reward occurs that user claim the reward which is produced by staked ALS.
    #[ink(event)]
    pub struct RewardPaid {
        #[ink(topic)]
        user: Option<AccountId>,
        #[ink(topic)]
        reward: u128,
    }

    /// Event emitted when an allocate_seigniorage occurs that treasury allocate the reward.
    #[ink(event)]
    pub struct RewardAdded {
        #[ink(topic)]
        user: Option<AccountId>,
        #[ink(topic)]
        reward: u128,
    }

    /// BoardSeat record the reward should paid to user.
    /// When treasury allocate the reward, boardroom generate the new BoardSeat for user who staked the ALS.
    #[derive(Debug, PartialEq, Eq, Clone, scale::Encode, scale::Decode, SpreadLayout, PackedLayout)]
    #[cfg_attr(
        feature = "std",
        derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout)
    )]
    pub struct BoardSeat {
        pub last_snapshot_index: u128,
        pub reward_earned: u128,
    }

    /// BoardSnapshot record the reward per ALS.
    /// When treasury allocate the reward, boardroom generate the new BoardSnapshot.
    #[derive(Debug, PartialEq, Eq, Clone, scale::Encode, scale::Decode, SpreadLayout, PackedLayout)]
    #[cfg_attr(
        feature = "std",
        derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout)
    )]
    pub struct BoardSnapshot {
        pub time: u64,
        pub reward_received: u128,
        pub reward_per_share: u128,
    }

    #[ink(storage)]
    pub struct Boardroom {
        util: Lazy<Util>,
        cash: Lazy<Asset>,
        share: Lazy<Asset>,
        stake_total: u128,
        balances: HashMap<AccountId, u128>,
        directors: HashMap<AccountId, BoardSeat>,
        board_history: StorageVec<BoardSnapshot>,

        operator: AccountId,
        status: HashMap<(u32, AccountId), bool>,
    }

    impl Boardroom {
        /// Creates a new boardroom contract with the contract's addresses of ALS, ALC, util.
        #[ink(constructor)]
        pub fn new(cash_address:AccountId,
                   share_address:AccountId,
                   util_address:AccountId) -> Self {
            let share: Asset = FromAccountId::from_account_id(share_address);
            let cash: Asset = FromAccountId::from_account_


}) {
  return ChatMessage(
    messageId: const Uuid().v4(),
    role: CusRole.assistant.name,
    content: "",
    contentVoicePath: "",
    dateTime: DateTime.now(),
    modelLabel: modelLabel,
  );
}
import 'package:sqflite/sqflite.dart';

import '../../../models/brief_ai_tools/chat_competion/com_cc_state.dart';
import '../../../models/brief_ai_tools/media_generation_history/media_generation_history.dart';

import '../../llm_spec/cus_brief_llm_model.dart';
import '../../llm_spec/constant_llm_enum.dart';

import 'init_db.dart';
import 'ddl_brief_ai_tool.dart';

///
/// 简洁版AI工具相关数据库操作
///
class DBBriefAIToolHelper {
  // 单例模式
  static final DBBriefAIToolHelper _dbBriefHelper =
      DBBriefAIToolHelper._createInstance();
  // 构造函数，返回单例
  factory DBBriefAIToolHelper() => _dbBriefHelper;

  // 命名的构造函数用于创建DatabaseHelper的实例
  DBBriefAIToolHelper._createInstance();

  // 获取数据库实例(每次操作都从 DBInit 获取，不缓存)
  Future<Database> get database async => DBInit().database;

  ///
  ///  Helper 的相关方法
  ///

  ///***********************************************/
  /// 2025-02-14 简洁版本的 自定义的LLM信息管理
  ///

  // 查询所有模型信息
  Future<List<CusBriefLLMSpec>> queryBriefCusLLMSpecList({
    String? cusLlmSpecId, // 模型规格编号
    ApiPlatform? platform, // 平台
    String? name, // 模型名称
    LLModelType? modelType, // 模型分类枚举
    bool? isFree, // 是否收费(0要收费，1不收费)
    bool? isBuiltin, // 是否内置(0不是，1是)
  }) async {
    Database db = await database;

    // print("模型规格查询参数：");
    // print("uuid $cusLlmSpecId");
    // print("平台 $platform");
    // print("cusLlm $cusLlm");
    // print("name $name");
    // print("modelType $modelType");
    // print("isFree $isFree");

    final where = <String>[];
    final whereArgs = <dynamic>[];

    if (cusLlmSpecId != null) {
      where.add('cusLlmSpecId = ?');
      whereArgs.add(cusLlmSpecId);
    }

    if (platform != null) {
      where.add('platform = ?');
      whereArgs.add(platform.toString());
    }
    if (name != null) {
      where.add('name = ?');
      whereArgs.add(name);
    }
    if (modelType != null) {
      where.add('modelType = ?');
      whereArgs.add(modelType.toString());
    }

    if (cusLlmSpecId != null) {
      where.add('isFree = ?');
      whereArgs.add(isFree == true ? 1 : 0);
    }

    if (isBuiltin != null) {
      where.add('isBuiltin = ?');
      whereArgs.add(isBuiltin == true ? 1 : 0);
    }

    final rows = await db.query(
      BriefAIToolDdl.tableNameOfCusBriefLlmSpec,
      where: where.isNotEmpty ? where.join(' AND ') : null,
      whereArgs: whereArgs.isNotEmpty ? whereArgs : null,
      orderBy: "gmtC


y"
[#]: url: "https://linux.cn/article-14930-1.html"

在 Linux 中如何使用命令行管理文件
======

> 如果你更喜欢用终端与系统交互，请了解一下我最喜欢的管理文件的命令。

![](https://img.linux.net.cn/data/attachment/album/202208/14/172405m2wa2tbiq6qtpw2p.jpg)

在如 GNOME 或 KDE 等图形桌面中使用鼠标点击管理文件。你点击文件的图标，将它移动到另一个文件夹中，或者移动到回收站里。图形交互使得桌面计算机便于使用。

但是在 Linux 中，我们并不总是与图形界面交互。如果你在服务器上工作，那么你可能需要使用命令行来解决问题。即使像我这样使用桌面的用户，可能也更喜欢使用终端和命令行和系统交互。我倾向于通过命令行运行命令来管理我的文件：

### 使用 ls 显示文件

```
ls
```

对任何使用命令行的人来说，如果不知道有什么文件，工作将很难进行下去。[ls 命令][2] 会罗列出文件夹中的文件。例如，要查看 Web 服务器的文档根目录 `/var/www/html` 中的内容，你可以键入：

```
ls /var/www/html
```

大多数情况，我使用 `ls` 命令查看当前文件夹内的文件。只需要输入 `ls` 即可查看所有文件。例如，当我在我的网页项目的根目录时，输入 `ls` 后可以看到这些：

```
$ ls
about  fontawesome      fonts   index.php  styles
docs   fontawesome.zip  images  prism
```

`ls` 命令包含 60 种选项，可以以任意方式显示文件和目录。`-l` 是一个很有用的选项，可以详细的显示文件，包含权限、文件大小以及所有者等信息。

```
$ ls -l

total 6252
drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:18 about
drwxr-xr-x. 2 jhall jhall    4096 Jun 25 16:35 docs
drwxr-xr-x. 2 jhall jhall    4096 Jun  7 00:00 fontawesome
-rw-r--r--. 1 jhall jhall 6365962 Jun  2 16:26 fontawesome.zip
drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:17 fonts
drwxr-xr-x. 2 jhall jhall    4096 Jun 25 13:03 images
-rw-rw-r--. 1 jhall jhall     327 Jun 22 16:38 index.php
drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:18 prism
drwxrwxr-x. 2 jhall jhall    4096 Jun 22 16:17 styles
```

上方的文件大小是以字节为单位，或许看起来有点吃力。想要以方便我们阅读的格式查看文件大小，只需要添加 `-h` 或 `--human-readable` 选项，能以 `G` 、`M` 、`K` 为单位显示文件大小。

```
$ ls -l --human-readable
total 6.2M
drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 about
drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 16:35 docs
drwxr-xr-x. 2 jhall jhall 4.0K Jun  7 00:00 fontawesome
-rw-r--r--. 1 jhall jhall 6.1M Jun  2 16:26 fontawesome.zip
drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 fonts
drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 13:03 images
-rw-rw-r--. 1 jhall jhall  327 Jun 22 16:38 index.php
drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 prism
drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 styles
```

现在，


],b=ktn(s,u,p,v,d);let y="",T="",_=0,A=0,P=H2[u.branch].index;u.type===ad.MERGE&&s.id!==u.parents[0]&&(P=H2[s.branch].index);let R;if(b){y="A 10 10, 0, 0, 0,",T="A 10 10, 0, 0, 1,",_=10,A=10;const F=p.y<v.y?BR(p.y,v.y):BR(v.y,p.y),j=p.x<v.x?BR(p.x,v.x):BR(v.x,p.x);R0==="TB"?p.x<v.x?R=`M ${p.x} ${p.y} L ${j-_} ${p.y} ${T} ${j} ${p.y+A} L ${j} ${v.y-_} ${y} ${j+A} ${v.y} L ${v.x} ${v.y}`:(P=H2[s.branch].index,R=`M ${p.x} ${p.y} L ${j+_} ${p.y} ${y} ${j} ${p.y+A} L ${j} ${v.y-_} ${T} ${j-A} ${v.y} L ${v.x} ${v.y}`):p.y<v.y?R=`M ${p.x} ${p.y} L ${p.x} ${F-_} ${y} ${p.x+A} ${F} L ${v.x-_} ${F} ${T} ${v.x} ${F+A} L ${v.x} ${v.y}`:(P=H2[s.branch].index,R=`M ${p.x} ${p.y} L ${p.x} ${F+_} ${T} ${p.x+A} ${F} L ${v.x-_} ${F} ${y} ${v.x} ${F-A} L ${v.x} ${v.y}`)}else y="A 20 20, 0, 0, 0,",T="A 20 20, 0, 0, 1,",_=20,A=20,R0==="TB"?(p.x<v.x&&(u.type===ad.MERGE&&s.id!==u.parents[0]?R=`M ${p.x} ${p.y} L ${p.x} ${v.y-_} ${y} ${p.x+A} ${v.y} L ${v.x} ${v.y}`:R=`M ${p.x} ${p.y} L ${v.x-_} ${p.y} ${T} ${v.x} ${p.y+A} L ${v.x} ${v.y}`),p.x>v.x&&(y="A 20 20, 0, 0, 0,",T="A 20 20, 0, 0, 1,",_=20,A=20,u.type===ad.MERGE&&s.id!==u.parents[0]?R=`M ${p.x} ${p.y} L ${p.x} ${v.y-_} ${T} ${p.x-A} ${v.y} L ${v.x} ${v.y}`:R=`M ${p.x} ${p.y} L ${v.x+_} ${p.y} ${y} ${v.x} ${p.y+A} L ${v.x} ${v.y}`),p.x===v.x&&(R=`M ${p.x} ${p.y} L ${v.x} ${v.y}`)):(p.y<v.y&&(u.type===ad.MERGE&&s.id!==u.parents[0]?R=`M ${p.x} ${p.y} L ${v.x-_} ${p.y} ${T} ${v.x} ${p.y+A} L ${v.x} ${v.y}`:R=`M ${p.x} ${p.y} L ${p.x} ${v.y-_} ${y} ${p.x+A} ${v.y} L ${v.x} ${v.y}`),p.y>v.y&&(u.type===ad.MERGE&&s.id!==u.parents[0]?R=`M ${p.x} ${p.y} L ${v.x-_} ${p.y} ${y} ${v.x} ${p.y-A} L ${v.x} ${v.y}`:R=`M ${p.x} ${p.y} L ${p.x} ${v.y+_} ${T} ${p.x+A} ${v.y} L ${v.x} ${v.y}`),p.y===v.y&&(R=`M ${p.x} ${p.y} L ${v.x}


pciones...
 * - Debes hacer print por consola del resultado de todos los ejemplos.
 *
 * DIFICULTAD EXTRA (opcional):
 * Crea un programa que imprima por consola todos los números comprendidos
 * entre 10 y 55 (incluidos), pares, y que no son ni el 16 ni múltiplos de 3.
 *
 * @version v1
 *
 * @since 07/01/2024
 *
 * @author Blas Barragán
 *
 */
public class BlasBarragan {
    public static void main(String[] args) {
    // ### OPERADORES ###

        // OPERADORES ARITMETICOS
        int valorA = 10;
        int valorB = 5;

        int suma = valorA + valorB;
        int resta = valorA - valorB;
        int multiplicacion = valorA * valorB;
        int division = valorA / valorB;
        int restoDeLaDivision = valorA % valorB;

        System.out.println("<=Operadores Aritmeticos=>\n");
        System.out.println("Suma: " + suma);
        System.out.println("Resta: " + resta);
        System.out.println("Multiplicación: " + multiplicacion);
        System.out.println("División: " + division);
        System.out.println("Resto de la división: " + restoDeLaDivision);

        // OPERADORES DE ASIGNACIÓN
        System.out.println("\n<=Operadores de Asignación=>\n"); // Realizan la operación antes de la asignación.
        System.out.println("ValorA = " + valorA + " Asignación = 5");
        valorA += 5;
        System.out.println("Suma: valorA = " + valorA);
        System.out.println("ValorA = " + valorA + " Asignación = 5");
        valorA -= 5;
        System.out.println("Resta: valorA = " + valorA);
        System.out.println("ValorA = " + valorA + " Asignación = 5");
        valorA *= 5;
        System.out.println("Multiplicación: valorA = " + valorA);
        System.out.println("ValorA = " + valorA + " Asignación = 5");
        valorA /= 5;
        System.out.println("División: valorA = " + valorA);
        System.out.println("ValorA = " + valorA + " Asignación = 5");
        valorA %= 5;
        System.out.println("Resto de la división: " + valorA);

        // OPERADORES RELACIONALES
        System.out.println("\n<=Operadores de Asignación=>\n"); // Responden true o false.
        System.out.println("Es " + valorA + " Mayor que (>) " + valorB + " ? : " + (valorA>valorB));
        System.out.println("Es " + valorA + " Menor que (<) " + valorB + " ? : " + (valorA<valorB));
        System.out.println("Es " + valorA + " Igual a (==) " + valorB + " ? : " + (valorA==valorB));
        System.out.println("Es " + valorA + " Distinto de (!=) " + valorB + " ? : " + (valorA!=valorB));
        System.out.println("Es " + valorA + " Mayor o Igual que (>) " + valorB + " ? : " + (valorA>=valorB));
        System.out.println("Es " + valorA + " Menor o Igual que (>) " + valorB + " ? : " + (valorA<=valorB));

        // OPERADORES LÓGICOS
        System.out.println("\n<=Operadores Lógicos=>\n"); // Responden true o false.
        boolean and = (valorA>valorB)&&(valorA<valorB);
        boolean or = (valorA==valorB)||(valorA!=valorB);
        boolean not = (!and);
        System.out.println( valorA + " es mayor que (>) " + valorB +


# encoding: utf-8

import ckan.plugins as p

import ckanext.datastore.interfaces as interfaces

class SampleDataStorePlugin(p.SingletonPlugin):
    p.implements(interfaces.IDatastore, inherit=True)

    def datastore_validate(self, context, data_dict, column_names):
        valid_filters = ("age_between", "age_not_between", "insecure_filter")
        filters = data_dict.get("filters", {})
        for key in list(filters.keys()):
            if key in valid_filters:
                del filters[key]

        return data_dict

    def datastore_search(self, context, data_dict, column_names, query_dict):
        query_dict["where"] += self._where(data_dict)
        return query_dict

    def datastore_delete(self, context, data_dict, column_names, query_dict):
        query_dict["where"] += self._where(data_dict)
        return query_dict

    def _where(self, data_dict):
        filters = data_dict.get("filters", {})
        where_clauses = []

        if "age_between" in filters:
            age_between = filters["age_between"]

            clause = (
                '"age" >= :min AND "age" <= :max',
                {"min": age_between[0], "max": age_between[1]},
            )
            where_clauses.append(clause)
        if "age_not_between" in filters:
            age_not_between = filters["age_not_between"]

            clause = (
                '"age" < :min OR "age" > :max',
                {"min": age_not_between[0], "max": age_not_between[1]},
            )
            where_clauses.append(clause)
        if "insecure_filter" in filters:
            insecure_filter = filters["insecure_filter"]

            clause = (insecure_filter,)
            where_clauses.append(clause)

        return where_clauses


red by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package util

import (
	"crypto/sha256"

	ct "github.com/google/certificate-transparency-go"
	"github.com/google/certificate-transparency-go/tls"
	"github.com/google/trillian"
	"k8s.io/klog/v2"
)

// BuildLogLeaf returns a Trillian LogLeaf structure for a (pre-)cert and the
// chain of certificates leading it up to a known root.
func BuildLogLeaf(logPrefix string,
	merkleLeaf ct.MerkleTreeLeaf, leafIndex int64,
	cert ct.ASN1Cert, chain []ct.ASN1Cert, isPrecert bool,
) (*trillian.LogLeaf, error) {
	return buildLogLeaf(logPrefix, merkleLeaf, leafIndex, cert, chain, nil, isPrecert)
}

// ExtraDataForChain creates the extra data associated with a log entry as
// described in RFC6962 section 4.6.
func ExtraDataForChain(cert ct.ASN1Cert, chain []ct.ASN1Cert, isPrecert bool) ([]byte, error) {
	var extra interface{}
	if isPrecert {
		// For a pre-cert, the extra data is a TLS-encoded PrecertChainEntry.
		extra = ct.PrecertChainEntry{
			PreCertificate:   cert,
			CertificateChain: chain,
		}
	} else {
		// For a certificate, the extra data is a TLS-encoded:
		//   ASN.1Cert certificate_chain<0..2^24-1>;
		// containing the chain after the leaf.
		extra = ct.CertificateChain{Entries: chain}
	}
	return tls.Marshal(extra)
}

// BuildLogLeafWithChainHash returns a Trillian LogLeaf structure for a
// (pre-)cert and the chain of certificates leading it up to a known root.
func BuildLogLeafWithChainHash(logPrefix string, merkleLeaf ct.MerkleTreeLeaf, leafIndex int64, cert ct.ASN1Cert, chainHash []byte, isPrecert bool) (*trillian.LogLeaf, error) {
	return buildLogLeaf(logPrefix, merkleLeaf, leafIndex, cert, nil, chainHash, isPrecert)
}

// ExtraDataForChainHash creates the extra data associated with a log entry as
// described in RFC6962 section 4.6 except the chain being replaced with its hash.
func ExtraDataForChainHash(cert ct.ASN1Cert, chainHash []byte, isPrecert bool) ([]byte, error) {
	var extra any

	if isPrecert {
		// For a pre-cert, the extra data is a TLS-encoded PrecertChainEntry.
		extra = ct.PrecertChainEntryHash{
			PreCertificate:    cert,
			IssuanceChainHash: chainHash,
		}
	} else {
		// For a certificate, the extra data is a TLS-encoded:
		//   ASN.1Cert certificate_chain<0..2^24-1>;
		// containing the chain after the leaf.
		extra = ct.CertificateChainHash{
			IssuanceChainHash: chainHash,
		}
	}
	return tls.Marshal(extra)
}

// buildLogLeaf builds the trillian.LogLeaf. The chainHash argument controls
// whether ExtraDataForChain or ExtraDataForChainHash method will be called.
// If chainHash is not nil, but neither is chain, then chain will be ignored.
func buildLogLeaf(logPrefix string, merkleLeaf ct.MerkleTreeLeaf, leafIndex int64, cert ct.ASN1Cert, chain []ct.ASN1Cert, chainHash []byte, isPrecert bool) (*trillian.LogLeaf, error) {
	leafData, err := tls.Marshal(merkleLeaf)
	if err !=


def test_pass():
    assert 1 == 1


">

CHANGE
  LOG

Version 2.110
    (2005/02/10)

Maintainership taken over by DSKOLL <dfs@roaringpenguin.com>

Closed the following bugs at
        https://rt.cpan.org/NoAuth/Bugs.html?Dist=IO-stringy:

2208 IO::ScalarArray->getline does not return undef for EOF if
      undef($/)

7132 IO-stringy/Makefile.PL bug - name should be module name

11249 IO::Scalar flush shouldn't return undef

2172 $\ (output record separator) not respected

8605 IO::InnerFile::seek() should return 1 on success

4798 *.html in lib/

4369 Improvement: handling of fixed-size reads in IO::Scalar

(Actually, bug 4369 was closed in Version 2.109)

Version 2.109
    (2003/12/21)

IO::Scalar::getline now works with ref to int. Thanks to Dominique
      Quatravaux for this patch.

Version 2.108
    (2001/08/20)

The terms-of-use have been placed in the distribution file
      "COPYING". Also, small documentation tweaks were made.

Version 2.105
    (2001/08/09)

Added support for various seek() whences to IO::ScalarArray.

Added support for consulting $/ in IO::Scalar and
        IO::ScalarArray. The old "use_RS()" is
        not even an option. Unsupported record separators will cause a
        croak().

Added a lot of regression tests to supoprt the above.

Better on-line docs (hyperlinks to individual functions).

Version 2.103
    (2001/08/08)

After sober consideration I have reimplemented IO::Scalar::print()
      so that it once again always seeks to the end of the string. Benchmarks
      show the new implementation to be just as fast as Juergen's contributed
      patch; until someone can convince me otherwise, the current, safer
      implementation stays.

I thought more about giving IO::Scalar two separate handles,
        one for reading and one for writing, as suggested by Binkley. His points
        about what tell() and eof() return are, I think,
        show-stoppers for this feature. Even the manpages for stdio's
        fseek() seem to imply a single file position indicator,
        not two. So I think I will take this off the TO DO list. Remedy:
        you can always have two handles open on the same scalar, one which you
        only write to, and one which yo


_test_instance;

void TestLogging::runTests(IGameDef *gamedef)
{
	TEST(testNullChecks);
	TEST(testBitCheck);
}

////////////////////////////////////////////////////////////////////////////////

void TestLogging::testNullChecks()
{
	CaptureLogOutput capture(g_logger);

	infostream << "Test char*: "          << (char*)0          << std::endl;
	infostream << "Test signed char*: "   << (signed char*)0   << std::endl;
	infostream << "Test unsigned char*: " << (unsigned char*)0 << std::endl;

	infostream << "Test const char*: "          << (const char*)0          << std::endl;
	infostream << "Test const signed char*: "   << (const signed char*)0   << std::endl;
	infostream << "Test const unsigned char*: " << (const unsigned char*)0 << std::endl;

	auto logs = capture.take();
	UASSERTEQ(size_t, logs.size(), 6);
	UASSERTEQ(std::string, logs[0].text, "Test char*: (null)");
	UASSERTEQ(std::string, logs[1].text, "Test signed char*: (null)");
	UASSERTEQ(std::string, logs[2].text, "Test unsigned char*: (null)");
	UASSERTEQ(std::string, logs[3].text, "Test const char*: (null)");
	UASSERTEQ(std::string, logs[4].text, "Test const signed char*: (null)");
	UASSERTEQ(std::string, logs[5].text, "Test const unsigned char*: (null)");
}

namespace {
	class ForceEofBit {};
	class ForceFailBit {};
	class ForceBadBit {};

	ostream& operator<<(ostream& os, ForceEofBit)
	{
		os.setstate(std::ios::eofbit);
		return os;
	}

	ostream& operator<<(ostream& os, ForceFailBit)
	{
		os.setstate(std::ios::failbit);
		return os;
	}

	ostream& operator<<(ostream& os, ForceBadBit)
	{
		os.setstate(std::ios::badbit);
		return os;
	}
}

void TestLogging::testBitCheck()
{
	CaptureLogOutput capture(g_logger);

	infostream << "EOF is " << ForceEofBit{} << std::endl;
	infostream << "Fail is " << ForceFailBit{} << std::endl;
	infostream << "Bad is " << ForceBadBit{} << std::endl;

	auto logs = capture.take();
	UASSERTEQ(size_t, logs.size(), 3);
	UASSERTEQ(std::string, logs[0].text, "EOF is (ostream:eofbit)");
	UASSERTEQ(std::string, logs[1].text, "Fail is (ostream:failbit)");
	UASSERTEQ(std::string, logs[2].text, "Bad is (ostream:badbit)");
}
// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

#include "test.h"

#include "log.h"
#include "porting.h"
#include "settings.h"
#include "util/serialize.h"
#include "network/peerhandler.h"
#include "network/mtp/internal.h"
#include "network/networkpacket.h"
#include "network/socket.h"

class TestConnection : public TestBase {
public:
	TestConnection()
	{
		if (INTERNET_SIMULATOR == false)
			TestManager::registerTestModule(this);
	}

	const char *getName() { return "TestCo


}

// Destroy function used when embedding client stats in call context.
void DestroyClientStats(void* arg) {
  grpc_grpclb_client_stats_unref(static_cast<grpc_grpclb_client_stats*>(arg));
}

void GrpcLb::PendingPickSetMetadataAndContext(PendingPick* pp) {
  /* if connected_subchannel is nullptr, no pick has been made by the RR
   * policy (e.g., all addresses failed to connect). There won't be any
   * user_data/token available */
  if (pp->pick->connected_subchannel != nullptr) {
    if (!GRPC_MDISNULL(pp->lb_token)) {
      AddLbTokenToInitialMetadata(GRPC_MDELEM_REF(pp->lb_token),
                                  &pp->pick->lb_token_mdelem_storage,
                                  pp->pick->initial_metadata);
    } else {
      gpr_log(GPR_ERROR,
              "[grpclb %p] No LB token for connected subchannel pick %p",
              pp->grpclb_policy, pp->pick);
      abort();
    }
    // Pass on client stats via context. Passes ownership of the reference.
    if (pp->client_stats != nullptr) {
      pp->pick->subchannel_call_context[GRPC_GRPCLB_CLIENT_STATS].value =
          pp->client_stats;
      pp->pick->subchannel_call_context[GRPC_GRPCLB_CLIENT_STATS].destroy =
          DestroyClientStats;
    }
  } else {
    if (pp->client_stats != nullptr) {
      grpc_grpclb_client_stats_unref(pp->client_stats);
    }
  }
}

/* The \a on_complete closure passed as part of the pick requires keeping a
 * reference to its associated round robin instance. We wrap this closure in
 * order to unref the round robin instance upon its invocation */
void GrpcLb::OnPendingPickComplete(void* arg, grpc_error* error) {
  PendingPick* pp = static_cast<PendingPick*>(arg);
  PendingPickSetMetadataAndContext(pp);
  GRPC_CLOSURE_SCHED(pp->original_on_complete, GRPC_ERROR_REF(error));
  Delete(pp);
}

GrpcLb::PendingPick* GrpcLb::PendingPickCreate(PickState* pick) {
  PendingPick* pp = New<PendingPick>();
  pp->grpclb_policy = this;
  pp->pick = pick;
  GRPC_CLOSURE_INIT(&pp->on_complete, &GrpcLb::OnPendingPickComplete, pp,
                    grpc_schedule_on_exec_ctx);
  pp->original_on_complete = pick->on_complete;
  pick->on_complete = &pp->on_complete;
  return pp;
}

void GrpcLb::AddPendingPick(PendingPick* pp) {
  pp->next = pending_picks_;
  pending_picks_ = pp;
}

//
// PendingPing
//

void GrpcLb::AddPendingPing(grpc_closure* on_initiate, grpc_closure* on_ack) {
  PendingPing* pping = New<PendingPing>();
  pping->on_initiate = on_initiate;
  pping->on_ack = on_ack;
  pping->next = pending_pings_;
  pending_pings_ = pping;
}

//
// code for interacting with the RR policy
//

// Performs a pick over \a rr_policy_. Given that a pick can return
// immediately (ignoring its completion callback), we need to perform the
// cleanups this callback would otherwise be responsible for.
// If \a force_async is true, then we will manually schedule the
// completion callback even if the pick is available immediately.
bool GrpcLb::PickFromRoundRobinPolicyLocked(bool force_async, PendingPick* pp) {
  // Check for drops if we are not using fallback backend addresses.
  if (serverlist_ !=


CreateFileA href "../../../dao/artifact/d3f:WindowsCreateFileA";
            click d3f:WindowsNtCreatePagingFile href "../../../dao/artifact/d3f:WindowsNtCreatePagingFile";   d3f:WindowsNtCreatePagingFile["Windows NtCreatePagingFile"] --> | subClassOf | d3f:OSAPICreateFile["OS API Create File"];

          class d3f:OSAPICreateFile inbound_node;
          style d3f:OSAPICreateFile fill:#fff4dd;

          class d3f:WindowsNtCreatePagingFile RootArtifactNode;
          style d3f:WindowsNtCreatePagingFile fill:#fff4dd;

          click d3f:OSAPICreateFile href "../../../dao/artifact/d3f:OSAPICreateFile";
          click d3f:WindowsNtCreatePagingFile href "../../../dao/artifact/d3f:WindowsNtCreatePagingFile";

Inferred Relationships

This page is experimental and may change significantly in future releases.

Hierarchy

(filtered)

<button style="background-color: #fff4dd; border: hsl(40.5882352941,60%,83.3333333333%) 1px solid;margin-bottom: 1px;" class="small svelte-pwso03">Digital Artifact</button>
<button style="background-color: #fff4dd; border: hsl(40.5882352941,60%,83.3333333333%) 1px solid;margin-bottom: 1px;" class="small svelte-pwso03">Digital Information </button>
<button style="background-color: #fff4dd; border: hsl(40.5882352941,60%,83.3333333333%) 1px solid;margin-bottom: 1px;" class="small svelte-pwso03">Software</button>
<button style="background-color: #fff4dd; border: hsl(40.5882352941,60%,83.3333333333%) 1px solid;margin-bottom: 1px;" class="small svelte-pwso03">OS API Function </button>
<a target="_self" href="../../../dao/artifact/d3f:OSAPISystemFunction"


--================================================================
--
-- 配置
--
--================================================================

-- 怪物
monsters = {
	{ config_id = 600, monster_id = 20010501, pos = { x = 2750.2, y = 251.5, z = -369.9 }, rot = { x = 0.0, y = 186.9, z = 0.0 }, level = 12, drop_tag = "史莱姆" },
	{ config_id = 601, monster_id = 20010701, pos = { x = 2750.8, y = 251.5, z = -367.8 }, rot = { x = 0.0, y = 209.3, z = 0.0 }, level = 12, drop_tag = "史莱姆" },
	{ config_id = 602, monster_id = 20010501, pos = { x = 2748.8, y = 251.0, z = -367.1 }, rot = { x = 0.0, y = 150.9, z = 0.0 }, level = 12, drop_tag = "史莱姆" }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
}

-- 区域
regions = {
	{ config_id = 274, shape = RegionShape.SPHERE, radius = 5, pos = { x = 2750.6, y = 251.7, z = -369.6 } }
}

-- 触发器
triggers = {
	{ name = "ENTER_REGION_274", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_274", action = "action_EVENT_ENTER_REGION_274" }
}

-- 变量
variables = {
}

--================================================================
--
-- 初始化配置
--
--================================================================

-- 初始化时创建
init_config = {
	suite =


  << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_AES       << true  << kdbx4;

    QTest::newRow("Argon2           + ChaCha20")              << KeePass2::KDF_ARGON2    << KeePass2::CIPHER_CHACHA20  << false << kdbx4;
    QTest::newRow("AES-KDF          + ChaCha20")              << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_CHACHA20  << false << kdbx4;
    QTest::newRow("AES-KDF (legacy) + ChaCha20")              << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_CHACHA20  << false << kdbx3;
    QTest::newRow("Argon2           + ChaCha20 + CustomData") << KeePass2::KDF_ARGON2    << KeePass2::CIPHER_CHACHA20  << true  << kdbx4;
    QTest::newRow("AES-KDF          + ChaCha20 + CustomData") << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_CHACHA20  << true  << kdbx4;
    QTest::newRow("AES-KDF (legacy) + ChaCha20 + CustomData") << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_CHACHA20  << true  << kdbx4;

    QTest::newRow("Argon2           + Twofish")               << KeePass2::KDF_ARGON2    << KeePass2::CIPHER_TWOFISH   << false << kdbx4;
    QTest::newRow("AES-KDF          + Twofish")               << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_TWOFISH   << false << kdbx4;
    QTest::newRow("AES-KDF (legacy) + Twofish")               << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_TWOFISH   << false << kdbx3;
    QTest::newRow("Argon2           + Twofish  + CustomData") << KeePass2::KDF_ARGON2    << KeePass2::CIPHER_TWOFISH   << true  << kdbx4;
    QTest::newRow("AES-KDF          + Twofish  + CustomData") << KeePass2::KDF_AES_KDBX4 << KeePass2::CIPHER_TWOFISH   << true  << kdbx4;
    QTest::newRow("AES-KDF (legacy) + Twofish  + CustomData") << KeePass2::KDF_AES_KDBX3 << KeePass2::CIPHER_TWOFISH   << true  << kdbx4;
}

void TestKdbx4::testUpgradeMasterKeyIntegrity()
{
    QFETCH(QString, upgradeAction);
    QFETCH(quint32, expectedVersion);

    // prepare composite key
    PasswordKey passwordKey("turXpGMQiUE6CkPvWacydAKsnp4cxz");

    QByteArray fileKeyBytes("Ma6hHov98FbPeyAL22XhcgmpJk8xjQ");
    QBuffer fileKeyBuffer(&fileKeyBytes);
    fileKeyBuffer.open(QBuffer::ReadOnly);
    FileKey fileKey;
    fileKey.load(&fileKeyBuffer);

    auto crKey = QSharedPointer<MockChallengeResponseKey>::create(QByteArray("azdJnbVCFE76vV6t9RJ2DS6xvSS93k"));

    CompositeKey compositeKey;
    compositeKey.addKey(passwordKey);
    compositeKey.addKey(fileKey);
    compositeKey.addChallengeResponseKey(crKey);

    QScopedPointer<Database> db(new Database());
    db->setKey(compositeKey);

    // upgrade the database by a specific method
    if (upgradeAction == "none") {
        // do nothing
    } else if (upgradeAction == "meta-customdata") {
        db->metadata()->customData()->set("abc", "def");
    } else if (upgradeAction == "kdf-aes-kdbx3") {
        db->changeKdf(KeePass2::uuidTo


      ["R75", "D30", "R83", "U83", "L12", "D49", "R71", "U7", "L72"],
      ["U62", "R66", "U55", "R34", "D71", "R55", "D58", "R83"]
    ],
    expected: 159
  },
  {
    paths: [
      [
        "R98",
        "U47",
        "R26",
        "D63",
        "R33",
        "U87",
        "L62",
        "D20",
        "R33",
        "U53",
        "R51"
      ],
      ["U98", "R91", "D20", "R16", "D67", "R40", "U7", "R15", "U6", "R7"]
    ],
    expected: 135
  }
];

function main() {
  // REAL INPUT
  const paths = getInput();
  resetBoard();
  let pathIndex: 0 | 1 = 0;
  paths.forEach(path => {
    runPath(path, pathIndex);
    pathIndex++;
  });
  const crossers = drawBoard();
  const answer = getMinDistance(crossers);

  console.log({ answer });

  // TEST INPUT
  testCases.forEach(({ paths, expected }) => {
    resetBoard();
    let pathIndex: 0 | 1 = 0;
    paths.forEach(path => {
      runPath(path, pathIndex);
      pathIndex++;
    });
    const crossers = drawBoard();
    const answer = getMinDistance(crossers);

    console.log({ answer, expected });
    console.log("-------------------");
  });
}

withTime(main);

function runPath(path: string[], pathIndex: 0 | 1) {
  let coords = [0, 0];
  path.forEach(instruction => {
    const [x, y] = coords;
    const direction = instruction[0];
    const count = Number(instruction.substring(1));

    if (direction === "U") {
      for (let i = y; i <= y + count; i++) {
        setVisited(x, i, pathIndex);
      }
      coords[1] = coords[1] + count;
    } else if (direction === "D") {
      for (let i = y; i >= y - count; i--) {
        setVisited(x, i, pathIndex);
      }
      coords[1] = coords[1] - count;
    } else if (direction === "R") {
      for (let i = x; i <= x + count; i++) {
        setVisited(i, y, pathIndex);
      }
      coords[0] = coords[0] + count;
    } else if (direction === "L") {
      for (let i = x; i >= x - count; i--) {
        setVisited(i, y, pathIndex);
      }
      coords[0] = coords[0] - count;
    }
  });
}

function getMinDistance(crossers: Contender[]) {
  return crossers.reduce((acc, cur) => {
    if (cur.dist < acc) acc = cur.dist;
    return acc;
  }, Number.MAX_SAFE_INTEGER);
}

interface Contender extends Coordinate {
  dist: number;
}

function drawBoard(): Contender[] {
  const crossers = [];

  for (let [key, value] of board.entries()) {
    if (value[0] === true && value[1] === true && key !== "0,0") {
      const { x, y } = getCoordsFromKey(key);
      crossers.push({
        x,
        y,
        dist: getManhattanDistance({ x: 0, y: 0 }, { x, y })
      });
    }
  }

  return crossers;
}

function setVisited(x: number, y: number, path: 0 | 1) {
  const key = makeKey(x, y);

  // initialize if first visit
  if (!board.has(key)) {
    board.set(key, { 0: false, 1: false });
  }

  const newVal = board.get(key) || {};
  new


ndows.Forms.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Media;

/// <summary>
/// Summary description for Form1.
/// </summary>
public ref class Form1: public System::Windows::Forms::Form
{
private:

   /// <summary>
   /// Required designer variable.
   /// </summary>
   System::ComponentModel::Container^ components;

public:
   Form1()
   {
      //
      // Required for Windows Form Designer support
      //
      InitializeComponent();

      //
      // TODO: Add any constructor code after InitializeComponent call
      //
   }

public:

   /// <summary>
   /// Clean up any resources being used.
   /// </summary>

   ~Form1()
   {

   }

private:

   /// <summary>
   /// Required method for Designer support - do not modify
   /// the contents of this method with the code editor.
   /// </summary>

   void InitializeComponent()
   {
      this->components = gcnew System::ComponentModel::Container;
      this->Size = System::Drawing::Size( 300, 300 );
      this->Text = "Form1";

	  Player = gcnew SoundPlayer();
	  this->Player->LoadCompleted += gcnew System::ComponentModel::AsyncCompletedEventHandler( this, &Form1::Player_LoadCompleted );
   }

   /// <summary>
   /// The main entry point for the application.
   /// </summary>
   //<Snippet1>
private:
   SoundPlayer^ Player;

   void loadSoundAsync()
   {
      // Note: You may need to change the location specified based on
      // the location of the sound to be played.
      this->Player->SoundLocation = "http://www.tailspintoys.com/sounds/stop.wav";
      this->Player->LoadAsync();
   }

   void Player_LoadCompleted( Object^ /*sender*/, System::ComponentModel::AsyncCompletedEventArgs^ /*e*/ )
   {
      if (this->Player->IsLoadCompleted)
      {
         this->Player->PlaySync();
      }
   }
   //</Snippet1>
};

[STAThread]
int main()
{
   Application::Run( gcnew Form1 );
}

#using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;

namespace PropChanged
{
   public ref class MyTextBox: public TextBox
   {
      // <snippet1>
   protected:
      virtual void OnTextChanged( System::EventArgs^ e ) override
      {
         try
         {
            // Convert the text to a Double and determine
            // if it is a negative number.
            if ( Double::Parse( this->Text ) < 0 )
            {
               // If the number is negative, display it in Red.
               this->ForeColor = Color::Red;
            }
            else
            {
               // If the number is not negative, display it in Black.
               this->ForeColor = Color::Black;
            }
         }
         catch ( Exception^ )
         {
            // If there is an error, display the
            // text using the system colors.
            this->ForeColor = SystemColors::ControlText;
         }

         TextBox::OnTextChanged( e );
      }
      // </snippet1>
   };

   public ref class Form1: public System::Windows::Forms::Form
   {
   private:
      MyTextBox^ currencyTextBox;
      System::Windows::Forms::Button^ button1;
      System::ComponentModel::


力强，熟悉分布式计算框架；

3、有较好的数据意识，对电商推荐业务有丰富经验者优先；

4、工作主动性强，有责任心，沟通交流能力强

---

#### [技术专家（广告商业化方向）](https://app.mokahr.com/social-recruitment/shein/2933#/job/9740dd9f-4c27-4111-8194-ef1ad0146912)

📍 深圳市

职位描述

岗位职责:

1、电商场景下的流量分发体系建设；

2、电商场景下的广告平台建设。

任职要求：

1、计算机及相关专业本科及以上学历，具有扎实的代码功底，熟悉常用的算法和数据结构；

2、精通C++或者Java语言和框架，熟悉了解Python语言，具有良好的编程习惯，熟悉Linux开发环境，掌握设计模式；

3、掌握多线程及高性能的设计编码及性能调优，有高并发应用开发经验，对服务治理体系有充分的理解和应用；

4、熟悉Hadoop/Hive/HBase/Spark/Flink/ES等计算框架，熟悉Docker技术及Kubernetes容器调度系统；

5、具备互联网广告业务的系统架构开发经验；

6、具备大容量、高性能、分布式系统的设计开发经验。

---

#### [高级/资深算法工程师 （站内广告-策略）](https://app.mokahr.com/social-recruitment/shein/2933#/job/ffa71a5b-2d59-4d16-abb8-4cc6f2d5df5d)

📍 深圳市

职位描述

岗位职责：

1、负责电商流量策略相关算法的落地和优化，包括但不限于新品冷启、爆款打造等，与运营、产品、分析等团队深度合作，持续优化流量效率和平台生态。

2、负责流量分配调控系统的建设，与产品协作将算法能力平台化。

岗位要求：

1、熟悉常用机器学习/运筹学算


end
	end};

	[{"noexesound", "noexecutesound", "unexesound", "unexecutesound"}] = {"", "Changes the sound ID of when a command is executed to 0(So it doesn't play)", 0, "Owner", false, function(Speaker, Rank, Arguments)
		Settings.ExecuteNotificationSound = 0
	end};

	[{"char", "character"}] = {"player string/num(ID)", "Changes player's character appearance to look like the character with the id ID or string.", 2, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			CORE:ChangeCharacter(Player, Arguments[2], false, Speaker)
		end
	end};

	[{"rich", "merely"}] = {"player", "Changes player's character appearance to look like Merely", 1, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			CORE:ChangeCharacter(Player, 13416513, false, Speaker)
		end
	end};

	[{"makerm".."odellua", "luamodelma".."ker", "mml", "lmm"}] = {"player", "Changes player's character appearance to look like MakerMo".."delLua", 1, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			coroutine.wrap(function()
				CORE:ChangeCharacter(Player, 38837082, false, Speaker)
				wait(1)
				GUI:SendMessage(Player, "Wow!", "You're looking cool!", "Admin", 7)
			end)()
		end
	end, Hidden = true};

	[{"become", "bcome"}] = {"player string/num(ID)", "Changes player's character appearance to look like the character with the id ID or string and also name you.", 2, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			CORE:ChangeCharacter(Player, Arguments[2], false, Speaker, true)
		end
	end};

	[{"name", "rename"}] = {"player name", "Changes player's character name", 2, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			CORE:ChangeName(Player, Arguments[2])
		end
	end};

	[{"noname", "unname"}] = {"player", "Removes player's names from the 'name' command", 1, "Member", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			if Player.Character then
				local Head = Player.Character:FindFirstChild("Label")
				if Head then Head:Destroy() end
				local Head = Player.Character:FindFirstChild("Head")
				if Head then Head.Transparency = 0 if Head:FindFirstChild("Face") then Head.face.Transparency = 0 end end
			end
		end
	end};

	[{"ogre", "shrek"}] = {"player", "Changes the player into shrek", 1, "Member", true, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Arguments[1], Speaker)
		for _,Player in pairs(Players) do
			CORE:ChangeCharacter(Player, 11397, false, Speaker)
		end
	end};

	[{"forcetp", "forcetp", "forceplace"}] = {"player num(ID)", "Forces a player to teleport to the place with the id of ID", 2, "Owner", false, function(Speaker, Rank, Arguments)
		local Players = STRING:Scan(Ar


ul3")
        public void persistMX1Test1() throws java.lang.Exception {
            super.persistMX1Test1();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test2() throws java.lang.Exception {
            super.persistMX1Test2();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test3() throws java.lang.Exception {
            super.persistMX1Test3();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test4() throws java.lang.Exception {
            super.persistMX1Test4();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test5() throws java.lang.Exception {
            super.persistMX1Test5();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test6() throws java.lang.Exception {
            super.persistMX1Test6();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test7() throws java.lang.Exception {
            super.persistMX1Test7();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test8() throws java.lang.Exception {
            super.persistMX1Test8();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test9() throws java.lang.Exception {
            super.persistMX1Test9();
        }

        @Test
        @Override
        @TargetVehicle("stateful3")
        public void persistMX1Test10() throws java.lang.Exception {
            super.persistMX1Test10();
        }

}
package ee.jakarta.tck.persistence.core.entitytest.persist.manyXmany;

import com.sun.ts.lib.harness.Fault;
import com.sun.ts.lib.harness.SetupException;
import com.sun.ts.tests.common.base.EETest;
import com.sun.ts.tests.common.base.ServiceEETest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.container.test.api.TargetsContainer;
import org.jboss.arquillian.junit5.ArquillianExtension;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import tck.arquillian.porting.lib.spi.TestArchiveProcessor;
import tck.arquillian.protocol.common.TargetVehicle;

import java.net.URL;

@ExtendWith(ArquillianExtension.class)
@Tag("persistence")
@Tag("platform")
@Tag("tck-appclient")

@TestMethodOrder(MethodOrderer.MethodName.class)
public class ClientAppmanagedTest extends ee.jakarta.tck.persistence.core.entitytest.persist.manyXmany.Client {
    static final String VEHICLE_ARCHIVE = "jpa_core_et_persist_manyXmany_appmanaged_vehicle";

        /**
        EE


/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; version 2 of the License.

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

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */

#ifndef PFS_COLUMN_VALUES_H
#define PFS_COLUMN_VALUES_H

#include "m_string.h"                           /* LEX_STRING */

/**
  @file storage/perfschema/pfs_column_values.h
  Literal values for columns used in the
  performance schema tables (declarations).
*/

/** String, "PERFORMANCE_SCHEMA". */
extern LEX_CSTRING PERFORMANCE_SCHEMA_str;

/** String prefix for all mutex instruments. */
extern LEX_CSTRING mutex_instrument_prefix;
/** String prefix for all rwlock instruments. */
extern LEX_CSTRING rwlock_instrument_prefix;
/** String prefix for all cond instruments. */
extern LEX_CSTRING cond_instrument_prefix;
/** String prefix for all thread instruments. */
extern LEX_CSTRING thread_instrument_prefix;
/** String prefix for all file instruments. */
extern LEX_CSTRING file_instrument_prefix;
/** String prefix for all stage instruments. */
extern LEX_CSTRING stage_instrument_prefix;
/** String prefix for all statement instruments. */
extern LEX_CSTRING statement_instrument_prefix;
extern LEX_CSTRING socket_instrument_prefix;

#endif


expected = string.Format(expected, VersionInfo.VersionDisplayText);

            UnitTestHelper.AssertStringsEqualCharacterByCharacter(expected, writer.Xml);
        }

        /// <summary>
        /// Makes sure the RSS Writer can write the delta of a feed based
        /// on the RFC3229 with feeds
        /// <see href="http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html"/>.
        /// </summary>
        [Test]
        [RollBack2]
        public void RssWriterHandlesRFC3229DeltaEncoding()
        {
            UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "", "Subtext.Web");

            var blogInfo = new Blog();
            BlogRequest.Current.Blog = blogInfo;
            blogInfo.Host = "localhost";
            blogInfo.Subfolder = "";
            blogInfo.Email = "Subtext@example.com";
            blogInfo.RFC3229DeltaEncodingEnabled = true;
            blogInfo.TimeZoneId = TimeZonesTest.PacificTimeZoneId;

            HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

            var entries = new List<Entry>(CreateSomeEntriesDescending());
            var subtextContext = new Mock<ISubtextContext>();
            subtextContext.FakeSyndicationContext(blogInfo, "/", "Subtext.Web", null);
            Mock<BlogUrlHelper> urlHelper = Mock.Get(subtextContext.Object.UrlHelper);
            urlHelper.Setup(u => u.BlogUrl()).Returns("/Subtext.Web/");
            urlHelper.Setup(u => u.EntryUrl(It.IsAny<Entry>())).Returns("/Subtext.Web/whatever");

            // Tell the write we already received 1002 published 6/25/1976.
            var writer = new RssWriter(new StringWriter(), entries,
                                       DateTime.ParseExact("06/25/1976", "MM/dd/yyyy", CultureInfo.InvariantCulture),
                                       true, subtextContext.Object);

            // We only expect 1003 and 1004
            string expected =
                @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/"">" +
                Environment.NewLine
                + indent() + "<channel>" + Environment.NewLine
                + indent(2) + "<title />" + Environment.NewLine
                + indent(2) + "<link>http://localhost/Subtext.Web/Default.aspx</link>" + Environment.NewLine
                + indent(2) + "<description />" + Environment.NewLine
                + indent(2) + "<language>en-US</language>" + Environment.NewLine
                + indent(2) + "<copyright>Subtext Weblog</copyright>" + Environment.NewLine
                + indent(2) + "<generator>{0}</generator>" + Environment.NewLine
                + indent(2) + "<image>" + Environment.NewLine
                + indent(3) + "<title />" + Environment.NewLine
                + indent(3) + "<url>http://localhost/Subtext.Web/images/RSS2Image.gif</url>" + Environment.NewLine
                + indent(3) + "<link>http://localhost/Subtext.Web/Default.aspx</link>" + Environment.NewLine
                + indent(3) + "<width>77</width>" + Environment.NewLine
                + indent(3) + "<height>60</height>" + Environment.NewLine
                + indent(2) + "</image>" + Environment.NewLine
                + indent(2) + @"<item>" + Environment.NewLine
                + indent(3) + @"<title>Title of 1004.</title>" + Environment.NewLine
                + indent(3) + @"<link>http://localhost/Subtext.Web/whatever</link>" + Enviro


429rem}h4{font-size:1.07142857rem}h5{font-size:1rem}h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,p:first-child{margin-top:0}h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,p:last-child{margin-bottom:0}p{margin:0 0 1em;line-height:1.4285em}a:hover{color:#1e70bf;text-decoration:none}::-webkit-selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}::-moz-selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}::selection{background-color:#CCE2FF;color:rgba(0,0,0,.87)}input::-webkit-selection,textarea::-webkit-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::-moz-selection,textarea::-moz-selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}input::selection,textarea::selection{background-color:rgba(100,100,100,.4);color:rgba(0,0,0,.87)}.ui.button{cursor:pointer;display:inline-block;min-height:1em;outline:0;border:none;vertical-align:baseline;background:#E0E1E2;color:rgba(0,0,0,.6);font-family:Roboto,'Helvetica Neue',Arial,Helvetica,sans-serif;margin:0 .25em 0 0;padding:.78571429em 1.5em;text-transform:none;text-shadow:none;font-weight:700;line-height:1em;font-style:normal;text-align:center;text-decoration:none;border-radius:.28571429rem;box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;will-change:'';-webkit-tap-highlight-color:transparent}.ui.button:hover{background-color:#CACBCD;background-image:none;box-shadow:0 0 0 1px transparent inset,0 0 0 0 rgba(34,36,38,.15) inset;color:rgba(0,0,0,.8)}.ui.button:hover .icon{opacity:.85}.ui.button:focus{background-color:#CACBCD;color:rgba(0,0,0,.8);background-image:''!important;box-shadow:''!important}.ui.button:focus .icon{opacity:.85}.ui.active.button:active,.ui.button:active{background-color:#BABBBC;background-image:'';color:rgba(0,0,0,.9);box-shadow:0 0 0 1px transparent inset,none}.ui.active.button{background-color:#C0C1C2;background-image:none;box-shadow:0 0 0 1px transparent inset;color:rgba(0,0,0,.95)}.ui.active.button:hover{background-color:#C0C1C2;background-image:none;color:rgba(0,0,0,.95)}.ui.active.button:active{background-color:#C0C1C2;background-image:none}.ui.loading.loading.loading.loading.loading.loading.button{position:relative;cursor:default;text-shadow:none!important;color:transparent!important;opacity:1;pointer-events:auto;-webkit-transition


piter.api.Assertions.*
import wasm.*
import wasm.host.soroban.SorobanImport.Buf
import wasm.host.soroban.SorobanImport.Map
import wasm.host.soroban.SorobanImport.Ledger
import wasm.host.soroban.Val.Tag.*
import wasm.wat.*

class LedgerModuleTest : SorobanTestFixture() {
    companion object {
        val STORAGE_TYPE_TEMPORARY = i64(0)
        val STORAGE_TYPE_PERSISTENT = i64(1)
        val STORAGE_TYPE_INSTANCE = i64(2)
    }

    @Test
    fun `contract data with simple key`() {
        assertTrue(verifyWasm {
            for (i in 1..5) {
                Ledger.put_contract_data(U32Val(i), U32Val(i), STORAGE_TYPE_TEMPORARY)
            }
            for (i in 1..5) {
                certoraAssert(Ledger.has_contract_data(U32Val(i), STORAGE_TYPE_TEMPORARY) eq TrueVal)
                certoraAssert(Ledger.get_contract_data(U32Val(i), STORAGE_TYPE_TEMPORARY) eq U32Val(i))
            }
            for (i in 1..5) {
                Ledger.put_contract_data(U32Val(i), U32Val(i + 10), STORAGE_TYPE_PERSISTENT)
            }
            for (i in 1..5) {
                certoraAssert(Ledger.has_contract_data(U32Val(i), STORAGE_TYPE_TEMPORARY) eq TrueVal)
                certoraAssert(Ledger.get_contract_data(U32Val(i), STORAGE_TYPE_TEMPORARY) eq U32Val(i))
                certoraAssert(Ledger.has_contract_data(U32Val(i), STORAGE_TYPE_PERSISTENT) eq TrueVal)
                certoraAssert(Ledger.get_contract_data(U32Val(i), STORAGE_TYPE_PERSISTENT) eq U32Val(i + 10))
            }
            Ledger.del_contract_data(U32Val(3), STORAGE_TYPE_TEMPORARY)
            certoraAssert(Ledger.has_contract_data(U32Val(3), STORAGE_TYPE_TEMPORARY) eq FalseVal)
            certoraAssert(Ledger.has_contract_data(U32Val(3), STORAGE_TYPE_PERSISTENT) eq TrueVal)
        })
    }

    @Test
    fun `contract data with string key`() {
        assertTrue(verifyWasm(
            watModule {
                memory()
                dataSegment("d0", 1000, "key1")
                dataSegment("d1", 2000, "key2")
                func(exportName = "entry").implement {
                    val key1 = Buf.string_new_from_linear_memory(U32Val(1000), U32Val(4))
                    val key2 = Buf.string_new_from_linear_memory(U32Val(2000), U32Val(4))
                    val key2Copy = Buf.string_new_from_linear_memory(U32Val(2000), U32Val(4))

                    certoraAssert(key2Copy valEq key2)

                    Ledger.put_contract_data(key1, U32Val(1), STORAGE_TYPE_TEMPORARY)
                    Ledger.put_contract_data(key2, U32Val(2), STORAGE_TYPE_PERSISTENT)

                    certoraAssert(Ledger.has_contract_data(key1, STORAGE_TYPE_TEMPORARY) eq TrueVal)
                    certoraAssert(Ledger.get_contract_data(key1, STORAGE_TYPE_TEMPORARY) eq U32Val(1))
                    certoraAssert(Ledger.has_contract_data(key2, STORAGE_TYPE_PERSISTENT) eq TrueVal)
                    certoraAssert(Ledger.get_contract_data(key2, STORAGE_TYPE_PERSISTENT) eq U32Val(2))
                    certoraAssert(Ledger.has_contract_data(key2Copy, STORAGE_TYPE_PERSISTENT) eq TrueVal)
                    certoraAssert(Ledger.get_contract_data(key2Copy, STORAGE_TYPE_PERSISTENT) eq U32Val(2))
                }
            },
            "entry"
        ))


estrict);
int gettimeofday(struct timeval *restrict, struct timezone *restrict);
char *realpath(const char *restrict, char *restrict);
char *basename(char *);
char *dirname(char *);
typedef int clockid_t;
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
static const int TIMER_ABSTIME = 1;
int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
void *malloc(size_t);
void *calloc(size_t, size_t);
void free(void *);
void *memset(void *, int, size_t);
void *memchr(const void *, int, size_t);
void *memrchr(const void *, int, size_t);
void *memmem(const void *, size_t, const void *, size_t);
size_t strlen(const char *);
size_t strnlen(const char *, size_t);
char *strdup(const char *);
char *strndup(const char *, size_t);
int strcoll(const char *, const char *);
int strcmp(const char *, const char *);
int strcasecmp(const char *, const char *);
static const int F_OK = 0;
static const int R_OK = 4;
static const int W_OK = 2;
static const int X_OK = 1;
int access(const char *, int);
typedef struct _IO_FILE FILE;
typedef long long unsigned int dev_t;
typedef long unsigned int ino_t;
typedef unsigned int mode_t;
typedef unsigned int nlink_t;
typedef unsigned int uid_t;
typedef unsigned int gid_t;
typedef long int blksize_t;
typedef long int blkcnt_t;
struct stat {
  long long unsigned int st_dev;
  short unsigned int __pad1;
  long unsigned int st_ino;
  unsigned int st_mode;
  unsigned int st_nlink;
  unsigned int st_uid;
  unsigned int st_gid;
  long long unsigned int st_rdev;
  short unsigned int __pad2;
  long int st_size;
  long int st_blksize;
  long int st_blocks;
  struct timespec st_atim;
  struct timespec st_mtim;
  struct timespec st_ctim;
  long unsigned int __glibc_reserved4;
  long unsigned int __glibc_reserved5;
};
unsigned int getuid(void);
FILE *fopen(const char *restrict, const char *restrict);
int stat(const char *restrict, struct stat *restrict);
int fstat(int, struct stat *);
int lstat(const char *restrict, struct stat *restrict);
size_t fread(void *restrict, size_t, size_t, FILE *restrict);
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
int fclose(FILE *);
int fflush(FILE *);
int feof(FILE *);
int ferror(FILE *);
int printf(const char *, ...);
int sprintf(char *, const char *, ...);
int fprintf(FILE *restrict, const char *restrict, ...);
int fputc(int, FILE *);
int fileno(FILE *);
char *strerror(int);
int fsync(int);
int fdatasync(int);
int setenv(const char *, const char *, int);
int unsetenv(const char *);
int _putenv(const char *);
typedef unsigned int id_t;
enum __priority_which {
  PRIO_PROCESS = 0,
  PRIO_PGRP = 1,
  PRIO_USER = 2,
};
typedef enum __priority_which __priority_which_t;
int getpriority(__priority_which_t, id_t);
int setpriority(__priority


 isSecure() {
        return false;
    }

    @Override
    public void start() throws IOException {
        selector = Selector.open();
        channel = ServerSocketChannel.open();
        channel.configureBlocking(false);
        InetSocketAddress isa  = new InetSocketAddress(super.getIpAddress(), super.getPort());
        channel.socket().bind(isa);
        channel.register(selector, SelectionKey.OP_ACCEPT);
        selectorThread = new Thread(createProcessorTask());
        selectorThread.start();
        selectorThread.setName("NioSelector-" + getTransport() + '-' + getIpAddress().getHostAddress() + '/' + getPort());
    }

    protected ProcessorTask createProcessorTask() {
    	return new ProcessorTask();
    }

    @Override
    public void stop() {
    	try {
    		if(selector.isOpen())
    			selector.close();

    		nioHandler.stop();
    	} catch (Exception ex) {
    		logger.logError("Problem closing channel " , ex);
    	}
        try {
            channel.close();
        } catch (Exception ex) {
    		logger.logError("Problem closing channel " , ex);
    	}
    }

}

/*******************************************************************************
* Product of NIST/ITL Advanced Networking Technologies Division (ANTD).        *
*******************************************************************************/

package gov.nist.javax.sip.header.extensions;

import java.text.ParseException;

import javax.sip.header.ExtensionHeader;
import gov.nist.javax.sip.header.*;

import gov.nist.javax.sip.address.*;
/*
* This code has been contributed by the author to the public domain.
*/

/**
 * ReferredBy SIP Header. RFC 3892
 *
 * @version JAIN-SIP-1.2
 *
 * @author Peter Musgrave.
 *
 *
 */
public final class ReferredBy
    extends AddressParametersHeader implements ExtensionHeader, ReferredByHeader {

    // TODO: Need a unique UID
    private static final long serialVersionUID = 3134344915465784267L;

    // TODO: When the MinSEHeader is added to javax - move this there...pmusgrave
    public static final String NAME = "Referred-By";

    /** default Constructor.
     */
    public ReferredBy() {
        super(NAME);
    }

    public void setValue(String value) throws ParseException {
        // not implemented.
        throw new ParseException(value,0);

    }

    /**
     * Encode the header content into a String.
     * @return String
     */
    public StringBuilder encodeBody(StringBuilder retval) {
        if (address == null)
            return null;
//        String retval = "";
        if (address.getAddressType() == AddressImpl.ADDRESS_SPEC) {
            retval.append(LESS_THAN);
        }
        address.encode(retval);
        if (address.getAddressType() == AddressImpl.ADDRESS_SPEC) {
            retval.append(GREATER_THAN);
        }

        if (!parameters.isEmpty()) {
            retval.append(SEMICOLON);
            parameters.encode(retval);
        }
        return retval;
    }
}
/*
 * $Log: not supported by cvs2svn $
 * Revision 1.3  2009/07/17 18:57:42  emcho
 * Converts indentation tabs to spaces so that we have a uniform indentation policy in the whole project.
 *
 * Revision 1.2  2006/10/27 20:58:31  mranga
 * Issue number:
 * Obtained from:
 * Submitted by:
 * Reviewed by:   mranga
 * doc fixups
 * CVS: ----------------------------------------------------------------------
 * CVS: Issue number:
 * CVS:   If this change addresses one or more issues,
 * CVS:   then enter the issue number(s) here.
 * CVS: Obtained from:
 *


et('Pikachu')!.types[1]).toBeUndefined();
        expect(Gen(7).species.get('Mew')!.baseStats)
          .toEqual({hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100});
        expect(Gen(1).species.get('Tauros')!.baseStats)
          .toEqual({hp: 75, atk: 100, def: 95, spa: 70, spd: 70, spe: 110});
        expect(Gen(6).species.get('Pelipper')!.baseStats.spa).toBe(85);
        expect(Gen(7).species.get('Pelipper')!.baseStats.spa).toBe(95);
        expect(Gen(6).species.get('Greninja')!.abilities).toEqual({'0': 'Torrent', 'H': 'Protean'});
        expect(Gen(7).species.get('Greninja')!.abilities)
          .toEqual({'0': 'Torrent', 'H': 'Protean', 'S': 'Battle Bond'});
        expect(Gen(3).species.get('Clefable')!.abilities).toEqual({'0': 'Cute Charm'});
        expect(Gen(8).species.get('Clefable')!.abilities)
          .toEqual({'0': 'Cute Charm', '1': 'Magic Guard', H: 'Unaware'});
        expect(Gen(5).species.get('Milotic')!.abilities).toEqual({'0': 'Marvel Scale'});
        expect(Gen(6).species.get('Milotic')!.abilities)
          .toEqual({'0': 'Marvel Scale', '1': 'Competitive', H: 'Cute Charm'});
        expect(Gen(2).species.get('Snorlax')!.tier).toBe('OU');
        expect(Gen(5).species.get('Snorlax')!.tier).toBe('UU');
        expect(Gen(3).species.get('Chansey')!.prevo).toBeUndefined();
        expect(Gen(4).species.get('Chansey')!.prevo).toBe('Happiny');
        expect(Gen(2).species.get('Chansey')!.evos).toEqual(['Blissey']);
        expect(Gen(7).species.get('Charizard-Mega-X')!.baseSpecies).toBe('Charizard');
        expect(Gen(7).species.get('Giratina-O')!.forme).toBe('Origin');
        expect(Gen(7).species.get('Giratina')!.baseForme).toBe('Altered');
        expect(Gen(7).species.get('Shaymin')!.otherFormes).toEqual(['Shaymin-Sky']);
        expect(Gen(7).species.get('Gastrodon')!.cosmeticFormes).toEqual(['Gastrodon-East']);
        expect(Gen(7).species.get('Garchomp-Mega')!.isMega).toBe(true);
        expect(Gen(7).species.get('Yanmega')!.isMega).toBeUndefined();
        expect(Gen(7).species.get('Kyogre-Primal')!.isPrimal).toBe(true);
        expect(Gen(1).species.get('Charizard')!.otherFormes).toBeUndefined();
        expect(Gen(7).species.get('Charizard')!.otherFormes)
          .toEqual(['Charizard-Mega-X', 'Charizard-Mega-Y']);
        expect(Gen(2).species.get('Venusaur')!.formes).toBeUndefined();
        expect(Gen(2).species.get('Venusaur')!.formeOrder).toBeUndefined();
        expect(Gen(3).species.get('Nosepass')!.evos).toBeUndefined();
        expect(Gen(4).species.get('Nosepass')!.evos).toEqual(['Probopass']);
        expect(Gen(3).species.get


',
            value: `\`${moment(playerData.player.lastLogin).format(
              'LL LTS'
            )}\``,
            inline: true,
          },
          {
            name: 'Name History',
            value: playerData.player.history.join(', '),
            inline: false,
          }
        );
    } catch (stacktrace) {
      return APIErrorMessage;
    }
  }

  /**
   * Creates a personal embed for the queried guild.
   * @param query - The query (guild) that was asked.
   */
  public async createEmbedGuild(query: any): Promise<MessageEmbed> {
    try {
      const guildData = await super.getGuild(query, query);

      return new MessageEmbed()
        .setAuthor(
          `Guild • ${guildData.name}`,
          `https://fsa.zobj.net/crop.php?r=by0jGANgnc4W22sOr9z4e9V-f5s5J9Ud5UMMEyggbnr0Mr3JYYoK16DCVlQulNDLSO6xrestaTY37IUXFdx5A-h1LOgW6zaWU03pvnFnVw-6C37MyBorvI6Fc-qdaFTVsjNzrGm-ZcZDSmu4`,
          `https://hypixel.net`
        )
        .addFields(
          {
            name: 'Description',
            value: guildData.description,
            inline: false,
          },
          {
            name: 'Level',
            value: `${guildData.level}`,
            inline: true,
          },
          {
            name: 'Created At',
            value: `${moment(guildData.createdAt).format('LL LTS')}`,
            inline: true,
          }
        );
    } catch (stacktrace) {
      return APIErrorMessage;
    }
  }

  /**
   * Creates a personal embed for Watchdog Statistics.
   */
  public async createEmbedWatchdog(): Promise<MessageEmbed> {
    try {
      const stats = await this.getWatchdogStats();

      return new MessageEmbed().setTimestamp().addFields(
        {
          name: 'Watchdog\nTotal Bans⠀⠀⠀',
          value: stats.byWatchdogTotal,
          inline: true,
        },
        {
          name: '⠀\nLast Min⠀⠀⠀',
          value: stats.byWatchdogLastMinute,
          inline: true,
        },
        {
          name: '⠀\nDaily Bans⠀⠀⠀',
          value: stats.byWatchdogRollingDay,
          inline: true,
        },
        {
          name: 'Staff\nTotal Bans⠀⠀⠀',
          value: stats.byStaffTotal,
          inline: true,
        },
        {
          name: '⠀\nDaily Bans⠀⠀⠀',
          value: stats.byStaffRollingDay,
          inline: true,
        },
        { name: '⠀', value: '⠀', inline: true }
      );
    } catch (stacktrace) {
      return APIErrorMessage;
    }
  }

  /**
   * Generates an embed for Bedwars Stats.
   * @param query - The query (player) that was asked.
   */
  public async createEmbedPlayerBedwars(query: string): Promise<MessageEmbed> {
    try {
      const player = await super.getPlayer(query);
      const { bedwars } = player.stats;

      // 📡 Subsitutes not available statistics.
      const avgDeaths =
        Math.round((bedwars.deaths / bedwars.playedGames) * 100) / 100;
      const AK


a.75.75 0 0 1 0-1.5h.77l.26-1.41A2.25 2.25 0 0 1 6 9h6.09c1.03 0 1.93.7 2.18 1.7l.39 1.55h.6a.75.75 0 1 1 0 1.5h-.11c.53.5.86 1.21.86 2v4.75a1.5 1.5 0 1 1-3 0V20H5v.5a1.5 1.5 0 1 1-3 0v-4.75c0-.79.33-1.5.86-2Zm2.4-2.64L4.9 13h8.35v-.12l-.44-1.81a.75.75 0 0 0-.73-.57H5.99a.75.75 0 0 0-.73.61ZM13 16.5a1 1 0 1 0-2 0 1 1 0 0 0 2 0Zm-7 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"/>") { } }
    public class VehicleCarParking : Icon { public VehicleCarParking() : base("VehicleCarParking", IconVariant.Filled, IconSize.Size24, "<path d=\"M17.25 2a1 1 0 0 1 1-1H22a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-1v14.25a.75.75 0 0 1-1.5 0V8h-1.25a1 1 0 0 1-1-1V2ZM15.8 3l.45.03v1.53c-.14-.04-.3-.06-.45-.06H8.2c-.8 0-1.5.55-1.7 1.33L5.71 9H18.5v9.5h-1v1.25c0 .13.11.25.25.25h.75v1.5h-.75c-.97 0-1.75-.79-1.75-1.75V18.5H8v1.25c0 .96-.78 1.75-1.75 1.75h-1.5C3.78 21.5 3 20.7 3 19.75v-8.5c0-.81.43-1.53 1.08-1.92l.2-.83h-.53a.75.75 0 0 1-.74-.65L3 7.75c0-.38.28-.7.65-.74l.1-.01h.91l.39-1.54A3.25 3.25 0 0 1 8.2 3h7.6ZM6.5 18.5h-2v1.25c0 .13.11.25.25.25h1.5c.14 0 .25-.12.25-.25V18.5Zm7.25-4.5h-3.6a.75.75 0 0 0 0 1.5h3.7a.75.75 0 0 0-.1-1.5ZM17 12a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM7 12a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z\"/>") { } }
    public class VehicleCarProfile : Icon { public VehicleCarProfile() : base("VehicleCarProfile", IconVariant.Filled, IconSize.Size24, "<path d=\"M8.03 4c-1.24 0-2.33.83-2.66 2.03l-.95 3.49A2.75 2.75 0 0 0 2 12.25v2.25c0 .86.4 1.64 1.02 2.14a3.25 3.25 0 0 0 6.32.61h4.82a3.25 3.25 0 0 0 6.25-.26A2.75 2.75 0 0 0 22 14.5v-1.69c0-1.26-.86-2.36-2.08-2.67l-2.19-.54-2.5-4.25A2.75 2.75 0 0 0 12.86 4H8.03Zm-1.2 2.42c.14-.54.63-.92 1.2-.92H9.5v4H5.98


QrcLcZObVkGSMnmGduddlxrQVpP7Qm8ZnuIKCQOMmClVrdZPOL50E1IO4o4NUcZAdLuhGQ+G1w6xConuXHouY2kd/SDJQXPHiO1RsibnWMC650SB7AYr8sPbb7YNYE5iosfStGRBZ1JoiE0cpnwgk3thSUpY/HTtrY61LHvlV2XhkwUvI1m+ah0bDH7DgzIv1ipQNqf4J5/7D8fwvj9NfPdf6lezoZl/PLn5v+4FUjvrwyg+n4v74Xu7yh+UBb4PJyLPqPK0435dIZkxc27v+WtuPD4ymbnLIcLs7HRp2iNtRpqh1fHaWejGeNp0wb0ynTpcvfXR2XTxun+reg5s0k8cXkyATQlwbvP0JwpUkmuUSvbfqHRdEGu+6Znu25nu+FXpTSnW26Y9c907M91/O90ItSurNLd+y6Z/ZZ) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
}
/* latin-ext */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(data:font/woff2;base64,d09GMgABAAAAABWoAAwAAAAAMsgAABVWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx4cLgZgAIIACskovF0LgmQAATYCJAOFRAQgBYNcB4ohG0MqVUaGjQOAOH53UZQHRgv+/5LAyRi/ObhWolrxUM8pbq7lDl3rRIaGgiAuOJCVt0Ps5weIZSHTXFnYxTJyOXIWsxjRm8VPdjMC+mm/iSg3cw9T5rF3h/Q/LWxyjIZGEpPne/b73z4zXzT9n7ESSNa8QhdfHSIvFBqJSqKZpCRakqU7P89v8w9YjRkgKhiElTziEYIgonDBRnsKKFurC/fnMtXpunQV6Y/SZQycc/ubVtFvikI/yMEvertSNMrBPqFgSWdKPvtBspupE/LWZcGtZwoWEC5rrkg8ofMMRdpay2TeJa8YHWGJhDoSwjwLC6QIFmRlhWn8a63cqaEmwFpae/wcl2wTaJtDl7VdeaZ2xOUQP0mfNwmmY8NGswVAXjy6/9NlttLOjIlkH0N3Kbq1i0pFn6YZf4+WRrMsZ9GAOsD1BVDWHmgV0gFXAXw9IrweuWigxjZ9m5SpY87SMtJe35YIYRTHMcIIp923/brZMZRqd9Ezy2y1rC2v8mVQNWKA8SQFwA4ECEDgnpMowRYsAZgRpoXRolls7HNLb2aBxySVnRGQdcdrFqMyjxVAdVURcHn


/** @file

    Copyright (c) 2017, Linaro, Ltd. <ard.biesheuvel@linaro.org>
    Copyright (c) 2022-2023, Intel Corporation. All rights reserved.

    Copyright (c) 2024 Loongson Technology Corporation Limited. All rights reserved.

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

**/

#include "Emulator.h"
#include <Library/CpuExceptionHandlerLib.h>
#include <Register/LoongArch64/Csr.h>

extern CONST UINT64  EmulatorThunk[];

VOID
EFIAPI
DefaultExceptionHandler(
  IN     EFI_EXCEPTION_TYPE  ExceptionType,
  IN OUT EFI_SYSTEM_CONTEXT  SystemContext
  );

VOID
EFIAPI
EmulatorSyncExceptionCallback (
  IN     EFI_EXCEPTION_TYPE  ExceptionType,
  IN OUT EFI_SYSTEM_CONTEXT  SystemContext
  )
{
  EFI_SYSTEM_CONTEXT_LOONGARCH64  *LoongArch64Context;
  ImageRecord                     *Record;

  LoongArch64Context = SystemContext.SystemContextLoongArch64;

  /*
   * Instruction permission faults or PC misalignment faults thunk
   * us to emulated code.
   */
   Record = ImageFindByAddress (LoongArch64Context->ERA);
   if (Record != NULL) {
     LoongArch64Context->R12 = LoongArch64Context->ERA;
     LoongArch64Context->R13 = (UINT64)Record;
     LoongArch64Context->ERA = (UINT64)EmulatorThunk;
     return;
   }

  /*
   * We can't handle these exception. Try to produce some meaningful
   * diagnostics regarding the emulated code this maps onto.
   */
  if (CpuAddrIsCodeGen (LoongArch64Context->ERA)) {
    /*
     * It looks like we crashed in the JITed code.
     *
     * TBD: can we lookup/decode the TB info?
     */
    DEBUG ((DEBUG_ERROR, "Exception occurred in TBs\n"));
  }

  if ((LoongArch64Context->ERA >= (UINT64)gDriverImage->ImageBase) &&
      (LoongArch64Context->ERA <= ((UINT64)gDriverImage->ImageBase +
                               gDriverImage->ImageSize - 1)))
  {
    DEBUG ((
      DEBUG_ERROR,
      "Exception occured at driver PC +0x%lx\n",
      LoongArch64Context->ERA - (UINT64)gDriverImage->ImageBase
      ));
  }

  /*
   * Emulate failed, dump the messages.
   */
  EmulatorDump ();
  DefaultExceptionHandler (ExceptionType, SystemContext);
}

EFI_STATUS
ArchInit (
  VOID
  )
{
  EFI_STATUS  Status;

  Status = gCpu->RegisterInterruptHandler (
                   gCpu,
                   EXCEPT_LOONGARCH_PNX << CSR_ESTAT_EXC_SHIFT,
                   &EmulatorSyncExceptionCallback
                   );
  if (EFI_ERROR (Status)) {
    DEBUG ((DEBUG_ERROR, "RegisterInterruptHandler failed: %r\n", Status));
  }

  Status = gCpu->RegisterInterruptHandler (
                   gCpu,
                   EXCEPT_LOONGARCH_ADE << CSR_ESTAT_EXC_SHIFT,
                   &EmulatorSyncExceptionCallback
                   );
  if (EFI_ERROR (Status)) {
    DEBUG ((DEBUG_ERROR, "RegisterInterruptHandler failed: %r\n", Status));
  }

  return Status;
}

VOID
ArchCleanup (
  VOID
  )
{
  EFI_STATUS  Status;

  Status = gCpu->RegisterInterruptHandler (
                   gCpu,
                   EXCEPT_LOONGARCH_PNX << CSR_ESTAT_EXC_SHIFT,
                   NULL
                   );
  ASSERT (!EFI_ERROR (Status));

  Status = gCpu->RegisterInterruptHandler (
                   gCpu,
                   EXCEPT_LOONGARCH_ADE << CSR_ESTAT_EXC_SHIFT,
                   NULL
                   );
  ASSERT (!EFI_ERROR (Status));
}


|
| Low level and interrupt routines for the Svethlana driver
|
| 2010-12-17 Torbjrn & Henrik Gild
|
|

#include "mint/asmdefs.h"

	.globl SYM(old_i6_int)
	.globl SYM(interrupt_i6)
	.extern SYM(svethlana_int)
	.globl SYM(set_old_int_lvl)
	.globl SYM(set_int_lvl6)
	.globl SYM(int_off)
	.globl SYM(int_on)

	.text

	dc.l	0x58425241		| XBRA
	dc.l	0x00000000		| (no cookie)
SYM(old_i6_int):
	ds.l	1
SYM(interrupt_i6):
	move.w	(sp),oldSR
	movem.l	a0-a6/d0-d7,-(sp)
	bsr	SYM(svethlana_int)
	movem.l	(sp)+,a0-a6/d0-d7
	rte

oldSR:		ds.w	1
save_SR:	ds.w	1

| Sets interrupt level to what wa


// Auto-generated code. Do not modify manually.
using AssetRipper.IO.Endian;
using AssetRipper.Primitives;
namespace AssetRipper.IO.Files.SerializedFiles.FileIdentifiers;
/// <summary>
/// A serialized file may be linked with other serialized files to create shared dependencies.
/// </summary>
public partial interface IFileIdentifier : IEndianWritable
{
	/// <summary>
	/// Actual file path. This path is relative to the path of the current file.
	/// </summary>
	/// <remarks>
	/// The folder "library" often needs to be translated to "resource


racy we have seen to save the best model at the end of every epoch
    best_acc = -math.inf
    best_acc_epoch = -1
    last_acc = -math.inf

    if not config.get("skip_initial_validation", False):
        last_acc = validate_one_epoch(0, val_data_loader, model, validator, validation_logger, verbose)
        best_acc = last_acc
        best_acc_epoch = 0

    save_state_dict_compressed(model, os.path.join(config["output_path"], _MODEL_OUTPUT_PATH_SUFFIX, "0.pth"))

    training_start_timestamp = datetime.now()
    for epoch in range(1, n_epochs + 1):
        train_one_epoch(epoch, train_sampler, train_data_loader, model, trainer, training_logger, verbose)

        # Save the current state of the model after every epoch
        save_state_dict_compressed(
            model, os.path.join(config["output_path"], _MODEL_OUTPUT_PATH_SUFFIX, f"{epoch}.pth")
        )

        last_acc = validate_one_epoch(epoch, val_data_loader, model, validator, validation_logger, verbose)
        if lr_scheduler.step_epoch():
            # last_acc is between 0 and 100. We need between 0 and 1
            lr_scheduler.step(last_acc / 100)

        if last_acc > best_acc:
            save_state_dict_compressed(
                model, os.path.join(config["output_path"], _MODEL_OUTPUT_PATH_SUFFIX, "best.pth")
            )
            best_acc = last_acc
            best_acc_epoch = epoch

    # Done training!
    if verbose:
        print("Done training!")
        summary_writer.close()
        with open(os.path.join(config["output_path"], "results.txt"), "w") as f:
            print(f"{start_timestamp:%Y-%m-%d %H:%M:%S}", file=f)
            print(f"{training_start_timestamp:%Y-%m-%d %H:%M:%S}", file=f)
            print(f"{datetime.now():%Y-%m-%d %H:%M:%S}", file=f)
            print(last_acc, file=f)
            print(best_acc, file=f)
            print(best_acc_epoch, file=f)

if __name__ == "__main__":
    main()