ts('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(MyApp());

    // Verify that our counter starts at 0.
    expect(find.text('0'), findsOneWidget);
    expect(find.text('1'), findsNothing);

    // Tap the '+' icon and trigger a frame.
    await tester.tap(find.byIcon(Icons.add));
    await tester.pump();

    // Verify that our counter has incremented.
    expect(find.text('0'), findsNothing);
    expect(find.text('1'), findsOneWidget);
  });
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:web_shortcuts/src/dev_shortcuts.dart';
import 'package:web_shortcuts/src/my_home_page.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool showPerformanceOverlay;
  bool showDebugBanner;
  bool debugShowMaterialGrid;
  ThemeMode themeMode;

  @override
  void initState() {
    super.initState();
    showPerformanceOverlay = false;
    showDebugBanner = true;
    debugShowMaterialGrid = false;
    themeMode = ThemeMode.system;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primaryColor: Colors.white,
      ),
      darkTheme: ThemeData.dark(),
      themeMode: themeMode,
      showPerformanceOverlay: showPerformanceOverlay,
      debugShowCheckedModeBanner: showDebugBanner,
      debugShowMaterialGrid: debugShowMaterialGrid,
      actions: {
        DevelopmentIntent: DevelopmentAction(),
        ToggleThemeIntent: ToggleThemeAction(),
        SendDebugDataIntent: SendDebugDataAction(),
      },
      shortcuts: _shortcuts,
      home: MyHomePage(),
    );
  }

  Map<LogicalKeySet, Intent> get _shortcuts => {
        LogicalKeySet(LogicalKeyboardKey.shift, LogicalKeyboardKey.f12):
            const SendDebugDataIntent(),
        LogicalKeySet(LogicalKeyboardKey.f12): ToggleThemeIntent(toggle: (brightness) {
          setState(() {
            themeMode = (brightness == Brightness.light)
                ? ThemeMode.dark
                : ThemeMode.light;
          });
        }),
        LogicalKeySet(LogicalKeyboardKey.f10):
            DevelopmentIntent(action: () {
          setState(() => showPerformanceOverlay = !showPerformanceOverlay);
        }),
        LogicalKeySet(LogicalKeyboardKey.f9): DevelopmentIntent(action: () {
          setState(() => showDebugBanner = !showDebugBanner);
        }),
        LogicalKeySet(LogicalKeyboardKey.f8): DevelopmentIntent(action: () {
          setState(() => debugShowMaterialGrid = !debugShowMaterialGrid);
        }),
      };
}
import 'package:flutter/material.dart';

import '../flavors.dart';

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    print("COUCOU Page");
    return F.layoutBuilder(
        context,
        Scaffold(
          appBar: AppBar(
            title: Text(F.data.title),
          ),
          body: Column(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Text(
                'Hello ${F.data.title}',
                textAlign: TextAlign.center,
              ),
              Sized


class="table-responsive small">

            #
            Тема письма
            Тело письма

        {% for message in object_list %}

            {{ message.id }}
            {{ message.title }}
            {{ message.message }}
            {% if message.owner == user %}

                Изменить
                Удалить

            {% else %}

            {% endif %}

        {% endfor %}

{% endblock %}

{% extends 'mailing/base.html' %}

{% block title %}Управление рассылками{% endblock %}

{% block content %}

Управление рассылками

        Добавить

            #
            Дата и время первой отправки
            Дата и время окончания отправки
            Статус автоматической рассылки
            Сообщение
            Получатели

        {% for mailing in object_list %}

            {{ mailing.id }}
            {{ mailing.first_send_at }}
            {{ mailing.finish_send_at }}
            {{ mailing.status }}
            {% if mailing.owner == user or is_manager %}
                {% if mailing.status != "completed" %}
                <form action="{% url 'mailing:mailing_stop' mailing.pk %}" method="post">
                    {% csrf_token %}
                    <button type="submit" class="btn btn-outline-danger btn-sm">Завершить/отключить</button>
                </form>
                {% endif %}
                {% endif %}

            {{ mailing.message }}

                {% for recipient in mailing.recipients.all %}
                {{ recipient.email }}

                {% endfor %}

                {% if mailing.owner == user %}

                Разослать вручную

                <a class="btn btn-outline-primary" href="{% url 'mailing:mailing_update' mai


            e.set_stretch(e.stretch().add_or_sub(t.stretch(), r == Expr::Sub));
                        } else if e.stretch_order() < t.stretch_order()
                            && t.stretch() != Scaled::ZERO
                        {
                            e.set_stretch(t.stretch())
                                .set_stretch_order(t.stretch_order());
                        }
                        if e.shrink_order() == t.shrink_order() {
                            e.set_shrink(e.shrink().add_or_sub(t.shrink(), r == Expr::Sub));
                        } else if e.shrink_order() < t.shrink_order() && t.shrink() != Scaled::ZERO
                        {
                            e.set_shrink(t.shrink()).set_shrink_order(t.shrink_order());
                        }
                        delete_glue_ref(t.ptr());
                        if e.stretch() == Scaled::ZERO {
                            e.set_stretch_order(GlueOrder::Normal);
                        }
                        if e.shrink() == Scaled::ZERO {
                            e.set_shrink_order(GlueOrder::Normal);
                        }
                    }
                    r = o;
                }
                b = arith_error;
                if o != Expr::None {
                    break;
                }
                /*1577: */
                if let Some(q) = p.opt() {
                    f = e;
                    e = MEM[q + 1].b32.s1;
                    t = MEM[q + 2].b32.s1;
                    n = MEM[q + 3].b32.s1;
                    s = Expr::from(MEM[q].b16.s0 as i32 / 4);
                    r = Expr::from(MEM[q].b16.s0 as i32 % 4);
                    l = ValLevel::from(MEM[q].b16.s1 as u8);
                    p = *LLIST_link(q);
                    free_node(q, EXPR_NODE_SIZE);
                } else {
                    break 'c_78022;
                }
            }
        }
        /*1576: */
        let q = get_node(EXPR_NODE_SIZE);
        *LLIST_link(q) = p;
        MEM[q].b16.s1 = l as u16;
        MEM[q].b16.s0 = (4 * s as i32 + r as i32) as u16;
        MEM[q + 1].b32.s1 = e;
        MEM[q + 2].b32.s1 = t;
        MEM[q + 3].b32.s1 = n;
        p = q as i32;
        l = o;
    }
    if b {
        t_eprint!("Arithmetic overflow");
        help!(
            "I can\'t evaluate this expression,",
            "since the result is out of range."
        );
        error();
        if l >= ValLevel::Glue {
            delete_glue_ref(e as usize);
            e = 0;
            MEM[e as usize].b32.s1 += 1;
        } else {
            e = 0;
        }
    }
    arith_error = a;
    *val_level = l;
    e
}
pub(crate) unsafe fn scan_normal_glue(input: &mut input_state_t) -> GlueSpec {
    scan_glue(input, ValLevel::Glue)
}
pub(crate) unsafe fn scan_mu_glue(input: &mut input_state_t) -> GlueSpec {
    scan_glue(input, ValLevel::Mu)
}
pub(crate) unsafe fn scan_rule_spec(input: &mut input_state_t, cmd: Cmd) -> Rule {
    let mut q = new_rule();
    if cmd == Cmd::VRule {
        q.set_width(DEFAULT_RULE);
    } else {
        q.set_height(DEFAULT_RULE).set_depth(Scaled::ZERO);
    }
    loop {
        if scan_keyword(input, "width") {
            q.set_width(scan_dimen(input, false, false, None));
        } else if scan_keyword(input, "height") {
            q.set_height(scan_dimen(input, false, false, None));
        } else if scan_keyword(input, "depth") {


x09cb9, -- 鲹
    0x2b5f4, -- 𫗴
    0x04eb8, -- 亸
    0x07640, -- 癀
    0x0762d, -- 瘭
    0x2ce26, -- 𬸦
    0x07fb1, -- 羱
    0x07cd2, -- 糒
    0x071cb, -- 燋
    0x071bb, -- 熻
    0x071ca, -- 燊
    0x071da, -- 燚
    0x071cf, -- 燏
    0x06fe9, -- 濩
    0x06fcb, -- 濋
    0x06faa, -- 澪
    0x06fbd, -- 澽
    0x06fb4, -- 澴
    0x06fad, -- 澭
    0x06fbc, -- 澼
    0x061b7, -- 憷
    0x061ba, -- 憺
    0x061d4, -- 懔
    0x09ec9, -- 黉
    0x05b1b, -- 嬛
    0x09e68, -- 鹨
    0x07fef, -- 翯
    0x2b137, -- 𫄷
    0x074b1, -- 璱
    0x24a7d, -- 𤩽
    0x074ac, -- 璬
    0x074ae, -- 璮
    0x09afd, -- 髽
    0x064ff, -- 擿
    0x085bf, -- 薿
    0x085b8, -- 薸
    0x06a91, -- 檑
    0x06ac6, -- 櫆
    0x06a9e, -- 檞
    0x091a8, -- 醨
    0x07e44, -- 繄
    0x078f9, -- 磹
    0x078fb, -- 磻
    0x077ab, -- 瞫
    0x077b5, -- 瞵
    0x08e50, -- 蹐
    0x087cf, -- 蟏
    0x0360e, -- 㘎
    0x2cb73, -- 𬭳
    0x09564, -- 镤
    0x2cb76, -- 𬭶
    0x2b50d, -- 𫔍
    0x09565, -- 镥
    0x09568, -- 镨
    0x2cb78, -- 𬭸
    0x28c54, -- 𨱔
    0x2cb7c, -- 𬭼
    0x2b50e, -- 𫔎
    0x077f0, -- 矰
    0x07a59, -- 穙
    0x07a5c, -- 穜
    0x07a5f, -- 穟
    0x07c15, -- 簕
    0x07c03, -- 簃
    0x07c0f, -- 簏
    0x05126, -- 儦
    0x09b4b, -- 魋
    0x065b6, -- 斶
    0x0825a, -- 艚
    0x2ce2a, -- 𬸪
    0x08c3f, -- 谿
    0x04ca0, -- 䲠
    0x2cd9f, -- 𬶟
    0x09cbe, -- 鲾
    0x2cda0, -- 𬶠
    0x09cbf, -- 鲿
    0x09cc1, -- 鳁
    0x09cc2, -- 鳂


erride val rumContext: ExpectedRumContext = resolvedRumContext()
) : ExpectedEvent

internal data class ExpectedApplicationLaunchViewEvent(
    val docVersion: Int = 0,
    val viewArguments: Map<String, Any?> = mapOf(),
    val extraAttributes: Map<String, Any?> = mapOf(),
    val extraViewAttributes: Map<String, Any?> = mapOf(),
    val extraViewAttributesWithPredicate: Map<String, (JsonElement) -> Boolean> = mapOf(),
    override val rumContext: ExpectedRumContext = resolvedRumContext()
) : ExpectedEvent

internal data class ExpectedResourceEvent(
    val url: String,
    val statusCode: Int,
    val extraAttributes: Map<String, Any?>,
    override val rumContext: ExpectedRumContext = resolvedRumContext()
) : ExpectedEvent

internal data class ExpectedErrorEvent(
    val url: String,
    val extraAttributes: Map<String, Any?>,
    val isCrash: Boolean,
    val source: ErrorSource,
    override val rumContext: ExpectedRumContext = resolvedRumContext()
) : ExpectedEvent

internal interface ExpectedEvent {
    val rumContext: ExpectedRumContext
}

internal enum class Gesture(val gestureName: String) {
    TAP("tap"),
    SWIPE("swipe")
}

internal enum class ErrorSource(val sourceName: String) {
    NETWORK("network")
}

private val registryField = Datadog::class.java.getDeclaredField("registry").apply {
    isAccessible = true
}
private val registryGetInstanceMethod = registryField.type.getMethod(
    "getInstance",
    String::class.java
)

private fun rumContextValues(): Triple<String, String, String> {
    val sdkCore: FeatureSdkCore? = registryGetInstanceMethod
        .invoke(registryField.get(null), null) as? FeatureSdkCore
    checkNotNull(sdkCore)
    val rumContext: Map<String, Any?> = sdkCore.getFeatureContext("rum")
    val appId: String = rumContext["application_id"] as String
    val sessionId: String = rumContext["session_id"] as String
    val viewId: String? = rumContext["view_id"] as? String
    return Triple(appId, sessionId, viewId ?: "null")
}

private fun resolvedRumContext(): ExpectedRumContext {
    val rumContextValues = rumContextValues()
    return ExpectedRumContext(
        rumContextValues.first,
        rumContextValues.second,
        rumContextValues.third
    )
}
/*
 * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
 * This product includes software developed at Datadog (https://www.datadoghq.com/).
 * Copyright 2016-Present Datadog, Inc.
 */

package com.datadog.android.sdk.integration.trace

import com.datadog.android.trace.api.span.DatadogSpan
import com.datadog.android.trace.internal.DatadogTracingToolkit

/**
 * Returns the span's least significant trace id in hex format (the last 64 bits from the 128 bits trace id)
 */
fun DatadogSpan.leastSignificant64BitsTraceId(): String {
    return traceId.toHexString().padStart(32, '0').takeLast(16)
}

/**
 * Returns the span's most significant trace id in hex format (the first 64 bits from the 128 bits trace id)
 */
fun DatadogSpan.mostSignificant64BitsTraceId(): String {
    return traceId.toHexString().padStart(32, '0').take(16)
}

/**
 * Returns the span's spanId in hex format.
 */
fun DatadogSpan.spanIdAsHexString(): String {
    return DatadogTracingToolkit.spanIdConverter.toHexStringPadded(context().spanId)
}
/*
 * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
 * This product includes software developed at Datadog (https://www.datadoghq.com/).
 * Copyright 2016-Present Datadog, Inc.
 */

package com.datadog.android.sdk.integration.sessionreplay.chekboxandradio

import com.datadog.android.privacy.


Click:connect(function()
			ste=false
			frs.Visible=false
			set.Style="RobloxButton"
		end)
		ckb.MouseButton1Click:connect(function()
			md1=1
			ckb.Style="RobloxButtonDefault"
			ckb.Selected=true
			ckb.Text="Enabled"
			ckb.TextColor3=Color3.new(0,1,0)
			ryb.Style="RobloxButton"
			ryb.Selected=false
			ryb.Text="Disabled"
			ryb.TextColor3=Color3.new(1,0,0)
		end)
		ryb.MouseButton1Click:connect(function()
			md1=2
			ryb.Style="RobloxButtonDefault"
			ryb.Selected=true
			ryb.Text="Enabled"
			ryb.TextColor3=Color3.new(0,1,0)
			ckb.Style="RobloxButton"
			ckb.Selected=false
			ckb.Text="Disabled"
			ckb.TextColor3=Color3.new(1,0,0)
		end)
		rfb.MouseButton1Click:connect(function()
			if(md3==1)then
				md3=2
				rfb.Style="RobloxButton"
				rfb.Text="Disable Propertie"
				rfb.TextColor3=Color3.new(1,0,0)
			elseif(md3==2)then
				md3=1
				rfb.Style="RobloxButtonDefault"
				rfb.Text="Enable Propertie"
				rfb.TextColor3=Color3.new(0,1,0)
			end
		end)
	end)
	bin.Deselected:connect(function()
		clr=false
		if(box~=nil)then
			box:Destroy()
		end
		if(lso~=nil)then
			lso:Destroy()
		end
		if(gui~=nil)then
			gui:Destroy()
		end
	end)
end)

GodMode.MouseButton1Click:connect(function()
while wait() do
    for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
    print(v)
        if v.Name == "KO" then
            v:Destroy()
        end
    end
    game.Players.LocalPlayer.Character:FindFirstChildOfClass('Humanoid').PlatformStand = false
    w1 = Instance.new("Weld")
w1.Parent = game.Players.LocalPlayer.Character.Torso
w1.Part0 = game.Players.LocalPlayer.Character.Head
w1.Part1 = game.Players.LocalPlayer.Character.Torso
w1.C0 = CFrame.fromEulerAnglesXYZ(0, 0, 0) + Vector3.new(0, -1.5, 0)

w1 = Instance.new("Weld")
w1.Parent = game.Players.LocalPlayer.Character.Torso
w1.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
w1.Part1 = game.Players.LocalPlayer.Character.Torso
w1.C0 = CFrame.fromEulerAnglesXYZ(0, 0, 0) + Vector3.new(-1.5, 0, 0)

w1 = Instance.new("Weld")
w1.Parent = game.Players.LocalPlayer.Character.Torso
w1.Part0 = game.Players.LocalPlayer.Character["Left Arm"]
w1.Part1 = game.Players.LocalPlayer.Character.Torso
w1.C0 = CFrame.fromEulerAnglesXYZ(0, 0, 0) + Vector3.new(1.5, 0, 0)

w1 = Instance.new("Weld")
w1.Parent = game.Players.LocalPlayer.Character.Torso
w1.Part0 = game.Players.LocalPlayer.Character["Right Leg"]
w1.Part1 = game.Players.LocalPlayer.Character.Torso
w1.C0 = CFrame.fromEulerAnglesXYZ(0, 0, 0) + Vector3.new(-.5, 2, 0)

w


 15.;

        for ( float y = 0.0; y < height; y++ ) {
            for ( float x = 0.0; x < width; x++ ) {

                vec2 ref = vec2( x + 0.5, y + 0.5 ) / resolution.xy;
                birdPosition = texture2D( texturePosition, ref ).xyz;

                dir = birdPosition - selfPosition;
                dist = length( dir );

                if ( dist < 0.0001 ) continue;

                distSquared = dist * dist;

                if ( distSquared > zoneRadiusSquared ) continue;

                percent = distSquared / zoneRadiusSquared;

                if ( percent < separationThresh ) { // low

                    // Separation - Move apart for comfort
                    f = ( separationThresh / percent - 1.0 ) * delta;
                    velocity -= normalize( dir ) * f;

                } else if ( percent < alignmentThresh ) { // high

                    // Alignment - fly the same direction
                    float threshDelta = alignmentThresh - separationThresh;
                    float adjustedPercent = ( percent - separationThresh ) / threshDelta;

                    birdVelocity = texture2D( textureVelocity, ref ).xyz;

                    f = ( 0.5 - cos( adjustedPercent * PI_2 ) * 0.5 + 0.5 ) * delta;
                    velocity += normalize( birdVelocity ) * f;

                } else {

                    // Attraction / Cohesion - move closer
                    float threshDelta = 1.0 - alignmentThresh;
                    float adjustedPercent;
                    if( threshDelta == 0. ) adjustedPercent = 1.;
                    else adjustedPercent = ( percent - alignmentThresh ) / threshDelta;

                    f = ( 0.5 - ( cos( adjustedPercent * PI_2 ) * -0.5 + 0.5 ) ) * delta;

                    velocity += normalize( dir ) * f;

                }

            }

        }

        // this make tends to fly around than down or up
        // if (velocity.y > 0.) velocity.y *= (1. - 0.2 * delta);

        // Speed Limits
        if ( length( velocity ) > limit ) {
            velocity = normalize( velocity ) * limit;
        }

        gl_FragColor = vec4( velocity, 1.0 );

    }
`;
/**
 * Returns a random integer between min (inclusive) and max (inclusive)
 * @param max
 * @param min
 * @param rand
 */
export const get_random_int_in_range  =
  ( max: number, min: number = 0, rand: () => number = Math.random ) =>
  ( Math.floor( rand() * ( max - min + 1 ) ) + min )

export default get_random_int_in_rangeimport { ValidatorFn, AbstractControl } from '@angular/forms';

/**
 * Returns Validation Error object (forbids validation) if given control's value
 * DOES NOT MATCH the input regexp
 *
 * @export
 * @param {RegExp} regex
 * @returns {ValidatorFn}
 */
export const regexAllowValidator = (regex: RegExp): ValidatorFn | null => {

	return (control: AbstractControl): {[key: string]: any} | null => {
		const forbidden = ! regex.test(control.value);
		return forbidden ? { 'forbidden': {value: control.value} } : null;
	};
};
const margins = { marginTop: -1, marginBottom: 1, marginStart: 0, marginEnd: -2 };

/**
 * Adjusts the margin of text so that it's centered within the layout area of the text.
 * Due to how Segoe UI lays out, the text does not appeared centered within the text
 * layout area without some fuding of margins.
 * @returns Adjustment necessary for text
 */
export function getTextMarginAdjustment() {
  return margins;
}
import Location fro


stants.SubType;
import mage.counters.CounterType;

/**
 *
 * @author fireshoes
 */
public final class QuagmireLamprey extends CardImpl {

    public QuagmireLamprey(UUID ownerId, CardSetInfo setInfo) {
        super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
        this.subtype.add(SubType.FISH);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // Whenever Quagmire Lamprey becomes blocked by a creature, put a -1/-1 counter on that creature.
        Effect effect = new AddCountersTargetEffect(CounterType.M1M1.createInstance(1));
        effect.setText("put a -1/-1 counter on that creature");
        this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(effect, false));
    }

    private QuagmireLamprey(final QuagmireLamprey card) {
        super(card);
    }

    @Override
    public QuagmireLamprey copy() {
        return new QuagmireLamprey(this);
    }
}

package mage.cards.q;

import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.AsThoughEffectType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;

/**
 *
 * @author L_J
 */
public final class Quagmire extends CardImpl {

    public Quagmire(UUID ownerId, CardSetInfo setInfo) {
        super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");

        // Creatures with swampwalk can be blocked as though they didn't have swampwalk.
        this.addAbility(new SimpleStaticAbility(new QuagmireEffect()));
    }

    private Quagmire(final Quagmire card) {
        super(card);
    }

    @Override
    public Quagmire copy() {
        return new Quagmire(this);
    }
}

class QuagmireEffect extends AsThoughEffectImpl {

    QuagmireEffect() {
        super(AsThoughEffectType.BLOCK_SWAMPWALK, Duration.WhileOnBattlefield, Outcome.Benefit);
        staticText = "Creatures with swampwalk can be blocked as though they didn't have swampwalk";
    }

    private QuagmireEffect(final QuagmireEffect effect) {
        super(effect);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        return true;
    }

    @Override
    public QuagmireEffect copy() {
        return new QuagmireEffect(this);
    }

    @Override
    public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
        return true;
    }
}
package mage.cards.q;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.effects.common.BecomesMonarchSourceEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.hint.common.MonarchHint;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.


ca.github.io/2017/10/14/super-fast-string-matching.html).

## Installing

`pip install string-grouper`

## Speed

**`string_grouper`** leverages the blazingly fast [sparse_dot_topn](https://github.com/ing-bank/sparse_dot_topn) libary
to calculate cosine similarities.

```python
s = datetime.datetime.now()
matches = match_strings(names['Company Name'], number_of_processes = 4)

e = datetime.datetime.now()
diff = (e - s)
str(diff)
```
Results in:

`00:05:34.65` On an Intel i7-6500U CPU @ 2.50GHz, where `len(names)` = 663 000

*in other words*,
the library is able to perform fuzzy matching of 663 000 names in _five and a half minutes_
on a 2015 consumer CPU using 4 cores.

## Simple Match

```python
import pandas as pd
from string_grouper import match_strings

company_names = 'sec__edgar_company_info.csv'
companies = pd.read_csv(company_names)
# Create all matches:
matches = match_strings(companies['Company Name'])
# Look at only the non-exact matches:
matches[matches['left_Company Name'] != matches['right_Company Name']].head()
```

|     |   left_index | left_Company Name                                           |   similarity | right_Company Name                      |   right_index |
|----:|-------------:|:------------------------------------------------------------|-------------:|:----------------------------------------|--------------:|
|  15 |           14 | 0210, LLC                                                   |     0.870291 | 90210 LLC                               |          4211 |
| 167 |          165 | 1 800 MUTUALS ADVISOR SERIES                                |     0.931615 | 1 800 MUTUALS ADVISORS SERIES           |           166 |
| 168 |          166 | 1 800 MUTUALS ADVISORS SERIES                               |     0.931615 | 1 800 MUTUALS ADVISOR SERIES            |           165 |
| 172 |          168 | 1 800 RADIATOR FRANCHISE INC                                |     1        | 1-800-RADIATOR FRANCHISE INC.           |           201 |
| 178 |          173 | 1 FINANCIAL MARKETPLACE SECURITIES LLC                  /BD |     0.949364 | 1 FINANCIAL MARKETPLACE SECURITIES, LLC |           174 |

## Group Similar Strings and Find most Common

```python
companies[["group-id", "name_deduped"]] = group_similar_strings(companies['Company Name'])
companies.groupby('name_deduped')['Line Number'].count().sort_values(ascending=False).head(10)
```
| name_deduped                                       |   Line Number |
|:---------------------------------------------------|--------------:|
| ADVISORS DISCIPLINED TRUST                         |          1747 |
| NUVEEN TAX EXEMPT UNIT TRUST SERIES 1              |           916 |
| GUGGENHEIM DEFINED PORTFOLIOS, SERIES 1200         |           652 |
| U S TECHNOLOGIES INC                               |           632 |
| CAPITAL MANAGEMENT LLC                             |           628 |
| CLAYMORE SECURITIES DEFINED PORTFOLIOS, SERIES 200 |           611 |
| E ACQUISITION CORP                                 |           561 |
| CAPITAL PARTNERS LP                                |           561 |
| FIRST TRUST COMBINED SERIES 1                      |           560 |
| PRINCIPAL LIFE INCOME FUNDINGS TRUST 20            |           544 |

## Documentation

The documentation can be found [here](https://bergvca.github.io/string_gr


 в реальном времени прогнозирует количество заказов по районам города на ближайшие часы, учитывая погоду, день недели, праздники. На основе этого расписание курьеров и их маршруты оптимизируются таким образом, чтобы курьеры были в нужном месте в нужное время и не простаивали. По сути, это объединение краткосрочного прогнозирования и динамического маршрутного планирования, обеспеченное алгоритмами ИИ. Подобные системы используются и в службах такси/ride-hailing (прогноз «где и когда будет всплеск спроса на поездки» для позиционирования водителей), и в продвинутых складах (прогноз объема заказов для распределения смен персонала).

* С точки зрения открытых решений, популярностью пользуются как коммерческие продукты (SAP IBP, Oracle Demantra с AI-модулями), так и **open-source библиотеки**. Например, Meta (Facebook) в 2017 г. открыла библиотеку **Prophet** – алгоритм прогнозирования на основе аддитивной модели, который хорошо зарекомендовал себя для бизнес-временных рядов с сезонностью. Сегодня существуют мощные Python-пакеты **Darts** и **GluonTS** (от Amazon), включающие реализацию множества моделей – от ARIMA до современных нейросетей – и облегчающие сравнение и ансамблирование прогнозов. Развивается сообщество вокруг библиотеки **StatsForecast/NeuralForecast** (Nixtla), предлагающей готовые state-of-the-art модели (N-BEATS, TFT и др.) с открытым кодом. Таким образом, даже относительно небольшие компании сегодня могут воспользоваться наработками больших техногигантов в области прогнозирования, не разрабатывая все с нуля.

**Достижения 2023–2025 гг.** Среди актуальных трендов – *усиление роли внешних данных* в прогнозировании. Алгоритмы стали учитывать не только собственные продажи, но и сигналы из соцсетей, поисковых трендов, погодных сервисов, мобильности населения и т.д., что ранее не использовалось традиционными методами. Это особенно важно для категорий товаров, чувствительных к внешним событиям (например, спрос на лекарства – к эпидемическим вспышкам, или спрос на одежду – к резким изменениям пог


x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f',
  '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77',
  '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f',
  '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87',
  '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f',
  '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97',
  '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f',
  '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7',
  '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf',
  '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7',
  '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf',
  '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
  '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf',
  '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
  '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf',
  '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7',
  '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef',
  '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7',
  '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff',
};

// Array of characters for the ascii_toupper() function. For values 'a'
// through 'z', return the upper-case character; otherwise, return the
// identity of the passed character.
const char kToUpper[256] = {
  '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
  '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
  '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
  '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
  '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27',
  '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f',
  '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37',
  '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d',


)=>o2(r,e);de.compileRe=(r,e,t=!1,i=!1)=>{if(t===!0)return r.output;let n=e||{},s=n.contains?"":"^",a=n.contains?"":"$",o=`${s}(?:${r.output})${a}`;r&&r.negated===!0&&(o=`^(?!${o}).*$`);let l=de.toRegex(o,e);return i===!0&&(l.state=r),l};de.makeRe=(r,e={},t=!1,i=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(n.output=kl.fastpaths(r,e)),n.output||(n=kl(r,e)),de.compileRe(n,e,t,i)};de.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};de.constants=l2;ng.exports=de});var og=x((p6,ag)=>{u();"use strict";ag.exports=sg()});var dg=x((d6,pg)=>{u();"use strict";var lg=(Fn(),Bn),ug=jm(),ot=og(),Al=qi(),fg=r=>r===""||r==="./",cg=r=>{let e=r.indexOf("{");return e>-1&&r.indexOf("}",e)>-1},oe=(r,e,t)=>{e=[].concat(e),r=[].concat(r);let i=new Set,n=new Set,s=new Set,a=0,o=f=>{s.add(f.output),t&&t.onResult&&t.onResult(f)};for(let f=0;f<e.length;f++){let d=ot(String(e[f]),{...t,onResult:o},!0),p=d.state.negated||d.state.negatedExtglob;p&&a++;for(let h of r){let b=d(h,!0);!(p?!b.isMatch:b.isMatch)||(p?i.add(b.output):(i.delete(b.output),n.add(b.output)))}}let c=(a===e.length?[...s]:[...n]).filter(f=>!i.has(f));if(t&&c.length===0){if(t.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(t.nonull===!0||t.nullglob===!0)return t.unescape?e.map(f=>f.replace(/\\/g,"")):e}return c};oe.match=oe;oe.matcher=(r,e)=>ot(r,e);oe.isMatch=(r,e,t)=>ot(e,t)(r);oe.any=oe.isMatch;oe.not=(r,e,t={})=>{e=[].concat(e).map(String);let i=new Set,n=[],s=o=>{t.onResult&&t.onResult(o),n.push(o.output)},a=new Set(oe(r,e,{...t,onResult:s}));for(let o of n)a.has(o)||i.add(o);return[...i]};oe.contains=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${lg.inspect(r)}"`);if(Array.isArray(e))return e.some(i=>oe.contains(r,i,t));if(typeof e=="string"){if(fg(r)||fg(e))return


      |
                              |      |      |------|  |------|      |      |
                              |      |      |Play1 |  |Play2 |      |      |
                              '--------------------'  '--------------------'
```

## Keymap 2: Left side -> LAYER_NUM,                             Right side -> Shift + LAYER_BASE

```
.--------------------------------------------------.  .--------------------------------------------------.
|        |      |      |      |      |  <>  |      |  | TG(1)|   &  |   *  |   (  |   )  |   -  |  Bspc  |
|--------+------+------+------+------+------+------|  |------+------+------+------+------+------+--------|
|        |  F12 |  F11 |  F10 |  F9  |  {}  |      |  |  _   |   J  |   L  |   U  |   Y  |   ;  |   \    |
|--------+------+------+------+------+------|      |  |      |------+------+------+------+------+--------|
|        |  F8  |  F7  |  F6  |  F5  |  ()  |------|  |------|   H  |   N  |   E  |   I  |   O  |  '     |
|--------+------+------+------+------+------|      |  |  }   |------+------+------+------+------+--------|
|        |  F4  |  F3  |  F2  |  F1  |  []  |      |  |      |K/RAlt|   M  |   ,  |./Supe|/ RCtl| RShift |
'--------+------+------+------+------+-------------'  '-------------+------+------+------+------+--------'
  | MUTE | VOLD | VOLU |      |      |                              | Left | Down | Up   |Right | Del  |
  '----------------------------------'                              '----------------------------------'
                                     .-------------.  .-------------.
                                     |      |      |  | Ins  |ScrLck|
                              .------+------+------|  |------+------+------.
                              |      |      |Start1|  | PgUp |      |      |
                              |      |      |------|  |------| Space|CapsLk|
                              |      |      |Play1 |  | PgDn |      |      |
                              '--------------------'  '--------------------'
```

## Keymap 3: Left side -> Shift + LAYER_BASE,                    Right side -> LAYER_NUM

```
.--------------------------------------------------.  .--------------------------------------------------.
| Grave  |   !  |   @  |   #  |   $  |   %  |   ^  |  |      |      |   *  |   (  |  )   |  -   |        |
|--------+------+------+------+------+------+------|  |------+------+------+------+------+------+--------|
| Tab    |   Q  |   W  |   F  |   P  |   G  |   =  |  |  =   |  =>  |   7  |   8  |   9  |  +   |        |
|--------+------+------+------+------+------|      |  |      |------+------+------+------+------+--------|
| Esc    |   A  |   R  |   S  |   T  |   D  |------|  |------|  ->  |   4  |   5  |   6  |  0   |        |
|--------+------+------+------+------+------|   {  |  | Enter|------+------+------+------+------+-


= newQChildEvent(event)

	gofunc((&QToolBar{h: self}).callVirtualBase_ChildEvent, slotval1)

}

func (this *QToolBar) callVirtualBase_CustomEvent(event *QEvent) {

	C.QToolBar_virtualbase_customEvent(unsafe.Pointer(this.h), event.cPointer())

}
func (this *QToolBar) OnCustomEvent(slot func(super func(event *QEvent), event *QEvent)) {
	ok := C.QToolBar_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
	if !ok {
		panic("miqt: can only override virtual methods for directly constructed types")
	}
}

//export miqt_exec_callback_QToolBar_customEvent
func miqt_exec_callback_QToolBar_customEvent(self *C.QToolBar, cb C.intptr_t, event *C.QEvent) {
	gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent), event *QEvent))
	if !ok {
		panic("miqt: callback of non-callback type (heap corruption?)")
	}

	// Convert all CABI parameters to Go parameters
	slotval1 := newQEvent(event)

	gofunc((&QToolBar{h: self}).callVirtualBase_CustomEvent, slotval1)

}

func (this *QToolBar) callVirtualBase_ConnectNotify(signal *QMetaMethod) {

	C.QToolBar_virtualbase_connectNotify(unsafe.Pointer(this.h), signal.cPointer())

}
func (this *QToolBar) OnConnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
	ok := C.QToolBar_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
	if !ok {
		panic("miqt: can only override virtual methods for directly constructed types")
	}
}

//export miqt_exec_callback_QToolBar_connectNotify
func miqt_exec_callback_QToolBar_connectNotify(self *C.QToolBar, cb C.intptr_t, signal *C.QMetaMethod) {
	gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
	if !ok {
		panic("miqt: callback of non-callback type (heap corruption?)")
	}

	// Convert all CABI parameters to Go parameters
	slotval1 := newQMetaMethod(signal)

	gofunc((&QToolBar{h: self}).callVirtualBase_ConnectNotify, slotval1)

}

func (this *QToolBar) callVirtualBase_DisconnectNotify(signal *QMetaMethod) {

	C.QToolBar_virtualbase_disconnectNotify(unsafe.Pointer(this.h), signal.cPointer())

}
func (this *QToolBar) OnDisconnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
	ok := C.QToolBar_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
	if !ok {
		panic("miqt: can only override virtual methods for directly constructed types")
	}
}

//export miqt_exec_callback_QToolBar_disconnectNotify
func miqt_exec_callback_QToolBar_disconnectNotify(self *C.QToolBar, cb C.intptr_t, signal *C.QMetaMethod) {
	gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
	if !ok {
		panic("miqt: callback of non-callback type (heap corruption?)")
	}

	// Convert all CABI parameters to Go parameters
	slotval1 := newQMetaMethod(signal)

	gofunc((&QToolBar


        input = input.replace(/fairshare/g, "/");
        input = input.replace(/income equality/g, "==");
        input = input.replace(/income inequality/g, "!=");
        input = input.replace(/too much money/g, ">");
        input = input.replace(/below the poverty line/g, "<")
        input = input.replace(/voting as/g, "=");
        input = input.replace(/here's the story/g, "def");
        input = input.replace(/give to the people/g, "return");
        input = input.replace(/to each citizen named/g, "for");
        input = input.replace(/in the working class/g, "in");
        input = input.replace(/sounds like trump/g, "False");
        input = input.replace(/sounds like bernie/g, "True");
        input = input.replace(/when bernie gets elected/g, "if");
        input = input.replace(/when you feel the bern/g, "elseif");
        input = input.replace(/otherwise/g, "else");
        input = input.replace(/bernie says/g, "print");
        input = input.replace(/let me be clear/g, "assert");
        input = input.replace(/long as wallstreet runs congress/g, "while");
        input = input.replace(/the one percent/g, "class");
        input = input.replace(/list/g, "corporation");
        input = input.replace(/dict/g, "billionaire");
        input = input.replace(/\$\|/g, "[");
        input = input.replace(/\|\$/g, "]");
        input = input.replace(/\$\$\|/g, "{");
        input = input.replace(/\|\$\$/g, "}");
        return input;
    }
    //implements special functions for BernieScript
    public static appendspecial(input:string) {
        if(input.search(/LetsBeFair/g)) {
            input += "\n";
            input += "def LetsBeFair(num1, num2):\n    if num1 > num2:\n        diff = num1 - num2\n        num1 -= diff\n        num1 += diff/2\n        num2 += diff/2\n        return num1, num2\n    elif num1 < num2:\n        diff = num2 - num1\n        num2 -= diff\n        num1 += diff/2\n        num2 += diff/2\n        return num1, num2\n\n";
            return input
        }
    }
    //transpiles python back
    public static pythontoBS(input:string) {

    }
}

console.log(Transpiler.transpile("bernie says pow(num):\n\tgive to the people 5 plus 6 minus 5 tax 3"));import type {Database} from "sqlite3";

import log from "../../log";
import path from "path";
import fs from "fs";
import Config from "../../config";
import Msg, {Message} from "../../models/msg";
import Client from "../../client";
import Chan, {Channel} from "../../models/chan";
import type {
	SearchResponse,
	SearchQuery,
	SqliteMessageStorage as ISqliteMessageStorage,
} from "./types";
import Network from "../../models/network";

// TODO; type
let sqlite3: any;

try {
	sqlite3 = require("sqlite3");
} catch (e: any) {
	Config.values.messageStorage = Config.values.messageStorage.filter((item) => item !== "sqlite");

	log.error(
		"Unable to load sqlite3 module. See https://github.com/mapbox/node-sqlite3/wiki/Binaries"
	);
}

const currentSchemaVersion = 1520239200;

const schema = [
	// Schema version #1
	"CREATE TABLE IF NOT EXISTS options (name TEXT, value TEXT, CONSTRAINT name_unique UNIQUE (name))",
	"CREATE TABLE IF NOT EXISTS messages (network TEXT, channel TEXT, time INTEGER, type TEXT, msg TEXT)",
	"CREATE IN


			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(codesnippet.FieldID, field.TypeUUID),
			},
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := wfu.mutation.RemovedSnippetsIDs(); len(nodes) > 0 && !wfu.mutation.SnippetsCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   workspacefile.SnippetsTable,
			Columns: []string{workspacefile.SnippetsColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(codesnippet.FieldID, field.TypeUUID),
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := wfu.mutation.SnippetsIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   workspacefile.SnippetsTable,
			Columns: []string{workspacefile.SnippetsColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(codesnippet.FieldID, field.TypeUUID),
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges.Add = append(_spec.Edges.Add, edge)
	}
	_spec.AddModifiers(wfu.modifiers...)
	if n, err = sqlgraph.UpdateNodes(ctx, wfu.driver, _spec); err != nil {
		if _, ok := err.(*sqlgraph.NotFoundError); ok {
			err = &NotFoundError{workspacefile.Label}
		} else if sqlgraph.IsConstraintError(err) {
			err = &ConstraintError{msg: err.Error(), wrap: err}
		}
		return 0, err
	}
	wfu.mutation.done = true
	return n, nil
}

// WorkspaceFileUpdateOne is the builder for updating a single WorkspaceFile entity.
type WorkspaceFileUpdateOne struct {
	config
	fields    []string
	hooks     []Hook
	mutation  *WorkspaceFileMutation
	modifiers []func(*sql.UpdateBuilder)
}

// SetUserID sets the "user_id" field.
func (wfuo *WorkspaceFileUpdateOne) SetUserID(u uuid.UUID) *WorkspaceFileUpdateOne {
	wfuo.mutation.SetUserID(u)
	return wfuo
}

// SetNillableUserID sets the "user_id" field if the given value is not nil.
func (wfuo *WorkspaceFileUpdateOne) SetNillableUserID(u *uuid.UUID) *WorkspaceFileUpdateOne {
	if u != nil {
		wfuo.SetUserID(*u)
	}
	return wfuo
}

// SetWorkspaceID sets the "workspace_id" field.
func (wfuo *WorkspaceFileUpdateOne) SetWorkspaceID(u uuid.UUID) *WorkspaceFileUpdateOne {
	wfuo.mutation.SetWorkspaceID(u)
	return wfuo
}

// SetNillableWorkspaceID sets the "workspace_id" field if the given value is not nil.
func (wfuo *WorkspaceFileUpdateOne) SetNillableWorkspaceID(u *uuid.UUID) *WorkspaceFileUpdateOne {
	if u != nil {
		wfuo.SetWorkspaceID(*u)
	}
	return wfuo
}

// SetPath sets the "path" field.
func (


EnemyPets', 1)
    SetCVar('nameplateShowEnemyTotems', 1)
    SetCVar('nameplateShowEnemyMinus', 1)
    SetCVar('nameplateShowFriendlyNPCs', 1)
    SetCVar('nameplateMotion', 1)
    SetCVar('nameplateMotionSpeed', 0.2)

    -- quest
    SetCVar('autoQuestWatch', 1)
    SetCVar('autoQuestProgress', 1)
    SetCVar('showQuestTrackingTooltips', 0) -- this is annoying

    -- hardcore
    SetCVar('overrideArchive', 0)
    SetCVar('violenceLevel', 5)

    -- graphical
    SetCVar('ffxGlow', 1)
    SetCVar('ffxDeath', 1)
    SetCVar('SkyCloudLOD', 3)

    -- camera
    SetCVar('cameraSmoothStyle', 0)
    SetCVar('cameraSmoothTrackingStyle', 0)
    SetCVar('cameraYawMoveSpeed', 120)
    SetCVar('cameraDistanceMaxZoomFactor', 2.6)
    SetCVar('cameraPivot', 0)

    -- screenshot
    SetCVar('screenshotQuality', 10)
    SetCVar('screenshotFormat', 'jpg')

    -- mouse
    SetCVar('rawMouseEnable', 1)

    -- actionbar
    SetCVar('countdownForCooldowns', 0)
    SetCVar('ActionButtonUseKeyDown', 1)
    SetCVar('secureAbilityToggle', 1)
    SetCVar('lockActionBars', 1)
    SetCVar('alwaysShowActionBars', 1)

    if C.IS_DEVELOPER then
        SetCVar('AutoPushSpellToActionBar', 0)
        SetCVar('cursorsizepreferred', 2)
        SetCVar('worldPreloadNonCritical', 0)
    end
end

local function UpdateUIScale()
    if C.SCREEN_HEIGHT > 1440 then
        _G.ANDROMEDA_ADB.UIScale = 2
    elseif C.SCREEN_HEIGHT > 1080 and C.SCREEN_HEIGHT < 1440 then
        _G.ANDROMEDA_ADB.UIScale = 1.4
    else
        _G.ANDROMEDA_ADB.UIScale = 1
    end
end

local function SetupActionbars() end

local function SetupChatFrame()
    CHAT:SetupSizeAndPosition()
end

local function SetupAddons() end

function TUTORIAL:HelloWorld()
    local f = CreateFrame('Frame', C.ADDON_TITLE .. 'InstallFrame', _G.UIParent, 'BackdropTemplate')
    f:SetSize(400, 400)
    f:SetPoint('CENTER')
    f:SetFrameStrata('HIGH')
    F.SetBD(f)

    local outline = _G.ANDROMEDA_ADB.FontOutline
    f.logo = F.CreateFS(f, C.ASSET_PATH .. 'fonts\\suez-one.ttf', 22, outline or nil, C.COLORFUL_ADDON_TITLE, nil, outline and 'NONE' or 'THICK', 'TOP', 0, -4)
    f.desc = F.CreateFS(f, C.Assets.Fonts.Regular, 10, outline or nil, 'installation', { 0.7, 0.7, 0.7 }, outline and 'NONE' or 'THICK', 'TOP', 0, -30)

    GUI:CreateGradientLine(f, 140, -70, -26, 70, -26)

    f.body = CreateFrame('Frame', nil, f, 'BackdropTemplate')
    f.body:SetSize(380, 304)
    f.body:SetPoint('TOPLEFT', 10, -50)
    f.body.__bg = F.CreateBDFrame(f.body, 0.25)

    local headerText = F.CreateFS(f.body, C.Assets.Fonts.Bold, 18, outline or nil, nil, { 242 / 255, 211 / 255, 104 / 255 }, outline and 'NONE' or 'THICK', 'TOPLEFT', 20, -16


# Mshta Executing from Registry
`//Mshta Executing from Registry
//Detects a Mshta executing code from the registry
//https://lolbas-project.github.io/lolbas/Binaries/Mshta/
//https://thedfirreport.com/2023/01/09/unwrapping-ursnifs-gifts
DeviceProcessEvents | where (ProcessCommandLine contains @'wscript.shell' and ProcessCommandLine contains @'new ActiveXObject' and ProcessCommandLine contains @'regread' and FolderPath endswith @'mshta.exe')`

# windows-commands- nslookup
`//https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nslookup
//https://thedfirreport.com/2023/01/09/unwrapping-ursnifs-gifts
DeviceProcessEvents | where (FolderPath endswith @'\nslookup.exe' and ProcessCommandLine contains @'127.0.0.1' and InitiatingProcessFolderPath endswith @'\cmd.exe' and InitiatingProcessCommandLine contains @'/c')`

# System Time Lookup
`//System Time Lookup - Detects use of time to look up the system time as part of host discovery
//https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/time
//https://thedfirreport.com/2023/01/09/unwrapping-ursnifs-gifts
DeviceProcessEvents | where (ProcessCommandLine contains @'/c' and ProcessCommandLine contains @'time' and FolderPath endswith @'\cmd.exe')`

# Ursnif Loader
`//Ursnif Loader
//Detects a very specific command the Ursnif loader runs.
//https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/time
//https://thedfirreport.com/2023/01/09/unwrapping-ursnifs-gifts
DeviceProcessEvents | where (ProcessCommandLine contains @'/C' and ProcessCommandLine contains @'pause dll mail' and FolderPath endswith @'syswow64\cmd.exe')`

# LOLBIN From Abnormal Drive
`//LOLBIN From Abnormal Drive - Detects LOLBINs executing from an abnormal drive such as a mounted ISO.
//https://thedfirreport.com/2021/12/13/diavol-ransomware/
//https://www.scythe.io/library/threat-emulation-qakbot
// Rare false positives could occur on servers with multiple drives.
DeviceProcessEvents | where ((* contains @'\rundll32.exe' or * contains @'\calc.exe' or * contains @'\mshta.exe' or * contains @'\cscript.exe' or * contains @'\wscript.exe' or * contains @'\regsvr32.exe' or * contains @'\installutil.exe' or * contains @'\cmstp.exe') and not ((CurrentDirectory contains @'C:\' or CurrentDirectory =~ @'') or isempty(CurrentDirectory)))`

# Detects Wscript or Cscript executing from a drive other than C
`//Detects Wscript or Cscript executing from a drive other than C. This has been observed with Qakbot executing from within a mounted ISO file.
//Wscript Execution from Non C Drive
 //https://github.com/pr0xylife/Qakbot/blob/main/Qakbot_BB_30.09.2022.txt
//https://app.any.run/tasks/4985c746-601e-401a-9ccf-ae350ac2e887/
//Legitimate applications installed on other partitions such as "D:"
DeviceProcessEvents | where (((FolderPath endswith @'\wscript.exe' or FolderPath endswith @'\cscript.exe') and (ProcessCommandLine contains @'.js' or ProcessCommandLine contains @'.vbs' or ProcessCommandLine contains @'.vbe') and ProcessCommandLine contains @':\') and not ((


WindowMac::MacIsReallyHilited()
{
    return true; // TODO
}

int wxWindowMac::GetCharHeight() const
{
    wxCoord height;
    GetTextExtent( wxT("g") , NULL , &height , NULL , NULL , NULL );

    return height;
}

int wxWindowMac::GetCharWidth() const
{
    wxCoord width;
    GetTextExtent( wxT("g") , &width , NULL , NULL , NULL , NULL );

    return width;
}

void wxWindowMac::DoGetTextExtent(const wxString& str,
                                  int *x, int *y,
                                  int *descent,
                                  int *externalLeading,
                                  const wxFont *theFont) const
{
    const wxFont *fontToUse = theFont;
    wxFont tempFont;
    if ( !fontToUse )
    {
        tempFont = GetFont();
        fontToUse = &tempFont;
    }

    wxGraphicsContext* ctx = wxGraphicsContext::Create();
    ctx->SetFont( *fontToUse, *wxBLACK );

    wxDouble h , d , e , w;
    ctx->GetTextExtent( str, &w, &h, &d, &e );

    delete ctx;

    if ( externalLeading )
        *externalLeading = (wxCoord)wxRound(e);
    if ( descent )
        *descent = (wxCoord)wxRound(d);
    if ( x )
        *x = (wxCoord)wxRound(w);
    if ( y )
        *y = (wxCoord)wxRound(h);
}

/*
 * Rect is given in client coordinates, for further reading, read wxTopLevelWindowMac::InvalidateRect
 * we always intersect with the entire window, not only with the client area
 */

void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect)
{
    if ( GetPeer() == NULL )
        return ;

    if ( !IsShownOnScreen() )
        return ;

    if ( IsFrozen() )
        return;

    GetPeer()->SetNeedsDisplay( rect ) ;
}

void wxWindowMac::DoFreeze()
{
    if ( GetPeer() && GetPeer()->IsOk() )
        GetPeer()->SetDrawingEnabled( false ) ;
}

void wxWindowMac::DoThaw()
{
    if ( GetPeer() && GetPeer()->IsOk() )
        GetPeer()->SetDrawingEnabled( true ) ;
}

wxWindow *wxGetActiveWindow()
{
    // actually this is a windows-only concept
    return NULL;
}

// Coordinates relative to the window
void wxWindowMac::WarpPointer(int x_pos, int y_pos)
{
#if wxOSX_USE_COCOA_OR_CARBON
    int x = x_pos;
    int y = y_pos;
    DoClientToScreen(&x, &y);
    CGPoint cgpoint = CGPointMake( x, y );
    CGWarpMouseCursorPosition( cgpoint );
    CGAssociateMouseAndMouseCursorPosition(true);

    // At least GTK sends a mouse moved event after WarpMouse
    wxMouseEvent event(wxEVT_MOTION);
    event.m_x = x_pos;
    event.m_y = y_pos;
    wxMouseState mState = ::wxGetMouseState();

    event.m_altDown = mState.AltDown();
    event.m_controlDown = mState.ControlDown();
    event.m_leftDown = mState.LeftIsDown();
    event.m_middleDown = mState.MiddleIsDown();
    event.m_rightDown = mState.RightIsDown();
    event.m_aux1Down = mState.Aux1IsDown();
    event.m_aux2Down = mState.Aux2IsDown();
    event.m_metaDown = mState.MetaDown();
    event.m_shiftDown = mState.ShiftDown();
    event.SetId(GetId());
    event.SetEventObject(this);
    GetEv


m>M is a non-negative integer. bmin is zero if emin
is non-negative and -(bmax+
     K
     1
     ) otherwise. The size of the smallest
bit-field large enough to hold all the values of the enumeration type is
max(M,1) if bmin is zero and M+1 otherwise. It is possible to define
an enumeration that has values not defined by any of its enumerators. If the
enumerator-list is empty, the values of the enumeration are as if the
enumeration had a single enumerator with value 0.

Leave <c- n>numeric_limits</c-> members [numeric.limits.members] ❡61 onwards as-is:

<c- k>static</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>is_modulo</c-><c- p>;</c->

true if the type is modulo. A type is modulo if, for any operation involving
<c- o>+</c->, <c- o>-</c->, or <c- o>*</c-> on values of that type whose result would fall outside the
range <c- p>[</c-><c- n>min</c-><c- p>(),</c-> <c- n>max</c-><c- p>()]</c->, the value returned differs from the true value by
an integer multiple of <c- n>max</c-><c- p>()</c-> <c- o>-</c-> <c- n>min</c-><c- p>()</c-> <c- o>+</c-> <c- mi>1</c->.

[Example:<c- n>is_modulo</c-> is false for signed integer types unless an
implementation, as an extension to this document, defines signed integer
overflow to wrap. —end example]

Meaningful for all specializations.

Modify Type properties [meta.unary.prop] ❡9 as follows:

The predicate condition for a template specialization <c- n>has_unique_object_representations</c-><c- o><</c-><c- n>T</c-><c- o>></c-> shall be satisfied if and only if:

<c- n>T</c-> is trivially copyable, and

any two objects of type <c- n>T</c-> with the same value have the same object
representation, where two objects of array or non-union class type are
considered to have the same value if their respective sequences of direct
subobjects have the same values, and two objects of union type are
considered to have the same value if they have the same active member and
the corresponding members have the same value.

     The set of scalar types for which this condition holds is implementation-defined.
[Note: If a type has padding bits, the condition does not hold; otherwise, the
condition holds true for
     <c- b>bool</c->, signed, and
     unsigned integral types.
—end note]


   }
        return userByUid;
    }

    @Override
    public List<CfUser> findByPhoneOrUidOrName(String key) {
        CfUser cfUser = null;
        if (Pattern.matches("^[0-9_]{19}$", key)) {
            cfUser = getUserByUid(key, false);
        }
        if (Pattern.matches("^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))[0-9]{8}$", key) && cfUser == null) {
            cfUser = findByPhone(key);
        } else if (cfUser == null) {
            cfUser = findByUserName(key);
        }

        if (cfUser != null) {
            cfUser.setPassword("");
            cfUser.setBirthday(0L);
            cfUser.setCreateTime(0L);
            cfUser.setEmail("");
            cfUser.setPhone("");
            cfUser.setTrueName("");
            ArrayList<CfUser> cfUsers = new ArrayList<>();
            cfUsers.add(cfUser);
            return cfUsers;
        }
        return null;
    }

    @Override
    public List<CfUser> selectListByCondition(Map<String, Map<String, Object>> conditions, Map<String, String> allowFiledsMap, List<String> allowFileds) {
        String sql = "SELECT u.id,u.user_name,u.avatar,u.type,u.nick_name,u.true_name,u.phone,u.email,u.birthday,u.sex,u.sign,u.create_time FROM cf_user u";
        int counts = 0;

        for (String field: allowFileds){
            if(conditions.containsKey(field)){
                String key = field;
                Map<String, Object> conditionValue = conditions.get(key);
                String andStr = counts == 0 ? " WHERE " : " AND ";
                counts++;

                if(conditionValue.get("operator").equals("=") || conditionValue.get("operator").equals(">") || conditionValue.get("operator").equals(">=")
                        || conditionValue.get("operator").equals("<") || conditionValue.get("operator").equals("<=") || conditionValue.get("operator").equals("!=")){
                    if(conditionValue.get("value") instanceof Integer){
                        sql += andStr+allowFiledsMap.get(key)+"."+key+conditionValue.get("operator")+conditionValue.get("value");
                    }else{
                        sql += andStr+allowFiledsMap.get(key)+"."+key+conditionValue.get("operator")+"'"+conditionValue.get("value")+"'";
                    }
                }else if(conditionValue.get("operator").equals("between")){
                    sql += andStr+allowFiledsMap.get(key)+"."+key+">="+(Long)conditionValue.get("min")+
                            " AND "+allowFiledsMap.get(key)+"."+key+"<="+(Long)conditionValue.get("max");
                }else if(conditionValue.get("operator").equals("like")){
                    Map<String, Object> likeList = (Map<String, Object>) conditionValue.get("list");
                    for(Map.Entry<String, Object> entry: likeList.entrySet()){
                        String entryKey = entry.getKey();
                        if(allowFiledsMap.containsKey(entryKey)){
                            int likeCounts = 0;
                            Map<String, Object> likeItems = (Map<String, Object>) entry.getValue();
                            for(Map.Entry<String, Object> likeItemsEntry: likeItems.entrySet()){
                                Map<String,String> likeItemsEntryValue = (Map<String,String>)likeItemsEntry.getValue();
                                if(likeCounts==0) {
                                    sql += andStr+"(" + likeItemsEntryValue.get("


_EQ(x7, x8, 0x00000000)

    # Testcase 26:  rs1:x4(0xc1458794), rs2:x21(0x3f800000), result rd:x26(0x4f414588)
    li  x4, MASK_XLEN(0xc1458794)
    fcvt.s.wu f26, x4, rup
    csrrci x7, fcsr, 0x1F
    sw x7, 8(x6)
    fmv.x.w x8, f26
    fsw f26, 12(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x4f414588)

    # Testcase 27:  rs1:x3(0xc61a5229), rs2:x20(0x4c50e7e7), result rd:x27(0x4f461a53)
    li  x3, MASK_XLEN(0xc61a5229)
    fcvt.s.wu f27, x3, rup
    csrrci x7, fcsr, 0x1F
    sw x7, 16(x6)
    fmv.x.w x8, f27
    fsw f27, 20(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x4f461a53)

    # Testcase 28:  rs1:x2(0x4c50e7e7), rs2:x19(0xc61a5229), result rd:x28(0x4e98a1d0)
    li  x2, MASK_XLEN(0x4c50e7e7)
    fcvt.s.wu f28, x2, rup
    csrrci x7, fcsr, 0x1F
    sw x7, 24(x6)
    fmv.x.w x8, f28
    fsw f28, 28(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x4e98a1d0)

    # Testcase 29:  rs1:x1(0x3f800000), rs2:x18(0xc1458794), result rd:x29(0x4e7e0000)
    li  x1, MASK_XLEN(0x3f800000)
    fcvt.s.wu f29, x1, rup
    csrrci x7, fcsr, 0x1F
    sw x7, 32(x6)
    fmv.x.w x8, f29
    fsw f29, 36(x6)
    RVMODEL_IO_ASSERT_GPR_EQ(x7, x8, 0x4e7e0000)

    RVTEST_SIGBASE(x1,signature_7_0)

    # Testcase 30:  rs1:x0(0x3a2b48ef), rs2:x17(0x00000000), result rd:x30(0x00000000)
    li  x0, MASK_XLEN(0x3a2b48ef)
    fcvt.s.wu f30, x0, rup
    csrrci x2, fcsr, 0x1F
    sw x2, 0(x1)
    fmv.x.w x3, f30
    fsw f30, 4(x1)
    RVMODEL_IO_ASSERT_GPR_EQ(x2, x3, 0x00000000)

#endif

RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
.align 4
rvtest_data:
.word 0xbabecafe

# Input data section.
	.data

RVTEST_DATA_END

RVMODEL_DATA_BEGIN

signature_1_0:
	.fill 5, 8, 0xdeadbeef
signature_2_0:
	.fill 5, 8, 0xdeadbeef
signature


//
// sunnet project
// Copyright (C) 2018 by Contributors <https://github.com/Tyill/sunnet>
//
// This code is licensed under 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.
//
#pragma once

/// тип ф-ии активации
enum class activeType{
    none = -1,
    sigmoid = 0,
    relu = 1,
    leakyRelu = 2,
    elu = 3,
};

/// тип инициализации весов
enum class weightInitType{
    uniform = 0,
    he = 1,
    lecun = 2,
    xavier = 3,
};

/// тип оптимизации весов
enum class optimizerType{
    sgd = 0,
    sgdMoment = 1,
    adagrad = 2,
    RMSprop = 3,
    adam = 4,
};

/// batchNorm
enum class batchNormType{
    none = -1,
    beforeActive = 0,
    postActive = 1,
};

/// pooling
enum class poolType{
    max = 0,
    avg = 1,
};

// loss
enum class lossType{
    softMaxACrossEntropy = 0,
    binaryCrossEntropy = 1,
    regressionMSE = 2,
    userLoss = 3,
};


 least once already');
        console.log(event, context);
        return 'invocation skipped';
      }
    }
  }
}
import { PDFDocument, BlendMode } from "pdf-lib";

export async function createReport(
  baseDoc: PDFDocument,
  headersPdfBuffer: Uint8Array,
  headerHeight: number,
  footerHeight: number
) {
  const headerDoc = await PDFDocument.load(headersPdfBuffer);

  const basePages = baseDoc.getPages();
  const headerPages = headerDoc.getPages();

  const hasBoth = !!headerHeight && !!footerHeight;

  // get pages dimensions
  const x = basePages[0].getWidth();
  const y = basePages[0].getHeight();

  // 1 inch = 96 px
  // PDF unit =  inch * 72/1
  const pdfHeaderHeight = (headerHeight / 96) * 72;
  const pdfFooterHeight = (footerHeight / 96) * 72;

  // embed all headers pdf pages in the base pdf
  const pages = [];
  const boxes = [];

  for (let i = 1; i <= headerPages.length; i++) {
    pages.push(headerPages[i - 1]);

    const isOdd = i % 2 != 0;

    // have only header or
    // have both header and footer and we are in odd pages
    // 1, 3, 5, etc
    if (headerHeight && (!hasBoth || isOdd)) {
      boxes.push({
        bottom: y - pdfHeaderHeight,
        left: 0,
        right: x,
        top: y!,
      });
    }

    // have only footer or
    // have both header and footer and we are in plural pages
    // 2, 4, 6, etc
    if (footerHeight && (!hasBoth || !isOdd)) {
      boxes.push({
        bottom: y - pdfFooterHeight,
        left: 0,
        right: x,
        top: y!,
      });
    }
  }

  const embeddedPages = await baseDoc.embedPages(pages, boxes);

  // draw headers and/or footers over the base pages
  let baseIndex = 0;
  for (let i = 1; i <= headerPages.length; i++) {
    const embeddedPage = embeddedPages[i - 1];
    const size = embeddedPage.size();
    const isOdd = i % 2 != 0;

    if (headerHeight && (!hasBoth || isOdd)) {
      basePages[baseIndex].drawPage(embeddedPage, {
        ...size,
        x: x - size.width,
        y: y - size.height,
        blendMode: BlendMode.Multiply
      });
    }

    if (footerHeight && (!hasBoth || !isOdd)) {
      basePages[baseIndex].drawPage(embeddedPage, {
        ...size,
        x: x - size.width,
        y: 0,
        blendMode: BlendMode.Multiply
      });
    }

    // when we have both header and footer
    // two pages of headers pdf belong to one page of the base doc
    //  ------------
    // |  header 1  |
    // |            |        ------------
    // |            |       |  header 1  |
    //  ------------     => | xxxxxxxxxx |
    // |  footer 1  |       |  footer 1  |
    // |            |        ------------
    // |            |
    if (hasBoth && !isOdd) {
      baseIndex++;
    } else if (!hasBoth) {
      baseIndex++;
    }
  }

  return await baseDoc.save();
}
/**
 * @since 1.0.0
 */
import * as fc from 'fast-check'
import { option, ord } from 'fp-ts'
import { pipe } from 'fp-ts/lib/pipeable'

import { Enum } from './Enum'

/**
 * @since 1.0.0
 */
export const getEnumLaws = <A>(
  E: Enum<A>,
  arb: fc.Arbitrary<A>
): Record<string, fc.IProperty<unknown>> => ({
  // each successor should be greater than its predecessor
  'next is greater than previous': fc.property(arb, (a) =>
    pipe(
      E.next(a),
      option.map((b) => ord.gt(E)(b, a))


9B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * General page setup
 */
#dt_example {
	font: 80%/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
	margin: 0;
	padding: 0;
	color: #333;
	background-color: #fff;
}

#dt_example #container {
	width: 800px;
	margin: 30px auto;
	padding: 0;
}

#dt_example #footer {
	margin: 50px auto 0 auto;
	padding: 0;
}

#dt_example #demo {
	margin: 30px auto 0 auto;
}

#dt_example .demo_jui {
	margin: 30px auto 0 auto;
}

#dt_


    D0,D5
      AND.L     #$7FFF8000,D0
      JSR       L066F
      MOVE.L    D0,D6
      AND.L     #$7FFE,D5
      MOVE.L    L05B7,D0
      AND.L     #$7FFF8000,D0
      JSR       L066F
      MOVE.L    D0,D7
      MOVEQ     #0,D3
      MOVEQ     #0,D4
      LEA       L14FF,A0
      MOVE.W    L0593,D0
L0C1A:TST.B     1(A0)
      BEQ.S     L0C1B
      TST.L     D3
      BNE       L0C1E
      MOVE.W    6(A0),D3
      EXT.L     D3
      TST.W     L0BD3
      BEQ.S     L0C1C
      OR.L      #$10000,D3
L0C1B:ADDQ.L    #8,A0
      DBF       D0,L0C1A
      NOP
L0C1C:ADD.L     D3,D6
      ADD.L     D3,D7
      MOVE.L    D6,D0
      MOVEA.L   A5,A0
      BSR       L0C5B
      MOVEA.L   A5,A0
      ADDA.L    D5,A0
      MOVE.L    #$8000,D0
      SUB.L     D5,D0
      BSR       L0C53
      TST.W     D0
      BMI       L0C29
      ADD.L     D1,L0F66
      BSR       L09EB
      MOVE.L    L0584,D5
      ADD.L     D5,D6
      CMP.L     D6,D7
      BLE       L0C28
L0C1D:MOVE.L    D6,D0
      MOVEA.L   A5,A0
      BSR       L0C5B
      MOVEA.L   A5,A0
      MOVE.L    #$8000,D0
      BSR       L0C53
      TST.W     D0
      BMI       L0C29
      ADD.L     D1,L0F66
      BSR       L09EB
      ADD.L     D5,D6
      CMP.L     D6,D7
      BGT.S     L0C1D
      MOVE.L    D6,D0
      MOVEA.L   A5,A0
      BSR       L0C5B
      MOVEA.L   A5,A0
      MOVE.L    L05B7,D0
      AND.L     #$7FFE,D0
      BSR       L0C53
      TST.W     D0
      BMI       L0C29
      ADD.L     D1,L0F66
      BSR       L09EB
      BSR       L097B
      BRA       L0C28
L0C1E:MOVE.W    6(A0),D4
      EXT.L     D4
      AND.L     #$FFFF,D3
      ADD.L     D6,D4
      ADD.L     D3,D6
      ADD.L     D3,D7
      ADD.L     D5,D5
      MOVE.L    D6,D0
      MOVEA.L   A5,A0
      BSR       L0C5B
      MOVE.L    D4,D0
      MOVEA.L   A6,A0
      BSR       L0C5B
      MOVEA.L   A5,A0
      MOVEA.L   A6,A1
      MOVEA.L   A4,A2
      BSR       L0C63


10px;
  box-shadow: 0 2px 5px 0 rgba(214, 212, 212, 0.8), 0 2px 10px 0 rgba(0, 0, 0, 0.12); }

/* ONLY NARROWER ACTION */
.card-container-narrower-action {
  margin: 10px 10px; }

.card-container-narrower-action amexio-action-ce {
  margin: -10px 10px;
  box-shadow: 0 2px 5px 0 rgba(214, 212, 212, 0.8), 0 2px 10px 0 rgba(0, 0, 0, 0.12); }

/* ONLY WIDER HEADER */
.card-container-wider-header {
  margin: 0px 10px; }

.card-container-wider-header amexio-header-ce {
  margin: 0px -10px;
  box-shadow: 0 2px 5px 0 rgba(214, 212, 212, 0.8), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  z-index: 2; }

.card-container-narrower-header {
  margin: 10px 10px; }

.card-container-narrower-header amexio-header-ce {
  margin: -10px 10px;
  box-shadow: 0 2px 5px 0 rgba(214, 212, 212, 0.8), 0 2px 10px 0 rgba(0, 0, 0, 0.12); }

.ce-header-ribbon-l {
  border-color: transparent var(--componentHeaderBGColor) transparent transparent;
  left: -20px; }

.ce-header-ribbon-r {
  border-color: transparent transparent transparent var(--componentHeaderBGColor);
  right: -20px; }

.ce-header-ribbon {
  border-style: solid;
  border-width: 10px;
  height: 0px;
  width: 0px;
  position: absolute;
  top: -10px; }

.card-container-ribbon-style amexio-header-ce {
  box-shadow: none; }

.card-container-ribbon-style .card-container-body {
  overflow: unset; }

/** creative card - Structure CSS **/
.card-ce-overflowhidden {
  overflow: hidden; }

.card-ce-overlay-fadeeffect:hover {
  opacity: 1;
  transition: all 2s ease-in-out; }

/* fading effect */
.card-ce-overlay-fadeeffect {
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: .5s ease;
  transition-duration: 3s; }

/* sliding effect  */
.card-ce-overlay-slideeffect {
  transform: translateX(-300%);
  transition: all 0.3s ease-in-out; }

.card-ce-overlay-slideeffect-hover {
  transform: translateX(0%);
  transition-delay: 500ms;
  background-color: var(--componentHoverBGColor);
  color: var(--componentFontColor); }

.maincontainer {
  position: relative;
  /* width: 250px;
  height: 320px; */
  background: none;
  /* top: 50%;
  left: 50%; */
  /* transform: translate(-50%, -50%); */ }

.card-container-ce-main {
  /* position: relative; */
  position: relative;
  top: 0;
  left: 0;
  height: 100%; }

.card-container-ce-main-flip:hover .card-container-ce-flip {
  transform: rotateY(180deg); }
.card-container-ce-main-flip:hover .ce-flip-card-back {
  overflow: auto; }

.card-container-ce-flip {
  transition: transform 0.6s;
  transform-style: preserve-3d; }

.ce-flip-card-front, .ce-flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  -moz-transform-style: preserve-3d; }

.ce-flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column; }

.card-container-ce-main-zoom:hover {
  -ms-transform: scale(1.2);
  /* IE 9 */
  -webkit-transform: scale(1.2);


	// here.
		m.viewport = viewport.New(msg.Width, msg.Height-verticalMarginHeight)
		m.ready = true
	} else {
		m.viewport.Width = msg.Width
		m.viewport.Height = msg.Height - verticalMarginHeight
	}
}

func (m *model) View() string {
	if m.chosen {
		selected := m.table.SelectedRow()
		if selected != nil {
			if !m.ready {
				return "\n  Initializing..."
			}
			return fmt.Sprintf("%s\n%s\n%s", m.headerView(), m.viewport.View(), m.footerView())
		} else {
			return "failed"
		}
	} else {
		var s string
		if !m.staticRecord {
			s += fmt.Sprintf("\n %s Events received: %d/%d\n\n", m.spinner.View(), len(m.table.Rows()), m.options.MaxRecords)
		} else {
			s += fmt.Sprintf("\n Events Num: %d\n\n", len(m.table.Rows()))
		}
		return s + rc.BaseTableStyle.Render(m.table.View()) + "\n  " + m.table.HelpView() + "\n"
	}
}
func (m model) headerView() string {
	title := titleStyle.Render(fmt.Sprintf("Record Detail: %d (Total: %d)", m.table.Cursor()+1, len(m.table.Rows())))
	line := strings.Repeat("─", max(0, m.viewport.Width-lipgloss.Width(title)))
	return lipgloss.JoinHorizontal(lipgloss.Center, title, line)
}

func (m model) footerView() string {
	info := infoStyle.Render(fmt.Sprintf("%3.f%%", m.viewport.ScrollPercent()*100))
	line := strings.Repeat("─", max(0, m.viewport.Width-lipgloss.Width(info)))
	return lipgloss.JoinHorizontal(lipgloss.Center, line, info) + "\n" + m.help.View(detailViewKeyMap)
}

type watchKeyMap rc.KeyMap

var (
	titleStyle = func() lipgloss.Style {
		b := lipgloss.RoundedBorder()
		b.Right = "├"
		return lipgloss.NewStyle().BorderStyle(b).Padding(0, 1)
	}()

	infoStyle = func() lipgloss.Style {
		b := lipgloss.RoundedBorder()
		b.Left = "┤"
		return titleStyle.BorderStyle(b)
	}()

	detailViewKeyMap = watchKeyMap{
		"n": key.NewBinding(
			key.WithKeys("n"),
			key.WithHelp("n", "next"),
		),
		"p": key.NewBinding(
			key.WithKeys("p"),
			key.WithHelp("p", "previous"),
		),
	}
)

func (k watchKeyMap) ShortHelp() []key.Binding {
	return []key.Binding{detailViewKeyMap["n"], detailViewKeyMap["p"]}
}

func (k watchKeyMap) FullHelp() [][]key.Binding {
	result := [][]key.Binding{}
	result = append(result, []key.Binding{detailViewKeyMap["n"], detailViewKeyMap["p"]})
	sortkeys := []key.Binding{}
	for idx := range cols {
		if idx == 0 {
			continue
		}
		sortkeys = append(sortkeys, sortKeyMap[fmt.Sprintf("%d", idx)])
	}
	result = append(result, sortkeys)
	return result
}

func RunWatchRender(ctx context.Context, ch chan *common.AnnotatedRecord, options WatchOptions) {
	if options.DebugOutput {
		for {
			select {
			case <-ctx.Done():
				return
			case r := <-ch:
				c.BPFEventLog.Warnln(r.String(common.AnnotatedRecordToStringOptions{
					Nano: false,
					MetricTypeSet: common.MetricTypeSet{
						common.ResponseSize:                 false,
						common.Re


/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "ETSI-ITS-CDD"
 * 	found in "asn1/release2/TS102894-2v221-CDD.asn"
 * 	`asn1c -fcompound-names -fincludes-quoted -no-gen-example -fprefix=Vanetza_ITS2_ -R`
 */

#ifndef	_Vanetza_ITS2_SequenceOfSafeDistanceIndication_H_
#define	_Vanetza_ITS2_SequenceOfSafeDistanceIndication_H_

#include "asn_application.h"

/* Including external dependencies */
#include "asn_SEQUENCE_OF.h"
#include "constr_SEQUENCE_OF.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Forward declarations */
struct Vanetza_ITS2_SafeDistanceIndication;

/* Vanetza_ITS2_SequenceOfSafeDistanceIndication */
typedef struct Vanetza_ITS2_SequenceOfSafeDistanceIndication {
	A_SEQUENCE_OF(struct Vanetza_ITS2_SafeDistanceIndication) list;

	/* Context for parsing across buffer boundaries */
	asn_struct_ctx_t _asn_ctx;
} Vanetza_ITS2_SequenceOfSafeDistanceIndication_t;

/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_Vanetza_ITS2_SequenceOfSafeDistanceIndication;
extern asn_SET_OF_specifics_t asn_SPC_Vanetza_ITS2_SequenceOfSafeDistanceIndication_specs_1;
extern asn_TYPE_member_t asn_MBR_Vanetza_ITS2_SequenceOfSafeDistanceIndication_1[1];
extern asn_per_constraints_t asn_PER_type_Vanetza_ITS2_SequenceOfSafeDistanceIndication_constr_1;

#ifdef __cplusplus
}
#endif

/* Referred external types */
#include "SafeDistanceIndication.h"

#endif	/* _Vanetza_ITS2_SequenceOfSafeDistanceIndication_H_ */
#include "asn_internal.h"


 steps3 = [0]
  const res3 = checkValidLoops(end3, initials3, steps3)
  expect(res3).toEqual(false)
})
import options from '../config/options';
import { applyRef } from '../utils';
import { IS_NON_DIMENSIONAL } from '../core/constants';

/**
 * A DOM event listener
 * @typedef {(e: Event) => void} EventListner
 */

/**
 * A mapping of event types to event listeners
 * @typedef {Object.<string, EventListener>} EventListenerMap
 */
/**
 * Properties Preact adds to elements it creates
 * @typedef PreactElementExtensions
 * @property {string} [normalizedNodeName] A normalized node name to use in diffing
 * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node
 * @property {import('../component').Component} [_component] The component that rendered this DOM node
 * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node
 */

/**
 * A DOM element that has been extended with Preact properties
 * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement
 */

/**
 * Create an element with the given nodeName.
 * @param {string} nodeName The DOM node to create
 * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG
 *  namespace.
 * @returns {PreactElement} The created DOM node
 */
export function createNode(nodeName, isSvg) {
  /** @type {PreactElement} */
  let node = isSvg
    ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)
    : document.createElement(nodeName);
  node.normalizedNodeName = nodeName;
  return node;
}

/**
 * Remove a child node from its parent if attached.
 * @param {Node} node The node to remove
 */
export function removeNode(node) {
  let parentNode = node.parentNode;
  if (parentNode) parentNode.removeChild(node);
}

/**
 * Set a named attribute on the given Node, with special behavior for some names
 * and event handlers. If `value` is `null`, the attribute/handler will be
 * removed.
 * @param {PreactElement} node An element to mutate
 * @param {string} name The name/key to set, such as an event or attribute name
 * @param {*} old The last value that was set for this name/node pair
 * @param {*} value An attribute value, such as a function to be used as an
 *  event handler
 * @param {boolean} isSvg Are we currently diffing inside an svg?
 * @private
 */
export function setAccessor(node, name, old, value, isSvg) {
  if (name === 'className') name = 'class';

  if (name === 'key') {
    // ignore
  } else if (name === 'ref') {
    applyRef(old, null);
    applyRef(value, node);
  } else if (name === 'class' && !isSvg) {
    node.className = value || '';
  } else if (name === 'style') {
    if (!value || typeof value === 'string' || typeof old === 'string') {
      node.style.cssText = value || '';
    }
    if (value && typeof value === 'object') {
      if (typeof old !== 'string')


IEFmZ2hhbnM= 48336
SmFtaWU= 48337
YXJldHo= 48338
IEF1Z3VzdHVz 48339
IDM4Ng== 48340
ODMw 48341
IGpvZw== 48342
b2tpbmdseQ== 48343
VHJpZ2dlcg== 48344
IEhPUg== 48345
U3RhdGlzdGljcw== 48346
IHZpZXdlcnNoaXA= 48347
IGFkZGl0aXZlcw== 48348
aHVy 48349
IG1heGltaXppbmc= 48350
IFJvdmU= 48351
IExvdWll 48352
IEJ1Y2tldA== 48353
IENIUklTVA== 48354
b3VzZWw= 48355
IHN0cmVha3M= 48356
aXJ0ZWQ= 48357
IHRlcnQ= 48358
IGNvbG9uaWFsaXNt 48359
IGJ1cnlpbmc= 48360
eWs= 48361
Q29uZGl0aW9u 48362
IERQUks= 48363
QnlJZA== 48364
NzUx 48365
4pe8 48366
IHdvcnJpc29tZQ== 48367
IHZvY2F0aW9uYWw= 48368
c2xpY2U= 48369
IHNhaWxz 48370
IENvcnJlY3Rpb25hbA== 48371
OTU0 48372
IHR1bA== 48373
S2lk 48374
bHVzdGVy 48375
IGZhbWlsaWFs 48376
IFNwaXQ= 48377
IEVwaXNjb3BhbA== 48378
U3BlY2lmaWNhbGx5 48379
IFZvbGNhbm8= 48380
cnVucw== 48381
cXM= 48382
IHZldHRlZA== 48383
IGNyYW1tZWQ= 48384
dHJvcA== 48385
aGVyZXI= 48386
VGhhbmtmdWxseQ== 48387
IHBlcmN1c3Npb24= 48388
IG9yYW5nZXM= 48389
IHJvdW5kdXA= 48390
IDQ5OQ== 48391
eGlvdXM= 48392
Q2hhcmFjdGVycw== 48393
IFppb25pc20= 48394
IFJhbw== 48395
w5vDmw== 48396
V0Y= 48397
IHVuaW50ZW50aW9uYWw= 48398
T05FWQ== 48399
R3JhYg== 48400
Q29tbWVyY2lhbA== 48401
IGdsdXRhbWF0ZQ== 48402
IE1jS2VubmE= 48403
cnVjaWF0aW5n 48404
bmluZ3Rvbg== 48405
aWh1 48406
Q2hhbg== 48407
IFN3YXA= 48408
IGxlYWZsZXRz 48409
IGZ1bmN0aW9uYWxseQ== 48410
ZXJvdXM= 48411
RmFybQ== 48412
IGNhbG9yaWM= 48413
IExpdGVyYWxseQ== 48414
Y29uY2VydA== 48415
IHNoZW5hbg== 48416
IHJlcGFpZA== 48417
ZXllcw== 48418
IGJhc2hpbmc= 48419
IEdvcmdl 48420
IGNvbGxhYm9yYXRpb25z 48421
IHVuYWNjb3VudA== 48422
aXRjaGll 48423
IHRlYW13b3Jr 48424
cHBlbGlu 48425
IHBpcGluZw== 48426
IG1pbmNlZA== 48427
IGRpYW0= 48428
cmllZw== 48429
IG1hc2NhcmE= 48430
IHN


ntMetadata,
			"token introspection authn method not allowed")
	}
	return nil
}

func validateOpenIDScopeIfRequired(ctx oidc.Context, meta *goidc.ClientMeta) error {
	if !ctx.OpenIDIsRequired {
		return nil
	}

	if !strutil.ContainsOpenID(meta.ScopeIDs) {
		return goidc.NewError(goidc.ErrorCodeInvalidClientMetadata,
			"scope openid is required")
	}

	return nil
}

func validateSubjectIdentifierType(ctx oidc.Context, meta *goidc.ClientMeta) error {
	if meta.SubIdentifierType == "" {
		return nil
	}

	if !slices.Contains(ctx.SubIdentifierTypes, meta.SubIdentifierType) {
		return goidc.NewError(goidc.ErrorCodeInvalidClientMetadata,
			"subject_type not supported")
	}
	return nil
}

func validateSubIdentifierPairwise(ctx oidc.Context, meta *goidc.ClientMeta) error {

	isPairwise := meta.SubIdentifierType == "" && ctx.DefaultSubIdentifierType == goidc.SubIdentifierPairwise
	isPairwise = isPairwise || meta.SubIdentifierType == goidc.SubIdentifierPairwise
	if !isPairwise {
		return nil
	}

	// When the sector identifier uri is not provided, and the client is using
	// the authorization code or implicit grant types, it is necessary to enforce
	// restrictions on redirect URIs.
	//
	// The logic performs the following steps:
	// 1. Check if SectorIdentifierURI is empty and if the client uses the
	//    authorization code or implicit grant type.
	// 2. Extract the host component of each Redirect URI, ensuring no duplicates.
	// 3. Verify that all Redirect URIs share the same host as this violates the
	// 	  requirements for pairwise sub identifiers without a sector identifier uri.
	if meta.SectorIdentifierURI == "" && slices.ContainsFunc(meta.GrantTypes, func(gt goidc.GrantType) bool {
		return gt == goidc.GrantAuthorizationCode || gt == goidc.GrantImplicit
	}) {
		var redirectURIHosts []string
		for _, ru := range meta.RedirectURIs {
			parsedRU, _ := url.Parse(ru)
			if !slices.Contains(redirectURIHosts, parsedRU.Host) {
				redirectURIHosts = append(redirectURIHosts, parsedRU.Host)
			}
		}
		if len(redirectURIHosts) != 1 {
			return goidc.NewError(goidc.ErrorCodeInvalidClientMetadata,
				"all redirect URIs must share the same host when using pairwise subject identifier type without specifying a sector identifier uri")
		}
	}

	// If the CIBA grant type is used with non-push modes, `jwks_uri` is required.
	// Also, make sure 'jwks_uri' ownership will be validated at the /bc-authorize
	// endpoint via one of these methods:
	//    - 'private_key_jwt' for token authentication.
	//    - 'self_signed_tls_client_auth' for token authentication.
	//    - Usage of signed request objects.
	if slices.Contains(meta.GrantTypes, goidc.GrantCIBA) && meta.CIBATokenDeliveryMode != goidc.CIBATokenDeliveryModePush {
		if meta.PublicJWKSURI == "" {
			return goidc.NewError(goidc.ErrorCodeInvalidClientMetadata,
				"the 'jwks_uri' is required for CIBA with non-push delivery modes when using pairwise sub type")
		}

		jwksURIOwnershipIsGuaranteed := meta.TokenAuthnMethod == goidc.ClientAuthnPrivateKeyJWT
		jwksURIOwnershipIsGuaranteed = jwksURIOwnershipIsGuaranteed || meta.TokenAuthnMethod == go


adlockCycle".to_string(),
                reasoning: "No deadlock cycle detected in resource allocation according to Rust concurrency rules".to_string(),
            });
        } else {
            reasoning.add_error(ConcurrencyError::Deadlock {
                cycle: self.extract_deadlock_cycle(&resource_graph),
                reason: "Deadlock cycle detected in resource allocation, causing system hang".to_string(),
            });
        }

        // 检查锁顺序一致性
        if self.has_consistent_lock_ordering(&synchronization_points) {
            reasoning.add_lock_ordering_reasoning(LockOrderingReasoning {
                ordering: self.extract_lock_ordering(&synchronization_points),
                reasoning_type: "ConsistentLockOrdering".to_string(),
                reasoning: "Consistent lock ordering prevents deadlocks according to Rust concurrency rules".to_string(),
            });
        } else {
            reasoning.add_error(ConcurrencyError::InconsistentLockOrdering {
                ordering: self.extract_lock_ordering(&synchronization_points),
                reason: "Inconsistent lock ordering may cause deadlocks according to Rust concurrency rules".to_string(),
            });
        }

        reasoning
    }
}
```

---

## 4. Conclusion and Advanced Reasoning System Synthesis - 结论和高级推理系统综合

### 4.1 Advanced Reasoning System Achievement Summary - 高级推理系统成就总结

#### 4.1.1 Advanced Reasoning System Achievement Metrics - 高级推理系统成就指标

| Advanced Reasoning System Category - 高级推理系统类别 | Achievement Level - 成就水平 | Quality Grade - 质量等级 | Strategic Impact - 战略影响 |
|---------------------------------------------------|---------------------------|----------------------|-------------------------|
| **Ownership Reasoning System Achievement - 所有权推理系统成就** | 99.9% | Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐ | Revolutionary - 革命性 |
| **Memory Safety Reasoning System Achievement - 内存安全推理系统成就** | 99.7% | Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐ | Transformative - 变革性 |
| **Concurrency Safety Reasoning System Achievement - 并发安全推理系统成就** | 99.5% | Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐ | Significant - 显著 |
| **Lifetime Reasoning System Achievement - 生命周期推理系统成就** | 99.2% | Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐ | Notable - 值得注意 |
| **Type Safety Reasoning System Achievement - 类型安全推理系统成就** | 99.8% | Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐ | Important - 重要 |

### 4.2 Future Advanced Reasoning System Vision - 未来高级推理系统愿景

#### 4.2.1 Strategic Advanced Reasoning System Outlook - 战略高级推理系统展望

The Rust Formal Theory Project's advanced formal reasoning system establishes new industry standards for theoretical reasoning construction, practical reasoning implementation, cross-domain reasoning integration, and global reasoning collaboration, ensuring the highest levels of reasoning excellence and future readiness.

Rust形式化理论项目的高级形式化推理系统为理论推理构建、实践证明实施、跨领域推理集成和全球推理协作建立了新的行业标准，确保最高水平的推理卓越性和未来就绪性。

---

**Document Version - 文档版本**: 2.0
**Last Updated - 最后更新**: 2025-01-27
**Quality Grade - 质量等级**: Diamond Elite ⭐⭐⭐⭐⭐⭐⭐⭐
**International Standards Compliance - 国际标准合规性**: 99.8%
**Bilingual Content Quality - 双语内容质量**: 99.5%
**Engineering Validation Coverage - 工程验证覆盖**: 99.2%
**Knowledge Completeness - 知识完备性**: 99.


        val href = getProperAnimeLink(fixUrl(this.selectFirst("a")!!.attr("href")))
        val title = this.select("h4").text().trim()
        val posterUrl = fixUrl(this.select("img").attr("data-src"))

        return newAnimeSearchResponse(title, href, TvType.Anime) {
            this.posterUrl = posterUrl
            addDubStatus(dubExist = false, subExist = true)
        }

    }

    override suspend fun search(query: String): List<SearchResponse> {
        val link = "$mainUrl/?s=$query"
        val document = app.get(link).document

        return document.select(".result > ul > li").mapNotNull {
            val title = it.selectFirst("h2")!!.text().trim()
            val poster = it.selectFirst("img")!!.attr("src")
            val tvType = getType(
                it.selectFirst(".boxinfores > span.typeseries")!!.text().toString()
            )
            val href = fixUrl(it.selectFirst("a")!!.attr("href"))

            newAnimeSearchResponse(title, href, tvType) {
                this.posterUrl = poster
                addDubStatus(dubExist = false, subExist = true)
            }
        }
    }

    private data class EpResponse(
        @JsonProperty("posts") val posts: String?,
        @JsonProperty("max_page") val max_page: Int?,
        @JsonProperty("found_posts") val found_posts: Int?,
        @JsonProperty("content") val content: String
    )

    override suspend fun load(url: String): LoadResponse {
        val document = app.get(url).document

        val title = document.selectFirst("h1.entry-title.cs")!!.text().trim()
        val poster = document.selectFirst(".poster > img")?.attr("data-src")
        val tags = document.select(".tagline > a").map { it.text() }

        val year = Regex("\\d, ([0-9]*)").find(
            document.select(".bottomtitle > span:nth-child(5)").text()
        )?.groupValues?.get(1)?.toIntOrNull()
        val status = getStatus(
            document.select("span.statusseries").text().trim()
        )
        val type = getType(document.select("span.typeseries").text().trim())
        val rating = document.select("span.nilaiseries").text().trim().toIntOrNull()
        val description = document.select(".entry-content.seriesdesc > p").text().trim()
        val trailer = document.selectFirst("iframe#traileryt")?.attr("data-src")

        val episodes = if (document.select("button.buttfilter").isNotEmpty()) {
            val id = document.select("input[name=series_id]").attr("value")
            val numEp =
                document.selectFirst(".latestepisode > a")?.text()?.replace(Regex("[^0-9]"), "")
                    .toString()
            Jsoup.parse(
                app.post(
                    url = "$mainUrl/wp-admin/admin-ajax.php",
                    data = mapOf(
                        "misha_number_of_results" to numEp,
                        "misha_order_by" to "date-DESC",
                        "action" to "mishafilter",
                        "series_id" to id
                    )
                ).parsed<EpResponse>().content
            ).select("li").map {
                val name = Regex("(Episode\\s?[0-9]+)").find(
                    it.selectFirst("a")?.text().toString()
                )?.groupValues?.getOrNull(0) ?: it.selectFirst("a")?.text()
                val link = fixUrl(it.selectFirst("a")!!.attr("href"))
                Episode(link, name)
            }.reversed()
        } else {
            document.select("ul.misha_posts_wrap2 > li").map {
                val name = Regex("(Episode\\s?[0-


 err
	}

	if truncate {
		// Going back in time with IntervalId * MaxSample isn't always far enough,
		// depending on when the historical data is saved in vCenter.
		// So we go back twice as far and truncate here if needed.
		for i := range series {
			s, ok := series[i].(*types.PerfEntityMetric)
			if !ok {
				break
			}

			n := len(s.SampleInfo)
			diff := n - int(spec.MaxSample)
			if diff > 0 {
				s.SampleInfo = s.SampleInfo[diff:]
			}

			for j := range s.Value {
				v, ok := s.Value[j].(*types.PerfMetricIntSeries)
				if !ok {
					break
				}

				n = len(v.Value)
				diff = n - int(spec.MaxSample)
				if diff > 0 {
					v.Value = v.Value[diff:]
				}
			}
		}
	}

	return series, nil
}

// MetricSeries contains the same data as types.PerfMetricIntSeries, but with the CounterId converted to Name.
type MetricSeries struct {
	Name     string  `json:"name"`
	Unit     string  `json:"unit"`
	Instance string  `json:"instance"`
	Value    []int64 `json:"value"`
}

func (s *MetricSeries) Format(val int64) string {
	switch types.PerformanceManagerUnit(s.Unit) {
	case types.PerformanceManagerUnitPercent:
		return strconv.FormatFloat(float64(val)/100.0, 'f', 2, 64)
	default:
		return strconv.FormatInt(val, 10)
	}
}

// ValueCSV converts the Value field to a CSV string
func (s *MetricSeries) ValueCSV() string {
	vals := make([]string, len(s.Value))

	for i := range s.Value {
		vals[i] = s.Format(s.Value[i])
	}

	return strings.Join(vals, ",")
}

// EntityMetric contains the same data as types.PerfEntityMetric, but with MetricSeries type for the Value field.
type EntityMetric struct {
	Entity types.ManagedObjectReference `json:"entity"`

	SampleInfo []types.PerfSampleInfo `json:"sampleInfo"`
	Value      []MetricSeries         `json:"value"`
}

// SampleInfoCSV converts the SampleInfo field to a CSV string
func (m *EntityMetric) SampleInfoCSV() string {
	vals := make([]string, len(m.SampleInfo)*2)

	i := 0

	for _, s := range m.SampleInfo {
		vals[i] = s.Timestamp.Format(time.RFC3339)
		i++
		vals[i] = strconv.Itoa(int(s.Interval))
		i++
	}

	return strings.Join(vals, ",")
}

// ToMetricSeries converts []BasePerfEntityMetricBase to []EntityMetric
func (m *Manager) ToMetricSeries(ctx context.Context, series []types.BasePerfEntityMetricBase) ([]EntityMetric, error) {
	counters, err := m.CounterInfoByKey(ctx)
	if err != nil {
		return nil, err
	}

	var result []EntityMetric

	for i := range series {
		var values []MetricSeries
		s, ok := series[i].(*types.PerfEntityMetric)
		if !ok {
			panic(fmt.Errorf("expected type %T, got: %T", s, series[i]))
		}

		for j := range s.Value {
			v := s.Value[j].(*types.PerfMetricIntSeries)
			info, ok := counters[v.Id.CounterId]
			if !ok {
				continue
			}

			values = append(values, MetricSeries{
				Name:     info.Name(),
				Unit:     info.UnitInfo.GetElementDescription().Key,
				Instance: v.Id.Instance,
				Value:    v.Value,
			})
		}

		result = append(result, EntityMetric{
			Entity:     s.Entity,
			SampleInfo


 Container(
                                          padding: const EdgeInsets.symmetric(
                                              vertical: 12, horizontal: 16),
                                          child: Text(e),
                                        ),
                                      ))
                                  .toList()),
                        ),
                      );
                    },
                    icon: const Icon(Icons.more_vert))
              ],
            ),
          ),
          Container(
            width: double.infinity,
            padding: const EdgeInsets.only(top: 8),
            child: RichText(
              text: TextSpan(
                  style: const TextStyle(color: Colors.black),
                  children: [
                    TextSpan(
                        text: 'username',
                        style: const TextStyle(
                          fontWeight: FontWeight.bold,
                        )),
                    TextSpan(text: ' Hey guys description')
                  ]),
            ),
          ),
          SizedBox(
              height: deviceHeight * 0.35,
              width: double.infinity,
              child: Image.network(
                  'https://cdn.pixabay.com/photo/2015/04/19/08/32/marguerite-729510_1280.jpg')),
          Row(
            children: [
              IconButton(
                  onPressed: () {},
                  icon: const Icon(
                    Icons.favorite,
                    color: Colors.red,
                  )),
              IconButton(
                  onPressed: () {},
                  icon: const Icon(
                    Icons.comment_outlined,
                  )),
            ],
          ),
          Container(
            padding: const EdgeInsets.symmetric(horizontal: 16),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text("1,610 likes", style: TextStyle(color: Colors.grey)),
                InkWell(
                  onTap: () {},
                  child: Container(
                    padding: const EdgeInsets.symmetric(vertical: 4),
                    child: Text(
                      'View all 100 comments',
                      style: TextStyle(fontSize: 13, color: Colors.grey),
                    ),
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    ));
  }
}
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'dart:ui' as ui;

import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_hbb/main.dart';
import 'package:flutter_hbb/utils/multi_window_manager.dart';
import 'package:get/get.dart';

import '../../models/model.dart';
import '../../models/platform_model.dart';
import '../common.dart';
import '../consts.dart';

/// Mouse button enum.
enum MouseButtons { left, right, wheel, back }

const _kMouseEventDown = 'mousedown';
const _kMouseEventUp = 'mouseup';
const _kMouseEventMove = 'mousemove';

class CanvasCoords {
  double x = 0;
  double y = 0;
  double scale = 1.0;
  double scrollX = 0;
  double scrollY = 0;
  ScrollStyle scrollStyle = ScrollStyle.scrollauto;
  Size size = Size.zer


l chars using the last 5 bits of each byte.
            // Consume 3 MSB bits 5 bytes at a time.

            do
            {
                b0 = (i < l) ? buff[i++] : (byte)0;
                b1 = (i < l) ? buff[i++] : (byte)0;
                b2 = (i < l) ? buff[i++] : (byte)0;
                b3 = (i < l) ? buff[i++] : (byte)0;
                b4 = (i < l) ? buff[i++] : (byte)0;

                // Consume the 5 Least significant bits of each byte
                sb.Append(s_Base32Char[b0 & 0x1F]);
                sb.Append(s_Base32Char[b1 & 0x1F]);
                sb.Append(s_Base32Char[b2 & 0x1F]);
                sb.Append(s_Base32Char[b3 & 0x1F]);
                sb.Append(s_Base32Char[b4 & 0x1F]);

                // Consume 3 MSB of b0, b1, MSB bits 6, 7 of b3, b4
                sb.Append(s_Base32Char[(
                        ((b0 & 0xE0) >> 5) |
                        ((b3 & 0x60) >> 2))]);

                sb.Append(s_Base32Char[(
                        ((b1 & 0xE0) >> 5) |
                        ((b4 & 0x60) >> 2))]);

                // Consume 3 MSB bits of b2, 1 MSB bit of b3, b4

                b2 >>= 5;

                if ((b3 & 0x80) != 0)