 := sv.TopUpdateStart()
	defer sv.TopUpdateEnd(wupdt)

	updt := sv.UpdateStart()
	sort.Slice(sv.DraggedIdxs, func(i, j int) bool {
		return sv.DraggedIdxs[i] > sv.DraggedIdxs[j]
	})
	idx := sv.DraggedIdxs[0]
	for _, i := range sv.DraggedIdxs {
		sv.This().(SliceViewer).SliceDeleteAt(i, false)
	}
	sv.DraggedIdxs = nil
	sv.This().(SliceViewer).UpdateSliceGrid()
	sv.UpdateEnd(updt)
	sv.SelectIdxAction(idx, mouse.SelectOne)
}

// SaveDraggedIdxs saves selectedindexes into dragged indexes
// taking into account insertion at idx
func (sv *SliceViewBase) SaveDraggedIdxs(idx int) {
	sz := len(sv.SelectedIdxs)
	if sz == 0 {
		sv.DraggedIdxs = nil
		return
	}
	ixs := sv.SelectedIdxsList(false) // ascending
	sv.DraggedIdxs = make([]int, len(ixs))
	for i, ix := range ixs {
		if ix > idx {
			sv.DraggedIdxs[i] = ix + sz // make room for insertion
		} else {
			sv.DraggedIdxs[i] = ix
		}
	}
}

// DropBefore inserts object(s) from mime data before this node
func (sv *SliceViewBase) DropBefore(md mimedata.Mimes, mod dnd.DropMods, idx int) {
	sv.SaveDraggedIdxs(idx)
	sv.This().(SliceViewer).PasteAtIdx(md, idx)
	sv.DragNDropFinalize(mod)
}

// DropAfter inserts object(s) from mime data after this node
func (sv *SliceViewBase) DropAfter(md mimedata.Mimes, mod dnd.DropMods, idx int) {
	sv.SaveDraggedIdxs(idx + 1)
	sv.This().(SliceViewer).PasteAtIdx(md, idx+1)
	sv.DragNDropFinalize(mod)
}

// DropCancel cancels the drop action e.g., preventing deleting of source
// items in a Move case
func (sv *SliceViewBase) DropCancel() {
	sv.DragNDropFinalize(dnd.DropIgnore)
}

//////////////////////////////////////////////////////////////////////////////
//    Events

func (sv *SliceViewBase) StdCtxtMenu(m *gi.Menu, idx int) {
	if sv.isArray {
		return
	}
	m.AddAction(gi.ActOpts{Label: "Copy", Data: idx},
		sv.This(), func(recv, send ki.Ki, sig int64, data any) {
			svv := recv.Embed(KiT_SliceViewBase).(*SliceViewBase)
			svv.CopyIdxs(true)
		})
	m.AddAction(gi.ActOpts{Label: "Cut", Data: idx},
		sv.This(), func(recv, send ki.Ki, sig int64, data any) {
			svv := recv.Embed(KiT_SliceViewBase).(*SliceViewBase)
			svv.CutIdxs()
		})
	m.AddAction(gi.ActOpts{Label: "Paste", Data: idx},
		sv.This(), func(recv, send ki.Ki, sig int64, data any) {
			svv := recv.Embed(KiT_SliceViewBase).(*SliceViewBase)
			svv.PasteIdx(data.(int))
		})
	m.AddAction(gi.ActOpts{Label: "Duplicate", Data: idx},
		sv.This(), func(recv, send ki.Ki, sig int64, data any) {
			svv := recv.Embed(KiT_SliceViewBase).(*SliceViewBase)
			svv.Duplicate()
		})
}

func (sv *SliceViewBa


rning disable 1591 // Xml Comments
        public LocalizationScope BeginScope()
        {
            var scope = LocalizationScope.FromCurrentThread();

            CultureInfo.CurrentCulture = Configure.Instance.Culture;
            CultureInfo.CurrentUICulture = Configure.Instance.UICulture;

            return scope;
        }

        public void EndScope(LocalizationScope scope)
        {
            CultureInfo.CurrentCulture = scope.Culture;
            CultureInfo.CurrentUICulture = scope.UICulture;
        }
#pragma warning restore 1591 // Xml Comments
    }
}


rue)
joblib.dump({
    'fitted_model': fitted_model,
    'target_column': 'total_throughput',
    'last_train_timestamp': last_train_timestamp,
    'best_order': best_order,
    'features': exog_cols
}, MODEL_SAVE_PATH)

print(f"\nBest ARIMA Model: ARIMA{best_order} (lowest AIC = {best_aic:.2f}) saved to: {MODEL_SAVE_PATH}")

# === Forecast on test set ===
print("\nGenerating forecast for test set...")
forecast = fitted_model.forecast(steps=TEST_SIZE, exog=test_data[exog_cols])

# === Evaluation ===
y_true = test_data['total_throughput'].values
y_pred = forecast.values

mse = mean_squared_error(y_true, y_pred)
rmse = np.sqrt(mse)
mae = mean_absolute_error(y_true, y_pred)

print(f"\nBest ARIMA Model: ARIMA{best_order}")
print("Evaluation Metrics on Test Set:")
print(f" - MSE  : {mse:.4f}")
print(f" - RMSE : {rmse:.4f}")
print(f" - MAE  : {mae:.4f}")


lares the following functions with different call declarator.
// We don't need them. Just redefine them to nothing.
#define _interlockedbittestandset fake_set
#define _interlockedbittestandreset fake_reset
#define _interlockedbittestandset64 fake_set64
#define _interlockedbittestandreset64 fake_reset64
#include <intrin.h>

#define MFX_WAIT() SwitchToThread()

// static section of the file
namespace
{

enum
{
    MFX_SC_IS_FREE = 0,
    MFX_SC_IS_TAKEN = 1
};

} // namespace

namespace MFX
{

mfxU32 mfxInterlockedCas32(mfxCriticalSection *pCSection, mfxU32 value_to_exchange, mfxU32 value_to_compare)
{
    return _InterlockedCompareExchange(pCSection, value_to_exchange, value_to_compare);
}

mfxU32 mfxInterlockedXchg32(mfxCriticalSection *pCSection, mfxU32 value)
{
    return _InterlockedExchange(pCSection, value);
}

void mfxEnterCriticalSection(mfxCriticalSection *pCSection)
{
    while (MFX_SC_IS_TAKEN == mfxInterlockedCas32(pCSection,
                                                  MFX_SC_IS_TAKEN,
                                                  MFX_SC_IS_FREE))
    {
        MFX_WAIT();
    }
} // void mfxEnterCriticalSection(mfxCriticalSection *pCSection)

void mfxLeaveCriticalSection(mfxCriticalSection *pCSection)
{
    mfxInterlockedXchg32(pCSection, MFX_SC_IS_FREE);
} // void mfxLeaveCriticalSection(mfxCriticalSection *pCSection)

} // namespace MFX

#endif // #if defined(_WIN32) || defined(_WIN64)
/* ****************************************************************************** *\

Copyright (C) 2012-2014 Intel Corporation.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File Name: mfx_load_dll.cpp

\* ****************************************************************************** */

#if defined(_WIN32) || defined(_WIN64)

#include "mfx_dispatcher.h"
#include "mfx_load_dll.h"

#include <wchar.h>
#include <string.h>
#include <windows.h>

#if !defined(_DEBUG)

#if defined(_WIN64)
const
wchar_t * const defaultDLLName[2] = {L"libmfxhw64.dll",
                                     L"libmfxsw64.dll"};
const
wchar_t * const defaultAudioDLLName[2] = {L"libmfxaudiosw64.dll",
                                          L"libmfxaudiosw64.dll"};

const
wchar_t  * const defaultPluginDLLName[2] = {L"mfxplugin64_hw.dll",
                                            L"mfxplugin64_sw.


actObjectByID(obj.ID, func() bool {
				if !ctx.Data.PlayerUnit.Area.IsTown() {
					// Ensure area data is synced after portal transition
					utils.Sleep(500)
					ctx.RefreshGameData()

					if err := ensureAreaSync(ctx, ctx.Data.PlayerUnit.Area); err != nil {
						return false
					}
					return true
				}
				return false
			})
		}
	}

	return errors.New("portal not found")
}
package step

import (
	"fmt"
	"github.com/hectorgimenez/d2go/pkg/data"
	"github.com/hectorgimenez/d2go/pkg/data/area"
	"github.com/hectorgimenez/koolo/internal/context"
	"github.com/hectorgimenez/koolo/internal/game"
	"github.com/hectorgimenez/koolo/internal/utils"
	"time"
)

const (
	maxEntranceDistance = 6
	maxMoveRetries      = 3
)

func InteractEntrance(area area.ID) error {
	maxInteractionAttempts := 5
	interactionAttempts := 0
	waitingForInteraction := false
	currentMouseCoords := data.Position{}
	lastRun := time.Time{}

	ctx := context.Get()
	ctx.SetLastStep("InteractEntrance")

	for {
		ctx.PauseIfNotPriority()

		if ctx.Data.AreaData.Area == area && time.Since(lastRun) > time.Millisecond*500 && ctx.Data.AreaData.IsInside(ctx.Data.PlayerUnit.Position) {
			return nil
		}

		if interactionAttempts > maxInteractionAttempts {
			return fmt.Errorf("area %s [%d] could not be interacted", area.Area().Name, area)
		}

		if waitingForInteraction && time.Since(lastRun) < time.Millisecond*500 {
			continue
		}

		lastRun = time.Now()
		for _, l := range ctx.Data.AdjacentLevels {
			if l.Area == area {
				distance := ctx.PathFinder.DistanceFromMe(l.Position)
				if distance > maxEntranceDistance {
					// Try to move closer with retries
					for retry := 0; retry < maxMoveRetries; retry++ {
						if err := MoveTo(l.Position); err != nil {
							// If MoveTo fails, try direct movement
							screenX, screenY := ctx.PathFinder.GameCoordsToScreenCords(
								l.Position.X-2,
								l.Position.Y-2,
							)
							ctx.HID.Click(game.LeftButton, screenX, screenY)
							utils.Sleep(800)
							ctx.RefreshGameData()
						}

						// Check if we're close enough now
						newDistance := ctx.PathFinder.DistanceFromMe(l.Position)
						if newDistance <= maxEntranceDistance {
							break
						}

						if retry == maxMoveRetries-1 {
							return fmt.Errorf("entrance too far away (distance: %d)", distance)
						}
					}
				}

				if l.IsEntrance {
					lx, ly := ctx.PathFinder.GameCoordsToScreenCords(l.Position.X-1, l.Position.Y-1)
					if ctx.Data.HoverData.UnitType == 5 || ctx.Data.HoverData.UnitType == 2 && ctx.Data.HoverData.IsHovered {
						ctx.HID.Click(game.LeftButton, currentMouseCoords.X, currentMouseCoords.Y)
						waitingForInteraction = true


 math.asin(float(p[1])) / math.pi
            uvs[vertex_id, :] = np.array([u, v])
            vertex_id += 1

    # Generate indices by going through each triangle.
    # Duplicated vertex are mapped to the one with smaller index.
    indices = []
    for i in range(size): # height
        for j in range(size): # width
            left_top = i * (size + 1) + j
            right_top = i * (size + 1) + j + 1
            left_bottom = (i + 1) * (size + 1) + j
            right_bottom = (i + 1) * (size + 1) + j + 1
            # Wrap rule for octahedron topology
            if i == 0 and j >= half_size:
                if j > half_size:
                    left_top = i * (size + 1) + size - j
                right_top = i * (size + 1) + (size - (j + 1))
            elif i == size - 1 and j >= half_size:
                if j > half_size:
                    left_bottom = (i + 1) * (size + 1) + size - j
                right_bottom = (i + 1) * (size + 1) + (size - (j + 1))
                if j == size - 1:
                    right_bottom = 0
            elif j == 0 and i >= half_size:
                if i > half_size:
                    left_top = (size - i) * (size + 1) + j
                left_bottom = (size - (i + 1)) * (size + 1) + j
            elif j == size - 1 and i >= half_size:
                if i > half_size:
                    right_top = (size - i) * (size + 1) + j + 1
                right_bottom = (size - (i + 1)) * (size + 1) + j + 1

            # Left Top
            if i < half_size and j < half_size:
                indices.append((left_top, left_bottom, right_top))
                indices.append((right_top, left_bottom, right_bottom))
            # Right Top
            elif i < half_size and j >= half_size:
                indices.append((left_top, left_bottom, right_bottom))
                indices.append((left_top, right_bottom, right_top))
            # Left Bottom
            elif i >= half_size and j < half_size:
                indices.append((left_top, right_bottom, right_top))
                indices.append((left_top, left_bottom, right_bottom))
            # Right Bottom
            else:
                indices.append((left_top, left_bottom, right_top))
                indices.append((right_top, left_bottom, right_bottom))

    vertices = torch.tensor(vertices, dtype = torch.float32, device = device)
    uvs = torch.tensor(uvs, dtype = torch.float32, device = device)
    indices = torch.tensor(indices, dtype = torch.int32, device = device)
    return vertices, indices, uvs


= GetString("LangName", ci) }); // index 8

            //tr-TR
            ++orderIndex;
            ci = new CultureInfo("tr-TR");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 10

            //de-DE
            ++orderIndex;
            ci = new CultureInfo("de-DE");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 11

            //ru-RU
            ++orderIndex;
            ci = new CultureInfo("ru-RU");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 12

            //it-IT
            ++orderIndex;
            ci = new CultureInfo("it-IT");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 13

            //hi-IN
            ++orderIndex;
            ci = new CultureInfo("hi-IN");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 14

            //ar-SA
            ++orderIndex;
            ci = new CultureInfo("ar-SA");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 15

            //ur-PK
            ++orderIndex;
            ci = new CultureInfo("ur-PK");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 16

            //uz-Latn
            ++orderIndex;
            ci = new CultureInfo("uz-Latn");
            AllLangList.Add(orderIndex, new Lang() { Culture = ci, LangIndex = orderIndex, LangOrder = orderIndex, LangName = GetString("LangName", ci) }); // index 17

        }

        /// <summary>
        /// 初始化主要语言
        /// </summary>
        internal void InitialMainLang(string mainLangLists)
        {
            int orderIndex = 0;
            MainLangList.Clear();
            foreach (var item in mainLangLists.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
            {
                int index = int.Parse(item);
                CultureInfo ci = AllLangList[index].Culture;
                MainLangList.Add(index, new Lang() { Culture = ci, LangIndex = index, MainLangIndex = orderIndex, LangName = GetString("LangName", ci) }); // index 0
                ++orderIndex;
            }

            MainLangIndex = CurrentLangIndex;
        }

        private int _mainLangIndex;
        /// <summary>
        /// 获取主语言索引
        /// </summary>
        public int MainLangIndex
        {
            internal set
            {

                if (MainLangList.ContainsKey(CurrentLangIndex))
                    _mainLangIndex = MainLangList[CurrentLangIndex].MainLangIndex;
                // 否则返回主语言索引
                else
                    _mainLangIndex = MainLangList[0].MainLangIndex;
            }
            get
            {
                return _mainLangIndex;
            }
        }

        /// <summary>
        /// 主语言名称
        /// </summary>
        public Lang MainLang
        {
            internal set { }
            get
            {
                return MainLangList.FirstOrDefault(x => x.Value.MainLangIndex == MainLangIndex).Value;
            }
        }

        /// <summary>
        /// 根据语言名返回索引
        /// </summary>
        ///


er
import icu.windea.pls.lang.util.ParadoxInlineScriptManager
import icu.windea.pls.lang.util.ParadoxLocalisationManager
import icu.windea.pls.localisation.psi.ParadoxLocalisationParameter
import icu.windea.pls.localisation.psi.ParadoxLocalisationProperty
import icu.windea.pls.model.ParadoxDefinitionInfo
import icu.windea.pls.model.ParadoxFileInfo
import icu.windea.pls.model.ParadoxGameType
import icu.windea.pls.model.ParadoxLocalisationInfo
import icu.windea.pls.model.ParadoxRootInfo
import icu.windea.pls.model.indexInfo.ParadoxComplexEnumValueIndexInfo
import icu.windea.pls.script.psi.ParadoxScriptDefinitionElement
import icu.windea.pls.script.psi.ParadoxScriptScriptedVariable
import icu.windea.pls.script.psi.ParadoxScriptStringExpressionElement
import java.util.concurrent.atomic.AtomicReference

fun Char.isIdentifierChar(): Boolean {
    return StringUtil.isJavaIdentifierPart(this)
}

fun String.isIdentifier(vararg extraChars: Char): Boolean {
    return this.all { c -> c.isIdentifierChar() || c in extraChars }
}

fun String.isParameterAwareIdentifier(vararg extraChars: Char): Boolean {
    // 比较复杂的实现逻辑
    val fullRange = TextRange.create(0, this.length)
    val parameterRanges = ParadoxExpressionManager.getParameterRanges(this)
    val ranges = TextRangeUtil.excludeRanges(fullRange, parameterRanges)
    ranges.forEach f@{ range ->
        for (i in range.startOffset until range.endOffset) {
            if (i >= this.length) continue
            val c = this[i]
            if (c.isIdentifierChar() || c in extraChars) continue
            return false
        }
    }
    return true
}

fun String.isParameterized(conditionBlock: Boolean = true, full: Boolean = false): Boolean {
    return ParadoxExpressionManager.isParameterized(this, conditionBlock, full)
}

fun String.isInlineUsage(): Boolean {
    return this.equals(ParadoxInlineScriptManager.inlineScriptKey, true)
}

/**
 * 基于注解[WithGameType]判断目标对象是否支持当前游戏类型。
 */
fun ParadoxGameType?.supportsByAnnotation(target: Any): Boolean {
    if (this == null) return true
    val targetGameType = target.javaClass.getAnnotation(WithGameType::class.java)?.value
    return targetGameType == null || this in targetGameType
}

val Project.paradoxLibrary: ParadoxLibrary
    get() = this.getOrPutUserData(PlsKeys.library) { ParadoxLibrary(this) }

// 注意：不要更改直接调用CachedValuesManager.getCachedValue(...)的那个顶级方法（静态方法）的方法声明，IDE内部会进行检查
// 如果不同的输入参数得到了相同的输出值，或者相同的输入参数得到了不同的输出值，IDE都会报错

val VirtualFile.rootInfo: ParadoxRootInfo?
    get() = ParadoxCoreManager.getRootInfo(this)

val VirtualFile.fileInfo: ParadoxFileInfo?
    get() = ParadoxCoreManager.getFileInfo(this)

val PsiElement.fileInfo: ParadoxFileInfo?
    get() = ParadoxCoreManager.getFileInfo(this)

val ParadoxScriptDefinitionElement.definitionInfo: ParadoxDefinitionInfo?
    get() = ParadoxDefinitionManager.getInfo(this)

val ParadoxLocalisationProperty.localisationInfo: ParadoxLocalisationInfo?
    get() = ParadoxLocalisationManager.getInfo


ent has zero piece length")
	errZeroPieces       = errors.New("torrent has zero pieces")
	errPieceLength      = errors.New("piece length must be multiple of 16K")
)

// Info contains information about torrent.
type Info struct {
	PieceLength uint32
	Name        string
	Hash        [20]byte
	Length      int64
	NumPieces   uint32
	Bytes       []byte
	Private     bool
	Files       []File
	pieces      []byte
}

// File represents a file inside a Torrent.
type File struct {
	Length int64
	Path   string
	// https://www.bittorrent.org/beps/bep_0047.html
	Padding bool
}

type file struct {
	Length   int64    `bencode:"length"`
	Path     []string `bencode:"path"`
	PathUTF8 []string `bencode:"path.utf-8,omitempty"`
	Attr     string   `bencode:"attr"`
}

func (f *file) isPadding() bool {
	// BEP 0047
	if strings.ContainsRune(f.Attr, 'p') {
		return true
	}
	// BitComet convention that do not conform BEP 0047
	if len(f.Path) > 0 && strings.HasPrefix(f.Path[len(f.Path)-1], "_____padding_file") {
		return true
	}
	return false
}

type infoType struct {
	PieceLength uint32             `bencode:"piece length"`
	Pieces      []byte             `bencode:"pieces"`
	Name        string             `bencode:"name"`
	NameUTF8    string             `bencode:"name.utf-8,omitempty"`
	Private     bencode.RawMessage `bencode:"private"`
	Length      int64              `bencode:"length"` // Single File Mode
	Files       []file             `bencode:"files"`  // Multiple File mode
}

func (ib *infoType) overrideUTF8Keys() {
	if len(ib.NameUTF8) > 0 {
		ib.Name = ib.NameUTF8
	}
	for i := range ib.Files {
		if len(ib.Files[i].PathUTF8) > 0 {
			ib.Files[i].Path = ib.Files[i].PathUTF8
		}
	}
}

// NewInfo returns info from bencoded bytes in b.
func NewInfo(b []byte, utf8 bool, pad bool) (*Info, error) {
	var ib infoType
	if err := bencode.DecodeBytes(b, &ib); err != nil {
		return nil, err
	}
	if ib.PieceLength == 0 {
		return nil, errZeroPieceLength
	}
	if len(ib.Pieces)%sha1.Size != 0 {
		return nil, errInvalidPieceData
	}
	numPieces := len(ib.Pieces) / sha1.Size
	if numPieces == 0 {
		return nil, errZeroPieces
	}
	if utf8 {
		ib.overrideUTF8Keys()
	}
	// ".." is not allowed in file names
	for _, file := range ib.Files {
		for _, path := range file.Path {
			if strings.TrimSpace(path) == ".." {
				return nil, fmt.Errorf("invalid file name: %q", filepath.Join(file.Path...))
			}
		}
	}
	i := Info{
		PieceLength: ib.PieceLength,
		NumPieces:   uint32(numPieces),
		pieces:      ib.Pieces,
		Name:        ib.Name,
		Private:     parsePrivateField(ib.Private),
	}
	multiFile := len(ib.Files) > 0
	if multiFile {
		for _, f := range ib.Files {
			i.Length += f.Length
		}
	} else {
		i.Length = ib.Length
	}
	totalPieceDataLength := int64(i.PieceLength) * int64


ельзя.

Например:

```html run
<p id="elem"></p>

<script>
  var root = elem.createShadowRoot();
  root.innerHTML = "<span>Текущее время:</span> <input type='date'>";

  // выберет только span из #elem
  // вообще-то, должен выбрать span и из вложенных Shadow DOM,
  // но для встроенных элементов - не умеет
  alert( document.querySelectorAll('#elem::shadow span').length ); // 1
</script>
```
````

## Стиль в зависимости от хозяина

Следующие селекторы позволяют изнутри Shadow DOM выбрать внешний элемент ("элемент-хозяин"):

- `:host` выбирает элемент-хозяин, в котором, живёт Shadow DOM.

    Хозяин :host выбирается именно в контексте Shadow DOM.

    То есть, это доступ не к внешнему элементу, а, скорее, к корню текущего Shadow DOM.

    После `:host` мы можем указать селекторы и стили, которые нужно применить, если хозяин удовлетворяет тому или иному условию, например:

    ```html

    ```

    Этот селектор сработает для `<p>` первого уровня внутри Shadow DOM.
- `:host(селектор хозяина)` выбирает элемент-хозяин, если он подходит под селектор.

    Этот селектор используется для темизации хозяина "изнутри", в зависимости от его классов и атрибутов. Он отлично добавляет просто `:host`, например:

    ```css
    :host p {
      color: green;
    }

    :host(.important) p {
      color: red;
    }
    ```

    Здесь параграфы будут иметь `color:green`, но если у хозяина класс `.important`, то `color:red`.
- `:host-context(селектор хозяина)` выбирает элемент-хозяин, если какой-либо из его родителей удовлетворяет селектору, например:

    ```css
    :host-context(h1) p {
      /* селектор сработает для p, если хозяин находится внутри h1 */
    }
    ```

    Это используется для расширенной темизации, теперь уже не только в зависимости от его атрибутов, но и от того, внутри каких элементов он находится.

Пример использования селектора `:host()` для разной расцветки Shadow DOM-сообщения, в зависимости от того, в каком оно `<p>`:

```html run autorun="no-epub" no-beautify
*!*

Доброе утро, страна!

*/!*

*!*

Внимание-внимание! Говорит информбюро!

*/!*

<template id="tmpl">


': '🥓',
  'steak': '🥩',
  'pancakes': '🥞',
  'poultry_leg': '🍗',
  'meat_on_bone': '🍖',
  'fried_shrimp': '🍤',
  'fried_egg': '🍳',
  'hamburger': '🍔',
  'fries': '🍟',
  'stuffed_flatbread': '🥙',
  'hotdog': '🌭',
  'pizza': '🍕',
  'sandwich': '🥪',
  'canned_food': '🥫',
  'spaghetti': '🍝',
  'taco': '🌮',
  'burrito': '🌯',
  'green_salad': '🥗',
  'shallow_pan_of_food': '🥘',
  'ramen': '🍜',
  'stew': '🍲',
  'fish_cake': '🍥',
  'fortune_cookie': '🥠',
  'sushi': '🍣',
  'bento': '🍱',
  'curry': '🍛',
  'rice_ball': '🍙',
  'rice': '🍚',
  'rice_cracker': '🍘',
  'oden': '🍢',
  'dango': '🍡',
  'shaved_ice': '🍧',
  'ice_cream': '🍨',
  'icecream': '🍦',
  'pie': '🥧',
  'cake': '🍰',
  'birthday': '🎂',
  'custard': '🍮',
  'candy': '🍬',
  'lollipop': '🍭',
  'chocolate_bar': '🍫',
  'popcorn': '🍿',
  'dumpling': '🥟',
  'doughnut': '🍩',
  'cookie': '🍪',
  'milk_glass': '🥛',
  'beer': '🍺',
  'beers': '🍻',
  'clinking_glasses': '🥂',
  'wine_glass': '🍷',
  'tumbler_glass': '🥃',
  'cocktail': '🍸',
  'tropical_drink': '🍹',
  'champagne': '🍾',
  'sake': '🍶',
  'tea': '🍵',
  'cup_with_straw': '🥤',
  'coffee': '☕',
  'baby_bottle': '🍼',
  'spoon': '🥄',
  'fork_and_knife': '🍴',
  'plate_with_cutlery': '🍽',
  'bowl_with_spoon': '🥣',
  'takeout_box': '🥡',
  'chopsticks': '🥢',
  'soccer': '⚽',
  'basketball': '🏀',
  'football': '🏈',
  'baseball': '⚾',
  'tennis': '🎾',
  'volleyball': '🏐',
  'rugby_football': '🏉',
  '8ball': '🎱',
  'golf': '⛳',
  'golfing_woman': '🏌♀',
  'golfing_man': '🏌',
  'ping_pong': '🏓',
  'badminton': '🏸',
  'goal_net': '🥅',
  'ice_hockey': '🏒',
  'field_hockey': '🏑',
  'cricket': '🏏',
  'ski': '🎿'


: instruction requires: sme2
// CHECK-UNKNOWN: c1fa5409 <unknown>

sdot    za.s[w10, 1], {z0.h, z1.h}, {z26.h, z27.h}  // 11000001-11111010-01010100-00001001
// CHECK-INST: sdot    za.s[w10, 1, vgx2], { z0.h, z1.h }, { z26.h, z27.h }
// CHECK-ENCODING: [0x09,0x54,0xfa,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1fa5409 <unknown>

sdot    za.s[w8, 5, vgx2], {z22.h, z23.h}, {z30.h, z31.h}  // 11000001-11111110-00010110-11001101
// CHECK-INST: sdot    za.s[w8, 5, vgx2], { z22.h, z23.h }, { z30.h, z31.h }
// CHECK-ENCODING: [0xcd,0x16,0xfe,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1fe16cd <unknown>

sdot    za.s[w8, 5], {z22.h, z23.h}, {z30.h, z31.h}  // 11000001-11111110-00010110-11001101
// CHECK-INST: sdot    za.s[w8, 5, vgx2], { z22.h, z23.h }, { z30.h, z31.h }
// CHECK-ENCODING: [0xcd,0x16,0xfe,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1fe16cd <unknown>

sdot    za.s[w11, 2, vgx2], {z8.h, z9.h}, {z0.h, z1.h}  // 11000001-11100000-01110101-00001010
// CHECK-INST: sdot    za.s[w11, 2, vgx2], { z8.h, z9.h }, { z0.h, z1.h }
// CHECK-ENCODING: [0x0a,0x75,0xe0,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1e0750a <unknown>

sdot    za.s[w11, 2], {z8.h, z9.h}, {z0.h, z1.h}  // 11000001-11100000-01110101-00001010
// CHECK-INST: sdot    za.s[w11, 2, vgx2], { z8.h, z9.h }, { z0.h, z1.h }
// CHECK-ENCODING: [0x0a,0x75,0xe0,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1e0750a <unknown>

sdot    za.s[w9, 7, vgx2], {z12.h, z13.h}, {z10.h, z11.h}  // 11000001-11101010-00110101-10001111
// CHECK-INST: sdot    za.s[w9, 7, vgx2], { z12.h, z13.h }, { z10.h, z11.h }
// CHECK-ENCODING: [0x8f,0x35,0xea,0xc1]
// CHECK-ERROR: instruction requires: sme2
// CHECK-UNKNOWN: c1ea358f <unknown>

sdot    za.s[w9, 7], {z12.h, z13.h}, {z10.h, z11.h}  // 11000001-11101010-00110101-10001111
// CHECK-INST: sdot    za.s[w9, 7, vgx2], { z12.h, z13.h }, { z10.h, z11.h }
// CHECK-ENCODING


/*
 * Copyright (c) 1980 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#ifndef lint
static char sccsid[] = "@(#)out.c	5.4 (Berkeley) 6/1/90";
#endif /* not lint */

# include	"trek.h"

/*
**  Announce Device Out
*/

void out(dev)
int dev;
{
	register struct device	*d;

	d = &Device[dev];
	printf("%s reports %s ", d->person, d->name);
	if (d->name[length(d->name) - 1] == 's')
		printf("are");
	else
		printf("is");
	printf(" damaged\n");
}


 blocks[i].fill(0xff);
    }

    println!("block corrupted image (errors = {}/{}, {:.2}%):",
        3,
        blocks.len(),
        100.0 * (3.0 / (blocks.len() as f64)));
    println!();
    for line in dots(width+3*columns, &toimage(&blocks)) {
        println!("    {}", line);
    }
    println!();

    // find bad blocks by checking CRCs
    let bad_blocks = chcrcs(&blocks);
    // repair
    {
        let (r, blocks) = blocks.split_last_mut().unwrap();
        let (q, blocks) = blocks.split_last_mut().unwrap();
        let (p, blocks) = blocks.split_last_mut().unwrap();
        raid7_repair(blocks, p, q, r, &bad_blocks).unwrap();
    }
    // update CRCs
    mkcrcs(&mut blocks);

    println!("corrected:");
    println!();
    for line in dots(width+3*columns, &toimage(&blocks)) {
        println!("    {}", line);
    }
    println!();
}
// This file is auto-generated by rute_gen. DO NOT EDIT.
use rute_ffi_base::*;

#[allow(unused_imports)]
use auto::backing_store_ffi::RUBackingStore;
#[allow(unused_imports)]
use auto::cursor_ffi::RUCursor;
#[allow(unused_imports)]
use auto::font_ffi::RUFont;
#[allow(unused_imports)]
use auto::icon_ffi::RUIcon;
#[allow(unused_imports)]
use auto::layout_ffi::RULayout;
#[allow(unused_imports)]
use auto::margins_ffi::RUMargins;
#[allow(unused_imports)]
use auto::object_ffi::*;
#[allow(unused_imports)]
use auto::paint_device_ffi::*;
#[allow(unused_imports)]
use auto::paint_engine_ffi::RUPaintEngine;
#[allow(unused_imports)]
use auto::palette_ffi::RUPalette;
#[allow(unused_imports)]
use auto::pixmap_ffi::RUPixmap;
#[allow(unused_imports)]
use auto::point_ffi::RUPoint;
#[allow(unused_imports)]
use auto::rect_ffi::RURect;
#[allow(unused_imports)]
use auto::region_ffi::RURegion;
#[allow(unused_imports)]
use auto::size_ffi::RUSize;
#[allow(unused_imports)]
use auto::size_policy_ffi::RUSizePolicy;
#[allow(unused_imports)]
use auto::style_ffi::RUStyle;
#[allow(unused_imports)]
use auto::window_ffi::RUWindow;
#[allow(unused_imports)]
use std::os::raw::c_void;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct RUWidgetFuncs {
    pub destroy: extern "C" fn(self_c: *const RUBase),
    pub win_id: extern "C" fn(self_c: *const RUBase) -> u64,
    pub create_win_id: extern "C" fn(self_c: *const RUBase),
    pub internal_win_id: extern "C" fn(self_c: *const RUBase) -> u64,
    pub effective_win_id: extern "C" fn(self_c: *const RUBase) -> u64,
    pub style: extern "C" fn(self_c: *const RUBase) -> RUStyle,
    pub set_style: extern "C" fn(self_c: *const RUBase, arg0: *const RUBase),
    pub is_top_level: extern "C" fn(self_c: *const RUBase) -> bool,
    pub is_window: extern "C" fn(self_c: *const RUBase) -> bool,
    pub is_modal: extern "C" fn(self_c: *const RU


在地周围群众烧砖瓦建房被污蔑为资本主义黑烟包围公社，强行拆毁群众一幢新房（十一届三中全会后已平反赔偿）。

   1975年

   （八十九）县号召开展大打批修批资总体战

   8月16日，县委书记贺毅在县三级干部会议上，号召开展大打批修批资总体战运动（批判修正主义，批判资本主义，批判资产阶级法权）。在运动中抓住典型，推广经验，发动群众揭批，运用典型案例，组织巡回批斗。县直机关揭发了所谓“李家府”篡党阴谋，批判李守汉（县教育局局长），逮捕法办县劳动局局长李坚业（1979年12月27日县委撤销原对李坚业的处理决定，恢复党籍和公职），会后由贺毅、古顺权、周赞益分别带队前往大寨参观。当年大寨大队干部郭凤莲、耿长锁到上林“传经送宝”。

   （九十）县召开农业学大寨四级干部会议

   10月29日至11月5日，在全县召开全县农业学大寨四级干部会议。发动深入开展农业学大寨运动，参加会议的有县党委、县革委的全体委员，县贫协，工、青、妇委全体委员，公社、生产队的主要干部，上山下乡知识青年代表，县社下乡宣传队，县直属机关各有关部门领导，各战线的代表共5600人。会议学习中央领导关于农业学大寨的讲话，讨论县委提出《全党动员，全力以赴，苦战两年，为建成大寨县而奋斗》的决议。

   农业学大寨，搞所谓大批足大干，刮浮夸风，盲目蛮干，某些方面造成了人力物力的极大浪费。如调动大批民工、干部到澄泰修建三保水利，共耗费250万1000元（74年6万元，75年10万元，76年47万元，77年71万元，78年54万1千元，79年70万元），工程完工后，到目前未有效


 div.dt-autofill-button{border-bottom:none}div.dt-autofill-list ul li:hover{background-color:#f6f6f6}div.dt-autofill-list ul li:hover button.btn{background-color:#548bbb}div.dt-autofill-list div.dt-autofill-question{display:table-cell;padding:.5em 0;padding-left:5px;border-bottom:1px solid #ccc}div.dt-autofill-list div.dt-autofill-question input[type=number]{padding:6px;width:30px;margin:-2px 0}div.dt-autofill-list div.dt-autofill-button{display:table-cell;padding:.5em 0;padding-right:5px;border-bottom:1px solid #ccc;text-align:right}div.dtaf-popover-closeable{padding-top:2.5em}div.dt-autofill-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);background:radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);z-index:10}@media screen and (max-width: 767px){div.dt-autofill-handle{height:16px;width:16px}div.dt-autofill-list{width:90%;left:74.5%}}div.dt-autofill-list button{margin:0}
table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control{position:relative;padding-left:30px;cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before{top:50%;left:5px;height:14px;width:14px;margin-top:-9px;display:block;position:absolute;color:white;border:.15em solid white;border-radius:1em;box-shadow:0 0 .2em #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:"Courier New",Courier,monospace;line-height:1em;content:"+";background-color:#21ba45}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before{content:"-";background-color:#d33333}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control{padding-left:27px}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control:before{left:4px;height:14px;width:14px;border-radius:14px;line-height:14px;text-indent:3px}tabl


filterOnPet', true) --This is the line that matters. Without this, it sorts based on the owners name
	end,
	INDEX = function(header)
		header:SetAttribute('groupingOrder', '1,2,3,4,5,6,7,8')
		header:SetAttribute('sortMethod', 'INDEX')
		header:SetAttribute('groupBy', nil)
	end,
}

local POINT_COLUMN_ANCHOR_TO_DIRECTION = {
	TOPTOP = 'UP_RIGHT',
	BOTTOMBOTTOM = 'TOP_RIGHT',
	LEFTLEFT = 'RIGHT_UP',
	RIGHTRIGHT = 'LEFT_UP',
	RIGHTTOP = 'LEFT_DOWN',
	LEFTTOP = 'RIGHT_DOWN',
	LEFTBOTTOM = 'RIGHT_UP',
	RIGHTBOTTOM = 'LEFT_UP',
	BOTTOMRIGHT = 'UP_LEFT',
	BOTTOMLEFT = 'UP_RIGHT',
	TOPRIGHT = 'DOWN_LEFT',
	TOPLEFT = 'DOWN_RIGHT'
}

local DIRECTION_TO_POINT = {
	DOWN_RIGHT = 'TOP',
	DOWN_LEFT = 'TOP',
	UP_RIGHT = 'BOTTOM',
	UP_LEFT = 'BOTTOM',
	RIGHT_DOWN = 'LEFT',
	RIGHT_UP = 'LEFT',
	LEFT_DOWN = 'RIGHT',
	LEFT_UP = 'RIGHT',
	UP = 'BOTTOM',
	DOWN = 'TOP'
}

local DIRECTION_TO_GROUP_ANCHOR_POINT = {
	DOWN_RIGHT = 'TOPLEFT',
	DOWN_LEFT = 'TOPRIGHT',
	UP_RIGHT = 'BOTTOMLEFT',
	UP_LEFT = 'BOTTOMRIGHT',
	RIGHT_DOWN = 'TOPLEFT',
	RIGHT_UP = 'BOTTOMLEFT',
	LEFT_DOWN = 'TOPRIGHT',
	LEFT_UP = 'BOTTOMRIGHT',
	OUT_RIGHT_UP = 'BOTTOM',
	OUT_LEFT_UP = 'BOTTOM',
	OUT_RIGHT_DOWN = 'TOP',
	OUT_LEFT_DOWN = 'TOP',
	OUT_UP_RIGHT = 'LEFT',
	OUT_UP_LEFT = 'RIGHT',
	OUT_DOWN_RIGHT = 'LEFT',
	OUT_DOWN_LEFT = 'RIGHT',
}

local INVERTED_DIRECTION_TO_COLUMN_ANCHOR_POINT = {
	DOWN_RIGHT = 'RIGHT',
	DOWN_LEFT = 'LEFT',
	UP_RIGHT = 'RIGHT',
	UP_LEFT = 'LEFT',
	RIGHT_DOWN = 'BOTTOM',
	RIGHT_UP = 'TOP',
	LEFT_DOWN = 'BOTTOM',
	LEFT_UP = 'TOP',
	UP = 'TOP',
	DOWN = 'BOTTOM'
}

local DIRECTION_TO_COLUMN_ANCHOR_POINT = {
	DOWN_RIGHT = 'LEFT',
	DOWN_LEFT = 'RIGHT',
	UP_RIGHT = 'LEFT',
	UP_LEFT = 'RIGHT',
	RIGHT_DOWN = 'TOP',
	RIGHT_UP = 'BOTTOM',
	LEFT_DOWN = 'TOP',
	LEFT_UP = 'BOTTOM',
}

local DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER = {
	DOWN_RIGHT = 1,
	DOWN_LEFT = -1,
	UP_RIGHT = 1,
	UP_LEFT = -1,
	RIGHT_DOWN = 1,
	RIGHT_UP = 1,
	LEFT_DOWN = -1,
	LEFT_UP = -1,
}

local DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER = {
	DOWN_RIGHT = -1,
	DOWN_LEFT = -1,
	UP_RIGHT = 1,
	UP_LEFT = 1,
	RIGHT_DOWN = -1,
	RIGHT_UP = 1,
	LEFT_DOWN = -1,
	LEFT_UP = 1,
}

function UF:ConvertGroupDB(group)
	local db = UF.db.units[group.groupName]
	if db.point and db.columnAnchorPoint then
		db.growthDirection = POINT_COLUMN_ANCHOR_TO_DIRECTION[db.point..db.columnAnchorPoint]
		db.point = nil
		db.columnAnchorPoint = nil
	end

	if db.growthDirection == 'UP' or db.growthDirection == 'DOWN' then
		db.growthDirection = db.growthDirection..'_RIGHT'
	end
end

function UF:ResetAuraPriority()
	for unitName, content in pairs(E.db.unitframe.units) do
		local defaul


system, som er den teknologiske bedsteforældre til iOS, tvOS og selv watchOS.
- **watchOS** er navnet på Apples mindste operativsystem, og er ansvarlig for at køre native apps og også for at videregive notifikationer fra telefonen til uret.
- **Swift** er Apples moderne programmeringssprog som lader dig skrive apps for iOS, macOS og andre platforme. Det har funktionaliteten til at bygge programmer, men håndterer ikke ting som brugergrænseflader, audio (altså lyd) eller netværk.
- **Swift 1.2** var den første store opdatering til Swift. Diverse egenskaber ved sproget blev justeret og andre forbedret.
- **Swift 2** Swift 2 var den anden store opdatering af Swift. Her kom flere store forbedringer, herunder kontrolleret undtagelser (på engelsk: "checked exceptions").
- **Swift 2.2** var en mindre opdatering til Swift 2.0, hvor noget syntaks blev forældet forud for at det helt blev fjernet i Swift 3.
- **Swift 3** er den trejde større opdatering til Swift og bragte med sig et hav af navneændringer for at gøre det nemmere og mere naturligt at bruge sproget.
- **Swift 4** er den fjerde større opdatering til Swift, og fokuserede hovedsageligt på nye egenskaber der hjalp med at gøre sproget mere ekspressivt.
- **UIKit** er Apples værktøj til udvikling af brugergrænseflader. Det indeholder ting som knapper, tekstbokse, navigationskontroller samt mere, og du styrer det via Swift.
- **AppKit** er Apples værktøj til udvikling af brugergrænseflader til macOS. Ligesom UIKit indeholder det knapper, tekstbokse og mere med fokus på macOS i stedet for iOS.
- **WatchKit** er Apples værktøj til udvikling af brugergrænseflader til watchOS. Mens UIKit og AppKit har en del til fælles, er WatchKit væsentlig forskelligt - og væsentlig simplere.
- **Cocoa Touch** er navnet der normalt bruges til at beskrive Apples store samling af frameworks til iOS (et framework er en samling af kode der sammen løser et eller flere relaterede problemer. På dansk kalder nogle det for rammeværk, men vi vil bruge den engelske betegnelse da den er klart mest udbredt). Det inkluderer UIKit til at lave brugergrænseflader med, men de fleste vil også sige at der inkluderer SpriteKit til at lave 2D spil, SceneKit til at lave 3D spil, MapKit til kort, Core Graphics til at tegne mede, Core Animation til at animere ting, og meget mere.
- **Cocoa** er navnet brugt for Apples samling af frameworks på macOS. Strengt taget består det af AppKit for brugergrænseflade, Foundation for grundlæggende funktionalitet og Core Data for objektgrafer, men ligesom Cocoa Touch bruges det ofte i betydningen af "al macOS udvikling".
- **NeXTSTEP** er et operativsystem skabt af et firma kaldt NeXT som Steve Jobs grundlagde. Det blev købt af Apple, hvorved Jobs kom tilbage og kontrollerede firmaet, og satte NeXTSTEP-teknologi helt i centrum af Apples udviklingsplatform.
- **iOS Simulator** er et værktøj der kommer sam


//   					Metric: &MetricProperty{
//   						Dimensions: []interface{}{
//   							&DimensionProperty{
//   								Name: jsii.String("name"),
//   								Value: jsii.String("value"),
//   							},
//   						},
//   						MetricName: jsii.String("metricName"),
//   						Namespace: jsii.String("namespace"),
//   					},
//   					Period: jsii.Number(123),
//   					Stat: jsii.String("stat"),
//
//   					// the properties below are optional
//   					Unit: jsii.String("unit"),
//   				},
//   				ReturnData: jsii.Boolean(false),
//   			},
//   		},
//   	},
//   	OperationName: jsii.String("operationName"),
//   	TotalRequestCountMetric: []interface{}{
//   		&MetricDataQueryProperty{
//   			Id: jsii.String("id"),
//
//   			// the properties below are optional
//   			AccountId: jsii.String("accountId"),
//   			Expression: jsii.String("expression"),
//   			MetricStat: &MetricStatProperty{
//   				Metric: &MetricProperty{
//   					Dimensions: []interface{}{
//   						&DimensionProperty{
//   							Name: jsii.String("name"),
//   							Value: jsii.String("value"),
//   						},
//   					},
//   					MetricName: jsii.String("metricName"),
//   					Namespace: jsii.String("namespace"),
//   				},
//   				Period: jsii.Number(123),
//   				Stat: jsii.String("stat"),
//
//   				// the properties below are optional
//   				Unit: jsii.String("unit"),
//   			},
//   			ReturnData: jsii.Boolean(false),
//   		},
//   	},
//   }
//
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-requestbasedslimetric.html
//
type CfnServiceLevelObjective_RequestBasedSliMetricProperty struct {
	// Identifies the dependency using the `DependencyKeyAttributes` and `DependencyOperationName` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-requestbasedslimetric.html#cfn-applicationsignals-servicelevelobjective-requestbasedslimetric-dependencyconfig
	//
	DependencyConfig interface{} `field:"optional" json:"dependencyConfig" yaml:"dependencyConfig"`
	// This is a string-to-string map that contains information about the type of object that this SLO is related to.
	//
	// It can include the following fields.
	//
	// - `Type` designates the type of object that this SLO is related to.
	// - `ResourceType` specifies the type of the resource. This field is used only when the value of the `Type` field is `Resource` or `AWS::Resource` .
	// - `Name` specifies the name of the object. This is used only if the value of the `Type` field is `Service` , `RemoteService` , or `AWS::Service` .
	// - `Identifier` identifies the resource objects of this resource. This is used only if the value of the `Type` field is `Resource` or `AWS::Resource` .
	// - `Environment` specifies the location where this object is hosted, or what it belongs to.
	// - `AwsAccountId` allows you to create an SLO for an object that exists in another account.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-requestbasedslimetric.html#cfn-applicationsignals-servicelevelobjective-requestbasedslimetric-keyattributes
	//
	KeyAttributes interface{} `field:"optional" json:"keyAttributes" yaml:"keyAttributes"`
	// If the SLO monitors either the `LATENCY` or `AVAILABILITY` metric that Appl


      _sendRequest(lk_rtc.SignalRequest(
        updateLayers: lk_rtc.UpdateVideoLayers(
          trackSid: trackSid,
          layers: layers,
        ),
      ));

  @internal
  void sendUpdateSubscriptionPermissions({
    required bool allParticipants,
    required Iterable<lk_rtc.TrackPermission> trackPermissions,
  }) =>
      _sendRequest(lk_rtc.SignalRequest(
        subscriptionPermission: lk_rtc.SubscriptionPermission(
          allParticipants: allParticipants,
          trackPermissions: trackPermissions,
        ),
      ));

  @internal
  void sendLeave() => _sendRequest(lk_rtc.SignalRequest(
        leave: lk_rtc.LeaveRequest(),
      ));

  @internal
  void sendSyncState({
    required lk_rtc.SessionDescription? answer,
    required lk_rtc.UpdateSubscription subscription,
    required Iterable<lk_rtc.TrackPublishedResponse>? publishTracks,
    required Iterable<lk_rtc.DataChannelInfo>? dataChannelInfo,
  }) =>
      _sendRequest(lk_rtc.SignalRequest(
        syncState: lk_rtc.SyncState(
          answer: answer,
          subscription: subscription,
          publishTracks: publishTracks,
          dataChannels: dataChannelInfo,
        ),
      ));

  @internal
  void sendSimulateScenario({
    int? speakerUpdate,
    bool? nodeFailure,
    bool? migration,
    bool? serverLeave,
    bool? switchCandidate,
  }) =>
      _sendRequest(lk_rtc.SignalRequest(
        simulate: lk_rtc.SimulateScenario(
          speakerUpdate: speakerUpdate,
          nodeFailure: nodeFailure,
          migration: migration,
          serverLeave: serverLeave,
          switchCandidateProtocol: (switchCandidate != null && switchCandidate)
              ? lk_rtc.CandidateProtocol.TCP
              : null,
        ),
      ));
}

// private methods
extension on lk_rtc.SignalRequest {
  // returns if this request can be queued
  bool _canQueue() => ![
        // list of types that cannot be queued
        lk_rtc.SignalRequest_Message.syncState,
        lk_rtc.SignalRequest_Message.trickle,
        lk_rtc.SignalRequest_Message.answer,
        lk_rtc.SignalRequest_Message.simulate
      ].contains(whichMessage());
}

// internal methods
extension SignalClientInternalMethods on SignalClient {
  @internal
  void sendQueuedRequests() {
    // queue is empty
    if (_queue.isEmpty) return;
    // send requests
    for (final request in _queue) {
      _sendRequest(request, enqueueIfReconnecting: false);
    }
    _queue.clear();
  }

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

import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
import 'package:synchronized/synchronized.dart' as sync;

import '../hardware/hardware.dart';
import '../logger.dart';
import '../support/native.dart';
import '../support/native_audio.dart';
import '../support/platform.dart';
import 'local/local.dart';
import 'remote/remote.dart';

enum AudioTrackState {
  none,
  remoteOnly,
  localOnly,
  localAndRemote,
}

typedef ConfigureNat


=amount_wei * 10 if kind == OrderKind.BUY else 0,
            validTo=0,  # Valid for 1 hour
            appData={},
            feeAmount=0,
            kind="sell" if kind == OrderKind.SELL else "buy",  # `sell` or `buy`
            partiallyFillable=False,
            sellTokenBalance="erc20",  # `erc20`, `external` or `internal`
            buyTokenBalance="erc20",  # `erc20` or `internal`
        )

        quote = self.get_quote(order, NULL_ADDRESS)
        if "quote" in quote:
            result = cast(Dict[str, Any], quote)
            return {
                "buyAmount": int(result["quote"]["buyAmount"]),
                "sellAmount": int(result["quote"]["sellAmount"]),
            }
        else:
            error = cast(ErrorResponse, quote)
            return error


PARAM)
{
    MONITORINFO info = { 0 };
    info.cbSize = sizeof(MONITORINFO);
    if (!::GetMonitorInfo(monitor, &info))
        return TRUE;
    ImGuiPlatformMonitor imgui_monitor;
    imgui_monitor.MainPos = ImVec2((float)info.rcMonitor.left, (float)info.rcMonitor.top);
    imgui_monitor.MainSize = ImVec2((float)(info.rcMonitor.right - info.rcMonitor.left), (float)(info.rcMonitor.bottom - info.rcMonitor.top));
    imgui_monitor.WorkPos = ImVec2((float)info.rcWork.left, (float)info.rcWork.top);
    imgui_monitor.WorkSize = ImVec2((float)(info.rcWork.right - info.rcWork.left), (float)(info.rcWork.bottom - info.rcWork.top));
    imgui_monitor.DpiScale = ImGui_ImplWin32_GetDpiScaleForMonitor(monitor);
    ImGuiPlatformIO& io = ImGui::GetPlatformIO();
    if (info.dwFlags & MONITORINFOF_PRIMARY)
        io.Monitors.push_front(imgui_monitor);
    else
        io.Monitors.push_back(imgui_monitor);
    return TRUE;
}

static void ImGui_ImplWin32_UpdateMonitors()
{
    ImGui::GetPlatformIO().Monitors.resize(0);
    ::EnumDisplayMonitors(NULL, NULL, ImGui_ImplWin32_UpdateMonitors_EnumFunc, NULL);
    g_WantUpdateMonitors = false;
}

static void ImGui_ImplWin32_InitPlatformInterface()
{
    WNDCLASSEX wcex;
    wcex.cbSize = sizeof(WNDCLASSEX);
    wcex.style = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc = ImGui_ImplWin32_WndProcHandler_PlatformWindow;
    wcex.cbClsExtra = 0;
    wcex.cbWndExtra = 0;
    wcex.hInstance = ::GetModuleHandle(NULL);
    wcex.hIcon = NULL;
    wcex.hCursor = NULL;
    wcex.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
    wcex.lpszMenuName = NULL;
    wcex.lpszClassName = _T("ImGui Platform");
    wcex.hIconSm = NULL;
    ::RegisterClassEx(&wcex);

    ImGui_ImplWin32_UpdateMonitors();

    // Register platform interface (will be coupled with a renderer interface)
    ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
    platform_io.Platform_CreateWindow = ImGui_ImplWin32_CreateWindow;
    platform_io.Platform_DestroyWindow = ImGui_ImplWin32_DestroyWindow;
    platform_io.Platform_ShowWindow = ImGui_ImplWin32_ShowWindow;
    platform_io.Platform_SetWindowPos = ImGui_ImplWin32_SetWindowPos;
    platform_io.Platform_GetWindowPos = ImGui_ImplWin32_GetWindowPos;
    platform_io.Platform_SetWindowSize = ImGui_ImplWin32_SetWindowSize;
    platform_io.Platform_GetWindowSize = ImGui_ImplWin32_GetWindowSize;
    platform_io.Platform_SetWindowFocus = ImGui_ImplWin32_SetWindowFocus;
    platform_io.Platform_GetWindowFocus = ImGui_ImplWin32_GetWindowFocus;
    platform_io.Platform_GetWindowMinimized = ImGui_ImplWin32_GetWindowMinimized;
    platform_io.Platform_SetWindowTitle = ImGui_ImplWin32_SetWindowTitle;
    platform_io.Platform_SetWindowAlpha = ImGui_ImplWin32_SetWindowAlpha;
    platform_io.Platform_UpdateWindow = ImGui_ImplWin32_UpdateWindow;
    platform_io.Platform_GetWindowDpiScale = ImGui_ImplWin32_GetWindowDpiScale; // FIXME-DPI
    platform_io.Platform_OnChangedViewport = ImG


-picker-label:hover,.ql-snow.ql-toolbar .ql-picker .ql-picker-options .ql-picker-item.ql-selected,.ql-snow.ql-toolbar .ql-picker .ql-picker-options .ql-picker-item:hover{color:#06c}.ql-snow.ql-toolbar .ql-picker .ql-picker-label{background-color:#fff;background-position:right center;border:1px solid transparent;position:relative;width:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASBAMAAACk4JNkAAAAKlBMVEUAAABJSUlAQEBERERFRUVERERERERERERERERFRUVEREREREREREREREQJcW6NAAAADXRSTlMAFRzExcbLzM/Q0dLbKbcyLwAAADVJREFUCNdjYCAeMKYJQFnSdzdCWbl3r0NZvnev4tFre/cKlNV79yaUpXP3EJTFtEqBBHcAAHyoDQk0vM/lAAAAAElFTkSuQmCC)}.ql-snow.ql-toolbar .ql-picker .ql-picker-options{background-color:#fff;border:1px solid transparent;box-sizing:border-box;display:none;padding:4px 8px;position:absolute;width:100%}.ql-snow.ql-toolbar .ql-picker .ql-picker-options .ql-picker-item{background-position:center center;background-repeat:no-repeat;background-size:18px 18px;box-sizing:border-box;cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow.ql-toolbar .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc;color:#ccc;z-index:2;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAdElEQVR42mP4//8/VfBINGjVqlUMhw4dEj148OBpEAaxQWKkGgQz5BIQ/4fiSyAxkg2CuuQ/Gj5DjkFHsRh0jJwwwooHzCCQ145g8dpRcgw6j8WgCyQbtH//fhmgxttIhtwGiZETRjDDLoIwiA0UG820FGAA5b25+qRqGXcAAAAASUVORK5CYII=)}.ql-snow.ql-toolbar .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc;box-shadow:rgba(0,0,0,.2) 0 2px 8px;display:block;margin-top:-1px;z-index:1}.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-label{background-position:center center;width:28px}.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-options{padding:5px;width:152px}.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-options .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-options .ql-picker-item.ql-primary-color{margin-bottom:8px}.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-options .ql-picker-item.ql-selected,.ql-snow.ql-toolbar .ql-picker.ql-color-picker .ql-picker-options .ql-picker-item:hover{


 status of **global** AJAX requests. See the
`ajaxStatus` section to get more information about the component.

**Global vs Non-Global**

By default AJAX requests are global, meaning if there is an `ajaxStatus` component present on page, it
is triggered.

If you want to do a "silent" request not to trigger `ajaxStatus` instead, set `global` to `false`. An example
with `commandButton` would be;

```xhtml
<p:commandButton value="Silent" global="false" />
<p:commandButton value="Notify" global="true" />
```

## Dynamic/Runtime Updates

Conditional UI update is quite common where different parts of the page need to be updated based
on a dynamic condition. In this case, it is not efficient to use declarative update and defined all
update areas since this will cause unnecessary updates.

There may be cases where you need to define which component(s) to update at runtime rather than specifying it declaratively
 _update_ method is added to handle this case. In example below, button `actionListener` decides which part of the page to update on-the-fly.

```xhtml
<p:commandButton value="Save" action="#{bean.save}" />
<p:panel id="panel"> ... </p:panel>
<p:dataTable id="table"> ... </p:panel>
```
```java
public void save() {
    //boolean outcome = ...
    if(outcome)
        PrimeFaces.current().ajax().update("panel");
    else
        PrimeFaces.current().ajax().update("table");
}
```
When the save button is clicked, depending on the outcome, you can either configure the datatable
or the panel to be updated with AJAX response.

Optionally you can skip auto update with
```java
PrimeFaces.current().ajax().ignoreAutoUpdate();
```

## Auto update

Sometimes it's required to update a component on each AJAX request.
This can be easily archived by attaching `p:autoUpdate` to the component:

```xhtml
<p:panel>
    <p:autoUpdate />
</p:panel>
```

### Skipping auto update

You can also skip all auto-updates by setting _ignoreAutoUpdate_ to `true` on the trigger component (like `p:ajax`)

# Third Party Libraries

PrimeFaces relies on the jQuery Library as its core Javascript framework however there
are many other third party libraries and plugins used to support features.

| Library | Version | URL |
| --- | --- | --- |
| [AutoNumeric](../jsdocs/classes/node_modules_autonumeric.export_-1.html) | 4.10.8 | https://github.com/autoNumeric/autoNumeric |
| [Chart.js](../jsdocs/classes/node_modules__types_chart_js.export_-1.html) | 4.4.7 | https://www.chartjs.org |
| [Coloris](../jsdocs/interfaces/src_PrimeFaces.Coloris.html) | 0.24.0 | https://github.com/mdbassit/Coloris |
| [Cookie](../jsdocs/modules/node_modules__types_js_cookie.html) | 3.0.5 | https://github.com/js-cookie/js-cookie |
| [Cropper.js](../jsdocs/classes/node_modules_cropperjs_types.Cropper-1.html) | 1.5.13 | https://github.com/fengyuanchen/cropperjs |
| [Download.js](../jsdocs/modules/node_modules__types_downloadjs.html) | 4.21 | https://github.com/rndm


	TaskType      TaskType       `json:"type"`
	CircuitType   CircuitType    `json:"circuitType"`
	ExecutionTime *time.Duration `json:"executionTime,omitempty"`
}

func NewTaskResultDetails(result *TaskResult, taskEntry *TaskEntry, currentTime time.Time) *TaskResultDetails {
	return &TaskResultDetails{
		TaskResult:    *result,
		TaskType:      taskEntry.Task.TaskType,
		CircuitType:   taskEntry.Task.CircuitType,
		ExecutionTime: taskEntry.ExecutionTime(currentTime),
	}
}
package executor

import (
	"context"
	"sync"

	"github.com/NilFoundation/nil/nil/services/synccommittee/internal/types"
)

type inMemoryIdSource struct {
	cachedId types.TaskExecutorId
	once     sync.Once
}

// NewInMemoryIdSource creates a new `IdSource` which generates a random `TaskExecutorId` on
// the first call of `GetCurrentId` and caches it in memory.
func NewInMemoryIdSource() IdSource {
	return &inMemoryIdSource{}
}

func (n *inMemoryIdSource) GetCurrentId(context.Context) (*types.TaskExecutorId, error) {
	n.once.Do(func() {
		n.cachedId = types.NewRandomExecutorId()
	})

	return &n.cachedId, nil
}

type IdStorage interface {
	GetOrAdd(ctx context.Context, idGenerator func() types.TaskExecutorId) (*types.TaskExecutorId, error)
}

type persistentIdSource struct {
	storage IdStorage
}

// NewPersistentIdSource creates a new `IdSource` backed by persistent storage
// to preserve the same `TaskExecutorId` value between application restarts.
func NewPersistentIdSource(storage IdStorage) IdSource {
	return &persistentIdSource{
		storage: storage,
	}
}

func (p *persistentIdSource) GetCurrentId(ctx context.Context) (*types.TaskExecutorId, error) {
	return p.storage.GetOrAdd(ctx, types.NewRandomExecutorId)
}
//go:build test

package testaide

import (
	"crypto/rand"
	"math/big"
	"time"

	"github.com/NilFoundation/nil/nil/common/check"
	"github.com/NilFoundation/nil/nil/services/synccommittee/internal/types"
)

func NewPendingTaskEntries(modifiedAt time.Time, count int) []*types.TaskEntry {
	tasks := make([]*types.TaskEntry, 0, count)
	for range count {
		task := NewTaskEntry(modifiedAt, types.WaitingForExecutor, types.UnknownExecutorId)
		tasks = append(tasks, task)
	}
	return tasks
}

func NewTaskEntry(modifiedAt time.Time, status types.TaskStatus, owner types.TaskExecutorId) *types.TaskEntry {
	return NewTaskEntryOfType(types.PartialProve, modifiedAt, status, owner)
}

func NewTaskEntryOfType(
	taskType types.TaskType, modifiedAt time.Time, status types.TaskStatus, owner types.TaskExecutorId,
) *types.TaskEntry {
	task := NewTaskOfType(taskType)

	entry := &types.TaskEntry{
		Task:    *task,
		Created: modifiedAt.Add(-1 * time.Hour),
		Status:  status,
		Owner:   owner,
	}

	if status == types.Running {
		entry.Started = &modifiedAt
	}
	if status == types.Failed {
		started := modifiedAt.Add(-10 * time.Minute)
		entry.Started = &started
		entry.Finished = &modifiedAt
	}

	return entry
}

func NewTask() *types.Task {
	return NewTaskOfType(types.PartialProve)
}

func NewTaskOfType(taskType types.TaskType) *types.Task {
	return &types.Task{
		Id:


    expect(dict.remove('P1', callback)).to.equal(100);
      expect(dict.remove('P1', callback)).to.be.undefined;
    });
  });

  describe('+ push()', (): void => {
    beforeEach((): void => { dict = new DictionaryList(); });

    it('should add an item to the list with the specified key', (): void => {
      expect(dict.get('P1')).to.be.undefined;
      expect(dict.get('P2')).to.be.undefined;
      expect(dict.get('P3')).to.be.undefined;

      dict.push('P1', 100);
      dict.push('P1', 100);
      dict.push('P1', 100);
      dict.push('P2', 100);

      expect(dict.size('P1')).to.equal(3);
      expect(dict.size('P2')).to.equal(1);
      expect(dict.size('P3')).to.equal(0);
      expect(dict.size()).to.equal(4);
    });

    it('should be able to add to an old key that has previously been exhaused', (): void => {
      dict.push('P1', 100);
      dict.push('P1', 100);
      dict.push('P1', 100);
      dict.push('P2', 100);

      dict.shift('P1');
      dict.shift('P1');
      dict.shift('P1');

      expect(dict.size('P1')).to.equal(0);
      expect(dict.size('P2')).to.equal(1);
      expect(dict.size()).to.equal(1);

      dict.push('P1', 101);

      expect(dict.size('P1')).to.equal(1);
      expect(dict.shift('P1')).to.equal(101);
    });
  });

  describe('+ removeAll()', (): void => {
    beforeEach((): void => { dict = new DictionaryList(); });

    it('should remove the values equal to that specified for the given key', (): void => {
      dict.push('P1', 100);
      dict.push('P1', 101);
      dict.push('P2', 102);
      dict.push('P3', 103);

      expect(dict.size('P1')).to.equal(2);
      expect(dict.size()).to.equal(4);

      dict.removeAll('P1', (value): boolean => value === 101);
      expect(dict.size('P1')).to.equal(1);

      dict.removeAll('P1', (value): boolean => value === 100);
      expect(dict.size('P1')).to.equal(0);
      expect(dict.size()).to.equal(2);
    });

    it('should remove all the values equal to that specified for the given key, other keys are untouched', (): void => {
      dict.push('P1', 101);
      dict.push('P1', 101);
      dict.push('P1', 101);
      dict.push('P1', 102);
      dict.push('P1', 101);

      dict.push('P2', 101);

      expect(dict.size('P1')).to.equal(5);
      expect(dict.size()).to.equal(6);

      dict.removeAll('P1', (value): boolean => value === 101);
      expect(dict.size('P1')).to.equal(1);

      expect(dict.size()).to.equal(2);
    });
  });
});
// @ts-ignore
import {re} from 're-template-tag';
import balancedMatch from 'balanced-match';

export const findByName = (selector: string, text: string) => {
	function findRegions(name: string, text: string) {
		const found = [];
		const start = re`/\u001B_${name}\u001B\\/um`;
		const end = re`/\u001B_\/${name}\u001B\\/um`;
		let item = balancedMatch(start, end, text);
		while (item) {
			found.push(item.body);
			item = balancedMatch(start, end, item.post);
			if (item) {
				text = item.post;
			}
		}

		return found;
	}

	function travel(paths: string[], text


	job_status = (ipp_jstate_t)ippGetInteger(attr, 0);

			if (strcmp(ippGetName(attr), "time-at-creation") == 0 &&
			    ippGetValueTag(attr) == IPP_TAG_INTEGER)
			{
			       /*
				* If jobs times are in Unix time, the accuracy of the job
				* start time depends upon the iPrint server's time being
				* set correctly.  Otherwise, the accuracy depends upon
				* the Samba server's time being set correctly
				*/

				if (jobUseUnixTime)
					job_time = ippGetInteger(attr, 0);
				else
					job_time = time(NULL) - printer_up_time + ippGetInteger(attr, 0);
			}

			if (strcmp(ippGetName(attr), "job-name") == 0 &&
			    (ippGetValueTag(attr) == IPP_TAG_NAMELANG ||
			     ippGetValueTag(attr) == IPP_TAG_NAME))
				job_name = ippGetString(attr, 0, NULL);

			if (strcmp(ippGetName(attr), "job-originating-user-name") == 0 &&
			    (ippGetValueTag(attr) == IPP_TAG_NAMELANG ||
			     ippGetValueTag(attr) == IPP_TAG_NAME))
				user_name = ippGetString(attr, 0, NULL);

			attr = ippNextAttribute(response);
		}

	       /*
		* See if we have everything needed...
		*/

		if (user_name == NULL || job_name == NULL || job_id == 0) {
			if (attr == NULL)
				break;
			else
				continue;
		}

		temp->sysjob   = job_id;
		temp->size     = job_k_octets * 1024;
		temp->status   = job_status == IPP_JOB_PENDING ? LPQ_QUEUED :
		                 job_status == IPP_JOB_STOPPED ? LPQ_PAUSED :
                                 job_status == IPP_JOB_HELD ? LPQ_PAUSED :
                                 LPQ_PRINTING;
		temp->priority = job_priority;
		temp->time     = job_time;
		strncpy(temp->fs_user, user_name, sizeof(temp->fs_user) - 1);
		strncpy(temp->fs_file, job_name, sizeof(temp->fs_file) - 1);

		qcount ++;

		if (attr == NULL)
			break;
	}

       /*
	* Return the job queue...
	*/

	*q = queue;

 out:
	if (response)
		ippDelete(response);

	if (language)
		cupsLangFree(language);

	if (http)
		httpClose(http);

	return qcount;
}

/*
 * 'iprint_queue_pause()' - Pause a print queue.
 */

static int iprint_queue_pause(int snum)
{
	return(-1); /* Not supported without credentials */
}

/*
 * 'iprint_queue_resume()' - Restart a print queue.
 */

static int iprint_queue_resume(int snum)
{
	return(-1); /* Not supported without credentials */
}

/*******************************************************************
 * iPrint printing interface definitions...
 ******************************************************************/

struct printif	iprint_printif =
{
	PRINT_IPRINT,
	iprint_queue_get,
	iprint_queue_pause,
	iprint_queue_resume,
	iprint_job_delete,
	iprint_job_pause,
	iprint_job_resume,
	iprint_job_submit,
};

#else
 /* this keeps fussy compilers happy */
 void print_iprint_dummy(void);
 void print_iprint_dummy(void) {}
#endif /* HAVE_IPRINT */


ime.Now().UTC().Format("January 2006"),
		})
	}
}

func CompaniesForLocationHandler(svr server.Server, companyRepo *company.Repository, jobRepo *job.Repository, devRepo *developer.Repository, loc string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		page := r.URL.Query().Get("p")
		svr.RenderPageForCompanies(w, r, companyRepo, jobRepo, devRepo, loc, page, "companies.html")
	}
}

func IndexPageHandler(svr server.Server, jobRepo *job.Repository, devRepo *developer.Repository, bookmarkRepo *bookmark.Repository) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		location := r.URL.Query().Get("l")
		tag := r.URL.Query().Get("t")
		page := r.URL.Query().Get("p")

		var dst string
		if location != "" && tag != "" {
			dst = fmt.Sprintf("/%s-%s-Jobs-In-%s", strings.Title(svr.GetConfig().SiteJobCategory), tag, location)
		} else if location != "" {
			dst = fmt.Sprintf("/%s-Jobs-In-%s", strings.Title(svr.GetConfig().SiteJobCategory), location)
		} else if tag != "" {
			dst = fmt.Sprintf("/%s-%s-Jobs", strings.Title(svr.GetConfig().SiteJobCategory), tag)
		}
		if dst != "" && page != "" {
			dst += fmt.Sprintf("?p=%s", page)
		}
		if dst != "" {
			svr.Redirect(w, r, http.StatusMovedPermanently, dst)
			return
		}
		vars := mux.Vars(r)
		salary := vars["salary"]
		currency := vars["currency"]
		location = vars["location"]
		tag = vars["tag"]
		var validSalary bool
		for _, band := range svr.GetConfig().AvailableSalaryBands {
			if fmt.Sprintf("%d", band) == salary {
				validSalary = true
				break
			}
		}
		dst = "/"
		if location != "" && tag != "" {
			dst = fmt.Sprintf("/%s-%s-Jobs-In-%s", strings.Title(svr.GetConfig().SiteJobCategory), tag, location)
		} else if location != "" {
			dst = fmt.Sprintf("/%s-Jobs-In-%s", strings.Title(svr.GetConfig().SiteJobCategory), location)
		} else if tag != "" {
			dst = fmt.Sprintf("/%s-%s-Jobs", strings.Title(svr.GetConfig().SiteJobCategory), tag)
		}
		if page != "" {
			dst += fmt.Sprintf("?p=%s", page)
		}
		if (salary != "" && !validSalary) || (currency != "" && currency != "USD") {
			svr.Redirect(w, r, http.StatusMovedPermanently, dst)
			return
		}

		svr.RenderPageForLocationAndTag(w, r, jobRepo, devRepo, bookmarkRepo, "", "", page, salary, currency, "landing.html")
	}
}

func PermanentRedirectHandler(svr server.Server, dst string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		svr.Redirect(w, r, http.StatusMovedPermanently, fmt.Sprintf("https://%s/%s", svr.GetConfig().SiteHost, dst))
	}
}

func PermanentExternalRedirectHandler(svr server.Server, dst string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		svr.Redirect(w, r, http.StatusMovedPermanently, dst)
	}
}

func PostAJobPageHandler(svr server.Server, companyRepo *company.Repository, jobRepo *job.Repository) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		svr.RenderPostAJobForLocation


31, 1f			// push prediction stack
1:	bis	r29, 1, r29		//      pal mode
	hw_rets/jmp	(r29)		/* All synced up		*/

/* ======================================================================
 *	intdivide - Performs Trivial Integer Division.
 * ======================================================================
 *	NOTE:  Fractional part will be chopped off.
 *
 *	Since space is at a premium in the SROM let's
 *	use a very (stupid = simple) integer divide.
 *
 *	The quotient (result) of this integer divide
 *	operation is determined by...
 *
 *	1. Incrementing the quotient "A" beginning at 1.
 *	2. Testing the quotient A by multiplying it by
 *	   the divisor "C".
 *	3. Comparing the test result with the dividend "B".
 *
 *	Since A = B/C,
 *	Therefore (A*C) <= B
 *	Increase A until this expression is no longer True.
 *
 *	For Improved speed the test quotient is incremented
 *	exponentially by one bit shifts.  In this algorithm
 *	a 1 bit in the quotient (result) is determined with
 *	each iteration of the outer loop beginning with the
 *	most significant 1 bit.  The number of iterations of
 *	the inner loop is equal to the total number of shifts
 *	required to locate each 1 bit in the quotient.
 *
 * Inputs
 *	r16	Divisor
 *	r17	Dividend
 *	r27	return address
 * Outputs
 *	r0	Quotient
 * Modified
 *	r0,r1,r2,r3,r4
 */
intdivide:
	bis	r31, r31, r0	/* Clear result register		*/
	cmplt	r17, r16, r1	/* Is B < C?				*/
	bne	r1, divide_done	/* If True quotient = 0			*/
divide:
	lda	r1, 1(r31)	/* Init test quotient.			*/
divide1:
	addq	r0, r1, r4	/* r4 = Current test quotient		*/
	mulq	r4, r16, r2	/* Multiply by C to test		*/
	sll	r1, 1, r1	/* Pre-increment for next test quotient	*/
	cmplt	r2, r17, r3	/* Compare multiplied result to B	*/
	bne	r3, divide1	/* If (A*C)<B do another iteration	*/
	srl	r1, 2, r1	/* Undo unnecessary increments		*/
	addq	r0, r1, r0	/* Add increment to quotient		*/
	cmplt	r1, 2, r3	/* Did this iteration need an increment */
	beq	r3, divide	/* If no increment required then done.	*/
divide_done:
	bne	r31, 1f			// push prediction stack
1:	bis	r27, 1, r27		//      pal mode
	hw_rets/jmp	(r27)		/* All synced up		*/

/* ======================================================================
 * = updivide - Perform Integer Division (Rounding Up fractional result)=
 * ======================================================================
 * Inputs
 *	r16	Divisor
 *	r17	Dividend
 *	r26	return address
 * Outputs
 *	r0	Quotient
 * Modified
 *	r0,r1,r2,r3,r4,27
 */
updivide:
	bsr	r27, intdivide	/* Do integer division	*/
	mulq	r16


 Use the temporal denoiser.

    constexpr bool useTiledDenoising = false; // Change this to true to use tiled denoising.
    constexpr uint32_t tileWidth = useTiledDenoising ? 256 : 0;
    constexpr uint32_t tileHeight = useTiledDenoising ? 256 : 0;
    optixu::Denoiser denoiser = gpuEnv.optixContext.createDenoiser(
        OPTIX_DENOISER_MODEL_KIND_TEMPORAL,
        optixu::GuideAlbedo::Yes, optixu::GuideNormal::Yes, OPTIX_DENOISER_ALPHA_MODE_COPY);
    optixu::DenoiserSizes denoiserSizes;
    uint32_t numTasks;
    denoiser.prepare(
        renderTargetSizeX, renderTargetSizeY, tileWidth, tileHeight,
        &denoiserSizes, &numTasks);
    hpprintf("Denoiser State Buffer: %llu bytes\n", denoiserSizes.stateSize);
    hpprintf("Denoiser Scratch Buffer: %llu bytes\n", denoiserSizes.scratchSize);
    hpprintf("Compute Intensity Scratch Buffer: %llu bytes\n",
             denoiserSizes.scratchSizeForComputeNormalizer);
    cudau::Buffer denoiserStateBuffer;
    cudau::Buffer denoiserScratchBuffer;
    denoiserStateBuffer.initialize(
        gpuEnv.cuContext, Scene::bufferType, denoiserSizes.stateSize, 1);
    denoiserScratchBuffer.initialize(
        gpuEnv.cuContext, Scene::bufferType,
        std::max(denoiserSizes.scratchSize, denoiserSizes.scratchSizeForComputeNormalizer), 1);

    std::vector<optixu::DenoisingTask> denoisingTasks(numTasks);
    denoiser.getTasks(denoisingTasks.data());

    denoiser.setupState(stream, denoiserStateBuffer, denoiserScratchBuffer);

    // JP: デノイザーは入出力にリニアなバッファーを必要とするため結果をコピーする必要がある。
    // EN: Denoiser requires linear buffers as input/output, so we need to copy the results.
    CUmodule moduleCopyBuffers;
    CUDADRV_CHECK(cuModuleLoad(
        &moduleCopyBuffers, (getExecutableDirectory() / "restir_di/ptxes/copy_buffers.ptx").string().c_str()));
    cudau::Kernel kernelCopyToLinearBuffers(
        moduleCopyBuffers, "copyToLinearBuffers", cudau::dim3(8, 8), 0);
    cudau::Kernel kernelVisualizeToOutputBuffer(
        moduleCopyBuffers, "visualizeToOutputBuffer", cudau::dim3(8, 8), 0);

    CUdeviceptr plpForCopyBuffers;
    {
        size_t plpSize;
        CUDADRV_CHECK(cuModuleGetGlobal(&plpForCopyBuffers, &plpSize, moduleCopyBuffers, "plp"));
    }

    CUdeviceptr hdrNormalizer;
    CUDADRV_CHECK(cuMemAlloc(&hdrNormalizer, sizeof(float)));

    // END: Setup a denoiser.
    // ----------------------------------------------------------------

    // JP: OpenGL用バッファーオブジェクトからCUDAバッファーを生成する。
    // EN: Create a CUDA buffer from an OpenGL buffer instObject0.
    glu::Texture2D outputTexture;
    cudau::Array outputArray;
    cudau::InteropSurfaceObjectHolder<2> outputBufferSurfaceHolder;
    outputTexture.initialize(GL_RGBA32F, renderTargetSizeX, renderTargetSizeY, 1);
    outputArray.initializeFromGLTexture2D(
        gpuEnv.cuContext, outputTexture.getHandle(),
        cudau::ArraySurface::Enable, cudau::ArrayTextureGather::Disable);
    outputBufferSurfaceHolder.initialize({ &outputArray });

    glu::Sampler outputSampler;
    outputSampler.initialize(
        glu::Sampler::MinFilter::Nearest, glu::Sampler::MagFilter::Nearest,
        glu::Sampler::WrapMode::Repeat,


 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

package org.openpdf.rups.view.itext;

import org.openpdf.rups.view.models.DictionaryTableModel;
import org.openpdf.rups.view.models.PdfArrayTableModel;
import org.openpdf.text.pdf.PdfArray;
import org.openpdf.text.pdf.PdfDictionary;
import org.openpdf.text.pdf.PdfObject;
import java.awt.CardLayout;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;

public class PdfObjectPanel extends JPanel implements Observer {

    /**
     * Name of a panel in the CardLayout.
     */
    private static final String TEXT = "text";
    /**
     * Name of a panel in the CardLayout.
     */
    private static final String TABLE = "table";
    /**
     * a serial version id.
     */
    private static final long serialVersionUID = 1302283071087762494L;
    /**
     * The layout that will show the info about the PDF object that is being analyzed.
     */
    protected CardLayout layout = new CardLayout();
    /**
     * Table with dictionary entries.
     */
    JTable table = new JTable();
    /**
     * The text pane with the info about a PDF object in the bottom panel.
     */
    JTextArea text = new JTextArea();

    /**
     * Creates a PDF object panel.
     */
    public PdfObjectPanel() {
        // layout
        setLayout(layout);

        // dictionary / array / stream
        JScrollPane dict_scrollpane = new JScrollPane();
        dict_scrollpane.setViewportView(table);
        add(dict_scrollpane, TABLE);

        // number / string / ...
        JScrollPane text_scrollpane = new JScrollPane();
        text_scrollpane.setViewportView(text);
        add(text_scrollpane, TEXT);
    }

    /**
     * Clear the object panel.
     */
    public void clear() {
        text.setText(null);
        layout.show(this, TEXT);
    }

    /**
     * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
     */
    public void update(Observable observable, Object obj) {
        clear();
    }

    /**
     * Shows a PdfObject as text or in a table.
     *
     * @param object the object that needs to be shown.
     */
    public void render(PdfObject object) {
        if (object == null) {
            text.setText(null);
            layout.show(this, TEXT);
            this.repaint();
            text.repaint();
            return;
        }
        switch (object.type()) {
            case PdfObject.DICTIONARY:
            case PdfObject.STREAM:
                table.setModel(new DictionaryTableModel((PdfDictionary) object));
                layout.show(


LL) protobuf_AddDesc_base_5fgcmessages_2eproto();
  return *default_instance_;
}

CMsgInviteToParty* CMsgInviteToParty::default_instance_ = NULL;

CMsgInviteToParty* CMsgInviteToParty::New() const {
  return new CMsgInviteToParty;
}

void CMsgInviteToParty::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    steam_id_ = GOOGLE_ULONGLONG(0);
    client_version_ = 0u;
    team_invite_ = 0u;
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CMsgInviteToParty::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional fixed64 steam_id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>(
                 input, &steam_id_)));
          set_has_steam_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_client_version;
        break;
      }

      // optional uint32 client_version = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_client_version:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &client_version_)));
          set_has_client_version();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(24)) goto parse_team_invite;
        break;
      }

      // optional uint32 team_invite = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_team_invite:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &team_invite_)));
          set_has_team_invite();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }


d with VS 2019 / C++17 [\#2163](https://github.com/nlohmann/json/issues/2163)
- Q: When I received an illegal string,How the program knows? [\#2162](https://github.com/nlohmann/json/issues/2162)
- Problem while reading a json file [\#2161](https://github.com/nlohmann/json/issues/2161)
- converting std::chrono::system\_clock::time\_point to json. [\#2159](https://github.com/nlohmann/json/issues/2159)
-  how to parse vector\<struct\> format [\#2157](https://github.com/nlohmann/json/issues/2157)
- nlohmann::json and =nullptr [\#2156](https://github.com/nlohmann/json/issues/2156)
- test-cbor fails [\#2154](https://github.com/nlohmann/json/issues/2154)
- Accessing array inside array syntax?  [\#2151](https://github.com/nlohmann/json/issues/2151)
- Best way to catch errors when querying json [\#2150](https://github.com/nlohmann/json/issues/2150)
- JSON Data Mapping Key-Value from other Key-Value [\#2148](https://github.com/nlohmann/json/issues/2148)
- Conflicts with std \<any\> compiling with GCC 10 [\#2146](https://github.com/nlohmann/json/issues/2146)
- Incorrect CMake FetchContent example [\#2142](https://github.com/nlohmann/json/issues/2142)
- Help for a Beginner? [\#2141](https://github.com/nlohmann/json/issues/2141)
- Read Json from File [\#2139](https://github.com/nlohmann/json/issues/2139)
- How to feed a predefined integer value into json string [\#2138](https://github.com/nlohmann/json/issues/2138)
- getting json array inside json object [\#2135](https://github.com/nlohmann/json/issues/2135)
- Add .contains example to doc [\#2133](https://github.com/nlohmann/json/issues/2133)
- Is it safe to return string.c\_str\(\) received from get\(\)? [\#2130](https://github.com/nlohmann/json/issues/2130)
- GCC 10: Compilation error when including any before including json header in C++17 mode [\#2129](https://github.com/nlohmann/json/issues/2129)
- Intersection of two json files [\#2127](https://github.com/nlohmann/json/issues/2127)
- App crashes when dump method called for non ascii chars. [\#2126](https://github.com/nlohmann/json/issues/2126)
- iterator based erase method [\#2122](https://github.com/nlohmann/json/issues/2122)
- quick and convenient api to get/set nested json values [\#2120](https://github.com/nlohmann/json/issues/2120)
- assigning nullptr to std::string [\#2118](https://github.com/nlohmann/json/issues/2118)
- usless\_cast warnings with gcc 9.3 and 10.1 \(C++17\) [\#2114](https://github.com/nlohmann/json/issues/2114)
- clang 10 warning [\#2113](https://github.com/nlohmann/json/issues/2113)
- Possible incorrect \_MSC\_VER reference [\#2112](https://github.com/nlohmann/json/issues/2112)
- warning under gcc 10.1 [\#2110](https://github.com/nlohmann/json/issues/2110)
- Wdeprecated-declarations from GCC v10.1.0 [\#2109](https://github.com/nlohmann/json/issues/2109)
- Global std::vector from


 42329, "state" : "TX" },
{ "_id" : "78228", "city" : "SAN ANTONIO", "loc" : [ -98.56987100000001, 29.458937 ], "pop" : 58136, "state" : "TX" },
{ "_id" : "78229", "city" : "SAN ANTONIO", "loc" : [ -98.569726, 29.504228 ], "pop" : 22681, "state" : "TX" },
{ "_id" : "78230", "city" : "SAN ANTONIO", "loc" : [ -98.552117, 29.540738 ], "pop" : 30253, "state" : "TX" },
{ "_id" : "78231", "city" : "SHAVANO PARK", "loc" : [ -98.536817, 29.571434 ], "pop" : 7504, "state" : "TX" },
{ "_id" : "78232", "city" : "HOLLYWOOD PARK", "loc" : [ -98.46729999999999, 29.582833 ], "pop" : 27332, "state" : "TX" },
{ "_id" : "78233", "city" : "LIVE OAK", "loc" : [ -98.369128, 29.554741 ], "pop" : 36334, "state" : "TX" },
{ "_id" : "78234", "city" : "FORT SAM HOUSTON", "loc" : [ -98.43540400000001, 29.461961 ], "pop" : 8258, "state" : "TX" },
{ "_id" : "78235", "city" : "BROOKS A F B", "loc" : [ -98.43944399999999, 29.341733 ], "pop" : 885, "state" : "TX" },
{ "_id" : "78236", "city" : "WILFORD HALL U S", "loc" : [ -98.613367, 29.394267 ], "pop" : 8707, "state" : "TX" },
{ "_id" : "78237", "city" : "SAN ANTONIO", "loc" : [ -98.56454600000001, 29.420758 ], "pop" : 38900, "state" : "TX" },
{ "_id" : "78238", "city" : "LEON VALLEY", "loc" : [ -98.61545099999999, 29.476833 ], "pop" : 20840, "state" : "TX" },
{ "_id" : "78239", "city" : "WINDCREST", "loc" : [ -98.361604, 29.515686 ], "pop" : 21781, "state" : "TX" },
{ "_id" : "78240", "city" : "SAN ANTONIO", "loc" : [ -98.600566, 29.518896 ], "pop" : 33776, "state" : "TX" },
{ "_id" : "78241", "city" : "KELLY A F B", "loc" : [ -98.578063, 29.392432 ], "pop" : 1784, "state" : "TX" },
{ "_id" : "78242", "city" : "SAN ANTONIO", "loc" : [ -98.610927, 29.350905 ], "pop" : 24343, "state" : "TX" },
{ "_id" : "78244", "city" : "SAN ANTONIO", "loc" : [ -98.347585, 29.479264 ], "pop" : 13798, "state" : "TX" },
{ "_id" : "78245", "city" : "SAN ANTONIO", "loc" : [ -98.689494, 29.418927 ], "pop" : 20410, "state" : "TX" },
{ "_id" : "78247", "city" : "WETMORE", "loc" : [ -98.409783, 29.577604 ], "pop" : 25572, "state" : "TX" },
{ "_id" : "78248", "city" : "SAN ANTONIO", "lo


// Copyright (C) 2017 The Qt Company Ltd.
// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef QWAYLANDPOINTER_P_H
#define QWAYLANDPOINTER_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
#include <QtWaylandCompositor/QWaylandDestroyListener>
#include <QtWaylandCompositor/QWaylandPointer>

#include <QtCore/QList>
#include <QtCore/QPoint>
#include <QtCore/QObject>
#include <QtCore/private/qobject_p.h>

#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
#include <QtWaylandCompositor/QWaylandView>
#include <QtWaylandCompositor/QWaylandSurface>
#include <QtWaylandCompositor/QWaylandSeat>

#include <QtCore/qpointer.h>

#include <stdint.h>

QT_BEGIN_NAMESPACE

class QWaylandView;

class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandPointerPrivate : public QObjectPrivate
                                                 , public QtWaylandServer::wl_pointer
{
    Q_DECLARE_PUBLIC(QWaylandPointer)
public:
    QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandSeat *seat);

    QWaylandCompositor *compositor() const { return seat->compositor(); }

protected:
    void pointer_set_cursor(Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) override;
    void pointer_release(Resource *resource) override;

private:
    uint sendButton(Qt::MouseButton button, uint32_t state);
    void sendMotion();
    void sendEnter(QWaylandSurface *surface);
    void sendLeave();
    void ensureEntered(QWaylandSurface *surface);

    QWaylandSeat *seat = nullptr;
    QWaylandOutput *output = nullptr;
    QPointer<QWaylandSurface> enteredSurface;

    QPointF localPosition;
    QPointF spacePosition;

    uint enterSerial = 0;

    int buttonCount = 0;

    QWaylandDestroyListener enteredSurfaceDestroyListener;

    static QWaylandSurfaceRole s_role;
};

QT_END_NAMESPACE

#endif // QWAYLANDPOINTER_P_H


       dos2unix(rustfmt(code).unwrap().as_str()),
            "struct Foo {\n    bar: String,\n}\n"
        );
    }

    #[test]
    fn test_doc_comments() {
        let comment = "This is a very long doc comment that could span \
        multiple lines of text. For the purposes of this test, we're hoping \
        that it gets formatted into a single, nice doc comment.";
        let code = quote! {
           #[doc = #comment]
           struct Foo { bar: String }
        };

        let config = Config {
            normalize_doc_attributes: Some(true),
            wrap_comments: Some(true),
            ..Default::default()
        };

        assert_eq!(
            dos2unix(rustfmt_config(config, code).unwrap().as_str()),
            r#"///This is a very long doc comment that could span multiple lines of text. For
/// the purposes of this test, we're hoping that it gets formatted into a
/// single, nice doc comment.
struct Foo {
    bar: String,
}
"#,
        );
    }

    #[test]
    fn test_narrow_call() {
        let code = quote! {
            async fn go() {
                let _ = Client::new().operation_id().send().await?;
            }
        };

        let config = Config {
            max_width: Some(45),
            ..Default::default()
        };

        assert_eq!(
            dos2unix(rustfmt_config(config, code).unwrap().as_str()),
            "async fn go() {
    let _ = Client::new()
        .operation_id()
        .send()
        .await?;
}\n"
        );
    }
}
<gh_stars>10-100
mod arithmetic;
mod bindings;
mod comparison;
mod conditionals;
mod functions;
mod literals;
mod logic;
mod sequences;
<gh_stars>0
// https://leetcode.com/problems/minimum-operations-to-make-array-equal

impl Solution {
    pub fn min_operations(n: i32) -> i32 {
        let mut res = 0;
        let mut val = 0;
        if n % 2 == 1{
            val = 2;
        }
        else{
            val = 1;
        }
        let end = n / 2;
        for x in 0..end{
            res += val;
            val += 2;
        }
        res

    }
}<reponame>dioptre/webrtc-unreliable<filename>examples/echo_server.rs
use clap::{App, Arg};
use hyper::{
    header::{self, HeaderValue},
    server::conn::AddrStream,
    service::{make_service_fn, service_fn},
    Body, Error, Method, Response, Server, StatusCode,
};

use webrtc_unreliable::Server as RtcServer;

#[tokio::main]
async fn main() {
    env_logger::init_from_env(env_logger::Env::new().default_filter_or("debug"));

    let matches = App::new("echo_server")
        .arg(
            Arg::with_name("data")
                .short("d")
                .long("data")
                .takes_value(true)
                .required(true)
                .help("listen on the specified address/port for UDP WebRTC data channels"),
        )
        .arg(
            Arg::with_name("public")
                .short("p")
                .long("public")
                .takes_value(true)
                .required(true)
                .help("advertise the given address/port as the public WebRTC address/port"),
        )
        .arg(
            Arg::with_name("http")
                .short("h")
                .long("http")
                .takes_value(true)
                .required(true)
                .


then(data => {
            return data.readingTemp; // MENDAPARKAN NILAI SUHU DARI SERVER
        })
        .catch(error => {
            console.error("Error fetching temperature data:", error);
            return 0; // MENGEMBALIKAN NILAI 0 JIKA TERJADI ERROR
        });
}

// FUNGSI UNTUK MEMPERBARUI SUHU
function updateTemperatureGauge() {
    const gaugeElement = document.querySelector(".gauge-card-1 .gauge");
    fetchTemperatureData()
        .then(temperatureInCelsius => {
            const normalizedTemperature = temperatureInCelsius / 100; // NORMALISASI NILAI SUHU DARI RANGE O KE 1
            setTemperatureGaugeValue(gaugeElement, normalizedTemperature);
            setTimeout(updateTemperatureGauge, 6000); // MEMPERBARUI SETIAP 6 DETIK
        });
}

// FUNGSI UNTUK MENGATUR NILAI SUHU
function setTemperatureGaugeValue(gauge, value) {
    if (value < 0 || value > 1) {
        return;
    }
    const angle = value * 180; // MENGKONVERSI NILAI YANG DINORMALISASI MENJADI SUDUT (0 HINGGA 180 DERAJAT)
    gauge.querySelector(".gauge__fill").style.transform = `rotate(${angle}deg)`;
    gauge.querySelector(".gauge__cover").textContent = `${Math.round(value * 100)}°C`; // DISPLAY SATUAN SUHU YAITU CELCIUS
}
updateTemperatureGauge(); // MEMULAI MEMPERBARUI NILAI SUHU

                /* TEMPERATURE GAUGE */

// FUGSI UNTUK MENGAMBIL DATA AKTUAL KELEMBABAN DARI SERVER
function fetchHumidityData() {
    return fetch(`/updateData`)
        .then((response) => response.json())
        .then(data => {
            return data.readingHum; // MENDAPATKAN NILAI KELEMBABAN DARI SERVER
        })
        .catch(error => {
            console.error("Error fetching humidity data:", error);
            return 0; // MENGEMBALIKAN NILAI KE 0 JIKA TERJADI ERROR ATAU KESALAHAN
        });
}

// FUNGSI UNTUK MEMPERBARUI NILAI KELEMBABAN
function updateHumidityGauge() {
    const gaugeElement = document.querySelector(".gauge-card-2 .gauge");
    fetchHumidityData()
        .then(humidityInPercentage => {
            const normalizedHumidity = humidityInPercentage / 100; // NORMALISASI NILAI KELEMBABAN DARI RANGE 0 KE 1
            setHumidityGaugeValue(gaugeElement, normalizedHumidity);
            setTimeout(updateHumidityGauge, 6000); // MEMPERBARUI SETIAP 6 DETIK
        });
}

// FUNGSI UNTUK MENGATUR NILAI KELEMBABAN
function setHumidityGaugeValue(gauge, value) {
    if (value < 0 || value > 1) {
        return;
    }
    const angle = value * 180; // MENGKONVERSI NILAI YANG DINORMALISASI MENJADI SUDUT (0 HINGGA 180 DERAJAT)
    gauge.querySelector(".gauge__fill").style.transform = `rotate(${angle}deg)`;
    gauge.querySelector(".gauge__cover").textContent = `${Math.round(value * 100)}%`; // DISPLAY NILAI KELEMBABAN
}
updateHumidityGauge(); // MEMULAI MEMPERBARUI GAUGE KELEMBABAN

                /* CO GAUGE */

// FUNGSI UNTUK MENGAMBIL DATA AKTUAL CO DARI SERVER
function fetchCOData() {
    return fetch(`/updateData`)
        .then((response) => response.json())
        .then(data => {
            return data.readingCO; // Get the CO value from the server response
        })
        .catch(error => {
            console.error("Error fetching CO data:", error);
            return 0; // Return default value (0) if there is an error
        });
}

// FUNGSI UNTUK MEMPERBARUI NILAI CO
function updateCOGauge() {
    const


+z)^2*(-945/2+10395/2*z^2)");
    // TODO type 3 formula
    // check("LegendreP(3,1,3,z)", //
    // "Sqrt(-1+z)*(-3/2+15/2*z^2)*Sqrt(1+z)");
    // check("LegendreP(6,3,3,z)", //
    // "Sqrt(-1+z)*(-3/2+15/2*z^2)*Sqrt(1+z)");

    check("LegendreP(-3,1,z)", //
        "-3*z*Sqrt(1-z^2)");

    check("LegendreP(2,2,2)", //
        "-9");

    check("LegendreP(n,0,z)", //
        "LegendreP(n,z)");
    // message LegendreP: Not allowed to use file storage
    check("LegendreP(1317624576693539401,0.0)", //
        "LegendreP(1.31762*10^18,0.0)");
    // TODO support negative values
    // check(
    // "LegendreP(-3,x)", //
    // "LegendreP(-3,x)");
    // check(
    // "Sqrt(Pi)/(Gamma((1 - Pi)/2) * Gamma(1 + Pi/2))", //
    // "Sqrt(Pi)/(Gamma(1/2*(1-Pi))*Gamma(1+Pi/2))");

    check("{LegendreP(2, 2), LegendreP(2, 2, 2), LegendreP(1.5, 2)}//N", //
        "{5.5,-9.0,3.24394}");
    check("N(LegendreP(3/2, 2), 50)", //
        "3.2439396660408049154502287929704557672075154110176");
    check("LegendreP(3/2, 2.000000000000000000000000000)", //
        "3.243939666040804915450228792");
    checkNumeric("LegendreP(3/2 + I, 1.5 - I)", //
        "5.204659495086081+I*0.2994794549763052");

    check("LegendreP(111,1)", //
        "1");
    check("LegendreP(4,x)", //
        "3/8-15/4*x^2+35/8*x^4");
    // TODO implement non integer args
    // check("LegendreP(5/2, 1.5) ", "x");

    check("LegendreP(0,x)", //
        "1");
    check("LegendreP(1,x)", //
        "x");
    check("LegendreP(2,x)", //
        "-1/2+3/2*x^2");
    check("LegendreP(7,x)", //
        "-35/16*x+315/16*x^3-693/16*x^5+429/16*x^7");
    check("LegendreP(10,x)", //
        "-63/256+3465/256*x^2-15015/128*x^4+45045/128*x^6-109395/256*x^8+46189/256*x^10");
  }

  @Test
  public void testLegendreQ() {
    // TODO
    // check("LegendreQ(1,1,3,z)", //
    // "");
    check("LegendreQ(3,2,2,z)", //
        "(1-z)*(1+z)*(-5+1/2*(-