11000,30,30,1,{[331]={{73.67,60.0}}},nil,331,{25,824},{25,1918},29,"H",nil,3},
[12738] = {'Nori Pridedrift',75,75,5,5,0,{[1]={{24.98,75.96}}},nil,1,{3364},{3365},55,"A",nil,2},
[12739] = {'Onyxia\'s Elite Guard',28710,29610,58,59,1,nil,nil,0,nil,nil,14,nil,nil,0},
[12740] = {'Faustron',4300,4300,65,65,1,{[493]={{32.09,66.61}}},nil,493,nil,nil,29,"H","Wind Rider Master",8195},
[12741] = {'Warrior 40 (More Leash)',5000,5000,40,40,0,nil,nil,0,nil,nil,7,"AH","",0},
[12756] = {'Lady Onyxia',4300,4300,63,63,3,nil,nil,0,nil,nil,11,"A",nil,0},
[12757] = {'Karang Amakkar',1400,1400,35,35,0,{[331]={{11.9,34.54}}},nil,331,{216,6621},{216,6621},29,"H",nil,3},
[12758] = {'Onyxia Trigger',5000,5000,1,1,0,{[2159]={{-1,-1}}},nil,2159,nil,nil,35,"AH","",0},
[12759] = {'Tideress',828,828,27,27,0,{[331]={{45.88,70.62}}},{[331]={{{46.08,70.82},{46.32,70.85},{46.56,70.79},{46.74,70.62},{47.0,70.63},{47.22,70.43},{47.4,70.37},{47.57,70.42},{47.69,70.22},{47.8,69.88},{48.05,69.66},{48.32,69.62},{48.71,69.5},{48.37,69.72},{48.42,70.13},{48.66,70.56},{48.93,70.82},{49.21,70.78},{49.46,70.8},{49.93,70.59},{50.22,70.37},{50.5,70.42},{50.51,71.07},{50.74,71.31},{51.1,71.09},{51.41,70.9},{51.73,70.85},{51.98,71.06},{52.15,71.19},{52.19,71.6},{52.09,72.07},{52.19,71.6},{52.15,71.19},{51.98,71.06},{51.73,70.85},{51.41,70.9},{51.1,71.09},{50.74,71.31},{50.51,71.07},{50.5,70.42},{50.22,70.37},{49.93,70.59},{49.46,70.8},{49.21,70.78},{48.93,70.82},{48.66,70.56},{48.42,70.13},{48.37,69.72},{48.71,69.5},{48.32,69.62},{48.05,69.66},{47.8,69.88},{47.69,70.22},{47.58,70.42},{47.41,70.37},{47.22,70.43},{47.0,70.63},{46.74,70.62},{46.56,70.79},{46.32,70.85},{46.08,70.82},{45.89,70.68}}}},331,nil,nil,91,nil,nil,0},
[12776] = {'Hraug',372,372,9,9,0,{[14]={{40.56,68.44}}},nil,14,nil,nil,29,"H","Demon Trainer",131},
[12777] = {'Captain Dirgehammer',8075,8075,65,65,0,{[2918]={{-1,-1}}},nil,2918,nil,nil,35,"AH","Armor Quartermaster",4224},
[12778] = {'Lieutenant R


 {}`.
        // * `(` e.g. method definition like `(int, int) x() {}`.
        // * `,` e.g. non-last parameter like `void x((int, int) y, int z) {}`.
        // * `)` e.g. last parameter like `void x((int, int) y) {}`.
        // * `in` e.g. `for ((int, int) x in list) {}`.
        // * `}` e.g. `x({(int, int) x}) {}`.
        // * `:` e.g. `x({(int, int) x: (42, 42)}) {}`.
        // * `]` e.g. `x([(int, int) x = (42, 42)]) {}`.
        if (!isOneOfOrEof(afterIdentifier,
            const [";", "=", "<", "(", ",", ")", "in", "}", ":", "]"])) {
          if (getOrSet &&
              isOneOfOrEof(
                  afterIdentifier, const ["=>", "{", "async", "sync"])) {
            // With a getter/setter in the mix we can accept more stuff, e.g.
            // these would be "fine":
            // * `=>`: e.g. `(int, int) get x => (42, 42);`.
            // * `{`: e.g. `(int, int) get x { }`.
            // * `async`: e.g. `(int, int) get x async {}`.
            // * `sync`: e.g. `(int, int) get x sync* {}`.
            // Not all of this is valid (e.g. a setter can't be async, sync has
            // to be followed by *, return type of async has to be Future etc),
            // but for disambiguation we'll assume it's enough, and we'd rather
            // have an error saying "return time has to be Future" than "I don't
            // know what these parenthesis mean".
          } else if (optional("operator", next) &&
              afterIdentifier.isUserDefinableOperator) {
            // E.g.
            // `(int, int) operator [](int foo) {}`
          } else {
            // This could for instance be `(int x, int y) async {`.
            return noType;
          }
        }
      } else if ((optional("this", next) || optional("super", next)) &&
          optional(".", next.next!)) {
        // E.g.
        // * C(({int n, String s}) this.x);
        // * C((int, int) super.x);
      } else {
        // Is it e.g.
        // * List<(int, int)>
        // * Map<(int, int), (String, String)>?
        // * List<List<(int, int)>>
        // * List<List<List<(int, int)>>>
        // * typedef F2<T extends List<(int, int)>>= T Function();
        // * typedef F3<T extends List<List<(int, int)>>>= T Function();
        if (!isOneOfOrEof(next, const [",", ">", ">>", ">>=", ">>>", ">>>="])) {
          return noType;
        }
      }
    }
    assert(optional(')', token));

    beforeQuestionMark = null;
    end = token;
    token = token.next!;

    if (optional('?', token)) {
      beforeQuestionMark = end;
      end = token;
      token = token.next!;
    }

    isRecordType = true;

    assert(end != null);
    return this;
  }

  /// Check if the presumed record type has correct syntax between its
  /// parenthesis. If not [recovered] will be set to true.
  /// Keep in sync with [Parser.parseRecordType] et al.
  void _checkIfRecordTypeParenthesisAreRecovered(
      Token token, final Token endGroup) {
    int parameterCount = 0;
    bool hasNamedFields = false;
    bool hasComma = false;
    while (true) {
      Token next = token.next!;
      if (optional(')', next)) {
        token = next;
        break;
      } else if (hasNamedFields &&
          optional('}', next) &&
          optional(')', nex


e: Exception) {
                onError("保存失败: ${e.message}")
            }
        }
    }

    /**
     * 删除记录
     */
    fun deleteRecord(record: MenstrualRecord, onSuccess: () -> Unit, onError: (String) -> Unit) {
        viewModelScope.launch {
            try {
                storage.deleteRecord(record)
                onSuccess()
            } catch (e: Exception) {
                onError("删除失败: ${e.message}")
            }
        }
    }

    /**
     * 获取指定日期的记录
     */
    fun getRecordByDate(date: Date, callback: (MenstrualRecord?) -> Unit) {
        viewModelScope.launch {
            try {
                val calendar = Calendar.getInstance()
                calendar.time = date
                calendar.set(Calendar.HOUR_OF_DAY, 0)
                calendar.set(Calendar.MINUTE, 0)
                calendar.set(Calendar.SECOND, 0)
                calendar.set(Calendar.MILLISECOND, 0)
                val startOfDay = calendar.time

                calendar.add(Calendar.DAY_OF_MONTH, 1)
                val startOfNextDay = calendar.time

                val records = storage.getRecordsByDateRange(startOfDay, startOfNextDay)
                callback(records.firstOrNull())
            } catch (e: Exception) {
                callback(null)
            }
        }
    }

    /**
     * 预测下次月经日期
     */
    fun predictNextPeriod(callback: (Date?) -> Unit) {
        viewModelScope.launch {
            try {
                val recentRecords = storage.getRecentRecords(3)
                if (recentRecords.size >= 2) {
                    // 计算平均周期长度
                    var totalCycleDays = 0
                    var cycleCount = 0

                    for (i in 0 until recentRecords.size - 1) {
                        val current = recentRecords[i]
                        val previous = recentRecords[i + 1]
                        val daysBetween = ((current.startDate.time - previous.startDate.time) / (1000 * 60 * 60 * 24)).toInt()
                        totalCycleDays += daysBetween
                        cycleCount++
                    }

                    if (cycleCount > 0) {
                        val averageCycle = totalCycleDays / cycleCount
                        val lastPeriod = recentRecords.first().startDate
                        val calendar = Calendar.getInstance()
                        calendar.time = lastPeriod
                        calendar.add(Calendar.DAY_OF_MONTH, averageCycle)
                        callback(calendar.time)
                    } else {
                        callback(null)
                    }
                } else {
                    callback(null)
                }
            } catch (e: Exception) {
                callback(null)
            }
        }
    }
}package top.mizhoubaobei.womenhealth.ui.list

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import top.mizhoubaobei.womenhealth.data.MenstrualRecord
import top.mizhoubaobei.womenhealth.databinding.FragmentListBinding
import top.mizhoubaobei.womenhealth.ui.quickadd.QuickAddViewModel

/**
 * 列表式月经记录界面
 */
class ListFragment : Fragment() {

    private var _binding: FragmentListBinding? = null
    private val binding get() = _binding!!

    private lateinit var viewModel: ListViewModel


,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#define ASSEMBLY
#include <constants.h>
#include <asm/unwind_hints.h>

    .code64
    .intel_syntax noprefix

    .globl  serial_write_c
    .align  0x1000
serial_write_c:
    UNWIND_HINT_EMPTY

    push rax
    push rdx

wait_for_ffio_empty:
    mov rdx, HYPERVISOR_SERIAL_PORT
    add rdx, 5
    in  al, dx

    and al, 0x20
    cmp al, 0x0
    jz  wait_for_ffio_empty

    mov rdx, HYPERVISOR_SERIAL_PORT
    mov rax, rdi
    out dx, al

    pop rdx
    pop rax
    ret
    int 3

    .size serial_write_c, .-serial_write_c


upstreams_list_err = common.list_keys(common.PREFIX_MAP.upstreams)

    if upstreams_list_err then
        return "update_associate_node: get upstreams list FAIL [".. upstreams_list_err .."]"
    end

    if not upstreams_list or not upstreams_list.list or (#upstreams_list.list == 0) then
        return nil
    end

    local nodes_list, nodes_list_err = common.list_keys(common.PREFIX_MAP.upstream_nodes)

    if nodes_list_err then
        return "update_associate_node: get nodes list FAIL [".. nodes_list_err .."]"
    end

    if not nodes_list or not nodes_list.list or (#nodes_list.list == 0) then
        return nil
    end

    local nodes_id_map, nodes_name_map = {}, {}

    for i = 1, #nodes_list.list do

        if not nodes_id_map[nodes_list.list[i].id] then
            nodes_id_map[nodes_list.list[i].id] = nodes_list.list[i].name
        end

        if not nodes_name_map[nodes_list.list[i].name] then
            nodes_name_map[nodes_list.list[i].name] = nodes_list.list[i].id
        end

    end

    for i = 1, #upstreams_list.list do

        repeat

            local upstream_info = upstreams_list.list[i]

            if not upstream_info.nodes or (#upstream_info.nodes == 0) then
                break
            end

            local associate_nodes = upstream_info.nodes

            local new_nodes = {
                nodes = {}
            }

            local update = false

            for j = 1, #associate_nodes do


 if sequence[0].to_ascii_uppercase() == 'T' && sequence[1].to_ascii_uppercase() == 'C'
		{
			alpha[S_STATE_1][2] = alpha[S_STATE_1][2] - log30;
		}
	}
	/******************************************************************/
	/*  fill out the rest of the columns                              */
	/******************************************************************/
	let mut num_n = 0;
	for t in 1..len_seq {
		let mut from = nt2int(sequence[t - 1]);
		let mut from0: usize;
		if t > 2 {
			from0 = nt2int(sequence[t - 2]);
		} else {
			from0 = 2;
		}
		let mut to = nt2int(sequence[t]);

		/* if DNA is other than ACGT, do it later */
		if from == 4 {
			from = 2;
		}
		if from0 == 4 {
			from0 = 2;
		}
		if to == 4 {
			to = 2;
			num_n += 1;
		} else {
			num_n = 0;
		}
		let from2 = from0 * 4 + from;

		/******************/
		/* M state        */
		/******************/
		if t != 0 {
			for i in M1_STATE..=M6_STATE {
				if alpha[i][t] < max_dbl {
					let mut j;
					if i == M1_STATE {
						/* from M state */
						j = M6_STATE;
						alpha[i][t] =
							alpha[j][t - 1] - hmm.tr[TR_GG] - hmm.tr[TR_MM] - hmm.e_m[0][from2][to];
						path[i][t] = j as i8;

						/* from D state */
						if !wholegenome {
							for j in (M1_STATE..=M5_STATE).rev() {
								let mut num_d: isize = -10;
								if j >= i {
									num_d = i as isize - j as isize + 6;
								} else if j + 1 < i {
									num_d = i as isize - j as isize;
								}
								if num_d > 0 {
									let temp_alpha = alpha[j][t - 1]
										- hmm.tr[TR_MD] - hmm.e_m[0][from2][to] - log25
										* (num_d as f64 - 1.0) - hmm.tr[TR_DD]
										* (num_d as f64 - 2.0) - hmm.tr[TR_DM];
									if temp_alpha < alpha[i][t] {
										alpha[i][t] = temp_alpha;
										path[i][t] = j as i8;
									}
								}
							}
						}

						/* from Start state */
						let temp_alpha = alpha[S_STATE][t - 1] - hmm.e_m[0][from2][to];
						if temp_alpha < alpha[i][t] {
							alpha[i][t] = temp_alpha;
							path[i][t] = S_STATE as i8;
						}
					} else {
						/*i ==M2-M6*/

						/* from M state */
						j = i - 1;
						alpha[i][t] =
							alpha[j][t - 1] - hmm.tr[TR_MM] - hmm.e_m[i - M1_STATE][from2][to];
						path[i][t] = j as i8;

						/* from D state */
						if !wholegenome {
							for j in (M1_STATE..=M6_STATE).rev() {
								let mut num_d: isize = -10;
								if j >= i {
									num_d = i as isize - j as isize + 6;
								} else if j + 1 < i {
									num_d = i as isize -


# Copyright (c) Acconeer AB, 2022-2024
# All rights reserved
from __future__ import annotations

import typing as t

from acconeer.exptool import a121
from acconeer.exptool.a121.algo._plugins import processor_main

from . import Processor, ProcessorConfig, get_close_sensor_config
from ._blinkstick_updater import BlinkstickUpdater
from ._plugin import PlotPlugin

def _processor_getter(
    session_config: a121.SessionConfig,
    processor_config: ProcessorConfig,
    metadata: t.Union[a121.Metadata, t.List[t.Dict[int, a121.Metadata]]],
) -> Processor:
    if isinstance(metadata, list):
        msg = "Metadata is unexpectedly extended"
        raise RuntimeError(msg)

    return Processor(
        sensor_config=session_config.sensor_config,
        metadata=metadata,
        processor_config=processor_config,
    )

def _session_config_getter(sensor_id: int) -> a121.SessionConfig:
    return a121.SessionConfig({sensor_id: get_close_sensor_config()})

processor_main(
    processor_getter=_processor_getter,
    plot_plugin=PlotPlugin,
    session_config_getter=_session_config_getter,
    processor_config_getter=ProcessorConfig,
    _blinkstick_updater_cls=BlinkstickUpdater,
)


<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8" />
<title>Closure Unit Tests - goog.vec.Float32Array</title>
<script src="../base.js"></script>
<script>
  goog.require('goog.vec.Float32Array');
  goog.require('goog.testing.jsunit');
</script>
</head>
<body>
<script>

  function testConstructorInitializesElementsToZero() {
    var f = new goog.vec.Float32Array(3);
    assertEquals(3, f.length);
    assertEquals(0, f[0]);
    assertEquals(0, f[1]);
    assertEquals(0, f[2]);
    assertEquals(4, f.BYTES_PER_ELEMENT);
    assertEquals(4, goog.vec.Float32Array.BYTES_PER_ELEMENT);
  }

  function testConstructorWithArrayAsArgument() {
    var f0 = new goog.vec.Float32Array([0, 0, 1, 0]);
    var f1 = new goog.vec.Float32Array(4);
    f1[0] = 0;
    f1[1] = 0;
    f1[2] = 1;
    f1[3] = 0;
    assertObjectEquals(f0, f1);
  }

  function testSet() {
    var f0 = new goog.vec.Float32Array(4);
    var f1 = new goog.vec.Float32Array(4);
    f0.set([1, 2, 3, 4]);
    f1[0] = 1;
    f1[1] = 2;
    f1[2] = 3;
    f1[3] = 4;
    assertObjectEquals(f0, f1);
  }

  function testSetWithOffset() {
    var f0 = new goog.vec.Float32Array(4);
    var f1 = new goog.vec.Float32Array(4);
    f0.set([5], 1);
    f1[0] = 0;
    f1[1] = 5;
    f1[2] = 0;
    f1[3] = 0;
    assertObjectEquals(f0, f1);
  }

  function testToString() {
    var f = new goog.vec.Float32Array([4, 3, 2, 1]);
    assertEquals('4,3,2,1', f.toString());
  }

</script>
</body>
<!DOCTYPE html>
<html>
<!--
Copyright 2011 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8" />
<title>Closure Unit Tests - goog.vec.Quaternion</title>
<script src="../base.js"></script>
<script>
  goog.require('goog.vec.Float32Array');
  goog.require('goog.vec.Mat3');
  goog.require('goog.vec.Mat4');
  goog.require('goog.vec.Quaternion');
  goog.require('goog.vec.Vec3');
  goog.require('goog.vec.vec3f');
  goog.require('goog.vec.Vec4');
  goog.require('goog.testing.jsunit');
</script>
</head>
<body>
<script>

  function testCreateIdentityFloat32() {
    var q = goog.vec.Quaternion.createIdentityFloat32();
    assertElementsEquals([0, 0, 0, 1], q);
  }

  function testInvert() {
    var q0 = goog.vec.Quaternion.createFloat32FromValues(1, 2, 3, 4);
    var q1 = goog.vec.Quaternion.createFloat32();

    goog.vec.Quaternion.invert(q0, q1);
    assertElementsRoughlyEqual([1, 2, 3, 4], q0, goog.vec.EPSILON);
    asser


|dkr4|dn||V||}|||r||V|g}q|rt|dkr|dn||VdSNr6r)rHr
startswith_fwsr7r,pop_trailing_wsr*)r&klassthisr;Zend_wsrrrpartss

zTokenList.partscCs|dSr()rVr-rrrrVszTokenList.startswith_fwscCs$|djdkr|dS|dS)Nrfws)
token_typepopr9r-rrrr9s
zTokenList.pop_leading_fwscCs$|djdkr|dS|dS)Ncfws)r\r]rWr-rrrrWs
zTokenList.pop_trailing_wscCs|D]}|jrdSqdS)NTF)r8)r&partrrrr8szTokenList.has_fwscCs|dSr()has_leading_commentr-rrrra"szTokenList.has_leading_commentcCsg}|D]}||jq|Sr/)r)comments)r&rbr;rrrrb%szTokenList.commentscKs@|d}|d=|jptd}t||}|||t|S)Nr z+inf)max_line_lengthfloatrr:r0r)r&Z_3to2kwargsr rfoldedrrrfold,s

zTokenList.foldcCs`g}|}|r|||djdkr2|dnd}|tt||||d|S)Nr^r[r2)r9r*r\r]_ewencoderr3)r&charsetresr=trailerrrras_encoded_word5s

zTokenList.as_encoded_wordcCs*g}|D]}||||qd|Sr1)r*
cte_encoder3)r&rir rjr`rrrrmAszTokenList.cte_encodec	Cs|jD]}t|}t|}zt|dWnFtyrtdd|jDrTd}nd}|||j}t|}Yn0|	||rq|
}|durt|d|_|	|rq|j
r||q|||qdS)Nus-asciicss|]}t|tjVqdSr/
isinstancerUndecodableBytesDefectrJrrrrMNsz"TokenList._fold.<locals>.<genexpr>unknown-8bitutf-8r)rZrr7rhUnicodeEncodeErroranyrSrmr r?r9r]r"r8r:r*r.)r&rer`tstrtlenrir=rrrr:Gs2

zTokenList._foldr2cCstd|jdddSN
r2)indent)printr3_ppr&rzrrrpprintiszTokenList.pprintcCsd|jddSrx)r3r|r}rrrppstrlszTokenList.ppstrccsd||jj|jV|D]:}t|ds:|d|Vq||dD]
}|VqHq|jrjd|j}nd}d||VdS)Nz{}{}/{}(r|z*    !! invalid element in token list: {!r}z    z Defects: {}r2z{}){})rQrHr@r\hasattrr|rD)r&rzr;lineextrarrrr|os

z
TokenList._pp)r2)r2)r2)r@rArBr\r'r4rRpropertyrrSrZrVr9rWr8rarbrfrlrmr:r~rr|
__classcell__rrrGrrCs2

*

	"

rCc@s$eZdZeddZeddZdS)WhiteSpaceTokenListcCsdSN rr-rrrrszWhiteSpaceTokenList.valuecCsdd|DS)NcSsg|]}|jdkr|jqS)comment)r\contentrJrrr
<listcomp>rNz0WhiteSpaceTokenList.comments.<locals>.<listcomp>rr-rrrrbszWhiteSpaceTokenList.commentsN)r@rArBrrrbrrrrrs
rc@s eZdZdZddZddZdS)UnstructuredTokenListunstructuredc
Cstdd|Dr||Sd}|jD]}t|}d}zt|dWntytdd|jDrtd}nd}|durtd|j	|d|g
|}td	d|j	d|D}t|}	t|	}
||
|j
kr|j	|d=||	||
|_Yq&|
|}d
}Yn0|||r<|r&t|j	d}q&|sH|rT||q&|}|dur~t||_||r~q&|jr||q&|||d}q&dS)Ncss|]}|jdkVqdS)


 بدون مقدار اولیه ارور می‌دهد.

یک مثال اینجا داریم:

```js run
let arr = [];

// Error: Reduce of empty array with no initial value
// .آن را برای آرایه خالی برمی‌گرداند reduce ،اگر مقدار اولیه وجود داشت
arr.reduce((sum, current) => sum + current);
```

بنابراین توصیه می‌شود همیشه مقدار اولیه را تعیین کنید.

متد [arr.reduceRight](mdn:js/Array/reduceRight) کار یکسان را انجام می‌هد، اما از راست به چپ.

##متد Array.isArray

آرایه‌ها شکل جدیدی از انواع داده را شکل نمی‌دهند. آنها بر اساس شیءها هستند.

بنابراین `typeof` برای تشخیص یک شیء ساده از آرایه کمکی نمی‌کند:

```js run
alert(typeof {}); // object
alert(typeof []); // object (یکسان)
```

...اما آرایه‌ها به دلیل اینکه اغلب اوقات استفاده می‌شوند، یک متد خاص برای این کار دارند: [Array.isArray(value)](mdn:js/Array/isArray). این متد اگر `value` یک آرایه باشد `true` برمی‌گرداند و در غیر این صورت `false`.

```js run
alert(Array.isArray({})); // false

alert(Array.isArray([])); // true
```

## اکثر متدها از "thisArg" پشتیبانی می‌کنند

تقریبا تمام متدهای آرایه که تابعی را صدا می‌زنند -- مانند `find`، `filter`، `map`، همچنین یک استثنا از `sort`، پارامتر اختیاری اضافی `thisArg` را قبول می‌کنند.

این پارامتر به دلیل اینکه به ندرت استفاده می‌شود، در قسمت‌های بالایی گفته نشد. اما برای کامل بودن ما باید آن را پوشش دهیم.

سینتکس کامل این متدها در زیر آمده است:

```js
arr.find(func, thisArg);
arr.filter(func, thisArg);
arr.map(func, thisArg);
// ...
// آرگومان اختیاری آخر است thisArg
```

مقدار `thisArg` برای `func` برابر با `this` خواهد بود.

برای مثال، اینجا ما از متد شیء `army` به عنوان یک فیلتر اس


using System;
using System.Collections.ObjectModel;
using System.Linq;
using Microsoft.Playwright;
using OpenQA.Selenium;
using TomLonghurst.Selenium.PlaywrightWebDriver.Extensions;
using Cookie = OpenQA.Selenium.Cookie;

namespace TomLonghurst.Selenium.PlaywrightWebDriver;

public class PlaywrightCookieJar : ICookieJar
{
    private readonly PlaywrightWebDriver _playwrightWebDriver;

    public PlaywrightCookieJar(PlaywrightWebDriver playwrightWebDriver)
    {
        _playwrightWebDriver = playwrightWebDriver;
    }

    public void AddCookie(Cookie cookie)
    {
        _playwrightWebDriver.Context.AddCookiesAsync(new[]
        {
            MapCookie(cookie)
        }).Synchronously();
    }

    private SameSiteAttribute? MapSameSite(string sameSite)
    {
        if (Enum.TryParse<SameSiteAttribute>(sameSite, true, out var attr))
        {
            return attr;
        }

        return null;
    }

    public Cookie? GetCookieNamed(string name)
    {
        return AllCookies
            .FirstOrDefault(x => x.Name == name);
    }

    public void DeleteCookie(Cookie cookie)
    {
        DeleteCookieNamed(cookie.Name);
    }

    public void DeleteCookieNamed(string name)
    {
        var cookies = AllCookies;

        var cookiesToDelete = cookies.Where(x => x.Name == name);

        DeleteAllCookies();

        foreach (var cookie in cookies.Except(cookiesToDelete))
        {
            AddCookie(cookie);
        }
    }

    public void DeleteAllCookies()
    {
        _playwrightWebDriver.Context.Clea


2-notes]: https://github.com/mozilla/rust/blob/1.0.0-alpha.2/RELEASES.md
[1.0.0-alpha.2-tar]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2.tar.gz
[1.0.0-alpha.2-tar-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2.tar.gz.asc
[1.0.0-alpha.2-windows-x64]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-pc-windows-gnu.exe
[1.0.0-alpha.2-windows-x64-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-pc-windows-gnu.exe.asc
[1.0.0-alpha.2-windows-x32]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-pc-windows-gnu.exe
[1.0.0-alpha.2-windows-x32-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-pc-windows-gnu.exe.asc
[1.0.0-alpha.2-windows-msi-x64]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-pc-windows-gnu.msi
[1.0.0-alpha.2-windows-msi-x64-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-pc-windows-gnu.msi.asc
[1.0.0-alpha.2-windows-msi-x32]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-pc-windows-gnu.msi
[1.0.0-alpha.2-windows-msi-x32-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-pc-windows-gnu.msi.asc
[1.0.0-alpha.2-linux-x64]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-unknown-linux-gnu.tar.gz
[1.0.0-alpha.2-linux-x64-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-unknown-linux-gnu.tar.gz.asc
[1.0.0-alpha.2-linux-x32]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-unknown-linux-gnu.tar.gz
[1.0.0-alpha.2-linux-x32-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-unknown-linux-gnu.tar.gz.asc
[1.0.0-alpha.2-osx-x64-pkg]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-apple-darwin.pkg
[1.0.0-alpha.2-osx-x64-pkg-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-x86_64-apple-darwin.pkg.asc
[1.0.0-alpha.2-osx-x32-pkg]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-apple-darwin.pkg
[1.0.0-alpha.2-osx-x32-pkg-sig]: https://static.rust-lang.org/dist/rust-1.0.0-alpha.2-i686-a


*16,  8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 };

	UINT8 *tmp = (UINT8*)BurnMalloc(0x2000);
	if (!tmp) return;

	memcpy (tmp, Gfx0, 0x1000);

	GfxDecode(0x100, 2,  8,  8, CharPlane, CharXOffs, CharYOffs, 0x040, tmp, Gfx0);

	memcpy (tmp, Gfx1, 0x1000);

	GfxDecode(0x040, 2, 16, 16, SpriPlane, SpriXOffs, SpriYOffs, 0x100, tmp, Gfx1);

	BurnFree (tmp);
}

static INT32 MemIndex()
{
	UINT8 *Next; Next = AllMem;

	DrvROM          = Next; Next += 0x10000;

	Gfx0            = Next; Next += 0x08000;
	Gfx1            = Next; Next += 0x08000;
	Gfx2            = Next; Next += 0x08000;

	Prom            = Next; Next += 0x00080;

	Palette	        = (UINT32 *)Next; Next += 0x00140 * sizeof(UINT32);

	AllRam			= Next;

	DrvRAM          = Next; Next += 0x01000;
	DrvVidRAM       = Next; Next += 0x00800;
	DrvSpriteRAM    = Next; Next += 0x00100;

	RamEnd			= Next;

	dacbuf          = (INT16*)Next; Next += nBurnSoundLen * 2 * sizeof(INT16);

	MemEnd          = Next;

	return 0;
}

static INT32 DrvInit()
{
	AllMem = NULL;
	MemIndex();
	INT32 nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
	memset(AllMem, 0, nLen);
	MemIndex();

	{
		if(BurnLoadRom(DrvROM + 0x0000,  0, 1)) return 1;
		if(BurnLoadRom(DrvROM + 0x0800,  1, 1)) return 1;
		if(BurnLoadRom(DrvROM + 0x1000,  2, 1)) return 1;
		if(BurnLoadRom(DrvROM + 0x1800,  3, 1)) return 1;

		if(BurnLoadRom(Gfx0 + 0x0000,  4, 1)) return 1;
		if(BurnLoadRom(Gfx0 + 0x0800,  5, 1)) return 1;

		if(BurnLoadRom(Gfx1 + 0x0000,  6, 1)) return 1;
		if(BurnLoadRom(Gfx1 + 0x0800,  7, 1)) return 1;

		if(BurnLoadRom(Prom + 0x0000,  8, 1)) return 1;
		if(BurnLoadRom(Prom + 0x0020,  9, 1)) return 1;
		if(BurnLoadRom(Prom + 0x0040,  10, 1)) return 1;

		palette_init();
		gfx_decode();
	}

	ZetInit(0);
	ZetOpen(0);
	ZetSetInHandler(port_read);
	ZetSetOutHandler(port_write);
	ZetMapMemory(DrvROM,            0x0000, 0x1fff, MAP_ROM);
	ZetMapMemory(DrvRAM,            0x3000, 0x33ff, MAP_RAM);
	ZetMapMemory(DrvVidRAM,         0x3800, 0x3bff, MAP_RAM);
	ZetClose();

	DACInit(0, 0, 0, DrvSyncDAC);
	DACSetRoute(0, 0.50, BURN_SND_ROUTE_BOTH);

	GenericTilesInit();

#ifdef USE_SAMPLE_HACK
	BurnUpdateProgress(0.0, _T("Loading samples..."), 0);
	bBurnSample


ubleListOf(1.0, 2.0, 3.0, 4.0, 5.0)

    @Test
    fun emptyConstruction() {
        val l = mutableDoubleListOf()
        assertEquals(0, l.size)
        assertEquals(16, l.capacity)
    }

    @Test
    fun sizeConstruction() {
        val l = MutableDoubleList(4)
        assertEquals(4, l.capacity)
    }

    @Test
    fun contentConstruction() {
        val l = mutableDoubleListOf(1.0, 2.0, 3.0)
        assertEquals(3, l.size)
        assertEquals(1.0, l[0])
        assertEquals(2.0, l[1])
        assertEquals(3.0, l[2])
        assertEquals(3, l.capacity)
        repeat(2) {
            val l2 = mutableDoubleListOf(1.0, 2.0, 3.0, 4.0, 5.0)
            assertEquals(list, l2)
            l2.removeAt(0)
        }
    }

    @Test
    fun hashCodeTest() {
        val l2 = mutableDoubleListOf(1.0, 2.0, 3.0, 4.0, 5.0)
        assertEquals(list.hashCode(), l2.hashCode())
        l2.removeAt(4)
        assertNotEquals(list.hashCode(), l2.hashCode())
        l2.add(5.0)
        assertEquals(list.hashCode(), l2.hashCode())
        l2.clear()
        assertNotEquals(list.hashCode(), l2.hashCode())
    }

    @Test
    fun equalsTest() {
        val l2 = mutableDoubleListOf(1.0, 2.0, 3.0, 4.0, 5.0)
        assertEquals(list, l2)
        assertNotEquals(list, mutableDoubleListOf())
        l2.removeAt(4)
        assertNotEquals(list, l2)
        l2.add(5.0)
        assertEquals(list, l2)
        l2.clear()
        assertNotEquals(list, l2)
    }

    @Test
    fun string() {
        assertEquals("[${1.0}, ${2.0}, ${3.0}, ${4.0}, ${5.0}]", list.toString())
        assertEquals("[]", mutableDoubleListOf().toString())
    }

    @Test
    fun joinToString() {
        assertEquals("${1.0}, ${2.0}, ${3.0}, ${4.0}, ${5.0}", list.joinToString())
        assertEquals(
            "x${1.0}, ${2.0}, ${3.0}, ...y",
            list.joinToString(prefix = "x", postfix = "y", limit = 3)
        )
        assertEquals(
            ">${1.0}-${2.0}-${3.0}-${4.0}-${5.0}<",
            list.joinToString(separator = "-", prefix = ">", postfix = "<")
        )
        assertEquals("one, two, three, ...", list.joinToString(limit = 3) {
            when (it) {
                1.0 -> "one"
                2.0 -> "two"
                3.0 -> "three"
                else -> "whoops"
            }
        })
    }

    @Test
    fun size() {
        assertEquals(5, list.size)
        assertEquals(5, list.count())
        val l2 = mutableDoubleListOf()
        assertEquals(0, l2.size)
        assertEquals(0, l2.count())
        l2 += 1.0
        assertEquals(1, l2.size)
        assertEquals(1, l2.count())
    }

    @Test
    fun get() {
        assertEquals(1.0, list[0])
        assertEquals(5.0, list[4])
        assertEquals(1.0, list.elementAt(0))
        assertEquals(5.0, list.elementAt(4))
    }

    @Test
    fun getOutOfBounds() {
        assertFailsWith(IndexOutOfBoundsException::class) {
            list[5]
        }
    }

    @Test
    fun getOutOfBoundsNegative() {
        assertFailsWith(IndexOutOfBoundsException::class) {
            list[-1]
        }
    }

    @Test
    fun elementAtOfBounds() {
        assertFailsWith(IndexOutOfBoundsException::class) {
            list.elementAt(5)


 3 3 f . . .
                . . . f f f f f f f f f f . . .
                . . . . . f f . . f f . . . . .
            `, RUNNER_SPRITE_KIND)
        } else {
            runnerSprite.say("")
            runnerSprite.setImage(img`
                . . . . . . 5 . 5 . . . . . . .
                . . . . . f 5 5 5 f f . . . . .
                . . . . f 1 5 2 5 1 6 f . . . .
                . . . f 1 6 6 6 6 6 1 6 f . . .
                . . . f 6 6 f f f f 6 1 f . . .
                . . . f 6 f f d d f f 6 f . . .
                . . f 6 f d f d d f d f 6 f . .
                . . f 6 f d 3 d d 3 d f 6 f . .
                . . f 6 6 f d d d d f 6 6 f . .
                . f 6 6 f 3 f f f f 3 f 6 6 f .
                . . f f d 3 5 3 3 5 3 d f f . .
                . . f d d f 3 5 5 3 f d d f . .
                . . . f f 3 3 3 3 3 3 f f . . .
                . . . f 3 3 5 3 3 5 3 3 f . . .
                . . . f f f f f f f f f f . . .
                . . . . . f f . . f f . . . . .
            `)
        }

        _currentDirection = CollisionDirection.Bottom

        tiles.setTilemap(levelTilemaps[level - 1])
        tiles.placeOnRandomTile(runnerSprite, sprites.dungeon.stairNorth)

        runnerLoading()

        if (levelCallbacks[level - 1] == null) {
            runnerSprite.say("第" + level + "关的程序载入失败")
            pauseImpl(2000)
            runnerSprite.say("请在'当进入第" + level + "关'内写好程序")
            pauseImpl(5000)
        } else {
            runnerSprite.say("开始按程序运行")
            pauseImpl(1000)

            levelCallbacks[level-1]()

            if (!levelFinished) {
                runnerSprite.say("没有指令了，不知道接下来要做什么")
                pauseImpl(1000)
                _levelResults.push({
                    line:"Level " + level,
                    isCorrect:false,
                    oneline:true
                })
                levelFinished = true
            } else {
                _levelResults.push({
                    line:"Level " + level,
                    isCorrect:true,
                    oneline:true
                })
            }
        }
    }

    //朝向前进
    function moveInDirection(direction:CollisionDirection) {
        let directionMeta :DirectionMeta = null
        switch(direction) {
            case CollisionDirection.Top:
                directionMeta = UP;
                break;
            case CollisionDirection.Right:
                directionMeta = RIGHT;
                break;
            case CollisionDirection.Bottom:
                directionMeta = DOWN;
                break;
            case CollisionDirection.Left:
                directionMeta = LEFT;
                break;
        }

        runnerSprite.x += directionMeta.deltaX
        runnerSprite.y += directionMeta.deltaY

        runnerSprite.setImage(directionMeta.spriteImage)

        runnerSprite.say('前进')
    }

    let navigatingTimestamp = 0

    function navigateLevel(level : number) {
        settings.writeNumber("navigatingLevel", level)
        destroyAllNaviSprites()
        let startPointSprite = sprites.create(img`
            . . . . . . 5 . 5 . . . . . . .
            . .


nSpec;
                case PaletteButtonStyle.BreadCrumb:
                    return ButtonStyle.BreadCrumb;
                case PaletteButtonStyle.Cluster:
                    return ButtonStyle.Cluster;
                case PaletteButtonStyle.NavigatorStack:
                    return ButtonStyle.NavigatorStack;
                case PaletteButtonStyle.NavigatorOverflow:
                    return ButtonStyle.NavigatorOverflow;
                case PaletteButtonStyle.NavigatorMini:
                    return ButtonStyle.NavigatorMini;
                case PaletteButtonStyle.InputControl:
                    return ButtonStyle.InputControl;
                case PaletteButtonStyle.ListItem:
                    return ButtonStyle.ListItem;
                case PaletteButtonStyle.Form:
                    return ButtonStyle.Form;
                case PaletteButtonStyle.FormClose:
                    return ButtonStyle.FormClose;
                case PaletteButtonStyle.Command:
                    return ButtonStyle.Command;
                case PaletteButtonStyle.Custom1:
                    return ButtonStyle.Custom1;
                case PaletteButtonStyle.Custom2:
                    return ButtonStyle.Custom2;
                case PaletteButtonStyle.Custom3:
                    return ButtonStyle.Custom3;
                default:
                    // Should never happen!
                    Debug.Assert(false);
                    return ButtonStyle.Standalone;
            }
        }
        #endregion

        #region Implementation
        private void OnImageStateChanged(object sender, NeedLayoutEventArgs e)
        {
            OnButtonSpecPropertyChanged(@"Image");
        }
        #endregion
    }
}


938652,
    s = 0.0,
    h = 0.68402922153473
  },
  [30105] = {
    v = 0.90441995859146,
    s = 0.1000000089407,
    h = 0.64915418624878
  },
  [402] = 4022303,
  [101] = 0,
  [102] = 1022010,
  [103] = 1032010,
  [104] = 0,
  [20201] = 0.2524795069839,
  [20202] = 0.38207390194847,
  [20203] = 0.6,
  [20204] = 0.5,
  [20205] = false,
  [20206] = {
    v = 0.34509803921569,
    s = 0.11363636363636,
    h = 0.66666666666667
  },
  [30106] = {
    v = 0.10000000149012,
    s = 0.10000005364418,
    h = 0.67466306686401
  },
  [405] = 4052302,
  [30104] = {
    v = 0.10000000149012,
    s = 0.10000005364418,
    h = 0.66909992694855
  },
  [20105] = false,
  [40202] = {
    v = 0.10000000149012,
    s = 0.0,
    h = 0.25180053710938
  },
  [17] = 0.1,
  [10101] = {
    v = 0.27698764204979,
    s = 0.31928169727325,
    h = 0.68683910369873
  },
  [10102] = true,
  [10103] = {
    v = 0.15788425505161,
    s = 0.32416576147079,
    h = 0.6578540802002
  },
  [10104] = 0.8,
  [10105] = false,
  [10106] = {
    v = 0.66274899244308,
    s = 0.27533081173897,
    h = 0.66729307174683
  },
  [10107] = false,
  [10108] = {
    v = 0.0,
    s = 0.0,
    h = 0.0
  },
  [40701] = {
    v = 0.78487509489059,
    s = 0.49508967995644,
    h = 0.71431279182434
  },
  [406] = 4062301,
  [407] = 4072002
}
return FaceRandomData


RP amount
    NonXrpAmount,
}

/// Flags for [slot_type]
#[derive(Clone, Copy)]
pub enum SlotTypeFlags {
    /// Field
    Field,
    /// STI_AMOUNT type contains a native (XRP) amount
    XrpAmount,
}

/// Field type
#[allow(missing_docs)]
#[derive(Clone, Copy)]
#[repr(u32)]
pub enum FieldId {
    Generic = _c::sfGeneric,
    LedgerEntry = _c::sfLedgerEntry,
    Transaction = _c::sfTransaction,
    Validation = _c::sfValidation,
    Metadata = _c::sfMetadata,
    Hash = _c::sfHash,
    Index = _c::sfIndex,
    CloseResolution = _c::sfCloseResolution,
    Method = _c::sfMethod,
    TransactionResult = _c::sfTransactionResult,
    TickSize = _c::sfTickSize,
    UNLModifyDisabling = _c::sfUNLModifyDisabling,
    LedgerEntryType = _c::sfLedgerEntryType,
    TransactionType = _c::sfTransactionType,
    SignerWeight = _c::sfSignerWeight,
    Version = _c::sfVersion,
    Flags = _c::sfFlags,
    SourceTag = _c::sfSourceTag,
    Sequence = _c::sfSequence,
    PreviousTxnLgrSeq = _c::sfPreviousTxnLgrSeq,
    LedgerSequence = _c::sfLedgerSequence,
    CloseTime = _c::sfCloseTime,
    ParentCloseTime = _c::sfParentCloseTime,
    SigningTime = _c::sfSigningTime,
    Expiration = _c::sfExpiration,
    TransferRate = _c::sfTransferRate,
    WalletSize = _c::sfWalletSize,
    OwnerCount = _c::sfOwnerCount,
    DestinationTag = _c::sfDestinationTag,
    HighQualityIn = _c::sfHighQualityIn,
    HighQualityOut = _c::sfHighQualityOut,
    LowQualityIn = _c::sfLowQualityIn,
    LowQualityOut = _c::sfLowQualityOut,
    QualityIn = _c::sfQualityIn,
    QualityOut = _c::sfQualityOut,
    StampEscrow = _c::sfStampEscrow,
    BondAmount = _c::sfBondAmount,
    LoadFee = _c::sfLoadFee,
    OfferSequence = _c::sfOfferSequence,
    FirstLedgerSequence = _c::sfFirstLedgerSequence,
    LastLedgerSequence = _c::sfLastLedgerSequence,
    TransactionIndex = _c::sfTransactionIndex,
    OperationLimit = _c::sfOperationLimit,
    ReferenceFeeUnits = _c::sfReferenceFeeUnits,
    ReserveBase = _c::sfReserveBase,
    ReserveIncrement = _c::sfReserveIncrement,
    SetFlag = _c::sfSetFlag,
    ClearFlag = _c::sfClearFlag,
    SignerQuorum = _c::sfSignerQuorum,
    CancelAfter = _c::sfCancelAfter,
    FinishAfter = _c::sfFinishAfter,
    SignerListID = _c::sfSignerListID,
    SettleDelay = _c::sfSettleDelay,
    HookStateCount = _c::sfHookStateCount,
    HookReserveCount = _c::sfHookReserveCount,
    HookDataMaxSize = _c::sfHookDataMaxSize,
    EmitGeneration = _c::sfEmitGeneration,
    IndexNext = _c::sfIndexNext,
    IndexPrevious = _c::sfIndexPrevious,
    BookNode = _c::sfBookNode,
    OwnerNode = _c::sfOwnerNode,
    BaseFee = _c::sfBaseFee,
    ExchangeRate = _c::sfExchangeRate,
    LowNode = _c::


[PixelFS Desktop](https://github.com/pixelfs/pixelfs-desktop/releases) to download the desktop version of `PixelFS`.

![](./screenshots/dark_1.png)
![](./screenshots/light_1.png)

### Command Line Installation

::: details Ubuntu/Dedian
```shell
# Download the PixelFS binary (choose the version as needed)
wget https://github.com/pixelfs/pixelfs/releases/download/v1.1.4/pixelfs_1.1.4_linux_amd64.deb

# Install PixelFS
sudo dpkg -i pixelfs_1.1.4_linux_amd64.deb

# Start the PixelFS service (run in user mode)
systemctl --user start pixelfs
systemctl --user enable pixelfs

# Enable lingering session so that the user's services remain running even after the user logs out
loginctl enable-linger
```
:::

::: details CentOS/RHEL
```shell
# Download the PixelFS binary (choose the version as needed)
wget https://github.com/pixelfs/pixelfs/releases/download/v1.1.4/pixelfs_1.1.4_linux_amd64.rpm

# Install PixelFS
sudo rpm -i pixelfs_1.1.4_linux_amd64.rpm

# Start the PixelFS service (run in user mode)
systemctl --user start pixelfs
systemctl --user enable pixelfs

# Enable lingering session so that the user's services remain running even after the user logs out
loginctl enable-linger
```
:::

::: details MacOS
```shell
# Install PixelFS using Homebrew
brew tap pixelfs/tap
brew install pixelfs

# Start the PixelFS service
brew services start pixelfs
```
:::

#### Manual Installation

1. Go to [Releases](https://github.com/pixelfs/pixelfs/releases) and download the `PixelFS` binary suitable for your operating system and architecture.
2. Extract the downloaded file and move the extracted binary to a system path (e.g., /usr/local/bin) or add its directory to your system’s PATH environment variable.

```shell
mv pixelfs /usr/local/bin/
chmod +x /usr/local/bin/pixelfs
```

3. Start the PixelFS daemon (optional):

```shell
pixelfs daemon
```

::: warning
If the `daemon` service is not started, `PixelFS` will not manage files on this device.
:::

## Login

Command: `pixelfs auth login`

After running the command, the terminal will output a login URL, for example:

```text
To authenticate, Please visit:

    https://www.pixelfs.io/auth/cli/d9e5ccb055924bc4d0801a56524766d52f0c26397e9f431abb19ada6be9c16df

Waiting for session...
```

Login steps:
1.	Copy the generated login URL.
2.	Open the URL in a browser and follow the instructions to complete the login process.
3.	Once logged in, the terminal will automatically complete authentication and be ready for use.

## Add a Storage Location

Command: `pixelfs location add`

```shell
pixelfs location add \
    --node-id=0x29e3abdb587207dc4ac9c708670eefde717ef307 \
    --path=/path/to/data \
    --name=location-data
```

Parameter descriptions:

- `--node-id`: Node ID, identifies the storage node.
- `--path`: Path to store data. PixelFS will manage files within this path.
- `--name`: Name of the storage location, must be unique within the same node for easier identification and management.

::: tip
You can use `pixelfs id` to view the Node ID.
:::

## Add S3 Storage Information

Command: `pixelfs storage add`

```shell
pixelfs storage add \
	--type=s3 \
	--region='auto' \
	--endpoint='https://xxxxxx.r2.cloudflarestorage.com


tx->padding[i] = padding & SMFC_PADDING_MASK;
			padding >>= SMFC_PADDING_WIDTH;
		}
		break;
	case V4L2_CID_JPEG_SEC_PADDING:
		/*
		 * Padding format should be the following:
		 * - Bits[0:7] is padding for first plane
		 * - Bits[8:15] is padding for second plane, or zero if there is no second plane
		 * - Bits[16:23] is padding for third plane, or zero if there is no third plane
		 * - Bits [24:31] should be zero
		 */
		padding = (unsigned int)ctrl->val;
		for (i = 0; i < SMFC_MAX_PLANES / 2; i++) {
			ctx->thumb_padding[i] = padding & SMFC_PADDING_MASK;
			padding >>= SMFC_PADDING_WIDTH;
		}
		break;
	default:
		dev_err(ctx->smfc->dev, "Unsupported CID %#x\n", ctrl->id);
		return -EINVAL;
	}

	return 0;
}

static const struct v4l2_ctrl_ops smfc_ctrl_ops = {
	.s_ctrl = smfc_s_ctrl,
};

int smfc_init_controls(struct smfc_dev *smfc, struct v4l2_ctrl_handler *hdlr)
{
	struct smfc_ctx *ctx = container_of(hdlr, struct smfc_ctx, v4l2_ctrlhdlr);
	const char *msg;
	struct v4l2_ctrl_config ctrlcfg;

	v4l2_ctrl_handler_init(hdlr, 1);

	if (!v4l2_ctrl_new_std(hdlr, &smfc_ctrl_ops,
			       V4L2_CID_JPEG_COMPRESSION_QUALITY, 1, 100, 1, 96)) {
		msg = "quality factor";
		goto err;
	}

	if (!v4l2_ctrl_new_std(hdlr, &smfc_ctrl_ops, V4L2_CID_JPEG_RESTART_INTERVAL, 0, 64, 1, 0)) {
		msg = "restart interval";
		goto err;
	}

	if (!v4l2_ctrl_new_std_menu(hdlr, &smfc_ctrl_ops,
				    V4L2_CID_JPEG_CHROMA_SUBSAMPLING,
				    V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY, 0,
				    V4L2_JPEG_CHROMA_SUBSAMPLING_422)) {
		msg = "chroma subsampling";
		goto err;
	}

	memset(&ctrlcfg, 0, sizeof(ctrlcfg));
	ctrlcfg.ops = &smfc_ctrl_ops;
	ctrlcfg.id = V4L2_CID_JPEG_SEC_COMP_QUALITY;
	ctrlcfg.name = "Quality factor of secondray image";
	ctrlcfg.type = V4L2_CTRL_TYPE_INTEGER;
	ctrlcfg.min = 1;
	ctrlcfg.max = 100;
	ctrlcfg.step = 1;
	ctrlcfg.def = 50;
	if (!v4l2_ctrl_new_custom(hdlr, &ctrlcfg, NULL)) {
		msg = "secondary quality factor";
		goto err;
	}

	memset(&ctrlcfg, 0, sizeof(ctrlcfg));
	ctrlcfg.ops = &smfc_ctrl_ops;
	ctrlcfg.id = V4L2_CID_JPEG_HWFC_ENABLE;
	ctrlcfg.name = "HWFC configuration";
	ctrlcfg.type = V4L2_CTRL_TYPE_BOOLEAN;
	ctrlcfg.min = 0;
	ctrlcfg.max = 1;
	ctrlcfg.step = 1;
	ctrlcfg.def = 0;
	if (!v4l2_ctrl_new_custom(hdlr, &ctrlcfg, NULL)) {
		msg = "secondary quality factor";
		goto err;
	}

	memset(&ctrlcfg, 0, sizeof(ctrlcfg));
	ctrlcfg.ops = &smfc_ctrl_ops;
	ctrlcfg.id = V4L2_CID_JPEG_QTABLES2;
	ctrlcfg.name = "Quantization table configration";
	ctrlcfg.type = V4L2_CTRL_TYPE_U8;
	ctrlcfg.min = 1;
	ctrlcfg.max = 255;
	ctrlcfg.step = 1;
	ctrlcfg.def = 1;
	ctrlcfg.dims[0] = SMFC_MCU_SIZE; /* A qtable has 64 values */
	ctrlcfg.dims[1] = 2; /* 2 qtables are required for 0:luma, 1:chroma */
	ctx->ctrl_qtbl2 = v4l2_ctrl_new_custom(hdlr, &ctrlcfg, NULL);
	if (!ctx->ctrl_qtbl2) {
		msg = "Q-Table";
		goto err;
	}

	memset(&ctrlcfg, 0, sizeof(ctrlcfg));
	ctrlcfg.ops = &smfc_ctrl_ops;
	ctrlcfg.id = V4L2_CID_JPEG_PADDING;
	ctrlcfg.name = "Main image per-plane padding";
	ctrlcfg.type = V4L2_CTRL_TYPE_INTEGER;
	ctrlcfg.min = 0;
	ctrlcfg.max = 0xFFFFFF;
	ctrlcfg.step = 1;
	ctrlcfg.def = 0;
	if (!v4l2_ctrl_new_custom(hdlr, &ctrlcfg, NULL)) {
		msg = "Main image padding";
		goto err;
	}

	memset(&ctrlcfg, 0, sizeof(ctrlcfg));
	ctrlcfg.ops = &smfc_ctrl_ops;
	ctrlcfg.id = V4L2_CID_JPEG_SEC_PADDING;
	ctrlcfg.name = "Secondary image per-plane padding";
	ctrlcfg.type = V4L2_CTRL_TYPE_INTEGER;
	ctrlcfg.min = 0;
	ctrlcfg.max = 0xFFFFFF;
	ctrlcfg.step = 1;
	ctrlcfg.def = 0;
	if (!v4l2_ctrl_new_custom(hdlr, &ctrlcfg, NULL)) {
		msg = "Secondary image padding";
		goto err;
	}

	return 0;
err:
	v4l2_ctrl_handler_free(hdlr);

	dev_err(smfc->dev, "Failed to install %s control (%d)\n", msg, hdlr->error);
	return hdlr->error;
}

static int smfc_v4l2_querycap(struct file *filp, void *fh, struct v4l2_capability *cap)
{
	struct smfc_dev *smfc = v4l2_fh_to_smfc_ctx(fh)->smfc;

	strncpy(cap->driver, MODULE_NAME, sizeof(cap->driver));
	strncpy(cap->bus_info, dev_name(smfc->dev), sizeof(cap->bus_info));
	scnprintf(cap->card, sizeof(cap->card), "Still MFC %02x.%02x.%04x",
		  (smfc->hwver >> 24) & 0xFF, (smfc->hwver >> 16) & 0xFF, smfc->hwver & 0xFFFF);

	cap->driver[sizeof(cap->driver) - 1] = '\0';
	cap->card[sizeof(cap->card) - 1] = '\0';
	cap->bus_info[sizeof(cap->bus_info) - 1] = '\0';

	cap->device_caps = smfc->devdata->device_caps;
	cap->device_caps |= V4L2_CAP_EXYNOS_JPEG_DMABUF_OFFSET;

	return 0;
}

static int smfc_v4l2_enum_fmt(struct file *filp, void *fh,


    }

    // Record any GPR64 dead Def as some unmarked GPR32 could be alias of its
    // low 32-bit.
    if (RegIsGPR64)
      GPR64DeadDefs.push_back(MO.getReg());
  }

  // No GPR32 live Def, safe to return false.
  if (GPR32LiveDefs.empty())
    return false;

  // No GPR64 dead Def, so all those GPR32 live Def can't have alias, therefore
  // must be truely live, safe to return true.
  if (GPR64DeadDefs.empty())
    return true;

  // Otherwise, return true if any aliased SuperReg of GPR32 is not dead.
  for (auto I : GPR32LiveDefs)
    for (MCPhysReg SR : TRI->superregs(I))
      if (!llvm::is_contained(GPR64DeadDefs, SR))
        return true;

  return false;
}

bool BPFMIPreEmitChecking::processAtomicInsts() {
  for (MachineBasicBlock &MBB : *MF) {
    for (MachineInstr &MI : MBB) {
      if (MI.getOpcode() != BPF::XADDW &&
          MI.getOpcode() != BPF::XADDD &&
          MI.getOpcode() != BPF::XADDW32)
        continue;

      LLVM_DEBUG(MI.dump());
      if (hasLiveDefs(MI, TRI)) {
        DebugLoc Empty;
        const DebugLoc &DL = MI.getDebugLoc();
        if (DL != Empty)
          report_fatal_error(Twine("line ") + std::to_string(DL.getLine()) +
                             ": Invalid usage of the XADD return value", false);
        else
          report_fatal_error("Invalid usage of the XADD return value", false);
      }
    }
  }

  // Check return values of atomic_fetch_and_{add,and,or,xor}.
  // If the return is not used, the atomic_fetch_and_<op> instruction
  // is replaced with atomic_<op> instruction.
  MachineInstr *ToErase = nullptr;
  bool Changed = false;
  const BPFInstrInfo *TII = MF->getSubtarget<BPFSubtarget>().getInstrInfo();
  for (MachineBasicBlock &MBB : *MF) {
    for (MachineInstr &MI : MBB) {
      if (ToErase) {
        ToErase->eraseFromParent();
        ToErase = nullptr;
      }

      if (MI.getOpcode() != BPF::XFADDW32 && MI.getOpcode() != BPF::XFADDD &&
          MI.getOpcode() != BPF::XFANDW32 && MI.getOpcode() != BPF::XFANDD &&
          MI.getOpcode() != BPF::XFXORW32 && MI.getOpcode() != BPF::XFXORD &&
          MI.getOpcode() != BPF::XFORW32 && MI.getOpcode() != BPF::XFORD)
        continue;

      if (hasLiveDefs(MI, TRI))
        continue;

      LLVM_DEBUG(dbgs() << "Transforming "; MI.dump());
      unsigned newOpcode;
      switch (MI.getOpcode()) {
      case BPF::XFADDW32:
        newOpcode = BPF::XADDW32;
        break;
      case BPF::XFADDD:
        newOpcode = BPF::XADDD;
        break;
      case BPF::XFANDW32:
        newOpcode = BPF::XANDW32;
        break;
      case BPF::XFANDD:
        newOpcode = BPF::XANDD;
        break;
      case BPF::XFXORW32:
        newOpcode = BPF::XXORW32;
        break;
      case BPF::XFXORD:
        newOpcode = BPF::XXORD;
        break;
      case BPF::XFORW32:
        newOpcode = BPF::XORW32;
        break;
      case BPF::XFORD:
        newOpcode = BPF::XORD;
        break;
      default:
        llvm_unreachable("Incorrect Atomic Instruction Opcode");
      }

      BuildMI(MBB, MI, MI.getDebug


|name   (char *)               |
    +------------------------------+
    |cpu_slab                      |  * per cpu variable pointer
    |   (struct kmem_cache_cpu*)   |
    |   +--------------------------+
    |   |stat[NR_SLUB_STAT_ITEMS]  |
    |   |  (unsigned)              |
    |   +--------------------------+
    |   |tid      (unsigned long)  |
    |   |                          |
    |   |freelist            ------|----+   = page->freelist
    |   |    (void **)             |    |
    |   |                          |    v
    |   |page                      |    +--------+--------+--------+--------+
    |   |   (struct page *)  A     |    |        |        |        |        |
    |   |   +----------------------+    +--------+--------+--------+--------+
    |   |   |freelist = NULL       |
    |   |   |inuse = objects       |
    |   |   |frozen = 1            |
    |   |   +----------------------+
    |   |                          |
    |   |partial             ------|--->+-----------+     +-----------+
    |   |   (struct page *)        |    |C      next|---->|B      next|
    |   |                          |    +-----------+     +-----------+
    |   |                          |    |pobjectsC  |  =  |pobjectsB  | + objectsC
    |   |                          |    |           |     |           |
    |   |                          |    |inuse <    |     |inuse <    |
    |   |                          |    | objectsC  |     | objectsB  |
    |   |                          |    |frozen = 1 |     |frozen = 1 |
    |   |                          |    +-----------+     +-----------+
    |   |                          |
    +---+--------------------------+
    |node[MAX_NUMNODES]            |
    |   (struct kmem_cache_node*)  |
    |   +--------------------------+
    |   |nr_partial  = 1           |
    |   |    (unsigned long)       |
    |   |partial               ----|--->+-----------+
    |   |    (struct list_head)    |    |C       lru|
    +---+--------------------------+    +-----------+
```
## 将一个满页加到node->partial上

当一个页上的所有空间都被分配，这个页将不存在任何地方。（除非配置了CONFIG_SLUB_DEBUG）。当释放满页上的一个对象时，这个页就会再次出现在node->partial上。

下图中为了清晰起见，我将配置了CONFIG_SLUB_DEBUG时的node->full链表头显示出。用来表示页的移动情况。

```
    kmem_cache
    +------------------------------+
    |name   (char *)               |
    +------------------------------+
    |cpu_slab                      |  * per cpu variable pointer
    |   (struct kmem_cache_cpu*)   |
    |   +--------------------------+
    |   |stat[NR_SLUB_STAT_ITEMS]  |
    |   |  (unsigned)              |
    |   +--------------------------+
    |   |tid      (unsigned long)  |
    |   |                          |
    |   |freelist            ------|----+   = page->freelist
    |   |    (void **)             |    |
    |   |                          |    v
    |   |page                      |    +--------+--------+--------+--------+
    |   |   (struct page *)  A     |    |        |        |        |        |
    |   |   +----------------------+    +--------+--------+--------+--------+
    |   |   |freelist = NULL       |
    |   |   |inuse = objects       |
    |   |   |frozen = 1            |
    |   |   +----------------------+
    |   |                          |
    |   |partial             ------|--->+-----------+
    |   |   (st


			continue;

		CTFGrenadePipebombProjectile *pGrenade = dynamic_cast < CTFGrenadePipebombProjectile*> ( pObjects[i] );
		if ( !pGrenade )
			continue;

		if ( pGrenade->m_iType != TF_GL_MODE_REMOTE_DETONATE )
			continue;

		if ( pGrenade->m_bFizzle )
			continue;

		UTIL_TraceLine( vecOrigin, pGrenade->GetAbsOrigin(), MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr );
		if ( tr.fraction < 1.0 )
			continue; // No line of sight to the bomb.

		pGrenade->Fizzle();
		pGrenade->Detonate();

		iStickiesRemoved++;

		bDetonateSticky = true;
	}

	CTFPlayer *pOwner = ToTFPlayer( GetThrower() );
	if ( iStickiesRemoved && pOwner )
	{
		pOwner->AwardAchievement( ACHIEVEMENT_TF_DEMOMAN_DESTROY_X_STICKYBOMBS, iStickiesRemoved );
	}

	return bDetonateSticky;
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFGrenadePipebombProjectile::CreatePipebombGibs( void )
{
	CPVSFilter filter( GetAbsOrigin() );
	UserMessageBegin( filter, "CheapBreakModel" );
		WRITE_SHORT( GetModelIndex() );
		WRITE_VEC3COORD( GetAbsOrigin() );
	MessageEnd();
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFGrenadePipebombProjectile::Fizzle( void )
{
	m_bFizzle = true;
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFGrenadePipebombProjectile::StickybombTouch( CBaseEntity *pOther )
{
#ifdef GAME_DLL
#ifdef TF_RAID_MODE
	if ( TFGameRules()->IsRaidMode() )
	{
		if ( dynamic_cast< CBossAlpha * >( pOther ) != NULL )
		{
			// stickies stick to the boss
			m_bTouched = true;
			VPhysicsGetObject()->EnableMotion( false );

			SetParent( pOther );
		}
	}
#endif
#endif
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFGrenadePipebombProjectile::PipebombTouch( CBaseEntity *pOther )
{
	if ( pOther == GetThrower() )
		return;

	// Verify a correct "other."
	if ( !pOther->IsSolid() || pOther->IsSolidFlagSet( FSOLID_VOLUME_CONTENTS ) )
		return;

	// Handle hitting skybox (disappear).
	trace_t pTrace;
	Vector velDir = GetAbsVelocity();
	VectorNormalize( velDir );
	Vector vOrigin = GetAbsOrigin();
	Vector vecSpot = vOrigin - velDir * 32;
	UTIL_TraceLine( vecSpot, vecSpot + velDir * 64, MASK_SOLID, this, COLLISION_GROUP_NONE, &pTrace );

	if ( pTrace.fraction < 1.0 && pTrace.surface.flags & SURF_SKY )
	{
		UTIL_Remove( this );
		return;
	}

	// PASSTIME always explode when it hits the ball
	// fixme find a non-strcmp way to do this
	if ( !V_strcmp( pOther->GetClassname(), "passtime_ball" ) )
	{
		Explode( &pTrace, GetDamageType() );
		return;
	}

	//If we already to


Mean",
            "Mid",
            "Millisecond",
            "Min",
            "Minute",
            "Month",
            "MultiPartToSinglePart",
            "Multipoint",
            "NextSequenceValue",
            "None",
            "Now",
            "Number",
            "Offset|0",
            "OrderBy",
            "Overlaps",
            "Point",
            "Polygon",
            "Polyline",
            "Pop",
            "Portal",
            "Pow",
            "Proper",
            "Push",
            "Random",
            "Reduce",
            "Relate",
            "Replace",
            "Resize",
            "Reverse",
            "Right|0",
            "RingIsClockwise",
            "Rotate",
            "Round",
            "Schema",
            "Second",
            "SetGeometry",
            "Simplify",
            "Sin",
            "Slice",
            "Sort",
            "Splice",
            "Split",
            "Sqrt",
            "Stdev",
            "SubtypeCode",
            "SubtypeName",
            "Subtypes",
            "Sum",
            "SymmetricDifference",
            "Tan",
            "Text",
            "Timestamp",
            "ToCharCode",
            "ToCodePoint",
            "Today",
            "ToHex",
            "ToLocal",
            "Top|0",
            "Touches",
            "ToUTC",
            "TrackAccelerationAt",
            "TrackAccelerationWindow",
            "TrackCurrentAcceleration",
            "TrackCurrentDistance",
            "TrackCurrentSpeed",
            "TrackCurrentTime",
            "TrackDistanceAt",
            "TrackDistanceWindow",
            "TrackDuration",
            "TrackFieldWindow",
            "TrackGeometryWindow",
            "TrackIndex",
            "TrackSpeedAt",
            "TrackSpeedWindow",
            "TrackStartTime",
            "TrackWindow",
            "Trim",
            "TypeOf",
            "Union",
            "Upper",
            "UrlEncode",
            "Variance",
            "Week",
            "Weekday",
            "When",
            "Within",
            "Year"
          ]
        }, contains: <Mode>[
          APOS_STRING_MODE,
          QUOTE_STRING_MODE,
          Mode(ref: '~contains~2'),
          Mode(
              className: 'number',
              variants: <Mode>[
                Mode(begin: "\\b(0[bB][01]+)"),
                Mode(begin: "\\b(0[oO][0-7]+)"),
                Mode(
                    begin:
                        "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)")
              ],
              relevance: 0),
          REGEXP_MODE
        ])
      ]),
      '~contains~2~contains~1~contains~3': Mode(
          className: 'number',
          variants: <Mode>[
            Mode(begin: "\\b(0[bB][01]+)"),
            Mode(begin: "\\b(0[oO][0-7]+)"),
            Mode(
                begin:
                    "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)")
          ],
          relevance: 0)
    },
    name: "ArcGIS Arcade",
    caseInsensitive: true,
    keywords: {
      "keyword": [
        "if",
        "for",
        "while",
        "var",
        "new",
        "function",
        "do",
        "return",
        "void",
        "else",
        "break"
      ],
      "literal": [
        "BackSlash",
        "DoubleQuote",
        "fa


IT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitAttributedStmt" << "\n";
#endif
    bool res = true;

    ROSE_ASSERT(FAIL_TODO == 0); // TODO

    return VisitValueStmt(attributed_stmt, node) && res;
}

bool ClangToSageTranslator::VisitExpr(clang::Expr * expr, SgNode ** node) {
#if DEBUG_VISIT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitExpr" << "\n";
#endif

     // TODO Is there anything to be done? (maybe in relation with typing?)

     return VisitValueStmt(expr, node);
}

bool ClangToSageTranslator::VisitAbstractConditionalOperator(clang::AbstractConditionalOperator * abstract_conditional_operator, SgNode ** node) {
#if DEBUG_VISIT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitAbstractConditionalOperator" << "\n";
#endif
     bool res = true;

     // TODO

     return VisitStmt(abstract_conditional_operator, node) && res;
}

bool ClangToSageTranslator::VisitBinaryConditionalOperator(clang::BinaryConditionalOperator * binary_conditional_operator, SgNode ** node) {
#if DEBUG_VISIT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitBinaryConditionalOperator" << "\n";
#endif
     bool res = true;

     SgNode * tmp_cond  = Traverse(binary_conditional_operator->getCond());
     SgExpression * cond_expr = isSgExpression(tmp_cond);
     ROSE_ASSERT(cond_expr);
     SgNode * tmp_true  = Traverse(binary_conditional_operator->getTrueExpr());
     SgExpression * true_expr = isSgExpression(tmp_true);
     ROSE_ASSERT(true_expr);
     SgNode * tmp_false = Traverse(binary_conditional_operator->getFalseExpr());
     SgExpression * false_expr = isSgExpression(tmp_false);
     ROSE_ASSERT(false_expr);

     *node = SageBuilder::buildConditionalExp(cond_expr, true_expr, false_expr);

     return VisitAbstractConditionalOperator(binary_conditional_operator, node) && res;
}

bool ClangToSageTranslator::VisitConditionalOperator(clang::ConditionalOperator * conditional_operator, SgNode ** node) {
#if DEBUG_VISIT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitConditionalOperator" << "\n";
#endif

    bool res = true;

    SgNode * tmp_cond  = Traverse(conditional_operator->getCond());
    SgExpression * cond_expr = isSgExpression(tmp_cond);
    ROSE_ASSERT(cond_expr);
    SgNode * tmp_true  = Traverse(conditional_operator->getTrueExpr());
    SgExpression * true_expr = isSgExpression(tmp_true);
    ROSE_ASSERT(true_expr);
    SgNode * tmp_false = Traverse(conditional_operator->getFalseExpr());
    SgExpression * false_expr = isSgExpression(tmp_false);
    ROSE_ASSERT(false_expr);

    *node = SageBuilder::buildConditionalExp(cond_expr, true_expr, false_expr);

    return VisitAbstractConditionalOperator(conditional_operator, node) && res;
}

bool ClangToSageTranslator::VisitAddrLabelExpr(clang::AddrLabelExpr * addr_label_expr, SgNode ** node) {
#if DEBUG_VISIT_STMT
    logger[DEBUG] << "ClangToSageTranslator::VisitAddrLabelExpr" << "\n";
#endif
     bool res = true;

     // TODO

     return VisitExpr(addr_label_expr, node) && res;


ception).
The operating system or system BIOS may disable this instruction by using the
IA32_MISC_ENABLE MSR; disabling MONITOR clears the CPUID feature flag and causes
execution to generate an invalid-opcode exception.

The instruction''s operation is the same in non-64-bit modes and 64-bit mode.

Operation:

MONITOR sets up an address range for the monitor hardware using the content of EAX (RAX in 64-bit mode) as an
effective address and puts the monitor hardware in armed state. Always use memory of the write-back caching
type. A store to the specified address range will trigger the monitor hardware. The content of ECX and EDX are
used to communicate other information to the monitor hardware.

Intel C/C++ Compiler Intrinsic Equivalent:
| MONITOR:| void _mm_monitor(void const *p, unsigned
|         | extensions,unsigned hints)

Numeric Exceptions:
None

Protected Mode Exceptions:
| #GP(0)         | If the value in EAX is outside the CS,
|                | DS, ES, FS, or GS segment limit. If
|                | the DS, ES, FS, or GS register is used
|                | to access memory and it contains a NULL
|                | segment selector. If ECX != 0.
| #SS(0)         | If the value in EAX is outside the SS
|                | segment limit.
| #PF(fault-code)| For a page fault.
| #UD            | If CPUID.01H:ECX.MONITOR[bit 3] = 0.
|                | If current privilege level is not 0.

Real Address Mode Exceptions:
| #GP| If the CS, DS, ES, FS, or GS register
|    | is used to access memory and the value
|    | in EAX is outside of the effective address
|    | space from 0 to FFFFH. If ECX != 0.
| #SS| If the SS register is used to access
|    | memory and the value in EAX is outside
|    | of the effective address space from
|    | 0 to FFFFH.
| #UD| If CPUID.01H:ECX.MONITOR[bit 3] = 0.

Virtual 8086 Mode Exceptions:
| #UD| The MONITOR instruction is not recognized
|    | in virtual-8086 mode (even if CPUID.01H:ECX.MONITOR[bit
|    | 3] = 1).

Compatibility Mode Exceptions:
Same exceptions as in protected mode.

64-Bit Mode Exceptions:
| #GP(0)         | If the linear address of the operand
|                | in the CS, DS, ES, FS, or GS segment
|                | is in a non-canonical form. If RCX !=
|                | 0.
| #SS(0)         | If the SS register is used to access
|                | memory and the value in EAX is in a
|                | non-canonical form.
| #PF(fault-code)| For a page fault.
| #UD            | If the current privilege level is not
|                | 0. If CPUID.01H:ECX.MONITOR[bit 3] =
|                | 0.
`,
"MOV":`
MOV - Move:
| Opcode                   | Instruction                   | Op/En| 64-Bit Mode| Compat/Leg Mode| Description
| 88 /r REX + 88 /r        | MOV r/m8,r8 MOV r/m8***,r8*** | MR MR| Valid Valid| Valid N.E.     | Move r8 to r/m8. Move r8 to r/m8.
| 89 /r                    | MOV r/m16,r16                 | MR   | Valid      | Valid          | Move r16 to r/m16.
| 89 /r                    | MOV r/m32,r32                 | MR   | Valid      | Valid          | Move r32 to r/m32.
| REX.W + 89 /r            | MOV r/m


  // MLDSA_Q = 8380417 = 0x7FE001
        movz w9, #0xE001
        movk w9, #0x7F, lsl #16
        dup q_reg.4s, w9        // Load Q values

        mov count, #64/4
poly_caddq_loop:
        ldr q0, [a_ptr, #0*16]
        ldr q1, [a_ptr, #1*16]
        ldr q2, [a_ptr, #2*16]
        ldr q3, [a_ptr, #3*16]

        caddq v0
        caddq v1
        caddq v2
        caddq v3

        str q1, [a_ptr, #1*16]
        str q2, [a_ptr, #2*16]
        str q3, [a_ptr, #3*16]
        str q0, [a_ptr], #4*16

        subs count, count, #1
        bne poly_caddq_loop

        ret

        .unreq a_ptr
        .unreq count
        .unreq q_reg
        .unreq tmp

#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */


 validator.Validate(&ValidateContext{
		Docs: []common.K8sManifest{manifest},
	})

	assert.False(t, pass)
	assert.Equal(t, []string{
		"DocumentIndex:	0",
		"Expected to be apiVersion:",
		"	v2",
		"Actual:",
		"	v1",
	}, diff)
}

func TestIsAPIVersionValidatorWhenNegativeAndFail(t *testing.T) {
	doc := "apiVersion: v1"
	manifest := makeManifest(doc)

	validator := IsAPIVersionValidator{"v1"}
	pass, diff := validator.Validate(&ValidateContext{
		Docs:     []common.K8sManifest{manifest},
		Negative: true,
	})

	assert.False(t, pass)
	assert.Equal(t, []string{
		"DocumentIndex:	0",
		"Expected NOT to be apiVersion:",
		"	v1",
	}, diff)
}

func TestIsAPIVersionValidatorWhenNegativeAndFailFast(t *testing.T) {
	doc := "apiVersion: v1"
	manifest := makeManifest(doc)

	validator := IsAPIVersionValidator{"v1"}
	pass, diff := validator.Validate(&ValidateContext{
		FailFast: true,
		Docs:     []common.K8sManifest{manifest, manifest},
		Negative: true,
	})

	assert.False(t, pass)
	assert.Equal(t, []string{
		"DocumentIndex:	0",
		"Expected NOT to be apiVersion:",
		"	v1",
	}, diff)
}

func TestIsAPIVersionValidatorWhenNoManifestFail(t *testing.T) {
	validator := IsAPIVersionValidator{"v1"}
	pass, diff := validator.Validate(&ValidateContext{
		Docs: []common.K8sManifest{},
	})

	assert.False(t, pass)
	assert.Equal(t, []string{
		"Expected to be apiVersion:",
		"\tv1",
		"Actual:",
		"\tno manifest found"}, diff)
}

func TestIsAPIVersionValidatorWhenNoManifestNegativeOk(t *testing.T) {
	validator := IsAPIVersionValidator{"v1"}
	pass, diff := validator.Validate(&ValidateContext{
		Docs:     []common.K8sManifest{},
		Negative: true,
	})

	assert.True(t, pass)
	assert.Equal(t, []string{}, diff)
}
package valueutils_test

import (
	"fmt"
	"testing"

	"github.com/helm-unittest/helm-unittest/internal/common"
	. "github.com/helm-unittest/helm-unittest/pkg/unittest/valueutils"
	"github.com/stretchr/testify/assert"

	v3util "helm.sh/helm/v3/pkg/chartutil"
)

func TestGetValueOfSetPathWithSingleResults(t *testing.T) {
	a := assert.New(t)
	data := common.K8sManifest{
		"a": map[string]any{
			"b":   []any{"_", map[string]any{"c": "yes"}},
			"d":   "no",
			"e.f": "false",
			"g":   map[string]any{"h": "\"quotes\""},
			"i":   []any{map[string]any{"i1": "1"}, map[string]any{"i2": "2"}},
		},
	}

	var expectionsMapping = map[string]any{
		"a.b[1].c":              "yes",
		"a.b[0]":                "_",
		"a.b":                   []any{"_", map[string]any{"c": "yes"}},
		"a['d']":                "no",
		"a[\"e.f\"]":            "false",
		"a.g.h":                 "\"quotes\"",
		"":                      data,
		"a.i[?(@.i1 == \"1\")]": map[string]any(map[string]any{"i1": "1"}),
	}

	for path, expect := range expectionsMapping {
		actual, err := GetValueOfSetPath(data, path)
		a.Equal(expect, actual[0])
		a.Nil(err)
	}
}

func TestGetValueOfSetPath


ptProvider.ShowDialog(checkResult, variantHandler.CanAutoInstall, variantHandler.RequiresUac);
                        }
                    }
                    catch (OperationCanceledException)
                    {
                        toastCts = null;
                        logger.Debug("Update toast cancelled. Moving to a dialog");
                        promptResult = updatePromptProvider.ShowDialog(checkResult, variantHandler.CanAutoInstall, variantHandler.RequiresUac);
                    }
                }

                remindLaterActive = false;
                switch (promptResult)
                {
                    case VersionPromptResult.InstallNow:
                        Debug.Assert(variantHandler.CanAutoInstall);
                        logger.Info("Auto-installing {0}", checkResult.NewVersion);
                        variantHandler.AutoInstall(PathToRestartApplication());
                        break;

                    case VersionPromptResult.Download:
                        logger.Info("Proceeding to download URL {0}", checkResult.DownloadUrl);
                        processStartProvider.StartDetached(checkResult.ReleasePageUrl);
                        break;

                    case VersionPromptResult.Ignore:
                        logger.Info("Ignoring version {0}", checkResult.NewVersion);
                        OnVersionIgnored(checkResult.NewVersion);
                        break;

                    cas


rewetka](https://github.com/krewetka))

## [3.35.1](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/compare/3.35.0...3.35.1) - 2021-11-25
### Fixed
- [[#1585](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1585)] Paginator set useOutputWalkers to false for query with joins ([@JustDylan23](https://github.com/JustDylan23))

## [3.35.0](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/compare/3.34.3...3.35.0) - 2021-07-20
### Added
- [[#1470](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1470)] `global_search` option to the `StringFilter` ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#1457](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1457)] `treat_null_as` option to BooleanFilter ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#1477](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1477)] `GroupableConditionAwareInterface` ([@VincentLanglet](https://github.com/VincentLanglet))

### Deprecated
- [[#1477](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1477)] "or_group" option in `Filter` objects ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#1477](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1477)] `Filter::$groupedOrExpressions` ([@VincentLanglet](https://github.com/VincentLanglet))

### Fixed
- [[#1473](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1473)] Deprecation from SonataAdminBundle 3.x ([@dmaicher](https://github.com/dmaicher))
- [[#1470](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1470)] Stop using `ChoiceTypeFilter` for global search ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#1477](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1477)] Not resetting `Filter::$groupedOrExpressions` static property (see sonata-project/SonataAdminBundle#7096) ([@VincentLanglet](https://github.com/VincentLanglet))

## [3.34.3](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/compare/3.34.2...3.34.3) - 2021-06-13
### Fixed
- [[#1455](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1455)] Export for admin with fetch join in the `configureQuery()` method ([@VincentLanglet](https://github.com/VincentLanglet))

## [3.34.2](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/compare/3.34.1...3.34.2) - 2021-05-31
### Fixed
- [[#1444](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/1444)] Fixed issue where pagination of large dataset would take very long time or cause database engine  to swap even for simplest queries without joins. ([@alfabetagama](https://github.com/alfabetagama))

## [3.34.1](https://github.com/sonata-project/SonataDoctrineORMAdminBundle/compare/3.34.0...3.34.1) - 2021-05-18
### Fixed
- [[#1439](https://github.com/sonata-project/So


fStepInfo data
 *
 *
 * @retval aclprofStepInfo pointer
 */
MSVP_PROF_API aclprofStepInfo* aclprofCreateStepInfo();

 /**
 * @ingroup AscendCL
 * @brief destroy aclprofStepInfo pointer
 *
 *
 * @retval void
 */
MSVP_PROF_API void aclprofDestroyStepInfo(aclprofStepInfo* stepinfo);

/**
* @ingroup AscendCL
* @brief create pointer to aclprofstamp
*
*
* @retval aclprofStamp pointer
*/
MSVP_PROF_API void *aclprofCreateStamp();

/**
* @ingroup AscendCL
* @brief destory stamp pointer
*
*
* @retval void
*/
MSVP_PROF_API void aclprofDestroyStamp(void *stamp);

/**
* @ingroup AscendCL
* @brief Record push timestamp
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
MSVP_PROF_API aclError aclprofPush(void *stamp);

/**
* @ingroup AscendCL
* @brief Record pop timestamp
*
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
MSVP_PROF_API aclError aclprofPop();

/**
* @ingroup AscendCL
* @brief Record range start timestamp
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
MSVP_PROF_API aclError aclprofRangeStart(void *stamp, uint32_t *rangeId);

/**
* @ingroup AscendCL
* @brief Record range end timestamp
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
MSVP_PROF_API aclError aclprofRangeStop(uint32_t rangeId);

/**
* @ingroup AscendCL
* @brief set message to stamp
*
*
* @retval void
*/
MSVP_PROF_API aclError aclprofSetStampTraceMessage(void *stamp, const char *msg, uint32_t msgLen);

/**
* @ingroup AscendCL
* @brief Record mark timestamp
*
* @retval ACL_SUCCESS The function is successfully executed.
* @retval OtherValues Failure
*/
MSVP_PROF_API aclError aclprofMark(void *stamp);

#ifdef __cplusplus
}
#endif

#endif // INC_EXTERNAL_ACL_PROF_H_


type AccountThemes interface {
	tl.Object
	ImplementsAccountThemes()
}
type AccountThemesObj struct {
	Hash   int32
	Themes []*Theme
}

func (*AccountThemesObj) CRC() uint32 {
	return 0x7f676421
}

func (*AccountThemesObj) ImplementsAccountThemes() {}

type AccountThemesNotModified struct{}

func (*AccountThemesNotModified) CRC() uint32 {
	return 0xf41eb622
}

func (*AccountThemesNotModified) ImplementsAccountThemes() {}

type AccountWallPapers interface {
	tl.Object
	ImplementsAccountWallPapers()
}
type AccountWallPapersObj struct {
	Hash       int32
	Wallpapers []WallPaper
}

func (*AccountWallPapersObj) CRC() uint32 {
	return 0x702b65a9
}

func (*AccountWallPapersObj) ImplementsAccountWallPapers() {}

type AccountWallPapersNotModified struct{}

func (*AccountWallPapersNotModified) CRC() uint32 {
	return 0x1c199183
}

func (*AccountWallPapersNotModified) ImplementsAccountWallPapers() {}

type AuthAuthorization interface {
	tl.Object
	ImplementsAuthAuthorization()
}
type AuthAuthorizationObj struct {
	TmpSessions int32 `tl:"flag:0"`
	User        User
}

func (*AuthAuthorizationObj) CRC() uint32 {
	return 0xcd050916
}

func (*AuthAuthorizationObj) FlagIndex() int {
	return 0
}

func (*AuthAuthorizationObj) ImplementsAuthAuthorization() {}

type AuthAuthorizationSignUpRequired struct {
	TermsOfService *HelpTermsOfService `tl:"flag:0"`
}

func (*AuthAuthorizationSignUpRequired) CRC() uint32 {
	return 0x44747e9a
}

func (*AuthAuthorizationSignUpRequired) FlagIndex() int {
	return 0
}

func (*AuthAuthorizationSignUpRequired) ImplementsAuthAuthorization() {}

type AuthLoginToken interface {
	tl.Object
	ImplementsAuthLoginToken()
}
type AuthLoginTokenObj struct {
	Expires int32
	Token   []byte
}

func (*AuthLoginTokenObj) CRC() uint32 {
	return 0x629f1980
}

func (*AuthLoginTokenObj) ImplementsAuthLoginToken() {}

type AuthLoginTokenMigrateTo struct {
	DcID  int32
	Token []byte
}

func (*AuthLoginTokenMigrateTo) CRC() uint32 {
	return 0x68e9916
}

func (*AuthLoginTokenMigrateTo) ImplementsAuthLoginToken() {}

type AuthLoginTokenSuccess struct {
	Authorization AuthAuthorization
}

func (*AuthLoginTokenSuccess) CRC() uint32 {
	return 0x390d5c5e
}

func (*AuthLoginTokenSuccess) ImplementsAuthLoginToken() {}

type AuthSentCodeType interface {
	tl.Object
	ImplementsAuthSentCodeType()
}
type AuthSentCodeTypeApp struct {
	Length int32
}

func (*AuthSentCodeTypeApp) CRC() uint32 {
	return 0x3dbb5986
}

func (*AuthSentCodeTypeApp) ImplementsAuthSentCodeType() {}

type AuthSentCodeTypeCall struct {
	Length int32
}

func (*AuthSentCodeTypeCall) CRC() uint32 {
	return 0x5353e5a7
}

func (*AuthSentCodeTypeCall) ImplementsAuthSentCodeType() {}

type AuthSentCodeTypeFlashCall struct {
	Pattern string
}

func (*AuthSentCodeTypeFlashCall) CRC() uint32 {
	return 0xab03c6d9
}

func (*AuthSentCodeTypeFlashCall) ImplementsAuthSentCodeType() {}

type AuthSentCodeTypeSms struct {
	Length int32
}

func (*AuthSentCodeTypeSms) CRC() uint32 {
	return 0xc000bba2
}

func (*AuthSentCodeTypeSms) ImplementsAuthSentCodeType() {}

type ChannelsChannelParticipants interface {
	tl.Ob


1.2 5.9-3.3 8l-9.4 9.4c-2.1 2.1-5 3.3-8 3.3h-16c-6.2 0-11.3-5.1-11.3-11.3zm128 306.4v-7.1c0-8.8-7.2-16-16-16h-20.2c-10.8 0-26.7-5.3-35.4-11.8l-22.2-16.7c-11.5-8.6-18.2-22.1-18.2-36.4v-23.9c0-16 8.4-30.8 22.1-39l42.9-25.7c7.1-4.2 15.2-6.5 23.4-6.5h31.2c10.9 0 21.4 3.9 29.6 10.9l43.2 37.1h18.3c8.5 0 16.6 3.4 22.6 9.4l17.3 17.3c3.4 3.4 8.1 5.3 12.9 5.3H423c-32.4 58.9-93.8 99.5-164.9 103.1z"],"golf-ball":[416,512,[],"f450","M96 416h224c0 17.7-14.3 32-32 32h-16c-17.7 0-32 14.3-32 32v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-20c0-17.7-14.3-32-32-32h-16c-17.7 0-32-14.3-32-32zm320-208c0 74.2-39 139.2-97.5 176h-221C39 347.2 0 282.2 0 208 0 93.1 93.1 0 208 0s208 93.1 208 208zm-180.1 43.9c18.3 0 33.1-14.8 33.1-33.1 0-14.4-9.3-26.3-22.1-30.9 9.6 26.8-15.6 51.3-41.9 41.9 4.6 12.8 16.5 22.1 30.9 22.1zm49.1 46.9c0-14.4-9.3-26.3-22.1-30.9 9.6 26.8-15.6 51.3-41.9 41.9 4.6 12.8 16.5 22.1 30.9 22.1 18.3 0 33.1-14.9 33.1-33.1zm64-64c0-14.4-9.3-26.3-22.1-30.9 9.6 26.8-15.6 51.3-41.9 41.9 4.6 12.8 16.5 22.1 30.9 22.1 18.3 0 33.1-14.9 33.1-33.1z"],gopuram:[512,512,[],"f664","M496 352h-16V240c0-8.8-7.2-16-16-16h-16v-80c0-8.8-7.2-16-16-16h-16V16c0-8.8-7.2-16-16-16s-16 7.2-16 16v16h-64V16c0-8.8-7.2-16-16-16s-16 7.2-16 16v16h-64V16c0-8.8-7.2-16-16-16s-16 7.2-16 16v16h-64V16c0-8.8-7.2-16-16-16S96 7.2 96 16v112H80c-8.8 0-16 7.2-16 16v80H48c-8.8 0-16 7.2-16 16v112H16c-8.8 0-16 7.2-


 手順

1. デバイスを起動します。

2. アプリのプライベートデータディレクトリの最初のコピーを作成 ([アプリデータディレクトリへのアクセス (Accessing App Data Directories)](../../../techniques/android/MASTG-TECH-0008.md)) し、オフライン解析の参照として所持します。たとえば [adb](../../../tools/android/MASTG-TOOL-0004.md) を使用できます。

3. アプリを起動して使用し、さまざまなワークフローを実行しながら、可能な限り機密データを入力します。入力したデータをメモしておくと、後でツールを使用して検索する際に、それを特定するのに役立ちます。

4. アプリのプライベートデータディレクトリの二つ目のコピーをオフライン解析用に作成し、最初のコピーを使用して差分を作成し、テストセッション時に作成または変更されたすべてのファイルを特定します。

## 結果

出力には実行時にアプリのプライベートストレージに作成されたファイルのリストを含む可能性があります。

## 評価

base64 エンコーディング、16 進数表現、URL エンコーディング、エスケープシーケンス、ワイド文字、XOR などのよくあるデータ難読化手法などの方法を使用してエンコードされたデータの特定とデコードを試みます。tar や zip などの圧縮ファイルを特定して展開することも考慮してください。これらの方法は機密データをわかりにくくしますが、保護するものではありません。

抽出されたデータから鍵、パスワード、アプリに入力された任意の機密データなどのアイテムを探します。このような機密データを見つけることができた場合、そのテストケースは不合格です。
---
title: WebView のデバッグが有効 (Debugging Enabled for WebViews)
platform: android
id: MASTG-TEST-0227
type: [static]
weakness: MASWE-0067
best-practices: [MASTG-BEST-0008]
profiles: [R]
---

## 概要

`WebView.setWebContentsDebuggingEnabled(true)` API はアプリケーション内の **すべて** の WebView に対してデバッグを有効にします。この機能は開発時には便利ですが、本番で有効のままにしておくと重大なセキュリティリスクをもたらします。有効にすると、接続された PC はアプリケーション内の任意の WebView 内の通信をデバッグ、盗聴、改変できます。詳細については ["Android ドキュメント"](https://developer.chrome.com/docs/devtools/remote-debugging/webviews/#configure_webviews_for_debugging) をご覧ください。

このフラグは `AndroidManifest.xml` の `debuggable` 属性とは独立して機能することに注意してください ([AndroidManifest で有効になっているデバッグフラグ (Debuggable Flag Enabled in the AndroidManifest)](MASTG-TEST-0226.md) を参照)。アプリが debuggable としてマークされていない場合でも、この API を呼び出すことで依然として WebView をデバッグできます。

## 手順

1. アプリバイナリに対して [re-flutter](../../../tools/generic/MAS


 {
	m0 := &v2.MetricPoint{
		Name:		key + ".value",
		Value:		float64(counter.Value),
		Timestamp:	now,
		Tags:		tags,
	}
	m1 := &v2.MetricPoint{
		Name:		key + ".per_second",
		Value:		float64(counter.PerSecond),
		Timestamp:	now,
		Tags:		tags,
	}
	points := []*v2.MetricPoint{m0, m1}
	return points
}

func composeTimerPoints(timer gostatsd.Timer, key string, tags []*v2.MetricTag, now int64) []*v2.MetricPoint {
	m0 := &v2.MetricPoint{
		Name:		key + ".min",
		Value:		timer.Min,
		Timestamp:	now,
		Tags:		tags,
	}
	m1 := &v2.MetricPoint{
		Name:		key + ".max",
		Value:		timer.Max,
		Timestamp:	now,
		Tags:		tags,
	}
	m2 := &v2.MetricPoint{
		Name:		key + ".count",
		Value:		float64(timer.Count),
		Timestamp:	now,
		Tags:		tags,
	}
	m3 := &v2.MetricPoint{
		Name:		key + ".per_second",
		Value:		timer.PerSecond,
		Timestamp:	now,
		Tags:		tags,
	}
	m4 := &v2.MetricPoint{
		Name:		key + ".mean",
		Value:		timer.Mean,
		Timestamp:	now,
		Tags:		tags,
	}
	m5 := &v2.MetricPoint{
		Name:		key + ".median",
		Value:		timer.Median,
		Timestamp:	now,
		Tags:		tags,
	}
	m6 := &v2.MetricPoint{
		Name:		key + ".stddev",
		Value:		timer.StdDev,
		Timestamp:	now,
		Tags:		tags,
	}
	m7 := &v2.MetricPoint{
		Name:		key + ".sum",
		Value:		timer.Sum,
		Timestamp:	now,
		Tags:		tags,
	}
	m8 := &v2.MetricPoint{
		Name:		key + ".sum_squares",
		Value:		timer.SumSquares,
		Timestamp:	now,
		Tags:		tags,
	}
	points := []*v2.MetricPoint{m0, m1, m2, m3, m4, m5, m6, m7, m8}
	for _, pct := range timer.Percentiles {
		m := &v2.MetricPoint{
			Name:		key + ".percentile_" + pct.Str,
			Value:		pct.Float,
			Timestamp:	now,
			Tags:		tags,
		}
		points = append(points, m)
	}
	return points
}

func composeGaugePoints(gauge gostatsd.Gauge, key string, tags []*v2.MetricTag, now int64) []*v2.MetricPoint {
	m0 := &v2.MetricPoint{
		Name:		key + ".value",
		Value:		float64(gauge.Value),
		Timestamp:	now,
		Tags:		tags,
	}
	points := []*v2.MetricPoint{m0}
	return points
}

func composeSetPoints(set gostatsd.Set, key string, tags []*v2.MetricTag, now int64) []*v2.MetricPoint {
	m0 := &v2.MetricPoint{
		Name:		key + ".value",
		Value:		float64(len(set.Values)),
		Timestamp:	now,
		Tags:		tags,
	}
	points := []*v2.MetricPoint{m0}
	return points
}
package integration

import (
	"context"
	"fmt"
	"testing"

	"github.com/graphql-go/graphql/language/ast"
	"github.com/sensu/sensu-go/graphql"
	schema "github.com/sensu/sensu-go/graphql/integration/testdata"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestExerciseServic


thub.com/stretchr/testify/require"
)

// TestDescriptorProtoString is to make sure gogo/protobuf is able to text
// marshal a protobuf struct has child field of type EnumMetadata
func TestDescriptorProtoString(t *testing.T) {
	enumMembers := []string{"hi", "hello"}
	enumType := types.MakeEnum(typedesc.TypeIDToOID(500), typedesc.TypeIDToOID(100500))
	enumType.TypeMeta = types.UserDefinedTypeMetadata{
		Name: &types.UserDefinedTypeName{
			Schema: "test",
			Name:   "greeting",
		},
		EnumData: &types.EnumMetadata{
			LogicalRepresentations: enumMembers,
			PhysicalRepresentations: [][]byte{
				{0x42, 0x1},
				{0x42},
			},
			IsMemberReadOnly: make([]bool, len(enumMembers)),
		},
	}
	desc := &descpb.ColumnDescriptor{
		Name: "c",
		ID:   1,
		Type: enumType,
	}

	var str string
	require.NotPanics(t, func() { str = desc.String() })
	// Assert we only dump InternalType from types.T without metadata
	require.Contains(t, str, "type:<family")
	require.NotContains(t, str, "TypeMeta:<Name")
}
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package types

import (
	"bytes"
	"fmt"
	"reflect"
	"testing"

	"github.com/cockroachdb/cockroach/pkg/geo/geopb"
	"github.com/cockroachdb/cockroach/pkg/sql/oidext"
	"github.com/cockroachdb/cockroach/pkg/util/protoutil"
	"github.com/lib/pq/oid"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestTypes(t *testing.T) {
	enCollate := "en"

	testCases := []struct {
		actual   *T
		expected *T
	}{
		// ARRAY
		{MakeArray(Any), AnyArray},
		{MakeArray(Any), &T{InternalType: InternalType{
			Family: ArrayFamily, ArrayContents: Any, Oid: oid.T_anyarray, Locale: &emptyLocale}}},

		{MakeArray(Float), FloatArray},
		{MakeArray(Float), &T{InternalType: InternalType{
			Family: ArrayFamily, ArrayContents: Float, Oid: oid.T__float8, Locale: &emptyLocale}}},

		{MakeArray(Decimal), DecimalArray},
		{MakeArray(Decimal), &T{InternalType: InternalType{
			Family: ArrayFamily, ArrayContents: Decimal, Oid: oid.T__numeric, Locale: &emptyLocale}}},

		{MakeArray(Int), IntArray},
		{MakeArray(Int), &T{InternalType: InternalType{
			Family: ArrayFamily, ArrayContents: Int, Oid: oid.T__int8, Locale: &emptyLocale}}},
		{MakeArray(MakeArray(Int)), &T{InternalType: InternalType{
			Family: ArrayFamily, ArrayContents: IntArray, Oid: oid.T__int8, Locale: &emptyLocale}}},

		{Int2Vector, &T{InternalType: InternalType{
			Family: ArrayFamily, Oid: oid.T_int2vector, ArrayContents: Int2, Locale: &emptyLocale}}},


# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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.
#
from collections import OrderedDict

from .base import CustomAudienceServiceTransport
from .grpc import CustomAudienceServiceGrpcTransport
from .grpc_asyncio import CustomAudienceServiceGrpcAsyncIOTransport

# Compile a registry of transports.
_transport_registry = (
    OrderedDict()
)  # type: Dict[str, Type[CustomAudienceServiceTransport]]
_transport_registry["grpc"] = CustomAudienceServiceGrpcTransport
_transport_registry["grpc_asyncio"] = CustomAudienceServiceGrpcAsyncIOTransport

__all__ = (
    "CustomAudienceServiceTransport",
    "CustomAudienceServiceGrpcTransport",
    "CustomAudienceServiceGrpcAsyncIOTransport",
)


=1, C_DocType_ID=1
		helper.addToPrintQueue("02", 1, 2); // AD_Org_ID=1, C_DocType_ID=2
		helper.addToPrintQueue("03", 1, 3); // AD_Org_ID=1, C_DocType_ID=3

		//
		// Setup expected result
		// task 08958: we want the paged in the order of out print job line. i.e. two lines shall *not* be aggregated into one, just because they match.
		// that is because we need a straight forward ordering and that is more important than minimizing the number of print jobs.
		final byte[] pdfDataExpected = new PdfCollator()
				.addPages(helper.getPdf("01"), 1, 2)
				.addPages(helper.getPdf("02"), 3, 4)
				.addPages(helper.getPdf("03"), 5, 6)
				.toByteArray();

		final int printJobsCountExpected = 1;

		//
		// Execute Test
		executeGenericTest(printJobsCountExpected, pdfDataExpected);
	}

	private void executeGenericTest(final int printJobsCountExpected, final byte[] pdfDataExpected)
	{
		helper.createAllPrintJobs();

		final int printJobsCountActual = POJOLookupMap.get().getRecords(I_C_Print_Job.class).size();
		Assert.assertEquals("Invalid Print Jobs count", printJobsCountExpected, printJobsCountActual);
		assumePrintJobInstructions(X_C_Print_Job_Instructions.STATUS_Pending);

		final I_C_Print_Job printJobExpected = null; // we don't know what print job(s) were created
		helper.createNextPrintPackageAndTest(printJobExpected, pdfDataExpected);

		assumePrintQueueProcessed();
		assumePrintJobsProcessed();
		assumePrintJobInstructions(X_C_Print_Job_Instructions.STATUS_Send);
		helper.assumeNothingLocked();
	}

	@Test
	public void test_TwoPrintJobsCreated()
	{
		//
		// Setup routings
		helper.createPrinterRouting("printer01", "tray01", 10, -1, -1, -1);

		//
		// Create printing queue
		helper.addToPrintQueue("01", 1, -1); // AD_Org_ID=1, C_DocType_ID=N/A
		helper.addToPrintQueue("02", 2, -1); // AD_Org_ID=2, C_DocType_ID=N/A

		//
		// Setup expected PDFs
		final List<byte[]> pdfDataExpected = new ArrayList<>();
		pdfDataExpected.add(new PdfCollator()
				.addPages(helper.getPdf("01"), 1, 20)
				.toByteArray()
		);
		pdfDataExpected.add(new PdfCollator()
				.addPages(helper.getPdf("02"), 1, 20)
				.toByteArray()
		);

		// when
		helper.createAllPrintJobs();

		// then
		final List<I_C_Print_Job> printJobs = helper.getDB().getRecords(I_C_Print_Job.class);
		assertThat(printJobs).as("Invalid Print Jobs count").hasSize(2);

		for (int i = 0; i < printJobs.size(); i++)
		{
			helper.createNextPrintPackageAndTest(printJobs.get(i), pdfDataExpected.get(i));
		}
	}

	@Test
	public void test_TwoPrintJobs_SecondOneIsUsedBecauseFirstOneFails()
	{
		//
		// Setup routings
		final I_AD_PrinterRouting routing1 = helper.createPrinterRouting("printer01", "tray01", 10, -1, -1, -1);
		routing1.setAD_Org_ID(1);
		helper.getDB().save(routing1);
		final I_AD_PrinterRouting routing2 = helper.createPrinterRouting("printer02", "tray01", 10, -1, -1, -1);
		routing2.setAD_Org_ID(2);
		helper.getDB().save(routing2);

		//
		// Create printing que


angeScripttype()
{

}

void CScriptTypes::OnSelchangeScripttype()
{
	CIniFile& ini=Map->GetIniFile();

	int sel=m_Action.GetCurSel();
	while(m_Action.DeleteString(0)!=CB_ERR);

	CString Scripttype;
	if(m_ScriptType.GetCurSel()<0) return;
	m_ScriptType.GetLBText(m_ScriptType.GetCurSel(), Scripttype);
	TruncSpace(Scripttype);

	m_Name=ini.sections[(LPCTSTR)Scripttype].values["Name"];

	int count=ini.sections[(LPCTSTR)Scripttype].values.size()-1;
	int i;
	for(i=0;i<count;i++)
	{
		char c[50];
		itoa(i,c,10);
		m_Action.AddString(c);
	}

	m_Action.SetCurSel(0);
	if(sel>=0) m_Action.SetCurSel(sel);
	OnSelchangeAction();

	UpdateData(FALSE);
}

void CScriptTypes::OnSelchangeAction()
{
	CIniFile& ini=Map->GetIniFile();

	CString Scripttype;
	char action[50];
	if(m_ScriptType.GetCurSel()<0) return;
	if(m_Action.GetCurSel()<0) return;
	m_ScriptType.GetLBText(m_ScriptType.GetCurSel(), Scripttype);
	TruncSpace(Scripttype);

	itoa(m_Action.GetCurSel(), action, 10);
	//m_Type.SetWindowText(GetParam(ini.sections[(LPCTSTR)Scripttype].values[action],0));
	m_Type.SetCurSel(atoi(GetParam(ini.sections[(LPCTSTR)Scripttype].values[action], 0)));

	OnSelchangeType();

	m_Param.SetWindowText(GetParam(ini.sections[(LPCTSTR)Scripttype].values[action],1));

}

void CScriptTypes::OnChangeName()
{
	CIniFile& ini=Map->GetIniFile();

	UpdateData();

	CEdit* n=(CEdit*)GetDlgItem(IDC_NAME);

	DWORD pos=n->GetSel();
	CString Scripttype;
	if(m_ScriptType.GetCurSel()<0) return;
	m_ScriptType.GetLBText(m_ScriptType.GetCurSel(), Scripttype);
	TruncSpace(Scripttype);

	ini.sections[(LPCTSTR)Scripttype].values["Name"]=m_Name;

	UpdateDialog();
	n->SetSel(pos);
}

void CScriptTypes::OnEditchangeType()
{
	CIniFile& ini=Map->GetIniFile();

	while(m_Param.DeleteString(0)!=CB_ERR);
	CString Scripttype;
	char action[50];
	if(m_Action.GetCurSel()<0) return;
	if(m_ScriptType.GetCurSel()<0) return;
	m_ScriptType.GetLBText(m_ScriptType.GetCurSel(), Scripttype);
	TruncSpace(Scripttype);

	//CString type;
	//m_Type.GetWindowText(type);
	//TruncSpace(type);
	//MessageBox("beep");
	int type=m_Type.GetCurSel();

	int i;
	char tmp[50];

	switch(type)
	{
	case 0:
		ListTargets(m_Param);
		m_Desc.SetWindowText("Target:");
		break;
	case 39:
	case 40:
		ListGlobals(m_Param);
		break;

	case 11:
		ListBehaviours(m_Param);
		break;
	case 1:
	case 3:
	case 16:
		ListWaypoints(m_Param);
		m_Desc.SetWindowText("Waypoint:");
		break;
	case 4:
		m_Desc.SetWindo


ell_map ~= 'ElementalEnfeeble' and spell.english ~= 'Impact' then
		if state.MagicBurstMode.value ~= 'Off' then
			if state.CastingMode.value:contains('Resistant') and sets.ResistantMagicBurst then
				equip(sets.ResistantMagicBurst)
			else
				equip(sets.MagicBurst)
			end
		end
		if spell.element == world.weather_element or spell.element == world.day_element then
			if state.CastingMode.value == 'Fodder' then
				-- if item_available('Twilight Cape') and not LowTierNukes:contains(spell.english) and not state.Capacity.value then
					-- sets.TwilightCape = {back="Twilight Cape"}
					-- equip(sets.TwilightCape)
				-- end
				if spell.element == world.day_element then
					if item_available('Zodiac Ring') then
						sets.ZodiacRing = {ring2="Zodiac Ring"}
						equip(sets.ZodiacRing)
					end
				end
			end
		end

		if spell.element and sets.element[spell.element] then
			equip(sets.element[spell.element])
		end

		if state.RecoverMode.value ~= 'Never' and (state.RecoverMode.value == 'Always' or tonumber(state.RecoverMode.value:sub(1, -2)) > player.mpp) then
			if state.MagicBurstMode.value ~= 'Off' then
				if state.CastingMode.value:contains('Resistant') and sets.ResistantRecoverBurst then
					equip(sets.ResistantRecoverBurst)
				elseif sets.RecoverBurst then
					equip(sets.RecoverBurst)
				end
			elseif sets.RecoverMP then
				equip(sets.RecoverMP)
			end
		end

    elseif spell.skill == 'Geomancy' then
		if spell.english:startswith('Geo-') then
			if state.Buff['Blaze of Glory'] and sets.buff['Blaze of Glory'] then
				equip(sets.buff['Blaze of Glory'])
				disable('head')
				blazelocked = true
			end
		elseif state.Buff.Entrust and spell.english:startswith('Indi-') then
			if sets.midcast.Geomancy.main == 'Idris' and item_available('Solstice') then
				equip({main="Solstice"})
			end
		end
    end

end

function job_aftercast(spell, spellMap, eventArgs)
    if not spell.interrupted then
        if spell.english:startswith('Indi-') then
            if spell.target.type == 'SELF' then
                last_indi = string.sub(spell.english,6)
            end
            if not classes.CustomIdleGroups:contains('Indi') then
                classes.CustomIdleGroups:append('Indi')
            end
			if state.UseCustomTimers.value then
				send_command('@timers d "'..spell.target.name..': '..indi_timer..'"')
				indi_timer = spell.english
				send_command('@timers c "'..spell.target.name..': '..indi_timer..'" '..indi_duration..' down spells/00136.png')
			end
		elseif spell.english:startswith('Geo-') or spell.english == "Mending Halation" or spell.english == "Radial Arcana" then
			eventArgs.handled = true
			if spell.english:startswith('Geo-') then
				last_geo = string.sub(spell.english,5)
			end
        elseif state.UseCustomTimers.value and spell.english == 'Sleep' or spell.english == 'Sleepga' then
            send_command('@timers c "'..spell.english..' ['..spell.target.name..']" 60 down spells/00220.png')
        elseif state.UseCustomTimers.value and spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
            send_command('@timers c "'..spell.english..' ['..spell.target.name..']" 90 down spells/00220.png')
        elseif spell.skill == 'Elemental Magic' and state.MagicBurstMode.value


/// <param name="x"></param>
		/// <param name="y"></param>
		/// <param name="w"></param>
		/// <param name="h"></param>
		/// <param name="backColor"></param>
		public void SubImage(int x, int y, int w, int h, ColorRgba backColor)
		{
			PixelData tempLayer = new PixelData(w, h, backColor);
			this.DrawOnto(tempLayer, BlendMode.Solid, -x, -y);
			this.width = tempLayer.width;
			this.height = tempLayer.height;
			this.data = tempLayer.data;
		}
		/// <summary>
		/// Crops the Layer, removing transparent / empty border areas.
		/// </summary>
		/// <param name="cropX">Whether the Layer should be cropped in X-direction</param>
		/// <param name="cropY">Whether the Layer should be cropped in Y-direction</param>
		public void Crop(bool cropX = true, bool cropY = true)
		{
			if (!cropX && !cropY) return;
			Point2 topLeft;
			Point2 size;
			this.GetOpaqueBoundaries(out topLeft, out size);
			this.SubImage(
				cropX ? topLeft.X : 0,
				cropY ? topLeft.Y : 0,
				cropX ? size.X : this.width,
				cropY ? size.Y : this.height);
		}

		/// <summary>
		/// Measures the bounding rectangle of the Layers opaque pixels.
		/// </summary>
		/// <param name="topLeft"></param>
		/// <param name="size"></param>
		public void GetOpaqueBoundaries(out Point2 topLeft, out Point2 size)
		{
			topLeft = new Point2(this.width, this.height);
			size = new Point2(0, 0);

			for (int i = 0; i < this.data.Length; i++)
			{
				if (this.data[i].A == 0) continue;
				int cX = i % this.width;
				int cY = i / this.width;
				topLeft.X = Math.Min(topLeft.X, cX);
				topLeft.Y = Math.Min(topLeft.Y, cY);
				size.X = Math.Max(size.X, cX);
				size.Y = Math.Max(size.Y, cY);
			}
			size.X = 1 + Math.Max(0, size.X - topLeft.X);
			size.Y = 1 + Math.Max(0, size.Y - topLeft.Y);
		}
		/// <summary>
		/// Determines the average color of a Layer.
		/// </summary>
		/// <param name="weightTransparent">If true, the alpha value weights a pixels color value. </param>
		public ColorRgba GetAverageColor(bool weightTransparent = true)
		{
			float[] sum = new float[4];
			int count = 0;

			if (weightTransparent)
			{
				for (int i = 0; i < this.data.Length; i++)
				{
					sum[0] += this.data[i].R * ((float)this.data[i].A / 255.0f);
					sum[1] += this.data[i].G * ((float)this.data[i].A / 255.0f);
					sum[2] += this.data[i].B * ((float)this.data[i].A / 255.0f);
					sum[3] += (float)this.data[i].A / 255.0f;
					++count;
				}
				if (sum[3] <= 0.001f) return ColorRgba.TransparentBlack;