 & MouseEvent.BUTTON1_MASK) != 0)
	    return;
	int x = e.getX();
	int y = e.getY();
	dragX = snapGrid(x); dragY = snapGrid(y);
	draggingPost = -1;
	int i;
	CircuitElm origMouse = mouseElm;
	mouseElm = null;
	mousePost = -1;
	plotXElm = plotYElm = null;
	int bestDist = 100000;
	int bestArea = 100000;
	for (i = 0; i != elmList.size(); i++) {
	    CircuitElm ce = getElm(i);
	    if (ce.boundingBox.contains(x, y)) {
		int j;
		int area = ce.boundingBox.width * ce.boundingBox.height;
		int jn = ce.getPostCount();
		if (jn > 2)
		    jn = 2;
		for (j = 0; j != jn; j++) {
		    Point pt = ce.getPost(j);
		    int dist = distanceSq(x, y, pt.x, pt.y);

		    // if multiple elements have overlapping bounding boxes,
		    // we prefer selecting elements that have posts close
		    // to the mouse pointer and that have a small bounding
		    // box area.
		    if (dist <= bestDist && area <= bestArea) {
			bestDist = dist;
			bestArea = area;
			mouseElm = ce;
		    }
		}
		if (ce.getPostCount() == 0)
		    mouseElm = ce;
	    }
	}
	scopeSelected = -1;
	if (mouseElm == null) {
	    for (i = 0; i != scopeCount; i++) {
		Scope s = scopes[i];
		if (s.rect.contains(x, y)) {
		    s.select();
		    scopeSelected = i;
		}
	    }
	    // the mouse pointer was not in any of the bounding boxes, but we
	    // might still be close to a post
	    for (i = 0; i != elmList.size(); i++) {
		CircuitElm ce = getElm(i);
		int j;
		int jn = ce.getPostCount();
		for (j = 0; j != jn; j++) {
		    Point pt = ce.getPost(j);
		    int dist = distanceSq(x, y, pt.x, pt.y);
		    if (distanceSq(pt.x, pt.y, x, y) < 26) {
			mouseElm = ce;
			mousePost = j;
			break;
		    }
		}
	    }
	} else {
	    mousePost = -1;
	    // look for post close to the mouse pointer
	    for (i = 0; i != mouseElm.getPostCount(); i++) {
		Point pt = mouseElm.getPost(i);
		if (distanceSq(pt.x, pt.y, x, y) < 26)
		    mousePost = i;
	    }
	}
	if (mouseElm != origMouse)
	    cv.repaint();
    }

    int distanceSq(int x1, int y1, int x2, int y2) {
	x2 -= x1;
	y2 -= y1;
	return x2*x2+y2*y2;
    }

    public void mouseClicked(MouseEvent e) {
	if ( e.getClickCount() == 2 && !didSwitch )
	    doEditMenu(e);
	if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) {
	    if (mouseMode == MODE_SELECT || mouseMode == MODE_DRAG_SELECTED)
		clearSelection();
	}
    }
    public void mouseEntered(MouseEvent e) {
    }
    public void mouseExited(MouseEvent e) {
	scopeSelected = -1;
	mouseElm = plotXElm = plotYElm = null;
	cv.repaint();
    }

    public void mousePressed(MouseEvent e) {
	didSwitch = false;

	System.out.println(e.getModifier


ext-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-align-center']::before {
    content: var(--jmix-rte-icons-align-center);
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-align-end']::before {
    content: var(--jmix-rte-icons-align-end);
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-align-justify']::before {
    content: var(--jmix-rte-icons-align-justify);
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-image']::before {
    content: var(--jmix-rte-icons-image);
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-link']::before {
    content: var(--jmix-rte-icons-link);
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar [class*='toolbar-button-clean']::before {
    content: var(--jmix-rte-icons-clean);
}

/* State */

jmix-rich-text-editor[readonly] .jmix-rich-text-editor-toolbar {
    display: none;
}

jmix-rich-text-editor[disabled] [class*='toolbar-button'] {
    background-color: transparent;
}

jmix-rich-text-editor .jmix-rich-text-editor-toolbar input[type='file'] {
    display: none;
}

/* Content */

jmix-rich-text-editor .jmix-rich-text-editor-content {
    box-sizing: border-box;
    position: relative;
    flex: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background-color: var(--lumo-base-color);
}

jmix-rich-text-editor .jmix-rich-text-editor-content > .ql-editor {
    padding: 0 var(--lumo-space-m);
    line-height: inherit;
}

jmix-rich-text-editor .jmix-rich-text-editor-content :where(h1, h2, h3, h4, h5, h6) {
    margin-top: 1.25em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content h1 {
    margin-bottom: 0.75em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content :where(h2, h3, h4) {
    margin-bottom: 0.5em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content h5 {
    margin-bottom: 0.25em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content blockquote {
    padding-left: 1em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content pre {
    white-space: pre-wrap;
    margin-bottom: 0.3125em;
    margin-top: 0.3125em;
    padding: 0.3125em 0.625em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content code {
    font-size: 85%;
    padding: 0.125em 0.25em;
}

jmix-rich-text-editor .jmix-rich-text-editor-content img {
    max-width: 100%;
}

/* Theme variants */

/* No border */
jmix-rich-text-editor:not([theme~='no-border']):not([readonly]) .jmix-rich-text-editor-content {
    border-top: 1px solid var(--lumo-


font-size:9px;font-family:Times;color:#000000;}
	.ft08{font-size:11px;line-height:16px;font-family:Times;color:#000000;}
	.ft09{font-size:11px;line-height:23px;font-family:Times;color:#000000;}
	.ft010{font-size:11px;line-height:24px;font-family:Times;color:#000000;}
-->
</style>

Vol. 1 7-13

PROGRAMMING WITH GENERAL-PURPOSE INSTRUCTIONS

7.3.6.3

Rotate Instructions

The ROL (rotate left), ROR (rotate right), RCL (rotate through carry left) and RCR (rotate through carry right)
instructions rotate the bits in the destination operand out of one end and back through the other end (see
Figure 7-10). Unlike a shift, no bits are lost during a rotation. The rotate count can range from 0 to 31.

The ROL instruction rotates the bits in the operand to the left (toward more significant bit locations). The ROR
instruction rotates the operand right (toward less significant bit locations).
The RCL instruction rotates the bits in the operand to the left, through the CF flag. This instruction treats the CF
flag as a one-bit extension on the upper end of the operand. Each bit that exits from the most significant bit loca-
tion of the operand moves into the CF flag. At the same time, the bit in the CF flag enters the least significant bit
location of the operand.
The RCR instruction rotates the bits in the operand to the right through the CF flag.
For all the


sion 3 of the License, or
(at your option) any later version.

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

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

package console

import (
	"reflect"
	"strings"
	"testing"

	v1 "github.com/cgrates/cgrates/apier/v1"

	"github.com/cgrates/cgrates/utils"
)

func TestCmdRoutesProfileRemove(t *testing.T) {
	// commands map is initiated in init function
	command := commands["routes_profile_remove"]
	// verify if ApierSv1 object has method on it
	m, ok := reflect.TypeOf(new(v1.APIerSv1)).MethodByName(strings.Split(command.RpcMethod(), utils.NestingSep)[1])
	if !ok {
		t.Fatal("method not found")
	}
	if m.Type.NumIn() != 4 { // expecting 4 inputs
		t.Fatalf("invalid number of input parameters ")
	}
	// verify the type of input parameter
	if ok := m.Type.In(2).AssignableTo(reflect.TypeOf(command.RpcParams(true))); !ok {
		t.Fatalf("cannot assign input parameter")
	}
	// verify the type of output parameter
	if ok := m.Type.In(3).AssignableTo(reflect.TypeOf(command.RpcResult())); !ok {
		t.Fatalf("cannot assign output parameter")
	}
	// for coverage purpose
	if err := command.PostprocessRpcParams(); err != nil {
		t.Fatal(err)
	}
}
/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH

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

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

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

package sessions

import (
	"reflect"
	"testing"
	"time"

	"github.com/cgrates/cgrates/engine"
	"github.com/cgrates/cgrates/utils"
)

func TestSessionIDCGRID(t *testing.T) {
	//empty check
	sessionID := new(SessionID)
	rcv := sessionID.CGRID()
	eOut := "da39a3ee5e6b4b0d3255bfef95601890afd80709"
	if !reflect.DeepEqual(eOut, rcv) {
		t.Errorf("Expecting: %s, received: %s", utils.ToJSON(eOut), utils.ToJSON(rcv))
	}
	//normal check
	sessionID.OriginHost = "testhost"
	sessionID.OriginID = "testid"
	rcv = sessionID.CGRID()
	eOut = "2aaff7e3e832de08b0604a79a18ccc6bba823360"
	if !reflect.DeepEqual(eOut, rcv) {
		t.Errorf("Expecting: %s, received: %s", utils.ToJSON(eOut), utils.ToJSON(rcv))
	}
}

func TestSessionCgrID(t *testing.T) {
	//empty check
	session := new(Session)
	rcv := session.cgrID()
	eOut := ""
	if !reflect.DeepEqual(eOut, rcv) {
		t.Errorf("Expecting: %s, received: %s", utils.ToJSON


f (ticketerSub.Empty)
                                emptyAccountTicketerSubs.Add(ticketer);
                        }
                        foreach (var ticketer in emptyAccountTicketerSubs)
                            accountSub.Ticketers.Remove(ticketer);

                        if (accountSub.Ticketers.Count == 0)
                            accountSub.Ticketers = null;
                    }
                    if (accountSub.Empty)
                        emptyAccountSubs.Add(account);
                }
                foreach (var account in emptyAccountSubs)
                    AccountSubs.Remove(account);
                #endregion

                #region ticketer subs
                var emptyTicketerSubs = new List<string>();
                foreach (var (ticketer, ticketerSub) in TicketerSubs)
                {
                    ticketerSub.All = TryRemove(ticketerSub.All, connectionId);

                    if (ticketerSub.Empty)
                        emptyTicketerSubs.Add(ticketer);
                }
                foreach (var ticketer in emptyTicketerSubs)
                    TicketerSubs.Remove(ticketer);
                #endregion

                if (Limits[connectionId] != 0)
                    Logger.LogCritical("Failed to unsibscribe {id}: {cnt} subs left", connectionId, Limits[connectionId]);
                Limits.Remove(connectionId);

                Logger.LogDebug("Client {id} unsubscribed", connectionId);
            }
            catch (Exception ex)
            {
                Logger.LogError(ex, "Failed to remove subscription");
            }
            finally
            {
                Sema.Release();
            }
        }

        private static void TryAdd(HashSet<string> set, string connectionId)
        {
            if (set.Add(connectionId))
                Limits[connectionId] = Limits.GetValueOrDefault(connectionId) + 1;
        }

        private static HashSet<string>? TryRemove(HashSet<string>? set, string connectionId)
        {
            if (set == null) return null;
            if (set.Remove(connectionId))
            {
                Limits[connectionId]--;
                if (set.Count == 0) return null;
            }
            return set;
        }

        private static IEnumerable<TicketBalance> Distinct(List<TicketBalance> items)
        {
            var set = new HashSet<long>(items.Count);
            foreach (var item in items)
                if (set.Add(item.Id))
                    yield return item;
        }
    }
}


px solid transparent;border-radius:6px;box-shadow:0 0 2px 0 rgba(34,47,62,.2),0 4px 8px 0 rgba(34,47,62,.15);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0 4px}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:8px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:8px}@media only screen and (min-width:768px){.tox .tox-menu .tox-collection__item-label{overflow-wrap:break-word;word-break:normal}.tox .tox-dialog__popups .tox-menu .tox-collection__item-label{word-break:break-all}}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:repeating-linear-gradient(transparent 0 1px,transparent 1px 39px) center top 39px/100% calc(100% - 39px) no-repeat;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;grid-column:1/-1;grid-row:1;padding:0 11px 0 12px}.tox .tox-promotion+.tox-menubar{grid-column:1}.tox .tox-promotion{background:repeating-linear-gradient(transparent 0 1px,transparent 1px 39px) center top 39px/100% calc(100% - 39px) no-repeat;background-color:#fff;grid-column:2;grid-row:1;padding-inline-end:8px;padding-inline-start:4px;padding-top:5px}.tox .tox-promotion-link{align-items:unsafe center;background-color:#e8f1f8;border-radius:5px;color:#086be6;cursor:pointer;display:flex;font-size:14px;height:26.6px;padding:4px 8px;white-space:nowrap}.tox .tox-promotion-link:hover{background-color:#b4d7ff}.tox .tox-promotion-link:focus{background-color:#d9edf7}.tox .tox-mbtn{align-items:center;background:#fff;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;justify-content:center;margin:5px 1px 6px 0;outline:0;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:#fff;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#fff;border:0;box-shadow:none;color:#222f3e;position:relative;z-index:1}.tox .tox-mbtn:focus:not(:disabled)::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:'';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-mbtn:focus:not(:disabled)::after{border:2px solid highlight}}.tox .tox-mbtn--active,.tox .tox-mbtn:not(:disabled).tox-mbtn--active:focus{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#f0f0f0;border:0;box-shadow:none;color:#222f3e}.tox .


  @Test
  fun testYankMotionLineWise() {
    val before = """
            ${c}qwe
            rty
            asd
            ${c}fgh
            zxc
            vbn

    """.trimIndent()
    configureByText(before)
    typeText(injector.parser.parseKeys("yj"))
    val vimEditor = fixture.editor.vim
    val context = injector.executionContextManager.getEditorExecutionContext(vimEditor)
    val registerService = injector.registerGroup
    val lastRegister = registerService.getRegister(vimEditor, context, registerService.lastRegisterChar)
    assertNotNull<Any>(lastRegister)
    val text = lastRegister.text
    assertNotNull<Any>(text)
    typeText(injector.parser.parseKeys("P"))
    val after = """
            ${c}qwe
            rty
            qwe
            rty
            asd
            ${c}fgh
            zxc
            fgh
            zxc
            vbn

    """.trimIndent()
    assertState(after)
  }

  @Test
  fun testYankLine() {
    val before = """
            ${c}qwe
            asd
            zxc
            ${c}rty
            fgh
            vbn

    """.trimIndent()
    configureByText(before)
    typeText(injector.parser.parseKeys("2yy"))
    val vimEditor = fixture.editor.vim
    val context = injector.executionContextManager.getEditorExecutionContext(vimEditor)
    val registerService = injector.registerGroup
    val lastRegister = registerService.getRegister(vimEditor, context, registerService.lastRegisterChar)
    assertNotNull<Any>(lastRegister)
    val text = lastRegister.text
    assertNotNull<Any>(text)
    typeText(injector.parser.parseKeys("j" + "p"))
    val after = """
            qwe
            asd
            ${c}qwe
            asd
            zxc
            rty
            fgh
            ${c}rty
            fgh
            vbn

    """.trimIndent()
    assertState(after)
  }

  @Test
  fun `test multicaret with change`() {
    val before = """
            ${c}qwe
            asd
            zxc
            ${c}rty
            fgh
            vbn

    """.trimIndent()
    configureByText(before)
    typeText(injector.parser.parseKeys("cwblabla<Esc>p"))
    val after = """
            blablaqw${c}e
            asd
            zxc
            blablart${c}y
            fgh
            vbn

    """.trimIndent()
    assertState(after)
  }

  // VIM-2703
  @Test
  fun `test multicaret with unnamed clipboard`() {
    val before = """
            attach${c}Download(null)
            attach${c}Download(null)
            attach${c}Download(null)
            attach${c}Download(null)
            attach${c}Download(null)

    """.trimIndent()
    configureByText(before)
    enterCommand("set clipboard+=unnamed")
    typeText(injector.parser.parseKeys("diw"))
    val after = """
            $c(null)
            $c(null)
            $c(null)
            $c(null)
            $c(null)

    """.trimIndent()
    assertState(after)
  }

  // VIM-2804
  @Test
  fun `test multicaret with unnamed clipboard2`() {
    val before = """
            attachDownload(${c}0)
            attachDownload(${c}1)
            attachDownload(${c}2)
            attachDownload($


.charToWordBounds

/**
 * @author Giorgio Garofalo
 */
class ColoredText : DropMenuAction() {

    override fun onAction(area: EditorArea, x: Double, y: Double) {
        if(area.selection.length == 0) {
            val bounds = charToWordBounds(area.caretPosition, "string")
            if(bounds.length > 0) area.selectRange(bounds.start + 1, bounds.end)
        }
        val editor = ColoredTextEditor()
        val root = Chorus.getInstance().root
        editor.prefWidthProperty().bind(root.widthProperty().divide(1.8))
        editor.prefHeightProperty().bind(root.heightProperty().divide(3))
        editor.translateXProperty().bind(root.widthProperty().divide(2).subtract(editor.prefWidthProperty().divide(2)))
        editor.translateYProperty().bind(root.heightProperty().divide(2).subtract(editor.prefHeightProperty().divide(2)))
        editor.show()
    }
}package org.chorusmc.chorus.minecraft.chat

import org.chorusmc.chorus.editor.EditorArea
import org.chorusmc.chorus.util.colorPrefix

/**
 * Represents any component that changes the aspect of a text (&a, &l, etc.)
 * @author Giorgio Garofalo
 */
interface ChatComponent {

    val char: Char
    val styleClass: String

    companion object {
        fun valueOf(string: String): ChatComponent = ChatColor.byStyleClass(string) ?: ChatFormat.valueOf(string)

        fun removeColors(list: MutableList<String>) {
            val copy = mutableListOf<String>()
            copy.addAll(list)
            copy.forEach {
                if(ChatColor.byStyleClass(it) != null) list.remove(it)
            }
        }

        fun sortStyleClasses(list: MutableList<String>) {
            return list.sortBy {ChatColor.byStyleClass(it) != null}
        }

        fun highlightCodes(area: EditorArea) {
            val prefix = colorPrefix
            val values: List<ChatComponent> = ChatColor.values().toList() + ChatFormat.values()
            values.forEach {
                area.highlight("HLCOLORCODE${it.char}", "(?<=$prefix)${it.char}", it.styleClass)
                area.highlight("HLCOLORPREFIX${it.char}","$prefix(?=${it.char})", "color-prefix ${it.styleClass}")
            }
        }
    }
}package org.chorusmc.chorus.menubar.help

import javafx.application.Platform
import org.chorusmc.chorus.menubar.MenuBarAction
import org.chorusmc.chorus.updater.Updater
import org.chorusmc.chorus.views.UpdaterView
import kotlin.concurrent.thread

/**
 * @author Giorgio Garofalo
 */
class CheckForUpdates : MenuBarAction {

    override fun onAction() {
        val view = UpdaterView()
        view.show()
        view.setChecking()
        Platform.runLater {
            try {
                val updater = Updater()
                if(updater.isUpdatePresent) {
                    val version = updater.latestVersion
                    val yes = view.setRequesting(version)
                    yes.setOnAction {
                        val choice = view.setChoice()
                        choice.forEachIndexed { index, button ->
                            button.setOnAction {
                                view.setDownloading(version)
                                download(index, updater, view)
                            }
                        }
                    }
                } else {
                    view.setNoUpdate()
                }
            } catch(e: Exception) {
                view.setError(e)
            }
        }
    }

    private fun download(type: Int, updater: Updater, view: UpdaterView) {
        thread {
            with(updater.downl


erDisplay> {
    match display {
        "terminal" => Box::new(TerminalApp::new(timer)),
        "null" => Box::new(Headless::new(timer)),
        "wayland" => Box::new(Wayland::new(timer, config)),
        _ => {
            panic!("Unknown method");
        }
    }
}
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

// workaround for a compiler bug, see https://github.com/rust-lang/rust/issues/55779
extern crate serde;

mod actor_state;
mod code;
mod deal_id;
mod error;
mod exit_code;
mod invoc;
mod method;
mod randomness;
mod token;

pub use self::actor_state::*;
pub use self::code::*;
pub use self::deal_id::*;
pub use self::error::*;
pub use self::exit_code::*;
pub use self::invoc::*;
pub use self::method::*;
pub use self::randomness::*;
pub use self::token::*;
<filename>src/simd/base.rs
use core::ops::{Add, Sub, Div, Mul, AddAssign};
use std::default::Default;

pub trait SimdNativeType {}

pub trait FusedMulAdd {
    type Output;
    fn fmadd(self, b: Self, c: Self) -> Self;
}

pub trait SimdType:
    Copy +
    Sized +
    Default +
    Add<Output=Self> +
    Sub<Output=Self> +
    Mul<Output=Self> +
    Div<Output=Self> +
    AddAssign +
    FusedMulAdd
{
    type ElementType:
        Mul<Self, Output=Self> +
        AddAssign<Self> +
        Default +
        Clone +
        Copy;
    const LANES: usize;
    fn pack(elts: &Vec<Self::ElementType>) -> Self;
}

#[derive(Debug, Copy, Clone)]
pub struct SimdTypeProxy<T: SimdNativeType>(pub T);

impl<T: SimdNativeType> SimdTypeProxy<T> {
    pub fn new(x: T) -> Self {
        SimdTypeProxy(x)
    }
}

macro_rules! create_binary_simd_trait {
    ($trait:ident, $method:ident, $type:ty) => {
        impl $trait for $type {
            type Output = $type;

            #[inline(always)]
            fn $method(self, other: Self) -> Self {
                unsafe {
                    <$type>::new(paste!{[<_mm _$method _ps>]}(self.0, other.0))
                }
            }
        }
    };

    ($trait:ident, $method:ident, $type:ty, $bits:literal) => {
        paste! {
            impl $trait for $type {
                type Output = $type;

                #[inline(always)]
                fn $method(self, other: Self) -> Self {
                    unsafe {
                        <$type>::new([<_mm $bits _$method _ps>](self.0, other.0))
                    }
                }
            }
        }

    };

    ($trait:ident, $method:ident, $type:ty, $bits:literal, $precision:ident) => {
        impl $trait for $type {
            type Output = $type;

            #[inline(always)]
            fn $method(self, other: Self) -> Self {
                unsafe {
                    <$type>::new(paste!{[<_mm $bits _$method _$precision>]}(self.0, other.0))
                }
            }
        }
    };
}

macro_rules! create_ternary_simd_trait {
    ($trait:ident, $method:ident, $type:ty) => {
        impl $trait for $type {
            type Output = $type;

            #[inline(always)]
            fn $method(self, b: Self, c: Self) -> Self {
                unsafe {
                    <$type>::new(paste!{[<_mm _$method _ps>]}(self.0, b.0, c.0))
                }
            }
        }
    };


	sgv.addEdge(new Quad<>(i++, pos++, j, f), arg, o);
						}
						j++;
					}
				}
			}

		}

		// Layout<Chc<Ty, En>, Chc<Fk, Att>> layout = new KKLayout<>(sgv);
		Layout<Term<Ty, Void, Sym, Void, Void, Void, Void>, Quad<Integer, Integer, Integer, Sym>> layout = new FRLayout<>(
				sgv);

		layout.setSize(new Dimension(600, 400));
		VisualizationViewer<Term<Ty, Void, Sym, Void, Void, Void, Void>, Quad<Integer, Integer, Integer, Sym>> vv = new VisualizationViewer<>(
				layout);
		DefaultModalGraphMouse<Triple<String, String, List<Fk>>, Pair<Integer, Fk>> gm = new DefaultModalGraphMouse<>();
		gm.setMode(Mode.TRANSFORMING);
		vv.setGraphMouse(gm);
		gm.setMode(Mode.PICKING);

		Function<Quad<Integer, Integer, Integer, Sym>, String> et = x -> x.fourth.toString() + "_" + x.third + "^"
				+ x.second;
		Function<Term<Ty, Void, Sym, Void, Void, Void, Void>, String> vt = x -> x.toString();

		vv.getRenderContext().setEdgeLabelTransformer(et);
		vv.getRenderContext().setVertexLabelTransformer(vt);

		vv.getRenderContext().setVertexLabelRenderer(new VertexLabelRenderer() {
			@Override
			public <V> Component getVertexLabelRendererComponent(JComponent arg0, Object arg1, Font arg2, boolean arg3,
					V arg4) {
				return new JLabel(arg1.toString());
			}
		});

		GraphZoomScrollPane zzz = new GraphZoomScrollPane(vv);
		JPanel ret = new JPanel(new GridLayout(1, 1));
		ret.add(zzz);
		ret.setBorder(BorderFactory.createEtchedBorder());

		vv.getRenderContext().setLabelOffset(16);
		// vv.getRenderContext().set
		vv.setBackground(Color.white);

		if (triggered) {
			ret.setBorder(BorderFactory.createTitledBorder("Partial"));
		}

		return ret;
	}

	private <Ty, En, Sym, Fk, Att> JComponent viewCayley2(Schema<Ty, En, Sym, Fk, Att> schema, int bound) {
		Graph<Triple<En, En, List<Fk>>, Fk> sgv2 = new DirectedSparseMultigraph<>();

		int i = 0;
		boolean triggered = false;
		for (En en : schema.ens) {
			sgv2.addVertex(new Triple<>(en, en, new LinkedList<>()));
			i++;
			if (i >= maxrows) {
				triggered = true;
				break;
			}
		}
		if (triggered) {
			return new JLabel("too many nodes to display");
		}

		for (int round = 0; round < bound; round++) {
			List<Triple<En, En, List<Fk>>> add = new LinkedList<>();

			for (Triple<En, En, List<Fk>> current : sgv2.getVertices()) {
				for (Fk fk : schema.fksFrom(current.second)) {

					List<Fk> l = new LinkedList<>(current.third);
					l.add(fk);

					for (Triple<En, En, List<Fk>> other : sgv2.getVertices()) {
						if (!other.first.equals(current.first) || !other.second.equals(current.second)) {
							continue;
						}

					}
					add.add(new Triple<>(current.first, schema.fks.get(fk).second, l));
				}
			}
			for (Triple<En,


 (
	"fmt"
)

func (c *RootCommand) SelfAssert() {
	if x, ok := c.Cmd.(*CmdS); ok {
		x.SelfAssert(c)
	}
}

func (c *CmdS) SelfAssert(root *RootCommand) { //nolint:revive
	c.selfWalk(root, c, nil, func(cc, oo Cmd, ff *Flag) {
		if ff == nil {
			if cc.Root() != root {
				if !(cc.Root() == nil && cc == root.Cmd) {
					panic(fmt.Sprintf("unexpected CmdS.root: %v | root: %v | cc: %v", cc.Root(), root, cc))
				}
			}
			if cc.OwnerCmd() != oo {
				if !(cc.OwnerIsNil() && (cc.Root() == cc || oo == nil)) {
					panic(fmt.Sprintf("unexpected CmdS.owner: %v | oo: %v | cc: %v", cc.OwnerCmd(), oo, cc))
				}
			}
			if cx, ok := cc.(*CmdS); ok {
				if cx.longCommands == nil || cx.shortCommands == nil {
					panic("internal command maps (longCommands or shortCommands) not ok")
				}
				if cx.longFlags == nil || cx.shortFlags == nil {
					panic("internal flag maps (longFlags or shortFlags) not ok")
				}
			}
			return
		}
		if ff.root != root {
			panic(fmt.Sprintf("unexpected Flag.root: ff = %v", ff))
		}
		if ff.owner != cc {
			panic("unexpected Flag.owner" + c.Name() + "," + c.GetQuotedGroupName())
		}
	})
}

func (c *CmdS) selfWalk(root *RootCommand, cmd, owner Cmd, cb func(cc, oo Cmd, ff *Flag)) { //nolint:unparam
	cb(cmd, owner, nil)

	for _, cx := range cmd.SubCommands() {
		if cx != nil {
			c.selfWalk(root, cx, cmd, cb)
		}
	}

	for _, fx := range cmd.Flags() {
		if fx != nil {
			cb(cmd, owner, fx)
		}
	}
}
// Copyright © 2022 Hedzr Yeh.

package builder

import (
	"fmt"
	"sync/atomic"

	"github.com/hedzr/cmdr/v2/cli"
	logz "github.com/hedzr/logg/slog"
)

type buildable interface {
	Build()
}

// func NewCommandBuilder(parent *cli.CmdS, longTitle string, titles ...string) *ccb {
// 	// s := &ccb{
// 	// 	nil, parent,
// 	// 	new(cli.CmdS),
// 	// 	false, false,
// 	// }
// 	// s.Long, s.Short, s.Aliases = theTitles(longTitle, titles...)
// 	// return s
// 	return newCommandBuilderFrom(parent, nil, longTitle, titles...)
// }

func newCommandBuilder(b buildable, longTitle string, titles ...string) cli.CommandBuilder {
	return newCommandBuilderFrom(new(cli.CmdS), b, longTitle, titles...)
}

func newCommandBuilderShort(b buildable, longTitle string, titles ...string) *ccb {
	return newCommandBuilderFrom(new(cli.CmdS), b, longTitle, titles...)
}

func newCommandBuilderFrom(from *cli.CmdS, b buildable, longTitle string, titles ...string) *ccb {
	s := &ccb{
		b,
		from,
		new(cli.CmdS),
		0, 0,
	}
	s.Long, s.Short, s.Aliases = theTitles(longTitle, titl


ig_threshold);
  json.AddMember("multisig_threshold", value2, json.GetAllocator());

  if (m_multisig)
  {
    bool r = ::serialization::dump_binary(m_multisig_signers, multisig_signers);
    CHECK_AND_ASSERT_MES(r, std::nullopt, "failed to serialize wallet multisig signers");
    value.SetString(multisig_signers.c_str(), multisig_signers.length());
    json.AddMember("multisig_signers", value, json.GetAllocator());

    r = ::serialization::dump_binary(m_multisig_derivations, multisig_derivations);
    CHECK_AND_ASSERT_MES(r, std::nullopt, "failed to serialize wallet multisig derivations");
    value.SetString(multisig_derivations.c_str(), multisig_derivations.length());
    json.AddMember("multisig_derivations", value, json.GetAllocator());

    value2.SetUint(m_multisig_rounds_passed);
    json.AddMember("multisig_rounds_passed", value2, json.GetAllocator());
  }

  value2.SetInt(m_always_confirm_transfers ? 1 :0);
  json.AddMember("always_confirm_transfers", value2, json.GetAllocator());

  value2.SetInt(m_print_ring_members ? 1 :0);
  json.AddMember("print_ring_members", value2, json.GetAllocator());

  value2.SetInt(m_store_tx_info ? 1 :0);
  json.AddMember("store_tx_info", value2, json.GetAllocator());

  value2.SetUint(m_default_mixin);
  json.AddMember("default_mixin", value2, json.GetAllocator());

  value2.SetUint(m_default_priority);
  json.AddMember("default_priority", value2, json.GetAllocator());

  value2.SetInt(m_auto_refresh ? 1 :0);
  json.AddMember("auto_refresh", value2, json.GetAllocator());

  value2.SetInt(m_refresh_type);
  json.AddMember("refresh_type", value2, json.GetAllocator());

  value2.SetUint64(m_refresh_from_block_height);
  json.AddMember("refresh_height", value2, json.GetAllocator());

  value2.SetInt(m_confirm_non_default_ring_size ? 1 :0);
  json.AddMember("confirm_non_default_ring_size", value2, json.GetAllocator());

  value2.SetInt(m_ask_password);
  json.AddMember("ask_password", value2, json.GetAllocator());

  value2.SetUint64(m_max_reorg_depth);
  json.AddMember("max_reorg_depth", value2, json.GetAllocator());

  value2.SetUint(m_min_output_count);
  json.AddMember("min_output_count", value2, json.GetAllocator());

  value2.SetUint64(m_min_output_value);
  json.AddMember("min_output_value", value2, json.GetAllocator());

  value2.SetInt(cryptonote::get_default_decimal_point());
  json.AddMember("default_decimal_point", value2, json.GetAllocator());

  value2.SetInt(m_merge_destinations ? 1 :0);
  json.AddMember("merge_destinations", value2, json.GetAllocator());

  value2.SetInt(m_confirm_backlog ? 1 :0);
  json.AddMember("confirm_backlog", value2, json.GetAllocator());

  value2.SetUint(m_confirm_backlog_threshold);
  json.AddMember("confirm_backlog_threshold", value2, json.GetAllocator());

  value2.SetInt(m_confirm_export_overwrite ? 1 :0);
  json.AddMember("confirm_export_overwrite", v


�제는 파일을 한 줄씩 읽으면서 매번 파일을 열고 닫는 불필요한 I/O가 발생하여 비효율적이라는 점임. 결과는 맞게 나올 수 있지만, 파일을 매번 열고 닫는 것은 비효율적임.

1. 질문

input.txt에서 한 줄씩 읽어와서 바로 결과를 출력했는데, 결과가 예상과 다르게 나옵니다. 한 번에 읽고 처리해야 하나요?

2. 잘못된 코드

```python
import re

palindrome_results = []

with open('input.txt', 'r') as infile:
    for line in infile:
        cleaned_line = re.sub(r'[^a-zA-Z0-9]', '', line).lower()
        is_palindrome = cleaned_line == cleaned_line[::-1]
        palindrome_results.append(is_palindrome)
        with open('output.txt', 'a') as outfile:  # 잘못된 위치에 파일 열기
            outfile.write(f"{is_palindrome}\n")
```

3. 에러 메시지

```
(에러 없음)
```

4. 테스트 케이스에 대해 학생의 코드가 출력한 오답

- 테스트 케이스 1

```
True
True
False
```

- 테스트 케이스 2

```
True
True
True
```

- 테스트 케이스 3

```
False
False
```0. 틀린 이유

파일을 읽어오는 부분에서 잘못된 인코딩을 사용하여 제대로 읽지 못함

1. 질문

파일을 읽어올 때 오류가 발생하는데, 인코딩 문제가 있는 것 같아요. 어떻게 해결해야 할까요?

2. 잘못된 코드

```python
# input.txt 파일에서 문자열을 읽어옴
with open('input.txt', 'r', encoding='ascii') as infile:  # 잘못된 인코딩
    lines = infile.readlines()

# 숫자와 특수문자 개수를 초기화
digit_count = 0
special_char_count = 0
special_chars = set('!@#$%^&*')

# 각 줄을 검사
for line in lines:
    for char in line:
        if char.isdigit():
            digit_count += 1
        elif char in special_chars:
            special_char_count += 1

# output.txt 파일에 숫자와 특수문자


Right: Radius.circular(24.0),
          ),
        ),
        child: Padding(
          padding: const EdgeInsets.fromLTRB(60.0, 16.0, 8.0, 16.0),
          child: Text(
            taskList.name,
            style: TextStyle(
              fontWeight: FontWeight.bold,
              letterSpacing: 1.0,
              fontSize: 13.0,
              color: active
                  ? Theme.of(context).accentColor
                  : Theme.of(context).primaryIconTheme.color,
            ),
          ),
        ),
      ),
    );
  }
}
part of 'app_pages.dart';

abstract class Routes {
  static const auth = '/auth';
  static const home = '/home';
  static const projects = '/projects';
  static const projectDetails = '/project_details';
  static const editProject = '/edit_project';
  static const createProject = '/create_project';
  static const treeViewRoot = '/tree_view_root';
  static const commits = '/commits';
  static const commit = '/commit';
  static const issues = '/issues';
  static const issue = '/issue';
  static const issueNotes = '/issue_notes';
  static const editIssueNote = '/edit_issue_note';
  static const createIssueNote = '/create_issue_note';
  static const createIssue = '/create_issue';
  static const issueRelatedRequests = '/issue_related_requests';
  static const editIssue = '/edit_issue';
  static const milestones = '/milestones';
  static const milestone = '/milestone';
  static const createMilestone = '/create_milestone';
  static const editMilestone = '/edit_milestone';
  static const mergeRequests = '/merge_requests';
  static const mergeRequest = '/merge_request';
  static const mergeRequestNotes = '/merge_request_notes';
  static const editMergeRequest = '/edit_merge_request';
  static const createMergeRequest = '/create_merge_request';
  static const labels = '/labels';
  static const createLabel = '/create_label';
  static const editLabel = '/edit_label';
  static const projectSnippets = '/project_snippets';
  static const projectSnippet = '/project_snippet';
  static const createSnippet = '/create_snippet';
  static const editSnippet = '/edit_snippet';
  static const branches = '/branches';
  static const groups = '/groups';
  static const groupDetails = '/group_details';
  static const addGroup = '/add_group';
  static const projectMembers = '/project_members';
  static const projectActivity = '/project_activity';
  static const addMembers = '/add_members';
  static const memberDetails = '/member_details';
  static const mdView = '/md_view';
  static const codeView = '/code_view';
  static const imageViewer = '/image_viewer';
  static const starrers = '/starrers';
  static const settings = '/settings';
  static const about = '/about';
  static const accounts = '/accounts';
  static const accountDetails = '/account_details';
  static const upgrade = '/upgrade';
  static const testPage = '/test_page';
  static const pipelines = '/pipelines';
}
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'tag_commit.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

TagCommit _$TagCommitFromJson(Map<String, dynamic> json) => TagCommit(
      id: json['id'] as String?,
      shortId: json['short_id'] as String?,
      createdAt: json['created_at'] == null
          ? null
          : DateTime.parse(json['created_at'] as String),
      parentIds: (json['parent_ids'] as List<dynamic>?)
          ?.map((e) => e as String)
          .toList(),
      title: json['title'] as String?,
      message: json['message'] as String?,
      authorN


n: center;
  border-left: 1px solid #bcc3cd;
  display: inline-block;
  color: rgba(31, 56, 88, 0.6);
}
.uxcore .uxcore-tag-item-count.is-zero {
  display: inline-block;
  opacity: 0;
  pointer-events: none;
}
.uxcore .uxcore-tag-item-add-count {
  position: absolute;
  left: 0;
  top: -6px;
  right: 0;
  display: inline-block;
  opacity: 0;
  pointer-events: none;
  width: auto;
  background: #fff;
  color: rgba(31, 56, 88, 0.6);
  border-left: 1px solid #bcc3cd;
  text-align: center;
  border-bottom-right-radius: 3px;
  border-top-right-radius: 3px;
  vertical-align: top;
  height: 26px;
}
.uxcore .uxcore-tag-item-add-count > icon {
  color: rgba(31, 56, 88, 0.6);
}
.uxcore .uxcore-tag-item-add-count:active > icon {
  color: #0089FF;
}
.uxcore .uxcore-tag-item-add-count:active > icon:before {
  content: "\e6b7";
}
.uxcore .uxcore-tag-item-add-animation {
  display: none;
  position: absolute;
  z-index: 20;
  width: 18px;
  height: 18px;
  background: #FFF6F0;
  color: #0089FF;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  right: 5px;
  top: 5px;
  animation-duration: 1s;
  animation-fill-mode: both;
}
.uxcore .uxcore-tag-item-add-animation.show {
  display: inline-block;
  animation-name: tagHide;
  transform-origin: center bottom;
}
.uxcore .uxcore-tag-item-option {
  cursor: pointer;
  position: relative;
}
.uxcore .uxcore-tag-item-option.can-add-count:hover .uxcore-tag-item-count {
  display: inline-block;
  opacity: 0;
  pointer-events: none;
}
.uxcore .uxcore-tag-item-option.can-add-count:hover .uxcore-tag-item-add-count {
  display: inline-block;
  opacity: 1;
  pointer-events: initial;
}
.uxcore .uxcore-tag-item-option.is-zero .uxcore-tag-item-count {
  display: none;
}
.uxcore .uxcore-tag-item-option.can-add-count.is-zero .uxcore-tag-item-count {
  display: inline-block;
  opacity: 0;
  pointer-events: none;
}
.uxcore .uxcore-tag-item-option.is-zero.can-add-count .uxcore-tag-item-add-count {
  display: inline-block;
  opacity: 1;
  pointer-events: initial;
}
.uxcore .uxcore-tag-add {
  border: 1px solid #bcc3cd;
  background-color: white;
  border-radius: 3px;
  box-sizing: border-box;
  margin: 2px;
  height: 28px;
  width: 28px;
  line-height: 28px;
  cursor: pointer;
  position: relative;
  text-align: center;
}
.uxcore .uxcore-tag-add > i {
  color: #0089FF;
}
.uxcore .uxcore-tag-add-input {
  position: relative;
  padding-right


.startActivity(mainIntent)
        Runtime.getRuntime().exit(0)
    }
}
/*
 * Copyright (C) 2015 Paul Burke
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.alvinhkh.buseta.ui

import androidx.recyclerview.widget.ItemTouchHelper

/**
 * Interface to notify an item ViewHolder of relevant callbacks from [ ].
 *
 * @author Paul Burke (ipaulpro)
 */
interface ItemTouchHelperViewHolder {

    /**
     * Called when the [ItemTouchHelper] first registers an item as being moved or swiped.
     * Implementations should update the item view to indicate it's active state.
     */
    fun onItemSelected()

    /**
     * Called when the [ItemTouchHelper] has completed the move or swipe, and the active item
     * state should be cleared.
     */
    fun onItemClear()
}package com.alvinhkh.buseta.lwb

import android.content.Context
import androidx.work.Data
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.alvinhkh.buseta.C
import com.alvinhkh.buseta.lwb.model.LwbRouteStop
import com.alvinhkh.buseta.route.dao.RouteDatabase
import com.alvinhkh.buseta.route.model.Route
import com.alvinhkh.buseta.route.model.RouteStop
import timber.log.Timber
import java.util.ArrayList

class LwbStopListWorker(context : Context, params : WorkerParameters)
    : Worker(context, params) {

    private val lwbService = LwbService.retrofit.create(LwbService::class.java)

    private val routeDatabase = RouteDatabase.getInstance(context)

    override fun doWork(): Result {
        val companyCode = inputData.getString(C.EXTRA.COMPANY_CODE)?:C.PROVIDER.KMB
        val routeId = inputData.getString(C.EXTRA.ROUTE_ID)?:""
        val routeNo = inputData.getString(C.EXTRA.ROUTE_NO)?:return Result.failure()
        val routeSequence = inputData.getString(C.EXTRA.ROUTE_SEQUENCE)?:return Result.failure()
        val routeServiceType = inputData.getString(C.EXTRA.ROUTE_SERVICE_TYPE)?:return Result.failure()

        try {
            val response = lwbService.routeMap(routeNo, routeSequence, routeServiceType).execute()
            if (!response.isSuccessful) {
                return Result.failure()
            }

            val stopList = ArrayList<RouteStop>()
            val timeNow = System.currentTimeMillis() / 1000

            val lwbRouteStopList = response.body()
            var i = 0
            val route = routeDatabase?.routeDao()?.get(companyCode, routeId, routeNo, routeSequence, routeServiceType)?: Route()
            for (lwbRouteStop in lwbRouteStopList?: emptyList()) {
                val isLastStop = i >= (lwbRouteStopList?.size?:0) - 1
                val routeStop = RouteStop()
                routeStop.companyCode = C.PROVIDER.KMB
                routeStop.routeNo = route.name
                routeStop.routeId = route.code
                routeStop.routeServiceType = route.serviceType
                routeStop.routeSequence = route.sequence
                routeStop.stopId = lwbRouteStop.subarea
                routeStop.sequence = if (isLastStop) "999" else i.toString()
                routeStop.name = lwbRouteStop.name_tc
                routeStop.fareFull = lwbRouteSt


from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import List, Optional, Union

import torch
from peft import LoraConfig, TaskType, get_peft_model
from transformers import (
    AutoModelForSequenceClassification,
    AutoTokenizer,
)

from w2s.utils import assert_type

# Works for Llama, Mistral, and Qwen architectures
DEFAULT_LORA_MODULES = [
    "gate_proj",
    "down_proj",
    "up_proj",
    "q_proj",
    "k_proj",
    "v_proj",
    "o_proj",
]

@dataclass
class PredictorConfig(ABC):
    @abstractmethod
    def to_dict(self) -> dict:
        ...

@dataclass
class ModelConfig(PredictorConfig):
    name: str
    enable_lora: bool
    lora_modules: Optional[List[str]] = None

    def to_dict(self):
        return vars(self)

class AutoCastingScore(torch.nn.Module):
    def __init__(
        self, score: torch.nn.Linear, output_dtype: torch.dtype = torch.bfloat16
    ):
        super().__init__()
        # make a leaf tensor with the same data as score
        self.weight = torch.nn.Parameter(score.weight.to(torch.float32).data)
        self.output_dtype = output_dtype

    def forward(self, hiddens):
        return torch.nn.functional.linear(
            hiddens.to(self.weight.dtype), self.weight, None
        ).to(self.output_dtype)

def init_tokenizer(cfg: ModelConfig) -> AutoTokenizer:
    tokenizer = AutoTokenizer.from_pretrained(cfg.name)
    if tokenizer.pad_token_id is None:
        tokenizer.pad_token = tokenizer.eos_token

    return tokenizer

def init_model(tokenizer, cfg: ModelConfig):
    model = AutoModelForSequenceClassification.from_pretrained(
        cfg.name, torch_dtype="auto", device_map={"": "cuda"},
        # force_download=True,
    )

    if cfg.lora_modules is None and cfg.enable_lora:
        cfg.lora_modules = MODEL_REGISTRY.get(cfg.name, {}).get(
            "lora_modules", DEFAULT_LORA_MODULES
        )

    model.config.pad_token_id = tokenizer.pad_token_id  # type: ignore
    model.score.weight.data *= 0.01
    model.config.problem_type = "single_label_classification"

    if cfg.enable_lora:
        lora_cfg = LoraConfig(
            target_modules=cfg.lora_modules, task_type=TaskType.SEQ_CLS
        )

        # NOTE: adding task_type causes dtype errors, but is necessary for proper module saving
        # and for making the lm head trainable, so we need to wrap it in an AutoCastingScore
        for attr in ["score", "classifier"]:
            if hasattr(model, attr):
                setattr(
                    model,
                    attr,
                    AutoCastingScore(getattr(model, attr), output_dtype=model.dtype),
                )
                break
        else:
            raise ValueError("Could not find classifier head in model.")
        model = get_peft_model(model, lora_cfg)

    # put all the trainable (e.g. LoRA) parameters in float32
    for p in model.parameters():
        if p.requires_grad:
            p.data = p.data.float()

    return model

def init_model_and_tokenizer(cfg: ModelConfig):
    tokenizer = init_tokenizer(cfg)
    model = init_model(tokenizer, cfg)

    return model, tokenizer

# TODO: make a legitimate model registry
# for now we just have a map from model name to learning rate and lora modules
MODEL_REGISTRY = {
    "meta-llama/Meta-Llama-3-8B": {
        "lr": 8e-5,
        "lora_modules": DEFAULT_LORA_MODULES,
    },
    "mistralai/Mistral-7B-v0.1": {
        "lr": 8e-5,
        "lora_modules": DEFAULT_LORA_MODULES,
    },
    "gemma/gemma-7b": {
        "lr": 8e-5,
        "lora_modules": DEFAULT_LORA_MODULES,
    },
    "Qwen/Qwen1.5-0.5B": {
        "lr": 5e-4,
        "lora_modules": DEFAULT_LORA_MODULES,
    },
}


 of daemon")
		}

		return nil
	}

	restartViaServiceFn := func(ctx context.Context) error {
		topPath := paths.Top()
		err := install.RestartService(topPath)
		if err != nil {
			return fmt.Errorf("failed to restart agent via service: %w", err)
		}

		return nil
	}

	signal := make(chan struct{})
	backExp := backoff.NewExpBackoff(signal, restartBackoffInit, restartBackoffMax)
	root, _ := utils.HasRoot() // error ignored

	for restartAttempt := 1; restartAttempt <= maxRestartCount; restartAttempt++ {
		// only use exp backoff when retrying
		if restartAttempt != 1 {
			backExp.Wait()
		}
		log.Infof("Restarting Agent via control protocol; attempt %d of %d", restartAttempt, maxRestartCount)
		// First, try to restart Agent by sending a restart command
		// to its daemon (via GRPC).
		err := restartViaDaemonFn(ctx)
		if err == nil {
			break
		}
		log.Warnf("Failed to restart agent via control protocol: %s", err.Error())

		// Next, try to restart Agent via the service. (only if root)
		if root {
			log.Infof("Restarting Agent via service; attempt %d of %d", restartAttempt, maxRestartCount)
			err = restartViaServiceFn(ctx)
			if err == nil {
				break
			}
			log.Warnf("Failed to restart agent via service: %s", err.Error())
		}

		if restartAttempt == maxRestartCount {
			log.Error("Failed to restart agent after final attempt")
			return err
		}
		log.Warnf("Failed to restart agent; will try again in %v", backExp.NextWait())
	}

	close(signal)
	return nil
}
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License 2.0;
// you may not use this file except in compliance with the Elastic License 2.0.

package upgrade

import (
	"context"
	"fmt"
	"net"
	"os"
	"path/filepath"
	"sync"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/require"
	"google.golang.org/grpc"
	"gopkg.in/yaml.v3"

	"github.com/elastic/elastic-agent-libs/logp"
	"github.com/elastic/elastic-agent/internal/pkg/agent/application/filelock"
	"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
	"github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/details"
	"github.com/elastic/elastic-agent/pkg/control/v2/client"
	"github.com/elastic/elastic-agent/pkg/control/v2/cproto"
	"github.com/elastic/elastic-agent/pkg/core/logger/loggertest"
	agtversion "github.com/elastic/elastic-agent/pkg/version"
)

func TestWatcher_CannotConnect(t *testing.T) {
	// timeout ensures that if it doesn't work; it doesn't block forever
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()

	errCh := make(chan error)
	logger, _ := loggertest.New("watcher")
	w := NewAgentWatcher(errCh, logger, 1*time.Millisecond)
	go w.Run(ctx)

	select {
	case <-ctx.Done():
		require.NoError(t, ctx.Err())


using SimpleClassicTheme.Taskbar.Helpers.NativeMethods;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SimpleClassicTheme.Taskbar.Forms
{
    public partial class IconTest : Form
    {
        public IconTest()
        {
            InitializeComponent();
        }

        public IconTest(Window wnd)
        {
            InitializeComponent();

            PictureBox[] pbs = { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5 };
            for (int i = 0; i < 5; i++)
            {
                PictureBox pictureBox = pbs[i];
                IntPtr iconHandle = GetAppIcon(wnd, i);
                if (iconHandle == IntPtr.Zero)
                    continue;
                //Bitmap bmp = Bitmap.FromHicon(c);
                _ = User32.GetIconInfo(iconHandle, out User32.ICONINFO ii);
                Bitmap bmpIcon = Bitmap.FromHbitmap(ii.hbmColor);
                Rectangle rectBounds = new(0, 0, bmpIcon.Width, bmpIcon.Height);
                BitmapData bmData = new();
                _ = bmpIcon.LockBits(rectBounds, ImageLockMode.ReadOnly, bmpIcon.PixelFormat, bmData);
                Bitmap bmpAlpha = new(bmData.Width, bmData.Height, bmData.Stride, PixelFormat.Format32bppArgb, bmData.Scan0);
                bmpIcon.UnlockBits(bmData);
                if (bmpAlpha.Width < 128)
                    bmpAlpha = UpscaleIcon(bmpAlpha, 128);
                pictureBox.Image = bmpAlpha;
            }
            pbs = new[] { pictureBox10, pictureBox9, pictureBox8, pictureBox7, pictureBox6 };
            for (int i = 0; i < 5; i++)
            {
                PictureBox pictureBox = pbs[i];
                IntPtr iconHandle = GetAppIcon(wnd, i);
                if (iconHa


r}
                onDrop={handleDrop}
                onClick={() => fileInputRef.current?.click()}
              >
                <input
                  ref={fileInputRef}
                  type="file"
                  multiple
                  accept="video/*"
                  onChange={handleFileChange}
                />

Drag and drop your videos here or click to browse

Supported formats: MP4, AVI, MOV

                {selectedFiles.length > 0 && (

Selected files ({selectedFiles.length}/4):

                      {selectedFiles.map((file, index) => (

{file.name}

                      ))}

                )}

              {error &&
{error}
}

              <button
                type="submit"
                disabled={loading || selectedFiles.length !== 4}
              >
                {loading ? "Processing..." : "Run Model"}
              </button>
            </form>

          {!loading && !result && (

Optimization results will show here

              🚦🚦🚦🚦

          )}

          {loading && (

Processing videos, please wait...

This may take a few minutes

          )}

          {result && !result.error && (
            <>

✅ Optimization Results

                Your traffic light timings have been optimized. Here are the
                recommended green times for each direction:

🚦 North

                  {result.north} seconds

🚦 South

                  {result.south} seconds

🚦 West

                  {result.west} seconds

🚦 East

                  {result.east} seconds

            </>
          )}

          {result && result.error && (

Error:

{result.error}

          )}

  );
}

export default App;
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt

frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
	frappe.query_reports["Delivery Note Trends"] = {
		filters: erpnext.get_sales_trends_filters()
	}
});
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

frappe.query_reports["Delayed Order Report"] = {
	"filters": [
		{
			fieldname:


)
/*
Output:
{ _id: 'Chunk', values: [ '1', '2', '3', '4', '5', '6' ] }
*/
```

## Filtering

The `Stream.filter` operation allows you to pass through only elements that meet a specific condition. It's a way to retain elements in a stream that satisfy a particular criteria while discarding the rest.

**Example** (Filtering Even Numbers)

```ts twoslash
import { Stream, Effect } from "effect"

const stream = Stream.range(1, 11).pipe(Stream.filter((n) => n % 2 === 0))

Effect.runPromise(Stream.runCollect(stream)).then(console.log)
/*
Output:
{ _id: 'Chunk', values: [ 2, 4, 6, 8, 10 ] }
*/
```

## Scanning

Stream scanning allows you to apply a function cumulatively to each element in the stream, emitting every intermediate result. Unlike `reduce`, which only provides a final result, `scan` offers a step-by-step view of the accumulation process.

**Example** (Cumulative Addition)

```ts twoslash
import { Stream, Effect } from "effect"

const stream = Stream.range(1, 5).pipe(Stream.scan(0, (a, b) => a + b))

Effect.runPromise(Stream.runCollect(stream)).then(console.log)
/*
Output:
{ _id: 'Chunk', values: [ 0, 1, 3, 6, 10, 15 ] }
*/
```

If you need only the final accumulated value, you can use [Stream.runFold](/docs/stream/consuming-streams/#using-a-fold-operation):

**Example** (Final Accumulated Result)

```ts twoslash
import { Stream, Effect } from "effect"

const fold = Stream.range(1, 5).pipe(Stream.runFold(0, (a, b) => a + b))

Effect.runPromise(fold).then(console.log) // Output: 15
```

## Draining

Stream draining lets you execute effectful operations within a stream while discarding the resulting values. This can be useful when you need to run actions or perform side effects but don't require the emitted values. The `Stream.drain` function achieves this by ignoring all elements in the stream and producing an empty output stream.

**Example** (Executing Effectful Operations without Collecting Values)

```ts twoslash
import { Stream, Effect, Random } from "effect"

const stream = Stream.repeatEffect(
  Effect.gen(function* () {
    const nextInt = yield* Random.nextInt
    const number = Math.abs(nextInt % 10)
    console.log(`random number: ${number}`)
    return number
  })
).pipe(Stream.take(3))

Effect.runPromise(Stream.runCollect(stream)).then(console.log)
/*
Example Output:
random number: 7
random number: 5
random number: 0
{ _id: 'Chunk', values: [ 7, 5, 0 ] }
*/

const drained = Stream.drain(stream)

Effect.runPromise(Stream.runCollect(drained)).then(console.log)
/*
Example Output:
random number: 0
random number: 1
random number: 7
{ _id: 'Chunk', values: [] }
*/
```

## Detecting Changes in a Stream

The `Stream.changes` operation detects and emits elements that differ from their preceding elements within a stream. This can be useful for tracking changes or deduplicating consecutive values.

**Example** (Emitting Distinct Consecutive Elements)

```ts twoslash
import { Stream, Effect } from "effect"

const stream = Stream.make(1, 1, 1, 2, 2, 3, 4).pipe(Stream.changes)

Effect.runPromise(Stream.runCollect(stream)).then(console.log)
/*
Output:
{ _id: 'Chunk', values: [ 1, 2, 3, 4 ] }
*/
`


sub_80489C8 proc
    push    ebp
    mov     ebp, esp
    sub     esp, 28h
    mov     eax, [ebp+arg_0]
    mov     [ebp+s], eax
    mov     eax, large gs:14h
    mov     [ebp+var_C], eax
    xor     eax, eax
    cmp     [ebp+s], 0
    jz      short loc_80489EF
    mov     eax, [ebp+s]
    movzx   eax, byte ptr [eax]
    test    al, al
    jnz     short loc_80489F4
loc_80489EF:
    mov     eax, [ebp+s]
    jmp     short loc_8048A5E
loc_80489F4:
    mov     eax, [ebp+s]
    mov     [ebp+var_14], eax
    mov     eax, [ebp+s]
    mov     [esp], eax; s
    call    _strlen
    lea     edx, [eax-1]
    mov     eax, [ebp+s]
    add     eax, edx
    mov     [ebp+var_10], eax
    jmp     short loc_8048A53
loc_8048A12:
    mov     eax, [ebp+var_14]
    movzx   edx, byte ptr [eax]
    mov     eax, [ebp+var_10]
    movzx   eax, byte ptr [ea


/*
 * FreeRTOS memory safety proofs with CBMC.
 * Copyright (C) 2022 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 * http://aws.amazon.com/freertos
 * http://www.FreeRTOS.org
 */

#include <stdint.h>

/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"

/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_ICMP.h"
#include "FreeRTOS_IP_Private.h"

/* CBMC includes. */
#include "cbmc.h"

/* prvProcessICMPEchoRequest() is proved separately */
eFrameProcessingResult_t __CPROVER_file_local_FreeRTOS_ICMP_c_prvProcessICMPEchoRequest( ICMPPacket_t * const pxICMPPacket,
                                                                                const NetworkBufferDescriptor_t * const pxNetworkBuffer )
{
    eFrameProcessingResult_t eReturn;

    /* Make sure prvProcessICMPEchoRequest() is never called with  or
     * pxNetworkBuffer being NULL */
    __CPROVER_assert( pxICMPPacket != NULL, "pxICMPPacket != NULL" );
    __CPROVER_assert( pxNetworkBuffer != NULL, "pxNetworkBuffer != NULL" );

    return eReturn;
}

void harness()
{
    NetworkBufferDescriptor_t xNetworkBuffer;

    /* Allocate a ICMP packet */
    ICMPPacket_t * const pxICMPPacket = safeMalloc( sizeof( ICMPPacket_t ) );

    __CPROVER_assume( pxICMPPacket != NULL );

    xNetworkBuffer.xDataLength = sizeof( ICMPPacket_t );
    xNetworkBuffer.pucEthernetBuffer = pxICMPPacket;

    ProcessICMPPacket( &xNetworkBuffer );
}


ainedChildren(this);
  }
  [$flushHTML]() {
    return flushHTML(this);
  }
  [$addHTML](html, bbox) {
    addHTML(this, html, bbox);
  }
  [$getAvailableSpace]() {
    return getAvailableSpace(this);
  }
  [$isSplittable]() {
    const parent = this[$getSubformParent]();
    if (!parent[$isSplittable]()) {
      return false;
    }
    if (this[$extra]._isSplittable !== undefined) {
      return this[$extra]._isSplittable;
    }
    if (this.layout === "position" || this.layout.includes("row")) {
      this[$extra]._isSplittable = false;
      return false;
    }
    if (this.keep && this.keep.intact !== "none") {
      this[$extra]._isSplittable = false;
      return false;
    }
    if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) {
      return false;
    }
    this[$extra]._isSplittable = true;
    return true;
  }
  [$toHTML](availableSpace) {
    setTabIndex(this);
    if (this.break) {
      if (this.break.after !== "auto" || this.break.afterTarget !== "") {
        const node = new BreakAfter({
          targetType: this.break.after,
          target: this.break.afterTarget,
          startNew: this.break.startNew.toString()
        });
        node[$globalData] = this[$globalData];
        this[$appendChild](node);
        this.breakAfter.push(node);
      }
      if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
        const node = new BreakBefore({
          targetType: this.break.before,
          target: this.break.beforeTarget,
          startNew: this.break.startNew.toString()
        });
        node[$globalData] = this[$globalData];
        this[$appendChild](node);
        this.breakBefore.push(node);
      }
      if (this.break.overflowTarget !== "") {
        const node = new Overflow({
          target: this.break.overflowTarget,
          leader: this.break.overflowLeader,
          trailer: this.break.overflowTrailer
        });
        node[$globalData] = this[$globalData];
        this[$appendChild](node);
        this.overflow.push(node);
      }
      this[$removeChild](this.break);
      this.break = null;
    }
    if (this.presence === "hidden" || this.presence === "inactive") {
      return HTMLResult.EMPTY;
    }
    if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) {
      warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");
    }
    if (this.breakBefore.children.length >= 1) {
      const breakBefore = this.breakBefore.children[0];
      if (handleBreak(breakBefore)) {
        return HTMLResult.breakNode(breakBefore);
      }
    }
    if (this[$extra]?.afterBreakAfter) {
      return HTMLResult.EMPTY;
    }
    fixDimensions(this);
    const children = [];
    const attributes = {
      id: this[$uid],
      class: []
    };
    setAccess(this, attributes.class);
    if (!this[$extra]) {
      this[$extra] = Object.create(null);
    }
    Object.assign(this[$extra], {
      children,
      line: null,
      attributes,
      attempt: 0,
      numberInLine: 0,
      availableSpace: {
        width: Math.min(this.w || Infinity, availableSpace.width),
        height: Math.min(this.h || Infinity, availableSpace.h


deletes {
		if _, ok := existing[tupleUtils.TupleKeyToString(tk)]; !ok {
			// If the tuple does not exist, we can not delete it.
			switch opts.OnMissingDelete {
			case storage.OnMissingDeleteIgnore:
				continue
			case storage.OnMissingDeleteError:
				fallthrough
			default:
				return storage.InvalidWriteInputError(
					tk,
					openfgav1.TupleOperation_TUPLE_OPERATION_DELETE,
				)
			}
		}

		id := ulid.MustNew(ulid.Timestamp(now), entropy).String()
		objectType, objectID := tupleUtils.SplitObject(tk.GetObject())
		userObjectType, userObjectID, userRelation := tupleUtils.ToUserParts(tk.GetUser())

		deleteConditions = append(deleteConditions, sq.Eq{
			"object_type":      objectType,
			"object_id":        objectID,
			"relation":         tk.GetRelation(),
			"user_object_type": userObjectType,
			"user_object_id":   userObjectID,
			"user_relation":    userRelation,
			"user_type":        tupleUtils.GetUserTypeFromUser(tk.GetUser()),
		})

		changeLogItems = append(changeLogItems, []interface{}{
			store,
			objectType,
			objectID,
			tk.GetRelation(),
			userObjectType,
			userObjectID,
			userRelation,
			"",
			nil, // Redact condition info for deletes since we only need the base triplet (object, relation, user).
			openfgav1.TupleOperation_TUPLE_OPERATION_DELETE,
			id,
			sq.Expr("datetime('subsec')"),
		})
	}

	writeItems := make([][]interface{}, 0, len(writes))

	// 5. For writes
	// a. If on_duplicate: error ( default behavior )
	// - Execute INSERTs as a single statement.
	//   On duplicate insert we’d get a CONSTRAINT VIOLATION error, return 400 Bad Request
	// b. If on_duplicate: ignore
	// - Based on the results from step 3.a, which identified and locked existing rows, the system will compare values to the ones we’re trying to insert
	// - On conflict ( values not identical ) - return an error 409 Conflict
	// - For rows that DO NOT exist in DB - create both INSERT tuple & INSERT changelog statements
	// c. Execute INSERTs as a single statement
	//   On error, return 409 Conflict
	for _, tk := range writes {
		if existingTuple, ok := existing[tupleUtils.TupleKeyToString(tk)]; ok {
			// If the tuple exists, we can not write it.
			switch opts.OnDuplicateInsert {
			case storage.OnDuplicateInsertIgnore:
				// If the tuple exists and the condition is the same, we can ignore it.
				// We need to use its serialized text instead of reflect.DeepEqual to avoid comparing internal values.
				if proto.Equal(existingTuple.GetKey().GetCondition(), tk.GetCondition()) {
					continue
				}
				// If tuple conditions are different, we throw an error.
				return storage.TupleConditionConflictError(tk)
			case storage.OnDuplicateInsertError:
				fallthrough
			default:
				return storage.InvalidWriteInputError(
					tk,
					openfgav1.TupleOperation_TUPLE_OPERATION_WRITE,
				)
			}
		}

		id := ulid.MustNew(ulid.Timestamp(now), entropy).String()
		objectType, objectID := tupleUtils.SplitObject(tk.GetObject())
		userObjectType, userObjectID, userRelation := tupleUtils.ToUserParts(tk.GetUser())

		conditionName, conditionContext, err := sqlcommon.MarshalRelationshipCondition(tk.GetCondition())
		if err != nil {
			return err
		}

		writeItems = append(writeItems, []interface{}{
			store,
			objectType,
			objectID,
			tk.


  hyphens: none;

  margin: 0;
  border: 0;
  padding: 0;
}

/* Inline code */
.answersPage :not(pre) > code[class*="language-"] {
  padding: 0.1rem;
  border-radius: 0.3rem;
  white-space: normal;
}

.answersPage .token.comment,
.answersPage .token.prolog,
.answersPage .token.doctype,
.answersPage .token.cdata {
  color: var(--text-subtle);
}

.answersPage .token.punctuation {
  color: var(--code-syntax-punctuation);
}

.answersPage .namespace {
  opacity: 0.7;
}

.answersPage .token {
  color: var(--code-syntax-normal);
}

.answersPage .token url {
  text-decoration-color: var(--code-syntax-underline);
}

.answersPage .token.punctuation {
  color: var(--code-syntax-punctuation);
}

.answersPage .token.keyword,
.answersPage .token.operator,
.answersPage .token.function,
.answersPage .token.class-name {
  color: var(--code-syntax-keyword);
}

.answersPage .token.keyword {
  font-weight: bold;
}

.answersPage .token.literal,
.answersPage .token.number,
.answersPage .token.string,
.answersPage .token.triple-quoted-string,
.answersPage .token.boolean {
  color: var(--code-syntax-literals);
}

.answersPage .token.comment {
  color: var(--text-subtle);
}

.answersPage .token.important,
.answersPage .token.bold {
  font-weight: bold;
}
.answersPage .token.italic {
  font-style: italic;
}

.answersPage .token.entity {
  cursor: help;
}
ul.tagit {
    overflow: auto;
    margin-left: inherit; /* usually we don't want the regular ul margins. */
    margin-right: inherit;
}
ul.tagit li {
    display: block;
    float: left;
    margin: 2px 5px 2px 0;
}
ul.tagit li.tagit-choice {
    position: relative;
    line-height: inherit;
}
input.tagit-hidden-field {
    display: none;
}
ul.tagit li.tagit-choice-read-only {
    padding: .2em .5em .2em .5em;
}

ul.tagit li.tagit-choice-editable {
    padding: .2em 18px .2em .5em;
}

ul.tagit li.tagit-new {
    padding: .25em 4px .25em 0;
}

ul.tagit li.tagit-choice a.tagit-label {
    cursor: pointer;
    text-decoration: none;
}
ul.tagit li.tagit-choice .tagit-close {
    cursor: pointer;
    position: absolute;
    right: .1em;
    top: 50%;
    margin-top: -8px;
    line-height: 17px;
}

/* used for some custom themes that don't need image icons */
ul.tagit li.tagit-choice .tagit-close .text-icon {
    display: none;
}

ul.tagit li.tagit-choice input {
    display: block;
    float: left;
    margin: 2px 5px 2px 0;
}
ul.tagit input[type="text"] {
    -moz-box-sizing:    border-box;
    -webkit-box-sizing: border-box;
    box-sizing:         border


scaling factor as needed */
  }
  100% {
      stroke-width: 1;
      transform: scale(1);
  }
}

@keyframes pulse-wobble {
  0% {
      stroke-width: 1;
      transform: scale(1) rotateZ(-30deg);
  }
  50% {
      stroke-width: 3; /* Adjust the stroke width for different effect */
      transform: scale(1.2) rotateZ(0deg); /* Adjust the scaling factor as needed */
  }
  100% {
      stroke-width: 1;
      transform: scale(1) rotateZ(-30deg);
  }
}

.slide-container > svg,
.col > svg {
  width: 100%;
  height: auto;
}

.highlight-li-last li {
  &.visible {
    opacity: 0.5 !important;
  }
  &.visible.current-fragment {
    opacity: 1 !important;
  }
}

mark.squiggle {
  background: none; /* Remove default highlighting */
  text-decoration: underline wavy #FF0000aa 3px; /* Add red squiggle underline */
}

.text-center {
  text-align: center;
}
.reveal .slide-logo {
  display: block;
  position: fixed;
  bottom: 0;
  right: 12px;
  max-height: 2.2rem;
  height: 100%;
  width: auto;
  z-index: 2;
}

.reveal .footer {
  display: block;
  position: fixed;
  bottom: 18px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  font-size: 18px;
  z-index: 2;
}

.reveal .footer > * {
  margin-top: 0;
  margin-bottom: 0;
}

.reveal .slide .footer {
  display: none;
}

.reveal .slide-number {
  bottom: 10px;
  right: 10px;
  font-size: 16px;
  background-color: transparent;
}

.reveal.has-logo .slide-number {
  bottom: initial;
  top: 8px;
  right: 8px;
}

.reveal .slide-number .slide-number-delimiter {
  margin: 0;
}

.reveal .slide-menu-button {
  left: 8px;
  bottom: 8px;
}

.reveal .slide-chalkboard-buttons {
  position: fixed;
  left: 12px;
  bottom: 8px;
  z-index: 30;
  font-size: 24px;
}

.reveal .slide-chalkboard-buttons.slide-menu-offset {
  left: 54px;
}

.reveal .slide-chalkboard-buttons > span {
  margin-right: 14px;
  cursor: pointer;
}

@media screen and (max-width: 800px) {
  .reveal .slide-logo {
    max-height: 1.1rem;
    bottom: -2px;
    right: 10px;
  }
  .reveal .footer {
    font-size: 14px;
    bottom: 12px;
  }
  .reveal .slide-number {
    font-size: 12px;
    bottom: 7px;
  }
  .reveal .slide-menu-button .fas::before {
    height: 1.3rem;
    width: 1.3rem;
    vertical-align: -0.125em;
    background-size: 1.3rem 1.3rem;
  }

  .reveal .slide-chalkboard-buttons .fas::before {
    height: 0.95rem;
    width: 0.95rem;
    background-size: 0.95rem 0.95rem;
    vertical-align: -0em;
  }

  .reveal .


name = "Volans Greaves" , enl = "volans greaves", model = 20508}
models.feet[15348] = { name = "Mountain Gaiters" , enl = "mountain gaiters", model = 20501}
models.feet[15349] = { name = "Rutter Sabatons" , enl = "rutter sabatons", model = 20502}
models.feet[15350] = { name = "Rostrum Pumps" , enl = "rostrum pumps", model = 20611}
models.feet[15351] = { name = "Bounding Boots" , enl = "bounding boots", model = 20486}
models.feet[15352] = { name = "Ftr. Calligae +1" , enl = "fighter's calligae +1", model = 20544}
models.feet[15353] = { name = "Tpl. Gaiters +1" , enl = "temple gaiters +1", model = 20546}
models.feet[15354] = { name = "Hlr. Duckbills +1" , enl = "healer's duckbills +1", model = 20548}
models.feet[15355] = { name = "Wzd. Sabots +1" , enl = "wizard's sabots +1", model = 20550}
models.feet[15356] = { name = "Wlk. Boots +1" , enl = "warlock's boots +1", model = 20552}
models.feet[15357] = { name = "Rog. Poulaines +1" , enl = "rogue's poulaines +1", model = 20554}
models.feet[15358] = { name = "Glt. Leggings +1" , enl = "gallant leggings +1", model = 20556}
models.feet[15359] = { name = "Chs. Sollerets +1" , enl = "chaos sollerets +1", model = 20568}
models.feet[15360] = { name = "Bst. Gaiters +1" , enl = "beast gaiters +1", model = 20560}
models.feet[15361] = { name = "Chl. Slippers +1" , enl = "choral slippers +1", model = 20562}
models.feet[15362] = { name = "Htr. Socks +1" , enl = "hunter's socks +1", model = 20564}
models.feet[15363] = { name = "Myn. Sune-Ate +1" , enl = "myochin sune-ate +1", model = 20566}
models.feet[15364] = { name = "Nin. Kyahan +1" , enl = "ninja kyahan +1", model = 20568}
models.feet[15365] = { name = "Drn. Greaves +1" , enl = "drachen greaves +1", model = 20570}
models.feet[15366] = { name = "Evk. Pigaches +1" , enl = "evoker's pigaches +1", model = 20572}
models.feet[15661] = { name = "Homam Gambieras" , enl = "homam gambieras", model = 20639}
models.feet[15662] = { name = "Nashira Crackows" , enl = "nashira crackows", model = 20640}
models.feet[15663] = { name = "Crow Gaiters" , enl = "crow gaiters", model = 20642}
models.feet[15664] = { name = "Raven Gaiters" , enl = "raven gaiters", model = 20642}
models.feet[15665] = { name = "War. Calligae +1" , enl = "warrior's calligae +1", model = 20545}
models.feet[15666] = { name = "Mel. Gaiters +1" , enl = "melee gaiters +1", model = 20547}
model


Response,
        message: result.details ?? result.message));

      return;
    }
    handler.next(response);
  }
}import 'package:json_annotation/json_annotation.dart';

part 'auth.g.dart';

/// 企业平台认证请求承载体
@JsonSerializable()
class PortalTokenRequest extends TokenRequest {
  PortalTokenRequest({
    required clientId,
    clientSecret,
    required this.userName,
    required this.password,
    this.enterpriseId,
  }) : super(
    grantType: 'portal',
    clientId: clientId,
    clientSecret: clientSecret,
  );
  /// 用户名
  @JsonKey(name: 'username')
  String userName;
  /// 密码
  @JsonKey(name: 'password')
  String password;
  /// 双因素认证提供者
  @JsonKey(name: 'enterpriseId')
  String? enterpriseId;

  @override
  String toFormUrlencodedData() {
    return '${super.toFormUrlencodedData()}&enterpriseId=${enterpriseId ?? ''}&username=$userName&password=$password';
  }

  factory PortalTokenRequest.fromJson(Map<String, dynamic> json) => _$PortalTokenRequestFromJson(json);

  Map<String, dynamic> toJson() => _$PortalTokenRequestToJson(this);
}

/// 双因素身份认证手机认证请求承载体
@JsonSerializable()
class TwoFactorPhoneNumberTokenRequest extends PhoneNumberTokenRequest {
  TwoFactorPhoneNumberTokenRequest({
    required super.clientId,
    super.clientSecret,
    required super.phoneNumber,
    required super.code,
    required this.twoFactorProvider,
    required this.twoFactorCode,
  });
  /// 双因素认证提供者
  @JsonKey(name: 'twoFactorProvider')
  String twoFactorProvider;
  /// 双因素认证验证码
  @JsonKey(name: 'twoFactorCode')
  String twoFactorCode;

  @override
  String toFormUrlencodedData() {
    return '${super.toFormUrlencodedData()}&phone_number=$phoneNumber&phone_verify_code=$code&twoFactorProvider=twoFactorProvider&twoFactorCode=$twoFactorCode';
  }

  factory TwoFactorPhoneNumberTokenRequest.fromJson(Map<String, dynamic> json) => _$TwoFactorPhoneNumberTokenRequestFromJson(json);

  @override
  Map<String, dynamic> toJson() => _$TwoFactorPhoneNumberTokenRequestToJson(this);
}

/// 身份认证手机验证请求承载体
@JsonSerializable()
class PhoneNumberTokenRequest extends TokenRequest {
  PhoneNumberTokenRequest({
    required clientId,
    clientSecret,
    required this.phoneNumber,
    required this.code,
  }) : super(grantType: 'phone_verify', clientId: clientId, clientSecret: clientSecret);
  /// 手机号
  // ignore: non_constant_identifier_names
  @JsonKey(name: 'phone_number')
  late String phoneNumber;
  /// 验证码
  // ignore: non_constant_identifier_names
  @JsonKey(name: 'phone_verify_code')
  late String code;

  @override
  String toFormUrlencodedData() {
    return '${super.toFormUrlencodedData()}&phone_number=$phoneNumber&phone_verify_code=$code';
  }

  factory PhoneNumberTokenRequest.fromJson(Map<String, dynamic> json) => _$PhoneNumberTokenRequestFromJson(json);
  Map<String, dynamic> toJson() => _$PhoneNumberTokenRequestToJson(this);
}

/// 双因素身份认证密码认证请求承载体
@JsonSerializable()
class TwoFactorPasswordTokenRequest extends PasswordTokenRequest {


mage">
    部署成功点击确认

2.设置tomcat模板方法二

2.1.打开设置 CTRL + ALT + S 或者 点击file->settings

    配置tomcat

2.2.搜索server -> application server -> '+'

 application server -> +" src="http://img.555519.xyz/uploads3/20220604/25eb13371775165e3e23c273dbf84312.jpg">
    搜索server -> application server -> +

2.3.选择Tomcat '家'目录

2.4.二次确认

1.添加项目的运行服务

<img decoding="async" alt="为项目添加运行服务" class="has" src="http://img.555519.xyz/uploads3/20220604/a3b290d7e


%tick
	wr	%g0, 0xf8, %tick_cmpr
	wr	%g0, 0xf7, %sys_tick_cmpr
	wrhpr	%g0, 0xd2, %hsys_tick_cmpr
	.word 0x81982ec1  ! 9149: WRHPR_HPSTATE_I	wrhpr	%r0, 0x0ec1, %hpstate
	.word 0xb9ece1bb  ! 9150: RESTORE_I	restore	%r19, 0x0001, %r28
	.word 0xb7ece02c  ! 9153: RESTORE_I	restore	%r19, 0x0001, %r27
	.word 0xbc1420ba  ! 9155: OR_I	or 	%r16, 0x00ba, %r30
	.word 0xb3ecc000  ! 9157: RESTORE_R	restore	%r19, %r0, %r25
	.word 0xb1a58940  ! 9158: FMULd	fmuld	%f22, %f0, %f24
	.word 0xb8b4e09e  ! 9160: SUBCcc_I	orncc 	%r19, 0x009e, %r28
T2_hwint_1202:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_1202), 16, 16)) -> intp(2, 0, a)
	.word 0xb6c52050  ! 9164: ADDCcc_I	addccc 	%r20, 0x0050, %r27
	.word 0xb6ace0ba  ! 9165: ANDNcc_I	andncc 	%r19, 0x00ba, %r27
	.word 0xbb2c5000  ! 9169: SLLX_R	sllx	%r17, %r0, %r29
	.word 0xbde5e1c6  ! 9170: SAVE_I	save	%r23, 0x0001, %r30
	.word 0xbba5c840  ! 9173: FADDd	faddd	%f54, %f0, %f60
	.word 0xbded4000  ! 9174: RESTORE_R	restore	%r21, %r0, %r30
	.word 0xb3e5c000  ! 9177: SAVE_R	save	%r23, %r0, %r25
	.word 0xb1a44920  ! 9178: FMULs	fmuls	%f17, %f0, %f24
	.word 0xbd3c7001  ! 9179: SRAX_I	srax	%r17, 0x0001, %r30
	.word 0xbba5c960  ! 9180: FMULq	dis not found

T2_hwint_1203:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_1203), 16, 16)) -> intp(2, 0, 3a)
	.word 0xb024e003  ! 9182: SUB_I	sub 	%r19, 0x0003, %r24
T2_hwint_1204:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_1204), 16, 16)) -> intp(2, 0, 31)
	.word 0xb7e5c000  ! 9185: SAVE_R	save	%r23, %r0, %r27
T2_hwint_1205:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_1205), 16, 16)) -> intp(2, 0, 32)
	.word 0xbead601f  ! 9187: ANDNcc_I	andncc 	%r21, 0x001f, %r31
T2_irf_ce_763:
!$EV error(2,expr(@VA(.MAIN.T2_irf_ce


# Part 10 - the goal of this script is to look at how the max diff
# increases along depth, in part9 we had max diff of 0.02 for a single
# block with standard normal distribution on inputs
# %%
%load_ext autoreload
%autoreload 2

# %%
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import jax
from part4_preliminary_qwemma_forward_pass import *
from part6_qwemma_rmsnorm_module import t2j, j2t_bfloat16
import torch
import gemma
import treescope
# %%
qwen_hf_model_name = "Qwen/Qwen3-0.6B"
qwen_hf_tokenizer = AutoTokenizer.from_pretrained(qwen_hf_model_name)
qwen_hf_model_inputs = qwen_hf_tokenizer(["hi there how are"], return_tensors="pt", padding=True)
qwen_hf_model = AutoModelForCausalLM.from_pretrained(qwen_hf_model_name)
# %%
qwen_hf_outputs = qwen_hf_model(**qwen_hf_model_inputs, output_hidden_states=True)
# %%
treescope.show(qwen_hf_outputs['hidden_states'])
# %%
hf_hiddens_j = jax.tree_util.tree_map(lambda tensor: t2j(tensor), qwen_hf_outputs['hidden_states'])
treescope.show(hf_hiddens_j)
# %%
out_qwemma = do_jax_forward_pass(qwemmaprompt_input_ids, model_qwemma, qwemma_params)
# %%
treescope.show(out_qwemma[1])
# %%
out_qwemma[1]['intermediates']['layer_0']['__call__'][0][1]
# %%
treescope.show(hf_hiddens_j)
# %%
len(hf_hiddens_j)
# %%
# %%
qwen_hf_model.model.layers[0].input_layernorm.weight.data
# %%
qwemma_params['layer_0']['pre_attention_norm']['scale']
# %%

# %%
#print(out_qwemma)
# %%
#treescope.show(out_qwemma[1])
# %%
#treescope.show(out_qwemma[1]['intermediates'])
# %%
#qwemma_R_s0 = out_qwemma[1]['intermediates']['layer_0']['__call__'][0][1]
# %%
#qwen_hf_R_s1 = jax.dlpack.from_dlpack(qwen_hf_outputs.hidden_states[1].detach())

# %%
#qwen_hf_R_s1
# %%
# Step 3
# Gemma-codebase rescales the embeddings
# modules.py ~line100: x *= jnp.sqrt(self.embed_dim).astype(x.dtype)
# Now added a setting

# Step 4 Pre-attention normalization should agree


(
                  clipper: _BadgeClipper(
                    badgeAlignment ?? AlignmentDirectional.topEnd,
                    badgeSize,
                    context.directionality,
                  ),
                  child: IconTheme.merge(
                    data: IconThemeData(size: size),
                    child: icon,
                  ),
                ),
                CustomSingleChildLayout(
                  delegate: _BadgeLayoutDelegate(
                    badgeAlignment ?? AlignmentDirectional.topEnd,
                    context.directionality,
                  ),
                  child: SizedBox.fromSize(
                    size: Size.square(badgeSize),
                    child: IconTheme.merge(
                      data: IconThemeData(size: badgeSize),
                      child: badgeIcon!,
                    ),
                  ),
                ),
              ],
            )
          : SizedBox.fromSize(
              size: Size.square(size),
              child: IconTheme.merge(
                data: IconThemeData(size: size),
                child: icon,
              ),
            ),
    );
  }
}

class _BadgeClipper extends CustomClipper<Path> {
  final AlignmentGeometry alignment;
  final double size;
  final TextDirection direction;

  _BadgeClipper(
    this.alignment,
    this.size,
    this.direction,
  );

  @override
  Path getClip(Size _size) {
    final resolvedAlignment = alignment.resolve(direction);
    final halfWidth = _size.width / 2;
    final halfHeight = _size.height / 2;

    final x = resolvedAlignment.x * halfWidth + halfWidth;
    final y = resolvedAlignment.y * halfHeight + halfHeight;

    final xAdjust = size / 2 * resolvedAlignment.x;
    final yAdjust = size / 2 * resolvedAlignment.y;
    final xInset = size / 4 * resolvedAlignment.x;
    final yInset = size / 4 * resolvedAlignment.y;

    return Path.combine(
      PathOperation.difference,
      Path()..addRect(Offset.zero & _size),
      Path()
        ..addOval(
          Rect.fromCircle(
            center: Offset(x - xAdjust + xInset, y - yAdjust + yInset),
            radius: size / 2 + size / 16,
          ),
        ),
    );
  }

  @override
  bool shouldReclip(_BadgeClipper old) {
    return alignment != old.alignment || size != old.size;
  }
}

class _BadgeLayoutDelegate extends SingleChildLayoutDelegate {
  final AlignmentGeometry alignment;
  final TextDirection direction;

  _BadgeLayoutDelegate(
    this.alignment,
    this.direction,
  );

  @override
  Offset getPositionForChild(Size size, Size childSize) {
    final Alignment resolvedAlignment = alignment.resolve(direction);
    final double halfWidth = size.width / 2;
    final double halfHeight = size.height / 2;

    final double x = resolvedAlignment.x * halfWidth + halfWidth;
    final double y = resolvedAlignment.y * halfHeight + halfHeight


viousCompanionFrame.hasPendingTarget) and constants.GROUP_COMPANION_FRAME_OFFSET_Y or constants.GROUP_FRAME_OFFSET_Y
        end
        groupFrameAnchor:SetTarget(ZO_SmallGroupAnchorFrame)
        groupFrameAnchor:SetOffsets(0, previousOffsetY + previousSizeY)
        return groupFrameAnchor
    end
end

local function GetGroupAnchorFrameOffsets(subgroupIndex, groupStride, constants)
    groupStride = groupStride or NUM_SUBGROUPS
    local zeroBasedIndex = subgroupIndex - 1
    local row = zo_floor(zeroBasedIndex / groupStride)
    local column = zeroBasedIndex - (row * groupStride)

    return (constants.RAID_FRAME_BASE_OFFSET_X + (column * constants.RAID_FRAME_OFFSET_X)), (constants.RAID_FRAME_BASE_OFFSET_Y + (row * constants.RAID_FRAME_ANCHOR_CONTAINER_HEIGHT))
end

function ZO_UnitFrames_GetGroupAnchorFrameOffsets(subgroupIndex, groupStride, constants)
    return GetGroupAnchorFrameOffsets(subgroupIndex, groupStride, constants)
end

ZO_MostRecentPowerUpdateHandler = ZO_MostRecentEventHandler:Subclass()

do
    local function PowerUpdateEqualityFunction(existingEventInfo, unitTag, powerPoolIndex, powerType, powerPool, powerPoolMax)
        local existingUnitTag = existingEventInfo[1]
        local existingPowerType = existingEventInfo[3]
        return existingUnitTag == unitTag and existingPowerType == powerType
    end

    function ZO_MostRecentPowerUpdateHandler:New(namespace, handlerFunction)
        return ZO_MostRecentEventHandler.New(self, namespace, EVENT_POWER_UPDATE, PowerUpdateEqualityFunction, handlerFunction)
    end
end

--[[
    UnitFrames container object.  Used to manage the ZO_UnitFrameObject objects according to UnitTags ("group1", "group4pet", etc...)
--]]

ZO_UnitFrames_Manager = ZO_InitializingObject:Subclass()

function ZO_UnitFrames_Manager:Initialize()
    self.groupFrames = {}
    self.raidFrames = {}
    self.companionRaidFrames = {}
    self.staticFrames = {}
    self.groupSize = GetGroupSize()
    self.targetOfTargetEnabled = true
    self.groupAndRaidHiddenReasons = ZO_HiddenReasons:New()
    self.firstDirtyGroupIndex = nil
    self:UpdateCompanionGroupSize()
end

local function ApplyVisualStyleToAllFrames(frames)
    for _, unitFrame in pairs(frames) do
        unitFrame:ApplyVisualStyle()
    end
end

function ZO_UnitFrames_Manager:ApplyVisualStyle()
    ApplyVisualStyleToAllFrames(self.staticFrames)
    ApplyVisualStyleToAllFrames(self.groupFrames)
    ApplyVisualStyleToAllFrames(self.raidFrames)
    ApplyVisualStyleToAllFrames(self.companionRaidFrames)
end

function ZO_UnitFrames_Manager:GetUnitFrameLookupTable(unitTag)
    if unitTag then
        local isGroupTag = ZO_Group_IsGroupUnitTag(unitTag)
        local isCompanionTag = IsGroupCompanionUnitTag(unitTag)

        if isGroupTag or isCompanionTag then
            if self:GetCombinedGroupSize() <= STANDARD_GROUP_SIZE_THRESHOLD then
                return self.groupFrames
            else
                return isCompanionTag and self.companionRaidFrames or self.raidFrames
            end
        end
    end

    return self.staticFrames
end

function ZO_UnitFrames_Manager:GetFrame(unitTag)
    local unitFrameTable = self:GetUnitFrameLookupTable(unitTag)

    if unitFrameTable then
        return unitFrameTable[unitTag]
    end
end

function Z


pand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"find":{"find":"খোজো","findOptions":"Find Options","findWhat":"যা খুঁজতে হবে:","matchCase":"কেস মিলাও","matchCyclic":"Match cyclic","matchWord":"পুরা শব্দ মেলাও","notFoundMsg":"আপনার উল্লেখিত টেকস্ট পাওয়া যায়নি","replace":"রিপ্লেস","replaceAll":"সব বদলে দাও","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"যার সাথে বদলাতে হবে:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs নীচে","alignAbsMiddle":"Abs উপর","alignBaseline":"মূল রেখা","alignTextTop":"টেক্সট উপর","bgcolor":"বেকগ্রাউন্ড রং","chkFull":"Allow Fullscreen","chkLoop":"লূপ","chkMenu":"ফ্ল্যাশ মেনু এনাবল কর","chkPlay":"অটো প্লে","flashvars":"Variables for Flash","hSpace":"হরাইজন্টাল স্পেস","properties":"ফ্লাশ প্রোপার্টি","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"স্কেল","scaleAll":"সব দেখাও","scaleFit":"নিখুঁত ফিট","scaleNoBorder":"কোনো বর্ডার নেই","title":"ফ্ল্যাশ প্রোপার্টি","vSpace":"ভার্টিকেল স্পেস","validateHSpace":"HSpace must be a number.","validateSrc":"অনুগ্রহ করে URL লিংক টাইপ করুন","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"সাইজ","voiceLabel":"Font Size","panelTitle":"সাইজ"},"label":"ফন্ট","panelTitle":"ফন্ট","voiceLabel":"ফন্ট"},"forms":{"button":{"title":"বাটন প্রোপার্টি","text":"টেক্সট (ভ্যালু)","type":"প্রকার","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"চেক বক্স প্রোপার্টি","radioTitle":"রেডিও বাটন �


rstVowelIndex + 1);
      // console.log(`${currentWord}`, `${firstVowelIndex}`);

      if (firstVowelIndex === undefined) {
        sentenceToReturn.push(currentWord);
      } else {
        sentenceToReturn.push(prefix + suffix);
      }
    } else {
      const lastVowelIndex = getLastVowelIndex(currentWord);
      const prefix = currentWord.slice(0, lastVowelIndex);
      const suffix = currentWord.slice(lastVowelIndex + 1);
      sentenceToReturn.push(prefix + suffix);
    }
  }
  return sentenceToReturn.join(' ');
}

// console.log(alternating_vowel('panthers are great animals')); // "pnthers ar grat animls"
// console.log(alternating_vowel('running panthers are epic')); // "rnning panthrs re epc"
// console.log(alternating_vowel('code properly please')); // "cde proprly plase"
// console.log(alternating_vowel('my forecast predicts rain today')); // "my forecst prdicts ran tday"

/*
Write a method silly_talk that accepts a sentence as an
argument. The method should translate each word of the
sentence according to the following rules:

if the word ends with a vowel, simply repeat that vowel at the
end of the word (example: 'code'->'codee')
if the word ends with a non-vowel, every vowel of the word
should be followed by 'b' and that same vowel
(example: 'siren'->'sibireben')

*/
const vowels = new Set(['a', 'e', 'i', 'o', 'u']);

const getVowelIndices = (word: string) => {
  const chars = word.split('');
  let indices = [];

  for (let i = 0; i < chars.length; i++) {
    const currentChar = chars[i];
    if (vowels.has(currentChar)) {
      indices.push(i);
    }
  }

  return indices;
};

function silly_talk(sentence: string) {
  let sentenceToReturn = [];
  const words = sentence.split(' ');

  words.forEach((word) => {
    const lastCharOfWord = word[word.length - 1];
    if (vowels.has(lastCharOfWord)) {
      sentenceToReturn.push(word + lastCharOfWord);
    } else {
      // const vowelIndices = getVowelIndices(word);
      const chars = word.split('');
      let newWord = [];

      chars.forEach((char) => {
        if (vowels.has(char)) {
          newWord.push(char + 'b' + char);
        } else {
          newWord.push(char);
        }
      });
      sentenceToReturn.push(newWord.join(''));
    }
  });

  return sentenceToReturn.join(' ');
}

// console.log(silly_talk('Kids like cats and dogs')); // "Kibids likee cabats aband dobogs"
// console.log(silly_talk('Stop that scooter')); // "Stobop thabat scobooboteber"
// console.log(silly_talk('They can code')); // "Thebey caban codee"
// console.log(silly_talk('He flew to Italy')); // "Hee flebew too Ibitabaly"

/*
Write a method compress that accepts a string as an argument.
The method should return a "compressed" version of the
string where streaks of consecutive letters are translated
to a single appearance of the letter followed by the number
of times it appears in the streak. If a letter does not
form a streak (meaning that it appears alone), then do not
add a number after it.
*/

function compress(string: string) {


isableOnTourStartChanged));

        internal static IList<UIElement> AttachedElements { get; } = new List<UIElement>(10);

        internal static bool IsTourRunning { get; } = false;

        public static void SetDisableOnTourStart(UIElement dp, bool value)
        {
            dp.SetValue(DisableOnTourStartProperty, value);
        }

        public static bool GetDisableOnTourStart(UIElement dp)
        {
            return (bool)dp.GetValue(DisableOnTourStartProperty);
        }

        private static void OnDisableOnTourStartChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var tc = dependencyObject as UIElement;

            if (tc == null || !e.Property.Name.Equals(DisableOnTourStartProperty.Name))
            {
                return;
            }

            bool contains = AttachedElements.Contains(tc);
            var value = (bool)e.NewValue;

            if (!contains && value)
            {
                if (IsTourRunning)
                {
                    tc.IsEnabled = false;
                }

                AttachedElements.Add(tc);
            }

            if (contains && !value)
            {
                AttachedElements.Remove(tc);
            }
        }
    }
}


using System;
using UnityEngine;
using Random = UnityEngine.Random;

namespace Zenject.Asteroids
{
    public class ShipStateDead : ShipState
    {
        readonly SignalBus _signalBus;
        readonly BrokenShipFactory _brokenShipFactory;
        readonly ExplosionFactory _explosionFactory;
        readonly Settings _settings;
        readonly Ship _ship;

        GameObject _shipBroken;
        GameObject _explosion;

        public ShipStateDead(
            Settings settings, Ship ship,
            ExplosionFactory explosionFactory,
            BrokenShipFactory brokenShipFactory,
            SignalBus signalBus)
        {
            _signalBus = signalBus;
            _brokenShipFactory = brokenShipFactory;
            _explosionFactory = explosionFactory;
            _settings = settings;
            _ship = ship;
        }

        public override void Start()
        {
            _ship.MeshRenderer.enabled = false;

            _ship.ParticleEmitter.gameObject.SetActive(false);

            _explosion = _explosionFactory.Create().gameObject;
            _explosion.transform.position = _ship.Position;


| onClick  | `() => void`     | 菜单项的点击事件回调函数 |
| children | `MenuItemType[]` | 子菜单的子菜单项         |

### MenuDividerType

菜单分割线类型。

| 属性名 | 类型      | 描述                               |
| ------ | --------- | ---------------------------------- |
| dashed | `boolean` | 菜单分割线的样式是否为虚线         |
| type   | `string`  | 菜单分割线的类型，固定为 'divider' |
---
nav: 组件
group: 基础组件
title: Snippet 代码片段
---

# Snippet 代码片段

Snippet 组件用于显示带有语法突出显示的代码片段。可以在内容之前使用符号和语法突出显示的语言进行自定义。该组件还可以通过默认包含的 CopyButton 进行复制

## 代码演示

<code src="./demos/spotlight.tsx" nopadding title="聚光灯背景效果" description="你可以设置 `spotlight` 属性来开启聚光灯背景效果">

## APIs

| 参数      | 说明                   | 类型               | 默认值  |
| :-------- | :--------------------- | :----------------- | :------ |
| children  | 组件内显示的内容       | string             | -       |
| copyable  | 内容是否可以复制       | boolean            | true    |
| language  | 组件内容的语言         | string             | 'tsx'   |
| spotlight | 是否添加聚光灯背景效果 | boolean            | false   |
| symbol    | 组件内容前显示的符号   | string             | -       |
| type      | 组件的渲染类型         | 'ghost' \| 'block' | 'ghost' |
---
nav: Components
group: Basic
title: Snippet
---

# Snippet Code Snippet

The Snippet component is used to display code snippets with syntax highlighting. Customization can be done with symbols and syntax highlighting languages before the content. The component also supports copying through the included CopyButton by default.

## Code Demo

<code src="./demos/spotlight.tsx" nopadding title="Spotlight Background Effect" description="You can set the `spotlight` attribute to enable the spotlight background effect">

## APIs

| Property  | Description                                   | Type               | Default |
| :-------- | :-------------------------------------------- | :----------------- | :------ |
| children  | Content displayed in the component            | string             | -       |
| copyable  | Whether the content can be copied             | boolean            | true    |
| language  | Language of the component content             | string             | 'tsx'   |
| spotlight | Whether to add a spotlight background effect  | boolean            | false   |
| symbol    | Symbol displayed before the component content | string             | -       |
| type      | Rendering type of the component               | 'ghost' \| 'block' | 'ghost' |
---
title: ActionIcon 动作图标
group: 基础组件
atomId: ActionIcon
nav:
  title: 基础组件
  order: 2
demo:
  cols: 2
---

# ActionIcon 动作图标

对 antd Button 的封装，让图标具备按钮动作的响应式效果。

## 代码演示

<code src="./demos/basic.tsx" title=