local Array = require('Array')
local AABB = require('AABB')

local lastIndex = 0

local function _setTrajectoryAllowed(m, f, t, v)
  local u = m[f]
  if u == nil then
    if v == false then
      m[f] = {[t] = true}
    end
    return
  end
  if (v ~= false) ~= (u[t] ~= true) then
    if v then
      u[t] = nil
      if next(u) == nil then
        m[f] = nil
      end
    else
      u[t] = true
    end
  end
end

local function _setTrajectoryAttributes(m, f, t, v)
  local u = m[f]
  if u == nil then
    if v ~= nil then
      m[f] = {[t] = v}
    end
    return
  end
  if (v ~= nil) ~= (u[t] ~= nil) then
    if v == nil then
      u[t] = nil
      if next(u) == nil then
        m[f] = nil
      end
    else
      u[t] = v
    end
  end
end

local function _setEntryOffset(m, i, v, e)
  local l = m[i]
  if l == nil then
    l = {0,0}
    m[i] = l
  end
  l[e and 2 or 1] = v
end

---@class EditorIntersection : ClassBase
---@field name string
---@field points vec3[]
---@field aabb AABB
---@field trafficLightProgram string
---@field trafficLightParams SerializedTrafficLightParams
---@field trafficLightEmissive SerializedTrafficLightEmissiveParams[]
local EditorIntersection = class('EditorIntersection')

---@param points vec3[]|SerializedIntersection
---@return EditorIntersection
function EditorIntersection:initialize(points)
  lastIndex = lastIndex + 1
  self.uniqueID = lastIndex
  self.trajectoryAttributes = {}
  self.disallowedTrajectories = {}
  self.trafficLightParams = {}
  self.entryOffsets = {}
  self.entryPriorityOffsets = {}
  self.aabb = AABB()

  if vec3.isvec3(points[1]) then
    self.name = "Intersection #" .. lastIndex
    self.id = lastIndex
    self.points = points
  else
    -- deserialization
    self.name = points.name
    self.id = points.id or lastIndex
    self.points = Array(points.points, vec3.new)

    if points.disallowedTrajectories then
      for i = 1, #points.disallowedTrajectories do
        local e = points.disallowedTrajectories[i]
        _setTrajectoryAllowed(self.disallowedTrajectories, e[1], e[2], false)
      end
    end

    if points.trajectoryAttributes then
      for i = 1, #points.trajectoryAttributes do
        local e = points.trajectoryAttributes[i]
        _setTrajectoryAttributes(self.trajectoryAttributes, e[1], e[2], e[3])
      end
    end

    if points.entryOffsets then
      for i = 1, #points.entryOffsets do
        local e = points.entryOffsets[i]
        _setEntryOffset(self.entryOffsets, e.lane, e.offsets[1], false)
        _setEntryOffset(self.entryOffsets, e.lane, e.offsets[2], true)
      end
    end

    if points.entryPriorityOffsets then
      for i = 1, #points.entryPriorityOffsets do
        local e = points.entryPriorityOffsets[i]
        self.entryPriorityOffsets[e.lane] = e.offset
      end
    end

    if points.trafficLight then
      self.trafficLightProgram = points.trafficLight.program
      self.trafficLightParams = points.trafficLight.params or {}
      self.trafficLightEmissive = points.tra


/*

  Copyright (c) 2015, 2016 Hubert Denkmair

  This file is part of cangaroo.

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

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

  You should have received a copy of the GNU General Public License
  along with cangaroo.  If not, see <http://www.gnu.org/licenses/>.

*/

#pragma once

#include <QString>
#include <core/Backend.h>
#include <driver/CanDriver.h>

class CANBlasterInterface;
class SetupDialogInterfacePage;
class GenericCanSetupPage;

class CANBlasterDriver: public CanDriver {
public:
    CANBlasterDriver(Backend &backend);
    virtual ~CANBlasterDriver();

    virtual QString getName();
    virtual bool update();

private:
    CANBlasterInterface *createOrUpdateInterface(int index, QString name, bool fd_support);
    GenericCanSetupPage *setupPage;
};


ps declared in FooPropsMixin
  ///     // (used as the default for `exclude` since that's what `props` is statically typed as)
  ///     // when forwarding to Bar.
  ///     ..modifyProps(props.addPropsToForward())
  ///   )();
  /// });
  /// ```
  ///
  /// Component with a more than one props mixin:
  /// ```dart
  /// mixin FooPropsMixin on UiProps {
  ///   String? foo;
  /// }
  /// class FooProps = UiProps with BarProps, FooPropsMixin;
  ///
  /// UiFactory<FooProp> Foo = uiFunction((props) {
  ///   return (Bar()
  ///     // Filter out props declared in FooPropsMixin when forwarding to Bar.
  ///     ..modifyProps(props.addPropsToForward(exclude: {FooPropsMixin}))
  ///   )();
  /// });
  /// ```
  ///
  /// To only add DOM props, use the [domOnly] named argument.
  ///
  /// Related: `UiComponent2`'s `addUnconsumedProps`
  PropsModifier addPropsToForward({Set<Type>? exclude, bool domOnly = false}) {
    return (Map<dynamic, dynamic> props) {
      _propsToForward(exclude: exclude, domOnly: domOnly, propsToUpdate: props);
    };
  }

  Map _propsToForward({Set<Type>? exclude, bool domOnly = false, required Map propsToUpdate}) {
    Iterable<PropsMeta> consumedProps = [];
    try {
      consumedProps = staticMeta.forMixins(exclude ?? {T}).toList();
    } catch(_) {
      assert(exclude != null, ArgumentError('Could not find props meta for type $T.'
        ' If this is not a props mixin, you need to specify its mixins as the second argument.  For example:'
        '\n  ..addAll(props.getPropsToForward(exclude: {${T}Mixin})').message);
      rethrow;
    }
    final consumedPropKeys = consumedProps.map((consumedProps) => consumedProps.keys);
    forwardUnconsumedPropsV2(
      props,
      propsToUpdate: propsToUpdate,
      keySetsToOmit: consumedPropKeys,
      onlyCopyDomProps: domOnly,
    );
    return propsToUpdate;
  }
}

/// A [dart.collection.MapView]-like class with strongly-typed getters/setters for React state.
///
/// To be used with the over_react builder to generate concrete state implementations
/// with a component's declared state mixin(s).
abstract class UiState extends component_base.UiState with GeneratedClass {
  /// This class should not be instantiated directly, and throws an error to indicate this.
  UiState() {
    _throwIfNotGenerated();
  }

  @override @toBeGenerated Map get state => throw UngeneratedError(member: #state);
}

// ----------------------------------------------------------------------
//   Errors/annotations related to code generation
// ----------------------------------------------------------------------

/// Annotation that denotes that a given member will be implemented via code generation.
///
/// Used in place of the `abstract` keyword so that subclasses don't have to be abstract.
const toBeGenerated = _ToBeGenerated();

class _ToBeGenerated {
  const _ToBeGenerated();
}

/// Thrown when stubbed code (usually annotated with `ToBeGenerated`) that expects to be
/// overridden by generated code is called unexpectedly.
///
/// Usually this is due to improper usage of the code-generating builder.
class UngeneratedError extends Error implements UnimplementedError {
  @override
  final String message;
  UngeneratedError({String? message, Symbol? member}) :
      this.message = '${member != null ? '' : '`$member` should be implemented by code generation.\n\n'}$message';

  @override
  String toString() =>
      'UngeneratedError: ${message.trimRight()}.\n\n'
      'Ensure that you\'


    val CONVENTION_C = builder("convention").addArgument("c").build()
    val IMPLEMENTATION_ONLY = builder("_implementationOnly").build()
  }
}
/*
 * Copyright 2018 Outfox, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.outfoxx.swiftpoet

import io.outfoxx.swiftpoet.builder.BuilderWithDocs

class FileMemberSpec internal constructor(
  builder: Builder,
) : Taggable(builder.tags.toImmutableMap()) {

  val doc = builder.doc.build()
  val member = builder.member
  val guardTest = builder.guardTest.build()

  internal fun emit(out: CodeWriter): CodeWriter {

    out.emitDoc(doc)

    if (guardTest.isNotEmpty()) {
      out.emit("#if ")
      out.emitCode(guardTest)
      out.emit("\n")
    }

    when (member) {
      is AnyTypeSpec -> member.emit(out)
      is FunctionSpec -> member.emit(out, null, setOf(Modifier.INTERNAL))
      is PropertySpec -> member.emit(out, setOf(Modifier.INTERNAL))
      is ExtensionSpec -> member.emit(out)
      else -> throw AssertionError()
    }

    if (guardTest.isNotEmpty()) {
      out.emit("#endif")
      out.emit("\n")
    }

    return out
  }

  class Builder internal constructor(
    internal val member: Any,
  ) : Taggable.Builder<Builder>(), BuilderWithDocs<Builder> {

    internal val doc = CodeBlock.builder()
    internal val guardTest = CodeBlock.builder()

    override fun addDoc(format: String, vararg args: Any) = apply {
      doc.add(format, *args)
    }

    override fun addDoc(block: CodeBlock) = apply {
      doc.add(block)
    }

    fun addGuard(test: CodeBlock) = apply {
      guardTest.add(test)
    }

    fun addGuard(format: String, vararg args: Any) = apply {
      addGuard(CodeBlock.of(format, args))
    }

    fun build(): FileMemberSpec {
      return FileMemberSpec(this)
    }
  }

  companion object {

    @JvmStatic
    fun builder(member: AnyTypeSpec) = Builder(member)

    @JvmStatic
    fun builder(member: FunctionSpec) = Builder(member)

    @JvmStatic
    fun builder(member: PropertySpec) = Builder(member)

    @JvmStatic
    fun builder(member: ExtensionSpec) = Builder(member)
  }
}
/*
 * Copyright 2018 Outfox, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.outfoxx.swiftpoet

import io.outfoxx.swiftpoet.TypeVariableName.Bound.Constraint.SAME_TYPE

class TypeVariableName private constructor(
  override val name: String,
  val bounds: List<Bound>,
) : TypeName() {

  class Bound internal constructor(val constraint: Constraint? = null, val type


inity,
		    maxZoom = -Infinity,
		    oldZoomSpan = this._getZoomSpan();

		for (var i in this._zoomBoundLayers) {
			var options = this._zoomBoundLayers[i].options;

			minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);
			maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);
		}

		this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;
		this._layersMinZoom = minZoom === Infinity ? undefined : minZoom;

		// @section Map state change events
		// @event zoomlevelschange: Event
		// Fired when the number of zoomlevels on the map is changed due
		// to adding or removing a layer.
		if (oldZoomSpan !== this._getZoomSpan()) {
			this.fire('zoomlevelschange');
		}

		if (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {
			this.setZoom(this._layersMaxZoom);
		}
		if (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {
			this.setZoom(this._layersMinZoom);
		}
	}
});

/*
 * @class LayerGroup
 * @aka L.LayerGroup
 * @inherits Layer
 *
 * Used to group several layers and handle them as one. If you add it to the map,
 * any layers added or removed from the group will be added/removed on the map as
 * well. Extends `Layer`.
 *
 * @example
 *
 * ```js
 * L.layerGroup([marker1, marker2])
 * 	.addLayer(polyline)
 * 	.addTo(map);
 * ```
 */

var LayerGroup = Layer.extend({

	initialize: function (layers, options) {
		setOptions(this, options);

		this._layers = {};

		var i, len;

		if (layers) {
			for (i = 0, len = layers.length; i < len; i++) {
				this.addLayer(layers[i]);
			}
		}
	},

	// @method addLayer(layer: Layer): this
	// Adds the given layer to the group.
	addLayer: function (layer) {
		var id = this.getLayerId(layer);

		this._layers[id] = layer;

		if (this._map) {
			this._map.addLayer(layer);
		}

		return this;
	},

	// @method removeLayer(layer: Layer): this
	// Removes the given layer from the group.
	// @alternative
	// @method removeLayer(id: Number): this
	// Removes the layer with the given internal ID from the group.
	removeLayer: function (layer) {
		var id = layer in this._layers ? layer : this.getLayerId(layer);

		if (this._map && this._layers[id]) {
			this._map.removeLayer(this._layers[id]);
		}

		delete this._layers[id];

		return this;
	},

	// @method hasLayer(layer: Layer): Boolean
	// Returns `true` if the given layer is currently added to the group.
	// @alternative
	// @method hasLayer(id: Number): Boolean
	// Returns `true` if the given internal ID is currently added to the group.
	hasLayer: function (layer) {
		if (!layer) { return false; }
		var layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);
		return layerId in this._layers;
	},

	// @method clearLayers(): this
	// Removes all the layers from the group.
	clearLayers: function () {
		return this.eachLayer(this.removeLayer, this);
	},

	// @method invoke(methodName: String, …): this
	// Calls `methodName` on every layer contained in this group, passing any
	// additional parameters. Has no effect if the layers cont


se DRETURN        : genReturn(frameState.pop(JavaKind.Double), JavaKind.Double); break;
            case ARETURN        : genReturn(frameState.pop(JavaKind.Object), JavaKind.Object); break;
            case RETURN         : genReturn(null, JavaKind.Void); break;
            case GETSTATIC      : cpi = stream.readCPI(); genGetStatic(cpi, opcode); break;
            case PUTSTATIC      : cpi = stream.readCPI(); genPutStatic(cpi, opcode); break;
            case GETFIELD       : cpi = stream.readCPI(); genGetField(cpi, opcode); break;
            case PUTFIELD       : cpi = stream.readCPI(); genPutField(cpi, opcode); break;
            case INVOKEVIRTUAL  : cpi = stream.readCPI(); genInvokeVirtual(cpi, opcode); break;
            case INVOKESPECIAL  : cpi = stream.readCPI(); genInvokeSpecial(cpi, opcode); break;
            case INVOKESTATIC   : cpi = stream.readCPI(); genInvokeStatic(cpi, opcode); break;
            case INVOKEINTERFACE: cpi = stream.readCPI(); genInvokeInterface(cpi, opcode); break;
            case INVOKEDYNAMIC  : cpi = stream.readCPI4(); genInvokeDynamic(cpi, opcode); break;
            case NEW            : genNewInstance(stream.readCPI()); break;
            case NEWARRAY       : genNewPrimitiveArray(stream.readLocalIndex()); break;
            case ANEWARRAY      : genNewObjectArray(stream.readCPI()); break;
            case ARRAYLENGTH    : genArrayLength(); break;
            case ATHROW         : genThrow(); break;
            case CHECKCAST      : genCheckCast(stream.readCPI()); break;
            case INSTANCEOF     : genInstanceOf(stream.readCPI()); break;
            case MONITORENTER   : genMonitorEnter(frameState.pop(JavaKind.Object), stream.nextBCI()); break;
            case MONITOREXIT    : genMonitorExit(frameState.pop(JavaKind.Object), null, stream.nextBCI(), false, true); break;
            case MULTIANEWARRAY : genNewMultiArray(stream.readCPI()); break;
            case IFNULL         : genIfNull(Condition.EQ); break;
            case IFNONNULL      : genIfNull(Condition.NE); break;
            case GOTO_W         : genGoto(); break;
            case JSR_W          : genJsr(stream.readBranchDest()); break;
            case BREAKPOINT     : throw new PermanentBailoutException("concurrent setting of breakpoint");
            default             : throw new PermanentBailoutException("Unsupported opcode %d (%s) [bci=%d]", opcode, nameOf(opcode), bci);
        }
        // @formatter:on
        // Checkstyle: resume
    }

    private void genArrayLength() {
        ValueNode array = frameState.pop(JavaKind.Object);
        frameState.push(JavaKind.Int, append(genArrayLength(array)));
    }

    @Override
    public ResolvedJavaMethod getMethod() {
        return method;
    }

    @Override
    public Bytecode getCode() {
        return code;
    }

    public FrameStateBuilder getFrameStateBuilder() {
        return frameState;
    }

    private boolean firstTraceEmitted;

    protected void traceInstruction(int bci, int opcode, boolean blockStart) {
        String indent = new String(new char[getDepth() * 2]).replace('\0', ' ');
        StringBuilder sb = new StringBuilder(40);
        String nl = System.lineSeparator();
        if (!firstTraceEmitted) {
            sb.append(indent).append(method.format("Parsing %H.%n(%p)%r")).append(nl);
            if (traceLevel >= TRACELEVEL_BLOCKMAP) {
                sb.append(indent).append("Blocks:").append(nl);
                String bm = blockMap.toString().replace(nl, nl + indent


Unbound Textures", priority = 303)]
        static void AssetsCleanMaterials_CleanUnboundTextures()
        {
            IEnumerable<Material> materials = Selection.objects.Where(o => o is Material).Select(o => o as Material);
            foreach (Materia


camera.cleanup.html)

Permissions
-----------

### Android

#### app/res/xml/config.xml

    <plugin name="Camera" value="org.apache.cordova.CameraLauncher" />

#### app/AndroidManifest

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

### Bada

#### manifest.xml

    <Privilege>
        <Name>CAMERA</Name>
    </Privilege>
    <Privilege>
        <Name>RECORDING</Name>
    </Privilege>

### BlackBerry WebWorks

#### www/plugins.xml

    <plugin name="Camera" value="org.apache.cordova.camera.Camera" />

#### www/config.xml

    <feature id="blackberry.media.camera" />

    <rim:permissions>
        <rim:permit>use_camera</rim:permit>
    </rim:permissions>

### iOS

#### config.xml

    <plugin name="Camera" value="CDVCamera" />

### webOS

    No permissions are required.

### Windows Phone

#### Properties/WPAppManifest.xml

    <Capabilities>
        <Capability Name="ID_CAP_ISV_CAMERA" />
        <Capability Name="ID_HW_FRONTCAMERA" />
    </Capabilities>

Reference: [Application Manifest for Windows Phone](http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx)

### Tizen

#### config.xml

    <feature name="http://tizen.org/api/application" required="true"/>
    <feature name="http://tizen.org/api/application.launch" required="true"/>

Reference: [Application Manifest for Tizen Web Application](https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures)
# 使用二分搜索法的 Python 数字猜谜游戏

> 原文:[https://www . geesforgeks . org/number-猜测-python 中的游戏-使用-binary-search/](https://www.geeksforgeeks.org/number-guessing-game-in-python-using-binary-search/)

在猜数字游戏中，用户选择一个定义范围内的数字，然后程序猜测该数字。如果猜测的数字是错误的，那么用户告诉程序实际数字是否大于猜测的数字。同样，程序再次猜测数字，直到实际数字没有被猜到。
**方法:**想法是使用[二分搜索法](https://www.geeksforgeeks.org/binary-search/)，在每一步中减少搜索空间的一半。以下是方法说明:

*   初始化猜测数字的开始和结束范围。
*   猜测数字作为搜索空间的中间。那就是
    ![Number = \frac{startRange + endRange}{2} ](img/9dc24aa44ba77ccac98553564e16868b.png "Rendered by QuickLaTeX.com")

*   如果猜测的数字是正确的，那么终止程序。
*   否则，询问用户猜测数是否小于猜测数。如果是，则相应减少搜索空间。

以下是上述方法的实现:

## 计算机编程语言

```
# Python implementation for the
# number guessing using
# Binary Search

# Global Arguments for playing game
args = ["N", "N", "Y"]
index = -1

# Temporary function for taking
# input from the local arguments list
def input():
    global index, args;
    index += 1
    return args[index]

# Function to guess the number in
# a defined range of the number
def guessNumber(startRange, endRange):
    if startRange > endRange:
        return True

    # Middle of the range
    mid = (startRange + endRange)//2

    # Asking user about the
    # actual number
    print("Is the number is ",
        mid, "?", end = " ")
    user = input()
    print


2, [r3, #724]
	ldr	r3, [r0, #1952]
	ldr	r2, [r4, #676]
	str	r2, [r3, #732]
	ldr	r3, [r0, #1952]
	ldr	r2, [r4, #684]
	str	r2, [r3, #728]
	ldr	r3, [r0, #1952]
	ldr	r1, [r3, #728]
	ldr	r2, [r3, #764]
	add	r2, r2, r1
	str	r2, [r3, #692]
	str	r2, [r3, #664]
	ldr	r2, [r0, #1952]
	ldrb	r3, [r2]	@ zero_extendqisi2
	cmp	r3, #0
	ldrneb	r3, [r4, #2]	@ zero_extendqisi2
	strb	r3, [r2]
	ldr	r3, [fp, #-48]
	ldr	r2, [r3, #1952]
	ldrb	r3, [r2, #1]	@ zero_extendqisi2
	orr	r3, r3, #1
	strb	r3, [r2, #1]
	ldrb	r3, [r4, #7]	@ zero_extendqisi2
	ldr	r1, [fp, #-48]
	cmp	r3, #1
	ldr	r3, [fp, #-48]
	ldr	r3, [r3, #1952]
	ldrb	r2, [r3, #3]	@ zero_extendqisi2
	orreq	r2, r2, #1
	strb	r2, [r3, #3]
	mov	r2, #624
	ldr	lr, [r1, #1952]
	add	r1, r4, #16
	add	ip, lr, r2
	add	r0, lr, #8
	ldr	r3, [lr, #608]
	ldrd	r6, [ip, #-8]
	ldr	r10, [lr, #16]
	str	r3, [fp, #-72]
	strd	r6, [fp, #-60]
	ldr	r3, [lr, #612]
	ldrd	r6, [ip]
	ldr	ip, [lr, #20]
	ldr	r8, [lr, #24]
	strd	r6, [fp, #-68]
	mov	r6, r3
	str	ip, [fp, #-52]
	ldr	r7, [lr, #28]
	bl	memcpy
	ldr	r3, [fp, #-72]
	add	r2, r4, #624
	and	ip, r3, r6
	ldmdb	r2, {r0, lr}
	adds	r1, ip, #1
	ldr	ip, [fp, #-52]
	and	r0, r0, lr
	movne	r1, #1
	cmn	r0, #1
	movne	r1, #0
	cmp	r1, #0
	ldrne	r1, [fp, #-48]
	ldrne	r1, [r1, #1952]
	strne	r3, [r1, #608]
	movne	r3, r6
	strne	r3, [r1, #612]
	ldr	r1, [fp, #-48]
	ldrd	r2, [r2]
	ldr	lr, [r1, #1952]
	ldrd	r0, [fp, #-60]
	cmp	r3, r1
	add	r1, lr, #624


Operations\x120.buildbarn.buildqueuestate.ListOperationsRequest\x1a1.buildbarn.buildqueuestate.ListOperationsResponse\x12Z\n" +
	"\x0eKillOperations\x120.buildbarn.buildqueuestate.KillOperationsRequest\x1a\x16.google.protobuf.Empty\x12c\n" +
	"\x12ListPlatformQueues\x12\x16.google.protobuf.Empty\x1a5.buildbarn.buildqueuestate.ListPlatformQueuesResponse\x12\x8d\x01\n" +
	"\x16ListInvocationChildren\x128.buildbarn.buildqueuestate.ListInvocationChildrenRequest\x1a9.buildbarn.buildqueuestate.ListInvocationChildrenResponse\x12\x87\x01\n" +
	"\x14ListQueuedOperations\x126.buildbarn.buildqueuestate.ListQueuedOperationsRequest\x1a7.buildbarn.buildqueuestate.ListQueuedOperationsResponse\x12l\n" +
	"\vListWorkers\x12-.buildbarn.buildqueuestate.ListWorkersRequest\x1a..buildbarn.buildqueuestate.ListWorkersResponse\x12^\n" +
	"\x10TerminateWorkers\x122.buildbarn.buildqueuestate.TerminateWorkersRequest\x1a\x16.google.protobuf.Empty\x12i\n" +
	"\n" +
	"ListDrains\x12,.buildbarn.buildqueuestate.ListDrainsRequest\x1a-.buildbarn.buildqueuestate.ListDrainsResponse\x12V\n" +
	"\bAddDrain\x122.buildbarn.buildqueuestate.AddOrRemoveDrainRequest\x1a\x16.google.protobuf.Empty\x12Y\n" +
	"\vRemoveDrain\x122.buildbarn.buildqueuestate.AddOrRemoveDrainRequest\x1a\x16.google.protobuf.EmptyBDZBgithub.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestateb\x06proto3"

var (
	file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescOnce sync.Once
	file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData []byte
)

func file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP() []byte {
	file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescOnce.Do(func() {
		file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc)))
	})
	return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData
}

var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes = make([]protoimpl.MessageInfo, 39)
var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_goTypes = []any{
	(ListInvocationChildrenRequest_Filter)(0),     // 0: buildbarn.buildqueuestate.ListInvocationChildrenRequest.Filter
	(*PaginationInfo)(nil),                        // 1: buildbarn.buildqueuestate.PaginationInfo
	(*PlatformQueueName)(nil),                     // 2: buildbarn.buildqueuestate.PlatformQueueName
	(*SizeClassQueueName)(nil),                    // 3: buildbarn.buildqueuestate.SizeClassQueueName
	(*InvocationName)(nil),                        // 4: b


ャパシタ", "アクティブアイテムが 部屋クリア時にチャージ されなくなる代わりに、 20%の確率で報酬に電池が 追加される#確率は運4.34で最大33%に"}, -- Old Capacitor
    [144] = {"144", "ブレイン ワーム", "外れた涙が90度ターンして 敵に向かう"}, -- Brain Worm
    [145] = {"145", "パーフェクション", "↑ 運 +10#ダメージを受けると消滅"}, -- Perfection
    [146] = {"146", "悪魔の王冠", "トレジャールームの アイテムが悪魔取引に 置き換わる"}, -- Devil's Crown
    [147] = {"147", "充電済みのペニー", "コイン取得時、17%の確率で アクティブアイテムが 1チャージされる#高額コインほど高確率"}, -- Charged Penny
    [148] = {"148", "友情のネックレス", "追従タイプの使い魔が アイザックを周回する ようになる"}, -- Friendship Necklace
    [149] = {"149", "パニック ボタン", "ダメージを受ける直前に アクティブアイテムの 効果が自動的に発動する#フルチャージされている 時のみ発動する"}, -- Panic Button
    [150] = {"150", "ブルー キー", "鍵を消費せずにドアを 開くことができる#鍵付きのドアを通ると、 二部屋の中間のように 機能する青い部屋に 移動する#青い部屋は出ると消滅し、 ドアは通常の挙動に戻る"}, -- Blue Key
    [151] = {"151", "フラット ファイル", "ドア・床・岩・宝箱・ 敵からトゲを取り除き、 無害化する"}, -- Flat File
    [152] = {"152", "望遠鏡レンズ", "プラネタリウムの出現率+9%#プラネタリウムに未訪問の 場合、追加で+15%#子宮／コープスフロアでも プラネタリウムが出現可能に"}, -- Telescope Lens
    [153] = {"153", "ママの髪束", "部屋に入った時、25%の 確率でランダムなママ 関連アイテムの効果が 付与される"}, -- Mom's Lock
    [154] = {"154", "ダイス バッグ", "新しい部屋に入った時、 50%の確率でランダムな ダイス系のアイテムが 消耗品スロットに追加 され、カード／ピルの ように使用できる#ダイスが追加されても、 保持中のカード／ピルは そのまま保持される#ダイスは部屋を出ると 消滅する"}, -- Dice Bag
    [155] = {"155", "ホーリー クラウン", "保持して大聖堂に 移動すると、お店と トレジャールームが 生成される"}, -- Holy Crown
    [156] = {"156", "マザーズ キス", "保持中、最大体力 +1#キーパーでも有効"}, -- Moth


12, 19, 26, 33], "/mycomponents": 2, "\u3053\u3063": [2, 32], "\u5185\u5bb9": [2, 10, 12, 19, 25, 26, 28, 30, 32, 33], "jsconfig": 2, "\u66f8\u3051": [2, 3, 13, 15, 16, 21, 23, 24, 26, 29], "veter": 2, "\u89e3\u91c8": [2, 18, 21, 23, 28, 30, 34], "-resolver": 2, "\u5165\u308c\u308c": 2, "\u3082\u3053\u306e": 2, "baseurl": [2, 21], ".\"": 2, "paths": [2, 21], "/*": [2, 8, 12, 14, 16, 20, 21, 34], "[\"": [2, 8, 9, 12, 16, 20, 21, 22, 23, 30], "\"]": [2, 8, 9, 12, 16, 20, 21, 22, 23, 26, 30, 34], "\u53d6\u5f97": [2, 7, 9, 12, 15, 24, 26, 28, 33], "modulenamemapper": [2, 21], "(.": [2, 22], "*)": 2, "$\"": 2, "\"<": [2, 21], "rootdir": [2, 21], ">/": [2, 21], "/$": [2, 14, 22], "\u5358\u306a\u308b": [2, 9, 22, 26, 30], "\u30a8\u30a4\u30ea\u30a2\u30b9": [2, 7, 28], "\u7279\u306b": [2, 3, 4, 10, 17, 24, 26, 29, 32], "targert": 2, "..": [2, 12, 16, 20, 21, 26, 34], "/..": [2, 21], "/components": 2, "/target": 2, "\u9577\u304f": [2, 22], "\u30b3\u30d4\u30fc": [2, 9, 12, 26], "\u6614\u3082": 3, "\u30a6\u30a7\u30d6\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9": [3, 8, 14, 19, 23, 26, 32, 33], "/typescript": [3, 9, 12, 13, 19, 21, 23, 24], "\u4e3b\u6226\u5834": 3, "\u30e1\u30b8\u30e3\u30fc": [3, 32], "\u672c\u66f8": [3, 6, 12, 14, 15, 19, 26, 28, 33], "\u53d6\u308a\u4e0a\u3052\u308b": 3, "\u30d9\u30fc\u30b9": [3, 8, 14, 15, 19, 21, 22, 23, 24, 28, 30], "\u7d71\u5408": [3, 28], "\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af": 3, "\u53d6\u308a\u4e0a\u3052": [3, 6, 7, 9, 21, 31], "\u3002angular": 3, "\u66f8\u304d\u76f4\u3055": 3, "\u72b6\u614b": [3, 9, 10, 12, 21, 25, 26, 30, 31, 33], "\u30d7\u30ed\u30b8\u30a7\u30af\u30c8": [3, 8, 9, 12, 13, 14, 15, 19, 21, 23, 25, 26, 30, 32, 33, 34], "\u4f5c\u6210": [3, 6, 9,


        match self {
            &Value::Int(ref datum) => {
                let datum_str = &datum.to_string();

                let mut encoded = String::with_capacity(datum_str.len() + 3);

                encoded.push(':');

                encoded.push_str(datum_str);

                encoded.push_str("\r\n");

                encoded
            }

            &Value::Str(ref datum) => {
                let mut encoded = String::with_capacity(datum.len() + 3);

                encoded.push('+');

                encoded.push_str(datum);

                encoded.push_str("\r\n");

                encoded
            }

            &Value::Err(ref datum) => {
                let mut encoded = String::with_capacity(datum.len() + 3);

                encoded.push('-');

                encoded.push_str(datum);

                encoded.push_str("\r\n");

                encoded
            }

            &Value::BStr(ref inner) => match inner {
                &None => Value::ENCODED_NULL_BSTR.to_owned(),

                &Some(ref datum) => match datum.len() {
                    0 => Value::ENCODED_EMPTY_BSTR.to_owned(),

                    len => {
                        let len_str = &len.to_string();

                        let mut encoded = String::with_capacity(len + len_str.len() + 5);

                        encoded.push('$');

                        encoded.push_str(len_str);

                        encoded.push_str("\r\n");

                        encoded.push_str(datum);

                        encoded.push_str("\r\n");

                        encoded
                    }
                },
            },

            &Value::Array(ref inner) => match inner {
                &None => Value::ENCODED_NULL_ARRAY.to_owned(),

                &Some(ref data) => match data.len() {
                    0 => Value::ENCODED_EMPTY_ARRAY.to_owned(),

                    len => {
                        let len_str = len.to_string();

                        let mut encoded_len = len_str.len() + 3;

                        let encoded_values: Vec<String> = {
                            data.iter()
                                .map(|value| {
                                    let encoded = value.encode();

                                    encoded_len += encoded.len();

                                    encoded
                                })
                                .collect()
                        };

                        let mut encoded = String::with_capacity(encoded_len);

                        encoded.push('*');

                        encoded.push_str(&len_str);

                        encoded.push_str("\r\n");

                        encoded.push_str(&encoded_values.concat());

                        encoded
                    }
                },
            },
        }
    }

    /// Encodes a `Value` as a vector of bytes.
    ///
    /// # Examples
    ///
    /// ```
    /// # use lib_resp::Value;
    /// let error = Value::err("ERR");
    ///
    /// assert_eq!(&error.encode_bytes(), b"-ERR\r\n");
    /// ```
    #[inline(always)]
    pub fn encode_


 = q.getColumnId(); // 0-based
						String colName = ( null != logicalTableRSMD ? logicalTableRSMD.getColumnName( colID+1 ) : "C" + (colID+1) );

						sqlWhereClause.append( colName );

						String orderable = getFormattedValueOfOrderable( q );

						if ( null == orderable )
							sqlWhereClause.append ( q.negateCompareResult() ? " IS NOT NULL" : " IS NULL" );
						else {
							sqlWhereClause.append( getOrderingOperatorString( q ) );
							sqlWhereClause.append( orderable );
						}
					}

					// Consider adding a closing bracket if this is the second row or above and it had more than one element
					if ( 0 < x && 1 < qualifiers[x].length ) {
						// Add a closing bracket as long as:
						//		   - this is the 3rd row or above
						//		or - the 1st row (of ANDs) had some elements
						//		or - there are more than 2 rows
						if ( 1 < x || 0 < qualifiers[0].length || 2 < qualifiers.length ) sqlWhereClause.append(')');
					}
				}
			}
		} catch ( Exception e ) {
			System.err.println("Exception building WHERE clause: " + e);
		}

		return sqlWhereClause.toString();
	}

	private static String getOrderingOperatorString( Qualifier q ) throws SQLException {
		int operator = q.getOperator();
		boolean negate = q.negateCompareResult();
		switch ( operator ) {
			case Orderable.ORDER_OP_EQUALS: return negate ? "!=" : "=";
			case Orderable.ORDER_OP_GREATEROREQUALS: return negate ? "<" : ">=";
			case Orderable.ORDER_OP_GREATERTHAN: return negate ? "<=" : ">";
			case Orderable.ORDER_OP_LESSOREQUALS: return negate ? ">" : "<=";
			case Orderable.ORDER_OP_LESSTHAN: return negate ? ">=" : "<";
		}
		String errmsg = "Invalid operator detected (not one of the Orderable interface): " + operator;
		System.err.println("DERBY ERROR: " + errmsg);
		throw new SQLException( errmsg );
	}

	private static String getFormattedValueOfOrderable( Qualifier q ) throws SQLException {

		try {
			DataValueDescriptor dvd = q.getOrderable();
			if ( dvd.isNull() ) return null;
			String value = dvd.getString();
			int jdbcType = TypeId.getBuiltInTypeId( dvd.getTypeName() ).getJDBCTypeId();
//			logInfo("Getting value for JDBC type: " + jdbcType);
			switch ( jdbcType ) {
				case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case Types.CLOB:
				case Types.DATE: case Types.TIME: case Types.TIMESTAMP: return "'" + value + "'";
				default: return value;
			}
		} catch (StandardException e) {
			String errmsg = "Could not get Orderable value from Qualifier: " + e;
			System.err.println("DERBY ERROR: " + errmsg);
			throw new SQLException( errmsg );
		}
	}
}
/*
 * (C) Copyright IBM Corp. 2011
 *
 * LICENSE: Eclipse Public License v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 */

package com.ibm.db2j;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLSyntaxErrorException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays


 "the spsc buffer must have a length representable in two bits less than half a usize");
//     //     Self::make(Slice::BorrowedPtrLen(NonNull::new_unchecked(ptr), len))
//     // }

}

#[derive(Debug,Default)]
pub struct Atomics {
    state:    AtomicUsize,
    #[cfg(feature="async")]
    sender:   AtomicWaker,
    #[cfg(feature="async")]
    receiver: AtomicWaker,
}

impl Atomics {
    fn drop_wakers(&self) {
        let _s = self.sender.take();
        let _r = self.receiver.take();
    }
}

#[derive(Debug,Eq,Hash,PartialEq)]
pub struct SendError<T> {
    pub kind:  SendErrorKind,
    pub value: T,
}
#[derive(Debug,Eq,Hash,PartialEq)]
pub enum SendErrorKind {
    Closed,
    Full,
}

#[derive(Debug,Eq,Hash,PartialEq)]
pub struct Closed;
<reponame>proda-ai/cached-nix-shell
use std::env::{var, var_os};
use std::path::Path;
use std::process::Command;

fn main() {
    if var_os("CNS_IN_NIX_SHELL").is_none() {
        // Release build triggered by nix-build. Use paths relative to $out.
        let out = var("out").unwrap();
        println!("cargo:rustc-env=CNS_TRACE_NIX_SO={}/lib/trace-nix.so", out);
        println!("cargo:rustc-env=CNS_VAR_EMPTY={}/var/empty", out);
        println!(
            "cargo:rustc-env=CNS_RCFILE={}/share/cached-nix-shell/rcfile.sh",
            out
        );
        println!(
            "cargo:rustc-env=CNS_WRAP_PATH={}/libexec/cached-nix-shell",
            out
        );

        // Use pinned nix and nix-shell binaries.
        println!(
            "cargo:rustc-env=CNS_NIX={}/",
            which::which("nix")
                .expect("command not found: nix")
                .parent()
                .unwrap()
                .as_os_str()
                .to_str()
                .unwrap()
        );
    } else {
        // Developer build triggered by `nix-shell --run 'cargo build'`.
        // Use paths relative to the build directory. Additionally, place
        // trace-nix.so and a symlink to the build directory.
        let out_dir = var("OUT_DIR").unwrap();
        let cmd = Command::new("make")
            .args(&[
                "-C",
                "nix-trace",
                &format!("DESTDIR={}", out_dir),
                &format!("{}/trace-nix.so", out_dir),
            ])
            .status()
            .unwrap();
        assert!(cmd.success());

        println!("cargo:rustc-env=CNS_TRACE_NIX_SO={}/trace-nix.so", out_dir);
        println!("cargo:rustc-env=CNS_VAR_EMPTY=/var/empty");
        println!(
            "cargo:rustc-env=CNS_RCFILE={}/rcfile.sh",
            var("CARGO_MANIFEST_DIR").unwrap()
        );

        if Path::new(&format!("{}/wrapper", out_dir)).exists() {
            std::fs::remove_dir_all(format!("{}/wrapper", out_dir)).unwrap();
        }
        std::fs::create_dir_all(format!("{}/wrapper", out_dir)).unwrap();
        std::os::unix::fs::symlink(
            "../../../../cached-nix-shell",
            format!("{}/wrapper/nix-shell", out_dir),
        )
        .unwrap();


/* Generated by RuntimeBrowser
   Image: /System/Library/PrivateFrameworks/FTServices.framework/FTServices
 */

@interface IDSAcceptMessage : IDSFaceTimeMessage <NSCopying> {
    NSData * _peerBlob;
    NSString * _peerID;
    NSData * _peerNATIP;
    NSNumber * _peerNATType;
    NSData * _peerPushToken;
    NSData * _peerRelayIP;
    NSNumber * _peerRelayPort;
    NSData * _relayConnectionId;
    NSData * _relayTokenAllocReq;
    NSData * _relayTransactionIdAlloc;
    NSNumber * _relayType;
    NSData * _selfBlob;
    NSData * _selfNATIP;
    NSNumber * _selfNATType;
    NSData * _selfPushToken;
    NSData * _selfRelayIP;
    NSNumber * _selfRelayPort;
}

@property (copy) NSData *peerBlob;
@property (copy) NSString *peerID;
@property (copy) NSData *peerNATIP;
@property (copy) NSNumber *peerNATType;
@property (copy) NSData *peerPushToken;
@property (copy) NSData *peerRelayIP;
@property (copy) NSNumber *peerRelayPort;
@property (copy) NSData *relayConnectionId;
@property (copy) NSData *relayTokenAllocReq;
@property (copy) NSData *relayTransactionIdAlloc;
@property (copy) NSNumber *relayType;
@property (copy) NSData *selfBlob;
@property (copy) NSData *selfNATIP;
@property (copy) NSNumber *selfNATType;
@property (copy) NSData *selfPushToken;
@property (copy) NSData *selfRelayIP;
@property (copy) NSNumber *selfRelayPort;

- (id)bagKey;
- (id)copyWithZone:(struct _NSZone { }*)arg1;
- (void)dealloc;
- (void)handleResponseDictionary:(id)arg1;
- (id)init;
- (id)messageBody;
- (id)peerBlob;
- (id)peerID;
- (id)peerNATIP;
- (id)peerNATType;
- (id)peerPushToken;
- (id)peerRelayIP;
- (id)peerRelayPort;
- (id)relayConnectionId;
- (id)relayTokenAllocReq;
- (id)relayTransactionIdAlloc;
- (id)relayType;
- (id)requiredKeys;
- (id)selfBlob;
- (id)selfNATIP;
- (id)selfNATType;
- (id)selfPushToken;
- (id)selfRelayIP;
- (id)selfRelayPort;
- (void)setPeerBlob:(id)arg1;
- (void)setPeerID:(id)arg1;
- (void)setPeerNATIP:(id)arg1;
- (void)setPeerNATType:(id)arg1;
- (void)setPeerPushToken:(id)arg1;
- (void)setPeerRelayIP:(id)arg1;
- (void)setPeerRelayPort:(id)arg1;
- (void)setRelayConnectionId:(id)arg1;
- (void)setRelayTokenAllocReq:(id)arg1;
- (void)setRelayTransactionIdAlloc:(id)arg1;
- (void)setRelayType:(id)arg1;
- (void)setSelfBlob:(id)arg1;
- (void)setSelfNATIP:(id)arg1;
- (void)setSelfNATType:(id)arg1;
- (void)setSelfPushToken:(id)arg1;
- (void)setSelfRelayIP:(id)arg1;
- (void)setSelfRelayPort:(id)arg1;

@end


T> &&
            (identical(other.key, key) || other.key == key) &&
            const DeepCollectionEquality().equals(other.value, value) &&
            const DeepCollectionEquality()
                .equals(other.initialValue, initialValue));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      key,
      const DeepCollectionEquality().hash(value),
      const DeepCollectionEquality().hash(initialValue));

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$_StoredValueCopyWith<T, _$_StoredValue<T>> get copyWith =>
      __$$_StoredValueCopyWithImpl<T, _$_StoredValue<T>>(this, _$identity);
}

abstract class _StoredValue<T> extends StoredValue<T> {
  factory _StoredValue(
      {required final StoredValueKeys key,
      required final T? value,
      final T? initialValue}) = _$_StoredValue<T>;
  _StoredValue._() : super._();

  @override
  StoredValueKeys get key;
  @override
  T? get value;
  @override
  T? get initialValue;
  @override
  @JsonKey(ignore: true)
  _$$_StoredValueCopyWith<T, _$_StoredValue<T>> get copyWith =>
      throw _privateConstructorUsedError;
}
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'emulator.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');

/// @nodoc
mixin _$Emulator {
  String get id => throw _privateConstructorUsedError;
  String get name => throw _privateConstructorUsedError;
  EmulatorFilesystemInterface get filesystem =>
      throw _privateConstructorUsedError;
  bool get hasMetadataSupport => throw _privateConstructorUsedError;
  String get path => throw _privateConstructorUsedError;

  @JsonKey(ignore: true)
  $EmulatorCopyWith<Emulator> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $EmulatorCopyWith<$Res> {
  factory $EmulatorCopyWith(Emulator value, $Res Function(Emulator) then) =
      _$EmulatorCopyWithImpl<$Res, Emulator>;
  @useResult
  $Res call(
      {String id,
      String name,
      EmulatorFilesystemInterface filesystem,
      bool hasMetadataSupport,
      String path});
}

/// @nodoc
class _$EmulatorCopyWithImpl<$Res, $Val extends Emulator>
    implements $EmulatorCopyWith<$Res> {
  _$EmulatorCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? id = null,
    Object? name = null,
    Object? filesystem = null,
    Object? hasMetadataSupport = null,
    Object? path = null,
  }) {
    return _then(_v


and(flag.inv())
}

/**
 * @return An array with the set bit flags.
 */
inline fun Long.getBitFlags(): Array<Long> {
    val found = ArrayList<Long>(countOneBits())
    for (i in 0..31) {
        val nextFlag = 1L.shl(i)
        if (this.and(nextFlag) == nextFlag) {
            found.add(nextFlag)
        }
    }
    return found.toTypedArray()
}

/**
 * @return `null` if the receiver is zero. Otherwise, the receiver is returned.
 */
inline fun Long.zeroAsNull() = if (this == 0L) null else this

/**
 * @return 0 if the receiver is `null`. Otherwise, the receiver is returned.
 */
inline fun Long?.nullAsZero() = this ?: 0L

/**
 * @return `null` if the receiver is negative. Otherwise, the receiver is returned.
 */
inline fun Long.negativeAsNull() = if (this < 0L) null else this

/**
 * @return 0 if the receiver is negative. Otherwise, the receiver is returned.
 */
inline fun Long.negativeAsZero() = if (this < 0L) 0L else this

/**
 * @return `null` if the receiver is positive. Otherwise, the receiver is returned.
 */
inline fun Long.positiveAsNull() = if (this > 0L) null else this

/**
 * @return 0 if the receiver is positive. Otherwise, the receiver is returned.
 */
inline fun Long.positiveAsZero() = if (this > 0L) 0L else this

/**
 * @return `true` if the receiver is negative.
 */
inline fun Long.isNegative() = this < 0L

/**
 * @return `true` if the receiver is positive.
 */
inline fun Long.isPositive() = this > 0L

/**
 * @return `true` it the receiver is zero.
 */
inline fun Long.isZero() = this == 0L

/**
 * @return `true` if the receiver is not negative.
 */
inline fun Long.isNotNegative() = this >= 0L

/**
 * @return `true` if the receiver is not positive.
 */
inline fun Long.isNotPositive() = this <= 0L

/**
 * @return `true` it the receiver is not zero.
 */
inline fun Long.isNotZero() = this != 0L

/**
 * @return `true` if the receiver is `null` or negative.
 */
inline fun Long?.isNullOrNegative() = this == null || this < 0L

/**
 * @return `true` if the receiver is `null` or positive.
 */
inline fun Long?.isNullOrPositive() = this == null || this > 0L

/**
 * @return `true` it the receiver is `null` or zero.
 */
inline fun Long?.isNullOrZero() = this == null || this == 0L/*
 * Copyright (C) 2023 Fabian Andera
 *
 * 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.
 *
 */

@file:Suppress("NOTHING_TO_INLINE", "unused")

package com.conena.nanokt.jvm

import java.io.PrintStream
import java.io.PrintWriter

/**
 * Prints the stack trace of the exception if the result is [Result.isFailure] to the given [stream].
 * @return The receiver object, for chaining multiple calls.
 */
inline fun <T> Result<T>.printStackTraceOnFailure(stream: PrintStream): Result<T> {
    exceptionOrNull()?.printStackTrace(stream = stream)
    return this
}

/**
 * Prints the stack trace of the exception if the result is [Result.isFailure] to the given [writer].
 * @return


c24}.xchart .color7 .line .fill{pointer-events:none}.xchart .color7 rect,.xchart .color7 circle{fill:#754c24}.xchart .color7 .fill{fill:rgba(117,76,36,0.1)}.xchart .color7.comp .line{stroke:#c98c50}.xchart .color7.comp rect{fill:#c98c50}.xchart .color7.comp .fill{display:none}.xchart .color7.comp circle,.xchart .color7.comp .pointer{fill:#c98c50}.xchart .color8 .line{stroke:#2eb9b4}.xchart .color8 .line .fill{pointer-events:none}.xchart .color8 rect,.xchart .color8 circle{fill:#2eb9b4}.xchart .color8 .fill{fill:rgba(46,185,180,0.1)}.xchart .color8.comp .line{stroke:#86e1de}.xchart .color8.comp rect{fill:#86e1de}.xchart .color8.comp .fill{display:none}.xchart .color8.comp circle,.xchart .color8.comp .pointer{fill:#86e1de}.xchart .color9 .line{stroke:#0e2e42}.xchart .color9 .line .fill{pointer-events:none}.xchart .color9 rect,.xchart .color9 circle{fill:#0e2e42}.xchart .color9 .fill{fill:rgba(14,46,66,0.1)}.xchart .color9.comp .line{stroke:#2477ab}.xchart .color9.comp rect{fill:#2477ab}.xchart .color9.comp .fill{display:none}.xchart .color9.comp circle,.xchart .color9.comp .pointer{fill:#2477ab} .xchart .errorLine path {stroke: #C6080D;stroke-width: 3px;}.ex-tooltip{position:absolute;background:#EEE;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:5px;-webkit-box-shadow:0 1px 3px #000;-moz-box-shadow:0 1px 3px #000;-ms-box-shadow:0 1px 3px #000;-o-box-shadow:0 1px 3px #000;box-shadow:0 1px 3px #000;border-collapse:separate;display:none}/*
 * 	Core carousel CSS File
 *	v1.21
 */

/* clearfix */
.owl-carousel .owl-wrapper:after {
	content: ".";
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
/* display none until init */
.owl-carousel{
	display: none;
	position: relative;
	width: 100%;
	-ms-touch-action: pan-y;
}
.owl-carousel .owl-wrapper{
	display: none;
	position: relative;
	-webkit-transform: translate3d(0px, 0px, 0px);
	-webkit-perspective: 1000;
}
.owl-carousel .owl-wrapper-outer{
	overflow: hidden;
	position: relative;
	width: 100%;
}
.owl-carousel .owl-wrapper-outer.autoHeight{
	-webkit-transition: height 500ms ease-in-out;
	-moz-transition: height 500ms ease-in-out;
	-ms-transition: height 500ms ease-in-out;
	-o-transition: height 500ms ease-in-out;
	transition: height 500ms ease-in-out;
}

.owl-carousel .owl-item{
	float: left;
}
.owl-controls .owl-page,
.owl-controls .owl-buttons div{
	cursor: pointer;
}
.owl-controls {
	-


matrix_operation extension.
	template <typename valType>
	detail::tmat4x4<valType> diagonal4x4(
		detail::tvec4<valType> const & v);

	/// @}
}//namespace glm

#include "matrix_operation.inl"

#endif//GLM_GTX_matrix_operation
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtx_string_cast
/// @file glm/gtx/string_cast.hpp
/// @date 2008-04-26 / 2011-06-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
/// @see gtx_integer (dependence)
/// @see gtx_quaternion (dependence)
///
/// @defgroup gtx_string_cast GLM_GTX_string_cast: String cast
/// @ingroup gtx
///
/// @brief Setup strings for GLM type values
///
/// <glm/gtx/string_cast.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////

#ifndef GLM_GTX_string_cast
#define GLM_GTX_string_cast GLM_VERSION

// Dependency:
#include "../glm.hpp"
#include "../gtc/half_float.hpp"
#include "../gtx/integer.hpp"
#include "../gtx/quaternion.hpp"
#include <string>

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_string_cast extension included")
#endif

namespace glm
{
	/// @addtogroup gtx_string_cast
	/// @{

	/// Create a string from a GLM type value.
	/// From GLM_GTX_string_cast extension.
	template <typename genType>
	std::string to_string(genType const & x);

	/// @}
}//namespace glm

#include "string_cast.inl"

#endif//GLM_GTX_string_cast
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WAR


tacktrace: debug.Stack(),
					}
				}
			}()

			defer task16.ran.Store(true)

			_185_4()

			taskEmitter.TaskSuccess(ctx)
			return
		}

		sched.Enqueue(ctx, cff.Job{
			Run: task16.fn,
		})
		tasks = append(tasks, task16)

		// go.uber.org/cff/internal/tests/parallel/parallel.go:193:4
		task17 := new(struct {
			emitter cff.TaskEmitter
			fn      func(context.Context) error
			ran     cff.AtomicBool
		})
		task17.emitter = cff.NopTaskEmitter()
		task17.fn = func(ctx context.Context) (err error) {
			taskEmitter := task17.emitter
			startTime := time.Now()
			defer func() {
				if task17.ran.Load() {
					taskEmitter.TaskDone(ctx, time.Since(startTime))
				}
			}()

			defer func() {
				recovered := recover()
				if recovered != nil {
					taskEmitter.TaskPanic(ctx, recovered)
					err = &cff.PanicError{
						Value:      recovered,
						Stacktrace: debug.Stack(),
					}
				}
			}()

			defer task17.ran.Store(true)

			_193_4()

			taskEmitter.TaskSuccess(ctx)
			return
		}

		sched.Enqueue(ctx, cff.Job{
			Run: task17.fn,
		})
		tasks = append(tasks, task17)

		// go.uber.org/cff/internal/tests/parallel/parallel.go:201:4
		task18 := new(struct {
			emitter cff.TaskEmitter
			fn      func(context.Context) error
			ran     cff.AtomicBool
		})
		task18.emitter = cff.NopTaskEmitter()
		task18.fn = func(ctx context.Context) (err error) {
			taskEmitter := task18.emitter
			startTime := time.Now()
			defer func() {
				if task18.ran.Load() {
					taskEmitter.TaskDone(ctx, time.Since(startTime))
				}
			}()

			defer func() {
				recovered := recover()
				if recovered != nil {
					taskEmitter.TaskPanic(ctx, recovered)
					err = &cff.PanicError{
						Value:      recovered,
						Stacktrace: debug.Stack(),
					}
				}
			}()

			defer task18.ran.Store(true)

			_201_4()

			taskEmitter.TaskSuccess(ctx)
			return
		}

		sched.Enqueue(ctx, cff.Job{
			Run: task18.fn,
		})
		tasks = append(tasks, task18)

		if err := sched.Wait(ctx); err != nil {
			parallelEmitter.ParallelError(ctx, err)
			return err
		}
		parallelEmitter.ParallelSuccess(ctx)
		return nil /*line parallel.go:207*/
	}()
}

// ContinueOnErrorBoolExpr parameterizes the ContinueOnError Option
// with a boolean expression. Despite tasks that error, the contents of
// the src slice should be copied into the target slice. The error returned
// by this function is checked to verify that it's underlying type is
// unchanged.
func ContinueOnErrorBoolExpr(src, target []int, fn func() bool) error {
	blockerA := make(chan struct{})
	blockerB := make(chan struct{})
	return func() (err error) {

		_220_3 := context.Background()

		_221_19 := 2

		_222_23 := fn()

		_224_4 := func(_ context.Context) error {
			close(blockerA)

			_, err := os.Open("non-existing")
			return err
		}

		_231_4 := func() {

			<-blockerA
			target[0] = src[0]
			close(block


modules.set_item("aiosnmp.asn1_rust", m.getattr("asn1_rust")?)?;
    Ok(())
}
<gh_stars>10-100
use std::path::PathBuf;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("Clashctl error: {0}")]
    ClashCtl(#[from] clashctl_core::Error),

    #[error("Cannot find server")]
    ServerNotFound,

    #[error("{0} is not a directory")]
    ConfigFileTypeError(PathBuf),

    #[error("Config file cannot be found")]
    ConfigFileOpenError,

    #[error("Config file IO error ({0})")]
    ConfigFileIoError(std::io::Error),

    #[error("Config file cannot be parsed")]
    ConfigFileFormatError(#[from] ron::Error),
}

pub type Result<T> = std::result::Result<T, Error>;
#![feature(type_alias_impl_trait)]
#![feature(generators, generator_trait)]

use prelude::*;

use serde::{Serialize, Deserialize};

use ast_macros::*;
use shapely::*;

pub type Stream<T> = Vec<T>;

// ============
// === Tree ===
// ============

/// A tree structure where each node may store value of `K` and has arbitrary
/// number of children nodes, each marked with a single `K`.
///
/// It is used to describe ambiguous macro match.
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
pub struct Tree<K,V> {
    pub value    : Option<V>,
    pub branches : Vec<(K, Tree<K,V>)>,
}

// ===============
// === Shifted ===
// ===============

/// A value of type `T` annotated with offset value `off`.
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize, Shrinkwrap)]
#[shrinkwrap(mutable)]
pub struct Shifted<T> {
    #[shrinkwrap(main_field)]
    pub wrapped : T,
    pub off     : usize,
}

/// A non-empty sequence of `T`s interspersed by offsets.
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
pub struct ShiftedVec1<T> {
    pub head: T,
    pub tail: Vec<Shifted<T>>
}

// =============
// === Layer ===
// =============

// === Trait ===

/// Types that can wrap a value of given `T`.
///
/// Same API as `From`, however not reflexive.
pub trait Layer<T> {
    fn layered(t: T) -> Self;
}

impl<T> From<T> for Layered<T> {
    fn from(t: T) -> Self {  Layered::layered(t) }
}

// === Layered ===

/// A trivial `Layer` type that is just a strongly typed wrapper over `T`.
#[derive(Debug)]
#[derive(Shrinkwrap)]
#[shrinkwrap(mutable)]
pub struct Layered<T>(pub T);

impl<T> Layer<T> for Layered<T> {
    fn layered(t: T) -> Self { Layered(t) }
}

// ===========
// === AST ===
// ===========

/// The primary class for Enso Abstract Syntax Tree.
///
/// This implementation is paired with AST implementation for Scala. Any changes
/// to either of the implementation need to be applied to the other one as well.
///
/// Each AST node is annotated with span and an optional ID.
#[derive(Eq, PartialEq, Debug, Shrinkwrap, Serialize, Deserialize)]
#[shrinkwrap(mutable)]
pub struct Ast {
    #[serde(flatten)]
    pub wrapped: Rc<WithID<WithSpan<Shape<Ast>>>>
}

impl Ast {
    pub fn iter(&self) -> Rc<dyn Iterator<Item = &'_ Shape<Ast>> + '_


from the pixijs app.
     */
    protected get resources(): PIXI.IResourceDictionary {
        return this.app.loader.resources;
    }

    /**
     * Helper function to get the stage element in specific games (derived classes).
     */
    protected getStageElement(): ElementRef {
        return this._stageElement;
    }

    /**
     * Game update loop.
     * @param delta The time delta between frames.
     */
    private _update(delta: number, ticker: PIXI.Ticker) {
        // console.log("Last Time: " + ticker.lastTime);
        // console.log("Last deltaMS: " + ticker.deltaMS);
        // console.log("Last deltaTime: " + ticker.deltaTime);
        if (this._debugMode) {
            this._fpsLastUpdate += ticker.elapsedMS;
            if (this._fpsLastUpdate > 1000) {
                this._fpsDisplay.text = `${Math.round(ticker.FPS)}`;
                this._fpsLastUpdate = 0;
            }
        }

        if (this.sceneManager.currentScene) {
            this.sceneManager.currentScene.update(delta);
        } else {
            if (this._debugMode) {
                console.warn('Game - no current scene');
            }
        }
    }

    /**
     * Reset the stage to a scene.
     * @param s The scene to reset to.
     */
    private _resetStage(s: Scene) {
        this.app.stage.removeChildren();
        this.app.stage.addChild(this._fpsDisplay); // Better way to do this?
        this.app.stage.addChild(s);
    }

    private _setupLogo() {
        const l: PIXI.Loader = new PIXI.Loader();
        l.add('logo', 'assets/fpl-logo.png').load((loader, resources) => {
            this._logo = new PIXI.Sprite(resources.logo.texture);
            this._logo.anchor.set(0.5, 0.5);
            this._logo.position.set(
                ((this.app.view.width / window.devicePixelRatio) / 2),
                ((this.app.view.height / window.devicePixelRatio) / 2 - (this._logo.height / 2))
            );
            this.app.stage.addChild(this._logo);
        });
    }

    /**
     * Setup the loading progress bar.
     */
    private _setupProgressbar() {
        this._progress = new PIXI.Graphics();
        this._progress.beginFill(0xE1B022);
        this._progress.drawRect(0, 0, 250, 25);
        this._progress.beginHole();
        this._progress.drawRect(1, 1, 248, 23);
        this._progress.endHole();
        this._progress.endFill();

        this._setProgressBarPosition();

        this.app.stage.addChild(this._progress);
    }

    /**
     * Update the progress bar with the given percentage.
     * @param percentage Percentage of assets loaded.
     */
    private _updateProgressbar(percentage: number) {
        const holeX: number = 250 * percentage;
        const holeWidth: number = (250 - holeX) - 1;

        this._progress.clear();
        this._progress.beginFill(0xE1B022);
        this._progress.drawRect(0, 0, 250, 25);
        this._progress.beginHole();
        this._progress.drawRect(holeX, 1, holeWidth, 23);
        this._progress.endHole();
        this._progress.endFill();

        this._setProgressBarPosition();
    }

    /**
     * Helper function for setting progressbar position.
     */
    private _setProgressBarPosition() {
        this._progress.position.x = ((this.app.view.width / window.devicePixelRatio) / 2) - (this._progress.width / 2);
        this._progress.position.y = ((this.app.view.height / window.devicePixelRatio) / 2) - (this._progress.height / 2) + 15;
    }

    /**
     * Destroy the progress bar.
     */
    private _destroyProgressbarAndLogo() {
        this._progress.clear();


MacAppsMetadata{
					MacAppsMetadata: &pb.MacAppsMetadata{
						BundleDisplayName:        "display-name",
						BundleIdentifier:         "bundle-identifier",
						BundleShortVersionString: "1.2.3",
						BundleExecutable:         "executable",
						BundleName:               "name",
						BundlePackageType:        "package-type",
						BundleSignature:          "signature",
						BundleVersion:            "1.2.3",
						ProductId:                "product-id",
						UpdateUrl:                "update-url",
					},
				},
			},
		},
	}

	for _, tc := range testCases {
		t.Run(tc.desc, func(t *testing.T) {
			p := proto.Clone(tc.p).(*pb.Package)
			tc.m.SetProto(p)
			opts := []cmp.Option{
				protocmp.Transform(),
			}
			if diff := cmp.Diff(tc.want, p, opts...); diff != "" {
				t.Errorf("Metatadata{%+v}.SetProto(%+v): (-want +got):\n%s", tc.m, tc.p, diff)
			}

			// Test the reverse conversion for completeness.

			if tc.p == nil && tc.want == nil {
				return
			}

			got := macapps.ToStruct(p.GetMacAppsMetadata())
			if diff := cmp.Diff(tc.m, got); diff != "" {
				t.Errorf("ToStruct(%+v): (-want +got):\n%s", p.GetMacAppsMetadata(), diff)
			}
		})
	}
}

func TestToStruct(t *testing.T) {
	testCases := []struct {
		desc string
		m    *pb.MacAppsMetadata
		want *macapps.Metadata
	}{
		{
			desc: "nil",
			m:    nil,
			want: nil,
		},
		{
			desc: "some fields",
			m: &pb.MacAppsMetadata{
				BundleDisplayName: "display-name",
			},
			want: &macapps.Metadata{
				CFBundleDisplayName: "display-name",
			},
		},
		{
			desc: "all fields",
			m: &pb.MacAppsMetadata{
				BundleDisplayName:        "display-name",
				BundleIdentifier:         "bundle-identifier",
				BundleShortVersionString: "1.2.3",
				BundleExecutable:         "executable",
				BundleName:               "name",
				BundlePackageType:        "package-type",
				BundleSignature:          "signature",
				BundleVersion:            "1.2.3",
				ProductId:                "product-id",
				UpdateUrl:                "update-url",
			},
			want: &macapps.Metadata{
				CFBundleDisplayName:        "display-name",
				CFBundleIdentifier:         "bundle-identifier",
				CFBundleShortVersionString: "1.2.3",
				CFBundleExecutable:         "executable",
				CFBundleName:               "name",
				CFBundlePackageType:        "package-type",
				CFBundleSignature:          "signature",
				CFBundleVersion:            "1.2.3",
				KSProductID:                "product-id",
				KSUpdateURL:                "update-url",
			},
		},
	}

	for _, tc := range testCases {
		t.Run(tc.desc, func(t *testing.T) {
			got := macapps.ToStruct(tc.m)
			if diff := cmp.Diff(tc.want, got); diff != "" {
				t.Errorf("ToStruct(%+v): (-want +got):\n%s", tc.m, diff)
			}

			if tc.m == nil {
				return
			}

			// Test the reverse conversion for completeness.

			gotP := &pb.Package{}
			wantP := &pb.Package{
				Metadata: &pb.Package_MacAppsMetadata{
					MacAppsMetadata: tc.m,
				},
			}
			got.SetProto(gotP)
			opts := []cmp.Option{
				protocmp.Transform(),
			}
			if


  rs1 value is non-zero and zero
  rs2 value is non-zero and zero
  All combinations of rs1 and rs2 non-zero and zero values are used
  All bits of rs1 are toggled
  All bits of rs2 are toggled
* **Pass/Fail Criteria:** Check RM
* **Test Type:** Constrained Random
* **Coverage Method:** Functional Coverage
* **Applicable Cores:** CV32A6_v0.1.0, CV32A6-step2, CV64A6-step3
* **Unique verification tag:** VP_ISA_RV32_F007_S002_I001
* **Link to Coverage:** isacov.rv32m_divu_cg.cp_rs1_value
isacov.rv32m_divu_cg.cp_rs2_value
isacov.rv32m_divu_cg.cross_rs1_rs2_value
isacov.rv32m_divu_cg.cp_rs1_toggle
isacov.rv32m_divu_cg.cp_rs2_toggle
* **Comments**

  *(none)*

#### Item: 002

* **Requirement location:** ./RISCV_Instructions.rst
* **Feature Description**

  divu rd, rs1, rs2
  x[rd] = x[rs1] u/ x[rs2]
  rd is calculated using unsigned arithmetic; rounding towards zero
* **Verification Goals**

  Output result:

  rd value is non-zero and zero
  All bits of rd are toggled
* **Pass/Fail Criteria:** Check RM
* **Test Type:** Constrained Random
* **Coverage Method:** Functional Coverage
* **Applicable Cores:** CV32A6_v0.1.0, CV32A6-step2, CV64A6-step3
* **Unique verification tag:** VP_ISA_RV32_F007_S002_I002
* **Link to Coverage:** isacov.rv32m_divu_cg.cp_rd_value
isacov.rv32m_divu_cg.cp_rd_toggle
* **Comments**

  *(none)*

#### Item: 003

* **Requirement location:** ./RISCV_Instructions.rst
* **Feature Description**

  divu rd, rs1, rs2
  x[rd] = x[rs1] u/ x[rs2]
  rd is calculated using unsigned arithmetic; rounding towards zero
* **Verification Goals**

  Exercise division by zero (returns 2^32-1 ; all bits set)
* **Pass/Fail Criteria:** Check RM
* **Test Type:** Constrained Random
* **Coverage Method:** Functional Coverage
* **Applicable Cores:** CV32A6_v0.1.0, CV32A6-step2, CV64A6-step3
* **Unique verification tag:** VP_ISA_RV32_F007_S002_I003
* **Link to Coverage:** isacov.rv32m_divu_results_cg.cp_div_zero
* **Comments**

  *(none)*

### Sub-feature: 003_REMU

#### Item: 000

* **Requirement location:** ./RISCV_Instructions.rst
* **Feature Description**

  remu rd, rs1, rs2
  x[rd] = x[rs1] % x[rs2]
  rd is calculated using unsigned arithmetic; remainder from the same division than DIVU
* **Verification Goals**

  Register operands:

  All possible rs1 registers are used.
  All possible rs2 registers are used.
  All possible rd registers are used.
  All possible register combinations where rs1 == rd are used
  All possible register combinations where rs2 == rd are used
* **Pass/Fail Criteria:** Check RM
* **Test Type:** Constrained Ra


 i++ {
		left[i] = max(left[i-1], height[i])
		right[n-i-1] = max(right[n-i], height[n-i-1])
	}
	for i, h := range height {
		ans += min(left[i], right[i]) - h
	}
	return
}
```

```ts
function trap(height: number[]): number {
    const n = height.length;
    if (n < 3) {
        return 0;
    }
    const left: number[] = new Array(n).fill(height[0]);
    const right: number[] = new Array(n).fill(height[n - 1]);
    for (let i = 1; i < n; ++i) {
        left[i] = Math.max(left[i - 1], height[i]);
        right[n - i - 1] = Math.max(right[n - i], height[n - i - 1]);
    }
    let ans = 0;
    for (let i = 0; i < n; ++i) {
        ans += Math.min(left[i], right[i]) - height[i];
    }
    return ans;
}
```

```cs
public class Solution {
    public int Trap(int[] height) {
        int n = height.Length;
        if (n < 3) {
            return 0;
        }
        int[] left = new int[n];
        int[] right = new int[n];
        left[0] = height[0];
        right[n - 1] = height[n - 1];
        for (int i = 1; i < n; ++i) {
            left[i] = Math.Max(left[i - 1], height[i]);
            right[n - i - 1] = Math.Max(right[n - i], height[n - i - 1]);
        }
        int ans = 0;
        for (int i = 0; i < n; ++i) {
            ans += Math.Min(left[i], right[i]) - height[i];
        }
        return ans;
    }
}
```

<!-- tabs:end -->

<!-- end -->
# [面试题 04.10. 检查子树](https://leetcode.cn/problems/check-subtree-lcci)

## 题目描述

<!-- 这里写题目描述 -->
<p>检查子树。你有两棵非常大的二叉树：T1，有几万个节点；T2，有几万个节点。设计一个算法，判断 T2 是否为 T1 的子树。</p>

<p>如果 T1 有这么一个节点 n，其子树与 T2 一模一样，则 T2 为 T1 的子树，也就是说，从节点 n 处把树砍断，得到的树与 T2 完全相同。</p>

<p><strong>示例1:</strong></p>

<pre class="AnLi"><strong> 输入</strong>：t1 = [1, 2, 3], t2 = [2]
<strong> 输出</strong>：true
</pre>

<p><strong>示例2:</strong></p>

<pre class="AnLi"><strong> 输入</strong>：t1 = [1, null, 2, 4], t2 = [3, 2]
<strong> 输出</strong>：false
</pre>

<p><strong>提示：</strong></p>

<ol>
	<li>树的节点数目范围为[0, 20000]。</li>
</ol>

## 解法

### 方法一

<!-- tabs:start -->

```python
# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None

class Solution:
    def checkSubTree(self, t1: TreeNode, t2


Luxury Perfume Gift Set For Men - 4 x 20mls

            <button class="add-to-cart">Add to Cart</button>

CEO Man Luxury Perfume - 100ml

            <button class="add-to-cart">Add to Cart</button>

OUD GOLD - 100ml

            <button class="add-to-cart">Add to Cart</button>

Luxury Perfume Gift Set For Women - 4 x 20mls

            <button class="add-to-cart">Add to Cart</button>

    <button id="viewAllBtn">VIEW ALL</button>

LUXURY CATEGORIES

LUXURY PERFUMES

BODY WASHES

BODY LOTIONS

BODY DEOS

                <img src="https://bellavitaorganic.com/cdn


//
8	܈85	UTF8 string with RTL char

	//
9	a	b	c
12	123123213	12313	tabs

	//

	//

9 rows

	// sql --format=rawhtml -e select * from t.t
	//

	//

s	d

	//

	//
foo	printable ASCII

	//
"foo	printable ASCII with quotes

	//
\foo	printable ASCII with backslash

	//
foo
bar	non-printable ASCII

	//
κόσμε	printable UTF8

	//
ñ	printable UTF8 using escapes

	//
\x01	non-printable UTF8 string

	//
܈85	UTF8 string with RTL char

	//
a	b	c
12	123123213	12313	tabs

	//

	//

	// sql --format=unnumbered-html -e select * from t.t
	//

	//

s	d

	//

	//
foo	printable ASCII

	//
"foo	printable ASCII with quotes

	//
\foo	printable ASCII with backslash

	//
foo
bar	non-printable ASCII

	//
κόσμε	printable UTF8

	//
ñ	printable UTF8 using escapes

	//
\x01	non-printable UTF8 string

	//
܈85	UTF8 string with RTL char

	//
a	b	c
12	123123213	12313	tabs

	//

	//

	// sql --format=raw -e select * from t.t
	// # 2 columns
	// # row 1
	// ## 3
	// foo
	// ## 15
	// printable ASCII
	// # row 2
	// ## 4
	// "foo
	// ## 27
	// printable ASCII with quotes
	// # row 3
	// ## 4
	// \foo
	// ## 30
	// printable ASCII with backslash
	// # row 4
	// ## 7
	// foo
	// bar
	// ## 19
	// non-printable ASCII
	// # row 5
	// ## 11
	// κόσμε
	// ## 14
	// printable UTF8
	// # row 6
	// ## 2
	// ñ
	// ## 28
	// printable UTF8 using escapes
	// # row 7
	// ## 4
	// \x01
	// ## 25
	// non-printable UTF8 string
	// # row 8
	// ## 4
	// ܈85
	// ## 25
	// UTF8 string with RTL char
	// # row 9
	// ## 24
	// a	b	c
	// 12	123123213	12313
	// ## 4
	// tabs
	// # 9 rows
}

func Example_sql_table_border() {
	c := cli.NewCLITest(cli.TestCLIParams{})


                controller: _decodeController,
                onChanged: (text) {
                  setState(() {
                    _currentDecodeInput = text;
                  });
                },
              ),
        GCWTwoOptionsSwitch(
          value: _currentMode,
          onChanged: (value) {
            setState(() {
              _currentMode = value;
            });
          },
        ),
        _buildOutput()
      ],
    );
  }

  Widget _buildOutput() {
    if (widget.mode == GaussWeberTelegraphMode.GAUSS_WEBER_ORIGINAL_V1) {
      if (_currentMode == GCWSwitchPosition.left) {
        var outputOriginal =
            encodeGaussWeberTelegraph(_currentEncodeInput, _currentGaussVersion);

        return GCWOutput(child: outputOriginal, title: i18n(context, 'telegraph_gausswebertelegraph_original'));
      } else {

        return GCWDefaultOutput(
            child: decodeGaussWeberTelegraph(_currentDecodeInput, _currentGaussVersion));
      }
    } else {
      String output;
      if (_currentMode == GCWSwitchPosition.left) {
        if (widget.mode == GaussWeberTelegraphMode.WHEATSTONE_COOKE_5) {
          output = encodeGaussWeberTelegraph(_currentEncodeInput, _currentNeedleNumber);
        } else {
          output = encodeGaussWeberTelegraph(_currentEncodeInput, widget.mode);
        }
      } else {
        if (widget.mode == GaussWeberTelegraphMode.WHEATSTONE_COOKE_5) {
          output = decodeGaussWeberTelegraph(_currentDecodeInput, _currentNeedleNumber);
        } else {
          output = decodeGaussWeberTelegraph(_currentDecodeInput, widget.mode);
        }
        output = output
            .replaceAll('schillingcanstatt_stop', i18n(context, 'telegraph_schillingcanstatt_stop'))
            .replaceAll('schillingcanstatt_goon', i18n(context, 'telegraph_schillingcanstatt_goon'))
            .replaceAll('schillingcanstatt_finish', i18n(context, 'telegraph_schillingcanstatt_finish'));
      }

      return GCWDefaultOutput(child: output);
    }
  }
}
part of 'package:gc_wizard/tools/science_and_technology/telegraphs/semaphore/widget/semaphore.dart';

const _INITIAL_SEGMENTS = <String, bool>{
  'l1': false,
  'l2': false,
  'l3': false,
  'l4': false,
  'l5': false,
  'r1': false,
  'r2': false,
  'r3': false,
  'r4': false,
  'r5': false
};

const _SEMAPHORE_RELATIVE_DISPLAY_WIDTH = 360; //110;
const _SEMAPHORE_RELATIVE_DISPLAY_HEIGHT = 260; //100;

class _SemaphoreSegmentDisplay extends NSegmentDisplay {
  _SemaphoreSegmentDisplay({
      required super.segments,
      super.readOnly,
      super.onChanged})
      : super(
            initialSegments: _INITIAL_SEGMENTS,
            type: SegmentDisplayType.CUSTOM,
            customPaint: (GCWTouchCanvas canvas, Size size, Map<String, bool> currentSegments, Function setSegmentState,
                Color segment_color_on, Color segment_color_off) {
              var paint = defaultSegmentPaint();
              var SEGMENTS_COLOR_ON = segment_color_on;
              var SEGMENTS_COLOR_OFF = segment_color_off;
              var paintTouch = defaultSegmentPaint();
              paintTouch.color = Colors.transparent;
              var centerPoint = Offset(size.width / _SEMAPHORE_RELATIVE_DISPLAY_WIDTH * 185, size.height * 0.5);


eq: &String = match uni.lookup("Q13526") {
    ///     Some(entry) => &entry.sequence,
    ///     None => 0,
    /// };
    /// ```
    pub fn lookup<T: AsRef<str>>(&self, acc: T) -> Option<&Entry> {
        self.inner.get(acc.as_ref())
    }
}

impl Entry {
    pub fn assign_residue(&self, seq: &str) -> Option<usize> {
        let peptide = if seq.contains(".") {
            seq.split(".").skip(1).next()?
        } else {
            seq
        };
        match peptide.find('*') {
            Some(offset) => {
                let needle = peptide.chars().filter(|&c| c != '*').collect::<String>();
                self.sequence.find(&needle).map(|idx| idx + offset)
            }
            None => self.sequence.find(peptide),
        }
    }
}
use crate::result::{illegal_operation, IonResult};
use crate::types::timestamp::{Precision, Timestamp};
use crate::IonType;
use bigdecimal::BigDecimal;
use chrono::{DateTime, Datelike, FixedOffset, NaiveDateTime, TimeZone, Timelike};
use std::convert::TryInto;
use std::io::{BufWriter, Write};

pub struct TextWriter<W: Write> {
    output: BufWriter<W>,
    annotations: Vec<String>,
    field_name: Option<String>,
    containers: Vec<IonType>,
    string_escape_codes: Vec<String>,
}

/**
 * String escape codes, for Ion Clob.
 */
fn string_escape_code_init() -> Vec<String> {
    let mut string_escape_codes = vec![String::new(); 256];
    string_escape_codes[0x00] = "\\0".to_string();
    string_escape_codes[0x07] = "\\a".to_string();
    string_escape_codes[0x08] = "\\b".to_string();
    string_escape_codes['\t' as usize] = "\\t".to_string();
    string_escape_codes['\n' as usize] = "\\n".to_string();
    string_escape_codes[0x0B] = "\\v".to_string();
    string_escape_codes[0x0C] = "\\f".to_string();
    string_escape_codes['\r' as usize] = "\\r".to_string();
    string_escape_codes['\\' as usize] = "\\\\".to_string();
    string_escape_codes['\"' as usize] = "\\\"".to_string();
    for i in 1..0x20 {
        if string_escape_codes[i] == "" {
            string_escape_codes[i] = format!("\\x{:02x}", i);
        }
    }
    for i in 0x7F..0x100 {
        string_escape_codes[i] = format!("\\x{:x}", i);
    }
    return string_escape_codes;
}

impl<W: Write> TextWriter<W> {
    /// Constructs a new instance of TextWriter that writes values to the provided io::Write
    /// implementation.
    pub fn new(sink: W) -> TextWriter<W> {
        TextWriter {
            output: BufWriter::new(sink),
            annotations: vec![],
            field_name: None,
            containers: vec![],
            string_escape_codes: string_escape_code_init(),
        }
    }

    /// Returns a reference to the underlying io::Write implementation.
    pub fn output(&self) -> &W {
        self.output.get_ref()
    }

    /// Returns a mutable reference to the underlying io::Write implementation. Modifying the
    /// underlying sink is an inherently risky operation and can result in unexpected behavior.
    /// It is not recommended for most use cases.
    pub fn output_mut(&mut self) -> &mut W {
        self.output.get_mut()
    }


lns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23181d25'%3e%3cpath d='M4.125 12c0-.483.392-.875.875-.875h14c.483 0 .875.392.875.875s-.392.875-.875.875H5c-.483 0-.875-.392-.875-.875z'/%3e%3c/svg%3e");
}

[data-label-collapsed]::before {
  content: attr(data-label-expanded);
}
[data-label-collapsed].collapsed::before, .collapsed > [data-label-collapsed]::before {
  content: attr(data-label-collapsed);
}

:not(.collapsed) > .collapse-toggle-icon {
  transform: rotate(180deg);
}

.hiding-collapse-toggle:not(.collapsed) {
  display: none;
}

[data-bs-theme=dark] .accordion:not([data-bs-theme=light]) .accordion-button::after {
  --cz-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3e%3cpath d='M3.8,7.9c0.4-0.4,1.1-0.4,1.5,0l6.7,6.7l6.7-6.7c0.4-0.4,1.1-0.4,1.5,0c0.4,0.4,0.4,1.1,0,1.5l-7.4,7.4c-0.4,0.4-1.1,0.4-1.5,0L3.8,9.4C3.3,9.1,3.3,8.4,3.8,7.9z'/%3e%3c/svg%3e");
  --cz-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3e%3cpath d='M3.8,7.9c0.4-0.4,1.1-0.4,1.5,0l6.7,6.7l6.7-6.7c0.4-0.4,1.1-0.4,1.5,0c0.4,0.4,0.4,1.1,0,1.5l-7.4,7.4c-0.4,0.4-1.1,0.4-1.5,0L3.8,9.4C3.3,9.1,3.3,8.4,3.8,7.9z'/%3e%3c/svg%3e");
}
[data-bs-theme=dark] .accordion-alt-icon:not([data-bs-theme=light]) .accordion-button::after {
  --cz-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3e%3cpath d='M12 4.125c.483 0 .875.392.875.875v14c0 .483-.392.875-.875.875s-.875-.392-.875-.875V5c0-.483.392-.875.875-.875z'/%3e%3cpath d='M4.125 12c0-.483.392-.875.875-.875h14c.483 0 .875.392.875.875s-.392.875-.875.875H5c-.483 0-.875-.392-.875-.875z'/%3e%3c/svg%3e");
  --cz-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3e%3cpath d='M4.125 12c0-.483.392-.875.875-.875h14c.483 0 .875.392.875.875s-.392.875-.875.875H5c-.483 0-.875-.392-.875-.875z'/%3e%3c/svg%3e");
}

.breadcrumb {
  --cz-breadcrumb-font-weight: 500;
  --cz-breadcrumb-color: var(--cz-component


/* At entry, the processor is in 16 bit real mode and the code is being
 * executed from an address it was not linked to. Code must be pic and
 * 32 bit sensitive until things are fixed up.
 *
 * Also be very careful as the stack is at the rear end of the interrupt
 * table so using a noticeable amount of stack space is a no-no.
 */

FILE_LICENCE ( GPL2_OR_LATER )

#include <config/general.h>

#define PNP_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'n' << 16 ) + ( 'P' << 24 ) )
#define PMM_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'M' << 16 ) + ( 'M' << 24 ) )
#define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
#define STACK_MAGIC ( 'L' + ( 'R' << 8 ) + ( 'E' << 16 ) + ( 'T' << 24 ) )
#define PMM_ALLOCATE 0x0000
#define PMM_FIND 0x0001
#define PMM_HANDLE_BASE ( ( ( 'F' - 'A' + 1 ) << 26 ) + \
			  ( ( 'E' - 'A' + 1 ) << 21 ) + \
			  ( ( 'N' - 'A' + 1 ) << 16 ) )
#define PMM_HANDLE_BASE_IMAGE_SOURCE \
	( PMM_HANDLE_BASE | 0x00001000 )
#define PMM_HANDLE_BASE_DECOMPRESS_TO \
	( PMM_HANDLE_BASE | 0x00002000 )
#define PCI_FUNC_MASK 0x07

/* ROM banner timeout, converted to a number of (18Hz) timer ticks. */
#define ROM_BANNER_TIMEOUT_TICKS ( ( 18 * ROM_BANNER_TIMEOUT ) / 10 )

/* Allow payload to be excluded from ROM size
 */
#if ROMPREFIX_EXCLUDE_PAYLOAD
#define	ZINFO_TYPE_ADxB "ADHB"
#define	ZINFO_TYPE_ADxW "ADHW"
#else
#define	ZINFO_TYPE_ADxB "ADDB"
#define	ZINFO_TYPE_ADxW "ADDW"
#endif

/* Allow ROM to be marked as containing multiple images
 */
#if ROMPREFIX_MORE_IMAGES
#define INDICATOR 0x00
#else
#define INDICATOR 0x80
#endif

	.text
	.code16
	.arch i386
	.section ".prefix", "ax", @progbits
	.globl	_rom_start
_rom_start:

	.org	0x00
romheader:
	.word	0xAA55			/* BIOS extension signature */
romheader_size:	.byte 0			/* Size in 512-byte blocks */
	jmp	init			/* Initialisation vector */
checksum:
	.byte	0
	.org	0x10
	.word	ipxeheader
	.org	0x16
	.word	undiheader
	.org	0x18
	.word	pciheader
	.org	0x1a
	.word	pnpheader
	.size romheader, . - romheader

	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
	.ascii	ZINFO_TYPE_ADxB
	.long	romheader_size
	.long	512
	.long	0
	.previous

pciheader:
	.ascii	"PCIR"			/* Signature */
	.word	pci_vendor_id		/* Vendor identification */
	.word	pci_device_id		/* Device identification */
	.word	0x0000			/* Device list pointer */
	.word	pciheader_len		/* PCI data structure length */
	.byte	0x03			/* PCI data structure revision */
	.byte	0x02, 0x00, 0x00	/* Class code */
pciheader_image_length:
	.word	0			/* Image length */
	.word	0x0001			/* Revision


 false,
		"sec": "https://www.sec.gov/Archives/edgar/data/1728328/000121390023044849/ea179639-8k_inmedpha.htm",
		"secUrl": "https://www.sec.gov/ix?doc=https://www.sec.gov/Archives/edgar/data/1728328/000121390023044849/ea179639-8k_inmedpha.htm",
		"devLink": "http://172.18.85.157:8080/ixviewer2plus/?doc=?doc=./../ixviewer-2-getter/filings/0001213900-23-044849/ea179639-8k_inmedpha.htm",
		"cik": "1728328",
		"accessionNum": "000121390023044849",
		"ticker": "ea179639",
		"dateString": "8k_inmedpha"
	},
	{
		"version": "2.2",
		"instance_file": "ea178909-8k_inmune.htm",
		"link": "?doc=filings/0001213900-23-044983/ea178909-8k_inmune.htm",
		"size": false,
		"sec": "https://www.sec.gov/Archives/edgar/data/1711754/000121390023044983/ea178909-8k_inmune.htm",
		"secUrl": "https://www.sec.gov/ix?doc=https://www.sec.gov/Archives/edgar/data/1711754/000121390023044983/ea178909-8k_inmune.htm",
		"devLink": "http://172.18.85.157:8080/ixviewer2plus/?doc=?doc=./../ixviewer-2-getter/filings/0001213900-23-044983/ea178909-8k_inmune.htm",
		"cik": "1711754",
		"accessionNum": "000121390023044983",
		"ticker": "ea178909",
		"dateString": "8k_inmune"
	},
	{
		"version": "2.2",
		"instance_file": "ea179605-8k_flexshopper.htm",
		"link": "?doc=filings/0001213900-23-044987/ea179605-8k_flexshopper.htm",
		"size": false,
		"sec": "https://www.sec.gov/Archives/edgar/data/1397047/000121390023044987/ea179605-8k_flexshopper.htm",
		"secUrl": "https://www.sec.gov/ix?doc=https://www.sec.gov/Archives/edgar/data/1397047/000121390023044987/ea179605-8k_flexshopper.htm",
		"devLink": "http://172.18.85.157:8080/ixviewer2plus/?doc=?doc=./../ixviewer-2-getter/filings/0001213900-23-044987/ea179605-8k_flexshopper.htm",
		"cik": "1397047",
		"accessionNum": "000121390023044987",
		"ticker": "ea179605",
		"dateString": "8k_flexshopper"
	},
	{
		"version": "2.2",
		"instance_file": "ea179627-8k_m3brigade3.htm",
		"link": "?doc=filings/0001213900-23-045020/ea179627-8k_m3brigade3.htm",
		"size": false,
		"sec": "https://www.sec.gov/Archives/edgar/data/1856589/000121390023045020/ea179627-8k_m3brigade3


	c.JSON(nil, bulkInsertArcs(c, newOIDs, v.Business, v.CourseTID, v.OperTID, v.ArticleTID, v.RecommendTID, v.ClassTID, v.Comment, ip))
}

//批量插入稿件表
func bulkInsertArcs(c *bm.Context, oids []int64, bs int8, courseTID, operTID, articleTID, recommendTID int64, classTID, comment, ip string) (err error) {
	arcInfo, err := bindArcInfo(c, oids, bs, ip)
	if err != nil {
		return err
	}
	arcs := make([]*academy.Archive, 0, len(oids))
	for _, oid := range oids {
		a, ok := arcInfo[oid]
		if !ok || a == nil { //校验oid是否有效
			if bs == academy.BusinessForArchvie {
				err = ecode.CreativeArcServiceErr
			} else if bs == academy.BusinessForArticle {
				err = ecode.CreativeArticleRPCErr
			}
			log.Error("bulkInsertArcs add archive with invalid oid(%d)|business(%d)", oid, bs)
			return
		}
		arcs = append(arcs, setArcParam(oid, a.Hot, bs, comment))
	}
	valArcs := make([]string, 0, len(arcs))
	valArcArgs := make([]interface{}, 0)
	for _, v := range arcs {
		valArcs = append(valArcs, "(?, ?, ?, ?, ?, ?, ?)")
		valArcArgs = append(valArcArgs, v.OID, v.Hot, v.Business, v.State, v.Comment, v.CTime, v.MTime)
	}
	//批量插入稿件标签关联表
	ctids, err := xstr.SplitInts(classTID)
	if err != nil {
		return
	}
	tags := make([]*academy.ArchiveTag, 0)
	for _, oid := range oids {
		tags = append(tags, setTagParam(oid, courseTID, bs), setTagParam(oid, operTID, bs), setTagParam(oid, recommendTID, bs))
		for _, cid := range ctids { //分类标签支持绑定多个二级标签
			tags = append(tags, setTagParam(oid, cid, bs))
		}
		if bs == academy.BusinessForArticle && articleTID > 0 { //专栏特殊分类
			tags = append(tags, setTagParam(oid, articleTID, bs))
		}
	}
	valTags := make([]string, 0)
	valTagArgs := make([]interface{}, 0)
	for _, v := range tags {
		valTags = append(valTags, "(?, ?, ?, ?, ?, ?)")
		valTagArgs = append(valTagArgs, v.OID, v.TID, v.State, v.CTime, v.MTime, v.Business)
	}
	sqlArcStr := fmt.Sprintf("INSERT INTO academy_archive (oid, hot, business, state, comment, ctime, mtime) VALUES %s ON DUPLICATE KEY UPDATE state=0, comment=VALUES(comment), mtime=VALUES(mtime)", strings.Join(valArcs, ","))
	sqlTagStr := fmt.Sprintf("INSERT INTO academy_archive_tag (oid, tid, state, ctime, mtime, business) VALUES %s ON DUPLICATE KEY UPDATE state=0, mtime=VALUES(mtime)", strings.Join(valTags, ","))
	tx := svc.DB.Begin()
	if err = tx.Exec(sqlArcStr, valArcArgs...).Error; err != nil {
		log.Error("creative-admin bulkInsertArcs error(%v)", err)
		tx.Rollback()
		return
	}
	if err = tx.Exec(sqlTagStr, valTagArgs...).Error; err != nil {
		log.


7C],// y
        [0x00, 0x44, 0x64, 0x54, 0x4C, 0x44],// z
        [0x14, 0x14, 0x14, 0x14, 0x14, 0x14],
    ];
    let F6x8: [u8;16]=
    [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00];

	if x>127{x=0;y=y+2;}

    if char_size ==16{
        OLED_WR_Byte(0xb0+y,0);
        OLED_WR_Byte(((x&0xf0)>>4)|0x10,0);
        OLED_WR_Byte((x&0x0f),0);

        for i in 0..8
        {
            IIC_Start();
            Write_IIC_Byte(0x78);			//D/C#=0; R/W#=0
            IIC_Wait_Ack();
            Write_IIC_Byte(0x40);			//write data
            IIC_Wait_Ack();
            Write_IIC_Byte(0xFF);//TODO：类型转换F6x8[char_c][i]
            IIC_Wait_Ack();
            IIC_Stop();

        }

        OLED_WR_Byte(0xb0+y+1,0);
        OLED_WR_Byte(((x&0xf0)>>4)|0x10,0);
        OLED_WR_Byte((x&0x0f),0);

        for i in 0..8{
            IIC_Start();
            Write_IIC_Byte(0x78);			//D/C#=0; R/W#=0
            IIC_Wait_Ack();
            Write_IIC_Byte(0x40);			//write data
            IIC_Wait_Ack();
            Write_IIC_Byte(0xFF);
            IIC_Wait_Ack();
            IIC_Stop();
        }
    }else{
        OLED_WR_Byte(0xb0+y,0);
        OLED_WR_Byte(((x&0xf0)>>4)|0x10,0);
        OLED_WR_Byte((x&0x0f),0);
        for i in 0..6{
            OLED_WR_Byte(0xFF,1);
        }
    }

}

pub fn rust_oled_print(msg: *const u8){
    //let mut u8:j=0;
    let mut x:u8=0;
    let mut y:u8=2;
    //TODO:oled_show every char in msg
    /*
    for c in &msg {
        OLED_ShowChar(0,2,c,16);
        x=x+8;
		if x>120
		{
			x=0;y=y+2;
		}
    }*/
}
use crate::{
    hittable::{HitRecord, Hittable, Shape},
    ray::Ray,
    aabb::{Aabb, surrounding_box}
};
use rand::Rng;
use std::cmp::Ordering;
//use std::sync::Arc;

#[derive(Clone)]
pub struct BvhNode {
    left: Box<Shape>,
    right: Box<Shape>,
    bbox: Aabb
}

fn box_x_compare (a: &Shape, b: &Shape) -> Ordering {
    let mut box_a = Aabb::default();
    let mut box_b = Aabb::default();
    if !a.bounding_box(0.0, 0.0, &mut box_a) || !b.bounding_box(0.0, 0.0, &mut box_b) {
        eprintln!("No bounding box in bvh_node constructor.\n");
    };
    if box_a.min().x < box_b.min().x {
        return Ordering::Less
    } else if box_a.min().y > box_b.min().y {
        return Ordering::Greater
    }
    return Ordering::Equal
}

fn box_y_compare (a: &Shape, b: &Shape) -> Ordering {
    let mut box_a = Aabb::default();
    let mut box_b = Aabb::default();
    if !a.bounding_box(0.0,0.0, &mut


_init__(self, options_dict=None):
        super(self.__class__, self).__init__(options_dict=options_dict)

        self.set_class_name('pyasm.widget.input_wdg.PasswordWdg')

def get_widget_name(tactic_class='', type=''):
    if type == 'input':
        tactic_classes = input_classes
    else:
        tactic_classes = None

    if tactic_classes:
        result_class = None
        for i, cls in enumerate(tactic_classes['tactic']):
            if tactic_class == cls:
                result_class = tactic_classes['handler'][i]

        return result_class


 OSPrioHighRdy;
	ld.b  0[r11]         , r12
	mov   #_OSPrioCur    , r11
	st.b  r12            , 0[r11]

	mov   #_OSTCBHighRdy, r11                                   -- OSTCBCur = OSTCBHighRdy;
	ld.w  0[r11]        , r12
	mov   #_OSTCBCur    , r11
	st.w  r12           , 0[r11]

	ld.w  0[r12], sp                                            -- SP = OSTCBHighRdy->OSTCBStkPtr;

	POPALL sp

	reti                                                        -- Return from interrupt starts new task

#********************************************************************************************************
#                                        INTERRUPT/EXCEPTION  HANDLER
#
# Note(s) : 1) The pseudo-code for OS_CPU_IntHandler() is:
#              a) Save processor registers;
#              b) Increment OSIntNesting;
#              c) if (OSIntNesting == 1) {
#                     OSTCBCur->OSTCBStkPtr = SP;
#                 }
#              d) Call OSIntExit();
#              e) Call OS_CPU_IntHandlerSrc();
#              f) Restore processosr Registers;
#
#           2) OS_CPU_IntHandlerSrc() must be implemented to handle maskable interrupts according to
#              to exception code provided by the system register ECR.
#
#********************************************************************************************************

_OS_CPU_IntHandler:
	PUSHALL sp                                                  -- Saves Processor registers

	ld.b #_OSIntNesting[r0], r2                                 -- increment OSIntNesting
	add 0x1, r2
	st.b r2, #_OSIntNesting[r0]

	cmp  0x1, r2
	bne  _OS_CPU_IntHandler01                                   -- if (OSIntNesting == 1) {

	mov   #_OSTCBCur, r11                                       --     OSTCBCur->OSTCBStkPtr = SP;
	ld.w  0[r11]    , r11
	st.w  sp        , 0[r11]                                    -- }

_OS_CPU_IntHandler01:
	stsr ECR, r6                                                -- get interrupt/exception source code that occured.
	jarl _OS_CPU_IntHandlerSrc, lp

	jarl _OSIntExit, lp

	POPALL sp                                                   -- Restore processor register

	reti


 nil
}

func (m *Hardware) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Hardware) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.Count != 0 {
		i = encodeVarintHardwareNode(dAtA, i, uint64(m.Count))
		i--
		dAtA[i] = 0x10
	}
	if len(m.Type) > 0 {
		i -= len(m.Type)
		copy(dAtA[i:], m.Type)
		i = encodeVarintHardwareNode(dAtA, i, uint64(len(m.Type)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintHardwareNode(dAtA []byte, offset int, v uint64) int {
	offset -= sovHardwareNode(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *HardwareNodes) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Participant)
	if l > 0 {
		n += 1 + l + sovHardwareNode(uint64(l))
	}
	if len(m.HardwareNodes) > 0 {
		for _, e := range m.HardwareNodes {
			l = e.Size()
			n += 1 + l + sovHardwareNode(uint64(l))
		}
	}
	return n
}

func (m *HardwareNode) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.LocalId)
	if l > 0 {
		n += 1 + l + sovHardwareNode(uint64(l))
	}
	if m.Status != 0 {
		n += 1 + sovHardwareNode(uint64(m.Status))
	}
	if len(m.Models) > 0 {
		for _, s := range m.Models {
			l = len(s)
			n += 1 + l + sovHardwareNode(uint64(l))
		}
	}
	if len(m.Hardware) > 0 {
		for _, e := range m.Hardware {
			l = e.Size()
			n += 1 + l + sovHardwareNode(uint64(l))
		}
	}
	l = len(m.Host)
	if l > 0 {
		n += 1 + l + sovHardwareNode(uint64(l))
	}
	l = len(m.Port)
	if l > 0 {
		n += 1 + l + sovHardwareNode(uint64(l))
	}
	return n
}

func (m *Hardware) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Type)
	if l > 0 {
		n += 1 + l + sovHardwareNode(uint64(l))
	}
	if m.Count != 0 {
		n += 1 + sovHardwareNode(uint64(m.Count))
	}
	return n
}

func sovHardwareNode(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozHardwareNode(x uint64) (n int) {
	return sovHardwareNode(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *HardwareNodes) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowHardwareNode
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x8


7 .g-first {
width:33%;
float:left;
margin:0;
}

.g-tpl-67-33-alt .g-unit,.g-unit .g-tpl-67-33-alt .g-unit,.g-unit .g-unit .g-tpl-67-33-alt .g-unit,.g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-unit,.g-unit .g-unit .g-unit .g-tpl-67-33 .g-first,.g-unit .g-unit .g-tpl-67-33 .g-first,.g-unit .g-tpl-67-33 .g-first,.g-tpl-67-33 .g-first {
width:67%;
float:left;
margin:0;
}

.g-tpl-67-33 .g-unit,.g-unit .g-tpl-67-33 .g-unit,.g-unit .g-unit .g-tpl-67-33 .g-unit,.g-unit .g-unit .g-unit .g-tpl-67-33 .g-unit,.g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-first,.g-unit .g-unit .g-tpl-67-33-alt .g-first,.g-unit .g-tpl-67-33-alt .g-first,.g-tpl-67-33-alt .g-first {
width:33%;
float:right;
margin:0;
}

.g-tpl-50-50 .g-unit,.g-unit .g-tpl-50-50 .g-unit,.g-unit .g-unit .g-tpl-50-50 .g-unit,.g-unit .g-unit .g-unit .g-tpl-50-50 .g-unit,.g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-first,.g-unit .g-unit .g-tpl-50-50-alt .g-first,.g-unit .g-tpl-50-50-alt .g-first,.g-tpl-50-50-alt .g-first {
width:50%;
float:right;
margin:0;
}

.g-tpl-50-50-alt .g-unit,.g-unit .g-tpl-50-50-alt .g-unit,.g-unit .g-unit .g-tpl-50-50-alt .g-unit,.g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-unit,.g-unit .g-unit .g-unit .g-tpl-50-50 .g-first,.g-unit .g-unit .g-tpl-50-50 .g-first,.g-unit .g-tpl-50-50 .g-first,.g-tpl-50-50 .g-first {
width:50%;
float:left;
margin:0;
}

@media screen,projection{
.g-section {
width:100%;
vertical-align:top;
display:inline-block;
}

.g-section:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
}

@media print{
.g-section {
width:100%;
vertical-align:top;
}

.g-section:after {
content:".";
display:block;
height:0;
visibility:hidden;
}

body {
font-size:9pt;
}

#logo {
position:static;
display:block;
margin:0;
padding:0;
}

.gbh {
display:none;
border:0;
}

#gc-topnav {
display:block;
clear:both;
}

#gc-pagecontent {
width: