.Equal(t, expected, hashRing.ids)
}
package main

import (
	"errors"
	"fmt"
	"strings"

	"github.com/pion/mediadevices/pkg/codec"
	"github.com/pion/mediadevices/pkg/io/audio"
	"github.com/pion/mediadevices/pkg/io/video"
	"github.com/pion/mediadevices/pkg/prop"
	"github.com/pion/webrtc/v3"
)

// CodecSelector is a container of video and audio encoder builders, which later will be used
// for codec matching.
type CodecSelector struct {
	videoEncoders []codec.VideoEncoderBuilder
	audioEncoders []codec.AudioEncoderBuilder
}

// CodecSelectorOption is a type for specifying CodecSelector options
type CodecSelectorOption func(*CodecSelector)

// WithVideoEncoders replace current video codecs with listed encoders
func WithVideoEncoders(encoders ...codec.VideoEncoderBuilder) CodecSelectorOption {
	return func(t *CodecSelector) {
		t.videoEncoders = encoders
	}
}

// WithVideoEncoders replace current audio codecs with listed encoders
func WithAudioEncoders(encoders ...codec.AudioEncoderBuilder) CodecSelectorOption {
	return func(t *CodecSelector) {
		t.audioEncoders = encoders
	}
}

// NewCodecSelector constructs CodecSelector with given variadic options
func NewCodecSelector(opts ...CodecSelectorOption) *CodecSelector {
	var track CodecSelector

	for _, opt := range opts {
		opt(&track)
	}

	return &track
}

// Populate lets the webrtc engine be aware of supported codecs that are contained in CodecSelector
func (selector *CodecSelector) Populate(setting *webrtc.MediaEngine) {
	for _, encoder := range selector.videoEncoders {
		setting.RegisterCodec(encoder.RTPCodec().RTPCodecParameters, webrtc.RTPCodecTypeVideo)
	}

	for _, encoder := range selector.audioEncoders {
		setting.RegisterCodec(encoder.RTPCodec().RTPCodecParameters, webrtc.RTPCodecTypeAudio)
	}
}

// selectVideoCodecByNames selects a single codec that can be built and matched. codecNames can be formatted as "video/<codecName>" or "<codecName>"
func (selector *CodecSelector) selectVideoCodecByNames(reader video.Reader, inputProp prop.Media, codecNames ...string) (codec.ReadCloser, *codec.RTPCodec, error) {
	var selectedEncoder codec.VideoEncoderBuilder
	var encodedReader codec.ReadCloser
	var errReasons []string
	var err error

outer:
	for _, wantCodec := range codecNames {
		wantCodecLower := strings.ToLower(wantCodec)
		for _, encoder := range selector.videoEncoders {
			// MimeType is formated as "video/<codecName>"
			if strings.HasSuffix(strings.ToLower(encoder.RTPCodec().MimeType), wantCodecLower) {
				encodedReader, err = encoder.BuildVideoEncoder(reader, inputProp)
				if err == nil {
					selectedEncoder = encoder
					break outer
				}
			}

			errReasons = append(errReasons, fmt.Sprintf("%s: %s", encoder.RTPCodec().MimeType, err))
		}
	}

	if selectedEncoder == nil {
		return nil, nil, errors.New(strings.Join(errReasons, "\n\n"))


(reason)` を呼ぶこともできます。

ファクトリ関数の中で `Promise` を返すことができるので、 Webpack 2 以降と ES2015 の構文では以下のように書くこともできます:

```js
import { defineAsyncComponent } from 'vue'

const AsyncComp = defineAsyncComponent(() =>
  import('./components/AsyncComponent.vue')
)

app.component('async-component', AsyncComp)
```

[コンポーネントのローカル登録](component-registration.html#ローカル登録) でも、 `defineAsyncComponent` を利用できます。

```js
import { createApp, defineAsyncComponent } from 'vue'

createApp({
  // ...
  components: {
    AsyncComponent: defineAsyncComponent(() =>
      import('./components/AsyncComponent.vue')
    )
  }
})
```

### Suspense との併用

非同期コンポーネントはデフォルトで _suspensible_ です。これは非同期コンポーネントが `<Suspense>` を親に持ったとき、 `<Suspense>` の非同期の依存として取り扱われることを意味しています。このケースでは、読み込みの状態は `<Suspense>` から制御され、コンポーネント自身が持つ loading や error, delay, timeout といったオプションは無視されます。

非同期コンポーネントのオプションに `suspensible: false` を指定することで、 `Suspense` の制御から外すことができ、常にコンポーネントが自身の読み込み状態を制御することができます。

[API リファレンス](../api/global-api.html#引数-4) で利用可能なオプションのリストを確認できます。
# Provide / Inject

> このセクションでは、コード例に [単一ファイルコンポーネント](../guide/single-file-component.html) 構文を使用します

> このページは、すでに [Provide / Inject](component-provide-inject.html)、[Composition API 導入](composition-api-introduction.html)、[リアクティブの基礎](reactivity-fundamentals.html)を読み終えていることを想定しています。

[provide / inject](component-provide-inject.html) は Composition API でも使うことができます。どちらも現在アクティブなインスタンスの [`setup()`](composition-api-setup.html) 中にのみ呼び出すことが可能です。

## シナリオの背景

これから、Composition API を使用して、以下のコードを書き直そうとしているとしましょう。以下のコードでは、`MyMap` コンポーネントが `MyMarker` コンポーネントにユーザの位置情報を提供しています。

```vue
<!-- src/components/MyMap.vue -->
<template>
  <MyMarker />
</template>

<script>
import MyMarker from './MyMarker.vue'

export default {
  components: {
    MyMarker
  },
  provide: {
    location: 'North Pole',
    geolocation: {
      longitude: 90,
      latitude: 135
    }
  }
}
</script>
```

```vue
<!-- src/components/MyMarker.vue -->
<script>
export default {
  inject: ['location', 'geolocation']
}
</script>
```

## Provide


achInfoState
	for i, a := range links {
		if _, ok := linksToRemove[i]; !ok {
			remainingLinks = append(remainingLinks, a)
		}
	}
	return remainingLinks
}

// getExpectedLinks expands *AttachInfo into a list of specific attach
// points.
func (r *ClFexitProgramReconciler) getExpectedLinks(_ bpfmaniov1alpha1.ClFexitAttachInfo,
) ([]bpfmaniov1alpha1.ClFexitAttachInfoState, error) {
	nodeLinks := []bpfmaniov1alpha1.ClFexitAttachInfoState{}

	link := bpfmaniov1alpha1.ClFexitAttachInfoState{
		AttachInfoStateCommon: bpfmaniov1alpha1.AttachInfoStateCommon{
			ShouldAttach: true,
			UUID:         uuid.New().String(),
			LinkId:       nil,
			LinkStatus:   bpfmaniov1alpha1.ApAttachNotAttached,
		},
	}
	nodeLinks = append(nodeLinks, link)

	return nodeLinks, nil
}

func (r *ClFexitProgramReconciler) getProgramLoadInfo() *gobpfman.LoadInfo {
	return &gobpfman.LoadInfo{
		Name:        r.currentProgram.Name,
		ProgramType: r.getBpfmanProgType(),
		Info: &gobpfman.ProgSpecificInfo{
			Info: &gobpfman.ProgSpecificInfo_FexitLoadInfo{
				FexitLoadInfo: &gobpfman.FexitLoadInfo{
					FnName: r.currentProgram.FExit.Function,
				},
			},
		},
	}
}
/*
Copyright 2025 The bpfman Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

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

package bpfmanagent

import (
	"context"
	"fmt"
	"reflect"

	bpfmaniov1alpha1 "github.com/bpfman/bpfman-operator/apis/v1alpha1"
	internal "github.com/bpfman/bpfman-operator/internal"
	gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1"
	"github.com/google/uuid"
)

// ClXdpProgramReconciler contains the info required to reconcile an XdpProgram
type ClXdpProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	currentLink *bpfmaniov1alpha1.ClXdpAttachInfoState
}

func (r *ClXdpProgramReconciler) getProgId() *uint32 {
	return r.currentProgramState.ProgramId
}

func (r *ClXdpProgramReconciler) getProgType() internal.ProgramType {
	return internal.Xdp
}

func (r *ClXdpProgramReconciler) getBpfmanProgType() gobpfman.BpfmanProgramType {
	return gobpfman.BpfmanProgramType_XDP
}

func (r *ClXdpProgramReconciler) getProgName() string {
	return r.currentProgram.Name
}

func (r *ClXdpProgramReconciler) shouldAttach() bool {
	return r.currentLink.ShouldAttach
}

func (r *ClXdpProgramReconciler) isAttached(ctx context.Context) bool {
	if r.currentProgramState.ProgramI


StartBtn->setStyleSheet(m_stylesheet_QPushButton_blue);
        if(rightTimedStartWidget){
            rightStackedWidget->setCurrentWidget(rightTimedStartWidget);
        }
    });

    leftLayout->addSpacing(40);
    leftLayout->addWidget(leftDirectStartBtn,0,Qt::AlignHCenter);
    leftLayout->addSpacing(10);
    leftLayout->addWidget(leftTimedStartBtn,0,Qt::AlignHCenter);
    leftLayout->addStretch(40);
    boxHLayout->addWidget(leftWidget);

}

#include "Settings.h"
#include "SettingsProxyDialog.h"
#include "Utils/ApiCheckVersion.h"
#include "Utils/models.h"
#include "style.h"
#include "Utils/ComLoadingLabel.h"
#include "Utils/ComLineWidget.h"
#include "Utils/ComMessageBox.h"
#include "Task/TaskWebEngineProfile.h"
#include <QSettings>
#include <QCoreApplication>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QToolButton>
#include <QLabel>
#include <QCheckBox>
#include <QTimer>
#include <QMessageBox>
#include <QsLog.h>

Settings::Settings(QWidget *parent) : QWidget(parent)
{
    QLOG_INFO() << "Settings::Settings()";
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    mainLayout->setContentsMargins(0,2,0,0);
    mainLayout->setSpacing(0);
    mainLayout->addWidget(new ComLineWidget(this));

    QWidget * boxWidget = new QWidget(this);
    mainLayout->addWidget(boxWidget);
    boxLayout = new QVBoxLayout(boxWidget);
    boxLayout->setContentsMargins(20,0,20,0);
    boxLayout->setSpacing(0);

    boxLayout->addSpacing(30);
    initUi();
    boxLayout->addStretch(10);

    // 检测更新监听
    connect(ApiCheckVersion::getInstance(),&ApiCheckVersion::notifyCheckVersion,this,[this](bool state,QString &msg,MVersion &version){
        loadingLabel->hide();
        loadingMsgLabel->setText(msg);
    });

}
Settings::~Settings(){
  QLOG_INFO() << "Settings::~Settings()";
}

void Settings::initUi(){

    QWidget *outWidget = new QWidget(this);
    outWidget->setFixedSize(600,160);
    outWidget->setStyleSheet(".QWidget{background-color:rgb(205,205,205);border-radius: 5px;}");
    QVBoxLayout *outLayout = new QVBoxLayout(outWidget);
    outLayout->setContentsMargins(1,1,1,1);

    QWidget * settingsWidget = new QWidget(outWidget);
    settingsWidget->setStyleSheet(".QWidget{background-color:rgb(255,255,255);border-radius: 5px;}");
    QVBoxLayout *settingsLayout = new QVBoxLayout(settingsWidget);
    settingsLayout->setContentsMargins(20,0,20,0);
    settingsLayout->setSpacing(0);

    // 版本检测更新 start
    QWidget *versionWidget = new QWidget(settingsWidget);
    versionWidget->setFixedHeight(45);
    QHBoxLayout *versionHLayout = new QHBoxLayout(versionWidget);
    versionHLayout->setContentsMargins(0,0,0,0);
    versionHLayout->setSpacing(0);
    QPushButton *checkBtn = new QPushButton(versionWidget);
    checkBtn->setFixedSize(80,28);
    checkBtn->setStyleSheet(m_stylesheet_QPushButton_hollow);
    checkBtn->setCursor(Qt::PointingHandCursor);
    checkBtn->setText("检查更新");
    QLabel *versionLabel = new QLabel(versionWidget);


1.5Z\"/>") { } }
    public class StarHalf : Icon { public StarHalf() : base("StarHalf", IconVariant.Regular, IconSize.Size16, "<path d=\"M5.67 5.18 7.2 2.1c.17-.33.49-.5.81-.5.32 0 .64.17.8.5l1.53 3.08 3.4.5a.9.9 0 0 1 .5 1.53l-2.46 2.4.58 3.39a.9.9 0 0 1-1.3.95L8 12.35l-3.04 1.6a.9.9 0 0 1-1.3-.95l.57-3.39-2.46-2.4a.9.9 0 0 1 .5-1.53l3.4-.5ZM8 11.34a.9.9 0 0 1 .42.1l2.9 1.53-.55-3.24a.9.9 0 0 1 .26-.8l2.36-2.3-3.26-.46a.9.9 0 0 1-.67-.5L8 2.73v8.6Z\"/>") { } }
    public class StarLineHorizontal3 : Icon { public StarLineHorizontal3() : base("StarLineHorizontal3", IconVariant.Regular, IconSize.Size16, "<path d=\"M8.8 2.1a.9.9 0 0 0-1.6 0L5.66 5.18l-3.4.5a.9.9 0 0 0-.5 1.53l2.46 2.4L3.65 13a.9.9 0 0 0 1.3.95L8 12.35l.48.25a1.5 1.5 0 0 1-.47-1.26.9.9 0 0 0-.43.1l-2.9 1.53.55-3.24a.9.9 0 0 0-.26-.8l-2.35-2.3 3.25-.46a.9.9 0 0 0 .68-.5L8 2.73l.73 1.48c.23-.13.49-.21.77-.21h.24l-.93-1.9ZM9.5 5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5Zm0 3a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5Zm0 3a.5.5 0 0 0 0 1h5a.5.5 0 1 0 0-1h-5Z\"/>") { } }
    public class StarOff : Icon { public StarOff() : base("StarOff", IconVariant.Regular, IconSize.Size16, "<path d=\"M12.36 13.06a.9.9 0 0 1-1.32.89L8 12.35l-3.04 1.6a.9.9 0 0 1-1.3-.95l.57-3.39-2.46-2.4a.9.9 0 0 1 .5-1.53l2.36-.34-3.48-3.49a.5.5 0 1 1 .7-.7l13 13a.5.5 0 0 1-.7.7l-1.8-1.79Zm-1.22-1.22L5.5 6.22l-2.9.42 2.36 2.3c.21.2.3.5.26.79l-.56 3.24 2.91-1.53a.9.9 0 0 1 .84 0l2.9 1.53-.18-1.13Zm2.25-5.2-2.35 2.28.74.73-.01-.04 2.46-2.4a.9.9 0 0 0-.5-1.53l-3.4-.5L8.8 2.1a.9.9 0 0 0-1.62 0l-.98 2 .75.74L8 2.73l1.46 2.94a.9.9 0 0 0 .67.5l3.26.47Z\"/>") { } }
    public class StarOneQuarter : Icon { public StarOneQuarter() : base("StarOneQuart


QuickCodeReplacementTrampolineArm,
  arm64: writeArtQuickCodeReplacementTrampolineArm64
};
function writeArtQuickCodeReplacementTrampolineIA32(trampoline, target, redirectSize, constraints, vm3) {
  const threadOffsets = getArtThreadSpec(vm3).offset;
  const artMethodOffsets = getArtMethodSpec(vm3).offset;
  let offset;
  Memory.patchCode(trampoline, 128, (code3) => {
    const writer = new X86Writer(code3, { pc: trampoline });
    const relocator = new X86Relocator(target, writer);
    const fxsave = [15, 174, 4, 36];
    const fxrstor = [15, 174, 12, 36];
    writer.putPushax();
    writer.putMovRegReg("ebp", "esp");
    writer.putAndRegU32("esp", 4294967280);
    writer.putSubRegImm("esp", 512);
    writer.putBytes(fxsave);
    writer.putMovRegFsU32Ptr("ebx", threadOffsets.self);
    writer.putCallAddressWithAlignedArguments(artController.replacedMethods.findReplacementFromQuickCode, ["eax", "ebx"]);
    writer.putTestRegReg("eax", "eax");
    writer.putJccShortLabel("je", "restore_registers", "no-hint");
    writer.putMovRegOffsetPtrReg("ebp", 7 * 4, "eax");
    writer.putLabel("restore_registers");
    writer.putBytes(fxrstor);
    writer.putMovRegReg("esp", "ebp");
    writer.putPopax();
    writer.putJccShortLabel("jne", "invoke_replacement", "no-hint");
    do {
      offset = relocator.readOne();
    } while (offset < redirectSize && !relocator.eoi);
    relocator.writeAll();
    if (!relocator.eoi) {
      writer.putJmpAddress(target.add(offset));
    }
    writer.putLabel("invoke_replacement");
    writer.putJmpRegOffsetPtr("eax", artMethodOffsets.quickCode);
    writer.flush();
  });
  return offset;
}
function writeArtQuickCodeReplacementTrampolineX64(trampoline, target, redirectSize, constraints, vm3) {
  const threadOffsets = getArtThreadSpec(vm3).offset;
  const artMethodOffsets = getArtMethodSpec(vm3).offset;
  let offset;
  Memory.patchCode(trampoline, 256, (code3) => {
    const writer = new X86Writer(code3, { pc: trampoline });
    const relocator = new X86Relocator(target, writer);
    const fxsave = [15, 174, 4, 36];
    const fxrstor = [15, 174, 12, 36];
    writer.putPushax();
    writer.putMovRegReg("rbp", "rsp");
    writer.putAndRegU32("rsp", 4294967280);
    writer.putSubRegImm("rsp", 512);
    writer.putBytes(fxsave);
    writer.putMovRegGsU32Ptr("rbx", threadOffsets.self);
    writer.putCallAddressWithAlignedArguments(artController.replacedMethods.findReplacementFromQuickCode, ["rdi", "rbx"]);
    writer.putTestRegReg("rax", "rax");
    writer.putJccShortLabel("je", "restore_registers", "no-hint");
    writer.putMovRegOffsetPtrReg("rbp", 8 * 8, "rax");
    writer.putLabel("restore_registers");
    writer.putBytes(fxrstor);
    writer.putMovRegReg("rsp", "rbp");
    writer.putPopax();
    writer.putJccShortLabel("jne", "invoke_replacement", "no-hint");
    do {
      offset = relocator.readOne();
    } while (offset < redirectSize && !relocator.eoi);
    relocator.writeAll();
    if (!relocator.eoi) {
      writer.putJmpAddress(target.add(offset));
    }
    writer.putLabel("invoke_


og has access to the project's directory.
   * The hint string can be a set of filters with wildcards like `"*.png,*.jpg"`. See also
   * [FileDialog.filters].
   */
  SAVE_FILE(27),
  /**
   * Hints that a [String] property is a path to a file. Editing it will show a file dialog for
   * picking the path for the file to be saved at. The dialog has access to the entire filesystem. The
   * hint string can be a set of filters with wildcards like `"*.png,*.jpg"`. See also
   * [FileDialog.filters].
   */
  GLOBAL_SAVE_FILE(28),
  INT_IS_OBJECTID(29),
  /**
   * Hints that an [int] property is a pointer. Used by GDExtension.
   */
  INT_IS_POINTER(30),
  /**
   * Hints that a property is an [Array] with the stored type specified in the hint string.
   */
  ARRAY_TYPE(31),
  /**
   * Hints that a property is a [Dictionary] with the stored types specified in the hint string.
   */
  DICTIONARY_TYPE(38),
  /**
   * Hints that a string property is a locale code. Editing it will show a locale dialog for picking
   * language and country.
   */
  LOCALE_ID(32),
  /**
   * Hints that a dictionary property is string translation map. Dictionary keys are locale codes
   * and, values are translated strings.
   */
  LOCALIZABLE_STRING(33),
  /**
   * Hints that a property is an instance of a [Node]-derived type, optionally specified via the
   * hint string (e.g. `"Node2D"`). Editing it will show a dialog for picking a node from the scene.
   */
  NODE_TYPE(34),
  /**
   * Hints that a quaternion property should disable the temporary euler editor.
   */
  HIDE_QUATERNION_EDIT(35),
  /**
   * Hints that a string property is a password, and every character is replaced with the secret
   * character.
   */
  PASSWORD(36),
  /**
   * Hints that a [Callable] property should be displayed as a clickable button. When the button is
   * pressed, the callable is called. The hint string specifies the button text and optionally an icon
   * from the `"EditorIcons"` theme type.
   *
   * [codeblock lang=text]
   *
   * "Click me!" - A button with the text "Click me!" and the default "Callable" icon.
   *
   * "Click me!,ColorRect" - A button with the text "Click me!" and the "ColorRect" icon.
   *
   * ```
   *
   * **Note:** A [Callable] cannot be properly serialized and stored in a file, so it is recommended
   * to use [PROPERTY_USAGE_EDITOR] instead of [PROPERTY_USAGE_DEFAULT].
   */
  TOOL_BUTTON(39),
  /**
   * Hints that a property will be changed on its own after setting, such as
   * [AudioStreamPlayer.playing] or [GPUParticles3D.emitting].
   */
  ONESHOT(40),
  /**
   * Represents the size of the [PropertyHint] enum.
   */
  MAX(42),
  ;

  public override val `value`: Long
  init {
    this.`value` = `value`
  }

  public companion object {
    public fun from(`value`: Long): PropertyHint = entries.single { it.`value` == `value` }
  }
}
@file:Suppress("RemoveRedundantBackticks", "FloatingPointLiteralPrecision


 Name"`
	Description string    `gorm:"type:text;comment:Group Description"`
	CreatedAt   time.Time `gorm:"<-:create;comment:Create Time"`
	UpdatedAt   time.Time `gorm:"comment:Update Time"`
}

func (Group) TableName() string {
	return "subscribe_group"
}
package ads

import (
	"context"

	"github.com/redis/go-redis/v9"
	"gorm.io/gorm"
)

type customAdsLogicModel interface {
	GetAdsListByPage(ctx context.Context, page, size int, filter Filter) (int64, []*Ads, error)
}

// NewModel returns a model for the database table.
func NewModel(conn *gorm.DB, c *redis.Client) Model {
	return &customAdsModel{
		defaultAdsModel: newAdsModel(conn, c),
	}
}

type Filter struct {
	Status *int
	Search string
}

// GetAdsListByPage  get ads list by page
func (m *customAdsModel) GetAdsListByPage(ctx context.Context, page, size int, filter Filter) (int64, []*Ads, error) {
	var list []*Ads
	var total int64
	err := m.QueryNoCacheCtx(ctx, &list, func(conn *gorm.DB, v interface{}) error {
		conn = conn.Model(&Ads{})
		if filter.Status != nil {
			conn = conn.Where("`status` = ?", *filter.Status)
		}
		if filter.Search != "" {
			conn = conn.Where("`title` LIKE ? OR `content` LIKE ?", "%"+filter.Search+"%", "%"+filter.Search+"%")
		}
		return conn.Count(&total).Offset((page - 1) * size).Limit(size).Find(v).Error
	})
	return total, list, err
}
package traffic

import (
	"context"
	"errors"

	"gorm.io/gorm"
)

var _ Model = (*customTrafficModel)(nil)

type (
	Model interface {
		trafficModel
		customTrafficLogicModel
	}
	trafficModel interface {
		Insert(ctx context.Context, data *TrafficLog) error
		FindOne(ctx context.Context, id int64) (*TrafficLog, error)
		Update(ctx context.Context, data *TrafficLog) error
		Delete(ctx context.Context, id int64) error
		Transaction(ctx context.Context, fn func(db *gorm.DB) error) error
	}

	customTrafficModel struct {
		*defaultTrafficModel
	}
	defaultTrafficModel struct {
		Conn  *gorm.DB
		table string
	}
)

func newTrafficModel(db *gorm.DB) *defaultTrafficModel {
	return &defaultTrafficModel{
		Conn:  db,
		table: "`traffic`",
	}
}

func (m *defaultTrafficModel) Insert(ctx context.Context, data *TrafficLog) error {
	return m.Conn.WithContext(ctx).Create(&data).Error
}

func (m *defaultTrafficModel) FindOne(ctx context.Context, id int64) (*TrafficLog, error) {
	var data TrafficLog
	err := m.Conn.WithContext(ctx).Model(&TrafficLog{}).Where("`id` = ?", id).First(&data).Error
	return &data, err
}

func (m *defaultTrafficModel) Update(ctx context.Context, data *TrafficLog) error {
	return m.Conn.Wi


from enert.init import *
from enert import *
from Crypto.Cipher import *
from fractions import gcd

class RSA:
    def __init__(self):
        pass
    @classmethod
    def new(cls, p, q):
        return RSAfactory(p, q)

class RSAfactory:
    def __init__(self, p, q):
        self.p = p
        self.q = q
        self.public_key, self.private_key = self.generate_keys(self.p, self.q)
    def lcm(self, p, q):
        return (p * q) // gcd(p, q)
    def generate_keys(self, p, q):
        N = p * q
        L = self.lcm(p - 1, q - 1)
        for i in range(2, L):
            if gcd(i, L) == 1:
                E = i
                break
        for i in range(2, L):
            if (E * i) % L == 1:
                D = i
                break
        return (E, N), (D, N)
    def encrypt(self, plain_text):
        E, N = self.public_key
        plain_integers = [ord(char) for char in plain_text]
        encrypted_integers = [i ** E % N for i in plain_integers]
        encrypted_text = ''.join(chr(i) for i in encrypted_integers)
        self.encrypted_text = encrypted_text
        return encrypted_text
    def decrypt(self, encrypted_text):
        D, N = self.private_key
        encrypted_integers = [ord(x) for x in encrypted_text]
        decrypted_intergers = [i ** D % N for i in encrypted_integers]
        decrypted_text = ''.join(chr(i) for i in decrypted_intergers)
        self.decrypted_text = decrypted_text
        return decrypted_text


_nMaxExternalTotal )
		{
			s_nMaxExternalTotal = nExternalTotal;
		}
		if ( nExternalLinked > s_nMaxExternalLinked )
		{
			s_nMaxExternalLinked = nExternalLinked;
		}
		if ( ( ( nClients - nProxies ) + nExternalTotal ) > s_nMaxCombinedViewers )
		{
			s_nMaxCombinedViewers = ( nClients - nProxies ) + nExternalTotal;
		}
	}
}

bool CheckKeyXuid( const CSteamID &steamID, KeyValues *pKeys, const char* pKeyWithXuid )
{
	CSteamID playerSteamID( pKeys->GetUint64( pKeyWithXuid ) );
	if ( steamID.GetAccountID() == playerSteamID.GetAccountID() )
	{
		return true;
	}

	return false;
}

int GetPlayerIndex( const CSteamID &steamID )
{
	FOR_EACH_VEC( s_demoUserInfo, i )
	{
		if ( s_demoUserInfo[ i ].steamID.GetAccountID() == steamID.GetAccountID() )
		{
			return i + 1;
		}
	}

	return -1;
}

//-----------------------------------------------------------------------------
// Purpose: Called when a demo file runs out, or the user starts a game
// Output : void CDemo::StopPlayback
//-----------------------------------------------------------------------------
void CDemoPlayer::StopPlayback( void )
{
	if ( !IsPlayingBack() )
		return;

	demoaction->StopPlaying();

	m_DemoFile.Close();
	m_bPlayingBack = false;
	m_bPlaybackPaused = false;
	m_flAutoResumeTime = 0.0f;

	if ( m_bTimeDemo )
	{
		g_EngineStats.EndRun();

		if ( !s_bBenchframe )
		{
			WriteTimeDemoResults();
		}
		else
		{
			mat_norendering.SetValue( 0 );
		}

		m_bTimeDemo = false;
	}
	else
	{
		int framecount = host_framecount - m_nTimeDemoStartFrame;
		float demotime = Sys_FloatTime() - m_flTimeDemoStartTime;

		if ( demotime > 0.0f )
		{
			DevMsg( "Demo playback finished ( %.1f seconds, %i render frames, %.2f fps).\n", demotime, framecount, framecount/demotime);
		}

	}

	m_flPlaybackRateModifier = 1.0f;

	delete[] m_DemoPacket.data;
	m_DemoPacket.data = NULL;

	scr_demo_override_fov = 0.0f;

	if ( demo_quitafterplayback.GetBool() )
	{
		Cbuf_AddText( Cbuf_GetCurrentPlayer(), "quit\n" );
	}

	g_ClientDLL->OnDemoPlaybackStop();

	FOR_EACH_VEC( m_ImportantTicks, i )
	{
		if ( m_ImportantTicks[ i ].pKeys )
		{
			m_ImportantTicks[ i ].pKeys->deleteThis();
		}
	}
	m_ImportantTicks.RemoveAll();
	m_ImportantGameEvents.RemoveAll();
	m_highlights.RemoveAll();
	m_nCurrentHighlight = -1;
	m_highlightSteamID.SetFromUint64( 0 );
	m_nHighlightPlayerIndex = -1;
	m_bScanMode = false;
	m_szScanMode[0] = 0;
}

#define SKIP_TO_TICK_FLAG uint32( uint32( 0x88 ) << 24 )

bool CDemoPlayer::IsSkipping( void )const
{
	return m_bPlayingBack && ( ( m_nSkipToTick != -1 ) || g_ClientDLL->ShouldSkipEvidencePlayback( m_pPlaybackParameters ) );
}

int CDemoPlayer::GetTotalTicks(void)
{
	return m_DemoFile.m_DemoHeader.playback_ticks; // == m_DemoFile.GetTotalTicks();
}

void CDemoPlayer::SetPacketReadSuspended


level/world",
	"levels/lindisfarne/world",
	"levels/island_01/island_01",
	"levels/gm_tdm/world",
	"levels/gm_siege/world",
	"levels/gm_grail_test/world",
	"levels/gm_conquest/world",
	"levels/fx_levels/whitebox_lighted",
	"levels/fx_levels/torch_01",
	"levels/fx_levels/pot1",
	"levels/fx_levels/fx_campfire",
	"levels/fx_levels/candelabra",
	"levels/forest_01/world",
	"levels/field_01/world",
	"levels/fabbe test/world",
	"levels/debug/nav_landscape/world",
	"levels/debug/level_test_01/world",
	"levels/debug/jockes/lindisfarne",
	"levels/debug/jockes/game_mode_flow",
	"levels/cpu_profiling/world",
	"levels/coop_castle/coop_castle",
	"levels/character_display/default/world",
	"levels/castle_02/world",
	"levels/castle_01_optimized/world",
	"levels/castle_01/world",
	"levels/artlevel/artlevel",
	"levels/all_characters/world",
	"levels/ai_benchmark/world",
	"levels/ai/world",
	"core/editor_slave/levels/animation_preview_level/animation_preview_level"
}

function boot()
	Application.set_autoload_enabled(true)
end

Test = Test or {}

function Test:init()
	self.units = UNITS
	self.levels = LEVELS
	self.stage = self.test_units

	self:init_world()
end

function Test:init_world()
	self.world = Application.new_world()
	self.viewport = Application.create_viewport(self.world, "default")
	self.shading_environment = World.create_shading_environment(self.world, "core/rendering/default_outdoor")

	local camera_unit = World.spawn_unit(self.world, "core/units/camera")

	self.camera = Unit.camera(camera_unit, "camera")

	local camera_pos = Vector3(0, -3, 2)
	local camera_look = Vector3(0, 0, 0.5)
	local camera_dir = Vector3.normalize(camera_look - camera_pos)

	Camera.set_local_position(self.camera, camera_unit, Vector3(0, -3, 2))
	Camera.set_local_rotation(self.camera, camera_unit, Quaternion.look(camera_dir, Vector3(0, 0, 1)))
	World.spawn_unit(self.world, "core/editor_slave/units/skydome/skydome")
	World.spawn_unit(self.world,


out = TimeSpan.FromMinutes(5);
            using (var xmlClient = new MyWebClient { Timeout = timeout, Encoding = Encoding.UTF8 })
            {
                Console.WriteLine($"Downloading {xmlUrl}");
                xmlData = xmlClient.DownloadString(xmlUrl);
            }

            var imageInfo = getFullUrl(xmlData);

            var imageName = getImageName(imageInfo);
            var imagePath = Path.Combine(dir, $"{imageName}");

            var xmlFileName = imageName.Split('_').First();
            var xmlFilePath = Path.Combine(dir, $"{xmlFileName}.xml");

            if (File.Exists(xmlFilePath) && File.Exists(imagePath))
            {
                Console.WriteLine($"Already have it: {xmlFileName}");
                return;
            }
            File.WriteAllText(xmlFilePath, xmlData);

            try
            {
                Downloader.DownloadFile(imageInfo.Url, imagePath);
            }
            catch (Exception ex)
            {
                ex.LogException();
                File.Delete(imagePath);
            }
        }

        private static string getImageName(ImageInfo imageInfo)
        {
            var imageName = Path.GetFileName(imageInfo.Url).CleanFileName();
            if (imageName.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase))
            {
                return imageName;
            }

            var nameValueCollection = new Uri(imageInfo.Url).ParseQueryString();
            var id = nameValueCollection["id"];
            return string.IsNullOrWhiteSpace(id) ? imageName : id.CleanFileName();
        }
    }
}


or err = w.init(data);
    QVERIFY2(!err, QByteArray("Got error \"") + cbor_error_string(err) + "\"");

    err = parseOne(&w.first, &decoded);
    QVERIFY2(!err, QByteArray("Got error \"") + cbor_error_string(err) + "\"");
    QCOMPARE(int(cbor_value_get_next_byte(&w.first) - w.begin()), offset);
}

void tst_Parser::recursionLimit_data()
{
    static const int recursions = CBOR_PARSER_MAX_RECURSIONS + 2;
    QTest::addColumn<QByteArray>("data");

    QTest::newRow("array") << QByteArray(recursions, '\x81') + '\x20';
    QTest::newRow("_array") << QByteArray(recursions, '\x9f') + '\x20' + QByteArray(recursions, '\xff');

    QByteArray data;
    for (int i = 0; i < recursions; ++i)
        data += "\xa1\x65Hello";
    data += '\2';
    QTest::newRow("map-recursive-values") << data;

    data.clear();
    for (int i = 0; i < recursions; ++i)
        data += "\xbf\x65World";
    data += '\2';
    for (int i = 0; i < recursions; ++i)
        data += "\xff";
    QTest::newRow("_map-recursive-values") << data;

    data = QByteArray(recursions, '\xa1');
    data += '\2';
    for (int i = 0; i < recursions; ++i)
        data += "\x7f\x64quux\xff";
    QTest::newRow("map-recursive-keys") << data;

    data = QByteArray(recursions, '\xbf');
    data += '\2';
    for (int i = 0; i < recursions; ++i)
        data += "\1\xff";
    QTest::newRow("_map-recursive-keys") << data;

    data.clear();
    for (int i = 0; i < recursions / 2; ++i)
        data += "\x81\xa1\1";
    data += '\2';
    QTest::newRow("mixed") << data;
}

void tst_Parser::recursionLimit()
{
    QFETCH(QByteArray, data);

    ParserWrapper w;
    CborError err = w.init(data);
    QVERIFY2(!err, QByteArray("Got error \"") + cbor_error_string(err) + "\"");

    // check that it is valid:
    CborValue it = w.first;
    {
        QString dummy;
        err = parseOne(&it, &dummy);
        QVERIFY2(!err, QByteArray("Got error \"") + cbor_error_string(err) + "\"");
    }

    it = w.first;
    err = cbor_value_advance(&it);
    QCOMPARE(err, CborErrorNestingTooDeep);

    it = w.first;
    if (cbor_value_is_map(&it)) {
        CborValue dummy;
        err = cbor_value_map_find_value(&it, "foo", &dummy);
        QCOMPARE(err, CborErrorNestingTooDeep);
    }
}

QTEST_MAIN(tst_Parser)
#include "tst_parser.moc"
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

#define FBGEMM_EXPORTS
#include "fbgemm/FbgemmSparse.h"

#if defined(__x86_64__) || defined(__i386__) || \
    (


/*
 * Copyright (c) 2016, Devan Lai
 *
 * Permission to use, copy, modify, and/or distribute this software
 * for any purpose with or without fee is hereby granted, provided
 * that the above copyright notice and this permission notice
 * appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <libopencm3/usb/usbd.h>
#include "winusb.h"

#include "usb_conf.h"

static const struct winusb_compatible_id_descriptor winusb_wcid = {
    .dwLength = (WINUSB_COMPATIBLE_ID_HEADER_SIZE +
                 1*WINUSB_COMPATIBLE_ID_FUNCTION_SECTION_SIZE),
    .bcdVersion = 0x0100,
    .wIndex = 0x0004,
    .bNumSections = 1,
    .reserved = { 0, 0, 0, 0, 0, 0, 0 },
    .functions = {
        {
            .bInterfaceNumber = 0,
            .reserved0 = { 1 },
            .compatibleId = "WINUSB",
            .subCompatibleId = "",
            .reserved1 = { 0, 0, 0, 0, 0, 0}
        },
    }
};

static int winusb_control_vendor_request(usbd_device *usbd_dev,
                                         struct usb_setup_data *req,
                                         uint8_t **buf, uint16_t *len,
                                         usbd_control_complete_callback* complete) {
    (void)complete;
    (void)usbd_dev;

    if (req->bRequest != WINUSB_MS_VENDOR_CODE) {
        return USBD_REQ_NEXT_CALLBACK;
    }

    int status = USBD_REQ_NOTSUPP;
    if (((req->bmRequestType & USB_REQ_TYPE_RECIPIENT) == USB_REQ_TYPE_DEVICE) &&
        (req->wIndex == WINUSB_REQ_GET_COMPATIBLE_ID_FEATURE_DESCRIPTOR)) {
        *buf = (uint8_t*)(&winusb_wcid);
        if (*len > winusb_wcid.dwLength) {
            *len = winusb_wcid.dwLength;
        }
        status = USBD_REQ_HANDLED;
    } else if (((req->bmRequestType & USB_REQ_TYPE_RECIPIENT) == USB_REQ_TYPE_INTERFACE) &&
               (req->wIndex == WINUSB_REQ_GET_EXTENDED_PROPERTIES_OS_FEATURE_DESCRIPTOR)) {
        status = USBD_REQ_NOTSUPP;
    } else {
        status = USBD_REQ_NOTSUPP;
    }

    return status;
}

static void winusb_set_config(usbd_device* usbd_dev, uint16_t wValue) {
    (void)wValue;
    usbd_register_control_callback(
        usbd_dev,
        USB_REQ_TYPE_VENDOR,
        USB_REQ_TYPE_TYPE,
        winusb_control_vendor_request);
}

void winusb_setup(usbd_device* usbd_dev) {
    usbd_register_extra_string(usbd_dev, 0xEE, "MSFT100!");
    usbd_register_set_config_callback(usbd_dev, winusb_set_config);

    /* Windows probes the compatible ID before setting the configuration,
       so also register the callback now */

    usbd_register_control_callback(
        usbd_dev,
        USB_REQ_TYPE_VENDOR,
        USB_REQ_TYPE_TYPE,
        winusb_control_vendor_request);
}


BigInteger(1, hashBytes)
        val hashText = hashInt.toString(RADIX)
        return if (hashText.length < hashLength)
            "0".repeat(hashLength - hashText.length) + hashText
        else hashText
    }

    fun hash(string: String): String = hash(string.byteInputStream())

    override fun toString(): String = algorithm

    class MD5 : HashAlgorithm("MD5", MD5_LENGTH)

    class SHA1 : HashAlgorithm("SHA-1", SHA1_LENGTH)

    class SHA256 : HashAlgorithm("SHA-256", SHA256_LENGTH)

    class SHA512 : HashAlgorithm("SHA-512", SHA512_LENGTH)

    companion object {
        private const val RADIX = 16
        const val MD5_LENGTH = 32
        const val SHA1_LENGTH = 40
        const val SHA256_LENGTH = 64
        const val SHA512_LENGTH = 128
    }
}

fun InputStream.sha512() = HashAlgorithm.SHA512().hash(this)
fun InputStream.sha256() = HashAlgorithm.SHA256().hash(this)
fun InputStream.sha1() = HashAlgorithm.SHA1().hash(this)
fun InputStream.md5() = HashAlgorithm.MD5().hash(this)

fun InputStream.crc64ecma(): String {
    val crc64ecma = CRC64()
    use {
        val buffer = ByteArray(DEFAULT_BUFFER_SIZE)
        var sizeRead = it.read(buffer)
        while (sizeRead != -1) {
            crc64ecma.update(buffer, 0, sizeRead)
            sizeRead = it.read(buffer)
        }
    }

    return crc64ecma.unsignedStringValue()
}

fun File.sha512() = this.inputStream().buffered().sha512()
fun File.sha256() = this.inputStream().buffered().sha256()
fun File.sha1() = this.inputStream().buffered().sha1()
fun File.md5() = this.inputStream().buffered().md5()
fun File.crc64ecma() = this.inputStream().buffered().crc64ecma()

fun String.sha512() = this.byteInputStream().sha512()
fun String.sha256() = this.byteInputStream().sha256()
fun String.sha1() = this.byteInputStream().sha1()
fun String.md5() = this.byteInputStream().md5()
fun String.crc64ecma() = this.byteInputStream().crc64ecma()
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2021 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.bkrepo.common.artifact.event.node

import com.tencent.bkrepo.common.artifact.event.base.ArtifactEvent
import com.tencent.bkrepo.common.artifact.event.base.EventType

/**
 * 节点�


), clockwise: false)
  ..cubicTo(285.45, 216.91, 257.84, 205.58, 256.04, 206.25)
  ..quadraticBezierTo(255.03, 205.67, 255.02, 204.69)
  ..cubicTo(255.01, 200.19, 253.94, 175.74, 255.50, 173.46)
  ..close()
  ..moveTo(256.00, 300.71)
  ..quadraticBezierTo(257.01, 301.38, 257.01, 302.75)
  ..quadraticBezierTo(257.01, 322.31, 256.99, 341.87)
  ..quadraticBezierTo(256.99, 342.12, 257.17, 342.30)
  ..lineTo(257.44, 342.56)
  ..quadraticBezierTo(257.82, 342.94, 257.48, 343.36)
  ..lineTo(257.00, 343.96)
  ..quadraticBezierTo(256.11, 343.85, 255.35, 343.38)
  ..quadraticBezierTo(177.32, 295.56, 99.34, 247.65)
  ..cubicTo(91.79, 243.01, 87.03, 234.08, 88.32, 225.23)
  ..cubicTo(88.99, 220.58, 91.28, 214.42, 95.79, 212.08)
  ..cubicTo(98.17, 210.84, 99.10, 211.82, 101.53, 213.25)
  ..quadraticBezierTo(177.08, 257.44, 252.62, 301.66)
  ..quadraticBezierTo(253.09, 301.94, 253.59, 301.72)
  ..lineTo(256.00, 300.71)
  ..close()
  ..moveTo(257.00, 343.96)
  ..lineTo(257.48, 343.36)
  ..quadraticBezierTo(257.82, 342.94, 257.44, 342.56)
  ..lineTo(257.17, 342.30)
  ..quadraticBezierTo(256.99, 342.12, 256.99, 341.87)
  ..quadraticBezierTo(257.01, 322.31, 257.01, 302.75)
  ..quadraticBezierTo(257.01, 301.38, 256.00, 300.71)
  ..quadraticBezierTo(257.11, 299.61, 259.02, 298.53)
  ..quadraticBezierTo(335.17, 255.36, 411.72, 211.72)
  ..arcToPoint(const Offset(412.64, 211.67), radius: const Radius.circular(1.05), clockwise: false)
  ..cubicTo(418.09, 214.00, 424.61, 219.56, 425.42, 225.90)
  ..cubicTo(426.62, 235.31, 413.40, 245.77, 406.71, 250.46)
  ..cubicTo(359.60, 283.49, 309.22, 313.40, 258.05, 343.80)
  ..quadraticBezierTo(257.51, 344.13, 257.00, 343.96)
  ..close()
  ..moveTo(256.50, 358.46)
  ..quadraticBezierTo(256.80, 358.50, 257.07, 358.67)
  ..quadraticBezierTo(257.47, 358.92, 257.27, 359.35)
  ..quadraticBezierTo(257.00, 359.92, 257.00, 360.25)
  ..quadraticBezierTo(256.91, 386.12, 257.13, 412.00)
  ..lineTo(255.97, 412.63)
  ..quadraticBezierTo(255.50, 412.88, 255.06, 412.58)
  ..quadraticBezierTo(173.68, 358.70, 92.30, 304.81)
  ..cubicTo(84.17, 299.42, 79


= (tournament.ElementAt(0) != current ? tournament.ElementAt(0) : tournament.ElementAt(1));
            }

            for (int i = 1; i < tournament.Count(); i++)
            {
                bool even = (i % 2 == 0);

                IChromosome test = tournament.ElementAt(i);

                if (even)
                {
                    if (test.Weight > tree2.Weight)
                        tree2 = test;
                }
                else
                {
                    if (test.Weight > tree1.Weight)
                        tree1 = test;
                }
            }

            return (tree1, tree2);
        }

        /// <summary>
        /// Performs tournament selection over the population and returns the best pairs.
        /// </summary>
        /// <param name="pool">Population of chromosomes.</param>
        /// <returns>IChromosome pair.</returns>
        public override IEnumerable<(IChromosome, IChromosome)> Pair(IEnumerable<IChromosome> pool)
        {
            int max = System.Math.Min(this.Size * 2, pool.Count());

            foreach (var chromosome in pool)
            {
                (IChromosome first, IChromosome second) = this.Match(chromosome, pool.Shuffle().Take(max));

                yield return (first, second);
            }
        }
    }
}


    override fun shouldSuppressGtd(psiElement: PsiElement?): Boolean {
        val leafElement = psiElement as? LeafPsiElement ?: return false
        val parentElement = parentProperty(leafElement) ?: return false
        val grandParentElement = parentProperty(parentElement) ?: return false
        val grandGrandParentElement = parentProperty(grandParentElement) ?: return false

        return grandGrandParentElement.name == OPENAPI_COMPONENTS && grandParentElement.name in setOf(
            OPENAPI_RESPONSES, OPENAPI_SCHEMAS, OPENAPI_PARAMETERS
        )
    }

    private fun parentProperty(psiElement: PsiElement): JsonProperty? {
        return psiElement.parent.parent as? JsonProperty
    }

}/*
 * Copyright © 2024 Explyt Ltd
 *
 * All rights reserved.
 *
 * This code and software are the property of Explyt Ltd and are protected by copyright and other intellectual property laws.
 *
 * You may use this code under the terms of the Explyt Source License Version 1.0 ("License"), if you accept its terms and conditions.
 *
 * By installing, downloading, accessing, using, or distributing this code, you agree to the terms and conditions of the License.
 * If you do not agree to such terms and conditions, you must cease using this code and immediately delete all copies of it.
 *
 * You may obtain a copy of the License at: https://github.com/explyt/spring-plugin/blob/main/EXPLYT-SOURCE-LICENSE.md
 *
 * Unauthorized use of this code constitutes a violation of intellectual property rights and may result in legal action.
 */

package com.explyt.spring.web.loader

import com.explyt.spring.core.service.SpringSearchService
import com.explyt.spring.web.util.SpringWebUtil
import com.intellij.openapi.extensions.ProjectExtensionPointName
import com.intellij.openapi.module.Module
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiMethod
import com.intellij.psi.search.searches.AnnotatedElementsSearch

interface SpringWebEndpointsLoader {

    fun searchEndpoints(module: Module): List<EndpointElement>

    fun getType(): EndpointType

    fun getEndpointElements(urlPath: String, module: Module): List<EndpointElement> {
        val searchUrl = SpringWebUtil.simplifyUrl(urlPath)

        return searchEndpoints(module)
            .filter { SpringWebUtil.isEndpointMatches(it.path, searchUrl) }
    }

    fun searchAnnotatedClasses(annotation: PsiClass, module: Module): List<PsiClass> =
        SpringSearchService.getInstance(module.project).searchAnnotatedClasses(annotation, module)

    fun searchAnnotatedMethods(annotation: PsiClass, module: Module): List<PsiMethod> {
        return AnnotatedElementsSearch.searchPsiMethods(annotation, module.moduleWithDependenciesScope).toList()
    }

    fun isApplicable(module: Module): Boolean

    companion object {
        val EP_NAME = ProjectExtensionPointName<SpringWebEndpointsLoader>(
            "com.explyt.spring.web.springWebEndpointsLoader"
        )

    }
}

data class Referrer(
    val path: String,
    val method: String?,
    val psiElement: PsiElement
)

data class EndpointElement(
    val path: String,
    val requestMethods: List<String>,
    val psiElement: PsiElement,
    val containingClass: PsiClass?,
    val containingFile: PsiFile?,
    val type: EndpointType
)

sealed class EndpointData {
    data class ReferrerData(val referrer: Referrer) : EndpointData()
    data class EndpointElementData(val endpointElement: EndpointElement) : EndpointData()
}

data class EndpointFileData(val psiFile: PsiFile, val endpoints: List<EndpointData>)

enum class EndpointType(


5,255,0) 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.1));
}

/* Button icon */
.zocial.acrobat:before { content: "\f100"; }
.zocial.amazon:before { content: "\f101"; }
.zocial.android:before { content: "\f102"; }
.zocial.angellist:before { content: "\f103"; }
.zocial.aol:before { content: "\f104"; }
.zocial.appnet:before { content: "\f105"; }
.zocial.appstore:before { content: "\f106"; }
.zocial.bitbucket:before { content: "\f107"; }
.zocial.bitcoin:before { content: "\f108"; }
.zocial.blogger:before { content: "\f109"; }
.zocial.buffer:before { content: "\f10a"; }
.zocial.cal:before { content: "\f10b"; }
.zocial.call:before { content: "\f10c"; }
.zocial.cart:before { content: "\f10d"; }
.zocial.chrome:before { content: "\f10e"; }
.zocial.cloudapp:before { content: "\f10f"; }
.zocial.creativecommons:before { content: "\f110"; }
.zocial.delicious:before { content: "\f111"; }
.zocial.digg:before { content: "\f112"; }
.zocial.disqus:before { content: "\f113"; }
.zocial.dribbble:before { content: "\f114"; }
.zocial.dropbox:before { content: "\f115"; }
.zocial.drupal:before { content: "\f116"; }
.zocial.dwolla:before { content: "\f118"; }
.zocial.email:before { content: "\f119"; }
.zocial.eventasaurus:before { content: "\f11a"; }
.zocial.eventbrite:before { content: "\f11b"; }
.zocial.eventful:before { content: "\f11c"; }
.zocial.evernote:before { content: "\f11d"; }
.zocial.facebook:before { content: "\f11e"; }
.zocial.fivehundredpx:before { content: "\f11f"; }
.zocial.flattr:before { content: "\f120"; }
.zocial.flickr:before { content: "\f121"; }
.zocial.forrst:before { content: "\f122"; }
.zocial.foursquare:before { content: "\f123"; }
.zocial.github:before { content: "\f124"; }
.zocial.gmail:before { content: "\f125"; }
.zocial.google:before { content: "\f126"; }
.zocial.googleplay:before { content: "\f127"; }
.zocial.googleplus:before { content: "\f128"; }
.zocial.gowalla:before { content: "\f129"; }
.zocial.grooveshark:before { content: "\f12a"; }
.zocial.guest:before { content: "\f12b"; }
.zocial.html5:before { content: "\f12c"; }
.zocial.ie:before { content: "\f12d"; }
.zocial.instagram:before { content: "\f12e"; }
.zocial.instapaper:before { content: "\f12f"; }
.zocial.intensedebate:before { content: "\f130"; }
.zocial.itunes:before { content: "\f131"; }
.zocial.klout:before { content: "\f132"; }
.zocial.lanyrd:before { content: "\f133"; }
.zocial.lastfm:before


 © 2011-2025 Natalia Portillo
// ****************************************************************************/

using System.IO;
using Aaru.CommonTypes;
using NUnit.Framework;

namespace Aaru.Tests.Partitions;

[TestFixture]
public class Xbox : PartitionSchemeTest
{
    public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Partitioning schemes", "Xbox");

    public override PartitionTest[] Tests =>
    [
        new PartitionTest
        {
            TestFile = "microsoft256mb.aif",
            Partitions =
            [
                new Partition
                {
                    Description = "System cache",
                    Length      = 16376,
                    Offset      = 0,
                    Sequence    = 0,
                    Size        = 0,
                    Start       = 0
                },
                new Partition
                {
                    Description = "Data volume",
                    Length      = 475144,
                    Offset      = 0,
                    Sequence    = 1,
                    Size        = 0,
                    Start       = 16376
                }
            ]
        }
    ];
}


xture_creator),
            overlay_drawer: Graphic::blank(2,2).tile_cache_textured(texture_creator)
        }
    }

    fn can_place(field: &[[Cell;10];10], ship: PieceType, vertical: bool, x: usize, y: usize) -> bool {
        for m in 0..ship.length() {
            let cx = if vertical { x } else { x + m };
            let cy = if vertical { y + m } else { y };
            if cx >= 10 || cy >= 10 { return false; }
            if let Some(_) = field[cx][cy].contents {
                return false;
            }
        }
        true
    }
    fn draw_overlay<C:RenderTarget>(&mut self, canvas : &mut Canvas<C>, hit:bool,size: u32, color: Color, position: (i32,i32)) {

        self.overlay_drawer.draw_rect(0,0,2,2,Tile{index:0,fg:color,bg:if color == Self::HIRED { rgba(41,0,0,255)} else { TRANSPARENT }});
        self.overlay_drawer[(0,0)].index=if hit { 185} else {117};
        if size > 0 {
            self.overlay_drawer[(1,1)].index=if hit { 185} else {117};
            if size > 1 {
                self.overlay_drawer[(0,1)].index=if hit { 185} else {117};
                if size > 2 {
                    self.overlay_drawer[(1,0)].index=if hit { 185} else {117};
                }
            }
        }
        self.overlay_drawer.update_texture(&self.tile_set);
        self.overlay_drawer.draw(canvas, position);
    }
    fn draw_ship<C:RenderTarget>(&mut self, canvas : &mut Canvas<C>, ship: PieceType, vertical: bool, color: Color, position: (i32,i32)) {

        self.ship_drawer.draw_rect(0,0,10,10,Tile{index:0,fg:TRANSPARENT,bg:TRANSPARENT});
        self.ship_drawer.draw_rect(0,0,if vertical { 2 } else {ship.length() as u32*2}, if vertical {ship.length() as u32* 2} else { 2 }, Tile{index:0,fg:TRANSPARENT,bg:color} );
        self.ship_drawer[(0,0)].index = 302;
        if vertical {
            self.ship_drawer[(1,0)].index = 303;
            self.ship_drawer[(0,ship.length() as u32*2-1)].index = 287;
            self.ship_drawer[(1,ship.length() as u32*2-1)].index = 286;
        } else {
            self.ship_drawer[(0,1)].index = 287;
            self.ship_drawer[(ship.length() as u32*2-1,0)].index = 303;
            self.ship_drawer[(ship.length() as u32*2-1,1)].index = 286;
        }
        self.ship_drawer.update_texture(&self.tile_set);
        self.ship_drawer.draw(canvas, position);

    }
    fn player_place_ship(&mut self) {
        if let Some((x,y)) = self.current_tile {
            if Self::can_place(&self.player_field,self.placing_ship,self.placing_vertical,x,y) {
                for m in 0..self.placing_ship.length() {
                    let cx = if self.placing_vertical { x } else { x + m };
                    let cy = if self.placing_vertical { y + m } else { y };
                    self.player_field[cx][cy].contents = Some(CellContents { piece: self.placing_ship, part: m, vertical: self.placing_vertical});


BeanDefinitionParser(ProtocolConfig.class, true));
          registerBeanDefinitionParser("service", new DubboBeanDefinitionParser(ServiceBean.class, true));
          registerBeanDefinitionParser("reference", new DubboBeanDefinitionParser(ReferenceBean.class, false));
          registerBeanDefinitionParser("annotation", new AnnotationBeanDefinitionParser());
      }

  }
  ```

- `org.apache.dubbo.config.spring.ServiceBean`

  ![1560503262585](assets/1560503262585.png)

  ```java
  public class ServiceBean<T> extends ServiceConfig<T> implements InitializingBean, DisposableBean,
          ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, BeanNameAware,
          ApplicationEventPublisherAware {
              // ...
          	// 入口
              if (!supportedApplicationListener) {
              	export();
          	}
          }
  ```

  - supportedApplicationListener是什么？

    ```java
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
        SpringExtensionFactory.addApplicationContext(applicationContext);
        supportedApplicationListener = addApplicationListener(applicationContext, this);
    }
    ```

    - `InitializingBean`
      - `org.springframework.beans.factory.InitializingBean#afterPropertiesSet`类初始化成功后做什么
    - `DisposableBean`
      - `org.springframework.beans.factory.DisposableBean#destroy`类销毁后做什么
    - `ApplicationContextAware`
      - 	`org.springframework.context.ApplicationContextAware#setApplicationContext`容器初始化时设置application context
    - `ApplicationListener`
      - `org.springframework.context.ApplicationListener#onApplicationEvent`spring的监听事件，监听bean
    - `BeanNameAware`
      - `org.springframework.beans.factory.BeanNameAware#setBeanName`设置bean的名称
    - `ApplicationEventPublisherAware`
      - `org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher`spring的事件发布者

  - 加载流程图调用链见最后总结

  ```sequence
  xml-->实体:DubboNamespaceHandler和DubboBeanDefinitionParser解析
  实体-->ServerBean#afterPropertiesSet:初始化后执行afterPropertiesSet方法
  ServerBean#afterPropertiesSet-->ServiceConfig#export:执行export方法
  ServiceConfig#export-->ServiceConfig#doExport: 执行doExport
  ServiceConfig#doExport-->ServiceConfig#doExportUrls:获取注册中心
  ServiceConfig#doExportUrls-->ServiceConfig#doExportUrlsFor1Protocol: 将配置文件中protocol转换成map，在由map转换成url...
  ```

  - `doExportUrls`

    ```xml
    <dubbo:registry address="zookeeper://192.168.1.107:2181"/>
    ```

    ![1560731475666](assets/1560731475666.png)

  - `doExportUrlsFor1Protocol`

    ```java
    private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> registryURLs) {
        // 本地服务
        if (!SCOPE_REMOTE.equalsIgnoreCase(scope)) {
            exportLocal(url);
        }
    }

        private void exportLocal(URL url) {
            URL local = URLBuilder.from(url)
                    .setProtocol(LOCAL_PROTOCOL)
                    .setHost(LOCALHOST_VALUE)
                    .setPort(0)
                    .build();
            // proxyFactory获取一个Invoker对象添加到Exporter中
            Exporter<?> exporter = protocol.export(
                    proxyFactory.getInvoker(ref, (Class) interfaceClass, local));
            exporters.add(exporter);
            logger.info("Export dubbo service " + interfaceClass.getName() + " to local registry url


oInt() == 0 -> System.arraycopy(
                    y, 1,
                    dst, offset,
                    keySizeBytes
                )
                else -> error("y value is too large")
            }
        }
    }
}

// JavaScriptのcreateECDHがエンコードした秘密鍵をデコードする
// https://github.com/nodejs/node/blob/main/lib/internal/crypto/diffiehellman.js#L232
// https://github.com/nodejs/node/blob/main/src/crypto/crypto_ec.cc#L265
fun Provider.decodePrivateKeyRaw(srcBytes: ByteArray): ECPrivateKey {
    // 符号拡張が起きないように先頭に０を追加する
    val newBytes = ByteArray(srcBytes.size + 1).also {
        System.arraycopy(
            srcBytes, 0,
            it, it.size - srcBytes.size,
            srcBytes.size
        )
    }

    val s = BigInteger(newBytes)

    // テキトーに鍵を作る
    val keyPair = generateKeyPair()
    // params部分を取り出す
    val ecParameterSpec = (keyPair.private as ECPrivateKey).params
    // s値を指定して鍵を作る
    val privateKeySpec = ECPrivateKeySpec(s, ecParameterSpec)
    return KeyFactory.getInstance("EC", this)
        .generatePrivate(privateKeySpec) as ECPrivateKey
}

/**
 * ECの鍵ペアを作成する
 */
fun Provider.generateKeyPair(curveName: String = DEFAULT_CURVE_NAME): KeyPair =
    KeyPairGenerator.getInstance("EC", this).apply {
        @Suppress("SpellCheckingInspection")
        initialize(ECGenParameterSpec(curveName))
    }.genKeyPair() ?: error("genKeyPair returns null")

fun Mac.update(br: ByteRange) = update(br.ba, br.start, br.size)

fun hmacSha256(salt: ByteRange, keyMaterial: ByteRange, plus1: Boolean = false) =
    Mac.getInstance("HMacSHA256").run {
        init(SecretKeySpec(salt.ba, salt.start, salt.size, "HMacSHA256"))
        update(keyMaterial)
        if (plus1) update(hkdfTrailBytes)
        doFinal()
    } ?: error("Mac.doFinal returns null")

/**
 * HKDF の2段階目は末尾に \01 を追加する
 */
fun hmacSha256Plus1(salt: ByteRange, keyMaterial: ByteRange) =
    hmacSha256(salt, keyMaterial, plus1 = true)

// 鍵全体をX509でエンコードしたものをデコードする
fun Provider.decodePrivateKeyX509(src: ByteArray) =
    KeyFactory.getInstance("EC", this)
        .generatePrivate(PKCS8EncodedKeySpec(src))
        ?: error("generatePrivate returns null")

/**
 * p256dh(65バイト)から公開鍵を復元する
 * - ECPointUtil.decodePoint はバイト配列全体を指定するしかないので、src引数はByteArrayである
 */
fun Provider.decodeP256dh(src: ByteArray, curveName: String = DEFAULT_CURVE_NAME): ECPublicKey {
    val spec = ECNamedCurveTable.getParameterSpec(curveName)
    val params = ECNamedCurveSpec(curveName, spec.curve, spec.g, spec.n)
    val pubKeySpec = ECPublicKeySpec(
        ECPointUtil.decodePoint(params.curve, src),
        params
    )
    return KeyFactory.getInstance("EC", this)
        .generatePublic(pubKeySpec) as ECPublicKey
}

fun Provider.sharedKeyBytes(
    receiverPrivateBytes: ByteArray,
    senderPublicBytes: ByteArray,
) = KeyAgreement.getInstance("ECDH", this).run {
    val receiverPrivate = decodePrivateKeyX509(receiverPrivateBytes)
    val senderPublic = decode


风神录_～_Mountain_of_Faith..md" class="mw-redirect" title="东方风神录 ～ Mountain of Faith.">东方风神录　～ Mountain of Faith.

09	桜風	04:26

	编曲	kaztora

	演唱	Candy

	作词	azuki

	原曲
幽雅に咲かせ、墨染の桜　～ Border of Life

アルティメットトゥルース

<a


create/}">Create Person

                        ID
                        User ID
                        Person
                        Age
                        Action

                        Person ID
                        Birth Date
                        Name
                        Age
                        Unknown Age

                            Update
                            Delete

<!DOCTYPE html>

        <title>AirBnb Clone</title>
        <link rel="stylesheet" href="styles/4-common.css">
        <link rel="stylesheet" href="styles/3-header.css">
        <link rel="stylesheet" href="styles/3-footer.css">
        <link rel="stylesheet" href="styles/6-filters.css">
        <link rel="stylesheet" href="styles/7-places.css">
        <link rel="icon" href="images/icon.png" type="image/png">

                <button type="button">Search</button>

States

California, Arizona...

Arizona:

Page

Page2

California:

San Francisco

Los Altos

Amenities

Internet, Kitchen...

Internet

TV

                        <


 Enable interrupt"]
    pub intenset: INTENSET,
    #[doc = "0x308 - Disable interrupt"]
    pub intenclr: INTENCLR,
    #[doc = "0x30c - Pending interrupts"]
    pub intpend: INTPEND,
    _reserved16: [u8; 248usize],
    #[doc = "0x408 - Status indicating that HFCLKSTART task has been triggered"]
    pub hfclkrun: HFCLKRUN,
    #[doc = "0x40c - The register shows if HFXO has been requested by triggering HFCLKSTART task and if it has been started (STATE)"]
    pub hfclkstat: HFCLKSTAT,
    _reserved18: [u8; 4usize],
    #[doc = "0x414 - Status indicating that LFCLKSTART task has been triggered"]
    pub lfclkrun: LFCLKRUN,
    #[doc = "0x418 - The register shows which LFCLK source has been requested (SRC) when triggering LFCLKSTART task and if the source has been started (STATE)"]
    pub lfclkstat: LFCLKSTAT,
    #[doc = "0x41c - Copy of LFCLKSRC register, set after LFCLKSTART task has been triggered"]
    pub lfclksrccopy: LFCLKSRCCOPY,
    _reserved21: [u8; 248usize],
    #[doc = "0x518 - Clock source for the LFCLK. LFCLKSTART task starts starts a clock source selected with this register."]
    pub lfclksrc: LFCLKSRC,
}
#[doc = "Start HFCLK crystal oscillator\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tasks_hfclkstart](tasks_hfclkstart) module"]
pub type TASKS_HFCLKSTART = crate::Reg<u32, _TASKS_HFCLKSTART>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _TASKS_HFCLKSTART;
#[doc = "`write(|w| ..)` method takes [tasks_hfclkstart::W](tasks_hfclkstart::W) writer structure"]
impl crate::Writable for TASKS_HFCLKSTART {}
#[doc = "Start HFCLK crystal oscillator"]
pub mod tasks_hfclkstart;
#[doc = "Stop HFCLK crystal oscillator\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tasks_hfclkstop](tasks_hfclkstop) module"]
pub type TASKS_HFCLKSTOP = crate::Reg<u32, _TASKS_HFCLKSTOP>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _TASKS_HFCLKSTOP;
#[doc = "`write(|w| ..)` method takes [tasks_hfclkstop::W](tasks_hfclkstop::W) writer structure"]
impl crate::Writable for TASKS_HFCLKSTOP {}
#[doc = "Stop HFCLK crystal oscillator"]
pub mod tasks_hfclkstop;
#[doc = "Start LFCLK source\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tasks_lfclkstart](tasks_lfclkstart) module"]
pub type TASKS_LFCLKSTART = crate::Reg<u32, _TASKS_LFCLKSTART>;


-button__icon {
    margin-inline-start: 0;
  }

  .ecl-button__label {
    margin-top: var(--s-2xs);
  }

  &:hover {
    background-color: map.get($menu, 'mobile', 'header-background-hover');
    border-color: transparent;
    color: currentcolor;
  }

  &:focus-visible {
    color: currentcolor;
    border-color: currentcolor;
    outline-color: map.get($menu, 'mobile', 'header-outline-color');
  }
}

.ecl-menu__back {
  border-radius: map.get($menu, 'global', 'border-radius');
  cursor: pointer;
  color: currentcolor;
  display: none;
  font: map.get($menu, 'mobile', 'header-font');
  text-decoration: none;
  width: 100%;

  &:hover {
    background-color: map.get($menu, 'mobile', 'header-background-hover');
    border-color: map.get($menu, 'mobile', 'header-border-hover');
    color: map.get($menu, 'mobile', 'header-color-hover');
  }

  &:focus-visible {
    color: currentcolor;
    border-color: currentcolor;
    outline-color: map.get($menu, 'mobile', 'header-outline-color');
  }
}

// Expanded
@if map.has-key($menu, 'mobile', 'hide-header') {
  .ecl-menu__inner-header {
    flex-flow: row;
  }

  .ecl-menu__inner:not(.ecl-menu__inner--expanded) .ecl-menu__inner-header,
  .ecl-menu__close {
    display: none;
  }
}

.ecl-menu__inner--expanded .ecl-menu__title {
  display: none;
}

.ecl-menu__inner--expanded .ecl-menu__back {
  display: block;
}

/* stylelint-disable-next-line order/order */
@include breakpoints.up('s') {
  .ecl-menu__inner {
    right: -25rem;
    width: 25rem;
  }

  .ecl-menu__overlay {
    background-color: map.get($menu, 'mobile', 'overlay-background');
    content: '';
    display: none;
    height: 100%;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: map.get($theme, 'z-index', 'modal') + 2;
  }

  .ecl-menu[aria-expanded='true'] .ecl-menu__overlay {
    display: block;
  }
}

/* stylelint-disable-next-line order/order */
@include breakpoints.up('l') {
  .ecl-menu:not(.ecl-menu--forced-mobile) {
    .ecl-menu__inner {
      background-color: transparent;
      box-shadow: none;
      display: block;
      overflow-y: visible;
      position: relative;
      right: 0;
      transition: none;
      width: 100%;
      z-index: map.get($theme, 'z-index', 'modal');
    }

    .ecl-menu__inner--has-overflow {
      overflow-x: clip;
    }

    .ecl-menu__overlay {
      display: none;
    }
  }
}

/*
 * First level
 */
.ecl-menu__list {
  box-sizing: border-box;
  clear: right;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: flex-start;
  list-style: none;
  list-style-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
  margin-bottom: 0;
  mar


/*
 * Copyright (C) 2020 Adrian Carpenter
 *
 * This file is part of Pingnoo (https://github.com/nedrysoft/pingnoo)
 *
 * An open-source cross-platform traceroute analyser.
 *
 * Created by Adrian Carpenter on 28/12/2020.
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */

#ifndef PINGNOO_COMPONENTS_ROUTEANALYSER_BARCHART_H
#define PINGNOO_COMPONENTS_ROUTEANALYSER_BARCHART_H

#pragma warning(push)
#pragma warning(disable : 4996)

#include "QCustomPlot/qcustomplot.h"

#pragma warning(pop)

namespace Nedrysoft { namespace RouteAnalyser {
    /**
     * @brief       The BarChart class is a subclass of QCPBars which clips the chart to a rounded rectangle.
     */
    class BarChart :
            public QCPBars {

        public:
            /**
             * @brief       Constructs a new BarChart and attaches it to the given axis.
             * @param[in]   keyAxis the axis for the keys.
             * @param[in]   valueAxis the axis for the values,
             */
            BarChart(QCPAxis *keyAxis, QCPAxis *valueAxis);

            // Classes with virtual functions should not have a public non-virtual destructor:
            virtual ~BarChart() = default;

        protected:
            /**
             * @brief       Draws the bar chart to the given painter.
             *
             * @param[in]   painter the QPainter to draw in.
             */
            virtual void draw(QCPPainter *painter);
    };
}}

#endif // PINGNOO_COMPONENTS_ROUTEANALYSER_BARCHART_H


ation is that
  /// operands of uniqued nodes are resolved before the nodes are read.  This
  /// avoids re-uniquing them on the context and factors away RAUW support.
  ///
  /// This algorithm guarantees that subgraphs of uniqued nodes are in
  /// post-order.  Distinct subgraphs reachable only from a single uniqued node
  /// will be in post-order.
  ///
  /// \note The relative order of a distinct and uniqued node is irrelevant.
  /// \a organizeMetadata() will later partition distinct nodes ahead of
  /// uniqued ones.
  ///{
  void EnumerateMetadata(const Function *F, const Metadata *MD);
  void EnumerateMetadata(unsigned F, const Metadata *MD);
  ///}

  void EnumerateFunctionLocalMetadata(const Function &F,
                                      const LocalAsMetadata *Local);
  void EnumerateFunctionLocalMetadata(unsigned F, const LocalAsMetadata *Local);
  void EnumerateFunctionLocalListMetadata(const Function &F,
                                          const DIArgList *ArgList);
  void EnumerateFunctionLocalListMetadata(unsigned F, const DIArgList *Arglist);
  void EnumerateNamedMDNode(const NamedMDNode *NMD);
  void EnumerateValue(const Value *V);
  void EnumerateOperandType(const Value *V);
  void EnumerateAttributes(AttributeList PAL);

  void EnumerateValueSymbolTable(const ValueSymbolTable &ST);
  void EnumerateNamedMetadata(const Module &M);
};

} // end namespace dxil
} // end namespace llvm

#endif // LLVM_DXILWRITER_VALUEENUMERATOR_H


�化的原因——整个 AI 研究领域的评估生态系统。作者敏锐地观察到，当前绝大多数被奉为圭臬的评估基准（benchmarks）和排行榜，都采用了一种简单粗暴的二元评分（binary grading）机制。在这种“非对即错”的规则下，模型给出正确答案得 1 分，而给出错误答案或承认不确定性（例如，回答“我不知道”）均得 0 分。

文章在此处引入了一个极其生动的类比：语言模型如同一个正在参加标准化考试的学生。面对一个不奖励“交白卷”却也不惩罚“答错”的考试，任何一个追求分数最大化的理性考生，其最优策略都是将所有不确定的题目全部猜一遍。当前的 LLM 正是在这种激励机制下被持续优化的“应试者”。为了在排行榜上获得更高的名次，开发者有极强的动机去训练模型，使其在面对不确定性时倾向于“大胆猜测”，而非“诚实 признать”。这直接导致了模型在后训练阶段（如 RLHF）变得过度自信（overconfident），牺牲了其内在的概率校准度，从而使得预训练阶段就已存在的幻觉问题被进一步固化和放大。

基于这一系统性的诊断，文章的结论自然地指向了一个“社会 - 技术”（socio-technical）层面的解决方案。作者认为，单纯在模型算法层面进行修补是治标不治本的，关键在于改革作为领域“指挥棒”的评估体系。他们强烈呼吁，主流基准测试应摒弃现有的二元评分，转而采用更精细的评分规则，例如，为错误答案引入明确的惩罚机制。这种改变将彻底扭转模型的激励结构，迫使其从一个“鲁莽的猜测者”转变为一个审慎的“风险评估者”。在此基础上，文章进一步提出了一个更具前瞻性的优化目标——行为校准（behavioral calibration）。该目标不要求模型输出精确的概率值，而是要求模型能够根据不同的风险容忍度（置信度阈值），做出最恰当的行为决策（自信回答、保守回答或拒绝回答）。

尽管该文的分析框架极具说服力，但我们仍需认识到其潜在的局限性。首先，其对幻觉的二元定义（非对即错）简化了现实世界的复杂性，忽略了错误陈述的严重程度差异。其次，将问题主要归因于公共基准，可能低估了商业应用中用户偏


):
            self.log.debug("CommsApp: Connected...")
            self.is_connected= True
            self.start_event.set()

        def disconnected(self):
            self.log.debug("CommsApp: Disconnected...")
            self.is_connected= False
            self.start_event.set()
            comms._stream_pause(False, True) # abort the stream

        def async_display(self, data):
            print(data)

        def stream_finished(self, ok):
            self.log.debug('CommsApp: stream finished: {}'.format(ok))
            self.ok= ok
            self.end_event.set()

        def alarm_state(self, s):
            self.ok= False
            # in this case we do want to disconnect
            comms.proto.transport.close()

    if len(sys.argv) < 4:
        print("Usage: {} ip port file".format(sys.argv[0]));
        exit(0)

    app= CommsApp()
    comms= CommsNet(app, False) # Don't start the report query timer when streaming
    if len(sys.argv) > 4:
        comms.ping_pong= True
        print('Ping Pong Stream')

    try:
        nlines= file_len(sys.argv[3]) # get number of lines so we can do progress and ETA
        print('number of lines: {}'.format(nlines))
    except:
        nlines= None

    start= None
    def display_progress(n):
        global start, nlines
        if not start:
            start= datetime.datetime.now()

        if nlines:
            now=datetime.datetime.now()
            d= (now-start).seconds
            if n > 10 and d > 1:
                # we have to wait a bit to get reasonable estimates
                lps= n/d
                eta= (nlines-n)/lps
            else:
                eta= 0

            print("progress: {}/{} {:.1%} ETA {:02d}:{:02d}:{:02d}".format(n, nlines, n/nlines, int(eta//3600), int(eta%3600)//60, int(eta%60)))

    try:
        t= comms.connect(sys.argv[1], sys.argv[2])
        if app.start_event.wait(5): # wait for connected as it is in a separate thread
            if app.is_connected:
                comms.stream_gcode(sys.argv[3], progress=lambda x: display_progress(x))
                app.end_event.wait() # wait for streaming to complete

                print("File sent: {}".format('Ok' if app.ok else 'Failed'))
                comms.stop()
                t.join()

            else:
                print("Error: Failed to connect")
                comms.stop()
        else:
            print("Error: Connection timed out")
            comms.stop()

    except KeyboardInterrupt:
        print("Interrupted")
        comms.stop()


B	    D7
		BNE	    FailDis

		LSR.W	    #8,D7
		BTST	    #1,D7
		BEQ.S	    MEMORY_MMU
		BTST	    #0,D7
		BNE	    FailDis
		CMP.B	    #%1100010,D7
		BEQ.S	    MMUSR_MEMORY
		BSR.S	    WRITE_MMU
		MOVE.B	    #',',(A2)+
		BRA	    CHECK_ADRESSIERUNG

MEMORY_MMU:	CMP.B	    #%1100000,D7
		BEQ.S	    MEMORY_MMUSR
		BTST	    #0,D7
		BEQ.S	    NO_FD
		MOVE.B	    #'F',-6(A2)
		MOVE.B	    #'D',-5(A2)
NO_FD:		BSR	    CHECK_ADRESSIERUNG
		MOVE.B	    #',',(A2)+
WRITE_MMU:	MOVE.W	    D7,D3
		AND.B	    #%11100000,D3
		BEQ.S	    TT_REGISTERS
		CMP.B	    #%1000000,D3
		BNE	    FailDis
		BSR.S	    GET_MMU
		BEQ	    WRITE_TC
		SUBQ.W	    #2,D3
		BEQ	    WRITE_SRP
		SUBQ.W	    #1,D3
		BEQ	    WRITE_CRP
		BRA	    FailDis

TT_REGISTERS:	BSR.S	    GET_MMU
		SUBQ.W	    #2,D3
		BEQ	    WRITE_TT0
		SUBQ.W	    #1,D3
		BEQ	    WRITE_TT1
		BRA	    FailDis

MEMORY_MMUSR:	BSR	    CHECK_ADRESSIERUNG
		MOVE.B	    #',',(A2)+
		BRA	    WRITE_MMUSR

MMUSR_MEMORY:	BSR	    WRITE_MMUSR
		MOVE.B	    #',',(A2)+
		BSR	    CHECK_ADRESSIERUNG

GET_MMU:	MOVEQ	    #%11100,D3
		AND.W	    D7,D3
		LSR.W	    #2,D3
		RTS

*-------------------------------------------------------------------------------

DISASSEMBLER_43:move.b		(a0),d3
				cmp.b		#%00100100,d3
				beq.s		PFLUSHA
				cmp.b		#%00110000,d3
				beq.s		PFLUSH_FC
				cmp.b		#%00111000,d3
				bne			FailDis

PFLUSH_FC_EA:	bsr.s		PFLUSH_FC
				move.b		#',',(a2)+
				bra			CHECK_ADRESSIERUNG

PFLUSHA:		tst.b		1(a0)
				bne			FailDis
				addq.w		#2,a0
				move.b		#'A',-DISSTRING_DISTANZ-2(a2)
				rts

PFLUSH_FC:		move.w		(a0)+,d7
				bsr.s		FC_WRITE		; FC schreiben
				move.b		#',',(a2)+
				moveq		#0,d3
				move.b		-1(a0),d3		; Maske schreiben
				lsr.w		#5,d3
				bra			WRITE_IMMEDIATE

*-------------------------------------------------------------------------------

DISASSEMBLER_44:bsr			GetRegister_1
				bra			WriteAri

*-------------------------------------------------------------------------------

DISASSEMBLER_45:bsr.s


    return AppTextTheme(
      bodyLargeRegular: bodyLargeRegular ?? this.bodyLargeRegular,
      bodyLargeMedium: bodyLargeMedium ?? this.bodyLargeMedium,
      bodyLargeSemiBold: bodyLargeSemiBold ?? this.bodyLargeSemiBold,
      bodyNormalMedium: bodyNormalMedium ?? this.bodyNormalMedium,
      bodyNormalRegular: bodyNormalRegular ?? this.bodyNormalRegular,
      header: header ?? this.header,
      navBar: navBar ?? this.navBar,
      pageHeader: pageHeader ?? this.pageHeader,
      button: button ?? this.button,
      bodySmallRegular: bodySmallRegular ?? this.bodySmallRegular,
      bodyNormalSemiBold: bodyNormalSemiBold ?? this.bodyNormalSemiBold,
      bodyNormalBold: bodyNormalBold ?? this.bodyNormalBold,
      bodyOddNormal: bodyOddNormal ?? this.bodyOddNormal,
      bodyOddMedium: bodyOddMedium ?? this.bodyOddMedium,
      bodyOddSemibold: bodyOddSemibold ?? this.bodyOddSemibold,
      label: label ?? this.label,
      formInput: formInput ?? this.formInput,
      formhelper: formhelper ?? this.formhelper,
      cardHeader: cardHeader ?? this.cardHeader,
      drawerHeader: drawerHeader ?? this.drawerHeader,
      sectionHeader: sectionHeader ?? this.sectionHeader,
      bodySmallMedium: bodySmallMedium ?? this.bodySmallMedium,
    );
  }

  @override
  ThemeExtension<AppTextTheme> lerp(
      covariant ThemeExtension<AppTextTheme>? other, double t) {
    return this;
  }
}
import 'dart:math';

import 'package:flutter/material.dart';

class ConfusionMatrixPainter extends CustomPainter {
  final List<String> xAxis;
  final List<String> yAxis;
  final List<List<num>> data;
  final Color color;
  final double cellWidth;
  final double cellHeight;
  final num backgroundOpacity;

  ConfusionMatrixPainter({
    required this.xAxis,
    required this.yAxis,
    required this.data,
    required this.color,
    required this.cellWidth,
    required this.cellHeight,
    this.backgroundOpacity = 3,
  });

  @override
  void paint(Canvas canvas, Size size) {
    for (int i = 0; i < data.length; i++) {
      for (int j = 0; j < data[i].length; j++) {
        final Rect rect = Rect.fromLTWH(
          j * cellWidth,
          i * cellHeight,
          cellWidth,
          cellHeight,
        );
        num value = data[i][j];
        Color cellColor = getColor(value);
        Paint paint = Paint()..color = cellColor;
        canvas.drawRect(rect, paint);

        // Draw dividers between cells
        final Paint dividerPaint = Paint()..color = Colors.white;
        canvas.drawLine(
          Offset((j + 1) * cellWidth, i * cellHeight),
          Offset((j + 1) * cellWidth, (i + 1) * cellHeight),
          dividerPaint,
        );
        canvas.drawLine(
          Offset(j * cellWidth, (i + 1) * cellHeight),
          Offset((j + 1) * cellWidth, (i + 1) * cellHeight),
          dividerPaint,
        );

        // Display unique data within each cell
        final TextSpan span = TextSpan(
          text: value.toString(),
          style: const TextStyle(color: Colors.white),
        );
        final TextPainter tp = TextPainter(
          text: span,
          textAlign: TextAlign.center,
          textDirection: TextDirection.ltr,
        );
        tp.layout();
        final double dx = j * cellWidth + (cellWidth - tp.width) / 2;
        final double dy = i * cellHeight + (


);
		store.add(13, n4);
		store.add(14, n5);
		store.add(15, n6);
		store.add(16, n7);

		assignment.choose(9, ThriceTruth.TRUE);
		assignment.choose(8, ThriceTruth.FALSE);
		assertNull(store.propagate());
		assertFalse(store.didPropagate());
		assignment.choose(7, ThriceTruth.FALSE);
		ConflictCause conflictCause = store.propagate();
		assertTrue(store.didPropagate());

		assertNotNull(conflictCause);
		Antecedent violatedNoGood = conflictCause.getAntecedent();
		assertNotNull(violatedNoGood);
		assertTrue(antecedentsEquals(violatedNoGood, n5.asAntecedent()) || antecedentsEquals(violatedNoGood, n7.asAntecedent()));
		GroundConflictNoGoodLearner.ConflictAnalysisResult analysisResult = learner.analyzeConflictingNoGood(conflictCause.getAntecedent());
		NoGood learnedNoGood = analysisResult.learnedNoGood;
		assertEquals(new NoGood(fromOldLiterals(1, -8)), learnedNoGood);
		int backjumpingDecisionLevel = analysisResult.backjumpLevel;
		assertEquals(backjumpingDecisionLevel, 2);
	}

	@Test
	@Disabled("TrailAssignment no longer propagates at lower decision level.")
	public void subCurrentDLPropagationWithChoiceCauseOfConflict() {
		GroundConflictNoGoodLearner learner = new GroundConflictNoGoodLearner(assignment, atomStore);
		NoGood n1 = new NoGood(fromOldLiterals(1, -2));
		NoGood n2 = new NoGood(fromOldLiterals(2, 3));
		store.add(10, n1);
		assignment.choose(1, ThriceTruth.TRUE);
		assignment.choose(3, ThriceTruth.TRUE);
		store.propagate();
		assertEquals(ThriceTruth.MBT, assignment.get(2).getTruth());
		assertEquals(1, assignment.get(2).getDecisionLevel());
		ConflictCause conflictCause = store.add(11, n2);
		assertNotNull(conflictCause);
		assertNotNull(conflictCause.getAntecedent());
		GroundConflictNoGoodLearner.ConflictAnalysisResult conflictAnalysisResult = learner.analyzeConflictingNoGood(conflictCause.getAntecedent());
		assertNull(conflictAnalysisResult.learnedNoGood);
		assertEquals(2, conflictAnalysisResult.backjumpLevel);

	}
}
/**
 * Copyright (c) 2018-2019 Siemens AG
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1) Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2) Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
pa


,2,1,0);
    TargetV(8,7,6,5,4,3,2,1,0);
    TargetV(9,8,7,6,5,4,3,2,1,0);
    TargetV(10,9,8,7,6,5,4,3,2,1,0);
    TargetV(11,10,9,8,7,6,5,4,3,2,1,0);
    TargetV(12,11,10,9,8,7,6,5,4,3,2,1,0);
    TargetV(13,12,11,10,9,8,7,6,5,4,3,2,1,0);
    TargetV(14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
    TargetV(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
    TargetV(16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
    TargetR(4,3,2,1,0);
    DWORD_PTR rv = TargetR(100,10,9,8,7,6,5,4,3,2,1,0);
    printf(" => %ld\n", (DWORD)rv);

    Trampoline_Target0_1 = Target0;
    Trampoline_Target0_2 = Target0;
    Trampoline_Target0_3 = Target0;

    //dprintf("Trampoline_Target0_1 = %p\n", DetourCodeFromPointer(Trampoline_Target0_1, NULL));
    //__debugbreak();

    printf("Calling Target0 again with 1 detour.\n");
    Target0();

    DetourTransactionBegin();
    DetourUpdateThread(GetCurrentThread());
    DetourAttach(&(PVOID&)Trampoline_Target0_1, MyTarget0_1);
    DetourTransactionCommit();

    //dprintf("Trampoline_Target0_2 = %p\n", DetourCodeFromPointer(Trampoline_Target0_2, NULL));
    //__debugbreak();
    printf("Calling Target0 again with 2 detours.\n");
    Target0();

    DetourTransactionBegin();
    DetourUpdateThread(GetCurrentThread());
    DetourAttach(&(PVOID&)Trampoline_Target0_2, MyTarget0_2);
    DetourTransactionCommit();

    //dprintf("Trampoline_Target0_3 = %p\n", DetourCodeFromPointer(Trampoline_Target0_3, NULL));
    //__debugbreak();
    printf("Calling Target0 again with 3 detours.\n");
    Target0();

    DetourTransactionBegin();
    DetourUpdateThread(GetCurrentThread());
    DetourAttach(&(PVOID&)Trampoline_Target0_3, MyTarget0_3);
    DetourTransactionCommit();

    //dprintf("Trampoline_Target0_3 = %p\n", DetourCodeFromPointer(Trampoline_Target0_3, NULL));
    //__debugbreak();
    printf("Calling Target0 again with 4 detours.\n");
    Target0();

    DetourTransactionBegin();
    DetourUpdateThread(GetCurrentThread());
    DetourDetach(&(PVOID&)Trampoline_Target0, MyTarget0);
    DetourDetach(&(PVOID&)Trampoline_Target1, MyTarget1);
    DetourDetach(&(PVOID&)Trampoline_Target2, MyTarget2);
    DetourDetach(&(PVOID&)Trampoline_Target3, MyTarget3);
    DetourDetach(&(PVOID&)Trampoline_Target4, MyTarget4);
    DetourDetach(&(PVOID&)Trampoline_Target5, MyTarget5);
    DetourDetach(&(PVOID&)Trampoline_Target6, MyTarget6);
    DetourDetach(&(PVOID&)Trampoline_Target7, MyTarget7);
    DetourDetach(&(PVOID&)Trampoline_Target8, MyTarget8);
    DetourDetach(&(PVOID&)Trampoline_Target9, MyTarget9);
    DetourDetach(&(


]
	prfm	PLDL1KEEP, [x9, x15]

	// preload
	ldr		d24, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d26, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d28, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d30, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d16, [x9]
	add		x9, x9, x10

	cmp		w8, #4
	ble		0f // consider clean up loop

	// prefetch
//	prfm	PLDL1KEEP, [x11]
//	prfm	PLDL1KEEP, [x11, x12]
//	prfm	PLDL1KEEP, [x11, x13]
//	prfm	PLDL1KEEP, [x11, x14]
//	prfm	PLDL1KEEP, [x9, #128]
//	prfm	PLDL1KEEP, [x9, #192]
	prfm	PLDL1KEEP, [x9, x15]

	// zero tmp acc
	fmov	d8, xzr

	// main loop
1:

	// unroll 0
	ldr		d18, [x9]
	fmla	v0.2d, v16.2d, v24.d[0]
	add		x9, x9, x10
	prfm	PLDL1KEEP, [x9, x15]
	prfm	PLDL1KEEP, [x11]
	prfm	PLDL1KEEP, [x11, x12]

	// unroll 1
	ldr		d16, [x9]
	fmla	v8.2d, v18.2d, v26.d[0]
	add		x9, x9, x10
	prfm	PLDL1KEEP, [x9, x15]
	prfm	PLDL1KEEP, [x11, x13]
	prfm	PLDL1KEEP, [x11, x14]
	sub		w8, w8, #4

	// unroll 2
	ldr		d18, [x9]
	fmla	v0.2d, v16.2d, v28.d[0]
	add		x9, x9, x10
	prfm	PLDL1KEEP, [x9, x15]
	cmp		w8, #4
	ldr		d24, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d26, [x11, #(0*8)]
	add		x11, x11, x12

	// unroll 3
	ldr		d16, [x9]
	fmla	v8.2d, v18.2d, v30.d[0]
	add		x9, x9, x10
	prfm	PLDL1KEEP, [x9, x15]
	ldr		d28, [x11, #(0*8)]
	add		x11, x11, x12
	ldr		d30, [x11, #(0*8)]
	add		x11, x11, x12

	bgt		1b

	// reduce
	fadd	v0.2d, v0.2d, v8.2d

//	sub		x9, x9, #32
//	sub		x11, x11, #32

0:

	cmp		w8, #3
	ble		4f

	// unroll 0
	ldr		d18, [x9]
	fmla	v0.2d, v16.2d, v24.d[0]
	add


oup");
    this->connections.clear();

    b2Vec2 lvel = b2Vec2(0.f, 0.f);
    float avel = 0.f;

    std::set<composable*> pending;
    std::set<composable*> found;
    std::set<connection*> found_conn;

    std::set<group*> modified_groups;
    std::set<composable*> modified_entities;

    for (std::vector<composable*>::iterator i = this->entities.begin();
            i != this->entities.end(); i++) {
        pending.insert(*i);
        (*i)->_pos = (*i)->get_position();
        (*i)->_angle = (*i)->get_angle();
        (*i)->gr = 0;
    }

    //tms_infof("created pending");

    this->entities.clear();

    if (!W->is_paused() && W->level.type == LCAT_ADVENTURE && this->body) {
        lvel = this->body->GetLinearVelocity();
        avel = this->body->GetAngularVelocity();
    }

    //tms_infof("%p group body: %p", this, this->body);
    if (this->body) {
        //this->_pos = this->body->GetPosition();
        //this->_angle = this->body->GetAngle();
        W->b2->DestroyBody(this->body);
    }
    this->body = 0;
    //tms_infof("%p group body: %p", this, this->body);

    bool created_self = false;

    while (pending.size() > 0) {
        found.clear();
        found_conn.clear();
        this->make_group(*pending.begin(), &pending, &found, &found_conn);

        if (found.size() > 1) {
            group *target;
            if (!created_self) {
                target = this;
                created_self = true;
            } else {
                target = new group();
                target->id = of::get_next_id();
                G->add_entity(target);
                W->add(target);
            }

            int xx = 0;
            for (std::set<composable*>::iterator i = found.begin();
                    i != found.end(); i++) {
                if (xx == 0) {
                    target->_pos = (*i)->_pos;
                    target->_angle = (*i)->_angle;
                    target->push_entity(*i, b2Vec2(.0f,.0f), 0.f);
                } else {
                    b2Vec2 p = target->body->GetLocalPoint((*i)->_pos);
                    target->push_entity(*i, p, (*i)->_angle - target->_angle);
                }
                xx = 1;
            }
            std::copy(found_conn.begin(), found_conn.end(), std::back_inserter(target->connections));

            //target->create_mesh();
            modified_groups.insert(target);
        } else {
            composable *e = *found.begin();
            e->update_shape(b2Vec2(0,0), 0);

            tms_debugf("loose entity: %u", e->id);

            if (e->scene) {
                bool select = (G->selection.e == e);

                G->remove_entity(e);
                if (e->update_method == ENTITY_UPDATE_GROUPED) {
                    e->curr_update_method = e->update_method = ENTITY_UPDATE_FASTBODY;
                }
                G->add_entity(e);

                if (select)
                    G->selection.select(e, 0, (tvec2){0,0}, 0, true);
            } else {
                if (e->update_method == ENTITY_UPDATE_GROUPED) {
                    e->curr_update_method = e->


defender:getMod(tpz.mod.CRIT_DEF_BONUS)
    critbonus = utils.clamp(critbonus, 0, 100)
    pdifcrit[1] = pdifmin * (100 + critbonus) / 100
    pdifcrit[2] = pdifmax * (100 + critbonus) / 100

    return pdif, pdifcrit
end

function cRangedRatio(attacker, defender, params, ignoredDef, tp)

    local atkmulti = fTP(tp, params.atk100, params.atk200, params.atk300)
    local cratio = attacker:getRATT() / (defender:getStat(tpz.mod.DEF) - ignoredDef)

    local levelcor = 0
    if (attacker:getMainLvl() < defender:getMainLvl()) then
        levelcor = 0.025 * (defender:getMainLvl() - attacker:getMainLvl())
    end

    cratio = cratio - levelcor

    cratio = cratio * atkmulti

    if (cratio > 3 - levelcor) then
        cratio = 3 - levelcor
    end

    if (cratio < 0) then
        cratio = 0
    end

    -- max
    local pdifmax = 0
    if (cratio < 0.9) then
        pdifmax = cratio * (10/9)
    elseif (cratio < 1.1) then
        pdifmax = 1
    else
        pdifmax = cratio
    end

    -- min
    local pdifmin = 0
    if (cratio < 0.9) then
        pdifmin = cratio
    elseif (cratio < 1.1) then
        pdifmin = 1
    else
        pdifmin = (cratio * (20/19))-(3/19)
    end

    pdif = {}
    pdif[1] = pdifmin
    pdif[2] = pdifmax
    -- printf("ratio: %f min: %f max %f\n", cratio, pdifmin, pdifmax)
    pdifcrit = {}

    pdifmin = pdifmin * 1.25
    pdifmax = pdifmax * 1.25

    pdifcrit[1] = pdifmin
    pdifcrit[2] = pdifmax

    return pdif, pdifcrit

end

-- Given the attacker's str and the mob's vit, fSTR is calculated (for melee WS)
function fSTR(atk_str, def_vit, weapon_rank)
    local dSTR = atk_str - def_vit
    local fSTR = 0
    if (dSTR >= 12) then
        fSTR = (dSTR + 4) / 4
    elseif (dSTR >= 6) then
        fSTR = (dSTR + 6) / 4
    elseif (dSTR >= 1) then
        fSTR = (dSTR + 7) / 4
    elseif (dSTR >= -2) then
        fSTR = (dSTR + 8) / 4
    elseif (dSTR >= -7) then
        fSTR = (dSTR + 9) / 4
    elseif (dSTR >= -15) then
        fSTR = (dSTR + 10) / 4
    elseif (dSTR >= -21) then
        fSTR = (dSTR + 12) / 4
    else
        fSTR = (dSTR + 13) / 4
    end

    -- Apply fSTR caps.
    local lower_cap = weapon_rank * -1
    if weapon_rank == 0 then
        lower_cap = -1
    end
    fSTR = utils.clamp(fSTR, lower_cap, weapon_rank + 8)
    return fSTR
end

-- Given the attacker's str and the mob's vit, fSTR2 is calculated (for ranged WS)
function fSTR2(atk_str, def_vit, weapon_rank)
    local dSTR = atk_str - def_vit
    local fSTR2 = 0
    if (dSTR >= 12) then
        fSTR2 = (dSTR + 4) / 2
    elseif (dSTR >= 6) then
        fSTR2 = (dSTR + 6) / 2
    elseif (dSTR >= 1) then
        fSTR2 = (dSTR + 7) / 2
    elseif (dSTR >= -2) then


+5358-5359, U+535b,
    U+535d, U+5365, U+5368, U+536a, U+536c-536d, U+5372, U+5376, U+5379, U+537b-537e, U+5380-5381,
    U+5383, U+5387-5388, U+538a, U+538e-5394, U+5396-5397, U+5399, U+539b-539c, U+539e, U+53a0-53a1,
    U+53a4, U+53a7, U+53aa-53ad, U+53af-53b5, U+53b7-53ba, U+53bc-53be, U+53c0, U+53c3-53c7,
    U+53ce-53d0, U+53d2-53d3, U+53d5, U+53da, U+53dc-53de, U+53e1-53e2, U+53e7, U+53f4, U+53fa,
    U+53fe-5400, U+5402, U+5405, U+5407, U+540b, U+5414, U+5418-541a, U+541c, U+5422, U+5424-5425,
    U+542a, U+5430, U+5433, U+5436-5437, U+543a, U+543d, U+543f, U+5441-5442, U+5444-5445, U+5447,
    U+5449, U+544c-544f, U+5451, U+545a, U+545d-5461, U+5463, U+5465, U+5467, U+5469-5470, U+5474,
    U+5479-547a, U+547e-547f, U+5481, U+5483, U+5485, U+5487-548a, U+548d, U+5491, U+5493,
    U+5497-5498, U+549c, U+549e-54a2, U+54a5, U+54ae, U+54b0, U+54b2, U+54b5-54b7, U+54b9-54ba,
    U+54bc, U+54be, U+54c3, U+54c5, U+54ca-54cb, U+54d6, U+54d8, U+54db, U+54e0-54e4, U+54eb-54ec,
    U+54ef-54f1, U+54f4-54f7;
}
@font-face {
  font-family: 'LXGW WenKai Screen';
  src:
    local('LXGW WenKai Screen'),
    url('./00574f73ac7417880855599b6db6e3e0.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+518b, U+518e-5191, U+5193-5194, U+5198, U+519a, U+519d-519f, U+51a1, U+51a3, U+51a6-51aa,
    U+51ad-51ae, U+51b4, U+51b8-51ba, U+51be-51bf, U+51c1-51c3, U+51c5, U+51c8, U+51ca, U+51cd-51ce,
    U+51d0, U+51d2-51da, U+51dc, U+51de-51df, U+51e2-51e3, U+51e5-51ea, U+51ec, U+51ee, U+51f1-51f2,
    U+51f4, U+51f7, U+51fe, U+5204-5205, U+5209, U+520b-520c, U+520f-5210, U+5213-


    protected override Stream UnParse()
        {
            var s = base.UnParse();
            BinaryWriter w = new BinaryWriter(s);
            if (this.trimTGIReference == null) this.trimTGIReference = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG");
            this.trimTGIReference.UnParse(s);
            w.Write(this.unknown1);
            if (this.modlTGIReference == null) this.modlTGIReference = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG");
            this.modlTGIReference.UnParse(s);
            w.Write(this.catalogGroupID);
            if (this.colorList == null) this.colorList = new SwatchColorList(OnResourceChanged);
            this.colorList.UnParse(s);
            w.Write(this.unknown2);
            return s;
        }
        #endregion

        #region Content Fields
        [ElementPriority(16)]
        public TGIBlock TrimTGIReference { get { return trimTGIReference; } set { if (!trimTGIReference.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.trimTGIReference = value; } } }
        [ElementPriority(17)]
        public uint Unknown1 { get { return unknown1; } set { if (!unknown1.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.unknown1 = value; } } }
        [ElementPriority(18)]
        public TGIBlock ModlTGIReference { get { return modlTGIReference; } set { if (!modlTGIReference.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.modlTGIReference = value; } } }
        [ElementPriority(19)]
        public ulong CatalogGroupID { get { return catalogGroupID; } set { if (!catalogGroupID.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.catalogGroupID = value; } } }
        [ElementPriority(20)]
        public SwatchColorList ColorList { get { return colorList; } set { if (!colorList.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.colorList = value; } } }
        [ElementPriority(21)]
        public uint Unknown2 { get { return unknown2; } set { if (!unknown2.Equals(value)) { OnResourceChanged(this, EventArgs.Empty); this.unknown2 = value; } } }
        #endregion

        #region Clone
        public override TGIBlock[] NestedTGIBlockList
        {
            get
            {
                return new TGIBlock[] { this.trimTGIReference, this.modlTGIReference };
            }
            set
            {
                base.SetTGIList(value);
            }
        }

        protected override object GroupingID { get { return this.CatalogGroupID; } set { this.CatalogGroupID = (ulong)value; } }
        #endregion
    }
}


;
    let devices = context.query_devices(queried_devices);
    ensure!(!devices.is_empty(), "No devices found.");

    // Create pipeline
    let pipeline = InactivePipeline::try_from(&context)?;
    let mut config = Config::new();

    // Check the USB speed of our connection
    // CStr => str => f32
    let usb_cstr = devices[0].info(Rs2CameraInfo::UsbTypeDescriptor).unwrap();
    let usb_val: f32 = usb_cstr.to_str().unwrap().parse().unwrap();
    if usb_val >= 3.0 {
        config
            .enable_device_from_serial(devices[0].info(Rs2CameraInfo::SerialNumber).unwrap())?
            .disable_all_streams()?
            .enable_stream(Rs2StreamKind::Depth, None, 640, 0, Rs2Format::Z16, 30)?
            .enable_stream(Rs2StreamKind::Infrared, None, 640, 0, Rs2Format::Y8, 30)?
            .enable_stream(Rs2StreamKind::Gyro, None, 0, 0, Rs2Format::Any, 0)?;
    } else {
        config
            .enable_device_from_serial(devices[0].info(Rs2CameraInfo::SerialNumber).unwrap())?
            .disable_all_streams()?
            .enable_stream(Rs2StreamKind::Depth, None, 320, 0, Rs2Format::Z16, 30)?
            .enable_stream(Rs2StreamKind::Infrared, None, 320, 0, Rs2Format::Y8, 30)?
            .enable_stream(Rs2StreamKind::Gyro, None, 0, 0, Rs2Format::Any, 0)?;
    }

    // Change pipeline's type from InactivePipeline -> ActivePipeline
    let mut pipeline = pipeline.start(Some(config))?;

    // process frames
    for _ in 0..1000 {
        // The L515 takes a while to initialize. Make this 5 seconds.
        let timeout = Duration::from_millis(5000);
        let frames = pipeline.wait(Some(timeout))?;

        let mut depth_frames = frames.frames_of_type::<DepthFrame>();
        if depth_frames.is_empty() {
            continue;
        }
        let depth_frame = depth_frames.pop().unwrap();
        let distance = depth_frame.distance(depth_frame.width() / 2, depth_frame.height() / 2)?;
        if distance == 0.0 {
            continue;
        }
        print!("\rCurrent distance of center pixel: {:<15} m", distance);
        io::stdout().flush().unwrap();
    }

    Ok(())
}
<reponame>livexia/rust-learning<filename>leetcode/leetcode_1579/src/lib.rs
/*
Alice 和 Bob 共有一个无向图，其中包含 n 个节点和 3  种类型的边：

类型 1：只能由 Alice 遍历。
类型 2：只能由 Bob 遍历。
类型 3：Alice 和 Bob 都可以遍历。
给你一个数组 edges ，其中 edges[i] = [typei, ui, vi] 表示节点