ow()
    });
  }

  /**
   * Delete a player's quest
   * @param {string} quest quest changes
   */
  deletePlayerQuest(questId: string) {
    return this.getQuest(questId).delete();
  }

  /**
   * Submit quest for team lead approval
   * @param {string} id              quest id
   * @param {Date}   completed       date completed
   * @param {string} completionProof link to completion proof
   */
  submitQuest(id: string, completed: Date, completionProof: string) {
    return this.getQuest(id).update({
      status: QuestStatus.PENDING_APPROVAL,
      submitted: Timestamp.now(),
      completed: Timestamp.fromDate(completed),
      completionProof
    });
  }

  private mapPlayerQuestData(actions: any[]): PlayerQuest[] {
    return actions.map((a) => {
      const data = a.payload.doc.data();
      return <PlayerQuest>{ id: a.payload.doc.id, ...data };
    });
  }

  /**
   * Get all quests of a team member
   * @param  {string}                    seasonId season's id
   * @param  {string}                    teamId   team's id
   * @param  {string}                    playerId player's user id
   * @return {Observable<PlayerQuest[]>}          observable array of player quests
   */
  getMemberQuests(seasonId: string, teamId: string, playerId: string): Observable<PlayerQuest[]> {
    this.playerQuestsCollection =
      this.afs.collection('playerQuests', ref => ref
        .where('seasonId', '==', seasonId)
        .where('teamId', '==', teamId)
        .where('playerId', '==', playerId)
        .orderBy('created', 'desc')
        .limit(20));

    return this.playerQuestsCollection.snapshotChanges().pipe(
      map((actions) => this.mapPlayerQuestData(actions))
    );
  }

  /**
   * Gets all quests awaiting approval from team members
   * @param  {string}                    seasonId season's id
   * @param  {string}                    teamId team's id
   * @return {Observable<PlayerQuest[]>}        observable array of player quests
   */
  getAllMemberSubmittedQuests(seasonId: string, teamId: string): Observable<PlayerQuest[]> {
    this.playerQuestsCollection =
      this.afs.collection('playerQuests', ref => ref
        .where('seasonId', '==', seasonId)
        .where('teamId', '==', teamId)
        .where('status', '==', QuestStatus.PENDING_APPROVAL)
        .orderBy('submitted', 'asc')
        .limit(20));

    return this.playerQuestsCollection.snapshotChanges().pipe(
      map((actions) => this.mapPlayerQuestData(actions))
    );
  }

  /**
   * Revert quest's status back to todo
   * @param {Partial<PlayerQuest>} quest all quest info
   */
  rejectQuest(quest: Partial<PlayerQuest>) {
    return from(this.getQuest(quest.id).update({
      status: QuestStatus.TODO
    }));
  }

  /**
   * Returns a playerPoints firestore document reference
   * @param  {string}                                 id playerpoints id (season id + player id)
   * @return {AngularFirestoreDocument<PlayerPoints>}    player points info reference
   */
  getPlayerPoints(id: string): AngularFirestoreDocument<PlayerPoints> {
    return this.afs.doc<PlayerPoints>(`playerPoints/${id}`);
  }

  /**
   * Change quest's status to completed and update player's total points
   * @param {Partial<PlayerQuest>} quest all quest info
   */
  approveQuest(quest: Partial<PlayerQuest


256.5 69.6,255.8
		69.2,256.7 90.6,256.2 90.8,242 90.3,222.5 89,207.8 90.4,206.6 90.6,206.2 90.1,205.2 90.6,204.5 91,204 90.9,203.2 90.9,202.3
		91.4,201.2 91.3,200.1 91.5,199.1 91.8,198.1 91.9,197.1 92.1,195.9 92.7,195 92.5,193.9 92.3,192.9 91.5,192.1 91.7,191.3
		91.7,190.5 91.3,190.1 90.2,190.5 89.5,190.3 88.9,190.1 88.3,190.4 87.8,190.5 87.2,190.2 86.9,190 86.6,189.3 86.5,188.5
		86,188.1 85.7,187.9 85.5,187.1 84.9,186.2 84.4,185.7 83.3,185 80.8,184.1 79.8,183.7 78.8,183.4 78.2,183.2 77.2,183 76.8,182.9
		75.7,182.9 74.6,182.9 74,182.9 73.4,183.5 72.8,184.1 72.5,184.5 71.8,184.3 71.4,184.4 69.9,184.3 69.5,184.2 68.8,184.9
		68.3,185.3 67.2,185.2 65.7,185.1 64.1,184.5 63.4,184 62.7,183.5 61.3,183.2 55.5,183.4 56,187.3 56.3,188.8 56.1,191.5
		56.4,192.3 57.5,193.5 58,194.2 56.8,194.5 	"/>
</g>
<g id="AR-A">
	<path class="st0" d="M67,83.2v-0.3l-0.1-0.5c0-0.2,0-0.4-0.1-0.4c-0.1-0.1-0.2,0-0.4,0.1l-0.8,0.4c-0.3,0.1-0.6,0.3-1.1,0.7
		c-0.5,0.4-1.2,1.1-1.7,1.5C62.3,85,62,85,61.8,85s-0.5,0-0.8-0.2s-0.6-0.5-0.7-0.9c-0.1-0.3-0.1-0.6-0.1-0.8
		c0.1-0.3,0.1-0.5-0.8-1.6c-0.9-1-2.6-2.9-3.5-3.8L55,76.9v-0.2c0-0.2-0.1-0.6-0.2-0.9c-0.1-0.3-0.3-0.6-0.4-0.9
		c-0.1


��본적으로 페이지 내의 내용은 하나의 일관된 언어로만 표시되어야 합니다.

HTTP 요청을 서버에 보내면, 대개 요청하는 유저 에이전트가 Accept-Language 헤더와 같은 기본 언어 설정에 대한 정보를 보냅니다. 그 다음 서버는 이 정보를 사용하여 해당 언어가 제공 가능한 경우, 해당 언어 버전의 문서를 반환할 수 있습니다. 반환된 HTML 문서는 `<html lang="en">...</html>`과 같이 `<html>` 태그에 lang 속성을 선언해야 합니다.

백엔드에서 HTML 마크업은 YML 또는 JSON 형식으로 저장된 특정 언어에 대한 i18n placeholder와 내용을 포함합니다. 그 다음 서버는 일반적으로 백엔드 프레임워크의 도움을 받아 특정 언어로 HTML 페이지를 동적 생성합니다.

## 💬 다국어 사이트를 디자인하거나 개발할 때 주의해야할 사항은 무엇인가요?
- HTML에 lang 속성을 사용합니다.

- 기본적으로 그들이 접속한 지역의 언어로 안내합니다.
  - 사용자가 번거롭지 않도록 쉽게 국가/언어를 변경할 수 있도록 합니다.

- 텍스트를 포함한 이미지를 사용하는 것은 확장 가능한 접근이 아닙니다.
  - 이미지에 텍스트를 배치하는 것은 잘 보이고 시스템 글꼴이 아닌 글꼴을 모든 컴퓨터에 표시하는데 여전히 널리 사용되는 방법입니다. 그러나 이미지에 텍스트를 번역하려면, 텍스트 문자열에 각 언어에 대해 만들어진 별도 이미지가 필요합니다. 이 같은 대체 방식이 늘어나면 금방 통제가 어려워집니다.

<b


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml;

using DigitalPlatform.LibraryServer;
using DigitalPlatform.Xml;
using System.Diagnostics;
using System.ComponentModel;
using System.Windows.Interop;
using DigitalPlatform.Text;

namespace DigitalPlatform.CirculationClient
{
    /// <summary>
    /// 流通权限编辑器控件
    /// LoanPolicyControl.xaml 的交互逻辑
    /// </summary>
    public partial class LoanPolicyControl : UserControl, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        // public event TextChangedEventHandler TextChanged = null;

        XmlDocument _dom = null;
        // List<string> _readerTypes = new List<string>();
        List<string> _bookTypes = new List<string>();

        List<Row> _rows = new List<Row>();

        bool _uiChanged = false;    // 界面上是否修改了数据？
        bool _domChanged = false;   // this._dom 内数据是否发生了变化

        public bool Changed
        {
            get
            {
                if (this._uiChanged == true || this._domChanged == true)
                    return true;
                return false;
            }
        }

        public LoanPolicyControl()
        {
            InitializeComponent();
            this.DataContext = this;
            if (null == System.Windows.Application.Current)
                new System.Windows.Application();
        }

        // TODO: 如果 strXml 为空，需要让馆代码列表设置为当前用户可以管辖的那些馆代码
        // parameters:
        //      strLibraryCodeList  当前用户管辖的馆代码。也就是说馆代码列表中，至少要出现这些事项
        public int SetData(
            string strLibraryCodeList,
            string strXml,
            out string strError)
        {
            strError = "";

            this._dom = new XmlDocument();
            try
            {
                if (string.IsNullOrEmpty(strXml) == false)
                    this._dom.LoadXml(strXml);
                else
                    this._dom.LoadXml("<rightsTable />");
            }
            catch (Exception ex)
            {
                strError = "XML 装入 DOM 时出错: " + ex.Message;
                return -1;
            }

            if (_comboBox_libraryCode == null)
            {
                Grid grid = new Grid();
                grid.ColumnDefinitions.Add(new ColumnDefinition());
                grid.RowDefinitions.Add(new RowDefinition());
                grid.RowDefinitions.Add(new RowDefinition());

                this._grid.Children.Add(grid);
                Grid.SetColumn(grid, 0);
                Grid.SetRow(grid, 0);

                Label label = new Label();
                label.Content = "馆代码";
                label.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                label.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Right;
                label.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255));
                grid.Children.Add(label);
                Grid.SetColumn(label, 0);
                Grid.SetRow(label, 0);

                _comboBox_libraryCode = new ComboBox();
                _comboBox_libraryCode.Margin = new Thickness(4, 0, 0, 0);
                _comboBox_libraryCode.DropDownClosed += new EventHandler(_comboBox_libraryCode_DropDownClosed);
                grid.Children.Add(_comboBox_libraryCode);
                Grid.SetColumn(_comboBox_libraryCode, 0);
                Grid.


#pragma once
/*
 *   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; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   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, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

/**
 * $Id: 3e12ea128dad61c62aac83b53913bc03a7be0bbb $
 * @file lib/bio/bio_priv.h
 * @brief Binary IO private functions
 *
 *  Create abstract binary input / output buffers.
 *
 * @copyright 2024 Network RADIUS SAS (legal@networkradius.com)
 */
RCSIDH(lib_bio_bio_priv_h, "$Id: 3e12ea128dad61c62aac83b53913bc03a7be0bbb $")

#define _BIO_PRIVATE 1
#include <freeradius-devel/bio/base.h>

typedef struct fr_bio_common_s fr_bio_common_t;

typedef struct {
	fr_bio_io_t		connected;
	fr_bio_io_t		shutdown;
	fr_bio_io_t		eof;
	fr_bio_callback_t	failed;

	fr_bio_io_t		read_blocked;
	fr_bio_io_t		write_blocked;

	fr_bio_io_t		read_resume;		//!< "unblocked" is too similar to "blocked"
	fr_bio_io_t		write_resume;
} fr_bio_priv_callback_t;

/** Common elements at the start of each private #fr_bio_t
 *
 */
#define FR_BIO_COMMON \
	fr_bio_t		bio; \
	fr_bio_cb_funcs_t	cb; \
	fr_bio_priv_callback_t	priv_cb

struct fr_bio_common_s {
	FR_BIO_COMMON;
};

/** Define a common destructor pattern.
 *
 *  Ensure that talloc_free() is safe no matter what.  The caller can free any BIO at any time.  If that
 *  happens, then the entire chain is shut down.  On successful shutdown, this BIO is removed from the chain.
 */
#define FR_BIO_DESTRUCTOR_COMMON \
do { \
	if (my->priv_cb.shutdown) {		   \
		int rcode;			   \
		rcode = fr_bio_shutdown(&my->bio); \
		if (rcode < 0) return rcode;	   \
	}					   \
	if (fr_bio_prev(&my->bio) || fr_bio_next(&my->bio)) \
		fr_bio_unchain(&my->bio);	   \
} while (0)

ssize_t fr_bio_next_read(fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size);

ssize_t fr_bio_next_write(fr_bio_t *bio, void *packet_ctx, void const *buffer, size_t size);

/** Chain one bio after another.
 *
 *  @todo - this likely needs to be public
 */
static inline void CC_HINT(nonnull) fr_bio_chain(fr_bio_t *first, fr_bio_t *second)
{
	fr_assert(first->entry.prev == NULL);
	fr_assert(first->entry.next == NULL);

	fr_assert(second->entry.prev == NULL);

	first->entry.next = &second->entry;
	second->entry.prev = &first->entry;
}

/** Remove a bio from a chain
 *
 *  And reset prev/next ptrs to NULL.
 *
 *  @todo - this likely needs to be public
 */
static inline void CC_HINT(nonnull) fr_bio_unchain(fr_bio_t *bio)
{
	fr_bio_t *prev = fr_bio_prev(bio);
	fr_bio_t *next = fr_bio_next(bio);

	fr_assert(prev || next);

	if (prev) prev->entry.next = bio->entry.next;

	if (next) next->entry.prev = bio->entry.prev;

	bio->entry.prev = bio->entry.next = NULL;
}

void	fr_bio_eof(fr_bio_t *bio) CC_HINT(nonnull);

int	fr_bio_write_blocked(fr_bio_t *bio) CC_HINT(nonnull);


up!');

  final baseDir = (await getApplicationSupportDirectory()).path;

  final backupDir = Directory(join(baseDir, 'backup_twonly_safe/'));
  await backupDir.create(recursive: true);

  final backupDatabaseFile =
      File(join(backupDir.path, 'twonly_database.backup.sqlite'));

  final backupDatabaseFileCleaned =
      File(join(backupDir.path, 'twonly_database.backup.cleaned.sqlite'));

  // copy database
  final originalDatabase = File(join(baseDir, 'twonly_database.sqlite'));
  await originalDatabase.copy(backupDatabaseFile.path);

  driftRuntimeOptions.dontWarnAboutMultipleDatabases = true;
  final backupDB = TwonlyDatabase(
    driftDatabase(
      name: 'twonly_database.backup',
      native: DriftNativeOptions(
        databaseDirectory: () async {
          return backupDir;
        },
      ),
    ),
  );

  await backupDB.deleteDataForTwonlySafe();

  await backupDB
      .customStatement('VACUUM INTO ?', [backupDatabaseFileCleaned.path]);

  await backupDB.printTableSizes();

  await backupDB.close();

  // ignore: inference_failure_on_collection_literal
  final secureStorageBackup = {};
  const storage = FlutterSecureStorage();
  secureStorageBackup[SecureStorageKeys.signalIdentity] =
      await storage.read(key: SecureStorageKeys.signalIdentity);
  secureStorageBackup[SecureStorageKeys.signalSignedPreKey] =
      await storage.read(key: SecureStorageKeys.signalSignedPreKey);

  final userBackup = await getUser();
  if (userBackup == null) return;
  // FILTER settings which should not be in the backup
  userBackup
    ..twonlySafeBackup = null
    ..lastImageSend = null
    ..todaysImageCounter = null
    ..lastPlanBallance = ''
    ..additionalUserInvites = ''
    ..signalLastSignedPreKeyUpdated = null;

  secureStorageBackup[SecureStorageKeys.userData] = jsonEncode(userBackup);

  // Compress and convert backup data

  final twonlyDatabaseBytes = await backupDatabaseFileCleaned.readAsBytes();
  await backupDatabaseFile.delete();
  await backupDatabaseFileCleaned.delete();

  Log.info('twonlyDatabaseLength = ${twonlyDatabaseBytes.lengthInBytes}');
  Log.info('secureStorageLength = ${jsonEncode(secureStorageBackup).length}');

  final backupProto = TwonlySafeBackupContent(
    secureStorageJson: jsonEncode(secureStorageBackup),
    twonlyDatabase: twonlyDatabaseBytes,
  );

  final backupBytes = gzip.encode(backupProto.writeToBuffer());

  final backupHash = uint8ListToHex((await Sha256().hash(backupBytes)).bytes);

  if (user.twonlySafeBackup!.lastBackupDone == null ||
      user.twonlySafeBackup!.lastBackupDone!
          .isAfter(DateTime.now().subtract(const Duration(days: 90)))) {
    force = true;
  }

  final lastHash =
      await storage.read(key: SecureStorageKeys.twonlySafeLastBackupHash);

  if (lastHash != null && !force) {
    if (backupHash == lastHash) {
      Log.info('Since last backup nothing has changed.');
      return;
    }
  }
  await storage.write(
    key: SecureStorageKeys.twonlySafeLastBackupHash,
    value: backupHash,
  );

  // Encrypt backup data

  final chacha20 = FlutterChacha20.poly1305Aead();
  final nonce = chacha20.newNonce();

  final secretBox = await chacha20.encrypt(
    backupBytes,
    secretKey: SecretKey(user.twonlySafeBackup!.encryptionKey),
    nonce: nonce,
  );

  final encryptedBackupBytes = Two


?uabc?*?q".parseMask(customDict)
        println(dicts)
    }

    @Test
    fun randomPassword() {
        repeat(10) { println(BASE92_DICT.random(5)) }
    }
}
package me.leon.hash.murmur

import me.leon.hash.murmur.Constant.Companion.UINT_MASK
import me.leon.hash.murmur.Constant.Companion.UNSIGNED_MASK

/**
 * A pure Kotlin implementation of the Murmur 1 hashing algorithm as presented at
 * [Murmur Project](https://sites.google.com/site/murmurhash/)
 *
 * Code is ported from original Java source at https://github.com/sangupta/murmur
 *
 * @author chan
 * @since 1.0
 */
internal object One : Constant {

    /**
     * Compute the Murmur1 hash as described in the original source code.
     *
     * @param data the data that needs to be hashed
     * @param length the length of the data that needs to be hashed
     * @param seed the seed to use to compute the hash
     * @return the computed hash value
     */
    fun hash(data: ByteArray, length: Int, seed: Long): Long {
        val m = 0xc6a4a793L
        val r = 16

        var h = seed xor length * m

        // Mix 4 bytes at a time into the hash
        val length4 = length shr 2

        for (i in 0 until length4) {
            val i4 = i shl 2

            var k = data[i4].toLong() and UNSIGNED_MASK
            k = k or ((data[i4 + 1].toLong() and UNSIGNED_MASK) shl 8)
            k = k or (((data[i4 + 2].toLong() and UNSIGNED_MASK)) shl 16)
            k = k or ((data[i4 + 3].toLong() and UNSIGNED_MASK) shl 24)

            h = h + k and UINT_MASK
            h = h * m and UINT_MASK
            h = h xor (h shr 16 and UINT_MASK)
        }

        // remaining bytes
        val offset = length4 shl 2
        when (length and 3) {
            3 -> {
                h += data[offset + 2].toLong() shl 16 and UINT_MASK
                h += data[offset + 1].toLong() shl 8 and UINT_MASK
                h += data[offset].toLong() and UINT_MASK
                h = h * m and UINT_MASK
                h = h xor (h shr r and UINT_MASK)
            }
            2 -> {
                h += data[offset + 1].toLong() shl 8 and UINT_MASK
                h += data[offset].toLong() and UINT_MASK
                h = h * m and UINT_MASK
                h = h xor (h shr r and UINT_MASK)
            }
            1 -> {
                h += data[offset].toLong() and UINT_MASK
                h = h * m and UINT_MASK
                h = h xor (h shr r and UINT_MASK)
            }
        }

        // final operations
        h = h * m and UINT_MASK
        h = h xor (h shr 10 and UINT_MASK)
        h = h * m and UINT_MASK
        h = h xor (h shr 17 and UINT_MASK)

        // return the hash
        return h
    }

    /**
     * Compute the Murmur1 hash (aligned version) as described in the original source code.
     *
     * Code ported from original C++ version at
     * [MurmurHashAligned.cpp](https://sites.google.com/site/murmurhash/MurmurHashAligned.cpp?attredirects=0)
     *
     * @param data the data that needs to be hashed
     * @param length the length of the data that needs to be hashed
     * @param seed the seed to use to compute the hash
     * @return the computed hash value
     */
    fun hashAligned(data: ByteArray, length: Int, seed: Long): Long {
        return hash(data, length, seed)
    }
}
package me.leon

import java.io.File
import java.util.*
import javafx.scene.image.Image
import kotlin.collections.component1
import kotlin.collections.component2
import kotlin.collections.set
import kotlin.concurrent.thread
import me.leon.config.*
import me.leon.ext.fromJson
import me.leon.ext.fx.Prefs
import me.leon.ext.toFile


// Emacs style mode select   -*- C -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 1993-1997 Id Software, Inc.
// Copyright(C) 1997 Midway Home Entertainment, Inc
// Copyright(C) 2007-2012 Samuel Villarreal
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
//-----------------------------------------------------------------------------

#ifndef __STSTUFF_H__
#define __STSTUFF_H__

#include "doomtype.h"
#include "d_event.h"
#include "p_mobj.h"

#include "net_client.h"

//
// STATUS BAR
//

// Called by main loop.
boolean ST_Responder(event_t* ev);

// Called by main loop.
void ST_Ticker(void);
void ST_ClearMessage(void);

// Called when the console player is spawned on each level.
void ST_Start(void);

// Called by startup code.
void ST_Init(void);
void ST_AddChatMsg(char* msg, int player);
void ST_Notification(char* msg);
void ST_Drawer(void);
void ST_FlashingScreen(byte r, byte g, byte b, byte a);
char ST_DequeueChatChar(void);
void ST_DrawCrosshair(int x, int y, int slot, byte scalefactor, rcolor color);
void ST_UpdateFlash(void);
void ST_AddDamageMarker(mobj_t* target, mobj_t* source);
void ST_ClearDamageMarkers(void);
void ST_RegisterCvars(void);
void ST_DisplayPendingWeapon(void);

extern char player_names[MAXPLAYERS][MAXPLAYERNAME];
extern boolean st_chatOn;
extern int st_crosshairs;

#endif


�ง การมีการเชื่อมต่อจำนวนมากระหว่างเธรดของเซิร์ฟเวอร์เว็บกับเซิร์ฟเวอร์ [memcached](https://memcached.org/) อาจมีค่าใช้จ่ายสูง [การรวมการเชื่อมต่อ](https://en.wikipedia.org/wiki/Connection_pool) สามารถช่วยได้ รวมถึงการเปลี่ยนไปใช้ UDP เมื่อเหมาะสม

TCP เหมาะสำหรับแอปพลิเคชันที่ต้องการความน่าเชื่อถือสูงแต่ไม่เร่งด่วนด้านเวลา ตัวอย่างเช่น เซิร์ฟเวอร์เว็บ ข้อมูลฐานข้อมูล SMTP FTP และ SSH

ใช้ TCP แทน UDP เมื่อ:

* คุณต้องการให้ข้อมูลทั้งหมดมาถึงอย่างครบถ้วน
* คุณต้องการให้ระบบประมาณการใช้งานความเร็วเครือข่ายอัตโนมัติ

### โปรโตคอล User datagram (UDP)

  ที่มา: วิธีสร้างเกมผู้เล่นหลายคน

UDP เป็นโปรโตคอลแบบไม่มีการเชื่อมต่อ ข้อมูล datagram (คล้ายกับแพ็กเก็ต) จะได้รับประกันเฉพาะในระดับ datagram เท่านั้น ข้อมูล datagram อาจไปถึงปลายทางแบบไม่เรียงลำดับหรืออาจไม่ถึงเลย UDP ไม่รองรับการควบคุมความแออัด เนื่องจากไม่มีการรับประกันเหมือน TCP UDP จึงมีประสิทธิภาพมากกว่าโดยทั่วไป

UDP สามารถกระจายข้อมูล (broadcast) ส่ง datagram ไปยังทุกอุปกรณ์ในเครือข่ายย่อย ซึ่งมีประโยชน์กับ [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) เพราะไคลเอนต์ยังไม่ได้รับที่อยู่ IP ทำให้ไม่สามารถใช้ TCP


n

    // region path

    /**
     * @include [CommonColDocs]
     * {@set [CommonColDocs.ARG] "pathTo"["columnName"\] }
     * {@set [CommonColDocs.EXAMPLE] {@include [CommonColDocs.DoubleExample]}}
     * @param [path\] The path to the column.
     */
    private interface ColPathDocs

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER]}
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("colUnTyped")
    public fun col(path: ColumnPath): ColumnAccessor<*> = column<Any?>(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER]}
     * @include [CommonColDocs.ColumnTypeParam]
     */
    public fun <C> col(path: ColumnPath): ColumnAccessor<C> = column(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] myColumnGroup.}
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("colUnTyped")
    public fun SingleColumn<DataRow<*>>.col(path: ColumnPath): SingleColumn<*> = col<Any?>(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] myColumnGroup.}
     * @include [CommonColDocs.ColumnTypeParam]
     */
    public fun <C> SingleColumn<DataRow<*>>.col(path: ColumnPath): SingleColumn<C> =
        this.ensureIsColumnGroup().transformSingle {
            val child = it.getCol(path)?.cast<C>()
                ?: throw IllegalStateException("Column '$path' not found in column group '${it.path}'")
            listOf(child)
        }.singleImpl()

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] myColumnGroup.}
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("colUnTyped")
    public fun AnyColumnGroupAccessor.col(path: ColumnPath): ColumnAccessor<*> = col<Any?>(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] myColumnGroup.}
     * @include [CommonColDocs.ColumnTypeParam]
     */
    public fun <C> AnyColumnGroupAccessor.col(path: ColumnPath): ColumnAccessor<C> =
        this.ensureIsColumnGroup().column(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] "myColumnGroup".}
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("colUnTyped")
    public fun String.col(path: ColumnPath): ColumnAccessor<*> = col<Any?>(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] "myColumnGroup".}
     * @include [CommonColDocs.ColumnTypeParam]
     */
    public fun <C> String.col(path: ColumnPath): ColumnAccessor<C> =
        columnGroup(this).ensureIsColumnGroup().column(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] Type::myColumnGroup.}
     */
    @Suppress("INAPPLICABLE_JVM_NAME")
    @JvmName("colUnTyped")
    @Deprecated(DEPRECATED_ACCESS_API)
    @AccessApiOverload
    public fun KProperty<*>.col(path: ColumnPath): ColumnAccessor<*> = col<Any?>(path)

    /**
     * @include [ColPathDocs] {@set [CommonColDocs.RECEIVER] Type::myColumnGroup.}
     * @include [CommonColDocs.ColumnTypeParam]
     */
    @Deprecated(DEPRECATED_ACCESS_


UM_NEIGH_MAX>
int SurfaceMesh<NUM_NODES,NUM_NEIGH_MAX>::n_active_corners(int i)
{
    int n = 0;
    if(i > this->size()) return n;

    if(cornerActive(i)[0]) n++;
    if(cornerActive(i)[1]) n++;
    if(cornerActive(i)[2]) n++;
    return n;
}

/* ----------------------------------------------------------------------
   edge-edge, edge-node, edge-point distance
------------------------------------------------------------------------- */

template<int NUM_NODES, int NUM_NEIGH_MAX>
double SurfaceMesh<NUM_NODES,NUM_NEIGH_MAX>::edgeEdgeDist(int iSrf, int iEdge, int jSrf, int jEdge)
{
    double d1,d2,d3,d4;
    d1 = edgeNodeDist(iSrf,iEdge,jSrf,jEdge);
    d2 = edgeNodeDist(iSrf,iEdge,jSrf,(jEdge+1)%NUM_NODES);
    d3 = edgeNodeDist(jSrf,jEdge,iSrf,(iEdge+1)%NUM_NODES);
    d4 = edgeNodeDist(jSrf,jEdge,iSrf,(iEdge+1)%NUM_NODES);
    return MathExtraLiggghts::min(d1,d2,d3,d4);
}

template<int NUM_NODES, int NUM_NEIGH_MAX>
double SurfaceMesh<NUM_NODES,NUM_NEIGH_MAX>::edgeNodeDist(int iSrf, int iEdge, int jSrf, int jNode)
{
    return edgePointDist(iSrf, iEdge, MultiNodeMesh<NUM_NODES>::node_(jSrf)[jNode]);
}

template<int NUM_NODES, int NUM_NEIGH_MAX>
double SurfaceMesh<NUM_NODES,NUM_NEIGH_MAX>::edgePointDist(int iSrf, int iEdge, double *point)
{
        double nodeToP[3], dot;

        vectorSubtract3D(point,MultiNodeMesh<NUM_NODES>::node_(iSrf)[iEdge],nodeToP);
        dot = vectorDot3D(edgeVec(iSrf)[iEdge],nodeToP);

        //NP node iEdge is closest
        if(dot < 0)
            return vectorMag3D(nodeToP);
        //NP node iEdge+1 is closest
        else if(dot > edgeLen(iSrf)[iEdge])
        {
            vectorSubtract3D(point,MultiNodeMesh<NUM_NODES>::node_(iSrf)[(iEdge+1)%NUM_NODES],nodeToP);
            return vectorMag3D(nodeToP);
        }
        //NP between both nodes
        else
            return MathExtraLiggghts::abs(vectorDot3D(edgeNorm(iSrf)[iEdge],nodeToP));
}

#endif


hat the max and flexibility sections show correct CSS property value."
  );
  const flexSection = flexItemSizingContainer.querySelector(
    ".section.flexibility"
  );
  const maxSection = flexItemSizingContainer.querySelector(".section.max");
  const flexGrow = flexSection.querySelector(".css-property-link");
  const maxSize = maxSection.querySelector(".css-property-link");

  is(
    maxSize.textContent,
    "(max-width: 400px !important)",
    "Maximum size section shows CSS property value with highest specificity."
  );
  is(
    flexGrow.textContent,
    "(flex-grow: 5 !important)",
    "Flexibility size section shows CSS property value with highest specificity."
  );
});
/* Any copyright is dedicated to the Public Domain.
 http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test that the flex item outline renders the basis and final points as a single point
// if their sizes are equal. If not, then render as separate points.

const TEST_URI = URL_ROOT + "doc_flexbox_specific_cases.html";

add_task(async function() {
  await addTab(TEST_URI);
  const { inspector, flexboxInspector } = await openLayoutView();
  const { document: doc, store } = flexboxInspector;

  info("Select a flex item whose basis size matches its final size.");
  let onUpdate = waitUntilAction(store, "UPDATE_FLEXBOX");
  await selectNode(".item", inspector);
  await onUpdate;

  const [basisFinalPoint] = [
    ...doc.querySelectorAll(".flex-outline-point.basisfinal"),
  ];

  ok(basisFinalPoint, "The basis/final point exists");

  info("Select a flex item whose basis size is different than its final size.");
  onUpdate = waitUntilAction(store, "UPDATE_FLEXBOX");
  await selectNode(".shrinking .item", inspector);
  await onUpdate;

  const [basis, final] = [
    ...doc.querySelectorAll(
      ".flex-outline-point.basis, .flex-outline-point.final"
    ),
  ];

  ok(basis, "The basis point exists");
  ok(final, "The final point exists");
});
/* Any copyright is dedicated to the Public Domain.
 http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const { getStr } = require("devtools/client/inspector/layout/utils/l10n");

// Test the specific max-clamping scenario where an item wants to grow a certain amount
// but its max-size prevents it from growing that much.

const TEST_URI = URL_ROOT + "doc_flexbox_specific_cases.html";

add_task(async function() {
  await addTab(TEST_URI);
  const { inspector, flexboxInspector } = await openLayoutView();
  const { document: doc } = flexboxInspector;

  info(
    "Select the test item in the document and wait for the sizing info to render"
  );
  const onRendered = waitForDOM(doc, ".flex-outline, .flex-item-sizing", 2);
  await selectNode("#want-to-grow-more-than-max div", inspector);
  const [outlineContainer, sizingContainer] = await onRendered;

  info(
    "Check that the outline contains the max point and that it's equal to final"
  );
  const maxPoint = outlineContainer.querySelector(".flex-outline-point.max");
  ok(maxPoint, "The max point is displayed");
  ok(
    outlineContainer.style.gridTemplateColumns.includes("[final-end max]"),
    "The final and max points are at the same position"
  );

  info("Check that the maximum sizing section displays the right info");
  const reasons = [...sizingContainer.querySelectorAll(".reasons li")];
  const expected


%
  );
  --gradient-muted: linear-gradient(
    135deg,
    rgb(40, 29, 45) 0%,
    rgb(32, 35, 54) 50%,
    rgb(20, 38, 31) 100%
  );

  /* Surface Colors (Dark Theme) */
  --color-surface-primary: rgba(15, 15, 15, 1);
  --color-surface-secondary: rgba(20, 20, 20, 1);
  --color-surface-tertiary: rgba(23, 23, 23, 1);
  --color-surface-quaternary: rgba(28, 28, 28, 1);
  --color-surface-elevated: rgba(35, 35, 35, 1);

  /* Border Colors */
  --color-border-primary: rgb(45, 45, 45);
  --color-border-secondary: rgba(36, 36, 36, 1);
  --color-border-tertiary: rgba(38, 38, 38, 1);
  --color-border-muted: rgba(51, 51, 51, 0.5);
  --color-border-subtle: rgba(55, 55, 55, 1);
  --color-border-light: rgba(69, 69, 69, 1);
  --color-border-white: rgba(255, 255, 255, 0.22);

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #dadada;
  --color-text-muted: rgba(255, 255, 255, 0.66);
  --color-text-subtle: rgba(255, 255, 255, 0.64);

  /* Overlay Colors */
  --color-overlay-light: rgba(0, 0, 0, 0.66);
  --color-overlay-medium: rgba(0, 0, 0, 0.81);
  --color-overlay-transparent: rgba(0, 0, 0, 0);

  /* Glass/Backdrop Colors */
  --color-glass-primary: rgba(35, 35, 35, 0.61);
  --color-glass-secondary: rgba(56, 56, 56, 0.61);
  --color-glass-tertiary: rgba(30, 30, 30, 0.5);
  --color-glass-muted: rgba(52, 52, 52, 0.37);
  --color-glass-subtle: rgba(61, 61, 61, 0.64);
  --color-glass-light: rgba(59, 59, 59, 0.5);

  /* ===================
   * SPACING SYSTEM
   * =================== */

  /* Base spacing unit */
  --space-unit: 4px;

  /* Spacing Scale */
  --space-1: calc(var(--space-unit) * 1); /* 4px */
  --space-2: calc(var(--space-unit) * 2); /* 8px */
  --space-3: calc(var(--space-unit) * 3); /* 12px */
  --space-4: calc(var(--space-unit) * 4); /* 16px */
  --space-5: calc(var(--space-unit) * 5); /* 20px */
  --space-6: calc(var(--space-unit) * 6); /* 24px */
  --space-8: calc(var(--space-unit) * 8); /* 32px */
  --space-10: calc(var(--space-unit) * 10); /* 40px */
  --space-12: calc(var(--space-unit) * 12); /* 48px */
  --space-16: calc(var(--space-unit) * 16); /* 64px */
  --space-20: calc(var(--space-unit) * 20); /* 80px */
  --space-24: calc(var(--space-unit) * 24); /* 96px */

  /* Common spacing values */
  --space-xs: var(--space-1); /* 4px */
  --space-sm: var(--space-2); /* 8px */
  --space-md: var(--space-4); /* 16px */
  --space-lg: var(--space-6); /* 24px */
  --space-xl: var(--space-8); /* 32px */
  --space-2xl: var(--space-12); /* 48px */
  --space-3xl: var(--space-16); /* 64px */

  /* ===================


人都不讓我進去看，不看就不看，有什麼了不起的，等我做了大俠他們都會來拜我為師的～

唐月蕪：這回我們用“三尸三蟲”把霹靂堂打得大敗，好，對付背信棄義的小人就該這樣！

唐月蕪：連二代弟子中也沒幾人曉得“三尸三蟲”的煉法。只是聽這名字，一定和人屍有關係。

唐濟：這次殺敗霹靂堂，純屬僥倖，聽說霹靂堂和蜀山鬥了起來，高手都在那邊，要是那妖道也在，我們一定不是對手。

唐濟：比武奪帥差不多要開始了，我得立刻趕去演武堂。

唐過：看來還是我們唐門的“三尸三蟲”厲害，霹靂堂這下元氣大傷了！

唐井：唐門七大暗器，尋常弟子也只曉得毒針、毒蒺藜和斷魂砂，不知今天的比武大會中又能出現幾樣？

唐艮：站這真是太無聊了～喂，依你看這回比武奪帥，誰的勝算大些？

唐井：難說！三叔公是很厲害，可五叔公使暗器的手法已達到爐火純青的境地，也不是省油的燈！

唐漸：你真是雪見的未婚夫婿？哼哼，我看不像～

▶『更房』

唐雙蓮：鹹叔，您曉得“三尸三蟲”是怎麼煉的嗎？

唐鹹：唔……那是個邪法，你不必明白……

唐雙蓮：霹靂堂這次不就是吃了“三尸三蟲”的虧才退回去的嗎？一直都沒有生事呢！

唐鹹：這事……鹹叔只說給你一個人聽。霹靂堂之所以罷手，還因為近來蜀山派派遣門人下山除妖，把他們堂裡那些妖怪給除掉了不少，自然是實力大減。

唐鹹：嘿嘿～�


:       fmt.Sprintf("%s(%#02x)", reading.EntityID.String(), uint8(reading.EntityID)),
			"Entity Instance": fmt.Sprintf("%d", reading.EntityInstance),
			"Temp. Readings":  fmt.Sprintf("%+d C", reading.TemperatureReading),
		}
	}

	headers := []string{
		"Entity ID",
		"Entity Instance",
		"Temp. Readings",
	}

	return RenderTable(headers, rows)
}
package commands

import (
	"context"
	"fmt"

	"github.com/bougou/go-ipmi"
	"github.com/spf13/cobra"
)

func NewCmdChannel() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "channel",
		Short: "channel",
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
			return initClient()
		},
		Run: func(cmd *cobra.Command, args []string) {
		},
		PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
			return closeClient()
		},
	}
	cmd.AddCommand(NewCmdChannelInfo())
	cmd.AddCommand(NewCmdChannelGetCiphers())

	return cmd
}

func NewCmdChannelInfo() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "info",
		Short: "info",
		Run: func(cmd *cobra.Command, args []string) {
			var channelNumber uint8
			if len(args) == 0 {
				channelNumber = ipmi.ChannelNumberSelf
			}
			if len(args) >= 1 {
				i, err := parseStringToInt64(args[0])
				if err != nil {
					CheckErr(fmt.Errorf("invalid channel number, err: %w", err))
				}
				channelNumber = uint8(i)
			}

			ctx := context.Background()
			res, err := client.GetChannelInfo(ctx, channelNumber)
			if err != nil {
				CheckErr(fmt.Errorf("GetChannelInfo failed, err: %w", err))
			}

			fmt.Println(res.Format())

			if res.SessionSupport == 0 {
				return
			}

			res2, err := client.GetChannelAccess(ctx, channelNumber, ipmi.ChannelAccessOption_Volatile)
			if err != nil {
				CheckErr(fmt.Errorf("GetChannelAccess failed, err: %w", err))
			}
			fmt.Println("  Volatile(active) Settings")
			fmt.Println(res2.Format())

			res3, err := client.GetChannelAccess(ctx, channelNumber, ipmi.ChannelAccessOption_NonVolatile)
			if err != nil {
				CheckErr(fmt.Errorf("GetChannelAccess failed, err: %w", err))
			}
			fmt.Println("  Non-Volatile Settings")
			fmt.Println(res3.Format())
		},
	}
	return cmd
}

func NewCmdChannelGetCiphers() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "getciphers",
		Short: "getciphers",
		Run: func(cmd *cobra.Command, args []string) {
			var channelNumber uint8
			if len(args) == 0 {
				channelNumber = ipmi.ChannelNumberSelf
			}
			if len(args) >= 1 {
				i, err := parseStringToInt64(args[0])
				if err != nil {
					CheckErr(fmt.Errorf("invalid channel number, err: %w", err))
				}
				channelNumber = uint8(i)
			}

			ctx := context.Background()
			cipherSuiteRecords, err := client.GetAllChannelCipherSuites(ctx, channelNumber)
			if err != nil {
				CheckErr(fmt.Errorf("GetChannelInfo failed, err: %w", err))
			}

			fmt.Println("ID   IANA    Auth Alg        Integrity Alg   Confidentiality Alg")
			for _, record := range cipher


            gemm(xdl_SP_p23_reg_idx, /*gemm_idx=*/number<1>{});
        };

        // pre-stage
        {
            ASM_MARKER("before pre-stage");
            // (1) load K0 to LDS & VGPR
            K_mem_load(number<0>{}); // mem_K0

            s_waitcnt_vmcnt<0>();
            __builtin_amdgcn_s_barrier();

            K_lds_load(number<0>{}); // lds_K0

            s_waitcnt_lgkmcnt<0>();
            __builtin_amdgcn_s_barrier();

            // (2) prefetch K1 and V0 to LDS in parallel with GEMM0
            if(1 < num_total_loop)
            {
                K_mem_load(number<1>{}); // mem_K1
            }
            V_mem_load(number<0>{}); // mem_V0

            // (3) mfma (Q*K0) + softmax
            gemm(number<0>{}, /*gemm_idx=*/number<0>{});

            fmha_mask(number<0>{});
            /// TODO: find better way to map fmha_alu(0,96) call
            fmha_alu0(number<0>{});
            fmha_alu_D_upd();

            kv_token_start += kN0;
            ++i_total_loops;
            if(num_total_loop <= i_total_loops)
            {
                goto label_main_loops_exit;
            }

            if(2 < num_total_loop)
            {
                K_mem_load(number<0>{}); // mem_K2

                s_waitcnt_vmcnt<K_mem_su_ld_insts + V_mem_su_ld_insts>();
                __builtin_amdgcn_s_barrier();
            }

            ASM_MARKER("end pre-stage");
        }

        if(1 < num_total_loop)
        {
            if(warp_group_id == 0)
            {
                V_mem_load(number<1>{}); // V1
                K_lds_load(number<1>{}); // K1

                __builtin_amdgcn_s_setprio(0);
                __builtin_amdgcn_s_barrier();
                while(core_loop(number<0>{}))
                    ;
            }
            if(warp_group_id != 0)
            {
                __builtin_amdgcn_s_setprio(1);
                __builtin_amdgcn_s_barrier();
                while(core_loop(number<1>{}))
                    ;
            }
        }
    label_main_loops_exit:
        if(num_total_loop % 2)
        {
            fmha_post_process(number<1>{});
        }
        if(!(num_total_loop % 2))
        {
            fmha_post_process(number<0>{});
        }

        // store lse
        if constexpr(kStoreLSE)
        {
            auto lse = make_static_distributed_tensor<LSEDataType>(m.get_tile_distribution());

            constexpr auto lse_spans = decltype(lse)::get_distributed_spans();
            sweep_tile_span(lse_spans[number<0>{}], [&](auto idx0) {
                constexpr auto i_idx = make_tuple(idx0);
                lse(i_idx)           = m[i_idx] / C_LOG2E + log(l[i_idx]);
            });

            store_tile(lse_dram_window_tmp, tile_elementwise_in(lse_element_func, lse));
        }

        // finally, O
        constexpr auto o_spans = decltype(o_acc)::get_distributed_spans();

        sweep_tile_span(o_spans[number<0>{}], [&](auto idx0) {
            constexpr auto i_idx = make_tuple(idx0);
            const auto tmp       = [&]() {
                if constexpr(FmhaMask::IsMasking)
                {


 {Vehicle} from '../../models/Vehicle Management/vehicleModel.js';

const router = express.Router();
router.post('/vehicleadd', async (req, res) => {
  const { brand, model,modelYear,engineCapacity, mileage,totalSeats,photos,transmission,price,status ,vehicleNumber} = req.body;
  try {

      const newVehicle = new Vehicle({
          brand,
          model,
          modelYear,
          engineCapacity,
          mileage,
          totalSeats,
          photos,
          transmission,
          price,
          status,
          category,
          vehicleNumber

      });
      await newVehicle.save();
      return res.json({ status: true, message: "Vehicle Added" });
  } catch (error) {
      console.error(error);
     }
});

// Insert a new Vehicle
router.post('/', async (req, res) => {
    const vehicle = new Vehicle(req.body);
    try {
      const newVehicle = await vehicle.save();
      res.status(201).json(newVehicle);
    } catch (error) {
      res.status(500).json({ error: 'Failed to insert Vehicle' });
    }
  });

  // GET all Vehicles
  router.get('/', async (req, res) => {
    try {
      const vehicles = await Vehicle.find();
      res.json(vehicles);
    } catch (err) {
      res.status(500).json({ message: err.message });
    }
  });

  // GET a specific Vehicle by id
  router.get('/:id', async (req, res) => {
    const { id } = req.params;
    try {
      const vehicle = await Vehicle.findById(id);
      if (!vehicle) {
        return res.status(404).json({ message: 'Vehicle not found' });
      }
      res.json(vehicle);
    } catch (err) {
      res.status(500).json({ message: err.message });
    }
  });

  //fetch vehicle details by owner id
  router.get('/owner/:ownerId', async (req, res) => {
    const { ownerId } = req.params;
    try {
      const vehicles = await Vehicle.find({ owner_id: ownerId });
      if (!vehicles || vehicles.length === 0) {
        return res.status(404).json({ error: 'Vehicles not found for the specified owner_id' });
      }
      res.status(200).json(vehicles);
    } catch (error) {
      console.error('Error fetching Vehicle details:', error);
      res.status(500).json({ error: 'Internal server error' });
    }
  });

  // Update a Vehicle by id
  router.patch('/:id', async (req, res) => {
    const { id } = req.params;
    try {
      const vehicle = await Vehicle.findById(id);
      if (!vehicle) {
        return res.status(404).json({ message: 'Vehicle not found' });
      }
      Object.assign(vehicle, req.body);
      const updatedVehicle = await vehicle.save();
      res.json(updatedVehicle);
    } catch (err) {
      res.status(500).json({ message: err.message });
    }
  });

  // Delete a Vehicle by id
  router.delete('/:id', async (req, res) => {
    const { id } = req.params;
    try {
      const vehicle = await Vehicle.findById(id);
      if (!vehicle) {
        return res.status(404).json({ message: 'Vehicle not found' });
      }
      await Vehicle.findByIdAndDelete(req.params.id);
      res.json({ message: 'Vehicle deleted successfully' });
    } catch (err) {
      res.status(500).json({ message: err.message });


".AsLaconicConfig())};

        s.Serialize(ms, dIn);
        ms.Seek(0, SeekOrigin.Begin);

        var dOut = (nlsStruct)s.Deserialize(ms);

        Assert.AreEqual( 2, dOut.Map.Count);
        Assert.AreEqual( "name", dOut.Map.Get(NLSMap.GetParts.Name, "eng"));
        Assert.AreEqual( "имя", dOut.Map.Get(NLSMap.GetParts.Name, "rus"));

        Assert.AreEqual( "description", dOut.Map.Get(NLSMap.GetParts.Description, "eng"));
        Assert.AreEqual( "описание", dOut.Map.Get(NLSMap.GetParts.Description, "rus"));
      }
    }

    [Test]
    public void NLS_Array()
    {
      using (var ms = new MemoryStream())
      {
        var s = new SlimSerializer();

        var dIn = new NLSMap[]{
                        new NLSMap("eng{n='name' d='description'} rus{n='имя' d='описание'}".AsLaconicConfig()),
                        new NLSMap("eng{n='color' d='of product'} rus{n='zvet' d='producta'}".AsLaconicConfig()),
                        new NLSMap("eng{n='size' d='of item'} rus{n='razmer' d='tovara'}".AsLaconicConfig())
                      };

        s.Serialize(ms, dIn);
        ms.Seek(0, SeekOrigin.Begin);

        var dOut = (NLSMap[])s.Deserialize(ms);

        Assert.IsNotNull(dOut);

        Assert.AreEqual( 3, dOut.Length);

        Assert.AreEqual( "name",        dOut[0].Get(NLSMap.GetParts.Name, "eng"));
        Assert.AreEqual( "имя",         dOut[0].Get(NLSMap.GetParts.Name, "rus"));
        Assert.AreEqual( "description", dOut[0].Get(NLSMap.GetParts.Description, "eng"));
        Assert.AreEqual( "описание",    dOut[0].Get(NLSMap.GetParts.Description, "rus"));

        Assert.AreEqual( "color",      dOut[1].Get(NLSMap.GetParts.Name, "eng"));
        Assert.AreEqual( "zvet",       dOut[1].Get(NLSMap.GetParts.Name, "rus"));
        Assert.AreEqual( "of product", dOut[1].Get(NLSMap.GetParts.Description, "eng"));
        Assert.AreEqual( "producta",   dOut[1].Get(NLSMap.GetParts.Description, "rus"));

        Assert.AreEqual( "size",    dOut[2].Get(NLSMap.GetParts.Name, "eng"));
        Assert.AreEqual( "razmer",  dOut[2].Get(NLSMap.GetParts.Name, "rus"));
        Assert.AreEqual( "of item", dOut[2].Get(NLSMap.GetParts.Description, "eng"));
        Assert.AreEqual( "tovara",  dOut[2].Get(NLSMap.GetParts.Description, "rus"));
      }
    }

    [Test]
    public void StringMap_Sensitive()
    {
      using (var ms = new MemoryStream())
      {
        var s = new SlimSerializer();

        var dIn = new StringMap
        {
          {"a", "Alex"},
          {"b", "Boris"}
        };

        s.Serialize(ms, dIn);
        ms.Seek(0, SeekOrigin.Begin);

        var dOut = (StringMap)s.Deserialize(ms);

        Assert.IsNotNull(dOut);

        Assert.IsTrue( dOut.CaseSensitive );
        Assert.AreEqual( 2, dOut.Count);
        Assert.AreEqual( "Alex", dOut["a"]);
        Assert.AreEqual( null, dOut["A"]);

        Assert.AreEqual( "Boris", dOut["b"]);
        Assert.AreEqual( null, dOut["B"]);
      }


HeaderExtractor,
			func(t *jwt.Token) (interface{}, error) { return secretKey, nil },
		)

		if token != nil {
			if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid {
				if _, exists := claims["cid"]; exists {
					usr := &user.User{ID: uint(claims["cid"].(float64))}
					if ok, _ := usr.Get(ctx); ok {
						ctx.Set(ctxKey, usr)
						ctx.Next()
						return
					}
				}
			}
		}

		for _, v := range notAbortPathList {
			methodMatch := false
			if len(v.Method) == 1 && strings.ToLower(v.Method[0]) == "all" {
				methodMatch = true
			} else if len(v.Method) > 0 {
				for _, m := range v.Method {
					if strings.ToUpper(m) == ctx.Request.Method {
						methodMatch = true
						break
					}
				}
			}

			if methodMatch {
				pathMatch := true
				requestPathSplit := strings.Split(ctx.Request.URL.Path, "/")
				notAbortPathSplit := strings.Split(v.Path, "/")
				if len(requestPathSplit) < len(notAbortPathSplit) {
					// 如果规则路径比请求路径长，肯定不匹配
					continue
				}
				for i, v := range requestPathSplit {
					if i >= len(notAbortPathSplit) {
						// 如果请求路由已经校验到比规则路径长还不匹配，就代表已经不匹配规则了
						pathMatch = false
						break
					}

					if notAbortPathSplit[i] == "*" {
						// 如果规则中有*，表示后面的都不用匹配了
						break
					}

					if strings.HasPrefix(notAbortPathSplit[i], ":") {
						// :开头的表示参数，不用匹配
						continue
					}

					if v != notAbortPathSplit[i] {
						pathMatch = false
						break
					}
				}
				if pathMatch {
					ctx.Next()
					return
				}
			}
		}

		ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
			"message": "Please log in to your account.",
			"action":  "login",
		})
	}
}

func GetUser(ctx *gin.Context) *user.User {
	v, ok := ctx.Get(ctxKey)
	if ok && v != nil {
		return v.(*user.User)
	}
	return nil
}
package dump

import (
	"fmt"
	"log/slog"
	"strings"

	"github.com/apicat/apicat/v2/backend/i18n"
	"github.com/apicat/apicat/v2/backend/route/middleware/jwt"

	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-playground/locales/en"
	"github.com/go-playground/locales/zh"
	ut "github.com/go-playground/universal-translator"
	"github.com/go-playground/validator/v10"
	en_translations "github.com/go-playground/validator/v10/translations/en"
	zh_translations "github.com/go-playground/validator/v10/translations/zh"
)

var trans = map[string]*ut.Translator{}

func init() {
	uni := ut.New(en.New(), en.New(), zh.New())
	validater := binding.Validator.Engine().(*validator.Validate)

	if zhtran, found := uni.GetTranslator("zh"); found {
		trans["zh"] = &zhtran
		trans["zh-CN"] = &zhtran
		if err


345ca0cff4e1bc159f3ebff86cb5b87969863aa
# Thu, 07 Aug 2025 19:20:07 GMT
RUN set -eux; 		savedAptMark="$(apt-mark showmanual)"; 	apt-get update; 	apt-get install -y --no-install-recommends 		dpkg-dev 		libgdbm-dev 		ruby 	; 		rustArch=; 	dpkgArch="$(dpkg --print-architecture)"; 	case "$dpkgArch" in 		'amd64') rustArch='x86_64-unknown-linux-gnu'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.27.1/x86_64-unknown-linux-gnu/rustup-init'; rustupSha256='6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d' ;; 		'arm64') rustArch='aarch64-unknown-linux-gnu'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.27.1/aarch64-unknown-linux-gnu/rustup-init'; rustupSha256='1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2' ;; 	esac; 		if [ -n "$rustArch" ]; then 		mkdir -p /tmp/rust; 				wget -O /tmp/rust/rustup-init "$rustupUrl"; 		echo "$rustupSha256 */tmp/rust/rustup-init" | sha256sum --check --strict; 		chmod +x /tmp/rust/rustup-init; 				export RUSTUP_HOME='/tmp/rust/rustup' CARGO_HOME='/tmp/rust/cargo'; 		export PATH="$CARGO_HOME/bin:$PATH"; 		/tmp/rust/rustup-init -y --no-modify-path --profile minimal --default-toolchain '1.84.0' --default-host "$rustArch"; 				rustc --version; 		cargo --version; 	fi; 		wget -O ruby.tar.xz "$RUBY_DOWNLOAD_URL"; 	echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; 		mkdir -p /usr/src/ruby; 	tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; 	rm ruby.tar.xz; 		cd /usr/src/ruby; 		autoconf; 	gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; 	./configure 		--build="$gnuArch" 		--disable-install-doc 		--enable-shared 		${rustArch:+--enable-yjit} 	; 	make -j "$(nproc)"; 	make install; 		rm -rf /tmp/rust; 	apt-mark auto '.*' > /dev/null; 	apt-mark manual $savedAptMark > /dev/null; 	find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' 		| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' 		| sort -u 		| xargs -r dpkg-query --search 		| awk 'sub(":$", "", $1) { print $1 }' 		| sort -u 		| xargs -r apt-mark manual 	; 	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; 	apt-get dist-cl


nderer,
                    CommandBuffer &command_buffer, SDL_GPULoadOp color_load_op,
                    SDL_GPULoadOp depth_load_op, bool has_normals_target,
                    const RobotScene::GBuffer &gbuffer) {
  SDL_GPUColorTargetInfo color_targets[2];
  SDL_zero(color_targets);
  color_targets[0].texture = renderer.colorTarget();
  color_targets[0].load_op = color_load_op;
  color_targets[0].store_op = SDL_GPU_STOREOP_STORE;
  color_targets[0].cycle = false;

  SDL_GPUDepthStencilTargetInfo depth_target;
  SDL_zero(depth_target);
  depth_target.texture = renderer.depthTarget();
  depth_target.clear_depth = 1.0f;
  depth_target.load_op = depth_load_op;
  depth_target.store_op = SDL_GPU_STOREOP_STORE;
  depth_target.stencil_load_op = SDL_GPU_LOADOP_DONT_CARE;
  depth_target.stencil_store_op = SDL_GPU_STOREOP_DONT_CARE;
  if (has_normals_target) {
    color_targets[1].texture = gbuffer.normalMap;
    color_targets[1].load_op = SDL_GPU_LOADOP_CLEAR;
    color_targets[1].store_op = SDL_GPU_STOREOP_STORE;
    color_targets[1].cycle = false;
    if (renderer.msaaEnabled()) {
      color_targets[1].resolve_texture = gbuffer.resolveNormalMap;
      color_targets[1].store_op = SDL_GPU_STOREOP_RESOLVE;
    }
  }
  Uint32 num_color_targets = has_normals_target ? 2 : 1;
  return SDL_BeginGPURenderPass(command_buffer, color_targets,
                                num_color_targets, &depth_target);
}

static SDL_GPURenderPass *
getTransparentRenderPass(const RenderContext &renderer,
                         CommandBuffer &command_buffer,
                         const RobotScene::GBuffer &gBuffer) {
  SDL_GPUColorTargetInfo targets[2];
  SDL_zero(targets);
  targets[0].texture = gBuffer.accumTexture;
  targets[0].load_op = SDL_GPU_LOADOP_CLEAR;
  targets[0].store_op = SDL_GPU_STOREOP_STORE;

  targets[1].texture = gBuffer.revealTexture;
  targets[1].clear_color = {1, 0, 0, 0}; // clear to red, since it's R8
  targets[1].load_op = SDL_GPU_LOADOP_CLEAR;
  targets[1].store_op = SDL_GPU_STOREOP_STORE;

  SDL_GPUDepthStencilTargetInfo depth_target;
  SDL_zero(depth_target);
  depth_target.texture = renderer.depthTarget();
  depth_target.load_op = SDL_GPU_LOADOP_LOAD;
  depth_target.store_op = SDL_GPU_STOREOP_STORE;

  return SDL_BeginGPURenderPass(command_buffer, targets, 2, &depth_target);
}

void RobotScene::compositeTransparencyPass(CommandBuffer &command_buffer) {
  // transparent triangle pipeline required
  if (!m_wboitComposite.initialized())
    return;

  SDL_GPUColorTargetInfo target;
  SDL_zero(target);
  target.texture = m_renderer.colorTarget();
  // op is LOAD - we want to keep results from opaque pass
  target.load_op = SDL_GPU_LOADOP_LOAD;
  target.store_op = SDL_GPU_STOREOP_STORE;
  const bool has_msaa = m_renderer.msaaEnabled();
  if (has_msaa) {
    target.resolve_texture = m_renderer.resolvedColorTarget();
    target.store_op = SDL_GPU_STOREOP_RESOLVE;
  }

  SDL_GPURenderPass *render_pass =
      SDL_BeginGPURenderPass(command_buffer, &target, 1, nullptr);
  m_wboitComposite.bind(render_pass);

  // Bind accumulation and revealage textures
  rend::bindFragmentSamplers(


['PRODUCT_BUNDLE_IDENTIFIER'] = settings.bundle_identifier,
			['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = 'iPhone Developer',
			['DEVELOPMENT_TEAM'] = settings.developer_team
		}
		end

		if _OPTIONS["teamid"] then
			xcodebuildsettings {
				["DEVELOPMENT_TEAM"] = _OPTIONS["teamid"]
			}
		end

		if _OPTIONS["tvOS"] then
			xcodebuildsettings {
				["SDKROOT"] = _OPTIONS["tvos"],
				['TARGETED_DEVICE_FAMILY'] = '3',
				['SUPPORTED_PLATFORMS'] = 'tvos'
			}
		end

		linkoptions { "-rpath @executable_path/Frameworks" }

		excludes
		{
			("**.DS_Store")
		}

		xcodebuildresources
		{
			"../Lumos/Source/Platform/iOS/Client",
			"Assets.xcassets",
            "Shaders",
            "ExampleProject"
            -- "Meshes",
            -- "Scenes",
            -- "Scripts",
            -- "Sounds",
            -- "Textures",
			--"Example.lmproj"
		}

	filter "system:linux"
		cppdialect "C++17"
		staticruntime "Off"
		systemversion "latest"

		defines
		{
			"LUMOS_PLATFORM_LINUX",
			"LUMOS_PLATFORM_UNIX",
			"LUMOS_RENDER_API_VULKAN",
			"VK_USE_PLATFORM_XCB_KHR",
			"LUMOS_IMGUI",
			"LUMOS_VOLK"
		}

		buildoptions
		{
			"-fpermissive",
			"-Wattributes",
			"-fPIC",
			"-Wignored-attributes",
			"-Wno-psabi"
		}

		links
		{
			"glfw",
		}

		links { "X11", "pthread", "dl", "atomic", "openal"}

		linkoptions { "-L%{cfg.targetdir}", "-Wl,-rpath=\\$$ORIGIN"}

		filter {'system:linux', 'architecture:x86_64'}
			buildoptions
			{
				"-msse4.1",
			}

		filter "system:android"
			androidsdkversion "29"
			androidminsdkversion "29"
			cppdialect "C++17"
			staticruntime "O


rMaterial.SetFloat("_FurLength", sliderFurLength.value);
    }

    void ChangeGravity()
    {
        _furMaterial.SetFloat("_GravityStrength", sliderGravityStrength.value);
    }

    void ChangeForceProperties()
    {

        float windValueX = Mathf.Sin(Time.time * sliderWindFrequency.value);
        float windValueY = Mathf.Sin(Time.time * sliderWindFrequency.value);
        float windValueZ = Mathf.Sin(Time.time * sliderWindFrequency.value);

        _furMaterial.SetVector("_Gravity", new Vector4(
                                        sliderForceX.value * windValueX,
                                        sliderForceY.value * windValueY,
                                        0 * windValueZ,
                                        0));
    }

}


= 0
        if interval > 0 then
            value = 1 - (paused_waves_for - game.tick) / interval
            if value < 0 then
                value = 0
            elseif value > 1 then
                value = 1
            end
        end
        gui.progressbar.value = value
        return
    end

    gui.threat.caption = { 'wave_defense.gui_3' }
    gui.threat.tooltip = { 'wave_defense.tooltip_1', biter_health_boost * 100, max_active_biters }
    ---@diagnostic disable-next-line: param-type-mismatch
    gui.threat_value.caption = floor(threat)
    gui.threat_value.tooltip = {
        'wave_defense.tooltip_1',
        biter_health_boost * 100,
        max_active_biters
    }

    if wave_number == 0 t


ic memory
        allocations in the process are allocated from the memory pool pointed to
        by the given MemoryPoolHandle.

        @param[in] pool The MemoryPoolHandle pointing to a valid memory pool
        @throws std::logic_error if a secret key is not set
        @throws std::invalid_argument if pool is uninitialized
        */
        SIGMA_NODISCARD inline Serializable<Ciphertext> encrypt_zero_symmetric(
            MemoryPoolHandle pool = MemoryManager::GetPool()) const
        {
            return encrypt_zero_symmetric(context_.first_parms_id(), pool);
        }

        /**
        Enables access to private members of sigma::Encryptor for SIGMA_C.
        */
        struct EncryptorPrivateHelper;

    private:
        Encryptor(const Encryptor &copy) = delete;

        Encryptor(Encryptor &&source) = delete;

        Encryptor &operator=(const Encryptor &assign) = delete;

        Encryptor &operator=(Encryptor &&assign) = delete;

        void encrypt_zero_internal(
            parms_id_type parms_id, bool is_asymmetric, bool save_seed, Ciphertext &destination,
            MemoryPoolHandle pool = MemoryManager::GetPool()) const;

        void encrypt_internal(
            const Plaintext &plain, bool is_asymmetric, bool save_seed, Ciphertext &destination,
            MemoryPoolHandle pool = MemoryManager::GetPool()) const;

        void sample_symmetric_ckks_c1_internal(Ciphertext &destination) const;

        void encrypt_symmetric_ckks_internal(const Plaintext &plain, Ciphertext &destination, Ciphertext &c1);

        SIGMAContext context_;

        PublicKey public_key_;

        SecretKey secret_key_;

        util::RandomGenerator *random_generator_ = nullptr;

//        util::DeviceArray<uint64_t> temp_noise_;
    };
} // namespace sigma


                As plugin can be something other than a button, icons and scss are optional depending on your feature.

                In a plugin, you get access to all Trumbowyg core and you can extends all things as you wish.

Skeleton

                To create a new plugin, you should start your trumbowyg.myplugin.js with this code:

(function ($) {
    'use strict';

    // Plugin default options
    var defaultOptions = {
    };

    // If the plugin is a button
    function buildButtonDef (trumbowyg) {
        return {
            fn: function () {
                // Plugin button logic
            }
        }
    }

    // If the plugin is a button
    function buildButtonIcon() {
        if ($("#trumbowyg-myplugin").length > 0) {
            return;
        }

        /*
        When your button is created, an SVG will be inserted with an xref to a
        symbol living at the fragment "#trumbowyg-myplugin". For Trumbowyg's
        own plugins, this will come from a sprite sheet which is injected into
        the document, built from the icon SVG in "ui/icons" in your plugin's
        source tree. This is how you should organise things if you are
        proposing your plugin to be included in the Trumbowyg main
        distribution, or if you are rolling your own custom build of Trumbowyg
        for your site.

        But, nothing says it *has* to come from Trumbowyg's injected sprite
        sheet; it only requires that this symbol exists in your document. To
        allow stand-alone distribution of your plugin, we're going to insert a
        custom SVG symbol into the document with the correct ID.
        */
        const iconWrap = $(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
        iconWrap.addClass("trumbowyg-icons");

        // For demonstration purposes, we've taken the "File" icon from
        // Remix Icon - https://remixicon.com/
        iconWrap.html(`
            <symbol id="trumbowyg-myplugin" viewBox="0 0 24 24">
                <path d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995L21 8zm-2 1h-5V4H5v16h14V9zM8 7h3v2H8V7zm0 4h8v2H8v-2zm0 4h8v2H8v-2z"/>
            </symbol>
        `).appendTo(document.body);
    }

    $.extend(true, $.trumbowyg, {
        // Add some translations
        langs: {
            en: {
                myplugin: 'My plugin'
            }
        },
        // Register plugin in Trumbowyg
        plugins: {
            myplugin: {
                // Code called by Trumbowyg core to register the plugin
                init: function (trumbowyg) {
                    // Fill current Trumbowyg instance with the plugin default options
                    trumbowyg.o.plugins.myplugin = $.extend(true, {},
                        defaultOptions,
                        trumbowyg.o.plugins.myplugin || {}
                    );

                    // If the plugin is a paste handler, register it
                    trumbowyg.pasteHandlers.push(function(pasteEvent) {
                        // My plugin paste logic
                    });

                    // If the plugin is a button
                    buildButtonIcon();
                    trumbowyg.addBtnDef('myplugin', buildButtonDef(trumbowyg));
                },
                // Return a list of button names which are active on current element
                tagHandler: function (element, trumbowyg) {
                    return [];
                },
                destroy: function (trumbowyg) {
                }
            }
        }
    })
})(jQuery);

        <div


/1/serde/trait.Serialize.html
pub struct Compat<T>(pub T);

impl<T> crate::Decode for Compat<T>
where
    T: serde_incl::de::DeserializeOwned,
{
    fn decode<D: crate::de::Decoder>(decoder: &mut D) -> Result<Self, crate::error::DecodeError> {
        let serde_decoder = de_owned::SerdeDecoder { de: decoder };
        T::deserialize(serde_decoder).map(Compat)
    }
}

impl<T> crate::Encode for Compat<T>
where
    T: serde_incl::Serialize,
{
    fn encode<E: crate::enc::Encoder>(
        &self,
        encoder: &mut E,
    ) -> Result<(), crate::error::EncodeError> {
        let serializer = ser::SerdeEncoder { enc: encoder };
        self.0.serialize(serializer)?;
        Ok(())
    }
}

/// Wrapper struct that implements [BorrowDecode] and [Encode] on any type that implements serde's [Deserialize] and [Serialize] respectively. This is mostly used on `&[u8]` and `&str`, for other types consider using [Compat] instead.
///
/// [BorrowDecode]: ../de/trait.BorrowDecode.html
/// [Encode]: ../enc/trait.Encode.html
/// [Deserialize]: https://docs.rs/serde/1/serde/de/trait.Deserialize.html
/// [Serialize]: https://docs.rs/serde/1/serde/trait.Serialize.html
pub struct BorrowCompat<T>(pub T);

impl<'de, T> crate::de::BorrowDecode<'de> for BorrowCompat<T>
where
    T: serde_incl::de::Deserialize<'de>,
{
    fn borrow_decode<D: crate::de::BorrowDecoder<'de>>(
        decoder: &mut D,
    ) -> Result<Self, crate::error::DecodeError> {
        let serde_decoder = de_borrowed::SerdeDecoder {
            de: decoder,
            pd: core::marker::PhantomData,
        };
        T::deserialize(serde_decoder).map(BorrowCompat)
    }
}

impl<T> crate::Encode for BorrowCompat<T>
where
    T: serde_incl::Serialize,
{
    fn encode<E: crate::enc::Encoder>(
        &self,
        encoder: &mut E,
    ) -> Result<(), crate::error::EncodeError> {
        let serializer = ser::SerdeEncoder { enc: encoder };
        self.0.serialize(serializer)?;
        Ok(())
    }
}
<gh_stars>1-10
use std::borrow::Cow;
fn can_catch_strings() -> eyre::Result<()> {
    Err("watch me catch this string")?;

    Ok(())
}

fn can_catch_cows() -> eyre::Result<()> {
    Err(Cow::Borrowed("holy crap was that a cow??? mooooo"))?;

    Ok(())
}

#[test]
fn can_catch_all_the_things() {
    can_catch_strings()
        .map_err(|e| println!("{:?}", e))
        .unwrap_err();
    can_catch_cows()
        .map_err(|e| println!("{:?}", e))
        .unwrap_err();
}
use std::{collections::HashMap, str::FromStr};

use anyhow::Result;
use bytes::Bytes;
use hyper::{
  header::{HeaderName, HeaderValue},
  Body, StatusCode,
};
use itertools::Itertools;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use smr::types::{BaseRequest, Request, Response};
use std::convert::TryFrom;
use thiserror::Error;
use tokio::sync::watch;
use


.SearchView.OnQueryTextListener {
            override fun onQueryTextChange(string: String): Boolean {
                searchStr = string
                if (searchStr == "") {
                    homeAdapter.run { setList(null) }
                }
                return false
            }

            override fun onQueryTextSubmit(string: String): Boolean {
                searchStr = string
                isRefresh = true
                startSearch(0, string)
                return false
            }
        })
        val mSearchTextView = search.findViewById<TextView>(R.id.search_src_text)
        //屏蔽搜索图标
        mSearchIcon.visibility = View.GONE
        mSearchTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f)
        mSearchTextView.setTextColor(ContextCompat.getColor(this, R.color.white))
        mSearchTextView.setHintTextColor(ContextCompat.getColor(this, R.color.list_divider))
        //去掉SearchView的下划线
        val viewById: View = search.findViewById(R.id.search_plate)
        viewById.setBackgroundColor(Color.TRANSPARENT)
    }

    override fun initView() {
        refreshLayout = swipeRefreshLayout1_search
        refreshLayout.setRefreshHeader(ch_header_seach)
        refreshLayout.setOnRefreshListener {
            homeAdapter.loadMoreModule.isEnableLoadMore = false
            isRefresh = true
            startSearch(0, searchStr)
        }
        recyclerView1_seach.run {
            layoutManager = linearLayoutManager
            adapter = homeAdapter
            itemAnimator = DefaultItemAnimator()
        }
        recycleViewCloseSoftInput(recyclerView1_seach, ll_search, this, true)
        homeAdapter.run {
            recyclerView = recyclerView1_seach
            setOnItemClickListener { adapter, view, position ->
                if (data.size != 0) {
                    val data = data[position]
                    WebViewActivity.start(this@SearchActivity, data.id, data.title, data.link)
                }
            }
            loadMoreModule.setOnLoadMoreListener {
                isRefresh = false
                refreshLayout.finishRefresh()
                val page = homeAdapter.data.size / pageSize
                startSearch(page, searchStr)
            }
            addChildClickViewIds(R.id.iv_like)
            setOnItemChildClickListener { adapter, view, position ->
                if (data.size == 0) return@setOnItemChildClickListener
                val res = data[position]
                when (view.id) {
                    R.id.iv_like -> {
                        if (!MyMMKV.mmkv.decodeBool(Constant.IS_LOGIN, false)) {
                            startActivity(Intent(this@SearchActivity, LoginActivity::class.java))
                            return@setOnItemChildClickListener
                        }
                        val collect = res.collect
                        res.collect = !collect
                        setData(position, res)
                        if (collect) viewModel.cancelCollectArticle(res.id)
                            .observe(this@SearchActivity, {})
                        else viewModel.addCollectArticle(res.id).observe(this@SearchActivity, {})
                    }
                }
            }
        }
        RvAnimUtils.setAnim(homeAdapter, SettingUtil.getListAnimal())
    }

    override fun startHttp() {
//        getHotSearch()
    }

    private fun startSearch(page: Int, key: String) {
        if (key == "") {
            refreshLayout.finishRefresh()
            return
        }
        showSearchLoading()
        viewModel.queryBySearchKey(page, key).observe(this) {
            it.datas.let { Article ->
                hideSearchLoading()
                homeAdapter.run {
                    if (isRefres


 toexec = [options.minisat_exe, fname]
        toprint += "Executing: %s\n" % toexec
        minisat_out_fname = "minisat_elim_data.out-%d" % self.threadID
        try:
            with open(minisat_out_fname, "w") as f:
                subprocess.check_call(" ".join(toexec), stdout=f, shell=True)
        except subprocess.CalledProcessError:
            toprint += "** Minisat errored out...\n"
            with print_lock:
                print(toprint)
            exit(-1)
            return -1
        t_msat = time.time()-start

        var_elimed = None
        num_vars_after_ms_preproc = None
        with open(minisat_out_fname, "r") as f:
            for line in f:
                line = line.strip()
                if "num-vars-eliminated" in line:
                    var_elimed = int(line.split()[1])
                if "num-free-vars" in line:
                    num_vars_after_ms_preproc = int(line.split()[1])

        assert var_elimed is not None, "Couldn't find var-elimed line, out: %s" % toprint
        assert num_vars_after_ms_preproc is not None, "Couldn't find num-free-vars line, out: %s" % toprint

        toprint += "-> orig num vars: %d\n" % orig_num_vars
        toprint += "-> T-cms : %-4.2f free vars after: %-9d\n" % (t_cms, num_vars_after_cms_preproc)
        toprint += "-> T-msat: %-4.2f free vars after: %-9d\n" % (t_msat, num_vars_after_ms_preproc)
        diff = num_vars_after_cms_preproc - num_vars_after_ms_preproc
        limit = float(orig_num_vars)*0.05
        if diff < limit*8 and t_msat > t_cms*4 and t_msat > 20:
            toprint += " * MiniSat didn't timeout, but we did, acceptable difference.\n"
            with print_lock:
                print(toprint)
            return 0

        if diff > limit:
            toprint += "*** ERROR: No. vars difference %d is more than 5%% " % diff
            toprint += "of original no. of vars, %d\n" % limit
            with print_lock:
                print(toprint)
            return 1

        toprint += "------------------[ thread %d ]------------------------" % self.threadID

        with print_lock:
            print(toprint)

        return 0

def test(extraopts):
    global exitnum
    exitnum = 0
    global todo
    assert os.path.isdir(args[0])
    path = os.path.join(args[0], '')
    todo = glob.glob(path+"/*.cnf.gz")

    threads = []
    for i in range(options.threads):
        threads.append(MyThread(i, extraopts))

    for t in threads:
        t.start()

    for t in threads:
        t.join()

    if exitnum == 0:
        print("ALL PASSED")
    else:
        print("SOME CHECKS FAILED")

    return exitnum

if __name__ == "__main__":
    test(["--preschedule", "occ-bve,must-renumber"])
    if exitnum != 0:
        exit(exitnum)


ip_node(MN_SET,(st),(name),(parent_id),(with_children),value))

#define zero_stat_node(st,name,parent_id,with_children)                 \
    (stats_tree_manip_node(MN_SET,(st),(name),(parent_id),(with_children),0))

/*
 * Add value to average calculation WITHOUT ticking node. Node MUST be ticked separately!
 *
 * Intention is to allow code to separately tick node (backward compatibility for plugin)
 * and set value to use for averages. Older versions without average support will then at
 * least show a count instead of 0.
 */
#define avg_stat_node_add_value_notick(st,name,parent_id,with_children,value) \
    (stats_tree_manip_node(MN_AVERAGE_NOTICK,(st),(name),(parent_id),(with_children),value))

/* Tick node and add a new value to the average calculation for this stats node. */
#define avg_stat_node_add_value(st,name,parent_id,with_children,value)  \
    (stats_tree_manip_node(MN_AVERAGE,(st),(name),(parent_id),(with_children),value))

/* Set flags for this node. Node created if it does not yet exist. */
#define stat_node_set_flags(st,name,parent_id,with_children,flags)      \
    (stats_tree_manip_node(MN_SET_FLAGS,(st),(name),(parent_id),(with_children),flags))

/* Clear flags for this node. Node created if it does not yet exist. */
#define stat_node_clear_flags(st,name,parent_id,with_children,flags)    \
    (stats_tree_manip_node(MN_CLEAR_FLAGS,(st),(name),(parent_id),(with_children),flags))

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __STATS_TREE_H */

/*
 * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 4
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * vi: set shiftwidth=4 tabstop=8 expandtab:
 * :indentSize=4:tabSize=8:noTabs=true:
 */


.27L20.95,2.03L0.07,0z"
				},
				{
					"id":"MP-SA",
					"title":"Saipan",
					"d":"M734.04,4627.93L659.4,4683.26L648.82,4770.17L704.68,4775.76L693.16,4740.68L727.33,4721.26L763.93,4632.15L734.04,4627.93z"
				},
				{
					"id":"MP-TI",
					"title":"Tinian",
					"d":"M616.96,4796.4L559.61,4843.5L599.07,4931.63L634.05,4873.47L616.96,4796.4z"
				},
				{
					"id":"MP-RO",
					"title":"Rota",
					"d":"M252.66,5623.97L319.77,5563.22L310.96,5544.83L249.13,5563.22L177.14,5607.72L252.66,5623.97z"
				}
			]
		}
	}
};
// (c) ammap.com | SVG (in JSON format) map of Tibet - Low
// areas: {id:"CN-540300"},{id:"CN-540100"},{id:"CN-542400"},{id:"CN-542500"},{id:"CN-540400"},{id:"CN-540500"},{id:"CN-540200"}
AmCharts.maps.tibetLow={
	"svg": {
		"defs": {
			"amcharts:ammap": {
				"projection":"mercator",
				"leftLongitude":"78.3934631348",
				"topLatitude":"36.4857940674",
				"rightLongitude":"99.1109237671",
				"bottomLatitude":"27.3054027557"
			}
		},
		"g":{
			"path":[
				{
					"id":"CN-540300",
					"title":"Chamdo",
					"d":"M779.92,359.28L799.03,326.63L797.44,294.36L790.1,232.39L764.84,188.97L734.29,181.5L709.5,219.58L691.38,207.56L688.34,223.51L637.75,188.83L628.56,211.36L640.38,242.52L624.9,231.56L615.01,255.32L588.49,255.34L607.79,273.56L650.69,266.43L697.99,280.85L700.83,307.77L732.76,317.75L735.21,334.06L762.85,334.46L779.92,359.28z"
				},
				{
					"id":"CN-540100",
					"title":"Lhasa",
					"d":"M549.46,283.71L524.44,286.1L500.65,250.51L478.86,249.78L443.3,294.97L440.25,319.01L460.12,325.69L539.4,303.6L549.46,283.71z"
				},
				{
					"id":"CN-542400",
					"title":"Nagqu",
					"d":"M345.48,0L212.99,48.76L236.45,83.88L232.17,108.21L294.77,147.61L296.89,167.15L258.1,201.81L301.27,248.29L315.6,275.49L335.51,253.84L357.11,278.54L443.3,294.97L478.86,249.78L500.65,250.51L524.44,286.1L549.46,283


4.4-.4h.93c.06-.2.14-.38.24-.55l-.65-.64a.392.392 0 010-.55l.54-.55a.38.38 0 01.54 0l.65.65c.18-.1.36-.18.55-.24V.4c0-.22.18-.4.4-.4h.8c.22 0 .4.18.4.4v.93c.18.06.35.14.52.22l.68-.68c.15-.16.41-.16.57 0l.57.57c.15.16.15.41 0 .57l-.68.68c.09.16.16.33.22.51zm-4.18.8c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5c-.82 0-1.5.67-1.5 1.5z"],"series-derived":["M10.66 7.92c.44.54 1.07.91 1.8 1.03L9.71 11.7c-.18.19-.43.3-.71.3s-.53-.11-.71-.3L5 8.41l-3 3V13h13c.55 0 1 .45 1 1s-.45 1-1 1H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1s1 .45 1 1v4.59l2.29-2.3C4.47 6.11 4.72 6 5 6s.53.11.71.29L9 9.59l1.66-1.67zM12.3 5.3l.3-.3H8c-.6 0-1-.4-1-1s.4-1 1-1h4.6l-.3-.3c-.2-.2-.3-.4-.3-.7 0-.6.5-1 1-1 .3 0 .5.1.7.3l2 2c.2.2.3.4.3.7s-.1.5-.3.7l-2 2c-.2.2-.4.3-.7.3-.6 0-1-.4-1-1 0-.3.1-.5.3-.7z"],"series-filtered":["M9.29 9.3c.3.62.8 1.12 1.42 1.41l-1 1c-.18.18-.43.29-.71.29s-.53-.11-.71-.3L5 8.41l-3 3V13h13c.55 0 1 .45 1 1s-.45 1-1 1H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1s1 .45 1 1v4.59l2.29-2.3C4.47 6.11 4.72 6 5 6s.53.11.71.29L9 9.59l.29-.29zM15.48 1c.31 0 .52.26.52.57 0 .16-.06.3-.17.41l-2.86 2.73v2.63c0 .16-.06.3-.17.41l-.82 1.1c-.1.1-.25.17-.41.17-.31 0-.57-.26-.57-.57V4.71L8.17 1.98A.566.566 0 018 1.57c0-.31.26-.57.57-.57h6.91z"],"series-search":["M9.6 8.94a4.937 4.937 0 001.82.01c.1-.01.22-.04.39-.08l.23-.07c.04-.01.08-.02.11-.04l.22.22-2.7 2.72c-.18.19-.43.3-.71.3s-.53-.11-.71-.3L4.98 8.41l-2.99 3V13h12.94c.55 0 1 .45 1 1s-.45 1-1 1H1c-.55 0-1-.45-1-1V3.99c0-.55.45-1 1-1s1 .45 1 1v4.59l2.28-2.3c.17-.18.42-.29.7-.29s.53.11


format string.

Example:

    timeWithNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 15, time.UTC)
    withNanoseconds := timeWithNanoseconds.String()

    timeWithoutNanoseconds := time.Date(2000, 2, 1, 12, 13, 14, 0, time.UTC)
    withoutNanoseconds := timeWithoutNanoseconds.String()

    fmt.Printf("withNanoseconds = %v\n", string(withNanoseconds))
    fmt.Printf("withoutNanoseconds = %v\n", string(withoutNanoseconds))

    // Output:
    // withNanoseconds = 2000-02-01 12:13:14.000000015 +0000 UTC
    // withoutNanoseconds = 2000-02-01 12:13:14 +0000 UTC

func (Time) Sub
    ¶

func (t Time) Sub(u Time) Duration

Sub returns the duration t-u. If the result exceeds the maximum (or minimum)
value that can be stored in a Duration, the maximum (or minimum) duration will
be returned. To compute t-d for a duration d, use t.Add(-d).

Example:

    start := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
    end := time.Date(2000, 1, 1, 12, 0, 0, 0, time.UTC)

    difference := end.Sub(start)
    fmt.Printf("difference = %v\n", difference)

    // Output:
    // difference = 12h0m0s

func (Time) Truncate
    ¶

func (t Time) Truncate(d Duration) Time

Truncate returns the result of rounding t down to a multiple of d (since the
zero time). If d <= 0, Truncate returns t stripped of any monotonic clock
reading but otherwise unchanged.

Truncate operates on the time as an absolute duration since the zero time; it
does not operate on the presentation form of the time. Thus, Truncate(Hour) may
return a time with a non-zero minute, depending on the time's Location.

Example:

    t, _ := time.Parse("2006 Jan 02 15:04:05", "2012 Dec 07 12:15:30.918273645")
    trunc := []time.Duration{
        time.Nanosecond,
        time.Microsecond,
        time.Millisecond,
        time.Second,
        2 * time.Second,
        time.Minute,
        10 * time.Minute,
    }

    for _, d := range trunc {
        fmt.Printf("t.Truncate(%5s) = %s\n", d, t.Truncate(d).Format("15:04:05.999999999"))
    }
    // To round to the last midnight in the local timezone, create a new Date.
    midnight := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local)
    _ = mi


            diam = read_float(line[4])
            sm.add_surface(inpt, sd=diam/2)
            if line[1] == 'AS':
                sm.set_stop()
    if 'aspherical data' in inpts:
        if 'AsphericalOddCount' in constants:
            typ = 'AsphericalOddCount'
        elif 'AsphericalA2' in constants:
            typ = 'AsphericalA2'
        else:
            typ = 'Aspherical'

        input_lines = inpts['aspherical data']
        _track_contents[typ] = len(input_lines)
        for line in input_lines:
            if typ == 'AsphericalOddCount':
                asp_coefs = [read_float(item) for item in line[3:]]
                asp_coefs = [0., 0.] + asp_coefs
            elif typ == 'AsphericalA2':
                asp_coefs = [read_float(item) for item in line[3:]]
            else:
                asp_coefs = [read_float(item) for item in line[2:]]
                asp_coefs[0] = 0.
            if typ == 'AsphericalOddCount':
                asp = RadialPolynomial(r=read_float(line[1]),
                                       cc=read_float(line[2]),
                                       coefs=asp_coefs)
            else:
                asp = EvenPolynomial(r=read_float(line[1]),
                                     cc=read_float(line[2]),
                                     coefs=asp_coefs)
            idx = int(line[0])
            sm.ifcs[idx].profile = asp

    if 'diffractive data' in inpts:
        input_lines = inpts['diffractive data']
        _track_contents['# doe'] = len(input_lines)
        for line in input_lines:
            coefs = [read_float(item) for item in line[3:]]
            dif_elem = DiffractiveElement(coefficients=coefs,
                                          ref_wl=read_float(line[1]),
                                          order=read_float(line[2]),
                                          phase_fct=doe.radial_phase_fct)
            idx = int(line[0])
            sm.ifcs[idx].phase_element = dif_elem
    if 'descriptive data' in inpts:
        input_lines = inpts['descriptive data']
        descripts = {input_line[0]: input_line[1:]
                     for input_line in input_lines}

        if 'title' in descripts:
            opt_model['sys'].title = descripts['title'][0]

    opt_model.update_model()
    return opt_model


ance](Sketcher_ConstrainDistanceX.md), [Vertical distance](Sketcher_ConstrainDistanceY.md) and [Distance](Sketcher_ConstrainDistance.md) constraints are transferred to the closest new edge.
-   [Angle](Sketcher_ConstrainAngle.md), [Symmetric](Sketcher_ConstrainSymmetric.md) and [Block](Sketcher_ConstrainBlock.md) constraints are currently not transferred.

---
⏵ [documentation index](../README.md) > [Sketcher](Sketcher_Workbench.md) > Sketcher Split/pt-br
---
 GuiCommand:
   Name: Std Workbench
   MenuLocation: View , Workbench
   Workbenches: All
---

# Std Workbench/pt-br

## Descrição

The **Std Workbench** command activates a selected [workbench](Workbenches.md).

![](images/Std_Workbench_ComboBox_Icons_And_Text.png )
*The default ComboBox Workbench selector type*

![](images/Std_Workbench_TabBar_Icons_Only.png )
*The optional TabBar Workbench selector type (here displayed with icons only) (v1.0*)

## Utilização

1.  There are several ways to invoke the command:
    -   Select a workbench from the ComboBox or TabBar ((v1.0) ) in the Workbench toolbar.
    -   Press the **** button on the TabBar to select a workbench that has been disabled in the [preferences](Preferences_Editor#Available_Workbenches.md) from the menu that opens.
    -   Select a workbench from the **View → Workbench** sub-menu.

## Notas

-   Additional [External Workbenches](External_Workbenches.md) can be downloaded with the  [Addon Manager](Std_AddonMgr.md).

## Preferências

See also: [Preferences Editor](Preferences_Editor.md).

-   A [page with related preferences](Preferences_Editor#Available_Workbenches.md) is available: **Edit → Preferences... → Workbenches → Available Workbenches**. You can change the **Start up workbench**, the **Workbench selector type**, and more. The **** button on the TabBar gives access to this page via its menu.

## Scripting

See also: [Autogenerated API documentation](https://freecad.github.io/SourceDoc/) and [FreeCAD Scripting Basics](FreeCAD_Scripting_Basics.md).

To change the workbench use the `activateWorkbench` method of the FreeCADGui module.

```python
import FreeCADGui

FreeCADGui.activateWorkbench("PartDesignWorkbench")
```

{{Std Base navi

}}  {{Interface navi}}

---
⏵ [documentation index](../README.md) > Std Workbench/pt-br
---
 GuiCommand:
   Name: Std Part
   MenuLocation: Nenhum
   Workbenches: Todas
   Version: 0.17
   SeeAlso: Std_Group/pt-br, PartDesign_Body/pt-br
---

# Std Part/pt-br

## Descrição

**[ [Parte Std](Std_Part/pt-br.md)**

(também chamada internamente de [Parte App](App_Part/pt-br.md)) é um contêiner usado para organizar e agrupar objetos. Ele permite que esses objetos sejam movimentados juntos como uma única unidade na [vista 3D](3D_view/pt-br.md).

O elemento \*\*Parte Std\*\* foi desenvolvido como um bloco básico para criar [montagens](assembly/pt-br.md) mecânicas. Ele é especialmente útil para organizar objetos que possuem


bar.Parent = holder

            update()

            bar.MouseButton1Click:Connect(function()
                create_card(plr)
            end)
        end
    end

    local function remove_plr(plr)
        local idx = find(players, plr)
        remove(players, idx)

        player_data[plr].bar:Destroy()
        player_data[plr] = nil

        --update the list cuz it doesnt update itself for some reason
        holder.Position = holder.Position
        update()
    end

    local function scroll(amount)
        current_scroll = clamp(amount, 0, max_players)

        if current_scroll > 0 then
            holder.Position = newUDim2(0, 6, 0, current_scroll * -tile_size - ((current_scroll) * 4) + 28)
        else
            holder.Position = newUDim2(0, 6, 0, 28)
        end

        indicator.Position = newUDim2(0, 0, (1 / (max_players + 1)) * current_scroll)
        update()
    end

    local function update_scroll(input)
        local sizeY = clamp((input.Position.Y - indicator_holder.AbsolutePosition.Y + inset) / indicator_holder.AbsoluteSize.Y, 0, 1)
        local value = round(clamp(max_players * sizeY, 0, max_players))

        scroll(value)
    end

    indicator_holder.MouseButton1Down:Connect(function()
        scrolling = true
        update_scroll{Position = services.UserInputService:GetMouseLocation() - newVector2(0, 36)}
    end)

    self:Connect(services.UserInputService.InputChanged, function(input)
        if scrolling and input.UserInputType == Enum.UserInputType.MouseMovement then
            update_scroll(input)
        end
    end)

    self:Connect(services.UserInputService.InputEnded, function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            scrolling = false
        end
    end)

    scroll_object.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseWheel then
            if input.Position.Z > 0 then
                scroll(current_scroll - 1)
            else
                scroll(current_scroll + 1)
            end
        end
    end)

    self:Connect(services.Players.PlayerRemoving, remove_plr)
    self:Connect(services.Players.PlayerAdded, create_player)

    for _, plr in next, services.Players:GetChildren() do
        create_player(plr)
    end

    self.Playerlist = {button_size = 0, labels = 0, object = list, toggled = true}

    function library.Playerlist:Button(options)
        utility.format(options)

        utility.defaults(options, {
            name = "button",
            callback = function() end
        })

        local button = card:Create("Square", {
            ZIndex = 29,
            Theme = "Object Background",
            OutlineTheme = "Object Border"
        })

        if options.tooltip then
            components.tooltip(button, options.tooltip)
        end

        utility.auto_button_color(button, "Object Background", fromRGB(3, 3, 3), fromRGB(8, 8, 8))

        local text = button:Create("Text", {
            Text = options.name,
            Font = library.font,
            Size = library.font_size,
            Position = newUDim2(0.5, 0, 0, 1),
            Theme = "Text",
            Center = true,
            ZIndex = 30
        })

        self.button_size += text.TextBounds.X + 38
        button.Size = newUDim2(0, text.TextBounds.X + 32, 0, 15)
        button.Position = newUDim2(1, -self.button_size, 1, -21)

        button.MouseButton1Click:Connect(function()
            options.callback(self, current_player)
        end)
    end

    functio


_START_GROUP),
                             "UnmatchedStartGroup", REQUIRED);
  ExpectParseFailureForProto(tag(1234, WireFormatLite::WIRETYPE_START_GROUP),
                             "UnmatchedStartGroupUnknown", REQUIRED);
  ExpectParseFailureForProto(tag(1, WireFormatLite::WIRETYPE_START_GROUP),
                             "UnmatchedStartGroupWrongType", REQUIRED);
  ExpectParseFailureForProto(
      len(18, tag(1234, WireFormatLite::WIRETYPE_START_GROUP)),
      "UnmatchedStartGroupNestedLen", REQUIRED);
  ExpectParseFailureForProto(
      group(201, tag(202, WireFormatLite::WIRETYPE_START_GROUP)),
      "UnmatchedStartGroupNested", REQUIRED);
  ExpectParseFailureForProto(
      absl::StrCat(tag(1, WireFormatLite::WIRETYPE_START_GROUP),
                   len(2, "hello world")),
      "UnmatchedStartGroupWithData", REQUIRED);

  ExpectParseFailureForProto(
      absl::StrCat(tag(201, WireFormatLite::WIRETYPE_START_GROUP),
                   len(2, "hello world"),
                   tag(202, WireFormatLite::WIRETYPE_END_GROUP)),
      "MismatchedGroupTags", REQUIRED);
  ExpectParseFailureForProto(
      group(201, absl::StrCat(tag(202, WireFormatLite::WIRETYPE_START_GROUP),
                              len(2, "hello world"),
                              tag(203, WireFormatLite::WIRETYPE_END_GROUP))),
      "MismatchedNestedGroupTags", REQUIRED);
}

template <typename MessageType>
void BinaryAndJsonConformanceSuiteImpl<MessageType>::TestUnknownWireType() {
  for (uint8_t type : {0x6, 0x7}) {
    for (uint8_t field = 0; field < 4; ++field) {
      for (uint8_t value = 0; value < 4; ++value) {
        std::string name = absl::StrFormat(
            "UnknownWireType%d_Field%d_Version%d", type, field, value);

        char data[2];
        data[0] = (field << 3) | type;  // unknown wire type.
        data[1] = value;
        std::string proto = {data, 2};
        ExpectParseFailureForProto(proto, name, REQUIRED);
      }
    }
  }
}

template <typename MessageType>
void BinaryAndJsonConformanceSuiteImpl<MessageType>::TestOneofMessage() {
  MessageType message;
  message.set_oneof_uint32(0);
  RunValidProtobufTestWithMessage("OneofZeroUint32", RECOMMENDED, &message,
                                  "oneof_uint32: 0");
  message.mutable_oneof_nested_message()->set_a(0);
  RunValidProtobufTestWithMessage("OneofZeroMessage", RECOMMENDED, &message,
                                  run_proto3_tests_
                                      ? "oneof_nested_message: {}"
                                      : "oneof_nested_message: {a: 0}");
  message.mutable_oneof_nested_message()->set_a(1);
  RunValidProtobufTestWithMessage("OneofZeroMessageSetTwice", RECOMMENDED,
                                  &message, "oneof_nested_message: {a: 1}");
  message.set_oneof_string("");
  RunValidProtobufTestWithMessage("OneofZeroString", RECOMMENDED, &message,
                                  "oneof_string: \"\"");
  message.set_oneof_bytes("");
  RunValidProtobufTestWithMessage("OneofZeroBytes", RECOMMENDED, &message,
                                  "oneof_bytes: \"\"");
  message.set_oneof_bool(false);
  RunValidProtobufTestWithMessage("OneofZeroBool", RECOMMENDED, &message,
                                  "oneof_bool: false");
  message.set_oneof_uint64(0);
  RunValidProtobufTestWithMessage("


("tokens: '%s' does not exist", tokens.c_str());
    return false;
  }

  if (!modeling_unit.empty() &&
      (modeling_unit == "bpe" || modeling_unit == "cjkchar+bpe")) {
    if (!FileExists(bpe_vocab)) {
      SHERPA_ONNX_LOGE("bpe_vocab: '%s' does not exist", bpe_vocab.c_str());
      return false;
    }
  }

  if (!paraformer.model.empty()) {
    return paraformer.Validate();
  }

  if (!nemo_ctc.model.empty()) {
    return nemo_ctc.Validate();
  }

  if (!whisper.encoder.empty()) {
    return whisper.Validate();
  }

  if (!fire_red_asr.encoder.empty()) {
    return fire_red_asr.Validate();
  }

  if (!tdnn.model.empty()) {
    return tdnn.Validate();
  }

  if (!zipformer_ctc.model.empty()) {
    return zipformer_ctc.Validate();
  }

  if (!wenet_ctc.model.empty()) {
    return wenet_ctc.Validate();
  }

  if (!sense_voice.model.empty()) {
    return sense_voice.Validate();
  }

  if (!moonshine.preprocessor.empty()) {
    return moonshine.Validate();
  }

  if (!dolphin.model.empty()) {
    return dolphin.Validate();
  }

  if (!canary.encoder.empty()) {
    return canary.Validate();
  }

  if (!telespeech_ctc.empty() && !FileExists(telespeech_ctc)) {
    SHERPA_ONNX_LOGE("telespeech_ctc: '%s' does not exist",
                     telespeech_ctc.c_str());
    return false;
  }

  if (!transducer.encoder_filename.empty()) {
    return transducer.Validate();
  }

  return true;
}

std::string OfflineModelConfig::ToString() const {
  std::ostringstream os;

  os << "OfflineModelConfig(";
  os << "transducer=" << transducer.ToString() << ", ";
  os << "paraformer=" << paraformer.ToString() << ", ";
  os << "nemo_ctc=" << nemo_ctc.ToString() << ", ";
  os << "whisper=" << whisper.ToString() << ", ";
  os << "fire_red_asr=" << fire_red_asr.ToString() << ", ";
  os << "tdnn=" << tdnn.ToString() << ", ";
  os << "zipformer_ctc=" << zipformer_ctc.ToString() << ", ";
  os << "wenet_ctc=" << wenet_ctc.ToString() << ", ";
  os << "sense_voice=" << sense_voice.ToString() << ", ";
  os << "moonshine=" << moonshine.ToString() << ", ";
  os << "dolphin=" << dolphin.ToString() << ", ";
  os << "canary=" << canary.ToString() << ", ";
  os << "telespeech_ctc=\"" << telespeech_ctc << "\", ";
  os << "tokens=\"" << tokens << "\", ";
  os << "num_threads=" << num_threads << ", ";
  os << "debug=" << (debug ? "True" : "False") << ", ";
  os << "provider=\"" << provider << "\", ";
  os << "model_type=\"" << model_type << "\", ";
  os << "modeling_unit=\"" << modeling_unit << "\", ";
  os << "bpe_vocab=\"" << bpe_vocab << "\")";

  return os.str();
}

}  // namespace sherpa_onnx
// sherpa-onnx/csrc/offline-ct-transformer-model.cc
//
// Copyright (c)  2024  Xiaomi Corporation

#include "sherpa-onnx/csrc/offline-ct-transformer-mo


PersonTable.GetMiddleName1DBName() + ", " +
                PPersonTable.GetFamilyIdDBName() + ' ' +
                "FROM PUB_" + PPersonTable.GetTableDBName() +
                " INNER JOIN " + "PUB_" + PPartnerTable.GetTableDBName() + " ON " +
                "PUB_" + PPersonTable.GetTableDBName() + '.' +
                PPartnerTable.GetPartnerKeyDBName() + " = " +
                "PUB_" + PPartnerTable.GetTableDBName() + '.' +
                PPartnerTable.GetPartnerKeyDBName() + ' ' +
                "WHERE " + PPersonTable.GetFamilyKeyDBName() + " = ? " +
                "AND " + PPartnerTable.GetStatusCodeDBName() + " <> '" +
                SharedTypes.StdPartnerStatusCodeEnumToString(TStdPartnerStatusCode.spscMERGED) + "' " +    // Make sure we don't load MERGED Partners (shouldn't have a p_family_key_n, but just in case.)
                "ORDER BY " + PPersonTable.GetFamilyIdDBName() + " ASC",
                PPersonTable.GetTableName(), AReadTransaction, ParametersArray, 0, 0);

            // Add Persons to Table
            for (Int32 Counter = 0; Counter <= FamilyPersonsDT.Rows.Count - 1; Counter += 1)
            {
                NewRow = FamilyMembersDT.NewRowTyped(false);
                NewRow.PartnerKey = FamilyPersonsDT[Counter].PartnerKey;
                NewRow.PartnerShortName =
                    Calculations.DeterminePartnerShortName(TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnFamilyName,
                            FamilyPersonsDT[Counter]), TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnTitle,
                            FamilyPersonsDT[Counter]), TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnFirstName,
                            FamilyPersonsDT[Counter]),
                        TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnMiddleName1, FamilyPersonsDT[Counter]));
                NewRow.FamilyId = FamilyPersonsDT[Counter].FamilyId;

                FamilyMembersDT.Rows.Add(NewRow);
            }

            return FamilyMembersDT;
        }
    }
}


 dotted black; }

.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }

.ui-slider-horizontal { height: 6px; }
.ui-slider-horizontal .ui-slider-handle {
  top: -5px;
  margin-left: 0;
}
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }

.ui-slider-vertical { width: .3em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
.ui-spinner-up { top: 0; }
.ui-spinner-down { bottom: 0; }

/* Fades and background-images don't work well together in IE6, drop the image */
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
.ui-widget-content { background: #e0ddda; color: #222222;  margin-top: 3em; }
.ui-widget-content a { color: #222222/*{fcContent}*/; }
.ui-widget-header { background: rgba(0, 153, 229, 0.78); color: #222222/*{fcHeader}*/; font-weight: bold; }
.ui-widget-header a { color: #222222/*{fcHeader}*/; }

/* Interaction states
----------------------------------*/

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 0px solid #ff5d56/*{borderColorDefault}*/;
  background: rgb(255, 137, 137);
  font-weight: normal/*{f