	return vs[0].(map[string]*PageShieldPolicy)[vs[1].(string)]
	}).(PageShieldPolicyOutput)
}

func init() {
	pulumi.RegisterInputType(reflect.TypeOf((*PageShieldPolicyInput)(nil)).Elem(), &PageShieldPolicy{})
	pulumi.RegisterInputType(reflect.TypeOf((*PageShieldPolicyArrayInput)(nil)).Elem(), PageShieldPolicyArray{})
	pulumi.RegisterInputType(reflect.TypeOf((*PageShieldPolicyMapInput)(nil)).Elem(), PageShieldPolicyMap{})
	pulumi.RegisterOutputType(PageShieldPolicyOutput{})
	pulumi.RegisterOutputType(PageShieldPolicyArrayOutput{})
	pulumi.RegisterOutputType(PageShieldPolicyMapOutput{})
}
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***

package cloudflare

import (
	"context"
	"reflect"

	"errors"
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare/internal"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

// ## Example Usage
//
// ```go
// package main
//
// import (
//
//	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
//	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
//	func main() {
//		pulumi.Run(func(ctx *pulumi.Context) error {
//			_, err := cloudflare.NewDnsZoneTransfersIncoming(ctx, "example_dns_zone_transfers_incoming", &cloudflare.DnsZoneTransfersIncomingArgs{
//				ZoneId:             pulumi.String("269d8f4853475ca241c4e730be286b20"),
//				AutoRefreshSeconds: pulumi.Float64(86400),
//				Name:               pulumi.String("www.example.com."),
//				Peers: pulumi.StringArray{
//					pulumi.String("23ff594956f20c2a721606e94745a8aa"),
//					pulumi.String("00920f38ce07c2e2f4df50b1f61d4194"),
//				},
//			})
//			if err != nil {
//				return err
//			}
//			return nil
//		})
//	}
//
// ```
//
// ## Import
//
// ```sh
// $ pulumi import cloudflare:index/dnsZoneTransfersIncoming:DnsZoneTransfersIncoming example '<zone_id>'
// ```
type DnsZoneTransfersIncoming struct {
	pulumi.CustomResourceState

	// How often should a secondary zone auto refresh regardless of DNS NOTIFY.
	// Not applicable for primary zones.
	AutoRefreshSeconds pulumi.Float64Output `pulumi:"autoRefreshSeconds"`
	// The time for a specific event.
	CheckedTime pulumi.StringOutput `pulumi:"checkedTime"`
	// The time for a specific event.
	CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
	// The time for a specific event.
	ModifiedTime pulumi.StringOutput `pulumi:"modifiedTime"`
	// Zone name.
	Name pulumi.StringOutput `pulumi:"name"`
	// A list of peer tags.
	Peers pulumi.StringArrayOutput `pulumi:"peers"`
	// The serial number of the SOA for the given zone.
	SoaSerial pulumi.Float64Output `pulumi:"soaSerial"`
	ZoneId    pulumi.StringOutput  `pulumi:"zoneId"`
}

// NewDnsZoneTransfersIncoming registers a new resource with the given unique name, arguments, and options.
func NewDnsZoneTransfersIncoming(ctx *pulumi.Context,
	name string, args *DnsZoneTransfersIncomingArgs, opts ...pulumi.ResourceOption) (*DnsZoneTransfersIncoming, error) {
	if args == nil {
		return nil, errors.New("missing one or more required arguments")


.
     */
    fun selectButtonWithAnimation(
        btn: ThemedButton,
        x: Float = (btn.btnWidth / 2).toFloat(),
        y: Float = (btn.btnHeight / 2).toFloat()
    ) {
        if (selectedButtons.isNotEmpty() && selectedButtons.last() != btn) selectAnimator.cancel()
        deselectAnimator?.cancel()
        val changed = selectButton(btn, x, y, true)
        if (changed) startAnimations()
    }

    /**
     * Selects or deselects the passed [ThemedButton]'s id. This call is blocked if this makes the amount of
     * selected buttons fall below the [requiredAmount] of selected buttons or if the button is not enabled.
     *
     * @param id Id of the [ThemedButton]'s view.
     */
    fun selectButton(@IdRes id: Int) = selectButton(findViewById<ThemedButton>(id))

    /**
     * Selects or deselects the passed [ThemedButton]. This call is blocked if this makes the amount of
     * selected buttons fall below the [requiredAmount] of selected buttons or if the button is not enabled.
     *
     * If the button is already selected, firing this method will deselect the button,
     * unless it will make the amount of selected buttons fall below the 'requiredAmount' of selected buttons,
     * in that case nothing happens.
     *
     * @param btn The [ThemedButton] to be selected/deselected.
     * @param x Horizontal position of the click.
     * @param y Vertical position of the click.
     * @param animate Whether the select should be animated.
     * @return Whether something changed.
     */
    fun selectButton(
        btn: ThemedButton,
        x: Float = (btn.btnWidth / 2).toFloat(),
        y: Float = (btn.btnHeight / 2).toFloat(),
        animate: Boolean = false
    ): Boolean {
        if (!btn.isEnabled || btn.isSelected && buttons.count { it.isSelected } <= requiredAmount)
            return false
        btn.isSelected = !btn.isSelected
        if (btn.isSelected) selectedButtons.enqueue(btn)
        else selectedButtons.remove(btn)
        if (animate) selectAnimator = getSelectionAnimator(btn, x, y, btn.isSelected)
        else btn.cvSelectedCard.visibility = if (btn.isSelected) VISIBLE else GONE
        if (buttons.count { it.isSelected } > selectableAmount) {
            val removedBtn = selectedButtons.dequeue()!!
            buttons.find { it == removedBtn }?.isSelected = false
            if (animate) deselectAnimator = getSelectionAnimator(removedBtn, x, y, false)
            else removedBtn.cvSelectedCard.visibility = GONE
        } else {
            if (animate) deselectAnimator = null
        }
        selectListener?.invoke(btn)
        return true
    }

    private fun getSelectionAnimator(btn: ThemedButton, x: Float, y: Float, selected: Boolean): Animator =
        when (selectAnimation) {
            NONE -> AnimationUtils.createFadeAnimator(btn.cvSelectedCard, selected, 0L)
            FADE -> AnimationUtils.createFadeAnimator(btn.cvSelectedCard, selected, 400L)
            VERTICAL_SLIDE -> AnimationUtils.createVericalSlideAnimator(btn.cvCard, btn.cvSelectedCard, selected)
            HORIZONTAL_SLIDE -> AnimationUtils.createHorizontalSlideAnimator(btn.cvCard, btn.cvSelectedCard, selected)
            HORIZONTAL_WINDOW -> AnimationUtils.createHorizontalWindowAnimator(btn.cvCard, btn.cvSelectedCard, selected)
            VERTICAL_WINDOW -> AnimationUtils.createVerticalWindowAnimator(btn.cvCard, btn.cvSelectedCard, selected)
            else -> AnimationUtils.createCircularReveal(btn.cvSelectedCard, x, y, selected, (btn.btnWidt


BG4Uy8IAAAAASUVORK5CYII=");
}
.header-button.minimize:disabled {
	-fx-background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAACtJREFUSIljYBgFo2AUjILhCBhxSTg7O/sQY8DevXu3YBNnItdFo2AUkA4AUSoEBEHM6pAAAAAASUVORK5CYII=");
}
.header-button.minimize:hover {
	-fx-background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAQhJREFUSImtlU1ugzAQRp8HSmk2VRe9EcfmRt00UpQQ6tAuZqwYFwIEP8mbsfzN2PNjxzwOeAVegBIozH4DPNDb+p07PGV7A2pAHjgGGIAOuKQOUmEHvFuEW/DAMRYvok0HfCS2tQh6wy4VDpE+IxoHVgHXWPiAJmovISc/Yp7qDKKBGnCCRrqU/S0IUAlap7mphO2ltYZC2FcJc5Q533aEoL2fGy9oO+bmVqIT6l9zNE3ztUahbdvPCXMvJjzsim/MAPRhuh1s5eAMnENVXMjz1t60RjV8xfr8SdEB+MZmctocHTr6tta3j0WnhMHmqe0tRT+gVz+x8DWle5WtgvtM8WhTPfxM/wAOpzUm2RETmQAAAABJRU5ErkJggg==");
}
.root:inactive .header-button.minimize {
	-fx-background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAACtJREFUSIljYBgFo2AUjILhCBhxSTg7O/sQY8DevXu3YBNnItdFo2AUkA4AUSoEBEHM6pAAAAAASUVORK5CYII=");
}
.root:maximized .header-button.maximize {
	-fx-background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAFBJREFUSIljYBgFowAdMBJS4OLi8h+f/J49ewiaQbLB+ORYiNGEzQBCLmXCJ0kJwOliGEB3GaEwhwGauXjwGUwoSHDGLKXpl2ZBMQpGASYAALVPF0E3twfSAAAAAElFTkSuQmCC");
}
.root:maximized .header-button.maximize:disabled {
	-fx-background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAFFJREFUSIljYBgFowAdMBJS4Ozs7INPfu/evVvIshmfwfjkWIjRhM0AQi5lwidJCcDpYhhAdxmhMIcBmrl48BlMKEhwpmNK0y/NgmIUjAJMAADwRhRpa6HEsAAAAABJRU5ErkJggg==");


es from
]]

function paynsprayClaims(vehicleid, amount) -- this is triggered everytime an insured vehicle goes into the paynspray
	if not vehicleid or not amount then return false end
	amount = tonumber(amount)
	vehicleid = tonumber(vehicleid)

	if datatable[vehicleid] then
		local newClaimsTotal = tonumber(datatable[vehicleid]["claims"]) + amount
		datatable[vehicleid]["claims"] = newClaimsTotal
		local r = mysql:query_free("UPDATE `insurance_data` SET `claims`="..mysql:escape_string(newClaimsTotal).." WHERE `vehicleid`="..vehicleid)

		updateClientCache(source, {datatable, factionstable})
	end
end
addEvent("insurance:claims", true)
addEventHandler("insurance:claims", root, paynsprayClaims)

function sqlSaveDatatable() -- this is triggered when resource stops and every 5 hours
	outputDebugString("Saving insurance data.")
	for k, v in pairs(datatable) do
		local r = mysql:query_free("UPDATE `insurance_data` SET `claims`="..v['claims']..", `cashout`="..v['cashout'].." WHERE `vehicleid`="..k)
		if not r then
			outputDebugString( "ERROR: [insurance] "..path.." - FAILED TO SAVE SQL DATA")
		end
	end
end
addEventHandler("onResourceStop", resourceRoot, sqlSaveDatatable)


: none;
}

.m-input--has-state .m-slider__track-background {
    opacity: 0.4;
}
.m-color-picker__canvas {
    position: relative;
    overflow: hidden;
    contain: strict;
}
.m-color-picker__canvas-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 0px 0px 0px 1.5px white, inset 0px 0px 1px 1.5px rgba(0, 0, 0, 0.3);
}
.m-color-picker__canvas-dot--disabled {
    box-shadow: 0px 0px 0px 1.5px rgba(255, 255, 255, 0.7), inset 0px 0px 1px 1.5px rgba(0, 0, 0, 0.3);
}
.m-color-picker__canvas:hover .m-color-picker__canvas-dot {
    will-change: transform;
}
.m-color-picker__edit {
    margin-top: 24px;
    display: flex;
}

.m-color-picker__input {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}
.m-application--is-ltr .m-color-picker__input:not(:last-child) {
    margin-right: 8px;
}
.m-application--is-rtl .m-color-picker__input:not(:last-child) {
    margin-left: 8px;
}
.m-color-picker__input input {
    border-radius: 4px;
    margin-bottom: 8px;
    min-width: 0;
    outline: none;
    text-align: center;
    width: 100%;
    height: 28px;
}
.m-color-picker__input span {
    font-size: 0.75rem;
}
.m-color-picker__swatches {
    overflow-y: auto;
}
.m-color-picker__swatches > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
}

.m-color-picker__swatch {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.m-color-picker__color {
    position: relative;
    height: 18px;
    max-height: 18px;
    width: 45px;
    margin: 2px 4px;
    border-radius: 2px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow: hidden;
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGElEQVQYlWNgYGCQwoKxgqGgcJA5h3yFAAs8BRWVSwooAAAAAElFTkSuQmCC) repeat;
    cursor: pointer;
}
.m-color-picker__color > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.m-main {
    display: flex;
    flex: 1 0 auto;
    max-width: 100%;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.m-main:not([data-booted=true]) {
    transition: none !important;
}
.m-main__wrap {
    flex: 1 1 auto;
    max-width: 100%;
    position: relative;
}
@-moz-document url-prefix() {
    @media print {
        .m-main {
            display: block;


}

    void Update()
    {
        if (!Player.IsLocalPlayer)
            return;

        // Inputs
        var fire = Input.GetButton("Fire1");
        if (fire && !IsShooting)
        {
            NetworkManager.Instance.SendPacket(new ShootingPacket {IsShooting = true}, DataPacketKind.RELIABLE);
            OnShootingChanged(true);
        }
        else if (!fire && IsShooting)
        {
            NetworkManager.Instance.SendPacket(new ShootingPacket {IsShooting = false}, DataPacketKind.RELIABLE);
            OnShootingChanged(false);
        }
    }

    void FixedUpdate()
    {
        if (!IsShooting)
        {
            m_LastFire = Time.time;
            return;
        }

        var startDir = MinigunPoint.transform.position;
        var dir = Player.Cursor.transform.position - startDir;

        while (Time.time - m_LastFire >= FireRate)
        {
            m_LastFire += FireRate;
            dir += Random.insideUnitSphere * 0.02f;

            if (!Physics.Raycast(startDir, dir, out RaycastHit hit))
                return;

            StartCoroutine(ShootEffect(startDir, hit));

            if (Player.IsLocalPlayer)
            {
                var rPlayer = hit.transform.GetComponent<Player>();
                if (rPlayer == null)
                    return;

                rPlayer.Health -= Damage;
                NetworkManager.Instance.SendPacket(new DamagePacket
                {
                    Sid = rPlayer.Participant.Sid
                }, DataPacketKind.RELIABLE);
            }
        }
    }

    void OnShootingChanged(bool shooting)
    {
        IsShooting = shooting;

        if (shooting)
            MuzzleEffect.Play();
        else
            MuzzleEffect.Stop();

        Player.Animator.SetBool(ShootingAnim, shooting);
    }

    IEnumerator ShootEffect(Vector3 start, RaycastHit hit)
    {
        var tracer = Instantiate(BulletTracer, start, Quaternion.identity);
        yield return new WaitForEndOfFrame();
        tracer.transform.position = hit.point;

        var i = Instantiate(ImpactEffect, hit.point, Quaternion.LookRotation(hit.normal));
        i.Play();
    }
}


",
        required=False,
    )
    parser.add_argument(
        "--merges-path",
        help="Path to merges file to embed in FasterTransformer checkpoint",
        required=False,
    )
    parser.add_argument(
        "--tokenizer-model-path",
        help="Path to tokenizer model file to embed in FasterTransformer checkpoint",
        required=False,
    )
    parser.add_argument("--verbose", action="store_true", help="Provide verbose messages")
    args = parser.parse_args()

    log_format = "%(asctime)s %(name)s [%(levelname)s] %(message)s"
    logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO, format=log_format)

    print("\n=============== Argument ===============")
    for key in vars(args):
        print(f"{key}: {vars(args)[key]}")
    print("========================================")

    input_path = pathlib.Path(args.in_file)
    if not input_path.exists():
        LOGGER.error("%s does not exists", input_path)
        sys.exit(1)

    with tempfile.TemporaryDirectory() as temp_dir:
        temp_dir = pathlib.Path(temp_dir)

        # unpack if needed
        if input_path.is_file():
            checkpoint_dir_path = temp_dir / "unpacked"
            start_time = datetime.datetime.now()
            unpacked_checkpoint_dir = UnpackedNemoCheckpointDir(
                unpack_nemo_ckpt(args.in_file, checkpoint_dir_path),
                load_checkpoints_to_cpu=bool(args.load_checkpoints_to_cpu),
            )
            LOGGER.info("Spent %s (h:m:s) to unpack NeMo archive", datetime.datetime.now() - start_time)
        else:
            unpacked_checkpoint_dir = UnpackedNemoCheckpointDir(
                input_path, load_checkpoints_to_cpu=bool(args.load_checkpoints_to_cpu)
            )

        start_time = datetime.datetime.now()
        convert_checkpoint(unpacked_checkpoint_dir, args)
        LOGGER.info("Spent %s (h:m:s) to convert the model", datetime.datetime.now() - start_time)

    map_location_fn = cpu_map_location if bool(args.load_checkpoints_to_cpu) else gpu_map_location
    # prompt checkpoint converting
    if args.prompt_in_file is not None:
        start_time = datetime.datetime.now()
        assert args.prompt_saved_dir is not None
        unpack_nemo_ckpt(args.prompt_in_file, args.prompt_saved_dir)
        LOGGER.info("Spent %s (h:m:s) to unpack NeMo prompt archive", datetime.datetime.now() - start_time)

        model_config_yaml = "model_config.yaml"
        model_weights_ckpt = "model_weights.ckpt"
        prompt_config_file = open(os.path.join(args.prompt_saved_dir, model_config_yaml), "r")
        prompt_config = yaml.full_load(prompt_config_file)
        LOGGER.info(prompt_config)

        start_time = datetime.datetime.now()
        prompt_weights = torch.load(
            os.path.join(args.prompt_saved_dir, model_weights_ckpt),
            map_location=map_location_fn,
        )
        prompt_convert(args, prompt_config, prompt_weights)
        LOGGER.info(f"Spent %s (h:m:s) to unpack convert prompt model", datetime.datetime.now() - start_time)

if __name__ == "__main__":
    main()


 getRowBytesAt(size_t planeIndex) const override {
    return rowBytes[planeIndex];
  }

 private:
  int _width = 0;
  int _height = 0;
  ReleaseProc releaseProc = nullptr;
  void* releaseContext = nullptr;
  std::vector<const void*> data = {};
  std::vector<size_t> rowBytes = {};
};

std::shared_ptr<YUVData> YUVData::MakeFrom(int width, int height, const void** data,
                                           const size_t* rowBytes, size_t planeCount,
                                           ReleaseProc releaseProc, void* context) {
  if (width <= 0 || height <= 0 || data == nullptr || rowBytes == nullptr || planeCount == 0) {
    return nullptr;
  }
  return std::make_shared<RasterYUVData>(width, height, data, rowBytes, planeCount, releaseProc,
                                         context);
}

}  // namespace tgfx
/////////////////////////////////////////////////////////////////////////////////////////////////
//
//  Tencent is pleased to support the open source community by making tgfx available.
//
//  Copyright (C) 2024 Tencent. All rights reserved.
//
//  Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
//  in compliance with the License. You may obtain a copy of the License at
//
//      https://opensource.org/licenses/BSD-3-Clause
//
//  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.
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "SVGTextBuilder.h"
#include <cstdint>
#include <string>
#include "core/utils/MathExtra.h"
#include "svg/SVGUtils.h"
#include "tgfx/core/Font.h"
#include "tgfx/core/Point.h"
#include "tgfx/core/Typeface.h"
#include "tgfx/core/UTF.h"

namespace tgfx {

SVGTextBuilder::UnicharsInfo SVGTextBuilder::glyphToUnicharsInfo(const GlyphRun& glyphRun) {
  auto unicodeChars = converter.glyphsToUnichars(glyphRun.font, glyphRun.glyphs);
  if (unicodeChars.empty()) {
    return {};
  }

  std::string _text;
  std::string posXString;
  std::string posYString;
  std::string constYString;
  float constY = 0.f;
  bool lastCharWasWhitespace = true;
  bool hasConstY = true;

  for (uint32_t i = 0; i < unicodeChars.size(); i++) {
    auto c = unicodeChars[i];
    auto position = glyphRun.positions[i];
    bool discardPos = false;
    bool isWhitespace = false;

    switch (c) {
      case ' ':
      case '\t':
        // consolidate whitespace to match SVG's xml:space=default munging
        // (http://www.w3.org/TR/SVG/text.html#WhiteSpace)
        if (lastCharWasWhitespace) {
          discardPos = true;
        } else {
          _text.append(UTF::ToUTF8(c));
        }
        isWhitespace = true;
        break;
      case '\0':
        // '\0' for inconvertible glyphs, but these are not legal XML characters
        // (http://www.w3.org/TR/REC-xml/#charsets)
        discardPos = true;
        isWhitespace = lastCharWasWhitespace;  // preserve whitespace consolidation
        break;
      case '&':
        _text.append("&");
        break;
      case '"':
        _text.append(""");
        break;
      case '\'':
        _text.append("'");
        break;


rfallSegment != null) //If segment is sum type
			{
				sum = segment._previousWaterfallSegment.Sum;
			}
			else
			{
				sum = YValues[index];
			}

			segment.Sum = sum;
		}

		static void OnWidthChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.UpdateSbsSeries();
			}
		}

		static void OnAllowAutoSumChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.SegmentsCreated = false;
				series.ScheduleUpdateChart();
			}
		}

		static void OnShowConnectorChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.ScheduleUpdateChart();
			}
		}

		static void OnSummaryBindingPathChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.OnBindingPathChanged();
			}
		}

		static void OnSummaryPointsBrushChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.SegmentsCreated = false;
				series.ScheduleUpdateChart();
			}
		}

		static void OnNegativePointsBrushChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.SegmentsCreated = false;
				series.ScheduleUpdateChart();
			}
		}

		static void OnSpacingChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series && series.ChartArea != null)
			{
				series.InvalidateSeries();
			}
		}

		static void OnConnectorLineStyleChanged(BindableObject bindable, object oldValue, object newValue)
		{
			if (bindable is WaterfallSeries series)
			{
				series.OnStylePropertyChanged(oldValue as ChartLineStyle, newValue as ChartLineStyle);
			}
		}

		void OnStylePropertyChanged(ChartLineStyle? oldValue, ChartLineStyle? newValue)
		{
			if (oldValue != null)
			{
				oldValue.PropertyChanged -= ConnectorLineStyles_PropertyChanged;
				oldValue.Parent = null;
				SetInheritedBindingContext(oldValue, null);
			}

			if (newValue != null)
			{
				newValue.PropertyChanged += ConnectorLineStyles_PropertyChanged;
				newValue.Parent = Parent;
				SetInheritedBindingContext(newValue, BindingContext);
			}

			if (AreaBounds != Rect.Zero)
			{
				InvalidateSeries();
			}
		}

		void ConnectorLineStyles_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			InvalidateSeries();
		}

		#endregion

		#endregion
	}
}


#include "test/jemalloc_test.h"

#define NTHREADS 10

static bool have_dss =
#ifdef JEMALLOC_DSS
    true
#else
    false
#endif
    ;

void *
thd_start(void *arg) {
	unsigned thread_ind = (unsigned)(uintptr_t)arg;
	unsigned arena_ind;
	void *p;
	size_t sz;

	sz = sizeof(arena_ind);
	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
	    0, "Error in arenas.create");

	if (thread_ind % 4 != 3) {
		size_t mib[3];
		size_t miblen = sizeof(mib) / sizeof(size_t);
		const char *dss_precs[] = {"disabled", "primary", "secondary"};
		unsigned prec_ind = thread_ind %
		    (sizeof(dss_precs)/sizeof(char*));
		const char *dss = dss_precs[prec_ind];
		int expected_err = (have_dss || prec_ind == 0) ? 0 : EFAULT;
		assert_d_eq(mallctlnametomib("arena.0.dss", mib, &miblen), 0,
		    "Error in mallctlnametomib()");
		mib[1] = arena_ind;
		assert_d_eq(mallctlbymib(mib, miblen, NULL, NULL, (void *)&dss,
		    sizeof(const char *)), expected_err,
		    "Error in mallctlbymib()");
	}

	p = mallocx(1, MALLOCX_ARENA(arena_ind));
	assert_ptr_not_null(p, "Unexpected mallocx() error");
	dallocx(p, 0);

	return NULL;
}

TEST_BEGIN(test_MALLOCX_ARENA) {
	thd_t thds[NTHREADS];
	unsigned i;

	for (i = 0; i < NTHREADS; i++) {
		thd_create(&thds[i], thd_start,
		    (void *)(uintptr_t)i);
	}

	for (i = 0; i < NTHREADS; i++) {
		thd_join(thds[i], NULL);
	}
}
TEST_END

int
main(void) {
	return test(
	    test_MALLOCX_ARENA);
}


;

export const getBuildingByOrgId = async (orgId: number): Promise<IBuiliding> => {
	const response = await pool.query(`SELECT grafanadb.building.id, grafanadb.building.name,
									grafanadb.building.geodata AS "geoJsonData",
									grafanadb.building.outer_bounds[1:2][1:2] AS "outerBounds",
									grafanadb.building.geolocation[0] AS longitude,
									grafanadb.building.geolocation[1] AS latitude,
									AGE(NOW(), grafanadb.building.created) AS "timeFromCreation",
									AGE(NOW(), grafanadb.building.updated) AS "timeFromLastUpdate"
									FROM grafanadb.building
									INNER JOIN grafanadb.org ON grafanadb.building.id = grafanadb.org.building_id
									WHERE grafanadb.org.building_id = $1`, [orgId]);
	return response.rows[0];
};

export const existsBuildingWithId = async (buildingId: number): Promise<boolean> => {
	const result = await pool.query(`SELECT COUNT(*) FROM grafanadb.building
									WHERE grafanadb.building.id = $1`, [buildingId]);
	return result.rows[0].count !== 0;
};

export const getFloorByBuildingIdAndFloorNumber = async (buildingId: number, floorNumber: number): Promise<IFloor> => {
	const response = await pool.query(`SELECT grafanadb.floor.id, grafanadb.floor.building_id AS "buildingId",
									grafanadb.building.name AS "buildingName",
									grafanadb.floor.floor_number AS "floorNumber",
									grafanadb.floor.geodata AS "geoJsonData",
									grafanadb.floor.outer_bounds AS "outerBounds",
									AGE(NOW(), grafanadb.floor.created) AS "timeFromCreation",
									AGE(NOW(), grafanadb.floor.updated) AS "timeFromLastUpdate"
									FROM grafanadb.floor
									INNER JOIN grafanadb.building ON grafanadb.building.id = grafanadb.floor.building_id
									WHERE building_id = $1 AND floor_number = $2`, [buildingId, floorNumber]);
	return response.rows[0];
};

export const getFloorById = async (floorId: number): Promise<IFloor> => {
	const response = await pool.query(`SELECT id, building_id AS "buildingId", floor_number AS "floorNumber",
									geodata AS "geoJsonData",
									outer_bounds AS "outerBounds",
									AGE(NOW(), created) AS "timeFromCreation",
									AGE(NOW(), updated) AS "timeFromLastUpdate"
									FROM grafanadb.floor
									WHERE id = $1`, [floorId]);
	return response.rows[0];
};

export const getFloorByOrgIdAndFloorNumber = async (orgId: number, floorNumber: number): Promise<IFloor> => {
	const response = await pool.query(`SELECT grafanadb.floor.id,
									grafanadb.floor.building_id AS "buildingId",
									grafanadb.floor.floor_number AS "floorNumber",
									grafanadb.floor.geodata AS "geoJsonData",
									grafanadb.floor.outer_bounds AS "outerBounds",
									AGE(NOW(), grafanadb.floor.created) AS "timeFromCreation",
									AGE(NOW(), grafanadb.floor.updated) AS "timeFromLastUpdate"
									FROM grafanadb.floor
									INNER JOIN grafanadb.building ON grafanadb.building.id = grafanadb.floor.building_id
									INNER JOIN grafanadb.org ON grafanadb.floor.building_id = grafanadb.org.building_id
									WHERE grafanadb.org.id = $1
									AND grafanadb.floor.floor_number = $2`, [orgId, floorNumber]);
	return response.rows[0];
};

export const createFloor = async (floorInput: CreateFloorDto): Promise<IFloor> => {


en_base	dc.l	0
original_rez:	dc.w	0
handle:		dc.w	0
old_palette:	ds.w	16
	even
buffer:	ds.b	(16*8)*20
	ds.b	(16*8)*20
	ds.b	(16*8)*20
eob:


 bind shape matrix? Most armatures seem to export an identity
    ///  bind shape matrix but that might not be the same for every armature.
    ///
    /// TODO: Do not mutate the matrices and instead just return the new values and let the caller
    ///  handle caching them? Would mean less moving parts in our data structures and you always
    ///  know exactly what you are getting. Right now you have no way actions of knowing whether or
    ///  not actions have their bind poses pre-multiplied in.
    pub fn apply_inverse_bind_poses(&mut self) {
        for (_name, action) in self.bone_space_actions.iter_mut() {
            for (bone_idx, keyframe) in action.keyframes_mut().iter_mut() {
                for (index, bone) in keyframe.iter_mut().enumerate() {
                    bone.bone_mut()
                        .multiply(self.inverse_bind_poses[*bone_idx as usize]);
                }
            }
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::interpolate::tests::dq_to_bone;
    use crate::test_util::action_with_keyframes;
    use nalgebra::Matrix4;

    #[test]
    fn convert_actions_to_dual_quats() {
        let mut keyframes = vec![];
        keyframes.push(BoneKeyframe::new(
            1,
            Bone::Matrix(Matrix4::from_column_slice(&[
                1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
            ])),
        ));

        let mut start_armature = BlenderArmature {
            bone_space_actions: action_with_keyframes(keyframes),
            ..BlenderArmature::default()
        };

        start_armature.matrices_to_dual_quats();

        let mut new_keyframes = vec![];
        new_keyframes.push(BoneKeyframe::new(
            1,
            dq_to_bone([1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]),
        ));

        let expected_armature = BlenderArmature {
            bone_space_actions: action_with_keyframes(new_keyframes),
            ..start_armature.clone()
        };

        assert_eq!(start_armature, expected_armature);
    }

    // TODO: Function to return these start_actions that we keep using
    #[test]
    fn transpose_actions() {
        let keyframes = vec![BoneKeyframe::new(
            1,
            Bone::Matrix(Matrix4::from_column_slice(&[
                1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 5.0, 1.0,
            ])),
        )];

        let mut start_armature = BlenderArmature {
            bone_space_actions: action_with_keyframes(keyframes),
            ..BlenderArmature::default()
        };

        start_armature.transpose_actions();

        let new_keyframes = vec![BoneKeyframe::new(
            1,
            Bone::Matrix(Matrix4::from_column_slice(&[
                1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0, 0.0, 1.0,
            ])),
        )];

        let expected_armature = BlenderArmature {
            bone_space_actions: action_with_keyframes(new_keyframes),
            ..start_armature.clone()
        };

        assert_eq!(start_armature, expected_armature);
    }
}
<reponame>PIAIC-IOT/Quarter-1_3.30-6.30<gh_stars>10-100
use std::collections::


/* -*- C++ -*- */
/*
 * Software Bluetooth Hands-Free Implementation
 *
 * Copyright (C) 2006-2008 Sam Revitch <samr7@cs.washington.edu>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

#if !defined(__HFPD_NET_H__)
#define __HFPD_NET_H__

#include <sys/types.h>

#include <libhfp/events.h>
#include <libhfp/list.h>

class Server;
class Session;
class HandsFree;

class Session {
	friend class Server;

	typedef void (HandsFree::*delete_cb_t)(Session *);

	libhfp::ListItem	m_links;
	Server			*m_server;
	int			m_sock;
	libhfp::SocketNotifier	*m_not;
	delete_cb_t		m_delete_cb;
	libhfp::TimerNotifier	*m_unpause;

	bool			m_defunct;
	bool			m_pause;
	size_t			m_req_start;
	size_t			m_req_len;
	char			m_req_buf[512];

	libhfp::DispatchInterface *GetDi(void) const;

	void DataReady(libhfp::SocketNotifier *notp, int fh);
	ssize_t ParseLine(char *buf, size_t len);
	bool ParseCommand(char *buf);
	void DoUnpause(libhfp::TimerNotifier *timerp);

public:
	bool Write(void *buf, size_t len);
	bool vprintf(const char *fmt, va_list ap);
	bool printf(const char *fmt, ...) {
		va_list ap;
		bool result;
		va_start(ap, fmt);
		result = vprintf(fmt, ap);
		va_end(ap);
		return result;
	}

	void SetPause(bool pause);
	void SetDefunct(void);
	void SetDeleteCallback(delete_cb_t cb) { m_delete_cb = cb; }

	Session(Server *servp, int sock, libhfp::SocketNotifier *notp)
		: m_server(servp), m_sock(sock), m_not(notp),
		  m_delete_cb(0), m_unpause(0), m_defunct(false),
		  m_pause(false), m_req_start(0), m_req_len(0) {
		notp->Register(this, &Session::DataReady);
	}
	~Session() {
		if (m_not)
			delete m_not;
		if (m_sock)
			close(m_sock);
	}
};

class Server {
public:
	libhfp::ListItem		m_sessions;
	libhfp::ListItem		m_sessions_defunct;
	libhfp::DispatchInterface	*m_di;

	HandsFree			*m_handsfree;

	typedef bool (HandsFree::*dispatch_cb_t)(Session *,
						 int argc, char *const * argv);

	dispatch_cb_t			m_dispatch;

	struct Listener {
		libhfp::ListItem	links;
		int			sock;
		libhfp::SocketNotifier	*notifier;
	};

	libhfp::ListItem		m_listeners;

	libhfp::DispatchInterface *GetDi(void) const { return m_di; }

	bool InetListen(uint16_t port, bool non_loopback = false);
	bool UnixListen(const char *sockname);
	bool FinishListen(int sock);
	void SocketCleanup(void);

	void ListenNotify(libhfp::SocketNotifier *notp, int fh);
	void SessionClosed(Session *sessp);
	void SessionDefunct(Session *sessp);
	void DefunctAll(void);
	void CleanSessions(void);

	void Broadcast(void *buf, size_t len);
	void vprintf(const char *fmt, va_list ap);
	void printf(const char *fmt, ...) {
		va_list ap;
		va_start(ap, fmt);
		vprintf(fmt, ap);
		va_end(ap);
	}

	bool DispatchCommand(Session *sessp, int argc, char * const *argv);

	Server(libhfp::DispatchInterface *di, HandsFree *hf)
		: m_di(di), m_handsfree(hf), m_dispatch(0) {}
	~Server() {
		DefunctAll();
		SocketCleanup();
		CleanSessions();
	}
};

#endif /* !defined(__HFPD_NET_H__) */


000：管理员
 * @param level 当前等级 0-6级
 * @param jointime 注册时间 此接口返回恒为0
 * @param moral 节操 默认70
 * @param silence 封禁状态 0：正常 1：被封
 * @param emailStatus 已验证邮箱 0：未验证 1：已验证
 * @param telStatus 已验证手机号	 0：未验证 1：已验证
 * @param identification 1
 * @param vip 会员信息
 * @param pendant 头像框信息
 * @param nameplate 勋章信息
 * @param official 认证信息
 * @param birthday 生日 时间戳
 * @param isTourist 会员信息
 * @param isFakeAccount
 * @param pinPrompting
 * @param isDeleted
 * @param inRegAudit
 * @param isRipUser
 * @param profession 专业资质信息
 * @param faceNft 是否为 nft 头像 0不是nft头像 1是 nft 头像
 * @param faceNftNew
 * @param isSeniorMember 是否为硬核会员 0：否 1：是
 * @param honours
 * @param digitalId
 * @param digitalType
 * @param levelExp
 * @param coins 硬币数
 * @param following 粉丝数
 * @param follower 粉丝数
 */
@Serializable
data class MyInfoData(
    val mid: Long,
    val name: String,
    val sex: String,
    val face: String,
    val sign: String,
    val rank: Int,
    val level: Int,
    val jointime: Int,
    val moral: Int,
    val silence: Int,
    @SerialName("email_status")
    val emailStatus: Int,
    @SerialName("tel_status")
    val telStatus: Int,
    val identification: Int,
    val vip: Vip,
    val pendant: Pendant,
    val nameplate: Nameplate,
    val official: Official,
    val birthday: Long,
    @SerialName("is_tourist")
    val isTourist: Int,
    @SerialName("is_fake_account")
    val isFakeAccount: Int,
    @SerialName("pin_prompting")
    val pinPrompting: Int,
    @SerialName("is_deleted")
    val isDeleted: Int,
    @SerialName("in_reg_audit")
    val inRegAudit: Int,
    @SerialName("is_rip_user")
    val isRipUser: Boolean,
    val profession: Profession,
    @SerialName("face_nft")
    val faceNft: Int,
    @SerialName("face_nft_new")
    val faceNftNew: Int,
    @SerialName("is_senior_member")
    val isSeniorMember: Int,
    val honours: UserHonours,
    @SerialName("digital_id")
    val digitalId: String,
    @SerialName("digital_type")
    val digitalType: Int,
    @SerialName("level_exp")
    val levelExp: LevelInfo,
    val coins: Float,
    val following: Int,
    val follower: Int
)
package dev.aaa1115910.biliapi.http.entity.index

object IndexFilterStyle {
    private val styleFilter = mapOf(
        -1 to "全部",
        -10 to "电影",

        10010 to "原创",
        10011 to "漫画改",
        10012 to "小说改",


                    sender_id: sender_id,
                    opcode: 1,
                    args: vec![Argument::NewId(id.id()), Argument::Object(pointer.id())],
                },
            }
        }
        unsafe fn from_raw_c(
            obj: *mut ::std::os::raw::c_void,
            opcode: u32,
            args: *const wl_argument,
        ) -> Result<Request, ()> {
            panic!("Request::from_raw_c can not be used Client-side.")
        }
        fn as_raw_c_in<F, T>(self, f: F) -> T
        where
            F: FnOnce(u32, &mut [wl_argument]) -> T,
        {
            match self {
                Request::GetSwipeGesture { id, pointer } => {
                    let mut _args_array: [wl_argument; 2] = unsafe { ::std::mem::zeroed() };
                    _args_array[0].o = id.c_ptr() as *mut _;
                    _args_array[1].o = pointer.c_ptr() as *mut _;
                    f(0, &mut _args_array)
                }
                Request::GetPinchGesture { id, pointer } => {
                    let mut _args_array: [wl_argument; 2] = unsafe { ::std::mem::zeroed() };
                    _args_array[0].o = id.c_ptr() as *mut _;
                    _args_array[1].o = pointer.c_ptr() as *mut _;
                    f(1, &mut _args_array)
                }
            }
        }
    }
    pub enum Event {}
    impl super::MessageGroup for Event {
        const MESSAGES: &'static [super::MessageDesc] = &[];
        type Map = super::ProxyMap;
        fn is_destructor(&self) -> bool {
            match *self {}
        }
        fn opcode(&self) -> u16 {
            match *self {}
        }
        fn child<Meta: ObjectMetadata>(
            opcode: u16,
            version: u32,
            meta: &Meta,
        ) -> Option<Object<Meta>> {
            match opcode {
                _ => None,
            }
        }
        fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()> {
            match msg.opcode {
                _ => Err(()),
            }
        }
        fn into_raw(self, sender_id: u32) -> Message {
            panic!("Event::into_raw can not be used Client-side.")
        }
        unsafe fn from_raw_c(
            obj: *mut ::std::os::raw::c_void,
            opcode: u32,
            args: *const wl_argument,
        ) -> Result<Event, ()> {
            match opcode {
                _ => return Err(()),
            }
        }
        fn as_raw_c_in<F, T>(self, f: F) -> T
        where
            F: FnOnce(u32, &mut [wl_argument]) -> T,
        {
            panic!("Event::as_raw_c_in can not be used Client-side.")
        }
    }
    pub struct ZwpPointerGesturesV1;
    impl Interface for ZwpPointerGesturesV1 {
        type Request = Request;
        type Event = Event;
        const NAME: &'static str = "zwp_pointer_gestures_v1";
        const VERSION: u32 = 1;
        fn c_interface() -> *const wl_interface {
            unsafe { &super::super::c_interfaces::zwp_pointer_gestures_v1_interface }
        }
    }
    pub trait RequestsTrait {
        #[doc = "get swipe gesture\n\nCreate a swipe gesture object. See the\nwl_pointer_gesture_swipe interface for details."]
        fn get_swipe_gesture<F>(
            &self,
            pointer: &Proxy<super::wl_pointer::WlPointer>,


#0 | ERR #0 | ERR #0 | ERR #0
    (op 'a)            | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 0 0)           | #t     | #f     | #f     | #t     | #t
    (op 1 0)           | #f     | #f     | #t     | #f     | #t
    (op 3 3)           | #t     | #f     | #f     | #t     | #t
    (op -1 3)          | #f     | #t     | #f     | #t     | #f
    (op 3 5)           | #f     | #t     | #f     | #t     | #f
    (op #f #f)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #t #f)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #f #t)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #t #t)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 'a)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 'b)         | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #f 0)          | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 0)          | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 0 'a)          | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 1 #t)          | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 1 1 1 1)       | #t     | #f     | #f     | #t     | #t
    (op 1 2 3 4)       | #f     | #t     | #f     | #t     | #f
    (op #f #f #f)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #f #f #f #f)   | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #t #t #t)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op #t #f #t)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 'a 'a)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 'b 'b)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 'a 'b 'c)      | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0
    (op 1 2 #t 1 'a)   | ERR #0 | ERR #0 | ERR #0 | ERR #0 | ERR #0

    # | error message
    --------------------------------------------------------------------
    0 | \\"error when evaluating precompiled fep: <error message omitted>\\"
    "
  `);
});

test('trigonometric ops', () => {
  // ,
  expectOpTable(
    ['sin', 'cos', 'tan'],
    [
      ...zeroArgTests,
      '(op (* (/ -2 1) pi))',
      '(op (* (/ -1 1) pi))',
      '(op (* (/ -1 2) pi))',
      '(op (* (/ -1 3) pi))',
      '(op (* (/ -1 4) pi))',
      '(op (* (/ -1 6) pi))',
      '(op 0)',
      '(op (* (/


uper  Abraam G11 XP}  {\cf2 Abraham.}"
    # out = Converter().convertFromRichTextFormat(text, True)
    # print(out)

    # file = "/Users/otseng/Downloads/TR.txt"
    # Converter().importTXTBible(file)

    # line = "In <FI>the<Fi> beginning<WH7225><WTHR><WTHNcfsa> God<WH430><WTHNcmpa> created<WH1254><WTHVqp3ms> <WH853><WTHTo> the heavens<WH8064><WTHTd><WTHNcmpa> and<WH853><WTHC><WTHTo> the earth.<WH776><WTHTd><WTHNcbsa>"
    # line = """And God<WH430><WTHNcmpa> said,<WH559><WTHC><WTHVqw3ms> "Let there be<WH1961><WTHVqj3ms> light."<WH216><WTHNcbsa> And there was<WH1961><WTHC><WTHVqw3ms> light.<WH216><WTHNcbsa>"""
    # line = """<v="Gen.1.1/Gen.1.1"><wt>ἐν<WTP l="ἐν"> <wt>ἀρχῇ<WTN1-DSF l="ἀρχή"> <wt>ἐποίησεν<WTVAI-AAI3S l="ποιέω"> <wt>ὁ<WTRA-NSM l="ὁ"> <wt>θεὸς<WTN2-NSM l="θεός"> <wt>τὸν<WTRA-ASM l="ὁ"> <wt>οὐρανὸν<WTN2-ASM l="οὐρανός"> <wt>καὶ<WTC l="καί"> <wt>τὴν<WTRA-ASF l="ὁ"> <wt>γῆν<WTN1-ASF l="γῆ">"""
    # out = Converter().stripTheWordTags(line)
    # print(out)

    # file = "/Users/otseng/Downloads/apocrypha.txt"
    # print("Processing " + file)
    # Converter().importScrollmapperDeuterocanonicalFiles(file)

    # file = "/Users/otseng/Downloads/FruchtenbaumOTRev.xrefs.twm"
    # Converter().importTheWordXref(file)

    # line = "\\tx123dev\\tx2345abc"
    # print(re.sub("\\\\tx[0-9]*", "", line))

    # filename = "/home/oliver/Downloads/Miller - Devotional Hours with the Bible.devx"
    # Converter().importESwordDevotional(filename)

    # line = '<TS>The Creation<Ts><wt><E>In the beginning<e><O> בְּרֵאשִׁ֖ית<o><T> bə·rê·šîṯ<t><WH7225><WTPrep-b+N-fs l="רֵאשִׁית"><RX 43.1.1+4><RX 58.11.1+2><wt><E> God<e><O> אֱלֹהִ֑ים<o><T> ’ĕ·lō·hîm<t><WH430><WTN-mp l="אֱלֹהִים"><wt><E> -<e><O> אֵ֥ת<o><T> ’êṯ<t><WH853><WTDirObjM l="אֵת"><wt><E> created<e><O> בָּרָ֣א<o><T> bā·rā<t><WH1254><WTV-Qal-Perf-3ms l="בָּרָא"><wt><E> the heavens<e><O> הַשָּׁמַ֖יִם<o><T> haš·šā·ma·yim<t><WH8064><WTArt+N-mp l="שָׁמַיִם"><wt><E> and<e><O> וְאֵ֥ת<o><T> wə·’êṯ<t><WH853><WTConj-w+DirObjM l="אֵת"><wt><E> the earth.<e><O> הָאָֽרֶץ׃<o><T> hā·’ā·reṣ<t><WH776><WTArt+N-fs l="אֶרֶץ">'
    # line = '<TS>Nothing May Be Added or Removed<Ts><wt><E>I<e><OG> ἐγὼ<og><T> egō<t><WG1473><WTPPro-N1S l="ἐγώ"><wt><E> testify<e><OG> Μαρτυρῶ<og><T> Martyrō<t><WG3140><WTV-PIA-1S l="μαρτυρέω"><wt><E> to everyone<e><OG> παντὶ<og><T> panti<t><WG3956><WTAdj-DMS l="πᾶς"><wt><E> who<e><OG> τῷ<og><T> tō<t><WG3588><WTArt-DMS l="ὁ"><wt><E> hears<e><OG> ἀκούοντι<og><T> akouonti<t><WG191><WTV-PPA-DMS l="ἀκούω"><wt><E> the<e><OG> τοὺς<og><T> tous<t><WG3588><WTArt-AMP l="ὁ"><wt><E> words<e><OG> λόγους<og><T> logous<t><WG3056><WTN-AMP l="λόγος"><wt><E> of<e><OG> τῆς<og><T> tēs<t><WG3588><WTArt-GFS l="ὁ"><wt><E> prophecy<e><OG> προφητείας<og><T> prophēteias<t><WG4394><WTN-GFS l="προφητεία"><wt><E> in this<e><OG> τούτου·<og><T> toutou·<t><WG3778><WTDPro-GNS l="οὗτος"><wt><E> -<e><OG> τοῦ<og><T> tou<t><WG3588><WTArt-GNS l="ὁ"><wt><E> book:<e><OG> βιβλίου<og><T> bibliou<t><WG975><WTN-GNS l="βιβλίον"><wt><E> If<e><OG> ἐάν<og><T> ean<t><WG1437><WTConj l="ἐάν"><wt><E> anyone<e><OG> τις<og><T> tis<t><WG5100><WTIPro-NMS l="τίς"><wt><E> adds<e><OG> ἐπιθῇ<og><T> epithē<t><WG2007><WTV-ASA-3S l="ἐπιτίθημι"><wt><E> to<e><OG> ἐπ’<og><T> ep’<t><WG1909><WTPrep l="ἐπί"><wt><E> them,<e><OG> αὐτά,<og><T> auta,<t><WG846><WTPPro-AN3P l="αὐτός"><wt><E> -<e><OG> ὁ<og><T> ho<t><WG3588><WTArt-NMS l="ὁ"><wt><E> God<e><OG> Θεὸς<og><T> Theos<t><WG2316><WTN-NMS l="θεός"><wt><E> will add<e><OG> ἐπιθήσει<og><T> epithēsei<t><WG2007><WTV-FIA-3S l="ἐπιτίθημι"><wt><E> to<e><OG> ἐπ’<og><T> ep’<t><WG1909><WTPrep l="ἐπί"><wt><E> him<e><OG> αὐτὸν<og><T> auton<t><WG846><WTPPro-AM3S l="αὐτός"><wt><E> the<e><OG> τὰς<og><T> tas<t><WG3588><WTArt-AFP l="ὁ"><wt><E> plagues<e><OG> πληγὰς<og><T> plēgas<t><WG4127><WTN-AFP l="πληγή"><wt><E> -<e><OG> τὰς<og><T> tas<t><WG3588><WTArt-AFP l="ὁ"><wt><E> described<e><OG> γεγραμμένας<og><T> gegrammenas<t><WG1125><WTV-RPM/P-AFP l="γράφω"><wt><E> in<e><OG> ἐν<og><T> en<t><WG1722><WTPrep l="ἔν"><wt><E> this<e><OG> τούτῳ.<og><T> toutō.<t><WG3778><WTDPro-DNS l="οὗτος"><wt><E> -<e><OG> τῷ<og><T> tō<t><WG3588><WTArt-DNS l="ὁ"><wt><E> book.<e><OG> βιβλίῳ<og><T> bibliō<t><WG975><WTN-DNS l="βιβλίον">'
    # out = Converter().stripTheWordTags(line)
    # print(out)

    file = "/home/oliver/Downloads/temp/2001b.xml"
    Converter().importXMLBible(file)


和边权
##### 实现的特征
```rust
impl Edge {
    pub fn new(u_ : usize, v_ : usize, w_ : i32) -> Edge {
        Edge { u : u_, v : v_, w : w_ }
    }
}

impl Default for Edge {
    fn default() -> Edge {
        Edge { u : 0, v : 0, w : 0 }
    }
}

impl Ord for Edge {
    fn cmp(&self, other: &Self) -> Ordering {
        self.w.cmp(&other.w)
    }
}

impl PartialOrd for Edge {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

impl PartialEq for Edge {
    fn eq(&self, other: &Self) -> bool {
        self.w == other.w
    }
}

impl Eq for Edge { }
```
定义了相等和偏序关系，用于sort
### union_find.rs
实现并查集，支持按秩合并
##### 数据结构
```rust
pub struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<u32>,
}
```
带权并查集
##### 成员函数
```rust
impl UnionFind {
    pub fn new(size: usize) -> UnionFind {
        UnionFind {
            parent: (0..size).collect(),
            rank: vec![0; size as usize],
        }
    }

    pub fn find(&mut self, x: usize) -> usize {
        if self.parent[x] != x {
            self.parent[x] = self.find(self.parent[x]);
        }
        self.parent[x]
    }

    pub fn union(&mut self, x: usize, y: usize) -> bool {
        let root_x = self.find(x);
        let root_y = self.find(y);

        if root_x == root_y {
            return false;
        }

        if self.rank[root_x] > self.rank[root_y] {
            self.parent[root_y] = root_x;
        } else if self.rank[root_x] < self.rank[root_y] {
            self.parent[root_x] = root_y;
        } else {
            self.parent[root_y] = root_x;
            self.rank[root_x] += 1;
        }

        true
    }
}
```
包括按秩合并，合并成功返回true反之false
以及路径压缩的find函数

# project
[https://github.com/annajcy/krusal_visualization.git](https://github.com/annajcy/krusal_visualization.git)
# Основные команды Git

Git — это мощная система контроля версий, которая помогает отслеживать изменения в вашем коде. В этом разделе мы рассмотрим основные команды Git, которые помогут вам начать работу с этой системой.

---

## Установка Git

Прежде чем начать использовать Git, вам нужно установить его на ваш компьютер. Вы можете скачать Git с официального сайта [git-scm.com](https://git-scm.com/).

---

## Основные команды

### 1. `git init`

Команда `git init` используется для создания нового л


he's plainly

    less than overjoyed to see them. And impatient to get

    it over with.

 APGAR

    My assistant Tayna... well, let's

    get on with it, shall we?

 From off camera, heads turning to the voice of --

 MANUA (O.S.)

    Don't be in such a hurry, dear...

24A ANGLE - MANUA

 entering... and it's a moment... like that first look

    that Bacall gave Bogart in "To Have and Have Not", she

    gives that look to Riker... female, thirties, strong,

    outgoing -- she takes your breath away. But Riker's

    hologram is quite unmoved.

 MANUA

    (continuing)

    Perhaps our guests would like some

    refreshment...

 STAR TREK: "Perspective" - REV. 12/3/89 - ACT TWO 17.

24A CONTINUED:

 She moves to Riker, looks him in the eyes...

 APGAR

    My wife, Manua...

 RIKER

    (pleasant but routine)

    Pleasure to meet you, Mrs.

    Apgar.

 His attention is on Apgar...

 RIKER

    Doctor, if you're prepared to get

    started, so are we...

 APGAR

    (defensive)

    Prepared? Of course I'm

    prepared...

 RIKER

    (reacts)

    All right... then why don't you

    give me the overview of your

    research while Mister La Forge

    and your assistant look at the

    experimental data...

 APGAR

    Fine. Whatever. I must say,

    Commander, I resent your early

    arrival. Starfleet will get its

    converter... I've had a few

    setbacks, that's all...

 STAR TREK: "Perspective" - REV. 12/4/89 - ACT TWO 17A.

24A CONTINUED: (2)

 RIKER

    (sympathetic)

    Doctor, we're not here to pressure

    you, we just want an update on

    your progress.

 Apgar grunts, disbelieving. Riker glances toward --

 STAR TREK: "Perspective" - REV. 12/3/89 - ACT TWO 18.

24B ANGLE - MANUA

 revealing she is bored beyond description, leaning

    languidly against a counter with her elbows back,

    supporting her and her chest thrust out rather

    invitingly, her eyes undress Riker.

 APGAR

    Tayna -- show the commander's

    assistant whatever he wants to

    see. Give him full access to our

    records.

 TAYNA

    (to Geordi)

    If you'll come with me...

 Tayna leads Geordi over to the other side of the lab,

    shows him the large array of condensers.

 TAYNA

    Our Lambda Field generator is on

    the planet since it requires a

    m


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using ShopApp.Business.Abstract;
using ShopApp.Business.Concrete;
using ShopApp.DataAccess.Abstract;
using ShopApp.DataAccess.Concrete.EfCore;
using ShopApp.DataAccess.Concrete.Memory;

namespace ShopApp.WebUI
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)


 .text, "ax"  # 0x800056C0 - 0x80472F00
.fn init__Q34Game12KumaKochappy3FSMFPQ24Game9EnemyBase, global
/* 802E4EE8 002E1E28  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 802E4EEC 002E1E2C  7C 08 02 A6 */	mflr r0
/* 802E4EF0 002E1E30  38 80 00 07 */	li r4, 7
/* 802E4EF4 002E1E34  90 01 00 14 */	stw r0, 0x14(r1)
/* 802E4EF8 002E1E38  93 E1 00 0C */	stw r31, 0xc(r1)
/* 802E4EFC 002E1E3C  7C 7F 1B 78 */	mr r31, r3
/* 802E4F00 002E1E40  4B E4 B9 65 */	bl create__Q24Game17EnemyStateMachineFi
/* 802E4F04 002E1E44  38 60 00 10 */	li r3, 0x10
/* 802E4F08 002E1E48  4B D3 EF 9D */	bl __nw__FUl
/* 802E4F0C 002E1E4C  7C 64 1B 79 */	or. r4, r3, r3
/* 802E4F10 002E1E50  41 82 00 3C */	beq .L_802E4F4C
/* 802E4F14 002E1E54  3C 60 80 4B */	lis r3, __vt__Q24Game13EnemyFSMState@ha
/* 802E4F18 002E1E58  3C A0 80 4D */	lis r5, __vt__Q34Game12KumaKochappy5State@ha
/* 802E4F1C 002E1E5C  38 03 F9 A4 */	addi r0, r3, __vt__Q24Game13EnemyFSMState@l
/* 802E4F20 002E1E60  3C 60 80 4D */	lis r3, __vt__Q34Game12KumaKochappy9StateDead@ha
/* 802E4F24 002E1E64  90 04 00 00 */	stw r0, 0(r4)
/* 802E4F28 002E1E68  38 E0 00 00 */	li r7, 0
/* 802E4F2C 002E1E6C  38 C5 40 9C */	addi r6, r5, __vt__Q34Game12KumaKochappy5State@l
/* 802E4F30 002E1E70  38 A2 EB 00 */	addi r5, r2, lbl_8051CE60@sda21
/* 802E4F34 002E1E74  90 E4 00 04 */	stw r7, 4(r4)
/* 802E4F38 002E1E78  38 03 40 78 */	addi r0, r3, __vt__Q34Game12KumaKochappy9StateDead@l
/* 802E4F3C 002E1E7C  90 E4 00 08 */	stw r7, 8(r4)
/* 802E4F40 002E1E80  90 C4 00 00 */	stw r6, 0(r4)
/* 802E4F44 002E1E84  90 A4 00 0C */	stw r5, 0xc(r4)
/* 802E4F48 002E1E88  90 04 00 00 */	stw r0, 0(r4)
.L_802E4F4C:
/* 802E4F4C 002E1E8C  7F E3 FB 78 */	mr r3, r31
/* 802E4F50 002E1E90  4B E4 B9 B9 */	bl registerState__Q24Game17EnemyStateMachineFPQ24Game13EnemyFSMState
/* 802E4F54 002E1E94  38 60 00 10 */	li r3, 0x10
/* 802E4F58 002E1E98  4B D3 EF 4D */	bl __nw__FUl
/* 802E4F5C 002E1E9C  7C 64 1B 79 */	or. r4, r3, r3
/* 802E4F60 002E1EA0  41 82 00 40 */	beq


fe.Pointer(cOldPath))

	cNewPath := C.CString(newPath)
	defer C.free(unsafe.Pointer(cNewPath))

	var err error
	copts := populateDiffOptions(&C.git_diff_options{}, opts, v, &err)
	defer freeDiffOptions(copts)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_patch_from_buffers(&patchPtr, oldPtr, C.size_t(len(oldBuf)), cOldPath, newPtr, C.size_t(len(newBuf)), cNewPath, copts)
	runtime.KeepAlive(oldBuf)
	runtime.KeepAlive(newBuf)
	if ret == C.int(ErrorCodeUser) && err != nil {
		return nil, err
	}
	if ret < 0 {
		return nil, MakeGitError(ret)
	}

	return newPatchFromC(patchPtr), nil
}
package git

/*
#include <git2.h>

extern void _go_git_populate_stash_apply_callbacks(git_stash_apply_options *opts);
extern int _go_git_stash_foreach(git_repository *repo, void *payload);
*/
import "C"
import (
	"runtime"
	"unsafe"
)

// StashFlag are flags that affect the stash save operation.
type StashFlag int

const (
	// StashDefault represents no option, default.
	StashDefault StashFlag = C.GIT_STASH_DEFAULT

	// StashKeepIndex leaves all changes already added to the
	// index intact in the working directory.
	StashKeepIndex StashFlag = C.GIT_STASH_KEEP_INDEX

	// StashIncludeUntracked means all untracked files are also
	// stashed and then cleaned up from the working directory.
	StashIncludeUntracked StashFlag = C.GIT_STASH_INCLUDE_UNTRACKED

	// StashIncludeIgnored means all ignored files are also
	// stashed and then cleaned up from the working directory.
	StashIncludeIgnored StashFlag = C.GIT_STASH_INCLUDE_IGNORED
)

// StashCollection represents the possible operations that can be
// performed on the collection of stashes for a repository.
type StashCollection struct {
	doNotCompare
	repo *Repository
}

// Save saves the local modifications to a new stash.
//
// Stasher is the identity of the person performing the stashing.
// Message is the optional description along with the stashed state.
// Flags control the stashing process and are given as bitwise OR.
func (c *StashCollection) Save(
	stasher *Signature, message string, flags StashFlag) (*Oid, error) {

	oid := new(Oid)

	stasherC, err := stasher.toC()
	if err != nil {
		return nil, err
	}
	defer C.git_signature_free(stasherC)

	messageC := C.CString(message)
	defer C.free(unsafe.Pointer(messageC))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_stash_save(
		oid.toC(), c.repo.ptr,
		stasherC, messageC, C.uint32_t(flags))
	runtime.KeepAlive(c)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return oid, nil
}

// StashApplyFlag are flags that affect the stash apply operation.
type StashApplyFlag int

const (
	// StashApplyDefault is the default.
	StashApplyDefault St


ED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include <machine/asm.h>

#if defined(LIBC_SCCS) && !defined(lint)
#if 0
	RCSID("from: @(#)bzero.s	5.1 (Berkeley) 5/12/90")
#else
	RCSID("$NetBSD: memset.S,v 1.7 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */

ENTRY(memset)
	movl	%d2,-(%sp)
	movl	8(%sp),%a0		| destination
	movl	16(%sp),%d1		| count
	movb	15(%sp),%d2		| get fill character

	/*
	 * It isn't worth the overhead of aligning to {long}word boundries
	 * if the string is too short.
	 */
	cmpl	#15,%d1
	jlt	.Lbzbyte

	clrl %d0
	moveb	%d2,%d0
	movel	%d0,%d2
	lsll	#8,%d0
	orl	%d0,%d2
	lsll	#8,%d0
	orl	%d0,%d2
	lsll	#8,%d0
	orl	%d0,%d2

	/* word align */
	movl	%a0,%d0
	btst	#0,%d0			| if (dst & 1)
	jeq	.Lbzalgndw		|
	movb	%d2,(%a0)+		|	*(char *)dst++ = X
	subql	#1,%d1			|	len--
	addql	#1,%d0
.Lbzalgndw:
#ifndef	__mc68010__
	/* long word align */
	btst	#1,%d0			| if (dst & 2)
	jeq	.Lbzalgndl		|
	movw	%d2,(%a0)+		|	*(short *)dst++ = X
	subql	#2,%d1			|	len -= 2
.Lbzalgndl:
	/* set by 8 longwords */
	movel	%d1,%d0
	lsrl	#5,%d0			| cnt = len / 32
	jeq	.Lbzlong			| if (cnt)
	andl	#31,%d1			|	len %= 32
	subql	#1,%d0			|	set up for dbf
.Lbz32loop:
	movl	%d2,(%a0)+		|	set 8 long words
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
	movl	%d2,(%a0)+
#ifndef __mcoldfire__
	dbf	%d0,.Lbz32loop		|	till done
	clrw	%d0
#endif
	subql	#1,%d0
	jcc	.Lbz32loop
#endif	/* !__mc68010__ */

.Lbzlong:
	/* set by longwords */
	movel	%d1,%d0
	lsrl	#2,%d0			| cnt = len / 4
	jeq	.Lbzbyte			| if (cnt)
	subql	#1,%d0			|	set up for dbf
.Lbzlloop:
	movl	%d2,(%a0)+		|	clear longwords
#ifndef __mcoldfire__
	dbf	%d0,.Lbzlloop		|	till done
#endif
#ifdef	__mc68010__
	clrw	%d0
#endif	/* __mc68010__ */
#if defined(__m68010) || defined(__mcoldfire__)
	subql	#1,%d0
	jcc	.Lbzlloop
#endif	/* __mc68010__ || __mcoldfire__ */
	andl	#3,%d1			|	len %= 4
	jeq	.Lbzdone

	subql	#1,%d1			| set up for dbf
.Lbzbloop:
	movb	%d2,(%a0)+		| set bytes
.Lbzbyte:
#ifdef __mcoldfire__
	subql	#1,%d1			| decrement
	jcc	.Lbzbloop		| till done
#else
	dbf	%d1,.Lbzbloop		| till done
#endif
.Lbzdone:
	movl	8(%sp),%d0		| return destination
#ifdef __SVR4_ABI__
	moveal	%d0,%a0
#endif
	movl	(%sp)+,%d2
	rts
END(memset)


from ultralytics import YOLO
from pathlib import Path
import torch
import os
import csv

def Train_Model(Yaml_List: list, Output_Path: str ,ksplit = 1):

    Out_Path = Path(Output_Path)

    Out_Path_Train = Path(Out_Path / "Train")
    Out_Path_Validate = Path(Out_Path / "Validate")

    Out_Path_Train.mkdir(parents=True, exist_ok=True)
    Out_Path_Validate.mkdir(parents=True, exist_ok=True)

    file = open(Yaml_List, "r")
    content = file.read()

    X = content.split(',')

    Weights_Path = "./yolo11m.pt"
    Use_Model = YOLO(Weights_Path, task="detect")

    results = {}

    batch = 8
    epochs = 300
    patience = 50
    imgsz = 640
    conf = 0.5
    iou = 0.6

    for k in range(ksplit):

        dataset_yaml = X[k]

        Use_Model.train(data=dataset_yaml, epochs=epochs, batch=batch, project=Out_Path_Train,
                        patience=patience, imgsz=imgsz, name=f"fold_{k}_train")

        val_metrics = Use_Model.val(data=dataset_yaml, batch=batch, project=Out_Path_Validate,
                                    imgsz=imgsz, name=f"fold_{k}_val", conf=conf, iou=iou)

        results[k] = {
            "train_metrics": Use_Model.metrics,
            "val_metrics": val_metrics
        }

if __name__ == "__main__":

    Ymal_List = 'Yaml_Split.txt'
    Out_path = 'Output_Path'

    Train_Model(Ymal_List, Out_path)


 String _MSG_SEPARATOR = '^';

enum RidMessageType {
  Severe,
  Error,
  LogWarn,
  LogInfo,
  LogDebug,
  MsgInfo,
  MsgWarn
}

RidMessageType _ridMsgTypeFromString(String s) {
  switch (s.toLowerCase()) {
    case "err_severe":
      return RidMessageType.Severe;
    case "err_error":
      return RidMessageType.Error;
    case "log_warn":
      return RidMessageType.LogWarn;
    case "log_info":
      return RidMessageType.LogInfo;
    case "log_debug":
      return RidMessageType.LogDebug;
    case "msg_warn":
      return RidMessageType.MsgWarn;
    case "msg_info":
      return RidMessageType.MsgInfo;
    default:
      throw ArgumentError.value(s);
  }
}

final _REMOVE_QUOTE_RX = RegExp(r'(^"|"$)');

class RidMessage {
  final RidMessageType type;
  late final String message;
  late final String? details;

  RidMessage._(this.type, String message, String? details) {
    this.message = message.replaceAll(_REMOVE_QUOTE_RX, '');
    this.details = details?.replaceAll(_REMOVE_QUOTE_RX, '');
  }

  @override
  String toString() {
    final detailsString = details == null ? '' : ', details: "$details"';
    return 'RidMessage{ type: $type, message: "$message"$detailsString }';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is RidMessage &&
          runtimeType == other.runtimeType &&
          type == other.type &&
          message == other.message &&
          details == other.details;

  @override
  int get hashCode => type.hashCode ^ message.hashCode ^ details.hashCode;
}

abstract class RidMessageChannel {
  Stream<RidMessage> get stream;
}

class RidMessageChannelInternal implements RidMessageChannel {
  final _zone = Zone.current;
  final StreamController<RidMessage> _sink;
  final DynamicLibrary _dl;
  late final RawReceivePort _receivePort;
  late final _zonedAdd;

  RidMessageChannelInternal._(this._dl, bool isDebugMode)
      : _sink = StreamController.broadcast() {
    _receivePort =
        RawReceivePort(_onReceivedMsg, 'rid::messaging_channel::port');
    initIsolate(this._dl, 'rid_init_msg_isolate',
        _receivePort.sendPort.nativePort, isDebugMode);
    _zonedAdd = _zone.registerUnaryCallback(_add);
  }

  void _onReceivedMsg(String reply) {
    _zone.runUnary(_zonedAdd, reply);
  }

  void _add(String reply) {
    if (!_sink.isClosed) {
      _sink.add(_decode(reply));
    }
  }

  RidMessage _decode(String data) {
    int sepIdx = data.indexOf(_MSG_SEPARATOR);
    final type = data.substring(0, sepIdx);
    final msgType = _ridMsgTypeFromString(type);

    final msg = data.substring(sepIdx + 1);
    sepIdx = msg.indexOf(_MSG_SEPARATOR);
    if (sepIdx < 0) {
      // No details
      return RidMessage._(msgType, msg, null);
    } else {
      final message = msg.substring(0, sepIdx);
      final details = msg.substring(sepIdx + 1);
      return RidMessage._(msgType, message, details);
    }
  }

  Stream<RidMessage> get stream => _sink.stream;

  int get nativePort {
    return _receivePort.sendPort.nativePort;
  }

  Future<void> dispose() {
    _receivePort.close();
    return _sink.close();
  }

  static bo


Message, session: &Session) -> Self {
        let country = session.country();

        let top_tracks = msg.get_top_track()
                            .iter()
                            .filter(|tt| !tt.has_country() ||
                                         countrylist_contains(tt.get_country(), &country))
                            .next()
                            .unwrap()
                            .get_track()
                            .iter()
                            .filter(|track| track.has_gid())
                            .map(|track| SpotifyId::from_raw(track.get_gid()))
                            .collect::<Vec<_>>();

        Artist {
            id: SpotifyId::from_raw(msg.get_gid()),
            name: msg.get_name().to_owned(),
            top_tracks: top_tracks
        }
    }
}

pub struct MetadataManager;

impl MetadataManager {
    pub fn new() -> MetadataManager {
        MetadataManager
    }

    pub fn get<T: MetadataTrait>(&mut self, session: &Session, id: SpotifyId) -> MetadataRef<T> {
        let session = session.clone();
        session.mercury(MercuryRequest {
                   method: MercuryMethod::GET,
                   uri: format!("{}/{}", T::base_url(), id.to_base16()),
                   content_type: None,
                   payload: Vec::new(),
               })
               .and_then(move |response| {
                   let data = response.payload.first().expect("Empty payload");
                   let msg: T::Message = protobuf::parse_from_bytes(data).unwrap();

                   Ok(T::parse(&msg, &session))
               })
    }
}
<gh_stars>0
use crate::target::Target;
use linkerd_app_core::{
    discovery_rejected, profiles::LookupAddr, svc::stack::Predicate, Error, NameMatch,
};

#[derive(Clone, Debug)]
pub struct AllowProfile(pub NameMatch);

impl Predicate<Target> for AllowProfile {
    type Request = LookupAddr;

    fn check(&mut self, target: Target) -> Result<LookupAddr, Error> {
        let addr = target.dst.into_name_addr().ok_or_else(discovery_rejected)?;
        if self.0.matches(addr.name()) {
            Ok(LookupAddr(addr.into()))
        } else {
            Err(discovery_rejected().into())
        }
    }
}
<reponame>rahealy/rpi3fxproc<filename>bootloader/tx/src/main.rs
extern crate clap;
extern crate serialport;

use std::io::ErrorKind;
use std::io::Error;
use std::fs::File;
use std::io::Read;
use std::time::Duration;
use clap::{App, AppSettings, Arg};
use serialport::prelude::*;

type PortType = Box<dyn serialport::SerialPort>; //Easier than typing the whole thing out.

const NUM_RETRIES: u8 = 10; //Number of times to retry a port read/write operation.

fn main() {
    let matches = App::new("rpi3serbtldr_px")
        .about("Transmit a file via serial port to a rpi3serbtldr client.")
        .setting(AppSettings::DisableVersion)
        .arg(Arg::with_name("port")
             .help("The device path to a serial port eg. /dev/ttyACM0")
             .short("p")
             .use_delimiter(false)
             .takes_value(true)
             .required(true))
        .arg(Arg::with_name("baud")
             .help("Baudrate of the serial connection eg. 115200")
             .short("b")
             .use_delimiter(false)
             .takes_value(true)
             .required(false))
        .arg(Arg::with_name("file")
             .help("Name of file to transmit eg. ./kernel8.img")
             .short("f")


, #0xe
	lsl r0, r0, #0xc
	cmp r7, r0
	bgt _0220FCA2
	ldr r1, [sp, #0x14]
	ldr r0, [sp, #0xc]
	strb r1, [r0, #4]
	strb r6, [r0, #5]
	ldr r1, [sp, #0x1c]
	strh r1, [r0]
	ldr r1, [sp, #0x18]
	add sp, #0x2c
	strh r1, [r0, #2]
	mov r0, #1
	pop {r4, r5, r6, r7, pc}
_0220FCA2:
	add r4, r4, #1
	cmp r4, #0xc
	blt _0220FC12
	mov r0, #0
	add sp, #0x2c
	pop {r4, r5, r6, r7, pc}
	.balign 4, 0
	thumb_func_end ov96_0220FBEC

	thumb_func_start ov96_0220FCB0
ov96_0220FCB0: ; 0x0220FCB0
	push {r4, r5, r6, r7}
	mov r5, #2
	ldrsh r5, [r0, r5]
	mov r2, #1
	sub r6, r1, #1
	add r3, r2, #0
	mov r4, #0
	cmp r5, r6
	bne _0220FCD6
	ldrsh r6, [r0, r4]
	add r7, r2, #0
	cmp r6, #8
	blt _0220FCD0
	cmp r6, #0x17
	bgt _0220FCD0
	add r7, r4, #0
_0220FCD0:
	cmp r7, #0
	beq _0220FCD6
	mov r4, #1
_0220FCD6:
	cmp r4, #0
	bne _0220FCFC
	sub r4, r1, #2
	mov r6, #0
	cmp r5, r4
	bne _0220FCF6
	ldrsh r4, [r0, r6]
	mov r7, #1
	cmp r4, #5
	blt _0220FCF0
	cmp r4, #0x1a
	bgt _0220FCF0
	add r7, r6, #0
_0220FCF0:
	cmp r7, #0
	beq _0220FCF6
	mov r6, #1
_0220FCF6:
	cmp r6, #0
	bne _0220FCFC
	mov r3, #0
_0220FCFC:
	cmp r3, #0
	bne _0220FD22
	sub r1, r1, #3
	mov r3, #0
	cmp r5, r1
	bne _0220FD1C
	ldrsh r0, [r0, r3]
	mov r1, #1
	cmp r0, #2
	blt _0220FD16
	cmp r0, #0x1d
	bgt _0220FD16
	add r1, r3, #0
_0220FD16:
	cmp r1, #0
	beq _0220FD1C
	mov r3, #1
_0220FD1C:
	cmp r3, #0
	bne _0220FD22
	mov r2, #0
_0220FD22:
	add r0, r2, #0
	pop {r4, r5, r6, r7}
	bx lr
	thumb_func_end ov96_0220FCB0

	thumb_func_start ov96_0220FD28
ov96_0220FD28:


skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-6 > :nth-child(n + 7) {
    display: block; }
  /* line 660, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-5 > :nth-child(n + 6) {
    display: block; }
  /* line 663, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-4 > :nth-child(n + 5) {
    display: block; }
  /* line 666, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-3 > :nth-child(n + 4) {
    display: block; }
  /* line 669, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-2 > :nth-child(n + 3) {
    display: block; }
  /* line 672, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-xs-1 > :nth-child(n + 2) {
    display: block; }
  /* line 675, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-18 > :nth-child(n + 19) {
    display: none; }
  /* line 678, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-17 > :nth-child(n + 18) {
    display: none; }
  /* line 681, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-16 > :nth-child(n + 17) {
    display: none; }
  /* line 684, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-15 > :nth-child(n + 16) {
    display: none; }
  /* line 687, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-14 > :nth-child(n + 15) {
    display: none; }
  /* line 690, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-13 > :nth-child(n + 14) {
    display: none; }
  /* line 693, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-12 > :nth-child(n + 13) {
    display: none; }
  /* line 696, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-11 > :nth-child(n + 12) {
    display: none; }
  /* line 699, /Users/Devin/GitHub/spotio/skin/objects/_grid.scss */
  html:not(.using-overlay-scroll-bars) .clamp-sm-10 > :nth-child(n + 11) {
    display: none; }
  /* line 702,


.disable_logs,
            !self.disable_metrics,
            !self.disable_traces,
            self.multiple_outputs,
        )?;
        let shutdown = cx.shutdown;
        Ok(Box::pin(async move {
            let span = Span::current();
            let routes = filters
                .with(warp::trace(move |_info| span.clone()))
                .recover(|r: Rejection| async move {
                    if let Some(e_msg) = r.find::<ErrorMessage>() {
                        let json = warp::reply::json(e_msg);
                        Ok(warp::reply::with_status(json, e_msg.status_code()))
                    } else {
                        // other internal error - will return 500 internal server error
                        Err(r)
                    }
                });
            warp::serve(routes)
                .serve_incoming_with_graceful_shutdown(
                    listener.accept_stream(),
                    shutdown.map(|_| ()),
                )
                .await;

            Ok(())
        }))
    }

    fn outputs(&self) -> Vec<Output> {
        let definition = match self.decoding {
            // See: `LogMsg` struct.
            DeserializerConfig::Bytes => schema::Definition::empty()
                .required_field("message", Kind::bytes(), Some("message"))
                .required_field("status", Kind::bytes(), Some("severity"))
                .required_field("timestamp", Kind::integer(), Some("timestamp"))
                .required_field("hostname", Kind::bytes(), Some("host"))
                .required_field("service", Kind::bytes(), None)
                .required_field("ddsource", Kind::bytes(), None)
                .required_field("ddtags", Kind::bytes(), None)
                .merge(self.decoding.schema_definition()),

            // JSON deserializer can overwrite existing fields at runtime, so we have to treat
            // those events as if there is no known type details we can provide, other than the
            // details provided by the generic JSON schema definition.
            DeserializerConfig::Json => self.decoding.schema_definition(),

            // Syslog deserializer allows for arbritrary "structured data" that can overwrite
            // existing fields, similar to the JSON deserializer.
            //
            // See also: https://datatracker.ietf.org/doc/html/rfc5424#section-6.3
            #[cfg(feature = "sources-syslog")]
            DeserializerConfig::Syslog => self.decoding.schema_definition(),

            DeserializerConfig::Native => self.decoding.schema_definition(),
            DeserializerConfig::NativeJson => self.decoding.schema_definition(),
        };

        if self.multiple_outputs {
            vec![
                Output::default(DataType::Metric).with_port(METRICS),
                Output::default(DataType::Log)
                    .with_schema_definition(definition)
                    .with_port(LOGS),
                Output::default(DataType::Trace).with_port(TRACES),
            ]
        } else {
            vec![Output::default(DataType::all()).with_schema_definition(definition)]
        }
    }

    fn source_type(&self) -> &'static str {
        "datadog_agent"
    }

    fn resources(&self) -> Vec<Resource> {
        vec![Resource::tcp(self.address)]
    }

    fn can_acknowledge(&self) -> bool {
        true
    }
}

#[derive(Clone, Copy, Debug, Snafu)]
pub(crate) enum ApiError {
    BadRequest,
    InvalidDataFormat,
    ServerShutdown,
}

impl warp::reject::Reject for ApiError {}

#[derive(Deserialize)]
pub struct ApiKeyQueryParams {
    #[serde(rename =


oorForNextSeq, },
				nil
			},
			Player = {
				{	msg =	"RideHelicopter",									func = this.PlayerRideHeli	},
				{	msg =	"RideHelicopterWithHuman",		 					func =
					function()
						Fox.Log( "#### s10050_sequence.Messages ### RideHelicopterWithHuman" )
						svars.isPlayerRideHeliWithQ = true
					end
				},
				{	msg =	"WarpEnd",											func =
					function()
						if (mvars.isPlayerWarpBeforeDemoPlay) then
							TppSequence.SetNextSequence("Seq_Demo_ConnectKillQuietGame")
							mvars.isPlayerWarpBeforeDemoPlay = false
						end
					end
				},
				{
					msg = "DeadInFOB",
					func = function (deadPlayerIndex, AttackerId)
						TppUiCommand.AnnounceLogView("Player " .. tostring(deadPlayerIndex) .. " died")
						if deadPlayerIndex == PlayerInfo.GetLocalPlayerIndex() then
							TppUiCommand.AnnounceLogView("Respawn in 10 seconds")
							GkEventTimerManager.Start("RespawnPlayer", 10 )
						end
					end
				},
			},
			Demo = {

				{	msg =	"SetQuietKillGame",									func = this.SetQuietKillGameOnPlayingDemo,	option = { isExecDemoPlaying = true } },
				nil
			},
			Timer = {
				{ msg = "Finish",	sender = "timer_execDemoPrepareFunction",	func = 	function()	this.FadeOutForDemoPlay()	end	},
				{ msg = "Finish",	sender = "timer_startDemo",					func =
					function()

						if svars.isQuietDead then

							local ridingGameObjectId = vars.playerVehicleGameObjectId
							if Tpp.IsVehicle(ridingGameObjectId) then
								GameObject.SendCommand( ridingGameObjectId,	{ id = "ForceStop", enabled = false, } )
							end

							Player.ResetPadMask {
								settingName	= "restrictPlayerActionBeforeDemo_AtDemoPrepare",
							}
							TppUI.HideAccessIcon()
							return
						end

						mvars.isPlayerWarpBeforeDemoPlay = true
						local gameObjectId = { type="TppPlayer2", index=0 }
						local command = { id = "WarpAndWaitBlock", pos={-1680.074, 354.7, -308.524}, rotY=166.28 }
						GameObject.SendCommand( gameObjectId, command )
					end
				},
				{
					msg = "Finish",
					sender = "RespawnPlayer",
					func = function ()
						TppUiCommand.AnnounceLogView("Respawning")
						TppUiStatusManager.ClearStatus("AnnounceLog")
						TppUiStatusManager.ClearStatus("EquipPanel")
						TppUiStatusManager.ClearStatus("HeadMarker")
						TppUiStatusManager.ClearStatus("WorldMarker")
						Player.RequestToRespawn()
					end
				},
			},
			Radio = {
				{	msg = "Finish",		sender = "s0050_esrg1030",	func = function ()	s10050_radio.SetRadioFromSituation()	end	},
			},
			Subtitles = {
				{	msg = "SubtitlesEndEventMessage", 							func =
					function( speechLabel, status )
						local checkSubtitles = {
							[1] = SubtitlesCommand:ConvertToSubtitlesId("qtrc1000_100263_0_miller"),
							[2] = SubtitlesCommand:ConvertToSubtitlesId("qtrc1000_100326_0_miller"),
						}

						if ( speechLabel == checkSubtitles[1] ) then
							Fox.Log( "#### s10050_sequence.Message


	button.prop("disabled", false);
					});
				});

				// 恢复界面默认设置
				$("#restore-default-settings", thisDialog).click(function(){
					if (confirm(system.lang["public"]["text-confirm"])==false)
					{
						return;
					}
					system.config = {};
					system.userConfig = {};
					system.saveConfig();
					system.saveUserConfig();

					location.href = location.href;
				});
			},
			// 初始化用户标签列表
			initUserLabels: function() {
				this.userLabelsTable = $("<table/>").appendTo($("#divLabels", thisDialog));
				var headContextMenu = null;
				var selectedIndex = -1;

				// 添加
				$("#btn-UserLabel-addNew", thisDialog).on("click", function() {
					if (page.endEditing()){
						page.userLabelsTable.datagrid('appendRow', {
							"ck": false,
							"color": "#000000"
						});
						page.editIndex = page.userLabelsTable.datagrid('getRows').length-1;
						page.userLabelsTable.datagrid('selectRow', page.editIndex).datagrid('beginEdit', page.editIndex);
					}
				});

				// 删除
				$("#btn-UserLabel-remove", thisDialog).on("click", function() {
					var checkedRows = page.userLabelsTable.datagrid("getChecked");
					if (checkedRows.length == 0){
						return;
					}
					if (!confirm(system.lang["public"]["text-confirm"])) {
						return;
					}

					page.userLabelsTable.datagrid('cancelEdit', page.editIndex);
					var removed = [];
					for (var index = checkedRows.length-1; index >= 0; index--) {
						var item = checkedRows[index];
						var rowIndex = page.userLabelsTable.datagrid("getRowIndex", item);
						console.log(rowIndex);
						removed.push(rowIndex);
						page.userLabelsTable.datagrid('deleteRow', rowIndex);
						system.config.labels.splice(rowIndex, 1);
					}

					// 清除已打过标签的种子
					for (var key in system.config.labelMaps) {
						if (system.config.labelMaps.hasOwnProperty(key)) {
							var items = system.config.labelMaps[key];
							for (var index = items.length-1; index >= 0; index--) {
								if ($.inArray(items[index], removed) !=-1 ) {
									items.splice(index, 1);
								}
							}
						}
					}

					system.saveConfig();
					system.control.torrentlist.refresh();
					system.resetNavLabels(true);
					page.editIndex = undefined;
				});

				// 导出
				$("#btn-UserLabel-export", thisDialog).on("click", function() {
					var data = {
						labels: system.config.labels,
						maps: system.config.labelMaps
					}
					var exportData = JSON.parse(JSON.stringify(data));

					saveFileAs("tr-web-contorl-labels.json", JSON.stringify(exportData));
				});

				// 导入
				$("#btn-UserLabel-import", thisDialog).on("click", function () {
					loadFileContent("json", function (content) {
						var item = content;
						if (typeof (content) === "string") {
							try {
								item = JSON.parse(content);
							} catch (error) {
								alert(system.lang["public"]["text-json-file-parsing-failed"]);
								return;
							}
						}

						if (item.labels && item.maps) {
							if (confirm(system.lang.dialog["system-config"]["labels-manage"]["import-confirm"])) {
								system.config.labels = item.labels;
								system.config.labelMaps = item.maps;
								system.saveConfig();
								reloadData();
								system.control.torrentlist.refre


Decoration();
    }

    if (computePosition) {
      setPosition();
    }
  }

  Widget _buildDecoration([String path = ""]) {
    String imageAsset = path;
    if (imageAsset == "") {
      switch (type) {
        case TileType.wall:
          imageAsset = "deco/wall.png";
          break;

        case TileType.bomb:
          imageAsset = "bombs/mine.png";
          break;

        case TileType.flare:
          imageAsset = "bombs/tnt.png";
          break;

        case TileType.wrapped:
          imageAsset = "tiles/multicolor.png";
          break;

        case TileType.fireball:
          imageAsset = "bombs/rocket.png";
          break;

        default:
          try {
            imageAsset = "tiles/${describeEnum(type)}.png";
          } catch (e) {
            return Container();
          }
          break;
      }
    }
    return Container(
      decoration: BoxDecoration(
          image: DecorationImage(
        image: AssetImage('assets/images/$imageAsset'),
        fit: BoxFit.contain,
      )),
    );
  }

  //
  // Returns the position of this tile in the checkerboard
  // based on its position in the grid (row, col) and
  // the dimensions of the board and a tile
  //
  void setPosition() {
    double bottom =
        level.boardTop + (level.numberOfRows - 1) * level.tileHeight;
    x = level.boardLeft + col * level.tileWidth;
    y = bottom - row * level.tileHeight;
  }

  //
  // Generate a tile to be used during the swap animations
  //
  Tile cloneForAnimation() {
    Tile tile = Tile(level: level, type: type, row: row, col: col);
    tile.build();

    return tile;
  }

  //
  // Swaps this tile (row, col) with the ones of another Tile
  //
  void swapRowColWith(Tile destTile) {
    int tft = destTile.row;
    destTile.row = row;
    row = tft;

    tft = destTile.col;
    destTile.col = col;
    col = tft;
  }

  //
  // Returns the Widget to be used to render the Tile
  //
  Widget get widget => getWidgetSized(level.tileWidth, level.tileHeight);

  Widget getWidgetSized(double width, double height) => Container(
        width: width,
        height: height,
        child: _widget,
      );

  //
  // Can the Tile move?
  //
  bool get canMove => (depth == 0) && (canBePlayed(type));

  //
  // Can a Tile fall?
  //
  bool get canFall =>
      type != TileType.wall &&
      type != TileType.forbidden &&
      type != TileType.empty;

  // ################  HELPERS  ######################
  //
  // Generate a random tile
  //
  static TileType random(math.Random rnd) {
    int minValue = _firstNormalTile;
    int maxValue = _lastNormalTile;
    int value = rnd.nextInt(maxValue - minValue) + minValue;
    return TileType.values[value];
  }

  static int get _firstNormalTile => TileType.red.index;
  static int get _lastNormalTile => TileType.yellow.index;
  static int get _firstBombTile => TileType.bomb.index;
  static int get _lastBombTile => TileType.fireball.index;

  static bool isNormal(TileType type) {
    int index = type.index;
    return (index >= _firstNormalTile && index


(1, 0, "after"));
  cm.execCommand("goGroupRight");
  eqCursorPos(cm.getCursor(), Pos(1, 2, "before"));
  cm.execCommand("goGroupRight");
  eqCursorPos(cm.getCursor(), Pos(1, 5, "before"));
  cm.execCommand("goGroupLeft"); cm.execCommand("goGroupLeft");
  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
  cm.execCommand("goGroupLeft");
  eqCursorPos(cm.getCursor(), Pos(0, 20, "after"));
  cm.execCommand("goGroupLeft");
  eqCursorPos(cm.getCursor(), Pos(0, 16, "after"));
}, {value: "booo ba---quux. ffff\n  abc d"});

testCM("groupsAndWhitespace", function(cm) {
  var positions = [Pos(0, 0), Pos(0, 2), Pos(0, 5), Pos(0, 9), Pos(0, 11),
                   Pos(1, 0), Pos(1, 2), Pos(1, 5)];
  for (var i = 1; i < positions.length; i++) {
    cm.execCommand("goGroupRight");
    eqCharPos(cm.getCursor(), positions[i]);
  }
  for (var i = positions.length - 2; i >= 0; i--) {
    cm.execCommand("goGroupLeft");
    eqCharPos(cm.getCursor(), i == 2 ? Pos(0, 6, "before") : positions[i]);
  }
}, {value: "  foo +++  \n  bar"});

testCM("charMovementCommands", function(cm) {
  cm.execCommand("goCharLeft"); cm.execCommand("goColumnLeft");
  eqCursorPos(cm.getCursor(), Pos(0, 0));
  cm.execCommand("goCharRight"); cm.execCommand("goCharRight");
  eqCursorPos(cm.getCursor(), Pos(0, 2, "before"));
  cm.setCursor(Pos(1, 0));
  cm.execCommand("goColumnLeft");
  eqCursorPos(cm.getCursor(), Pos(1, 0));
  cm.execCommand("goCharLeft");
  eqCursorPos(cm.getCursor(), Pos(0, 5, "before"));
  cm.execCommand("goColumnRight");
  eqCursorPos(cm.getCursor(), Pos(0, 5, "before"));
  cm.execCommand("goCharRight");
  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
  cm.execCommand("goLineEnd");
  eqCursorPos(cm.getCursor(), Pos(1, 5, "before"));
  cm.execCommand("goLineStartSmart");
  eqCursorPos(cm.getCursor(), Pos(1, 1, "after"));
  cm.execCommand("goLineStartSmart");
  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
  cm.setCursor(Pos(2, 0));
  cm.execCommand("goCharRight"); cm.execCommand("goColumnRight");
  eqCursorPos(cm.getCursor(), Pos(2, 0));
}, {value: "line1\n ine2\n"});

testCM("verticalMovementCommands", function(cm) {
  cm.execCommand("goLineUp");
  eqCharPos(cm.getCursor(), Pos(0, 0));
  cm.execCommand("goLineDown");
  eqCharPos(cm.getCursor(), Pos(1, 0));
  cm.setCursor(Pos(1, 12));
  cm.execCommand("goLineDown");
  eqCharPos(cm.getCursor(), Pos(2, 5));
  cm.execCommand("goLineDown");
  eqCharPos(cm.getCursor(), Pos(3, 0));
  cm.execCommand("goLineUp");
  eqCharPos(cm.getCursor(), Pos(2, 5));
  cm.execCommand("goLineUp");
  eqCharPos(cm.getCursor(), Pos(1, 12));
  cm.execCommand("goPageDown");
  eqCharPos(cm.getCursor(), Pos(5, 0));
  cm.execCommand("goPageDown"); cm.execCommand("goLineDown");
  eqCharPos(cm.getCursor


上次选择的目录
  Future<String?> _getLastDirectory(String key) async {
    try {
      final prefs = await SharedPreferences.getInstance();
      return prefs.getString(key);
    } catch (e) {
      print('获取目录失败: $e');
      return null;
    }
  }

  // 获取文件的有效路径(处理iOS路径问题)
  Future<String?> getValidFilePath(String originalPath) async {
    // macOS沙盒下首先尝试恢复书签访问
    if (io.Platform.isMacOS) {
      final resolvedPath =
          await SecurityBookmarkService.resolveBookmark(originalPath);
      if (resolvedPath != null && io.File(resolvedPath).existsSync()) {
        return resolvedPath;
      }
    }

    // 首先检查原始路径是否可访问
    if (io.File(originalPath).existsSync()) {
      return originalPath;
    }

    // 处理iOS的/private前缀
    if (io.Platform.isIOS) {
      String alternativePath;
      if (originalPath.startsWith('/private')) {
        alternativePath = originalPath.replaceFirst('/private', '');
      } else {
        alternativePath = '/private$originalPath';
      }

      if (io.File(alternativePath).existsSync()) {
        return alternativePath;
      }

      // 检查文件是否可能在文档目录中
      try {
        final io.Directory appDocDir =
            await StorageService.getAppStorageDirectory();
        final fileName = p.basename(originalPath);
        final docPath = '${appDocDir.path}/Videos/$fileName';

        if (io.File(docPath).existsSync()) {
          return docPath;
        }
      } catch (e) {
        print("检查文档目录中的文件失败: $e");
      }
    }

    return null; // 找不到有效路径
  }

  // Android平台特定的字幕文件选择方法
  Future<String?> _pickSubtitleFileAndroid() async {
    try {
      // 使用通用文件选择Intent，支持所有文本文件
      final result = await const MethodChannel('android/intent')
          .invokeMethod<Map<dynamic, dynamic>>('createChooser', {
        'action': 'android.intent.action.GET_CONTENT',
        'type': 'text/*', // 使用text/*类型，涵盖所有文本文件包括srt、ass等
        'title': '选择字幕文件',
        'extra_mime_types': [
          'text/plain',
          'text/srt',
          'text/ass',
          'text/ssa',
          'text/sub',
          'application/x-subrip',
          'application/x-ass',
          'application/octet-stream',
          '*/*' // 允许所有文件类型作为备选
        ],
      });

      if (result == null || result['data'] == null) {
        return null;
      }

      final filePath = result['data'].toString();

      // 存储目录信息
      _saveLastDirectory(filePath, _lastSubtitleDirKey, _lastDirKey);

      return _normalizePath(filePath);
    } catch (e) {
      print('Android选择字幕文件时出错: $e');

      // 如果Intent方法失败，尝试使用更宽泛的文件选择
      try {
        final fallbackResult = await const MethodChannel('android/intent')
            .invokeMethod<Map<dynamic, dynamic>>('createChooser', {
          'action': 'android


<t0=reg256#15,<x4=reg256#6,>x4=reg256#6
# asm 2: vxorpd <t0=%ymm14,<x4=%ymm5,>x4=%ymm5
vxorpd %ymm14,%ymm5,%ymm5

# qhasm: x5 ^= t1
# asm 1: vxorpd <t1=reg256#16,<x5=reg256#5,>x5=reg256#5
# asm 2: vxorpd <t1=%ymm15,<x5=%ymm4,>x5=%ymm4
vxorpd %ymm15,%ymm4,%ymm4

# qhasm: x4stack = x4
# asm 1: vmovapd <x4=reg256#6,>x4stack=stack256#5
# asm 2: vmovapd <x4=%ymm5,>x4stack=128(%rsp)
vmovapd %ymm5,128(%rsp)

# qhasm: x8stack = x8
# asm 1: vmovapd <x8=reg256#4,>x8stack=stack256#6
# asm 2: vmovapd <x8=%ymm3,>x8stack=160(%rsp)
vmovapd %ymm3,160(%rsp)

# qhasm: x9stack = x9
# asm 1: vmovapd <x9=reg256#11,>x9stack=stack256#7
# asm 2: vmovapd <x9=%ymm10,>x9stack=192(%rsp)
vmovapd %ymm10,192(%rsp)

# qhasm: x13stack = x13
# asm 1: vmovapd <x13=reg256#13,>x13stack=stack256#8
# asm 2: vmovapd <x13=%ymm12,>x13stack=224(%rsp)
vmovapd %ymm12,224(%rsp)

# qhasm: x6 = x6stack
# asm 1: vmovapd <x6stack=stack256#1,>x6=reg256#4
# asm 2: vmovapd <x6stack=0(%rsp),>x6=%ymm3
vmovapd 0(%rsp),%ymm3

# qhasm: x10 = x10stack
# asm 1: vmovapd <x10stack=stack256#2,>x10=reg256#6
# asm 2: vmovapd <x10stack=32(%rsp),>x10=%ymm5
vmovapd 32(%rsp),%ymm5

# qhasm: x11 = x11stack
# asm 1: vmovapd <x11stack=stack256#3,>x11=reg256#11
# asm 2: vmovapd <x11stack=64(%rsp),>x11=%ymm10
vmovapd 64(%rsp),%ymm10

# qhasm: x15 = x15stack
# asm 1: vmovapd <x15stack=stack256#4,>x15=reg256#13
# asm 2: vmovapd <x15stack=96(%rsp),>x15=%ymm12
vmovapd 96(%rsp),%ymm12

# qhasm: 8x  x2 += x6
# asm 1: vpaddd <x6=reg256#4,<x2=reg256#8,>x2=reg256#8
# asm 2: vpaddd <x6=%ymm3,<x2=%ymm7,>x2=%ymm7
vpaddd %ymm3,%ymm7,%ymm7

# qhasm: 8x  x3 += x7
# asm 1: vpaddd <x7=reg256#3,<x3=reg256#7,>x3=reg256#7
# asm 2: vpa


150] = "奶牛关传送卷轴",
  [60151] = "工匠火花转换器",
  [60152] = "吉格诺的扳手",
  [60153] = "吉格诺的工作裤",
  [60154] = "密封令状",
  [60155] = "达纳苏斯的证明",
  [60156] = "致维斯提亚·月矛的密封书信",
  [60157] = "纳斯查尔之心",
  [60158] = "天蓝色的鳞片",
  [60159] = "斯普鲁格螺栓",
  [60160] = "陀螺仪",
  [60161] = "麻须腰带",
  [60162] = "涡轮增压稳定冷却盘",
  [60163] = "芬多的扳手",
  [60164] = "涡轮增压冷却指环",
  [60165] = "稳定冷却步枪",
  [60166] = "比格斯的报告",
  [60167] = "艾伦托保险箱",
  [60168] = "便携短剑",
  [60169] = "悲伤卫士短剑",
  [60170] = "沉重的沼泽虎肋排",
  [60171] = "悲伤苔藓蘑菇",
  [60172] = "沙恩的头颅",
  [60173] = "达尔索斯之戒",
  [60174] = "公爵来信",
  [60175] = "达尔索斯印记",
  [60176] = "原林徽记",
  [60177] = "“独眼”长老之爪",
  [60178] = "黑喉长老之爪",
  [60179] = "格洛尔手环",
  [60180] = "哨兵链甲",
  [60181] = "林纹斗篷",
  [60182] = "森林智慧护肩",
  [60183] = "丛林猎手面罩",
  [60184] = "生锈罗盘",
  [60185] = "掌舵人日志",
  [60186] = "乔吉的头颅",
  [60187] = "乔吉的金耳环",
  [60188] = "遗忘之书",
  [60189] = "达尔索斯珠宝盒",
  [60190] = "纳格拉斯的信",
  [60191] = "迈雷纳斯的财产",
  [60192] = "机械手臂",
  [60193] = "机械大腿",
  [60194] = "机械头颅",
  [60195] = "完好的动力核心",
  [60196] = "肉块",
  [60197] = "斯托恩的头颅",
  [60198] = "侍从法杖",
  [60199] = "黄昏之心长靴",
  [60200] = "步兵短刃",
  [60201]


er() {
        override fun handleMessage(message: Message) {
            if (message.what == R.id.decode) {
                decode(message.obj as ByteArray, message.arg1, message.arg2)
            } else if (message.what == R.id.quit) {
                Looper.myLooper()?.quit()
            }
        }
    }

    private var multiFormatReader: MultiFormatReader? = null
    private fun decode(data: ByteArray, width: Int, height: Int) {
        var width1 = width
        var height1 = height
        val start = System.currentTimeMillis()
        var rawResult: Result? = null

        //modify here
        val rotatedData = ByteArray(data.size)
        for (y in 0 until height1) {
            for (x in 0 until width1) {
                rotatedData[x * height1 + height1 - y - 1] = data[x + y * width1]
            }
        }
        // Here we are swapping, that's the difference to #11
        val tmp = width1
        width1 = height1
        height1 = tmp
        val source = CameraManager.get().buildLuminanceSource(rotatedData, width1, height1)
        val bitmap = BinaryBitmap(HybridBinarizer(source))

        try {
            if (bitmap.width > 0 && bitmap.height > 0) {
                rawResult = multiFormatReader?.decodeWithState(bitmap)
            } else {
                multiFormatReader?.reset()
            }
        } catch (e: ReaderException) {
            // continue
        } finally {
            multiFormatReader?.reset()
        }
        if (rawResult != null) {
            val end = System.currentTimeMillis()
            d(ContentValues.TAG, """Found barcode (${end - start} ms):
$rawResult""")
            val message = Message.obtain(handler, R.id.decode_succeeded, rawResult)
            val bundle = Bundle()
            bundle.putParcelable("barcode_bitmap", source.renderCroppedGreyscaleBitmap())
            message.data = bundle
            //TLog.d(TAG, "Sending decode succeeded message...");
            message.sendToTarget()
        } else {
            val message = Message.obtain(handler, R.id.decode_failed)
            message.sendToTarget()
        }
    }

    private enum class State {
        //预览
        PREVIEW,  //成功
        SUCCESS,  //完成
        DONE
    }

    companion object {
        /**
         * 扫描结果监听
         */
        private var mScanerListener: OnRxScanerListener? = null

        /**
         * 设置扫描信息回调
         */
        fun setScanerListener(scanerListener: OnRxScanerListener?) {
            mScanerListener = scanerListener
        }
    }
}package com.tamsiree.rxui.view.indicator

import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import android.view.animation.DecelerateInterpolator
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import com.tamsiree.rxkit.RxImageTool
import com.tamsiree.rxui.R

class TIndicator @JvmOverloads constructor(
        context: Context,
        attrs: AttributeSet? = null,
        defStyle: Int = 0
) : View(context, attrs, defStyle), ViewPager.OnPageChangeListener {

    companion object {

        private const val DEFAULT_DOT_COUNT = 5
        private const val DEFAULT_FADING_DOT_COUNT = 1
        private const val DEFAULT_DOT_RADIUS_DP = 4
        private const val DEFAULT_SELECTED_DOT_RADIUS_DP = 5.5f

        // Measured outside of first dot to outside of next dot: O<->O