href="/podcast" class="sc-469abd6c-2 bMfUXc">Die besten Streaming-Tipps gibt's im Moviepilot-Podcast Streamgestöber

Originaltitel:
Star Trek: The Motion Picture

Star Trek - Der Film ist ein Science Fiction-Film aus dem Jahr 1979 von Robert Wise mit William Shatner und Leonard Nimoy.

In Star Trek - Der Film, dem ersten Kinofilm aus dem von Gene Roddenberry kreierten Universum, verschlägt es William Shatner als Captain Kirk und Leonard Nimoy als Mr. Spock in die unendlichen Weiten des Weltraums.

Aktueller Trailer zu Star Trek - Der Film

Komplette Handlung und Informationen zu Star Trek - Der Film

Die außergewöhnlichen Ereignisse des ersten Star Trek-Abenteuers in Spielfilmlänge werfen bereits im Prolog ihren Schatten in Form einer gigantischen Energiewolke voraus. Diese verschlingt nicht nur mit Leichtigkeit ein klingonisches Geschwader, bestehend aus drei Kreuzern, sondern veranlasst ebenfalls die Zerstörung des Föderationsaußenposten Epsilon IX. Um die drohende Gefahr zu bannen und die unaufhaltsame Gewalt des übernatürlichen Phänomens in seine Schra


 carry += (limb & 0x03FFFFFF) * 19 + x[index];
            x[index] = carry & 0x03FFFFFF;
            limb >>= 26;
            carry >>= 26;
        }
        if (size < NUM_LIMBS_255BIT) {
            // The high order half of the number is short; e.g. for mulA24().
            // Propagate the carry through the rest of the low order part.
            for (int index = size; index < NUM_LIMBS_255BIT; ++index) {
                carry += x[index];
                x[index] = carry & 0x03FFFFFF;
                carry >>= 26;
            }
        }

        // The "j" value may still be too large due to the final carry-out.
        // We must repeat the reduction.  If we already have the answer,
        // then this won't do any harm but we must still do the calculation
        // to preserve the overall timing.  The "j" value will be between
        // 0 and 19, which means that the carry we care about is in the
        // top 5 bits of the highest limb of the bottom half.
        carry = (x[NUM_LIMBS_255BIT - 1] >> 21) * 19;
        x[NUM_LIMBS_255BIT - 1] &= 0x001FFFFF;
        for (int index = 0; index < NUM_LIMBS_255BIT; ++index) {
            carry += x[index];
            result[index] = carry & 0x03FFFFFF;
            carry >>= 26;
        }

        // At this point "x" will either be the answer or it will be the
        // answer plus (2^255 - 19).  Perform a trial subtraction to
        // complete the reduction process.
        reduceQuick(result);
    }

    /**
     * Reduces a number modulo 2^255 - 19 where it is known that the
     * number can be reduced with only 1 trial subtraction.
     *
     * @param x The number to reduce, and the result.
     */
    private void reduceQuick(final int[] x) {
        // Perform a trial subtraction of (2^255 - 19) from "x" which is
        // equivalent to adding 19 and subtracting 2^255.  We add 19 here;
        // the subtraction of 2^255 occurs in the next step.
        int carry = 19;
        for (int index = 0; index < NUM_LIMBS_255BIT; ++index) {
            carry += x[index];
            t2[index] = carry & 0x03FFFFFF;
            carry >>= 26;
        }

        // If there was a borrow, then the original "x" is the correct answer.
        // If there was no borrow, then "t2" is the correct answer.  Select the
        // correct answer but do it in a way that instruction timing will not
        // reveal which value was selected.  Borrow will occur if bit 21 of
        // "t2" is zero.  Turn the bit into a selection mask.
        final int mask = -((t2[NUM_LIMBS_255BIT - 1] >> 21) & 0x01);
        final int nmask = ~mask;
        t2[NUM_LIMBS_255BIT - 1] &= 0x001FFFFF;
        for (int index = 0; index < NUM_LIMBS_255BIT; ++index)
            x[index] = (x[index] & nmask) | (t2[index] & mask);
    }

    /**
     * Squares a number modulo 2^255 - 19.
     *
     * @param result The result.
     * @param x      The number to square.
     */
    private void square(final int[] result, final int[] x) {
        mul(result, x, x);
    }
}
package io.reproto.example;

import com.fasterxml.jackson.databind.ObjectMapper;
import ex.github.gists.v3.Gist;
import ex.github.service.v3.Github;
import io.reproto.JacksonSupport;
import okhttp3.OkHttpClient;

public class Full {
    public static void main(String[] argv) throws Exception {
        final Ok


ractiveViewer] and provides callbacks that are called when a
/// horizontal boundary has been hit.
///
/// The callbacks are called when an interaction ends by listening to the
/// [InteractiveViewer.onInteractionEnd] callback.
class InteractiveViewerBoundary extends StatefulWidget {
  const InteractiveViewerBoundary({
    required this.child,
    required this.boundaryWidth,
    this.controller,
    this.onScaleChanged,
    this.onLeftBoundaryHit,
    this.onRightBoundaryHit,
    this.onNoBoundaryHit,
    this.maxScale,
    this.minScale,
    Key? key,
  }) : super(key: key);

  final Widget child;

  /// The max width this widget can have.
  ///
  /// If the [InteractiveViewer] can take up the entire screen width, this
  /// should be set to `MediaQuery.of(context).size.width`.
  final double boundaryWidth;

  /// The [TransformationController] for the [InteractiveViewer].
  final TransformationController? controller;

  /// Called when the scale changed after an interaction ended.
  final ScaleChanged? onScaleChanged;

  /// Called when the left boundary has been hit after an interaction ended.
  final VoidCallback? onLeftBoundaryHit;

  /// Called when the right boundary has been hit after an interaction ended.
  final VoidCallback? onRightBoundaryHit;

  /// Called when no boundary has been hit after an interaction ended.
  final VoidCallback? onNoBoundaryHit;

  final double? maxScale;

  final double? minScale;

  @override
  InteractiveViewerBoundaryState createState() =>
      InteractiveViewerBoundaryState();
}

class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary> {
  TransformationController? _controller;

  double? _scale;

  @override
  void initState() {
    super.initState();

    _controller = widget.controller ?? TransformationController();
  }

  @override
  void dispose() {
    _controller!.dispose();

    super.dispose();
  }

  void _updateBoundaryDetection() {
    final double scale = _controller!.value.row0[0];

    if (_scale != scale) {
      // the scale changed
      _scale = scale;
      widget.onScaleChanged?.call(scale);
    }

    if (scale <= 1.01) {
      // cant hit any boundaries when the child is not scaled
      return;
    }

    final double xOffset = _controller!.value.row0[3];
    final double boundaryWidth = widget.boundaryWidth;
    final double boundaryEnd = boundaryWidth * scale;
    final double xPos = boundaryEnd + xOffset;

    if (boundaryEnd.round() == xPos.round()) {
      // left boundary hit
      widget.onLeftBoundaryHit?.call();
    } else if (boundaryWidth.round() == xPos.round()) {
      // right boundary hit
      widget.onRightBoundaryHit?.call();
    } else {
      widget.onNoBoundaryHit?.call();
    }
  }

  @override
  Widget build(BuildContext context) {
    return InteractiveViewer(
      maxScale: widget.maxScale!,
      minScale: widget.minScale!,
      transformationController: _controller,
      onInteractionEnd: (_) => _updateBoundaryDetection(),
      child: widget.child,
    );
  }
}
import 'dart:async';

import 'package:flutter/material.dart';

class ForwardSeekIndicator extends StatefulWidget {
  final void Function(Duration) onChanged;
  final void Function(Duration) onSubmitted;


### Zygote与system_server的bootstrap流程

每个Android人员都知道Zygote会fork出Android中Java世界的所有进程，而对于system_server，它也不例外，如下图所示。

![](https://mmbiz.qpic.cn/sz_mmbiz_png/otTC1bvhCayUUcFL8kLQN13WM8ibHeLePaBhmRQvWKPc9gEaYaS6Ekhib7vKqQ1sPu5G4A7NANbpumob9BmFDMibw/640?wx_fmt=png&from=appmsg "null")

zygoteandsystemserver

Zygote进程实际上从system_server中接收指令，并根据指令孵化出子进程。这是通过
ZygoteServer.java中的poll机制来实现的：
```
 Runnable runSelectLoop(String abiList) {
 //...
 if (pollIndex == 0) {
                        // Zygote server socket
                        ZygoteConnection newPeer = acceptCommandPeer(abiList);
                        peers.add(newPeer);
                        socketFDs.add(newPeer.getFileDescriptor());
                    } else if (pollIndex < usapPoolEventFDIndex) {
                        // Session socket accepted from the Zygote server socket

                        try {
                            ZygoteConnection connection = peers.get(pollIndex);
                            boolean multipleForksOK = !isUsapPoolEnabled()
                                    && ZygoteHooks.isIndefiniteThreadSuspensionSafe();
                            final Runnable command =
                                    connection.processCommand(this, multipleForksOK);

                            // TODO (chriswailes): Is this extra check necessary?
                            if (mIsForkChild) {
                                // We're in the child. We should always have a command to run at


e: *const c_char) -> *mut FILE {
    unimplemented!();
}

/// Put a character `c` into `stream`
#[no_mangle]
pub extern "C" fn putc(c: c_int, stream: &mut FILE) -> c_int {
    flockfile(stream);
    let ret = putc_unlocked(c, stream);
    funlockfile(stream);
    ret
}

/// Put a character `c` into `stdout`
#[no_mangle]
pub unsafe extern "C" fn putchar(c: c_int) -> c_int {
    fputc(c, &mut *stdout)
}

/// Put a character `c` into `stream` without locking `stream`
#[no_mangle]
pub extern "C" fn putc_unlocked(c: c_int, stream: &mut FILE) -> c_int {
    if c as i8 != stream.buf_char && stream.wpos < stream.wend {
        unsafe {
            *stream.wpos = c as u8;
            stream.wpos = stream.wpos.add(1);
            c
        }
    } else {
        if stream.wend.is_null() && stream.can_write() {
            -1
        } else if c as i8 != stream.buf_char && stream.wpos < stream.wend {
            unsafe {
                *stream.wpos = c as u8;
                stream.wpos = stream.wpos.add(1);
                c
            }
        } else if stream.write(&[c as u8]) != 1 {
            -1
        } else {
            c
        }
    }
}

/// Put a character `c` into `stdout` without locking `stdout`
#[no_mangle]
pub unsafe extern "C" fn putchar_unlocked(c: c_int) -> c_int {
    putc_unlocked(c, &mut *stdout)
}

/// Put a string `s` into `stdout`
#[no_mangle]
pub unsafe extern "C" fn puts(s: *const c_char) -> c_int {
    let ret = (fputs(s, &mut *stdout) > 0) || (putchar_unlocked(b'\n' as c_int) > 0);
    if ret {
        0
    } else {
        -1
    }
}

/// Put an integer `w` into `stream`
#[no_mangle]
pub extern "C" fn putw(w: c_int, stream: &mut FILE) -> c_int {
    use core::mem;
    fwrite(&w as *const i32 as _, mem::size_of_val(&w), 1, stream) as i32 - 1
}

/// Delete file or directory `path`
#[no_mangle]
pub extern "C" fn remove(path: *const c_char) -> c_int {
    let r = platform::unlink(path);
    if r == -errno::EISDIR {
        platform::rmdir(path)
    } else {
        r
    }
}

#[no_mangle]
pub extern "C" fn rename(old: *const c_char, new: *const c_char) -> c_int {
    // This function requires a rename syscall, which currently is not in platform.
    unimplemented!();
}

/// Rewind `stream` back to the beginning of it
#[no_mangle]
pub extern "C" fn rewind(stream: &mut FILE) {
    fseeko(stream, 0, SEEK_SET);
    flockfile(stream);
    stream.flags &= !F_ERR;
    funlockfile(stream);
}

/// Reset `stream` to use buffer `buf`. Buffer must be `BUFSIZ` in length
#[no_mangle]
pub extern "C" fn setbuf(stream: &mut FILE, buf: *mut c_char) {
    unsafe {
        setvbuf(
            stream,


r.show_about = function () {
	try {
		frappe.ui.misc.about();
	} catch (e) {
		console.log(e);
	}
	return false;
};

frappe.ui.toolbar.route_to_user = function () {
	frappe.set_route("Form", "User", frappe.session.user);
};

frappe.ui.toolbar.view_website = function () {
	let website_tab = window.open();
	website_tab.opener = null;
	website_tab.location = "/index";
};

frappe.ui.toolbar.setup_session_defaults = function () {
	let fields = [];
	frappe.call({
		method: "frappe.core.doctype.session_default_settings.session_default_settings.get_session_default_values",
		callback: function (data) {
			fields = JSON.parse(data.message);
			let perms = frappe.perm.get_perm("Session Default Settings");
			//add settings button only if user is a System Manager or has permission on 'Session Default Settings'
			if (frappe.user_roles.includes("System Manager") || perms[0].read == 1) {
				fields[fields.length] = {
					fieldname: "settings",
					fieldtype: "Button",
					label: __("Settings"),
					click: () => {
						frappe.set_route(
							"Form",
							"Session Default Settings",
							"Session Default Settings"
						);
					},
				};
			}
			frappe.prompt(
				fields,
				function (values) {
					//if default is not set for a particular field in prompt
					fields.forEach(function (d) {
						if (!values[d.fieldname]) {
							values[d.fieldname] = "";
						}
					});
					frappe.call({
						method: "frappe.core.doctype.session_default_settings.session_default_settings.set_session_default_values",
						args: {
							default_values: values,
						},
						callback: function (data) {
							if (data.message == "success") {
								frappe.show_alert({
									message: __("Session Defaults Saved"),
									indicator: "green",
								});
								frappe.ui.toolbar.clear_cache();
							} else {
								frappe.show_alert({
									message: __(
										"An error occurred while setting Session Defaults"
									),
									indicator: "red",
								});
							}
						},
					});
				},
				__("Session Defaults"),
				__("Save")
			);
		},
	});
};
frappe.provide("frappe.views");

frappe.ui.GroupBy = class {
	constructor(report_view) {
		this.report_view = report_view;
		this.page = report_view.page;
		this.doctype = report_view.doctype;
		this.make();
	}

	make() {
		this.make_group_by_button();
		this.init_group_by_popover();
		this.set_popover_events();
	}

	init_group_by_popover() {
		const sql_aggregate_functions = [
			{ name: "count", label: __("Count") },
			{ name: "sum", label: __("Sum") },
			{ name: "avg", label: __("Average") },
		];

		const group_by_template = $(
			frappe.render_template("group_by", {
				doctype: this.doctype,
				group_by_conditions: this.get_group_by_fields(),
				aggregate_function_conditions: sql_aggregate_functions,


 [cfe] The operator '+' isn't defined for the type 'void'.

  x.toString(); // param_toString
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  x?.toString(); // param_null_dot
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  x..toString(); // param_cascade
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  if (x) {} // param_conditional_stmt
  //  ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  !x; // param_boolean_negation
  // [error column 4, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  x && true; // param_boolean_and_left
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  true && x; // param_boolean_and_right
  //      ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  x || true; // param_boolean_or_left
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  true || x; // param_boolean_or_right
  //      ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  x == 3; // param_equals_left
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  3 == x; // param_equals_right
  //   ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  identical(3, x); // param_identical
  //           ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  3 + x; // param_addition
  //  ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  3 * x; // param_multiplication
  //  ^
  // [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
  // [cfe] This expression has type 'void' and can't be used.

  -x; // param_negation
  // [error column 3, length 1]
  // [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
  // [cfe] The operator 'unary-' isn't defined for the type 'void'.


cc-9.1.0/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/finclude"
.LASF4:
        .string "./example.cpp"
        .ident  "GCC: (Compiler-Explorer-Build) 9.1.0"
        .section        .note.GNU-stack,"",@progbits


d
        this.addAbility(CompleatedAbility.getInstance());

        // +1: Create an X/X green Phyrexian Horror creature token, where X is Nissa, Ascended Animist's loyalty.
        this.addAbility(new LoyaltyAbility(new NissaAscendedAnimistEffect(), 1));

        // -1: Destroy target artifact or enchantment.
        Ability ability = new LoyaltyAbility(new DestroyTargetEffect(), -1);
        ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
        this.addAbility(ability);

        // -7: Until end of turn, creatures you control get +1/+1 for each Forest you control and gain trample.
        ability = new LoyaltyAbility(new BoostControlledEffect(
                xValue, xValue, Duration.EndOfTurn,
                StaticFilters.FILTER_PERMANENT_CREATURE,
                false
        ).setText("until end of turn, creatures you control get +1/+1 for each Forest you control"), -7);
        ability.addEffect(new GainAbilityControlledEffect(
                TrampleAbility.getInstance(), Duration.EndOfTurn,
                StaticFilters.FILTER_PERMANENT_CREATURE
        ).setText("and gain trample"));
        this.addAbility(ability.addHint(hint));
    }

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

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

class NissaAscendedAnimistEffect extends OneShotEffect {

    NissaAscendedAnimistEffect() {
        super(Outcome.Benefit);
        staticText = "create an X/X green Phyrexian Horror creature token, where X is {this}'s loyalty";
    }

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

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

    @Override
    public boolean apply(Game game, Ability source) {
        int loyalty = Optional
                .ofNullable(source.getSourcePermanentOrLKI(game))
                .filter(Objects::nonNull)
                .map(permanent -> permanent.getCounters(game))
                .map(counters -> counters.getCount(CounterType.LOYALTY))
                .orElse(0);
        return new PhyrexianHorrorGreenToken(loyalty).putOntoBattlefield(1, game, source);
    }
}

package mage.cards.n;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.BountyAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.target.TargetPlayer;

/**
 *
 * @author Styxo
 */
public final class NoviceBountyHunter extends CardImpl {

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

        // <i>Bounty</i> — Whenever a creature an opponent controls with a bounty counter on it dies, Novice Bounty Hunter deals 2 damge to target player.
        Ability ability = new BountyAbility(new DamageTargetEffect(2));
        ability.addTarget(new TargetPlayer());
        this.addAbility(ability);
    }


using System;

namespace UniRx.Operators
{
    internal class StartWithObservable<T> : OperatorObservableBase<T>
    {
        readonly IObservable<T> source;
        readonly T value;
        readonly Func<T> valueFactory;

        public StartWithObservable(IObservable<T> source, T value)
            : base(source.IsRequiredSubscribeOnCurrentThread())
        {
            this.source = source;
            this.value = value;
        }

        public StartWithObservable(IObservable<T> source, Func<T> valueFactory)
            : base(source.IsRequiredSubscribeOnCurrentThread())
        {
            this.source = source;
            this.valueFactory = valueFactory;
        }

        protected override IDisposable SubscribeCore(IObserver<T> observer, IDisposable cancel)
        {
            return new StartWith(this, observer, cancel).Run();
        }

        class StartWith : OperatorObserverBase<T, T>
        {
            readonly StartWithObservable<T> parent;

            public StartWith(StartWithObservable<T> parent, IObserver<T> observer, IDisposable cancel) : base(observer, cancel)
            {
                this.parent = parent;
            }

            public


hashicorp/aws/6.16.0/docs/resources/route53_record#geoproximity_routing_policy Route53Record#geoproximity_routing_policy}

---

##### `health_check_id`Optional

```python
health_check_id: str
```

- *Type:* str

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#health_check_id Route53Record#health_check_id}.

---

##### `id`Optional

```python
id: str
```

- *Type:* str

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#id Route53Record#id}.

Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2.
If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable.

---

##### `latency_routing_policy`Optional

```python
latency_routing_policy: Route53RecordLatencyRoutingPolicy
```

- *Type:* Route53RecordLatencyRoutingPolicy

latency_routing_policy block.

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#latency_routing_policy Route53Record#latency_routing_policy}

---

##### `multivalue_answer_routing_policy`Optional

```python
multivalue_answer_routing_policy: bool | IResolvable
```

- *Type:* bool | cdktf.IResolvable

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#multivalue_answer_routing_policy Route53Record#multivalue_answer_routing_policy}.

---

##### `records`Optional

```python
records: typing.List[str]
```

- *Type:* typing.List[str]

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#records Route53Record#records}.

---

##### `set_identifier`Optional

```python
set_identifier: str
```

- *Type:* str

Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/aws/6.16.0/docs/resources/route53_record#set_identifier Rou


 obj, diags

}

// --- List Unpacker for RoutePrefixListsIpv4Ipv4EntryInner ---
func unpackRoutePrefixListsIpv4Ipv4EntryInnerListToSdk(ctx context.Context, list types.List) ([]network_services.RoutePrefixListsIpv4Ipv4EntryInner, diag.Diagnostics) {
	tflog.Debug(ctx, "Entering list unpack helper for models.RoutePrefixListsIpv4Ipv4EntryInner")
	diags := diag.Diagnostics{}
	var data []models.RoutePrefixListsIpv4Ipv4EntryInner
	diags.Append(list.ElementsAs(ctx, &data, false)...)
	if diags.HasError() {
		tflog.Error(ctx, "Error converting list elements to Go models", map[string]interface{}{"diags": diags})
		return nil, diags
	}

	ans := make([]network_services.RoutePrefixListsIpv4Ipv4EntryInner, 0, len(data))
	for i, item := range data {
		tflog.Debug(ctx, "Unpacking item from list", map[string]interface{}{"index": i})
		obj, _ := types.ObjectValueFrom(ctx, models.RoutePrefixListsIpv4Ipv4EntryInner{}.AttrTypes(), &item)
		unpacked, d := unpackRoutePrefixListsIpv4Ipv4EntryInnerToSdk(ctx, obj)
		diags.Append(d...)
		if unpacked != nil {
			ans = append(ans, *unpacked)
		}
	}
	tflog.Debug(ctx, "Exiting list unpack helper for models.RoutePrefixListsIpv4Ipv4EntryInner", map[string]interface{}{"has_errors": diags.HasError()})
	return ans, diags
}

// --- List Packer for RoutePrefixListsIpv4Ipv4EntryInner ---
func packRoutePrefixListsIpv4Ipv4EntryInnerListFromSdk(ctx context.Context, sdks []network_services.RoutePrefixListsIpv4Ipv4EntryInner) (types.List, diag.Diagnostics) {
	tflog.Debug(ctx, "Entering list pack helper for models.RoutePrefixListsIpv4Ipv4EntryInner")
	diags := diag.Diagnostics{}
	var data []models.RoutePrefixListsIpv4Ipv4EntryInner

	for i, sdk := range sdks {
		tflog.Debug(ctx, "Packing item to list", map[string]interface{}{"index": i})
		var model models.RoutePrefixListsIpv4Ipv4EntryInner
		obj, d := packRoutePrefixListsIpv4Ipv4EntryInnerFromSdk(ctx, sdk)
		diags.Append(d...)
		if diags.HasError() {
			return basetypes.NewListNull(models.RoutePrefixListsIpv4Ipv4EntryInner{}.AttrType()), diags
		}
		diags.Append(obj.As(ctx, &model, basetypes.ObjectAsOptions{})...)
		data = append(data, model)
	}
	tflog.Debug(ctx, "Exiting list pack helper for models.RoutePrefixListsIpv4Ipv4EntryInner", map[string]interface{}{"has_errors": diags.HasError()})
	return basetypes.NewListValueFrom(ctx, models.RoutePrefixListsIpv4Ipv4EntryInner{}.AttrType(), data)
}

// --- Unpacker for RoutePrefixListsIpv4Ipv4EntryInnerPrefix ---
func unpackRoutePrefixListsIpv4Ipv4EntryInnerPrefixToSdk(ctx context.Context, obj types.Object) (*network_services.RoutePrefixListsIpv4Ipv4EntryInnerPrefix, diag.Diagnostics) {
	tflog.Debug(ctx, "Entering unpack helper for models.RoutePrefixListsIpv4Ipv4EntryInnerPrefix", map[string]interface{}{"tf_object": obj})
	diags := diag.Diagnostics{}
	var model models.RoutePrefixListsIpv4Ipv4EntryInnerPrefix
	diags.Append(obj.As(ctx, &model, basetypes.ObjectAsOptions{})...)
	if diags.HasError() {
		tflog.Error(c


* @xattrs: the header of the xattr object
 * @new_xattr: the xattr object to add
 *
 * Add an xattr object to @xattrs. This assumes no replacement or removal
 * of matching xattrs is wanted. Should only be called during inode
 * initialization when a few distinct initial xattrs are supposed to be set.
 */
void simple_xattr_add(struct simple_xattrs *xattrs,
		      struct simple_xattr *new_xattr)
{
	write_lock(&xattrs->lock);
	rb_add(&new_xattr->rb_node, &xattrs->rb_root, rbtree_simple_xattr_less);
	write_unlock(&xattrs->lock);
}

/**
 * simple_xattrs_init - initialize new xattr header
 * @xattrs: header to initialize
 *
 * Initialize relevant fields of a an xattr header.
 */
void simple_xattrs_init(struct simple_xattrs *xattrs)
{
	xattrs->rb_root = RB_ROOT;
	rwlock_init(&xattrs->lock);
}

/**
 * simple_xattrs_free - free xattrs
 * @xattrs: xattr header whose xattrs to destroy
 * @freed_space: approximate number of bytes of memory freed from @xattrs
 *
 * Destroy all xattrs in @xattr. When this is called no one can hold a
 * reference to any of the xattrs anymore.
 */
void simple_xattrs_free(struct simple_xattrs *xattrs, size_t *freed_space)
{
	struct rb_node *rbp;

	if (freed_space)
		*freed_space = 0;
	rbp = rb_first(&xattrs->rb_root);
	while (rbp) {
		struct simple_xattr *xattr;
		struct rb_node *rbp_next;

		rbp_next = rb_next(rbp);
		xattr = rb_entry(rbp, struct simple_xattr, rb_node);
		rb_erase(&xattr->rb_node, &xattrs->rb_root);
		if (freed_space)
			*freed_space += simple_xattr_space(xattr->name,
							   xattr->size);
		simple_xattr_free(xattr);
		rbp = rbp_next;
	}
}


final block = VoidBlock.listener(() {
        value = 123;
        hasRun.complete();
      });

      BlockTester.callOnSameThread(block);

      await hasRun.future;
      expect(value, 123);
    });

    test('Listener block new thread', () async {
      final hasRun = Completer<void>();
      int value = 0;
      final block = VoidBlock.listener(() {
        value = 123;
        hasRun.complete();
      });

      final thread = BlockTester.callOnNewThread(block);
      thread.start();

      await hasRun.future;
      expect(value, 123);
    });

    void waitSync(Duration d) {
      final t = Stopwatch();
      t.start();
      while (t.elapsed < d) {
        // Waiting...
      }
    }

    test('Blocking block same thread', () {
      int value = 0;
      final block = VoidBlock.blocking(() {
        waitSync(Duration(milliseconds: 100));
        value = 123;
      });
      BlockTester.callOnSameThread(block);
      expect(value, 123);
    });

    test('Blocking block new thread', () async {
      final block = IntPtrBlock.blocking((Pointer<Int32> result) {
        waitSync(Duration(milliseconds: 100));
        result.value = 123456;
      });
      final resultCompleter = Completer<int>();
      final resultBlock = ResultBlock.listener((int result) {
        resultCompleter.complete(result);
      });
      BlockTester.blockingBlockTest(block, resultBlock: resultBlock);
      expect(await resultCompleter.future, 123456);
    });

    test('Blocking block same thread throws', () {
      int value = 0;
      final block = VoidBlock.blocking(() {
        value = 123;
        throw "Hello";
      });
      BlockTester.callOnSameThread(block);
      expect(value, 123);
    });

    test('Blocking block new thread throws', () async {
      final block = IntPtrBlock.blocking((Pointer<Int32> result) {
        result.value = 123456;
        throw "Hello";
      });
      final resultCompleter = Completer<int>();
      final resultBlock = ResultBlock.listener((int result) {
        resultCompleter.complete(result);
      });
      BlockTester.blockingBlockTest(block, resultBlock: resultBlock);
      expect(await resultCompleter.future, 123456);
    });

    test('Blocking block manual invocation', () {
      int value = 0;
      final block = VoidBlock.blocking(() {
        waitSync(Duration(milliseconds: 100));
        value = 123;
      });
      block();
      expect(value, 123);
    });

    test('Float block', () {
      final block = FloatBlock.fromFunction((double x) {
        return x + 4.56;
      });
      expect(block(1.23), closeTo(5.79, 1e-6));
      expect(BlockTester.callFloatBlock(block), closeTo(5.79, 1e-6));
    });

    test('Double block', () {
      final block = DoubleBlock.fromFunction((double x) {
        return x + 4.56;
      });
      expect(block(1.23), closeTo(5.79, 1e-6));
      expect(BlockTester.callDoubleBlock(block), closeTo(5.79, 1e-6));
    });

    test('Struct block', () {
      using((Arena arena) {
        final inputPtr = arena<Vec4>();
        final input = inputPtr.ref;
        input.x = 1.2;
        input.y = 3.4;
        input.z = 5.6;
        input.w = 7.8;

        final tempPtr = arena<Vec4>();
        final temp = tempPtr.ref;
        final block = Vec4Block.fromFunction((Vec4 v) {
          // Twiddle the Vec4 components.


out) -> *mut u8 {
        interrupt::free(|cs| self.heap.borrow(cs).borrow_mut().allocate(layout))
            .map(NonNull::as_ptr)
            .unwrap_or_else(ptr::null_mut)
    }

    unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
        if let Some(non_null_ptr) = NonNull::new(ptr) {
            interrupt::free(|cs| {
                self.heap
                    .borrow(cs)
                    .borrow_mut()
                    .deallocate(non_null_ptr, layout)
            });
        }
    }
}
<reponame>lordarthas/codice_fiscale<filename>src/utils.rs
static CONSONANTS: &str = "BCDFGHJKLMNPQRSTVWXYZ";
static VOWELS: &str = "AEIOU";

fn is_vowel(c: &char) -> bool {
    VOWELS.contains(*c)
}

fn is_consonant(c: &char) -> bool {
    CONSONANTS.contains(*c)
}

fn extract_consonants(name: &str) -> String {
    name.to_uppercase().chars()
        .filter(|x| is_vowel(x))
        .rev()
        .collect()
}

/// Remove the 2nd consonant
pub fn prepare_name(name: &str) -> String {
    if extract_consonants(name).len() > 2 {
        let mut res = name.to_uppercase();
        let mut count: (u8, usize) = (0,0);
        for (i, ch) in res.chars().enumerate() {
            if is_consonant(&ch) {
                count.0 += 1;
                count.1 = i;
            }
            if count.0 == 2 {
                break;
            }
        }
        res.remove(count.1);
        res
    } else {
        name.to_owned()
    }
}

pub fn calc_name_component(name: &str) -> String {
    let part_consonants: String = name.to_uppercase().chars()
        .filter(|x| is_consonant(x))
        .collect();
    let mut part_vowels = extract_consonants(name);
    let mut cf_part = String::new();
    cf_part.push_str(part_consonants.chars().take(3).collect::<String>().as_ref());
    // Push vowels if needed (and there are)
    while cf_part.len() < 3 && !part_vowels.is_empty() {
        cf_part.push(part_vowels.pop().unwrap());
    }
    // Push Xs for missing chars
    while cf_part.len() < 3 {
        cf_part.push('X');
    }
    cf_part
}use std::time::Duration;

use criterion::{black_box, AxisScale, BenchmarkId, Criterion, PlotConfiguration, Throughput};
use rulex::{
    options::{CompileOptions, RegexFlavor},
    Rulex,
};

const STRINGS: &str = r#"'hello' "world" 'this is great!' "I absolutely love it!" '"'"#;

const PROPERTIES: &str = "
[Adlam] [Adlm] [Alphabetic] ![InBasic_Latin]
[Tibetan] ![Tibt] [!Uppercase_Letter] [Z] ![!Zl] ![cntrl] [ascii_digit] [.] [w]
";

const GROUPS: &str = r#"
( ( ( ( ( ( ( () ) ) ( ( ( ( ( ( ('hello') ) ) ) ) ) ) ) ) ) ( ( ( ( ( () ) ) 'world') ) ) ) )
"#;

const CAPT_GROUPS: &str = r#"
:test(:foo(:this_is_a_really_long_capturing_group_name() :bar() :() :baz('test' :(:(:()):())):()))
"#;

const CLASSES: &str = r#"
['a' '0'-'9' 'a'-'z' Greek !InBasic_Latin U+09-U+0D U+10FFFF '"' "'"]
"#;

const REPETITIONS: &str = r#"
[w]{4}{3}{7,}{1,2}* [w]+ greedy [w]* lazy{500


ADF2BFDA152B26555F",
"740F7649117F0DEE6EAA7789A9994C36",
"76AE64417C297184D668C5FD908B3CE5",
"6095FEA4AA8035591F1787A819C48787",
"D1FF4E7ACD1C79967FEBAB0F7465D450",
"5F5AD3C42B9489557BB63BF49ECF5F8A",
"FB56CC09B680B1D07C5A52149E29F07C",
"FF49B8DF4A97CBE03833E66197620DAD",
"5E070ADE533D2E090ED0F5BE13BC0983",
"3AB4FB1D2B7BA376590A2C241D1F508D",
"58B2431BC0BEDE02550F40238969EC78",
"0253786E126504F0DAB90C48A30321DE",
"200211214E7394DA2089B6ACD093ABE0",
"0388DACE60B6A392F328C2B971B2FE78",
"58E2FCCEFA7E3061367F1D57A4E7455A"
        },
        // Cipher Texts for 192-bit key
        {
"6CD02513E8D4DC986B4AFE087A60BD0C",
"423D2772A0CA56DAABB48D2129062987",
"1021F2A8DA70EB2219DC16804445FF98",
"C636E35B402577F96974D8804295EBB8",
"1566D2E57E8393C19E29F892EA28A9A7",
"883C878FED70B36CC09D040F9619DD19",
"06734593A974965790E715594FC34AA9",
"F19B389948D9A45534E5BD36C984134A",
"D8410DFC14FA6D175EC968EA8CAC514C",
"7E6C6EBB4029A177CF7B2FDD9AC6BB7A",
"4B51DD4850DC0A6C3A46D924003D2C27",
"2E510A9D917B15BE32A192B12A668F23",
"88F6F79962B0FB77FEA8E7C632D3108E",
"A3A35AB1D88DAF07B52794A0F065383A",
"DC6CC878433E2B3BB193049A4ECBFC53",
"EFCD3763EB7B1A415938248A9A5B4FD5",
"AB7E9FB9A66DBE5BB44854F07D9015EE",
"8B8E9D3365F8F6743ECF7E33E99255A4",
"54D37B4F176FF3D8F6AFC866066D8572",
"E83310889480FBF3C00342E3126D0D02",
"D321AB2511F92F098174AA2DE6E85DA2",
"D8E3F40B1112D5149D58C481DFA9983F",
"2454C4E0806639DDF19854D6C68054AD",
"A5506D410F7CA32F3955DD79D9D09418",
"7908EE40677699568A7DC1AA317C7E4E",
"B4B7B29DD43B2F5CF765E25192273982",
"92AFE9668159BEFFE2A86F8503260164",
"5C36A232FBA6D187A84657AD4028B18F",
"A2E994DFAB3A798DF8F54F6DA87E58E2",
"6CDAB10A72ADF


t 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
CLASS({
  package: 'foam.node.handlers',
  name: 'StaticFileHandler',
  extends: 'foam.node.handlers.Handler',
  properties: [
    {
      name: 'path',
      factory: function() { return require('path'); }
    },
    {
      name: 'fs',
      factory: function() { return require('fs'); }
    },
    {
      name: 'dir',
      documentation: 'Directory under which to serve files.',
      required: true,
      preSet: function(old, nu) {
        return this.path.resolve(process.cwd(), nu);
      },
      lazyFactory: function() { return process.cwd(); }
    },
    {
      name: 'prefix',
      documentation: 'URL path prefix. Stripped before searching $$DOC{ref:".dir"}.',
      required: true
    },
    {
      name: 'listDirectories',
      documentation: 'When set to true, the server will list directory ' +
          'contents. When false, returns 404s for directories.',
      defaultValue: true
    },
  ],

  constants: {
    LOG_TITLE: 'static',
    MIME_TYPES: {
      '.js': 'text/javascript',
      '.css': 'text/css',
      '.html': 'text/html',
      __default: 'application/octet-stream',
      '.ft': 'application/x.foam-template'
    }
  },

  methods: {
    send404: function(res, target) {
      this.send(res, 404, 'File not found: ' + target);
    },
    handle: function(req, res) {
      // Try to serve a static file.
      if ( ! this.dir ) return false;

      // Check the URL for the prefix.
      var target = req.url; // eg. /foo/bar/baz.jpg
      if ( target.indexOf(this.prefix) !== 0 ) return false;

      target = target.substring(this.prefix.length);

      // Check and strip the prefix off the URL.
      if ( target.indexOf('?') >= 0 )
        target = target.substring(0, target.indexOf('?'));
      if ( target.indexOf('#') >= 0 )
        target = target.substring(0, target.indexOf('#'));

      this.verbose('Matched prefix, target file: ' + target);

      // String a leading slash, if any.
      if ( target[0] === '/' ) target = target.substring(1);
      target = this.path.resolve(this.dir, target);
      this.verbose('Target resolved to: ' + target);
      var rel = this.path.relative(this.dir, target);
      this.verbose('Relative path: ' + target);
      // The relative path can't start with .. or it's outside the dir.
      if ( rel.startsWith('..') ) {
        this.send(res, 404, 'Illegal path: Attempts to leave directory.');
        this.warn('Tried to read static file outside directory: ' + target);
        return true;
      }

      // Now we have a legal filename within our subdirectory.
      // We try to stream the file to the other end.
      if ( ! this.fs.existsSync(target) ) {
        this.send404(res, target);
        this.warn('File not found: ' + target);
        return true;
      }

      var stats = this.fs


r3)
/* 803C4020 003C0E20  90 0D 0C 54 */	stw r0, lbl_805DDD34@sda21(r13)
/* 803C4024 003C0E24  80 63 00 3C */	lwz r3, 0x3c(r3)
/* 803C4028 003C0E28  90 83 00 38 */	stw r4, 0x38(r3)
/* 803C402C 003C0E2C  80 0D 0C 58 */	lwz r0, __DSP_first_task@sda21(r13)
/* 803C4030 003C0E30  90 0D 0C 5C */	stw r0, lbl_805DDD3C@sda21(r13)
/* 803C4034 003C0E34  4E 80 00 20 */	blr
lbl_803C4038:
/* 803C4038 003C0E38  80 03 00 38 */	lwz r0, 0x38(r3)
/* 803C403C 003C0E3C  90 0D 0C 5C */	stw r0, lbl_805DDD3C@sda21(r13)
/* 803C4040 003C0E40  80 03 00 38 */	lwz r0, 0x38(r3)
/* 803C4044 003C0E44  80 83 00 3C */	lwz r4, 0x3c(r3)
/* 803C4048 003C0E48  90 04 00 38 */	stw r0, 0x38(r4)
/* 803C404C 003C0E4C  80 03 00 3C */	lwz r0, 0x3c(r3)
/* 803C4050 003C0E50  80 63 00 38 */	lwz r3, 0x38(r3)
/* 803C4054 003C0E54  90 03 00 3C */	stw r0, 0x3c(r3)
/* 803C4058 003C0E58  4E 80 00 20 */	blr


 return false;
}

SDL_JoystickDriver SDL_HIDAPI_JoystickDriver = {
    HIDAPI_JoystickInit,
    HIDAPI_JoystickGetCount,
    HIDAPI_JoystickDetect,
    HIDAPI_IsDevicePresent,
    HIDAPI_JoystickGetDeviceName,
    HIDAPI_JoystickGetDevicePath,
    HIDAPI_JoystickGetDeviceSteamVirtualGamepadSlot,
    HIDAPI_JoystickGetDevicePlayerIndex,
    HIDAPI_JoystickSetDevicePlayerIndex,
    HIDAPI_JoystickGetDeviceGUID,
    HIDAPI_JoystickGetDeviceInstanceID,
    HIDAPI_JoystickOpen,
    HIDAPI_JoystickRumble,
    HIDAPI_JoystickRumbleTriggers,
    HIDAPI_JoystickSetLED,
    HIDAPI_JoystickSendEffect,
    HIDAPI_JoystickSetSensorsEnabled,
    HIDAPI_JoystickUpdate,
    HIDAPI_JoystickClose,
    HIDAPI_JoystickQuit,
    HIDAPI_JoystickGetGamepadMapping
};

#endif // SDL_JOYSTICK_HIDAPI


24)&255] ^ KW[r][1];
            C2 = T0[r2&255] ^ T1[(r3>>8)&255] ^ T2[(r0>>16)&255] ^ T3[(r1>>24)&255] ^ KW[r][2];
            C3 = T0[r3&255] ^ T1[(r0>>8)&255] ^ T2[(r1>>16)&255] ^ T3[(r2>>24)&255] ^ KW[r++][3];
        }

        r0 = T0[C0&255] ^ T1[(C1>>8)&255] ^ T2[(C2>>16)&255] ^ T3[(C3>>24)&255] ^ KW[r][0];
        r1 = T0[C1&255] ^ T1[(C2>>8)&255] ^ T2[(C3>>16)&255] ^ T3[(C0>>24)&255] ^ KW[r][1];
        r2 = T0[C2&255] ^ T1[(C3>>8)&255] ^ T2[(C0>>16)&255] ^ T3[(C1>>24)&255] ^ KW[r][2];
        r3 = T0[C3&255] ^ T1[(C0>>8)&255] ^ T2[(C1>>16)&255] ^ T3[(C2>>24)&255] ^ KW[r++][3];

        // the final round's table is a simple function of S so we don't use a whole other four tables for it

        C0 = (S[r0&255]&255) ^ ((S[(r1>>8)&255]&255)<<8) ^ ((S[(r2>>16)&255]&255)<<16) ^ (S[(r3>>24)&255]<<24) ^ KW[r][0];
        C1 = (S[r1&255]&255) ^ ((S[(r2>>8)&255]&255)<<8) ^ ((S[(r3>>16)&255]&255)<<16) ^ (S[(r0>>24)&255]<<24) ^ KW[r][1];
        C2 = (S[r2&255]&255) ^ ((S[(r3>>8)&255]&255)<<8) ^ ((S[(r0>>16)&255]&255)<<16) ^ (S[(r1>>24)&255]<<24) ^ KW[r][2];
        C3 = (S[r3&255]&255) ^ ((S[(r0>>8)&255]&255)<<8) ^ ((S[(r1>>16)&255]&255)<<16) ^ (S[(r2>>24)&255]<<24) ^ KW[r][3];

    }

    private final void decryptBlock(int[][] KW)
    {
        int r0, r1, r2, r3;

        C0 ^= KW[ROUNDS][0];
        C1 ^= KW[ROUNDS][1];
        C2 ^= KW[ROUNDS][2];
        C3 ^= KW[ROUNDS][3];

        int r = ROUNDS-1;

        while (r>1)
        {
            r0 = Tinv0[C0&255] ^ Tinv1[(C3>>8)&255] ^ Tinv2[(C2>>16)&255] ^ Tinv3[(C1>>24)&255] ^ KW[r][0];
            r1 = Tinv0[C1&255] ^ Tinv1[(C0>>8)&255] ^ Tinv2[(C3>>16)&255] ^ Tinv3[(C2>>24)&255] ^ KW[r][1];
            r2 = Tinv0[C2&255] ^ Tinv1[(C1>>8)&255] ^ Tinv2[(C0>>16)&255] ^ Tinv3[(C3>>24)&255] ^ KW[r][2];
            r3 = Tinv0[C3&255] ^ Tinv1[(C2>>8)&255] ^ Tinv2[(C1>>16)&255] ^ Tinv3[(C0>>24)&255] ^ KW[r--][3];
            C0 = Tinv0[r0&255] ^ Tinv1[(r3>>8)&255] ^ Tinv2[(r2>>16)&255] ^ Tinv3[(r1>>24)&255] ^ KW[r][0];
            C1 = Tinv0[r1&255] ^ Tinv1[(r0>>8)&255] ^ Tinv


dev/ttyACM0 - 比如，在 Mac OS 上该参数应为 /dev/tty.usbmodem1)：
   sh
   ./Tools/jmavsim_run.sh -q -d /dev/ttyACM0 -b 921600 -r 250

   ```sh
   ./Tools/simulation/jmavsim/jmavsim_run.sh -q -s -d /dev/ttyACM0 -b 921600 -r 250
   ```

   ::: info
   Replace the serial port name `/dev/ttyACM0` as appropriate.
   On macOS this port would be `/dev/tty.usbmodem1`.
   On Windows (including Cygwin) it would be the COM1 or another port - check the connection in the Windows Device Manager.

:::

3. Start _QGroundControl_.
   它应该会自动连接 PX4 和 Gazebo 。

## 在 HITL 仿真中执行自主飞行任务

You should be able to use _QGroundControl_ to [run missions](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/fly_view/fly_view.html#missions) and otherwise control the vehicle.
# Modules & Commands Reference

以下页面介绍了 PX4 模块， 驱动和命令。
They describe the provided functionality, high-level implementation overview and how
to use the command-line interface.

:::info
**This is auto-generated from the source code** and contains the most recent modules documentation.
:::

It is not a complete list and NuttX provides some additional commands
as well (such as `free`). Use `help` on the console to get a list of all
available commands, and in most cases `command help` will print the usage.

Since this is generated from source, errors must be reported/fixed
in the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) repository.
文档页可以在固件目录的根目录下运行如下命令生成：

```
make module_documentation
```

The generated files will be written to the `modules` directory.

## 分类

- [Autotune](modules_autotune.md)
- [Command](modules_command.md)
- [Communication](modules_communication.md)
- [Controller](modules_controller.md)
- [Driver](modules_driver.md)
- [Estimator](modules_estimator.md)
- [Simulation](modules_simulation.md)
- [System](modules_system.md)
- [Template](modules_template.md)
# Modules Reference: Imu (Driver)

## adis16448

Source: [drivers/imu/analog_devices/adis16448](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16448)

### 用法

```
adis16448 <command> [arguments...]
 Commands:
   start
     [-s]        Internal SPI bus(es)
     [-S]        External SPI bus(es)
     [-b <val>]  board-specific bus (default=all) (external SPI: n-th bus
                 (default=1))
     [-c <val>]  chip-select pin (for internal SPI) or index (for external SPI)
     [-m <val>]  SPI mode
     [-f <val>]  bus frequency in kHz
     [-q]        quiet startup (no message if no device found)
     [-R <val>]  Rotation
                 default: 0

   stop

   status        print status info
```

## adis16470

Source: [drivers/imu/analog_devices/adis16470](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/imu/analog_devices/adis16470)

### 用法

```
adis1647


td>Profile	Description	Context

    CDSHooksRequestGroup
    Defines a RequestGroup that can represent a CDS Hooks response
    CDS Hooks RequestGroup

14.13.8.2 Extensions <svg viewBox="0 0 1792 1792" width="20" class="self-link" height="20"><path d="M1520 1216q0-40-28-68l-208-208q-28-28-68-28-42 0-72 32 3 3 19 18.5t21.5 21.5 15 19 13 25.5 3.5 27.5q0 40-28 68t-68 28q-15 0-27.5-3.5t-25.5-13-19-15-21.5-21.5-18.5-19q-33 31-33 73 0 40 28 68l206 207q27 27 68 27 40 0 68-26l147-146q28-28 28-67zm-703-705q0-40-28-68l-206-207q-28-28-68-28-39 0-68 27l-147 146q-28 28-28 67 0 40 28 68l208 208q27 27 68 27 42 0 72-31-3-3-19-18.5t-21.5-21.5-15-19-13-25.5-3.5-27.5q0-40 28-68t68-28q15 0 27.5 3.5t25.5 13 19 15 21.5 21.5 18.5 19q33-31 33-73zm895 705q0 120-85 203l-147 146q-83 83-203 83-121 0-204-85l-206-207q-83-83-83-203 0-123 88-209l-88-88q-86 88-208 88-120 0-204-84l-208-208q-84-84-84-204t85-203l147-146q83-83 203-83 121 0 204 85l206 207q83 83 83 203 0 123-88 209l88 88q86-88 208-88 120 0 204 84l208 208q84 84 84 204z" fill="navy"></path></svg>

    timing-daysOfCycle
    RequestGroup.action
    daysOfCycle
    for Common extensions for Timing data type

Extensions for all resources or elements

    resource-pertainsToGoal
    pertainsToGoal
    for Resource HL7 Extensions

Extensions that reference this resource:

No Extensions refer to this resource

Extensions that refer to Any resource

    cqf-relativeDateTime
    relativeDateTime
    for Clinical Reasoning Extensions

    event-basedOn</td


r so that compliant browsers don't loose the bounding box */
.yui-toolbar-container .yui-toolbar-group:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
/* Grouped title styles */
.yui-toolbar-container .yui-toolbar-group h3 {
    font-size: 75%;
    color: #999;
    padding-left: .25em;
}
/* Style the separators with a left border */
.yui-toolbar-container span.yui-toolbar-separator {
    border-left: 1px solid #999;
    overflow: hidden;
    text-indent: 77777px;
    width: 2px;
    height: 18px;
    margin: .2em 0 .2em .1em;
    display: block;
    clear: none;
    float: left;
}
/* Set the height of a grouped separator to a little bit bigger */
.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator {
    height: 35px;
}

/* Reset the height of a separator inside of a group */
.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator {
    height: 18px;
}

/* Kill the default styles of the list */
.yui-toolbar-container ul li {
    margin: 0;
    float: left;
}

/* Setup the default style of a button in the toolbar */
.yui-toolbar-container .yui-button {
    border: 1px solid #999999;
    background: none;
    padding: 0;
    cursor: pointer;
    height: 20px;
    width: 30px;
    overflow: hidden;
    display: block;
    float: left;
    margin: 0 1px;
    position: relative;
    filter: none; /* UNDO Button filter..*/
}

/* setup the default style of the A inside of the toolbar button */
.yui-toolbar-container .yui-button .first-child, .yui-toolbar-container .yui-button .first-child a {
    margin: 0;
    border: 0;
    display: block;
    text-indent: 50px !important; /* IE Fix */
    width: 200px;
    overflow:hidden;
}

/* Setup the disabled state of a button */
.yui-toolbar-container .yui-button-disabled {
    opacity: .5;
    filter: alpha(opacity=50);
    cursor: default;
}
/* remove any padding from the A */
.yui-toolbar-container .yui-button a {
    padding: 0;
}
/* Fix a style inherited from the Button widget for IE */
.yui-toolbar-container .yui-button.ie6.hover {
    background-color: #98D5FC !important;
}

/* Select Button Emulation */
.yui-toolbar-container .yui-toolbar-select {
    height: 20px;
    width: auto;
}

/* Override the default Button style for select menu*/
.yui-toolbar-container .yui-toolbar-select a {
    border: none;
    background-color: transparent;
    height: 19px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    opacity: 1;
    filter: none;
}
/* Fix IE */
.yui-toolbar-container .yui-toolbar-select .first-child {
    width: 100% !important; /* For IE */
}
/* Reset the text-indent because we want to see the text of a select menu */
.yui-toolbar-container .yui-toolbar-select .first-child a {
    text-indent: 3px !important;
    width: 100% !important; /* For IE */
}


import discord
from discord.ext import commands
from discord import app_commands

class LockCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    # Comando com Prefixo - Lock
    @commands.command(name="lock")
    @commands.has_permissions(manage_channels=True)
    async def lock(self, ctx: commands.Context):
        """Desabilita a escrita no canal (com prefixo)."""
        channel = ctx.channel
        await channel.set_permissions(ctx.guild.default_role, send_messages=False)
        await ctx.send(f"🔒 Canal `{channel.name}` bloqueado!")

    # Comando com Slash - Lock
    @app_commands.command(name="lock", description="Desabilita a escrita no canal")
    async def slash_lock(self, interaction: discord.Interaction):
        """Desabilita a escrita no canal (com SlashCommand)."""
        # Verifica se o usuário tem permissão para gerenciar canais
        if not interaction.user.guild_permissions.manage_channels:
            await interaction.response.send_message("Você não tem permissão para gerenciar canais!", ephemeral=True)
            return

        channel = interaction.channel
        await channel.set_permissions(interaction.guild.default_role, send_messages=False)
        await interaction.response.send_message(f"🔒 Canal `{channel.name}` bloqueado!")

# Configura o Cog
async def setup(bot):
    await bot.add_cog(LockCog(bot))


 unsigned char c)
{
    *buffer++ = '%';
    placeByteAsHex(c, buffer);
}

static void appendEscapingBadChars(char*& buffer, const char* strStart, size_t length)
{
    char* p = buffer;

    const char* str = strStart;
    const char* strEnd = strStart + length;
    while (str < strEnd) {
        unsigned char c = *str++;
        if (isBadChar(c)) {
            if (c == '%' || c == '?')
                *p++ = c;
            else if (c != 0x09 && c != 0x0a && c != 0x0d)
                appendEscapedChar(p, c);
        } else
            *p++ = c;
    }

    buffer = p;
}

static void escapeAndAppendNonHierarchicalPart(char*& buffer, const char* strStart, size_t length)
{
    char* p = buffer;

    const char* str = strStart;
    const char* strEnd = strStart + length;
    while (str < strEnd) {
        unsigned char c = *str++;
        // Strip CR, LF and Tab from fragments, per:
        // https://bugs.webkit.org/show_bug.cgi?id=8770
        if (c == 0x09 || c == 0x0a || c == 0x0d)
            continue;

        // Chrome and IE allow non-ascii characters in fragments, however doing
        // so would hit an ASSERT in checkEncodedString, so for now we don't.
        if (c < 0x20 || c >= 127) {
            appendEscapedChar(p, c);
            continue;
        }
        *p++ = c;
    }

    buffer = p;
}

// copy a path, accounting for "." and ".." segments
static int copyPathRemovingDots(char* dst, const char* src, int srcStart, int srcEnd)
{
    char* bufferPathStart = dst;

    // empty path is a special case, and need not have a leading slash
    if (srcStart != srcEnd) {
        const char* baseStringStart = src + srcStart;
        const char* baseStringEnd = src + srcEnd;
        const char* baseStringPos = baseStringStart;

        // this code is unprepared for paths that do not begin with a
        // slash and we should always have one in the source string
        ASSERT(baseStringPos[0] == '/');

        // copy the leading slash into the destination
        *dst = *baseStringPos;
        baseStringPos++;
        dst++;

        while (baseStringPos < baseStringEnd) {
            if (baseStringPos[0] == '.' && dst[-1] == '/') {
                if (baseStringPos[1] == '/' || baseStringPos + 1 == baseStringEnd) {
                    // skip over "." segment
                    baseStringPos += 2;
                    continue;
                } else if (baseStringPos[1] == '.' && (baseStringPos[2] == '/' ||
                                       baseStringPos + 2 == baseStringEnd)) {
                    // skip over ".." segment and rewind the last segment
                    // the RFC leaves it up to the app to decide what to do with excess
                    // ".." segments - we choose to drop them since some web content
                    // relies on this.
                    baseStringPos += 3;
                    if (dst > bufferPathStart + 1)
                        dst--;
                    while (dst > bufferPathStart && dst[-1] != '/')
                        dst--;
                    continue;
                }
            }

            *dst = *baseStringPos;
            baseStringPos++;
            dst++;
        }
    }
    *dst = '\0';
    return dst - bufferPathStart;
}

static inline bool hasSlashDotOrDotDot(const char* str)
{
    const unsigned char* p = reinterpret_cast<const unsigned char*>(str);
    if (!*p)
        return fal


cakk.core.provider.jwt.JwtProvider
import com.cakk.core.vo.JsonWebToken
import com.cakk.domain.mysql.entity.user.User
import com.cakk.domain.redis.repository.TokenRedisRepository

@DisplayName("Sign 관련 비즈니스 로직 테스트")
internal class SignServiceTest : MockitoTest() {

	@InjectMocks
	private lateinit var signService: SignService

	@Mock
	private lateinit var oidcProviderDispatcher: OidcProviderDispatcher

	@Mock
	private lateinit var jwtProvider: JwtProvider

	@Mock
	private lateinit var userReadFacade: UserReadFacade

	@Mock
	private lateinit var userManagerFacade: UserManageFacade

	@Mock
	private lateinit var tokenRedisRepository: TokenRedisRepository

	@TestWithDisplayName("회원가입에 성공한다")
	fun signUp1() {
		// given
		val param = fixtureMonkey.giveMeBuilder(UserSignUpParam::class.java)
			.set("provider", getEnumFixture(Provider::class.java))
			.set("idToken", getStringFixtureBw(100, 200))
			.set("nickname", getStringFixtureBw(1, 10))
			.set("email", getStringFixtureBw(10, 20))
			.set("birthday", getDateFixture())
			.set("gender", getEnumFixture(Gender::class.java))
			.setNull("deviceOs")
			.setNull("deviceToken")
			.sample()
		val user = fixtureMonkey.giveMeBuilder(User::class.java)
			.set("id", getLongFixtureGoe(10))
			.set("provider", param.provider)
			.set("providerId", getStringFixtureBw(10, 20))
			.sample()
		val jwt = fixtureMonkey.giveMeBuilder(JsonWebToken::class.java)
			.set("accessToken", getStringFixtureBw(10, 20))
			.set("refreshToken", getStringFixtureBw(10, 20))
			.set("grantType", getStringFixtureBw(10, 20))
			.sample()

		doReturn(user.providerId).`when`(oidcProviderDispatcher).getProviderId(param.provider, param.idToken)
		doReturn(user).`when`(userManagerFacade).create(any())
		doReturn(jwt).`when`(jwtProvider).generateToken(user)

		// when
		val result = signService.signUp(param)

		// then
		result.accessToken shouldNotBe null
		result.refreshToken shouldNotBe null
		result.grantType shouldNotBe null

		verify(oidcProviderDispatcher, times(1)).getProviderId(param.provider, param.idToken)
		verify(userManagerFacade, times(1)).create(any())
		verify(jwtProvider, times(1)).generateToken(user)
	}

	@TestWithDisplayName("만료된 id token이라면 회원가입 시 에러를 던진다")
	fun signUp2() {
		// given
		val param: UserSignUpParam = fixtureMonkey.giveMeBuilder(UserSignUpParam::class.java)
			.setNotNull("provider")
			.setNotNull("idToken")
			.setNotNull("nickname")
			.setNotNull("email")
			.setNotNull("birthday")
			.setNotNull("gender")
			.sample()
		val user: User = fixtureMonkey.giveMeBuilder(User::class.java)
			.set("id", getLongFixtureGoe(10))
			.set("provider", param.provider)
			.set("providerId", getStringFixtureBw(10, 20))
			.sample()

		doThrow(CakkException(ReturnCode.EXPIRED_JWT_TOKEN)).`when`(oidcProviderDispatcher).getProviderId(param.provider, param.idToken)

		// whe


// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/util/test_log.proto

#ifndef GOOGLE_PROTOBUF_INCLUDED_tensorflow_2fcore_2futil_2ftest_5flog_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_tensorflow_2fcore_2futil_2ftest_5flog_2eproto

#include <limits>
#include <string>

#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021009 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif

#include <google/protobuf/port_undef.inc>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
#include <google/protobuf/extension_set.h>  // IWYU pragma: export
#include "tsl/protobuf/test_log.pb.h"
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2futil_2ftest_5flog_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
}  // namespace internal
PROTOBUF_NAMESPACE_CLOSE

// Internal implementation detail -- do not use these members.
struct TableStruct_tensorflow_2fcore_2futil_2ftest_5flog_2eproto {
  static const uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2futil_2ftest_5flog_2eproto;
PROTOBUF_NAMESPACE_OPEN
PROTOBUF_NAMESPACE_CLOSE
namespace tensorflow {
namespace dummy {

// ===================================================================

// ===================================================================

// ===================================================================

#ifdef __GNUC__
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif  // __GNUC__
#ifdef __GNUC__
  #pragma GCC diagnostic pop
#endif  // __GNUC__

// @@protoc_insertion_point(namespace_scope)

}  // namespace dummy
}  // namespace tensorflow

// @@protoc_insertion_point(global_scope)

#include <google/protobuf/port_undef.inc>
#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_tensorflow_2fcore_2futil_2ftest_5flog_2eproto


k,
};

static struct irq_chip iomd_chip_noclr = {
	.irq_mask	= iomd_irq_mask,
	.irq_unmask	= iomd_irq_unmask,
};

extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end;

void __init rpc_init_irq(void)
{
	unsigned int irq, clr, set;

	iomd_writeb(0, IOMD_IRQMASKA);
	iomd_writeb(0, IOMD_IRQMASKB);
	iomd_writeb(0, IOMD_FIQMASK);
	iomd_writeb(0, IOMD_DMAMASK);

	set_fiq_handler(&rpc_default_fiq_start,
		&rpc_default_fiq_end - &rpc_default_fiq_start);

	set_handle_irq(iomd_handle_irq);

	for (irq = 0; irq < NR_IRQS; irq++) {
		clr = IRQ_NOREQUEST;
		set = 0;

		if (irq <= 6 || (irq >= 9 && irq <= 15))
			clr |= IRQ_NOPROBE;

		if (irq == 21 || (irq >= 16 && irq <= 19) ||
		    irq == IRQ_KEYBOARDTX)
			set |= IRQ_NOAUTOEN;

		switch (irq) {
		case 0 ... 7:
			irq_set_chip_and_handler(irq, &iomd_chip_clr,
						 handle_level_irq);
			irq_modify_status(irq, clr, set);
			iomd_set_base_mask(irq, IOMD_BASE + IOMD_IRQSTATA,
					   BIT(irq));
			break;

		case 8 ... 15:
			irq_set_chip_and_handler(irq, &iomd_chip_noclr,
						 handle_level_irq);
			irq_modify_status(irq, clr, set);
			iomd_set_base_mask(irq, IOMD_BASE + IOMD_IRQSTATB,
					   BIT(irq - 8));
			break;

		case 16 ... 21:
			irq_set_chip_and_handler(irq, &iomd_chip_noclr,
						 handle_level_irq);
			irq_modify_status(irq, clr, set);
			iomd_set_base_mask(irq, IOMD_BASE + IOMD_DMASTAT,
					   BIT(irq - 16));
			break;

		case 64 ... 71:
			irq_set_chip(irq, &iomd_chip_noclr);
			irq_modify_status(irq, clr, set);
			iomd_set_base_mask(irq, IOMD_BASE + IOMD_FIQSTAT,
					   BIT(irq - 64));
			break;
		}
	}

	init_FIQ(FIQ_START);
}


, [sp, #4]
	cmp r1, r0
	bge _021DD0B6
	ldr r0, [r7, #4]
	bl ov16_021D9EDC
	add r1, r0, #0
	ldr r0, _021DD10C ; =0x000001EE
	cmp r1, r0
	beq _021DD0B6
	ldr r0, [r7, #4]
	bl ov16_021D9E08
	ldr r0, [r0, #4]
	cmp r0, #2
	bne _021DD0B6
	mov r6, #1
_021DD0B6:
	ldr r0, [sp]
	lsl r1, r5, #2
	add r5, r0, r1
	ldr r0, [r5, #0x50]
	add r1, r6, #0
	bl sub_020200A0
	cmp r6, #0
	beq _021DD102
	ldr r0, [r5]
	bl sub_0202011C
	mov r1, #0x36
	ldr r2, [r0]
	lsl r1, r1, #0xc
	sub r1, r2, r1
	str r1, [sp, #0xc]
	ldr r0, [r0, #4]
	add r1, sp, #0xc
	str r0, [sp, #0x10]
	ldr r0, [r5, #0x50]
	bl sub_02020044
	ldr r0, [r5]
	bl sub_02020300
	add r1, r0, #0
	ldr r0, [r5, #0x50]
	bl sub_020202A8
	ldr r0, [r5]
	bl sub_0202032C
	add r1, r0, #0
	ldr r0, [r5, #0x50]
	sub r1, r1, #1
	bl sub_02020310
_021DD102:
	add r4, r4, #1
	cmp r4, #9
	blt _021DD07E
	add sp, #0x18
	pop {r3, r4, r5, r6, r7, pc}
	.align 2, 0
_021DD10C: .word 0x000001EE
	thumb_func_end ov16_021DD060

	thumb_func_start ov16_021DD110
ov16_021DD110: ; 0x021DD110
	push {r4, lr}
	add r4, r0, #0
	ldr r0, [r1, #4]
	bl ov16_021D9ED0
	add r1, r0, #0
	mov r0, #0x36
	lsl r0, r0, #0xc
	lsl r1, r1, #0xc
	bl FX_Div
	str r0, [r4, #0x78]
	pop {r4, pc}
	.align 2, 0
	thumb_func_end ov16_021DD110

	thumb_func_start ov16_021DD12C
ov16_021DD12C: ; 0x021DD12C
	push {r3, r4, lr}
	sub sp, #0xc
	add r4, r0, #0
	ldr r0, [r1, #4]
	bl ov16_021D9EC4
	add r2, r0, #0
	ldr r0, [r4, #0x78]
	lsl r2, r2, #0xc
	asr r1, r0, #0x1f
	asr r3, r2, #0x1f
	bl _ll_mul
	mov r2, #2
	mov r3, #0
	lsl r2, r2, #0xa
	add r2, r0, r2
	adc


// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN:        | llvm-objdump -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN:   | llvm-objdump -d --mattr=-sve - | FileCheck %s --check-prefix=CHECK-UNKNOWN

orn     z5.b, z5.b, #0xf9
// CHECK-INST: orr     z5.b, z5.b, #0x6
// CHECK-ENCODING: [0x25,0x3e,0x00,0x05]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 05003e25 <unknown>

orn     z23.h, z23.h, #0xfff9
// CHECK-INST: orr     z23.h, z23.h, #0x6
// CHECK-ENCODING: [0x37,0x7c,0x00,0x05]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 05007c37 <unknown>

orn     z0.s, z0.s, #0xfffffff9
// CHECK-INST: orr     z0.s, z0.s, #0x6
// CHECK-ENCODING: [0x20,0xf8,0x00,0x05]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 0500f820 <unknown>

orn     z0.d, z0.d, #0xfffffffffffffff9
// CHECK-INST: orr     z0.d, z0.d, #0x6
// CHECK-ENCODING: [0x20,0xf8,0x03,0x05]
// CHECK-ERROR: instruction requires: sve or sme
// CHECK-UNKNOWN: 0503f820 <unknown>

orn     z5.b, z5.b, #0x6
// CHECK-INST: orr     z5.b, z5.b, #0xf9
// CHECK-ENCODING: [0xa5,0x2e,0x00,0x05]
//


 cbFileSize)
                {
                    pParam->hr = HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND);
                    goto lDone;
                }

                cbTotalSizeOfRawData += cbSizeOfResourceData;
            }

            // Check that the total raw data doesn't overflow.
            if (cbTotalSizeOfRawData.IsOverflow() ||
                cbTotalSizeOfRawData.Value() > cbFileSize)
            {
                pParam->hr = HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND);
                goto lDone;
            }
        }

        PESection *rsrcSection;
        pParam->hr = pParam->genWriter->getPEWriter().getSectionCreate(".rsrc", sdReadOnly, &rsrcSection);
        if (FAILED(pParam->hr)) goto lDone;

        rsrcSection->directoryEntry(IMAGE_DIRECTORY_ENTRY_RESOURCE);
        data = rsrcSection->getBlock(static_cast<unsigned>(cbTotalSizeOfRawData.Value()), 8);
        if(data == NULL)
        {
            pParam->hr = E_OUTOFMEMORY;
            goto lDone;
        }

        // Copy resource header
        memcpy(data, (char *)pParam->hMod + VAL32(rsrc[0]->PointerToRawData), VAL32(rsrc[0]->SizeOfRawData));

        // Map all the relocs in .rsrc$01 using the reloc and symbol tables in the COFF object.,
        cReloc        = 0;         // Total number of relocs
        pReloc        = NULL;      // Reloc table start

        cSymbol       = 0;         // Total number of symbols
        pSymbolTable  = NULL;      // Symbol table start

        {
            // Check that the relocations and symbols lie within the resource
            cReloc = VAL16(rsrc[0]->NumberOfRelocations);
            SIZE_T cbStartOfRelocations = static_cast<SIZE_T>(VAL32(rsrc[0]->PointerToRelocations));
            S_SIZE_T cbEndOfRelocations(S_SIZE_T(cbStartOfRelocations) +
                                        (S_SIZE_T(cReloc) * S_SIZE_T(sizeof(IMAGE_RELOCATION))));

            // Verify the number of symbols fit into the resource.
            cSymbol = static_cast<SIZE_T>(VAL32(pParam->hMod->NumberOfSymbols));
            SIZE_T cbStartOfSymbolTable = static_cast<SIZE_T>(VAL32(pParam->hMod->PointerToSymbolTable));
            S_SIZE_T cbEndOfSymbolTable(S_SIZE_T(cbStartOfSymbolTable) +
                                        (S_SIZE_T(cSymbol) * S_SIZE_T(IMAGE_SIZEOF_SYMBOL)));

            if (cbEndOfRelocations.IsOverflow() ||
                cbEndOfRelocations.Value() > cbFileSize ||
                cbEndOfSymbolTable.IsOverflow() ||
                cbEndOfSymbolTable.Value() > cbFileSize)
            {
                pParam->hr = HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND);
                goto lDone;
            }

            pReloc = (IMAGE_RELOCATION *)(pbStartOfMappedMem + cbStartOfRelocations);
            pSymbolTable = (IMAGE_SYMBOL *)(pbStartOfMappedMem + cbStartOfSymbolTable);
        }

        _ASSERTE(pReloc != NULL && pSymbolTable != NULL);

        for(SIZE_T iReloc = 0; iReloc < cReloc; iReloc++, pReloc++)
        {
            // Ensure this is a valid reloc
            {
                S_SIZE_T cbRelocEnd = S_SIZE_T(VAL32(pReloc->VirtualAddress)) + S_SIZE_T(sizeof(DWORD));
                if (cbRelocEnd.IsOverflow() ||
                    cbRelocEnd.Value() > static_cast<SIZE_T>(VAL32(rsrc[0]->SizeOfRawData)))
                {
                    pParam->hr = HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND


.29,71,6.43,94.31,6.43s73.24,1.93,94.3-6.43a54,54,0,0,0,30.41-30.41c8.35-21,6.43-71.05,6.43-94.33S357.1,182.74,348.75,161.67ZM224,338a82,82,0,1,1,82-82A81.9,81.9,0,0,1,224,338Zm85.38-148.3a19.14,19.14,0,1,1,19.13-19.14A19.1,19.1,0,0,1,309.42,189.74ZM400,32H48A48,48,0,0,0,0,80V432a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V80A48,48,0,0,0,400,32ZM382.88,322c-1.29,25.63-7.14,48.34-25.85,67s-41.4,24.63-67,25.85c-26.41,1.49-105.59,1.49-132,0-25.63-1.29-48.26-7.15-67-25.85s-24.63-41.42-25.85-67c-1.49-26.42-1.49-105.61,0-132,1.29-25.63,7.07-48.34,25.85-67s41.47-24.56,67-25.78c26.41-1.49,105.59-1.49,132,0,25.63,1.29,48.33,7.15,67,25.85s24.63,41.42,25.85,67.05C384.37,216.44,384.37,295.56,382.88,322Z", 448, 512))},
			{EFontAwesomeIcon.Brands_Instalod, new FontAwesomeInformation("InstaLOD", EFontAwesomeStyle.Brands, "", new FontAwesomeSvgInformation("M153.384,480H387.113L502.554,275.765,204.229,333.211ZM504.726,240.078,387.113,32H155.669L360.23,267.9ZM124.386,48.809,7.274,256,123.236,461.154,225.627,165.561Z", 512, 512))},
			{EFontAwesomeIcon.Brands_Intercom, new FontAwesomeInformation("Intercom", EFontAwesomeStyle.Brands, "", new FontAwesomeSvgInformation("M392 32H56C25.1 32 0 57.1 0 88v336c0 30.9 25.1 56 56 56h336c30.9 0 56-25.1 56-56V88c0-30.9-25.1-56-56-56zm-108.3 82.1c0-19.8 29.9-19.8 29.9 0v199.5c0 19.8-29.9 19.8-29.9 0V114.1zm-74.6-7.5c0-19.8 29.9-19.8 29.9 0v216.5c0 19.8-29.9 19.8-29.9 0V106.6zm-74.7 7.5c0-19.8 29.9-19.8 29.9 0v199.5c0 19.8-29.9 19.8-29.9 0V114.1zM59.7 144c0-19.8 29.9-19.8 29.9 0v134.3c0 19.8-29.9 19.8-29.9 0V144zm323.4 227.8c-72.8 63-241.7 65.4-318.1 0-15-12.8 4.4-35.5 19.4-22.7 65.9 55.3 216.1 53.


one => !regs_overwritten.is_empty(),
            }
        })
        .cloned()
        .collect()
}

// TODO: use drain_filter() once on stable
/// Parallel filter to gadget's whose addresses don't contain specified bytes
pub fn filter_bad_addr_bytes<'a>(
    gadgets: &[gadget::Gadget<'a>],
    bad_bytes: &[u8],
) -> Vec<gadget::Gadget<'a>> {
    let mut good_addr_gadgets = gadgets.to_vec();

    good_addr_gadgets.par_iter_mut().for_each(|g| {
        let tmp_set: BTreeSet<_> = g
            .full_matches
            .iter()
            .filter(|addr| addr.to_le_bytes().iter().all(|b| !bad_bytes.contains(b)))
            .cloned()
            .collect();

        g.full_matches = tmp_set;

        let tmp_map: BTreeMap<_, _> = g
            .partial_matches
            .iter()
            .filter(|(addr, _)| addr.to_le_bytes().iter().all(|b| !bad_bytes.contains(b)))
            .map(|(addr, bins)| (*addr, bins.clone()))
            .collect();

        g.partial_matches = tmp_map;
    });

    good_addr_gadgets
        .into_iter()
        .filter(|g| !g.full_matches.is_empty() || !g.partial_matches.is_empty())
        .collect()
}
<reponame>matt-ross16/enarx-keepldr<filename>internal/shim-sev/src/asm.rs
// SPDX-License-Identifier: Apache-2.0

//! Functions needing `asm!` blocks

use crate::addr::SHIM_VIRT_OFFSET;
use crate::hostlib::ALIGN_ABOVE_2MB;
use core::mem::size_of;
use x86_64::instructions::tables::lidt;
use x86_64::structures::DescriptorTablePointer;

#[allow(clippy::integer_arithmetic)]
const SHIM_OFFSET: u64 = 1u64 + SHIM_VIRT_OFFSET + ALIGN_ABOVE_2MB as u64;

/// Provoke a triple fault to shutdown the machine
///
/// An illegal IDT is loaded with limit=0 and an #UD is produced
///
/// Fun read: http://www.rcollins.org/Productivity/TripleFault.html
///
/// # Safety
///
/// This function causes a triple fault!
#[inline(never)]
pub unsafe fn _enarx_asm_triple_fault() -> ! {
    let mut rbp: u64;

    let mut frames = [0u64; 16];

    asm!("mov {}, rbp", out(reg) rbp);

    // Create an invalid DescriptorTablePointer with no base and limit
    let dtp = DescriptorTablePointer { limit: 0, base: 0 };
    // Load the invalid IDT
    lidt(&dtp);

    for ele in frames.iter_mut() {
        if let Some(rip_rbp) = rbp.checked_add(size_of::<usize>() as _) {
            let rip = *(rip_rbp as *const u64);
            if let Some(rip) = rip.checked_sub(SHIM_OFFSET) {
                *ele = rip;
                rbp = *(rbp as *const u64);
            } else {
                // Not a shim virtual address
                break;
            }
        } else {
            // RBP OVERFLOW
            break;
        }
    }

    // Provoke an #UD, which will lead to a triple fault, because of the invalid IDT
    asm!("ud2",
    in("rax") frames[2], // the first two frames are from panic
    in("rbx") frames[3],
    in("rcx") frames[4],
    in("rdx") frames[5],
    in("rsi") frames[6],
    in("rdi") frames[7],
    in("r8") frames[8],
    in("r9") frames[9],
    in("r10") frames[10],
    in("r11") frames[11],
    in("r12") frames[12],
    in("r13") frames[13


-flex:0;box-flex:0;-webkit-flex:0 8.3333333333%;-moz-flex:0 8.3333333333%;-ms-flex:0 8.3333333333%;flex:0 8.3333333333%}@media only all and (min-width: 48em)and (max-width: 59.938em){.size-tablet-1-2{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 50%;-moz-flex:0 50%;-ms-flex:0 50%;flex:0 50%}.size-tablet-1-3{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 33.3333333333%;-moz-flex:0 33.3333333333%;-ms-flex:0 33.3333333333%;flex:0 33.3333333333%}.size-tablet-1-4{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 25%;-moz-flex:0 25%;-ms-flex:0 25%;flex:0 25%}.size-tablet-1-5{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 20%;-moz-flex:0 20%;-ms-flex:0 20%;flex:0 20%}.size-tablet-1-6{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 16.6666666667%;-moz-flex:0 16.6666666667%;-ms-flex:0 16.6666666667%;flex:0 16.6666666667%}.size-tablet-1-7{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 14.2857142857%;-moz-flex:0 14.2857142857%;-ms-flex:0 14.2857142857%;flex:0 14.2857142857%}.size-tablet-1-8{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 12.5%;-moz-flex:0 12.5%;-ms-flex:0 12.5%;flex:0 12.5%}.size-tablet-1-9{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 11.1111111111%;-moz-flex:0 11.1111111111%;-ms-flex:0 11.1111111111%;flex:0 11.1111111111%}.size-tablet-1-10{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 10%;-moz-flex:0 10%;-ms-flex:0 10%;flex:0 10%}.size-tablet-1-11{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 9.0909090909%;-moz-flex:0 9.0909090909%;-ms-flex:0 9.0909090909%;flex:0 9.0909090909%}.size-tablet-1-12{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;-webkit-flex:0 8.3333333333%;-moz-flex:0 8.3333333333%;-ms-flex:0 8.3333333333%;flex:0 8.3333333333%}}@media only all and (max-width: 47.938em){@supports not (flex-wrap: wrap){.grid{display:block;-webkit-box-lines:inherit;-moz-box-lines:inherit;box-lines:inherit;-webkit-flex-wrap:inherit;-moz-flex-wrap:inherit;-ms-flex-wrap:inherit;flex-wrap:inherit}.block{display:block;-webkit-box-flex:inherit;-moz-box-flex:inherit;box-


	CommentExpr: ast.NewTextExpr("// line comment"),
			}))
		}
	})

	t.Run("mismatched import", func(t *testing.T) {
		_, err := parser.Accept(importAccept, `
		 "foo.api"`)
		assert.Error(t, err)

		_, err = parser.Accept(importAccept, `
		 impor "foo.api"`)
		assert.Error(t, err)
	})

	t.Run("mismatched value", func(t *testing.T) {
		_, err := parser.Accept(importAccept, `
		 import "foo"`)
		assert.Error(t, err)

		_, err = parser.Accept(importAccept, `
		 import ""`)
		assert.Error(t, err)

		_, err = parser.Accept(importAccept, `
		 import `)
		assert.Error(t, err)
	})
}
package ast

import (
	"github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/gen/api"
)

// ImportExpr defines import syntax for api
type ImportExpr struct {
	Import      Expr
	Value       Expr
	DocExpr     []Expr
	CommentExpr Expr
}

// VisitImportSpec implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitImportSpec(ctx *api.ImportSpecContext) interface{} {
	var list []*ImportExpr
	if ctx.ImportLit() != nil {
		lits := ctx.ImportLit().Accept(v).([]*ImportExpr)
		list = append(list, lits...)
	}
	if ctx.ImportBlock() != nil {
		blocks := ctx.ImportBlock().Accept(v).([]*ImportExpr)
		list = append(list, blocks...)
	}

	return list
}

// VisitImportLit implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitImportLit(ctx *api.ImportLitContext) interface{} {
	importToken := v.newExprWithToken(ctx.GetImportToken())
	valueExpr := ctx.ImportValue().Accept(v).(Expr)
	return []*ImportExpr{
		{
			Import:      importToken,
			Value:       valueExpr,
			DocExpr:     v.getDoc(ctx),
			CommentExpr: v.getComment(ctx),
		},
	}
}

// VisitImportBlock implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitImportBlock(ctx *api.ImportBlockContext) interface{} {
	importToken := v.newExprWithToken(ctx.GetImportToken())
	values := ctx.AllImportBlockValue()
	var list []*ImportExpr

	for _, value := range values {
		importExpr := value.Accept(v).(*ImportExpr)
		importExpr.Import = importToken
		list = append(list, importExpr)
	}

	return list
}

// VisitImportBlockValue implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitImportBlockValue(ctx *api.ImportBlockValueContext) interface{} {
	value := ctx.ImportValue().Accept(v).(Expr)
	return &ImportExpr{
		Value:       value,
		DocExpr:     v.getDoc(ctx),
		CommentExpr: v.getComment(ctx),
	}
}

// VisitImportValue implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitImportValue(ctx *api.ImportValueContext) interface{} {
	return v.newExprWithTerminalNode(ctx.STRING())
}

// Format provides a formatter for api command, now nothing to do
func (i *ImportExpr) Format() error {
	// todo
	return nil
}

// Equal compares whether the element literals in two ImportExpr are equal
func (i *ImportExpr) Equal(v interface{}) bool {
	if v == nil {


tiugk (82)
sdjzc (27)
jdxth (14)
aeeas (83)
crtnt (57)
ytwvl (313) -> nqjmi, mwgimvy
avmhq (86)
juscmde (150)
kbpvvf (72)
wegmegy (280) -> oaantta, fzvyv
kfdtg (68)
matvb (55)
ehzvm (62)
ebxyi (54)
qgfxzo (9)
zoodui (220)
dapjhx (93)
ywawq (1093) -> ptcby, kufsr, pxsuagy
laovxxw (27)
furny (8) -> lgxjcy, hcsiqp, vsijk
gzocll (70)
kifypgu (63)
kywpr (91)
eikjv (10)
wjkky (57)
fkwsxxk (1446) -> eyixz, bjeto, ghkmb
weeriq (19)
rxkpkvi (66)
bipzxj (81) -> bpgafw, ilidonx, uxswi
trjird (51)
istoj (49)
idcvpt (71) -> zzdgmmd, imakkq, jbodnl
pehio (202) -> bstznzu, xzdhzoa
exxbgm (77)
tuzquw (83)
ydmxb (1610) -> udoiqj, isfyuxu, hgtyjhv, tlxdyxj, inreau, qiinez
jmsuq (31)
dkjwj (155) -> nbbiqh, nbfbkao
xxbwj (122) -> xpinqek, xqmsvth
dfewulo (48) -> phmmydn, eyjdqm, qpblhez
ukvzqny (47)
gpormp (3465) -> ymogkwe, ywtwrq, hixtw, zmssxbl, twhcdv
diriz (19)
zltzea (47)
jkqbf (87) -> wpwxn, vzpqvfx, muecmt, trjird
uodyv (83)
fhqah (50)
aapsp (5) -> nvhbnlc, dzqax, ndjjag, dmjech
bxfwhrd (51)
knoziw (29) -> sinhju, otbxf, udkba
wbupk (63)
ixvxtb (87)
rnvlepv (34)
nerzb (81)
brtmsqe (59)
gjjyumz (81)
ogpvd (53)
ypttuns (56)
yzkpvn (50)
hssfwi (102) -> qfhfg, uvkecqz
ooenol (69)
mucpe (31)
bpbmbq (83) -> irkhv, navnyn, bzzsss, wbnux
kkimdb (84)
sfgatoz (40)
bqfor (66)
tobsrs (89)
polnw (83)
xlqycb (20)
uwrmetx (202)
jtjzsr (13)
tehdy (16)
feiitan (87)
hcsiqp (65) -> rlwyzv, liymh, huzjje, spfds
udghm (35)
iequdmw (572) -> cwxgg, geqnwz, smbkvwd, swhnbvw, uynmvcu
mwxiwty (90) -> lvtxk, ylrxgoz
xqmsvth (50)
ulszh (64)
cpllg (56)
oswpicl (51)
gcglasa (143) -> nbmat, cfqczei
kdwzx (40)
igumiu (373) -> ggynw, lrodp
jptqm (200) -> avrfgx, mucpe
yrwcj (112) -> cfshobe, mgcyq
uvkecq


glabel func_80AC43F0
/* 01750 80AC43F0 27BDFFE0 */  addiu   $sp, $sp, 0xFFE0           ## $sp = FFFFFFE0
/* 01754 80AC43F4 AFB10018 */  sw      $s1, 0x0018($sp)
/* 01758 80AC43F8 AFB00014 */  sw      $s0, 0x0014($sp)
/* 0175C 80AC43FC 00808025 */  or      $s0, $a0, $zero            ## $s0 = 00000000
/* 01760 80AC4400 00A08825 */  or      $s1, $a1, $zero            ## $s1 = 00000000
/* 01764 80AC4404 AFBF001C */  sw      $ra, 0x001C($sp)
/* 01768 80AC4408 AFA60028 */  sw      $a2, 0x0028($sp)
/* 0176C 80AC440C 3C063F00 */  lui     $a2, 0x3F00                ## $a2 = 3F000000
/* 01770 80AC4410 3C0541F0 */  lui     $a1, 0x41F0                ## $a1 = 41F00000
/* 01774 80AC4414 248402D4 */  addiu   $a0, $a0, 0x02D4           ## $a0 = 000002D4
/* 01778 80AC4418 0C01E107 */  jal     Math_SmoothScaleMaxF

/* 0177C 80AC441C 3C074120 */  lui     $a3, 0x4120                ## $a3 = 41200000
/* 01780 80AC4420 3C0141EC */  lui     $at, 0x41EC                ## $at = 41EC0000
/* 01784 80AC4424 44812000 */  mtc1    $at, $f4                   ## $f4 = 29.50
/* 01788 80AC4428 C60002D4 */  lwc1    $f0, 0x02D4($s0)           ## 000002D4
/* 0178C 80AC442C 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 01790 80AC4430 02202825 */  or      $a1, $s1, $zero            ## $a1 = 00000000
/* 01794 80AC4434 4600203C */  c.lt.s  $f4, $f0
/* 01798 80AC4438 00000000 */  nop
/* 0179C 80AC443C 45020005 */  bc1fl   .L80AC4454
/* 017A0 80AC4440 44060000 */  mfc1    $a2, $f0
/* 017A4 80AC4444 0C2B0CD4 */  jal     func_80AC3350
/* 017A8 80AC4448 3C0641F0 */  lui     $a2, 0x41F0                ## $a2 = 41F00000
/* 017AC 80AC444C C60002D4 */  lwc1    $f0, 0x02D4($s0)           ## 000002D4
/* 017B0 80AC4450 44060000 */  mfc1    $a2, $f0
.L80AC4454:
/* 017B4 80AC4454 02002025 */  or      $a0, $s0, $zero            ## $a0 = 00000000
/* 017B8 80AC4458 0C2B0CD4 */  jal     func_80AC3350
/* 017BC 80AC445C 02202825 */  or      $a1, $s1, $zero            ## $a1 = 00000000
/* 017C0 80AC4460 3C0141F0 */  lui     $at, 0x41F0                ## $at = 41F00000
/


/span>

                                   {/if}
                                   {if $item['deductcredit2']>0}

余额抵扣：-￥{:number_format( $item['deductcredit2'],2)}

                                   {/if}
                                   {if $item['deductenough']>0}

满额立减：-￥{:number_format( $item['deductenough'],2)}

                                   {/if}
                                   {if $item['couponprice']>0}

优惠券优惠：-￥{:number_format( $item['couponprice'],2)}

                                   {/if}
                               {/if}

                               {if intval($item['changeprice'])!=0}

                                   卖家改价：
                                   <span style='{if 0<$item['changeprice']}color:green{else}color:red{/if}'>{if 0<$item['changeprice']}+{else}-{/if}￥{:number_format(abs($item['changeprice']),2)}

                               {/if}

                               {if intval($item['changedispatchprice'])!=0}

                                   卖家改运费：
                                   <span style='{if 0<$item['changedispatchprice']}color:green{else}color:red{/if}'>{if 0<$item['changedispatchprice']}+{else}-{/if}￥{:abs($item['changedispatchprice'])}

                               {/if}

实付款：￥{:number_format($item['price'],2)}

   </form>

{include file='_footer'}

{include file='_header'}

    当前位置：{if !empty($item['id'])}编辑{else}添加{/if}门店
        {if !empty($item['id'])}修改【{$item['storename']}】{/if}

        添加新门店

<form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
    <input type="hidden" name="id" value="{$item['id']}"/>

        门店


t_polling(self.shop_bot, self.shop_dp, "ShopBot"), self._loop)
            logger.info("BotController: Start command sent to event loop.")
            return {"status": "success", "message": "Команда на запуск бота отправлена."}

        except Exception as e:
            logger.error(f"Failed to start bot: {e}", exc_info=True)
            self.shop_bot = None
            self.shop_dp = None
            return {"status": "error", "message": f"Ошибка при запуске: {e}"}

    def start_support_bot(self):
        if self.support_is_running:
            return {"status": "error", "message": "Бот-Саппорт уже запущен."}

        token = database.get_setting("support_bot_token")
        group_id = database.get_setting("support_group_id")

        if not token or not group_id:
            return {"status": "error", "message": "Токен для Бота-Саппорта и Айди группы не указаны."}

        try:
            self.support_bot = Bot(token=token, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
            self.support_dp = Dispatcher()

            support_handlers.SUPPORT_GROUP_ID = int(group_id)
            support_handlers.user_bot = self.shop_bot

            support_router = get_support_router()
            self.support_dp.include_router(support_router)

            self.support_is_running = True
            self.support_task = asyncio.run_coroutine_threadsafe(
                self._start_polling(self.support_bot, self.support_dp, "SupportBot"), self._loop
            )
            return {"status": "success", "message": "Команда на запуск бота отправлена."}
        except Exception as e:
            self.support_bot = None
            self.support_dp = None
            logger.error(f"Failed to start Support Bot: {e}", exc_info=True)
            return {"status": "error", "message": f"Error starting Support Bot: {e}"}

    def stop_shop_bot(self):
        if not self.shop_is_running:
            return {"status": "error", "message": "Бот не запущен."}

        if not self._loop or not self.shop_dp:
            return {"status": "error", "message": "Критическая ошибка: компоненты бота недоступны."}

        self.shop_is_running = False

        logger.info("BotController: Sending graceful stop signal...")
        asyncio.run_coroutine_threadsafe(self.shop_dp.stop_polling(), self._loop)

        return {"status": "success", "message": "Команда на остановку бота отправлена."}

    def stop_support_bot(self):
        if not self.support_is_running:
            return {"status": "error", "message": "Бот не запущен."}

        if not self._loop or not self.support_dp:
            return {"status": "error", "message": "Критическая ошибка: компоненты бота недоступны."}

        self.support_is_running = False

        logger.info("BotController: Sending graceful stop signal...")
        asyncio.run_coroutine_threadsafe(self.support_dp.stop_polling(), self._loop)

        return {"status": "success", "message": "Команда на остановку бота отправлена."}

    def get_status(self):
        return {"shop_bot_running": self.shop_is_running,
                "support_bot_running": self.support_is_running
            }


           print(batch.scales.is_pinned())
            print(batch.rots.is_pinned())
            print(batch.model_inds.is_pinned())

            show_input_batch(batch)

        print('*******************************************')

    _, counts = np.unique(dataset.input_labels, return_counts=True)
    print(counts)

def debug_batch_and_neighbors_calib(dataset, loader):
    """Timing of generator function"""

    t = [time.time()]
    last_display = time.time()
    mean_dt = np.zeros(2)

    for epoch in range(10):

        print()

        for batch_i, batch in enumerate(loader):
            # print(batch_i, tuple(points.shape),  tuple(normals.shape), labels, indices, in_sizes)

            # New time
            t = t[-1:]
            t += [time.time()]

            # Update estim_b (low pass filter)

            s = '\n'

            N_list = []
            n_max_list = []
            p_max_list = []
            for neighbs, pools in zip(batch.neighbors, batch.pools):
                N_list.append(neighbs.shape[0])
                n_max_list.append(neighbs.shape[1])
                p_max_list.append(pools.shape[1])

                N = neighbs.shape[0]
                n_max = neighbs.shape[1]
                p_max = pools.shape[1]

                s += '[{:6d},{:3d}, K, 3]  |  '.format(N, n_max)
                s += '[{:6d},{:3d}->K, f1]  |  '.format(N, n_max)
                s += '[{:6d}, K, f1->f2]'.format(N)
                s += '\n'

            s += '\n'
            print(s)
            print('-------------------------------------------')

            # Pause simulating computations
            time.sleep(0.01)
            t += [time.time()]

            # Average timing
            mean_dt = 0.9 * mean_dt + 0.1 * (np.array(t[1:]) - np.array(t[:-1]))

            # # Console display (only one per second)
            # if (t[-1] - last_display) > 1.0:
            #     last_display = t[-1]
            #     message = 'Step {:08d} -> Average timings (ms/batch) {:8.2f} {:8.2f} '
            #     print(message.format(batch_i,
            #                          1000 * mean_dt[0],
            #                          1000 * mean_dt[1]))

        print('************* Epoch ended *************')

    _, counts = np.unique(dataset.input_labels, return_counts=True)
    print(counts)


.dev/30921 for more context.
// TODO: Replace clients with more context-specific mappings.
impl Errno {
    pub fn from_status(status: zx::Status) -> Self {
        match status {
            zx::Status::NOT_FOUND => ENOENT,
            zx::Status::NO_MEMORY => ENOMEM,
            zx::Status::INVALID_ARGS => EINVAL,
            zx::Status::BUFFER_TOO_SMALL => EINVAL,
            zx::Status::TIMED_OUT => ETIMEDOUT,
            zx::Status::UNAVAILABLE => EBUSY,
            zx::Status::ALREADY_EXISTS => EEXIST,
            zx::Status::PEER_CLOSED => EPIPE,
            zx::Status::BAD_STATE => EPIPE,
            zx::Status::BAD_PATH => ENAMETOOLONG,
            zx::Status::IO => EIO,
            zx::Status::NOT_FILE => EISDIR,
            zx::Status::NOT_DIR => ENOTDIR,
            zx::Status::NOT_SUPPORTED => EOPNOTSUPP,
            zx::Status::WRONG_TYPE => EOPNOTSUPP,
            zx::Status::OUT_OF_RANGE => EINVAL,
            zx::Status::NO_RESOURCES => ENOMEM,
            zx::Status::BAD_HANDLE => EBADF,
            zx::Status::ACCESS_DENIED => EACCES,
            zx::Status::SHOULD_WAIT => EAGAIN,
            zx::Status::FILE_BIG => EFBIG,
            zx::Status::NO_SPACE => ENOSPC,
            zx::Status::NOT_EMPTY => ENOTEMPTY,
            zx::Status::IO_REFUSED => ECONNREFUSED,
            zx::Status::IO_INVALID => EIO,
            zx::Status::CANCELED => EBADF,
            zx::Status::PROTOCOL_NOT_SUPPORTED => EPROTONOSUPPORT,
            zx::Status::ADDRESS_UNREACHABLE => ENETUNREACH,
            zx::Status::ADDRESS_IN_USE => EADDRINUSE,
            zx::Status::NOT_CONNECTED => ENOTCONN,
            zx::Status::CONNECTION_REFUSED => ECONNREFUSED,
            zx::Status::CONNECTION_RESET => ECONNRESET,
            zx::Status::CONNECTION_ABORTED => ECONNABORTED,
            _ => EIO,
        }
    }
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, AsBytes, FromBytes)]
#[repr(transparent)]
pub struct UserAddress(u64);

impl UserAddress {
    pub fn ptr(&self) -> zx_vaddr_t {
        self.0 as zx_vaddr_t
    }

    pub fn round_up(&self, increment: u64) -> UserAddress {
        UserAddress((self.0 + (increment - 1)) & !(increment - 1))
    }
}

impl Default for UserAddress {
    fn default() -> UserAddress {
        UserAddress(0)
    }
}

impl From<u64> for UserAddress {
    fn from(value: u64) -> Self {
        UserAddress(value)
    }
}

impl From<usize> for UserAddress {
    fn from(value: usize) -> Self {
        UserAddress(value as u64)
    }
}

impl ops::Add<u64> for UserAddress {
    type Output = UserAddress;

    fn add(self, rhs: u64) -> UserAddress {
        UserAddress(self.0 + rhs)
    }
}

impl ops::Sub<UserAddress> for UserAddress {
    type Output = usize;

    fn sub(self, rhs: UserAddress) -> usize {
        self.ptr() - rhs.ptr()
    }
}

impl fmt::Display for UserAddress {
    fn fmt(&self, f: &mut fmt::Formatter<'_


17D394  7C 9E 23 78 */	mr r30, r4
/* 80181738 0017D398  7C BF 2B 78 */	mr r31, r5
/* 8018173C 0017D39C  40 82 00 08 */	bne lbl_80181744
/* 80181740 0017D3A0  83 CD 9F 88 */	lwz r30, lbl_8063F248-_SDA_BASE_(r13)
lbl_80181744:
/* 80181744 0017D3A4  7F C3 F3 78 */	mr r3, r30
/* 80181748 0017D3A8  38 80 00 00 */	li r4, 0
/* 8018174C 0017D3AC  48 03 DD 75 */	bl func_801BF4C0
/* 80181750 0017D3B0  28 1F 00 01 */	cmplwi r31, 1
/* 80181754 0017D3B4  7C 7F 1B 78 */	mr r31, r3
/* 80181758 0017D3B8  40 82 00 5C */	bne lbl_801817B4
/* 8018175C 0017D3BC  7F A3 EB 78 */	mr r3, r29
/* 80181760 0017D3C0  7F C4 F3 78 */	mr r4, r30
/* 80181764 0017D3C4  38 A0 00 0D */	li r5, 0xd
/* 80181768 0017D3C8  38 C0 00 00 */	li r6, 0
/* 8018176C 0017D3CC  38 E0 00 00 */	li r7, 0
/* 80181770 0017D3D0  39 00 00 00 */	li r8, 0
/* 80181774 0017D3D4  4B FF FD 91 */	bl func_80181504
/* 80181778 0017D3D8  2C 03 00 00 */	cmpwi r3, 0
/* 8018177C 0017D3DC  41 82 00 0C */	beq lbl_80181788
/* 80181780 0017D3E0  38 60 00 00 */	li r3, 0
/* 80181784 0017D3E4  48 00 00 34 */	b lbl_801817B8
lbl_80181788:
/* 80181788 0017D3E8  7F A3 EB 78 */	mr r3, r29
/* 8018178C 0017D3EC  7F C4 F3 78 */	mr r4, r30
/* 80181790 0017D3F0  38 A0 00 4C */	li r5, 0x4c
/* 80181794 0017D3F4  38 C0 00 00 */	li r6, 0
/* 80181798 0017D3F8  38 E0 00 00 */	li r7, 0
/* 8018179C 0017D3FC  39 00 00 00 */	li r8, 0
/* 801817A0 0017D400  4B FF FD 65 */	bl func_80181504
/* 801817A4 0017D404  2C 03 00 00 */	cmpwi r3, 0
/* 801817A8 0017D408  41 82 00 0C */	beq lbl_801817B4
/* 801817AC 0017D40C  38 60 00 00 */	li r3, 0
/* 801817B0 0017D410  48 00 00 08 */	b lbl_801817B8
lbl_801817B4:
/* 801817B4 0017D414  7F E3 FB 78 */	mr r3, r31
lbl_801817B8:
/* 801817B8 0017D418  39 61 00 20 */	addi r11, r1, 0x20
/* 801817BC 0017D41C  48 04 59 C1 */	bl _restgpr_29
/* 801817C0 0017D420  80 01 00 24 */	lwz r0, 0x24(r1)
/* 801817C4 0017D424  7C 08 03 A6 */	mtlr r0
/* 801817C8


 y + 0.00973333333333, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 0.001, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y - 0.01200000000007, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y - 0.0005, z, false))
                }

                "non-calculable" -> {
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 1E-5, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 1E-7, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y - 1E-6, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y - 1E-4, z, false))
                }

                "invalid" -> {
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 1E+27, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y - 1E+68, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 1E+41, z, false))
                }

                "verussmart" -> {
                    counter++
                    if (counter == 1) {
                        mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 0.001, z, true))
                        mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y, z, false))
                    }
                    if (counter >= 5)
                        counter = 0
                }

                "visual" -> mc.thePlayer.onCriticalHit(entity)

                "blocksmc" -> {
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 0.001091981, z, true))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y + 0.000114514, z, false))
                    mc.netHandler.addToSendQueue(C04PacketPlayerPosition(x, y, z, false))
                }
            }
            readyCrits = true
            msTimer.reset()
        }
    }

    @EventTarget
    fun onPacket(event: PacketEvent) {
        if (onlyAuraValue.get() && !LiquidBounce.moduleManager[KillAura::class.java]!!.state) return

        val packet = event.packet

        when (modeValue.get().lowercase(Locale.getDefault())) {
            "redesky" -> {
                if (packet is C03PacketPlayer) {
                    val packetPlayer: C03PacketPlayer = packet
                    if(mc.thePlayer.onGround && canCrits) {
                        packetPlayer.y += 0.000001
                        packetPlayer.onGround = false
                    }
                    if(mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.entityBoundingBox.offset(
                                    0.0, (mc.thePlayer.motionY - 0.08) * 0.98, 0.0).expand(0.0, 0.0, 0.0)).isEmpty()) {
                        packetPlayer.onGround = true
                    }
                }
                if(packet is C07PacketPlayerDigging) {
                    if(packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
                        canCrits = false
                    } else if(packet.status == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK || packet.status == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK) {
                        canCrits = true
                    }
                }
            }

            "noground" -> {
                if (packet is